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: max/plus interpretations on natural numbers: sel#_A(x1,x2) = x1 + 7 s_A(x1) = max{7, x1} cons_A(x1,x2) = max{x1 + 3, x2} activate_A(x1) = x1 + 7 f_A(x1) = max{15, x1 + 8} n__f_A(x1) = x1 + 8 n__g_A(x1) = max{5, x1} g_A(x1) = max{6, x1} |0|_A = 8 precedence: sel# = activate = f > cons = n__f = g > s = n__g = |0| partial status: pi(sel#) = [1] pi(s) = [1] pi(cons) = [1, 2] pi(activate) = [1] pi(f) = [1] pi(n__f) = [1] pi(n__g) = [1] pi(g) = [1] pi(|0|) = [] 2. weighted path order base order: max/plus interpretations on natural numbers: sel#_A(x1,x2) = max{0, x1 - 9} s_A(x1) = x1 + 8 cons_A(x1,x2) = max{x1 + 13, x2 + 10} activate_A(x1) = max{9, x1 + 5} f_A(x1) = max{10, x1 + 3} n__f_A(x1) = x1 + 2 n__g_A(x1) = x1 + 4 g_A(x1) = max{10, x1 + 9} |0|_A = 6 precedence: sel# = s = cons = activate = f = n__f = n__g = g = |0| partial status: pi(sel#) = [] pi(s) = [1] pi(cons) = [2] pi(activate) = [1] pi(f) = [] pi(n__f) = [1] pi(n__g) = [1] 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 monotone reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: max/plus interpretations on natural numbers: activate#_A(x1) = x1 + 1 n__g_A(x1) = x1 n__f_A(x1) = x1 precedence: activate# = n__g = n__f partial status: pi(activate#) = [] pi(n__g) = [] pi(n__f) = [] 2. weighted path order base order: max/plus interpretations on natural numbers: activate#_A(x1) = x1 + 1 n__g_A(x1) = x1 n__f_A(x1) = x1 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, 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: max/plus interpretations on natural numbers: g#_A(x1) = max{4, x1 + 3} s_A(x1) = max{3, x1 + 2} precedence: g# = s partial status: pi(g#) = [1] pi(s) = [1] 2. weighted path order base order: max/plus interpretations on natural numbers: g#_A(x1) = max{1, x1 - 1} s_A(x1) = x1 precedence: g# = s partial status: pi(g#) = [] pi(s) = [1] The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains.