YES We show the termination of the TRS R: from(X) -> cons(X,n__from(n__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) s(X) -> n__s(X) first(X1,X2) -> n__first(X1,X2) activate(n__from(X)) -> from(activate(X)) activate(n__s(X)) -> s(activate(X)) activate(n__first(X1,X2)) -> first(activate(X1),activate(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#(activate(X)) p5: activate#(n__from(X)) -> activate#(X) p6: activate#(n__s(X)) -> s#(activate(X)) p7: activate#(n__s(X)) -> activate#(X) p8: activate#(n__first(X1,X2)) -> first#(activate(X1),activate(X2)) p9: activate#(n__first(X1,X2)) -> activate#(X1) p10: activate#(n__first(X1,X2)) -> activate#(X2) and R consists of: r1: from(X) -> cons(X,n__from(n__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: s(X) -> n__s(X) r8: first(X1,X2) -> n__first(X1,X2) r9: activate(n__from(X)) -> from(activate(X)) r10: activate(n__s(X)) -> s(activate(X)) r11: activate(n__first(X1,X2)) -> first(activate(X1),activate(X2)) r12: activate(X) -> X The estimated dependency graph contains the following SCCs: {p2} {p1, p5, p7, p8, p9, p10} -- 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(n__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: s(X) -> n__s(X) r8: first(X1,X2) -> n__first(X1,X2) r9: activate(n__from(X)) -> from(activate(X)) r10: activate(n__s(X)) -> s(activate(X)) r11: activate(n__first(X1,X2)) -> first(activate(X1),activate(X2)) r12: activate(X) -> X The set of usable rules consists of r1, r2, r3, r6, r7, r8, r9, r10, r11, r12 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 + (3,1) s_A(x1) = x1 + (2,4) cons_A(x1,x2) = (4,0) activate_A(x1) = ((1,0),(1,1)) x1 + (1,2) from_A(x1) = ((1,0),(1,1)) x1 + (8,6) n__from_A(x1) = ((1,0),(1,1)) x1 + (8,0) n__s_A(x1) = x1 + (2,3) first_A(x1,x2) = (5,3) |0|_A() = (2,0) nil_A() = (1,1) n__first_A(x1,x2) = (5,1) precedence: sel# = s = activate = from = n__s = first > n__from = |0| = nil > n__first > cons partial status: pi(sel#) = [1] pi(s) = [1] pi(cons) = [] pi(activate) = [1] pi(from) = [] pi(n__from) = [1] pi(n__s) = [1] pi(first) = [] pi(|0|) = [] pi(nil) = [] pi(n__first) = [] 2. weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: sel#_A(x1,x2) = ((1,0),(1,1)) x1 + (1,3) s_A(x1) = x1 + (6,2) cons_A(x1,x2) = (7,0) activate_A(x1) = ((1,0),(1,0)) x1 + (5,0) from_A(x1) = (8,2) n__from_A(x1) = ((0,0),(1,0)) x1 + (4,1) n__s_A(x1) = x1 + (6,1) first_A(x1,x2) = (8,9) |0|_A() = (1,2) nil_A() = (1,1) n__first_A(x1,x2) = (8,3) precedence: activate = n__from > from = n__s > s = cons > sel# > first = |0| = nil = n__first partial status: pi(sel#) = [1] pi(s) = [1] pi(cons) = [] pi(activate) = [] pi(from) = [] pi(n__from) = [] pi(n__s) = [] pi(first) = [] pi(|0|) = [] pi(nil) = [] pi(n__first) = [] 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)) -> activate#(X2) p3: activate#(n__first(X1,X2)) -> activate#(X1) p4: activate#(n__first(X1,X2)) -> first#(activate(X1),activate(X2)) p5: activate#(n__s(X)) -> activate#(X) p6: activate#(n__from(X)) -> activate#(X) and R consists of: r1: from(X) -> cons(X,n__from(n__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: s(X) -> n__s(X) r8: first(X1,X2) -> n__first(X1,X2) r9: activate(n__from(X)) -> from(activate(X)) r10: activate(n__s(X)) -> s(activate(X)) r11: activate(n__first(X1,X2)) -> first(activate(X1),activate(X2)) r12: activate(X) -> X The set of usable rules consists of r1, r2, r3, r6, r7, r8, r9, r10, r11, r12 Take the reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: first#_A(x1,x2) = ((1,0),(0,0)) x1 + x2 + (1,3) s_A(x1) = ((1,0),(1,1)) x1 + (0,4) cons_A(x1,x2) = ((1,0),(0,0)) x2 + (0,1) activate#_A(x1) = ((1,0),(1,1)) x1 + (0,3) n__first_A(x1,x2) = ((1,0),(1,1)) x1 + ((1,0),(1,1)) x2 + (2,2) activate_A(x1) = ((1,0),(1,1)) x1 n__s_A(x1) = ((1,0),(1,1)) x1 + (0,4) n__from_A(x1) = ((1,0),(1,1)) x1 + (6,4) from_A(x1) = ((1,0),(1,1)) x1 + (6,9) first_A(x1,x2) = ((1,0),(1,1)) x1 + ((1,0),(1,1)) x2 + (2,4) |0|_A() = (1,1) nil_A() = (2,6) precedence: first# = activate# = activate > from > first > s = n__first = n__from > cons = n__s = |0| = nil partial status: pi(first#) = [2] pi(s) = [] pi(cons) = [] pi(activate#) = [] pi(n__first) = [] pi(activate) = [1] pi(n__s) = [] pi(n__from) = [1] pi(from) = [1] pi(first) = [2] pi(|0|) = [] pi(nil) = [] 2. weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: first#_A(x1,x2) = ((1,0),(1,1)) x2 + (0,1) s_A(x1) = (2,0) cons_A(x1,x2) = (3,1) activate#_A(x1) = (2,16) n__first_A(x1,x2) = (6,0) activate_A(x1) = (5,9) n__s_A(x1) = (1,2) n__from_A(x1) = ((0,0),(1,0)) x1 + (4,1) from_A(x1) = ((0,0),(1,0)) x1 + (4,3) first_A(x1,x2) = ((0,0),(1,0)) x2 + (7,5) |0|_A() = (1,0) nil_A() = (0,0) precedence: first# = cons = activate# > activate > first > n__from = from > |0| > s = n__first = n__s > nil partial status: pi(first#) = [2] pi(s) = [] pi(cons) = [] pi(activate#) = [] pi(n__first) = [] pi(activate) = [] pi(n__s) = [] pi(n__from) = [] pi(from) = [] pi(first) = [] pi(|0|) = [] pi(nil) = [] The next rules are strictly ordered: p1, p4 We remove them from the problem. -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: activate#(n__first(X1,X2)) -> activate#(X2) p2: activate#(n__first(X1,X2)) -> activate#(X1) p3: activate#(n__s(X)) -> activate#(X) p4: activate#(n__from(X)) -> activate#(X) and R consists of: r1: from(X) -> cons(X,n__from(n__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: s(X) -> n__s(X) r8: first(X1,X2) -> n__first(X1,X2) r9: activate(n__from(X)) -> from(activate(X)) r10: activate(n__s(X)) -> s(activate(X)) r11: activate(n__first(X1,X2)) -> first(activate(X1),activate(X2)) r12: activate(X) -> X The estimated dependency graph contains the following SCCs: {p1, p2, p3, p4} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: activate#(n__first(X1,X2)) -> activate#(X2) p2: activate#(n__from(X)) -> activate#(X) p3: activate#(n__s(X)) -> activate#(X) p4: activate#(n__first(X1,X2)) -> activate#(X1) and R consists of: r1: from(X) -> cons(X,n__from(n__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: s(X) -> n__s(X) r8: first(X1,X2) -> n__first(X1,X2) r9: activate(n__from(X)) -> from(activate(X)) r10: activate(n__s(X)) -> s(activate(X)) r11: activate(n__first(X1,X2)) -> first(activate(X1),activate(X2)) r12: 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) = ((1,0),(0,0)) x1 n__first_A(x1,x2) = ((1,0),(0,0)) x1 + ((1,0),(1,1)) x2 + (1,1) n__from_A(x1) = ((1,0),(1,1)) x1 + (1,0) n__s_A(x1) = ((1,0),(0,0)) x1 precedence: activate# = n__first = n__from = n__s partial status: pi(activate#) = [] pi(n__first) = [] pi(n__from) = [] pi(n__s) = [] 2. weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: activate#_A(x1) = (0,0) n__first_A(x1,x2) = (1,1) n__from_A(x1) = ((1,0),(0,0)) x1 + (1,1) n__s_A(x1) = (1,1) precedence: n__from = n__s > activate# = n__first partial status: pi(activate#) = [] pi(n__first) = [] pi(n__from) = [] pi(n__s) = [] 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__from(X)) -> activate#(X) p2: activate#(n__s(X)) -> activate#(X) p3: activate#(n__first(X1,X2)) -> activate#(X1) and R consists of: r1: from(X) -> cons(X,n__from(n__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: s(X) -> n__s(X) r8: first(X1,X2) -> n__first(X1,X2) r9: activate(n__from(X)) -> from(activate(X)) r10: activate(n__s(X)) -> s(activate(X)) r11: activate(n__first(X1,X2)) -> first(activate(X1),activate(X2)) r12: activate(X) -> X The estimated dependency graph contains the following SCCs: {p1, p2, p3} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: activate#(n__from(X)) -> activate#(X) p2: activate#(n__first(X1,X2)) -> activate#(X1) p3: activate#(n__s(X)) -> activate#(X) and R consists of: r1: from(X) -> cons(X,n__from(n__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: s(X) -> n__s(X) r8: first(X1,X2) -> n__first(X1,X2) r9: activate(n__from(X)) -> from(activate(X)) r10: activate(n__s(X)) -> s(activate(X)) r11: activate(n__first(X1,X2)) -> first(activate(X1),activate(X2)) r12: 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) = ((1,0),(1,0)) x1 + (1,2) n__from_A(x1) = ((1,0),(1,1)) x1 + (2,3) n__first_A(x1,x2) = x1 + x2 + (2,1) n__s_A(x1) = x1 precedence: n__from = n__s > activate# = n__first partial status: pi(activate#) = [] pi(n__from) = [] pi(n__first) = [1, 2] pi(n__s) = [] 2. weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: activate#_A(x1) = (0,0) n__from_A(x1) = (1,1) n__first_A(x1,x2) = x1 + x2 + (1,1) n__s_A(x1) = (1,1) precedence: n__from = n__s > activate# = n__first partial status: pi(activate#) = [] pi(n__from) = [] pi(n__first) = [1, 2] pi(n__s) = [] 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: activate#(n__s(X)) -> activate#(X) and R consists of: r1: from(X) -> cons(X,n__from(n__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: s(X) -> n__s(X) r8: first(X1,X2) -> n__first(X1,X2) r9: activate(n__from(X)) -> from(activate(X)) r10: activate(n__s(X)) -> s(activate(X)) r11: activate(n__first(X1,X2)) -> first(activate(X1),activate(X2)) r12: 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__s(X)) -> activate#(X) and R consists of: r1: from(X) -> cons(X,n__from(n__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: s(X) -> n__s(X) r8: first(X1,X2) -> n__first(X1,X2) r9: activate(n__from(X)) -> from(activate(X)) r10: activate(n__s(X)) -> s(activate(X)) r11: activate(n__first(X1,X2)) -> first(activate(X1),activate(X2)) r12: 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) = ((1,0),(1,1)) x1 + (2,2) n__s_A(x1) = ((1,0),(0,0)) x1 + (1,1) precedence: activate# = n__s partial status: pi(activate#) = [] pi(n__s) = [] 2. weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: activate#_A(x1) = ((1,0),(0,0)) x1 n__s_A(x1) = (1,1) precedence: n__s > activate# partial status: pi(activate#) = [] pi(n__s) = [] The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains.