YES We show the termination of the TRS R: from(X) -> cons(X,n__from(s(X))) first(|0|(),Z) -> nil() first(s(X),cons(Y,Z)) -> cons(Y,n__first(X,activate(Z))) sel(|0|(),cons(X,Z)) -> X sel(s(X),cons(Y,Z)) -> sel(X,activate(Z)) from(X) -> n__from(X) first(X1,X2) -> n__first(X1,X2) activate(n__from(X)) -> from(X) activate(n__first(X1,X2)) -> first(X1,X2) activate(X) -> X -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: first#(s(X),cons(Y,Z)) -> activate#(Z) p2: sel#(s(X),cons(Y,Z)) -> sel#(X,activate(Z)) p3: sel#(s(X),cons(Y,Z)) -> activate#(Z) p4: activate#(n__from(X)) -> from#(X) p5: activate#(n__first(X1,X2)) -> first#(X1,X2) and R consists of: r1: from(X) -> cons(X,n__from(s(X))) r2: first(|0|(),Z) -> nil() r3: first(s(X),cons(Y,Z)) -> cons(Y,n__first(X,activate(Z))) r4: sel(|0|(),cons(X,Z)) -> X r5: sel(s(X),cons(Y,Z)) -> sel(X,activate(Z)) r6: from(X) -> n__from(X) r7: first(X1,X2) -> n__first(X1,X2) r8: activate(n__from(X)) -> from(X) r9: activate(n__first(X1,X2)) -> first(X1,X2) r10: activate(X) -> X The estimated dependency graph contains the following SCCs: {p2} {p1, p5} -- 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: from(X) -> cons(X,n__from(s(X))) r2: first(|0|(),Z) -> nil() r3: first(s(X),cons(Y,Z)) -> cons(Y,n__first(X,activate(Z))) r4: sel(|0|(),cons(X,Z)) -> X r5: sel(s(X),cons(Y,Z)) -> sel(X,activate(Z)) r6: from(X) -> n__from(X) r7: first(X1,X2) -> n__first(X1,X2) r8: activate(n__from(X)) -> from(X) r9: activate(n__first(X1,X2)) -> first(X1,X2) 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 + 22 s_A(x1) = x1 + 10 cons_A(x1,x2) = max{x1 + 5, x2 - 11} activate_A(x1) = max{5, x1} from_A(x1) = x1 + 13 n__from_A(x1) = x1 + 13 first_A(x1,x2) = max{x1 + 2, x2 + 17} |0|_A = 2 nil_A = 1 n__first_A(x1,x2) = max{x1 + 2, x2 + 17} precedence: |0| > nil > sel# = activate = from = n__from > s = first > cons = n__first partial status: pi(sel#) = [] pi(s) = [1] pi(cons) = [1] pi(activate) = [1] pi(from) = [1] pi(n__from) = [] pi(first) = [2] pi(|0|) = [] pi(nil) = [] pi(n__first) = [2] 2. weighted path order base order: max/plus interpretations on natural numbers: sel#_A(x1,x2) = 0 s_A(x1) = max{17, x1 + 12} cons_A(x1,x2) = 9 activate_A(x1) = max{13, x1} from_A(x1) = 14 n__from_A(x1) = 14 first_A(x1,x2) = x2 + 10 |0|_A = 8 nil_A = 9 n__first_A(x1,x2) = x2 + 7 precedence: sel# = s = cons = activate = from = n__from = first = |0| > nil = n__first partial status: pi(sel#) = [] pi(s) = [] pi(cons) = [] pi(activate) = [1] pi(from) = [] pi(n__from) = [] pi(first) = [] pi(|0|) = [] pi(nil) = [] pi(n__first) = [2] 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: first#(s(X),cons(Y,Z)) -> activate#(Z) p2: activate#(n__first(X1,X2)) -> first#(X1,X2) and R consists of: r1: from(X) -> cons(X,n__from(s(X))) r2: first(|0|(),Z) -> nil() r3: first(s(X),cons(Y,Z)) -> cons(Y,n__first(X,activate(Z))) r4: sel(|0|(),cons(X,Z)) -> X r5: sel(s(X),cons(Y,Z)) -> sel(X,activate(Z)) r6: from(X) -> n__from(X) r7: first(X1,X2) -> n__first(X1,X2) r8: activate(n__from(X)) -> from(X) r9: activate(n__first(X1,X2)) -> first(X1,X2) 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: first#_A(x1,x2) = max{x1 + 8, x2 + 6} s_A(x1) = max{3, x1 + 1} cons_A(x1,x2) = max{x1 + 10, x2 + 5} activate#_A(x1) = max{10, x1 + 5} n__first_A(x1,x2) = max{x1 + 3, x2 + 1} precedence: cons = activate# > first# = n__first > s partial status: pi(first#) = [1] pi(s) = [1] pi(cons) = [2] pi(activate#) = [] pi(n__first) = [1] 2. weighted path order base order: max/plus interpretations on natural numbers: first#_A(x1,x2) = x1 + 2 s_A(x1) = x1 cons_A(x1,x2) = x2 activate#_A(x1) = 1 n__first_A(x1,x2) = x1 + 1 precedence: s > first# = activate# > cons > n__first partial status: pi(first#) = [1] pi(s) = [1] pi(cons) = [2] pi(activate#) = [] pi(n__first) = [] The next rules are strictly ordered: p1, p2 We remove them from the problem. Then no dependency pair remains.