YES We show the termination of the TRS R: a__from(X) -> cons(mark(X),from(s(X))) a__length(nil()) -> |0|() a__length(cons(X,Y)) -> s(a__length1(Y)) a__length1(X) -> a__length(X) mark(from(X)) -> a__from(mark(X)) mark(length(X)) -> a__length(X) mark(length1(X)) -> a__length1(X) mark(cons(X1,X2)) -> cons(mark(X1),X2) mark(s(X)) -> s(mark(X)) mark(nil()) -> nil() mark(|0|()) -> |0|() a__from(X) -> from(X) a__length(X) -> length(X) a__length1(X) -> length1(X) -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: a__from#(X) -> mark#(X) p2: a__length#(cons(X,Y)) -> a__length1#(Y) p3: a__length1#(X) -> a__length#(X) p4: mark#(from(X)) -> a__from#(mark(X)) p5: mark#(from(X)) -> mark#(X) p6: mark#(length(X)) -> a__length#(X) p7: mark#(length1(X)) -> a__length1#(X) p8: mark#(cons(X1,X2)) -> mark#(X1) p9: mark#(s(X)) -> mark#(X) and R consists of: r1: a__from(X) -> cons(mark(X),from(s(X))) r2: a__length(nil()) -> |0|() r3: a__length(cons(X,Y)) -> s(a__length1(Y)) r4: a__length1(X) -> a__length(X) r5: mark(from(X)) -> a__from(mark(X)) r6: mark(length(X)) -> a__length(X) r7: mark(length1(X)) -> a__length1(X) r8: mark(cons(X1,X2)) -> cons(mark(X1),X2) r9: mark(s(X)) -> s(mark(X)) r10: mark(nil()) -> nil() r11: mark(|0|()) -> |0|() r12: a__from(X) -> from(X) r13: a__length(X) -> length(X) r14: a__length1(X) -> length1(X) The estimated dependency graph contains the following SCCs: {p1, p4, p5, p8, p9} {p2, p3} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: a__from#(X) -> mark#(X) p2: mark#(s(X)) -> mark#(X) p3: mark#(cons(X1,X2)) -> mark#(X1) p4: mark#(from(X)) -> mark#(X) p5: mark#(from(X)) -> a__from#(mark(X)) and R consists of: r1: a__from(X) -> cons(mark(X),from(s(X))) r2: a__length(nil()) -> |0|() r3: a__length(cons(X,Y)) -> s(a__length1(Y)) r4: a__length1(X) -> a__length(X) r5: mark(from(X)) -> a__from(mark(X)) r6: mark(length(X)) -> a__length(X) r7: mark(length1(X)) -> a__length1(X) r8: mark(cons(X1,X2)) -> cons(mark(X1),X2) r9: mark(s(X)) -> s(mark(X)) r10: mark(nil()) -> nil() r11: mark(|0|()) -> |0|() r12: a__from(X) -> from(X) r13: a__length(X) -> length(X) r14: a__length1(X) -> length1(X) The set of usable rules consists of r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13, r14 Take the reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: max/plus interpretations on natural numbers: a__from#_A(x1) = max{11, x1 + 5} mark#_A(x1) = x1 + 5 s_A(x1) = max{2, x1} cons_A(x1,x2) = max{14, x1 + 4, x2} from_A(x1) = max{13, x1 + 12} mark_A(x1) = x1 + 6 a__from_A(x1) = max{14, x1 + 12} a__length_A(x1) = max{5, x1} nil_A = 7 |0|_A = 6 a__length1_A(x1) = max{5, x1} length_A(x1) = max{5, x1} length1_A(x1) = max{1, x1} precedence: a__from# = mark = nil = |0| > a__from > cons > from = a__length1 > s = a__length > mark# = length = length1 partial status: pi(a__from#) = [1] pi(mark#) = [1] pi(s) = [1] pi(cons) = [1, 2] pi(from) = [1] pi(mark) = [1] pi(a__from) = [1] pi(a__length) = [1] pi(nil) = [] pi(|0|) = [] pi(a__length1) = [1] pi(length) = [1] pi(length1) = [1] 2. weighted path order base order: max/plus interpretations on natural numbers: a__from#_A(x1) = x1 + 26 mark#_A(x1) = max{25, x1 + 22} s_A(x1) = x1 + 21 cons_A(x1,x2) = max{x1 + 10, x2 + 8} from_A(x1) = x1 + 5 mark_A(x1) = x1 a__from_A(x1) = x1 + 6 a__length_A(x1) = max{10, x1 + 9} nil_A = 10 |0|_A = 11 a__length1_A(x1) = max{9, x1 + 8} length_A(x1) = x1 + 1 length1_A(x1) = x1 + 1 precedence: a__from# > mark# = s = cons = from > mark > a__from = a__length = nil = |0| = a__length1 = length = length1 partial status: pi(a__from#) = [] pi(mark#) = [1] pi(s) = [1] pi(cons) = [] pi(from) = [1] pi(mark) = [1] pi(a__from) = [] pi(a__length) = [1] pi(nil) = [] pi(|0|) = [] pi(a__length1) = [1] pi(length) = [1] pi(length1) = [1] The next rules are strictly ordered: p1, p2, p3, p4, p5 We remove them from the problem. Then no dependency pair remains. -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: a__length#(cons(X,Y)) -> a__length1#(Y) p2: a__length1#(X) -> a__length#(X) and R consists of: r1: a__from(X) -> cons(mark(X),from(s(X))) r2: a__length(nil()) -> |0|() r3: a__length(cons(X,Y)) -> s(a__length1(Y)) r4: a__length1(X) -> a__length(X) r5: mark(from(X)) -> a__from(mark(X)) r6: mark(length(X)) -> a__length(X) r7: mark(length1(X)) -> a__length1(X) r8: mark(cons(X1,X2)) -> cons(mark(X1),X2) r9: mark(s(X)) -> s(mark(X)) r10: mark(nil()) -> nil() r11: mark(|0|()) -> |0|() r12: a__from(X) -> from(X) r13: a__length(X) -> length(X) r14: a__length1(X) -> length1(X) The set of usable rules consists of (no rules) Take the reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: max/plus interpretations on natural numbers: a__length#_A(x1) = max{5, x1 + 3} cons_A(x1,x2) = max{x1 - 1, x2 + 3} a__length1#_A(x1) = max{6, x1 + 4} precedence: a__length# = cons = a__length1# partial status: pi(a__length#) = [1] pi(cons) = [2] pi(a__length1#) = [1] 2. weighted path order base order: max/plus interpretations on natural numbers: a__length#_A(x1) = x1 + 3 cons_A(x1,x2) = x2 + 1 a__length1#_A(x1) = x1 + 4 precedence: a__length# = cons = a__length1# partial status: pi(a__length#) = [1] pi(cons) = [2] pi(a__length1#) = [1] The next rules are strictly ordered: p1, p2 We remove them from the problem. Then no dependency pair remains.