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