YES We show the termination of the TRS R: from(X) -> cons(X,n__from(s(X))) |2ndspos|(|0|(),Z) -> rnil() |2ndspos|(s(N),cons(X,Z)) -> |2ndspos|(s(N),cons2(X,activate(Z))) |2ndspos|(s(N),cons2(X,cons(Y,Z))) -> rcons(posrecip(Y),|2ndsneg|(N,activate(Z))) |2ndsneg|(|0|(),Z) -> rnil() |2ndsneg|(s(N),cons(X,Z)) -> |2ndsneg|(s(N),cons2(X,activate(Z))) |2ndsneg|(s(N),cons2(X,cons(Y,Z))) -> rcons(negrecip(Y),|2ndspos|(N,activate(Z))) pi(X) -> |2ndspos|(X,from(|0|())) plus(|0|(),Y) -> Y plus(s(X),Y) -> s(plus(X,Y)) times(|0|(),Y) -> |0|() times(s(X),Y) -> plus(Y,times(X,Y)) square(X) -> times(X,X) from(X) -> n__from(X) activate(n__from(X)) -> from(X) activate(X) -> X -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: |2ndspos|#(s(N),cons(X,Z)) -> |2ndspos|#(s(N),cons2(X,activate(Z))) p2: |2ndspos|#(s(N),cons(X,Z)) -> activate#(Z) p3: |2ndspos|#(s(N),cons2(X,cons(Y,Z))) -> |2ndsneg|#(N,activate(Z)) p4: |2ndspos|#(s(N),cons2(X,cons(Y,Z))) -> activate#(Z) p5: |2ndsneg|#(s(N),cons(X,Z)) -> |2ndsneg|#(s(N),cons2(X,activate(Z))) p6: |2ndsneg|#(s(N),cons(X,Z)) -> activate#(Z) p7: |2ndsneg|#(s(N),cons2(X,cons(Y,Z))) -> |2ndspos|#(N,activate(Z)) p8: |2ndsneg|#(s(N),cons2(X,cons(Y,Z))) -> activate#(Z) p9: pi#(X) -> |2ndspos|#(X,from(|0|())) p10: pi#(X) -> from#(|0|()) p11: plus#(s(X),Y) -> plus#(X,Y) p12: times#(s(X),Y) -> plus#(Y,times(X,Y)) p13: times#(s(X),Y) -> times#(X,Y) p14: square#(X) -> times#(X,X) p15: activate#(n__from(X)) -> from#(X) and R consists of: r1: from(X) -> cons(X,n__from(s(X))) r2: |2ndspos|(|0|(),Z) -> rnil() r3: |2ndspos|(s(N),cons(X,Z)) -> |2ndspos|(s(N),cons2(X,activate(Z))) r4: |2ndspos|(s(N),cons2(X,cons(Y,Z))) -> rcons(posrecip(Y),|2ndsneg|(N,activate(Z))) r5: |2ndsneg|(|0|(),Z) -> rnil() r6: |2ndsneg|(s(N),cons(X,Z)) -> |2ndsneg|(s(N),cons2(X,activate(Z))) r7: |2ndsneg|(s(N),cons2(X,cons(Y,Z))) -> rcons(negrecip(Y),|2ndspos|(N,activate(Z))) r8: pi(X) -> |2ndspos|(X,from(|0|())) r9: plus(|0|(),Y) -> Y r10: plus(s(X),Y) -> s(plus(X,Y)) r11: times(|0|(),Y) -> |0|() r12: times(s(X),Y) -> plus(Y,times(X,Y)) r13: square(X) -> times(X,X) r14: from(X) -> n__from(X) r15: activate(n__from(X)) -> from(X) r16: activate(X) -> X The estimated dependency graph contains the following SCCs: {p1, p3, p5, p7} {p13} {p11} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: |2ndspos|#(s(N),cons(X,Z)) -> |2ndspos|#(s(N),cons2(X,activate(Z))) p2: |2ndspos|#(s(N),cons2(X,cons(Y,Z))) -> |2ndsneg|#(N,activate(Z)) p3: |2ndsneg|#(s(N),cons2(X,cons(Y,Z))) -> |2ndspos|#(N,activate(Z)) p4: |2ndsneg|#(s(N),cons(X,Z)) -> |2ndsneg|#(s(N),cons2(X,activate(Z))) and R consists of: r1: from(X) -> cons(X,n__from(s(X))) r2: |2ndspos|(|0|(),Z) -> rnil() r3: |2ndspos|(s(N),cons(X,Z)) -> |2ndspos|(s(N),cons2(X,activate(Z))) r4: |2ndspos|(s(N),cons2(X,cons(Y,Z))) -> rcons(posrecip(Y),|2ndsneg|(N,activate(Z))) r5: |2ndsneg|(|0|(),Z) -> rnil() r6: |2ndsneg|(s(N),cons(X,Z)) -> |2ndsneg|(s(N),cons2(X,activate(Z))) r7: |2ndsneg|(s(N),cons2(X,cons(Y,Z))) -> rcons(negrecip(Y),|2ndspos|(N,activate(Z))) r8: pi(X) -> |2ndspos|(X,from(|0|())) r9: plus(|0|(),Y) -> Y r10: plus(s(X),Y) -> s(plus(X,Y)) r11: times(|0|(),Y) -> |0|() r12: times(s(X),Y) -> plus(Y,times(X,Y)) r13: square(X) -> times(X,X) r14: from(X) -> n__from(X) r15: activate(n__from(X)) -> from(X) r16: activate(X) -> X The set of usable rules consists of r1, r14, r15, r16 Take the reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: max/plus interpretations on natural numbers: |2ndspos|#_A(x1,x2) = x1 + 15 s_A(x1) = x1 + 15 cons_A(x1,x2) = max{34, x1 + 4} cons2_A(x1,x2) = max{73, x1 + 43, x2 + 13} activate_A(x1) = x1 + 23 |2ndsneg|#_A(x1,x2) = max{2, x1} from_A(x1) = max{34, x1 + 12} n__from_A(x1) = max{25, x1 + 12} precedence: |2ndspos|# = cons2 = |2ndsneg|# = from > cons > s = activate > n__from partial status: pi(|2ndspos|#) = [1] pi(s) = [] pi(cons) = [1] pi(cons2) = [1, 2] pi(activate) = [1] pi(|2ndsneg|#) = [1] pi(from) = [1] pi(n__from) = [1] 2. weighted path order base order: max/plus interpretations on natural numbers: |2ndspos|#_A(x1,x2) = x1 + 7 s_A(x1) = 0 cons_A(x1,x2) = x1 + 26 cons2_A(x1,x2) = max{29, x1 + 27, x2 + 7} activate_A(x1) = max{22, x1} |2ndsneg|#_A(x1,x2) = 1 from_A(x1) = x1 + 25 n__from_A(x1) = x1 + 22 precedence: |2ndspos|# = cons = cons2 = activate = |2ndsneg|# = from = n__from > s partial status: pi(|2ndspos|#) = [1] pi(s) = [] pi(cons) = [1] pi(cons2) = [1] pi(activate) = [1] pi(|2ndsneg|#) = [] pi(from) = [1] pi(n__from) = [1] The next rules are strictly ordered: p2, p3 We remove them from the problem. -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: |2ndspos|#(s(N),cons(X,Z)) -> |2ndspos|#(s(N),cons2(X,activate(Z))) p2: |2ndsneg|#(s(N),cons(X,Z)) -> |2ndsneg|#(s(N),cons2(X,activate(Z))) and R consists of: r1: from(X) -> cons(X,n__from(s(X))) r2: |2ndspos|(|0|(),Z) -> rnil() r3: |2ndspos|(s(N),cons(X,Z)) -> |2ndspos|(s(N),cons2(X,activate(Z))) r4: |2ndspos|(s(N),cons2(X,cons(Y,Z))) -> rcons(posrecip(Y),|2ndsneg|(N,activate(Z))) r5: |2ndsneg|(|0|(),Z) -> rnil() r6: |2ndsneg|(s(N),cons(X,Z)) -> |2ndsneg|(s(N),cons2(X,activate(Z))) r7: |2ndsneg|(s(N),cons2(X,cons(Y,Z))) -> rcons(negrecip(Y),|2ndspos|(N,activate(Z))) r8: pi(X) -> |2ndspos|(X,from(|0|())) r9: plus(|0|(),Y) -> Y r10: plus(s(X),Y) -> s(plus(X,Y)) r11: times(|0|(),Y) -> |0|() r12: times(s(X),Y) -> plus(Y,times(X,Y)) r13: square(X) -> times(X,X) r14: from(X) -> n__from(X) r15: activate(n__from(X)) -> from(X) r16: activate(X) -> X The estimated dependency graph contains the following SCCs: (no SCCs) -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: times#(s(X),Y) -> times#(X,Y) and R consists of: r1: from(X) -> cons(X,n__from(s(X))) r2: |2ndspos|(|0|(),Z) -> rnil() r3: |2ndspos|(s(N),cons(X,Z)) -> |2ndspos|(s(N),cons2(X,activate(Z))) r4: |2ndspos|(s(N),cons2(X,cons(Y,Z))) -> rcons(posrecip(Y),|2ndsneg|(N,activate(Z))) r5: |2ndsneg|(|0|(),Z) -> rnil() r6: |2ndsneg|(s(N),cons(X,Z)) -> |2ndsneg|(s(N),cons2(X,activate(Z))) r7: |2ndsneg|(s(N),cons2(X,cons(Y,Z))) -> rcons(negrecip(Y),|2ndspos|(N,activate(Z))) r8: pi(X) -> |2ndspos|(X,from(|0|())) r9: plus(|0|(),Y) -> Y r10: plus(s(X),Y) -> s(plus(X,Y)) r11: times(|0|(),Y) -> |0|() r12: times(s(X),Y) -> plus(Y,times(X,Y)) r13: square(X) -> times(X,X) r14: from(X) -> n__from(X) r15: activate(n__from(X)) -> from(X) r16: 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: times#_A(x1,x2) = max{2, x1 + 1, x2} s_A(x1) = max{1, x1} precedence: times# = s partial status: pi(times#) = [1, 2] pi(s) = [1] 2. weighted path order base order: max/plus interpretations on natural numbers: times#_A(x1,x2) = x2 + 1 s_A(x1) = x1 + 1 precedence: times# = s partial status: pi(times#) = [] pi(s) = [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: plus#(s(X),Y) -> plus#(X,Y) and R consists of: r1: from(X) -> cons(X,n__from(s(X))) r2: |2ndspos|(|0|(),Z) -> rnil() r3: |2ndspos|(s(N),cons(X,Z)) -> |2ndspos|(s(N),cons2(X,activate(Z))) r4: |2ndspos|(s(N),cons2(X,cons(Y,Z))) -> rcons(posrecip(Y),|2ndsneg|(N,activate(Z))) r5: |2ndsneg|(|0|(),Z) -> rnil() r6: |2ndsneg|(s(N),cons(X,Z)) -> |2ndsneg|(s(N),cons2(X,activate(Z))) r7: |2ndsneg|(s(N),cons2(X,cons(Y,Z))) -> rcons(negrecip(Y),|2ndspos|(N,activate(Z))) r8: pi(X) -> |2ndspos|(X,from(|0|())) r9: plus(|0|(),Y) -> Y r10: plus(s(X),Y) -> s(plus(X,Y)) r11: times(|0|(),Y) -> |0|() r12: times(s(X),Y) -> plus(Y,times(X,Y)) r13: square(X) -> times(X,X) r14: from(X) -> n__from(X) r15: activate(n__from(X)) -> from(X) r16: 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: plus#_A(x1,x2) = max{2, x1 + 1, x2} s_A(x1) = max{1, x1} precedence: plus# = s partial status: pi(plus#) = [1, 2] pi(s) = [1] 2. weighted path order base order: max/plus interpretations on natural numbers: plus#_A(x1,x2) = max{x1 - 1, x2 + 1} s_A(x1) = x1 precedence: plus# = s partial status: pi(plus#) = [] pi(s) = [1] The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains.