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: lexicographic combination of reduction pairs: 1. weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: rev2#_A(x1,x2) = ((1,0),(0,0)) x2 + (2,1) cons_A(x1,x2) = ((1,0),(0,0)) x2 + (3,0) rev#_A(x1) = ((1,0),(1,1)) x1 + (1,2) rev2_A(x1,x2) = ((0,0),(1,0)) x1 + ((1,0),(1,1)) x2 rev_A(x1) = ((1,0),(0,0)) x1 rev1_A(x1,x2) = (0,2) |0|_A() = (0,1) nil_A() = (0,0) s_A(x1) = (0,1) precedence: rev2 = rev = rev1 > rev2# = cons > rev# = |0| = nil = s partial status: pi(rev2#) = [] pi(cons) = [] pi(rev#) = [1] pi(rev2) = [2] pi(rev) = [] pi(rev1) = [] pi(|0|) = [] pi(nil) = [] pi(s) = [] 2. weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: rev2#_A(x1,x2) = (0,0) cons_A(x1,x2) = (1,0) rev#_A(x1) = (0,0) rev2_A(x1,x2) = ((0,0),(1,0)) x2 + (3,3) rev_A(x1) = (2,2) rev1_A(x1,x2) = (0,0) |0|_A() = (2,2) nil_A() = (1,1) s_A(x1) = (0,0) precedence: rev2 > rev > rev1 = |0| = nil > rev2# = cons = rev# = 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, p3 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: lexicographic combination of reduction pairs: 1. weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: rev#_A(x1) = ((1,0),(1,0)) x1 + (1,1) cons_A(x1,x2) = ((1,0),(0,0)) x2 + (4,2) rev2#_A(x1,x2) = x2 + (2,4) rev_A(x1) = x1 rev2_A(x1,x2) = ((0,0),(1,0)) x1 + x2 rev1_A(x1,x2) = ((0,0),(1,0)) x2 + (3,3) |0|_A() = (2,2) nil_A() = (1,1) s_A(x1) = (3,3) precedence: rev# = cons = rev2# = rev = rev2 = rev1 = |0| = nil = s partial status: pi(rev#) = [] pi(cons) = [] pi(rev2#) = [] pi(rev) = [] pi(rev2) = [] pi(rev1) = [] pi(|0|) = [] pi(nil) = [] pi(s) = [] 2. weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: rev#_A(x1) = (0,0) cons_A(x1,x2) = (3,2) rev2#_A(x1,x2) = ((1,0),(1,1)) x2 + (2,1) rev_A(x1) = (4,3) rev2_A(x1,x2) = ((0,0),(1,0)) x2 + (6,7) rev1_A(x1,x2) = (0,1) |0|_A() = (0,0) nil_A() = (1,9) s_A(x1) = (0,0) precedence: rev2 > rev > s > nil > rev# = cons = rev2# = rev1 = |0| 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: lexicographic combination of reduction pairs: 1. 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) = x1 + x2 + (2,2) precedence: rev1# = cons partial status: pi(rev1#) = [] pi(cons) = [] 2. weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: rev1#_A(x1,x2) = (0,0) cons_A(x1,x2) = (1,1) precedence: rev1# = cons partial status: pi(rev1#) = [] pi(cons) = [] The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains.