YES We show the termination of the TRS R: f(X) -> cons(X,n__f(n__g(X))) g(|0|()) -> s(|0|()) g(s(X)) -> s(s(g(X))) sel(|0|(),cons(X,Y)) -> X sel(s(X),cons(Y,Z)) -> sel(X,activate(Z)) f(X) -> n__f(X) g(X) -> n__g(X) activate(n__f(X)) -> f(activate(X)) activate(n__g(X)) -> g(activate(X)) activate(X) -> X -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: g#(s(X)) -> g#(X) p2: sel#(s(X),cons(Y,Z)) -> sel#(X,activate(Z)) p3: sel#(s(X),cons(Y,Z)) -> activate#(Z) p4: activate#(n__f(X)) -> f#(activate(X)) p5: activate#(n__f(X)) -> activate#(X) p6: activate#(n__g(X)) -> g#(activate(X)) p7: activate#(n__g(X)) -> activate#(X) and R consists of: r1: f(X) -> cons(X,n__f(n__g(X))) r2: g(|0|()) -> s(|0|()) r3: g(s(X)) -> s(s(g(X))) r4: sel(|0|(),cons(X,Y)) -> X r5: sel(s(X),cons(Y,Z)) -> sel(X,activate(Z)) r6: f(X) -> n__f(X) r7: g(X) -> n__g(X) r8: activate(n__f(X)) -> f(activate(X)) r9: activate(n__g(X)) -> g(activate(X)) r10: activate(X) -> X The estimated dependency graph contains the following SCCs: {p2} {p5, p7} {p1} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: sel#(s(X),cons(Y,Z)) -> sel#(X,activate(Z)) and R consists of: r1: f(X) -> cons(X,n__f(n__g(X))) r2: g(|0|()) -> s(|0|()) r3: g(s(X)) -> s(s(g(X))) r4: sel(|0|(),cons(X,Y)) -> X r5: sel(s(X),cons(Y,Z)) -> sel(X,activate(Z)) r6: f(X) -> n__f(X) r7: g(X) -> n__g(X) r8: activate(n__f(X)) -> f(activate(X)) r9: activate(n__g(X)) -> g(activate(X)) r10: activate(X) -> X The set of usable rules consists of r1, r2, r3, r6, r7, r8, r9, r10 Take the reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: sel#_A(x1,x2) = x1 s_A(x1) = x1 cons_A(x1,x2) = (3,5) activate_A(x1) = ((1,0),(1,1)) x1 + (2,2) f_A(x1) = (4,4) n__f_A(x1) = (3,3) n__g_A(x1) = x1 + (2,1) g_A(x1) = x1 + (2,3) |0|_A() = (0,0) precedence: activate > f > n__f = g > cons > s = n__g = |0| > sel# partial status: pi(sel#) = [1] pi(s) = [1] pi(cons) = [] pi(activate) = [] pi(f) = [] pi(n__f) = [] pi(n__g) = [] pi(g) = [1] pi(|0|) = [] 2. weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: sel#_A(x1,x2) = ((1,0),(0,0)) x1 s_A(x1) = ((1,0),(0,0)) x1 + (2,0) cons_A(x1,x2) = (0,0) activate_A(x1) = (1,4) f_A(x1) = (1,1) n__f_A(x1) = (0,0) n__g_A(x1) = (0,2) g_A(x1) = ((1,0),(0,0)) x1 + (0,3) |0|_A() = (0,0) precedence: sel# = cons = activate > s = g > |0| > n__g > f = n__f partial status: pi(sel#) = [] pi(s) = [] pi(cons) = [] pi(activate) = [] pi(f) = [] pi(n__f) = [] pi(n__g) = [] pi(g) = [] pi(|0|) = [] 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: activate#(n__g(X)) -> activate#(X) p2: activate#(n__f(X)) -> activate#(X) and R consists of: r1: f(X) -> cons(X,n__f(n__g(X))) r2: g(|0|()) -> s(|0|()) r3: g(s(X)) -> s(s(g(X))) r4: sel(|0|(),cons(X,Y)) -> X r5: sel(s(X),cons(Y,Z)) -> sel(X,activate(Z)) r6: f(X) -> n__f(X) r7: g(X) -> n__g(X) r8: activate(n__f(X)) -> f(activate(X)) r9: activate(n__g(X)) -> g(activate(X)) r10: activate(X) -> 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: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: activate#_A(x1) = x1 + (1,2) n__g_A(x1) = x1 + (2,1) n__f_A(x1) = ((1,0),(1,1)) x1 + (2,1) precedence: activate# = n__g = n__f partial status: pi(activate#) = [1] pi(n__g) = [1] pi(n__f) = [1] 2. weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: activate#_A(x1) = ((1,0),(1,0)) x1 + (0,2) n__g_A(x1) = ((1,0),(0,0)) x1 + (1,1) n__f_A(x1) = ((1,0),(0,0)) x1 + (1,1) precedence: activate# = n__g = n__f partial status: pi(activate#) = [] pi(n__g) = [] pi(n__f) = [] The next rules are strictly ordered: p1, p2 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: g#(s(X)) -> g#(X) and R consists of: r1: f(X) -> cons(X,n__f(n__g(X))) r2: g(|0|()) -> s(|0|()) r3: g(s(X)) -> s(s(g(X))) r4: sel(|0|(),cons(X,Y)) -> X r5: sel(s(X),cons(Y,Z)) -> sel(X,activate(Z)) r6: f(X) -> n__f(X) r7: g(X) -> n__g(X) r8: activate(n__f(X)) -> f(activate(X)) r9: activate(n__g(X)) -> g(activate(X)) r10: activate(X) -> 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: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: g#_A(x1) = ((1,0),(1,1)) x1 + (2,2) s_A(x1) = ((1,0),(0,0)) x1 + (1,1) precedence: g# = s partial status: pi(g#) = [] pi(s) = [] 2. weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: g#_A(x1) = ((1,0),(0,0)) x1 s_A(x1) = (1,1) precedence: s > g# partial status: pi(g#) = [] pi(s) = [] The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains.