YES We show the termination of the TRS R: rev(nil()) -> nil() rev(cons(x,l)) -> cons(rev1(x,l),rev2(x,l)) rev1(|0|(),nil()) -> |0|() rev1(s(x),nil()) -> s(x) rev1(x,cons(y,l)) -> rev1(y,l) rev2(x,nil()) -> nil() rev2(x,cons(y,l)) -> rev(cons(x,rev2(y,l))) -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: rev#(cons(x,l)) -> rev1#(x,l) p2: rev#(cons(x,l)) -> rev2#(x,l) p3: rev1#(x,cons(y,l)) -> rev1#(y,l) p4: rev2#(x,cons(y,l)) -> rev#(cons(x,rev2(y,l))) p5: rev2#(x,cons(y,l)) -> rev2#(y,l) and R consists of: r1: rev(nil()) -> nil() r2: rev(cons(x,l)) -> cons(rev1(x,l),rev2(x,l)) r3: rev1(|0|(),nil()) -> |0|() r4: rev1(s(x),nil()) -> s(x) r5: rev1(x,cons(y,l)) -> rev1(y,l) r6: rev2(x,nil()) -> nil() r7: rev2(x,cons(y,l)) -> rev(cons(x,rev2(y,l))) The estimated dependency graph contains the following SCCs: {p2, p4, p5} {p3} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: rev2#(x,cons(y,l)) -> rev#(cons(x,rev2(y,l))) p2: rev#(cons(x,l)) -> rev2#(x,l) p3: rev2#(x,cons(y,l)) -> rev2#(y,l) and R consists of: r1: rev(nil()) -> nil() r2: rev(cons(x,l)) -> cons(rev1(x,l),rev2(x,l)) r3: rev1(|0|(),nil()) -> |0|() r4: rev1(s(x),nil()) -> s(x) r5: rev1(x,cons(y,l)) -> rev1(y,l) r6: rev2(x,nil()) -> nil() r7: rev2(x,cons(y,l)) -> rev(cons(x,rev2(y,l))) The set of usable rules consists of 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) = x2 + (2,5) cons_A(x1,x2) = x2 + (6,4) rev#_A(x1) = x1 + (1,2) rev2_A(x1,x2) = ((1,0),(1,0)) x2 + (0,2) rev1_A(x1,x2) = (2,0) |0|_A() = (2,0) nil_A() = (3,0) s_A(x1) = (1,1) rev_A(x1) = ((1,0),(1,0)) x1 + (0,1) precedence: rev2 > rev > cons > rev# > rev2# = s > rev1 > |0| = nil partial status: pi(rev2#) = [2] pi(cons) = [] pi(rev#) = [] pi(rev2) = [] pi(rev1) = [] pi(|0|) = [] pi(nil) = [] pi(s) = [] pi(rev) = [] 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) = (2,1) rev2_A(x1,x2) = (3,0) rev1_A(x1,x2) = (0,0) |0|_A() = (0,0) nil_A() = (1,0) s_A(x1) = (2,1) rev_A(x1) = (2,1) precedence: rev# > rev2# > s > cons = rev2 = rev1 = |0| = nil > rev partial status: pi(rev2#) = [] pi(cons) = [] pi(rev#) = [] pi(rev2) = [] pi(rev1) = [] pi(|0|) = [] pi(nil) = [] pi(s) = [] pi(rev) = [] The next rules are strictly ordered: p1, p2 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)) -> rev2#(y,l) and R consists of: r1: rev(nil()) -> nil() r2: rev(cons(x,l)) -> cons(rev1(x,l),rev2(x,l)) r3: rev1(|0|(),nil()) -> |0|() r4: rev1(s(x),nil()) -> s(x) r5: rev1(x,cons(y,l)) -> rev1(y,l) r6: rev2(x,nil()) -> nil() r7: rev2(x,cons(y,l)) -> rev(cons(x,rev2(y,l))) The estimated dependency graph contains the following SCCs: {p1} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: rev2#(x,cons(y,l)) -> rev2#(y,l) and R consists of: r1: rev(nil()) -> nil() r2: rev(cons(x,l)) -> cons(rev1(x,l),rev2(x,l)) r3: rev1(|0|(),nil()) -> |0|() r4: rev1(s(x),nil()) -> s(x) r5: rev1(x,cons(y,l)) -> rev1(y,l) r6: rev2(x,nil()) -> nil() r7: rev2(x,cons(y,l)) -> rev(cons(x,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: rev2#_A(x1,x2) = ((1,0),(1,1)) x2 + (1,1) cons_A(x1,x2) = x1 + x2 + (2,2) precedence: rev2# = cons partial status: pi(rev2#) = [] pi(cons) = [] 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,1) precedence: cons > rev2# partial status: pi(rev2#) = [] pi(cons) = [] The next rules are strictly ordered: p1 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: rev1#(x,cons(y,l)) -> rev1#(y,l) and R consists of: r1: rev(nil()) -> nil() r2: rev(cons(x,l)) -> cons(rev1(x,l),rev2(x,l)) r3: rev1(|0|(),nil()) -> |0|() r4: rev1(s(x),nil()) -> s(x) r5: rev1(x,cons(y,l)) -> rev1(y,l) r6: rev2(x,nil()) -> nil() r7: rev2(x,cons(y,l)) -> rev(cons(x,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.