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,n__cons(Y,Z))) -> rcons(posrecip(activate(Y)),|2ndsneg|(N,activate(Z)))
  |2ndsneg|(|0|(),Z) -> rnil()
  |2ndsneg|(s(N),cons(X,n__cons(Y,Z))) -> rcons(negrecip(activate(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)
  cons(X1,X2) -> n__cons(X1,X2)
  activate(n__from(X)) -> from(X)
  activate(n__cons(X1,X2)) -> cons(X1,X2)
  activate(X) -> X

-- SCC decomposition.

Consider the dependency pair problem (P, R), where P consists of

p1: from#(X) -> cons#(X,n__from(s(X)))
p2: |2ndspos|#(s(N),cons(X,n__cons(Y,Z))) -> activate#(Y)
p3: |2ndspos|#(s(N),cons(X,n__cons(Y,Z))) -> |2ndsneg|#(N,activate(Z))
p4: |2ndspos|#(s(N),cons(X,n__cons(Y,Z))) -> activate#(Z)
p5: |2ndsneg|#(s(N),cons(X,n__cons(Y,Z))) -> activate#(Y)
p6: |2ndsneg|#(s(N),cons(X,n__cons(Y,Z))) -> |2ndspos|#(N,activate(Z))
p7: |2ndsneg|#(s(N),cons(X,n__cons(Y,Z))) -> activate#(Z)
p8: pi#(X) -> |2ndspos|#(X,from(|0|()))
p9: pi#(X) -> from#(|0|())
p10: plus#(s(X),Y) -> plus#(X,Y)
p11: times#(s(X),Y) -> plus#(Y,times(X,Y))
p12: times#(s(X),Y) -> times#(X,Y)
p13: square#(X) -> times#(X,X)
p14: activate#(n__from(X)) -> from#(X)
p15: activate#(n__cons(X1,X2)) -> cons#(X1,X2)

and R consists of:

r1: from(X) -> cons(X,n__from(s(X)))
r2: |2ndspos|(|0|(),Z) -> rnil()
r3: |2ndspos|(s(N),cons(X,n__cons(Y,Z))) -> rcons(posrecip(activate(Y)),|2ndsneg|(N,activate(Z)))
r4: |2ndsneg|(|0|(),Z) -> rnil()
r5: |2ndsneg|(s(N),cons(X,n__cons(Y,Z))) -> rcons(negrecip(activate(Y)),|2ndspos|(N,activate(Z)))
r6: pi(X) -> |2ndspos|(X,from(|0|()))
r7: plus(|0|(),Y) -> Y
r8: plus(s(X),Y) -> s(plus(X,Y))
r9: times(|0|(),Y) -> |0|()
r10: times(s(X),Y) -> plus(Y,times(X,Y))
r11: square(X) -> times(X,X)
r12: from(X) -> n__from(X)
r13: cons(X1,X2) -> n__cons(X1,X2)
r14: activate(n__from(X)) -> from(X)
r15: activate(n__cons(X1,X2)) -> cons(X1,X2)
r16: activate(X) -> X

The estimated dependency graph contains the following SCCs:

  {p3, p6}
  {p12}
  {p10}


-- Reduction pair.

Consider the dependency pair problem (P, R), where P consists of

p1: |2ndsneg|#(s(N),cons(X,n__cons(Y,Z))) -> |2ndspos|#(N,activate(Z))
p2: |2ndspos|#(s(N),cons(X,n__cons(Y,Z))) -> |2ndsneg|#(N,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,n__cons(Y,Z))) -> rcons(posrecip(activate(Y)),|2ndsneg|(N,activate(Z)))
r4: |2ndsneg|(|0|(),Z) -> rnil()
r5: |2ndsneg|(s(N),cons(X,n__cons(Y,Z))) -> rcons(negrecip(activate(Y)),|2ndspos|(N,activate(Z)))
r6: pi(X) -> |2ndspos|(X,from(|0|()))
r7: plus(|0|(),Y) -> Y
r8: plus(s(X),Y) -> s(plus(X,Y))
r9: times(|0|(),Y) -> |0|()
r10: times(s(X),Y) -> plus(Y,times(X,Y))
r11: square(X) -> times(X,X)
r12: from(X) -> n__from(X)
r13: cons(X1,X2) -> n__cons(X1,X2)
r14: activate(n__from(X)) -> from(X)
r15: activate(n__cons(X1,X2)) -> cons(X1,X2)
r16: activate(X) -> X

The set of usable rules consists of

  r1, r12, r13, r14, r15, r16

Take the reduction pair:

  lexicographic combination of reduction pairs:
  
    1. lexicographic path order with precedence:
    
      precedence:
      
        n__from > cons > s > from > activate > |2ndsneg|# > |2ndspos|# > n__cons
      
      argument filter:
    
        pi(|2ndsneg|#) = 1
        pi(s) = 1
        pi(cons) = 1
        pi(n__cons) = 1
        pi(|2ndspos|#) = 1
        pi(activate) = 1
        pi(from) = 1
        pi(n__from) = 1
    
    2. lexicographic path order with precedence:
    
      precedence:
      
        n__from > cons > s > from > activate > |2ndspos|# > |2ndsneg|# > n__cons
      
      argument filter:
    
        pi(|2ndsneg|#) = 1
        pi(s) = [1]
        pi(cons) = 1
        pi(n__cons) = 1
        pi(|2ndspos|#) = [1]
        pi(activate) = [1]
        pi(from) = 1
        pi(n__from) = 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: 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,n__cons(Y,Z))) -> rcons(posrecip(activate(Y)),|2ndsneg|(N,activate(Z)))
r4: |2ndsneg|(|0|(),Z) -> rnil()
r5: |2ndsneg|(s(N),cons(X,n__cons(Y,Z))) -> rcons(negrecip(activate(Y)),|2ndspos|(N,activate(Z)))
r6: pi(X) -> |2ndspos|(X,from(|0|()))
r7: plus(|0|(),Y) -> Y
r8: plus(s(X),Y) -> s(plus(X,Y))
r9: times(|0|(),Y) -> |0|()
r10: times(s(X),Y) -> plus(Y,times(X,Y))
r11: square(X) -> times(X,X)
r12: from(X) -> n__from(X)
r13: cons(X1,X2) -> n__cons(X1,X2)
r14: activate(n__from(X)) -> from(X)
r15: activate(n__cons(X1,X2)) -> cons(X1,X2)
r16: activate(X) -> X

The set of usable rules consists of

  (no rules)

Take the reduction pair:

  lexicographic combination of reduction pairs:
  
    1. lexicographic path order with precedence:
    
      precedence:
      
        s > times#
      
      argument filter:
    
        pi(times#) = 1
        pi(s) = [1]
    
    2. lexicographic path order with precedence:
    
      precedence:
      
        s > times#
      
      argument filter:
    
        pi(times#) = [1]
        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,n__cons(Y,Z))) -> rcons(posrecip(activate(Y)),|2ndsneg|(N,activate(Z)))
r4: |2ndsneg|(|0|(),Z) -> rnil()
r5: |2ndsneg|(s(N),cons(X,n__cons(Y,Z))) -> rcons(negrecip(activate(Y)),|2ndspos|(N,activate(Z)))
r6: pi(X) -> |2ndspos|(X,from(|0|()))
r7: plus(|0|(),Y) -> Y
r8: plus(s(X),Y) -> s(plus(X,Y))
r9: times(|0|(),Y) -> |0|()
r10: times(s(X),Y) -> plus(Y,times(X,Y))
r11: square(X) -> times(X,X)
r12: from(X) -> n__from(X)
r13: cons(X1,X2) -> n__cons(X1,X2)
r14: activate(n__from(X)) -> from(X)
r15: activate(n__cons(X1,X2)) -> cons(X1,X2)
r16: activate(X) -> X

The set of usable rules consists of

  (no rules)

Take the reduction pair:

  lexicographic combination of reduction pairs:
  
    1. lexicographic path order with precedence:
    
      precedence:
      
        s > plus#
      
      argument filter:
    
        pi(plus#) = 1
        pi(s) = [1]
    
    2. lexicographic path order with precedence:
    
      precedence:
      
        s > plus#
      
      argument filter:
    
        pi(plus#) = [1]
        pi(s) = [1]
    

The next rules are strictly ordered:

  p1

We remove them from the problem.  Then no dependency pair remains.