YES We show the termination of the TRS R: rev1(|0|(),nil()) -> |0|() rev1(s(X),nil()) -> s(X) rev1(X,cons(Y,L)) -> rev1(Y,L) rev(nil()) -> nil() rev(cons(X,L)) -> cons(rev1(X,L),rev2(X,L)) rev2(X,nil()) -> nil() rev2(X,cons(Y,L)) -> rev(cons(X,rev(rev2(Y,L)))) -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: rev1#(X,cons(Y,L)) -> rev1#(Y,L) p2: rev#(cons(X,L)) -> rev1#(X,L) p3: rev#(cons(X,L)) -> rev2#(X,L) p4: rev2#(X,cons(Y,L)) -> rev#(cons(X,rev(rev2(Y,L)))) p5: rev2#(X,cons(Y,L)) -> rev#(rev2(Y,L)) p6: rev2#(X,cons(Y,L)) -> rev2#(Y,L) and R consists of: r1: rev1(|0|(),nil()) -> |0|() r2: rev1(s(X),nil()) -> s(X) r3: rev1(X,cons(Y,L)) -> rev1(Y,L) r4: rev(nil()) -> nil() r5: rev(cons(X,L)) -> cons(rev1(X,L),rev2(X,L)) r6: rev2(X,nil()) -> nil() r7: rev2(X,cons(Y,L)) -> rev(cons(X,rev(rev2(Y,L)))) The estimated dependency graph contains the following SCCs: {p3, p4, p5, p6} {p1} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: rev2#(X,cons(Y,L)) -> rev#(rev2(Y,L)) p2: rev#(cons(X,L)) -> rev2#(X,L) p3: rev2#(X,cons(Y,L)) -> rev2#(Y,L) p4: rev2#(X,cons(Y,L)) -> rev#(cons(X,rev(rev2(Y,L)))) and R consists of: r1: rev1(|0|(),nil()) -> |0|() r2: rev1(s(X),nil()) -> s(X) r3: rev1(X,cons(Y,L)) -> rev1(Y,L) r4: rev(nil()) -> nil() r5: rev(cons(X,L)) -> cons(rev1(X,L),rev2(X,L)) r6: rev2(X,nil()) -> nil() r7: rev2(X,cons(Y,L)) -> rev(cons(X,rev(rev2(Y,L)))) The set of usable rules consists of r1, r2, r3, r4, r5, r6, r7 Take the reduction pair: weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: rev2#_A(x1,x2) = ((1,0),(1,0)) x2 + (2,0) cons_A(x1,x2) = ((1,0),(1,0)) x2 + (5,0) rev#_A(x1) = x1 + (1,1) rev2_A(x1,x2) = ((1,0),(1,0)) x2 + (0,2) rev_A(x1) = ((1,0),(1,0)) x1 + (0,1) rev1_A(x1,x2) = (4,7) |0|_A() = (1,2) nil_A() = (2,1) s_A(x1) = (3,8) precedence: rev2 > rev > cons > rev2# = rev# > rev1 = |0| = nil = s partial status: pi(rev2#) = [] pi(cons) = [] pi(rev#) = [] pi(rev2) = [] pi(rev) = [] pi(rev1) = [] pi(|0|) = [] pi(nil) = [] pi(s) = [] The next rules are strictly ordered: p3 We remove them from the problem. -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: rev2#(X,cons(Y,L)) -> rev#(rev2(Y,L)) p2: rev#(cons(X,L)) -> rev2#(X,L) p3: rev2#(X,cons(Y,L)) -> rev#(cons(X,rev(rev2(Y,L)))) and R consists of: r1: rev1(|0|(),nil()) -> |0|() r2: rev1(s(X),nil()) -> s(X) r3: rev1(X,cons(Y,L)) -> rev1(Y,L) r4: rev(nil()) -> nil() r5: rev(cons(X,L)) -> cons(rev1(X,L),rev2(X,L)) r6: rev2(X,nil()) -> nil() r7: rev2(X,cons(Y,L)) -> rev(cons(X,rev(rev2(Y,L)))) The estimated dependency graph contains the following SCCs: {p1, p2, p3} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: rev2#(X,cons(Y,L)) -> rev#(rev2(Y,L)) p2: rev#(cons(X,L)) -> rev2#(X,L) p3: rev2#(X,cons(Y,L)) -> rev#(cons(X,rev(rev2(Y,L)))) and R consists of: r1: rev1(|0|(),nil()) -> |0|() r2: rev1(s(X),nil()) -> s(X) r3: rev1(X,cons(Y,L)) -> rev1(Y,L) r4: rev(nil()) -> nil() r5: rev(cons(X,L)) -> cons(rev1(X,L),rev2(X,L)) r6: rev2(X,nil()) -> nil() r7: rev2(X,cons(Y,L)) -> rev(cons(X,rev(rev2(Y,L)))) The set of usable rules consists of r1, r2, r3, r4, r5, r6, r7 Take the reduction pair: weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: rev2#_A(x1,x2) = ((0,0),(1,0)) x1 + ((1,0),(1,0)) x2 + (4,4) cons_A(x1,x2) = ((0,0),(1,0)) x1 + ((1,0),(0,0)) x2 + (3,1) rev#_A(x1) = ((1,0),(0,0)) x1 + (2,8) rev2_A(x1,x2) = ((1,0),(0,0)) x2 + (0,7) rev_A(x1) = ((1,0),(0,0)) x1 + (0,6) rev1_A(x1,x2) = (4,0) |0|_A() = (1,6) nil_A() = (0,5) s_A(x1) = (1,1) precedence: rev2# = cons = rev# = rev2 = rev = rev1 = |0| = nil = s partial status: pi(rev2#) = [] pi(cons) = [] pi(rev#) = [] pi(rev2) = [] pi(rev) = [] pi(rev1) = [] pi(|0|) = [] pi(nil) = [] pi(s) = [] The next rules are strictly ordered: p1 We remove them from the problem. -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: rev#(cons(X,L)) -> rev2#(X,L) p2: rev2#(X,cons(Y,L)) -> rev#(cons(X,rev(rev2(Y,L)))) and R consists of: r1: rev1(|0|(),nil()) -> |0|() r2: rev1(s(X),nil()) -> s(X) r3: rev1(X,cons(Y,L)) -> rev1(Y,L) r4: rev(nil()) -> nil() r5: rev(cons(X,L)) -> cons(rev1(X,L),rev2(X,L)) r6: rev2(X,nil()) -> nil() r7: rev2(X,cons(Y,L)) -> rev(cons(X,rev(rev2(Y,L)))) The estimated dependency graph contains the following SCCs: {p1, p2} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: rev#(cons(X,L)) -> rev2#(X,L) p2: rev2#(X,cons(Y,L)) -> rev#(cons(X,rev(rev2(Y,L)))) and R consists of: r1: rev1(|0|(),nil()) -> |0|() r2: rev1(s(X),nil()) -> s(X) r3: rev1(X,cons(Y,L)) -> rev1(Y,L) r4: rev(nil()) -> nil() r5: rev(cons(X,L)) -> cons(rev1(X,L),rev2(X,L)) r6: rev2(X,nil()) -> nil() r7: rev2(X,cons(Y,L)) -> rev(cons(X,rev(rev2(Y,L)))) The set of usable rules consists of r1, r2, r3, r4, r5, r6, r7 Take the reduction pair: weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: rev#_A(x1) = ((1,0),(1,0)) x1 + (2,1) cons_A(x1,x2) = ((1,0),(0,0)) x2 + (3,3) rev2#_A(x1,x2) = ((1,0),(1,0)) x2 + (4,2) rev_A(x1) = ((1,0),(0,0)) x1 + (0,7) rev2_A(x1,x2) = ((0,0),(1,0)) x1 + x2 + (0,8) rev1_A(x1,x2) = ((1,0),(0,0)) x2 + (2,4) |0|_A() = (1,5) nil_A() = (2,6) s_A(x1) = (3,5) precedence: cons = rev = rev2 > rev2# = rev1 = s > |0| = nil > rev# partial status: pi(rev#) = [] pi(cons) = [] pi(rev2#) = [] pi(rev) = [] pi(rev2) = [] pi(rev1) = [] pi(|0|) = [] pi(nil) = [] pi(s) = [] The next rules are strictly ordered: p1 We remove them from the problem. -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: rev2#(X,cons(Y,L)) -> rev#(cons(X,rev(rev2(Y,L)))) and R consists of: r1: rev1(|0|(),nil()) -> |0|() r2: rev1(s(X),nil()) -> s(X) r3: rev1(X,cons(Y,L)) -> rev1(Y,L) r4: rev(nil()) -> nil() r5: rev(cons(X,L)) -> cons(rev1(X,L),rev2(X,L)) r6: rev2(X,nil()) -> nil() r7: rev2(X,cons(Y,L)) -> rev(cons(X,rev(rev2(Y,L)))) The estimated dependency graph contains the following SCCs: (no SCCs) -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: rev1#(X,cons(Y,L)) -> rev1#(Y,L) and R consists of: r1: rev1(|0|(),nil()) -> |0|() r2: rev1(s(X),nil()) -> s(X) r3: rev1(X,cons(Y,L)) -> rev1(Y,L) r4: rev(nil()) -> nil() r5: rev(cons(X,L)) -> cons(rev1(X,L),rev2(X,L)) r6: rev2(X,nil()) -> nil() r7: rev2(X,cons(Y,L)) -> rev(cons(X,rev(rev2(Y,L)))) The set of usable rules consists of (no rules) Take the reduction pair: weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: rev1#_A(x1,x2) = ((1,0),(1,1)) x2 + (1,1) cons_A(x1,x2) = ((1,0),(1,1)) x1 + x2 + (2,2) precedence: cons > rev1# partial status: pi(rev1#) = [2] pi(cons) = [2] The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains.