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: weighted path order base order: matrix interpretations: carrier: N^1 order: lexicographic order interpretations: sel#_A(x1,x2) = x1 s_A(x1) = x1 cons_A(x1,x2) = 1 activate_A(x1) = x1 + 3 f_A(x1) = 2 n__f_A(x1) = 2 n__g_A(x1) = x1 + 4 g_A(x1) = x1 + 4 |0|_A() = 1 precedence: cons = activate = f > n__f = n__g = g > sel# = s = |0| partial status: pi(sel#) = [1] pi(s) = [1] pi(cons) = [] pi(activate) = [1] pi(f) = [] pi(n__f) = [] pi(n__g) = [] pi(g) = [1] 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 monotone reduction pair: weighted path order base order: matrix interpretations: carrier: N^1 order: lexicographic order interpretations: activate#_A(x1) = x1 n__g_A(x1) = x1 + 1 n__f_A(x1) = x1 + 1 precedence: activate# = n__g = n__f partial status: pi(activate#) = [1] pi(n__g) = [1] pi(n__f) = [1] 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: 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 estimated dependency graph contains the following SCCs: {p1} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: 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 monotone reduction pair: weighted path order base order: matrix interpretations: carrier: N^1 order: lexicographic order interpretations: activate#_A(x1) = x1 n__f_A(x1) = x1 + 1 precedence: activate# = n__f partial status: pi(activate#) = [1] pi(n__f) = [1] 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: 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 monotone reduction pair: weighted path order base order: matrix interpretations: carrier: N^1 order: lexicographic order interpretations: g#_A(x1) = x1 s_A(x1) = x1 + 1 precedence: g# = s partial status: pi(g#) = [1] pi(s) = [1] The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains.