YES

We show the termination of the TRS R:

  terms(N) -> cons(recip(sqr(N)),n__terms(s(N)))
  sqr(|0|()) -> |0|()
  sqr(s(X)) -> s(add(sqr(X),dbl(X)))
  dbl(|0|()) -> |0|()
  dbl(s(X)) -> s(s(dbl(X)))
  add(|0|(),X) -> X
  add(s(X),Y) -> s(add(X,Y))
  first(|0|(),X) -> nil()
  first(s(X),cons(Y,Z)) -> cons(Y,n__first(X,activate(Z)))
  half(|0|()) -> |0|()
  half(s(|0|())) -> |0|()
  half(s(s(X))) -> s(half(X))
  half(dbl(X)) -> X
  terms(X) -> n__terms(X)
  first(X1,X2) -> n__first(X1,X2)
  activate(n__terms(X)) -> terms(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: terms#(N) -> sqr#(N)
p2: sqr#(s(X)) -> add#(sqr(X),dbl(X))
p3: sqr#(s(X)) -> sqr#(X)
p4: sqr#(s(X)) -> dbl#(X)
p5: dbl#(s(X)) -> dbl#(X)
p6: add#(s(X),Y) -> add#(X,Y)
p7: first#(s(X),cons(Y,Z)) -> activate#(Z)
p8: half#(s(s(X))) -> half#(X)
p9: activate#(n__terms(X)) -> terms#(X)
p10: activate#(n__first(X1,X2)) -> first#(X1,X2)

and R consists of:

r1: terms(N) -> cons(recip(sqr(N)),n__terms(s(N)))
r2: sqr(|0|()) -> |0|()
r3: sqr(s(X)) -> s(add(sqr(X),dbl(X)))
r4: dbl(|0|()) -> |0|()
r5: dbl(s(X)) -> s(s(dbl(X)))
r6: add(|0|(),X) -> X
r7: add(s(X),Y) -> s(add(X,Y))
r8: first(|0|(),X) -> nil()
r9: first(s(X),cons(Y,Z)) -> cons(Y,n__first(X,activate(Z)))
r10: half(|0|()) -> |0|()
r11: half(s(|0|())) -> |0|()
r12: half(s(s(X))) -> s(half(X))
r13: half(dbl(X)) -> X
r14: terms(X) -> n__terms(X)
r15: first(X1,X2) -> n__first(X1,X2)
r16: activate(n__terms(X)) -> terms(X)
r17: activate(n__first(X1,X2)) -> first(X1,X2)
r18: activate(X) -> X

The estimated dependency graph contains the following SCCs:

  {p7, p10}
  {p3}
  {p6}
  {p5}
  {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__first(X1,X2)) -> first#(X1,X2)

and R consists of:

r1: terms(N) -> cons(recip(sqr(N)),n__terms(s(N)))
r2: sqr(|0|()) -> |0|()
r3: sqr(s(X)) -> s(add(sqr(X),dbl(X)))
r4: dbl(|0|()) -> |0|()
r5: dbl(s(X)) -> s(s(dbl(X)))
r6: add(|0|(),X) -> X
r7: add(s(X),Y) -> s(add(X,Y))
r8: first(|0|(),X) -> nil()
r9: first(s(X),cons(Y,Z)) -> cons(Y,n__first(X,activate(Z)))
r10: half(|0|()) -> |0|()
r11: half(s(|0|())) -> |0|()
r12: half(s(s(X))) -> s(half(X))
r13: half(dbl(X)) -> X
r14: terms(X) -> n__terms(X)
r15: first(X1,X2) -> n__first(X1,X2)
r16: activate(n__terms(X)) -> terms(X)
r17: activate(n__first(X1,X2)) -> first(X1,X2)
r18: activate(X) -> X

The set of usable rules consists of

  (no rules)

Take the reduction pair:

  lexicographic combination of reduction pairs:
  
    1. matrix interpretations:
    
      carrier: N^1
      order: standard order
      interpretations:
        first#_A(x1,x2) = x2
        s_A(x1) = 1
        cons_A(x1,x2) = x1 + x2 + 1
        activate#_A(x1) = x1
        n__first_A(x1,x2) = x1 + x2 + 1
    
    2. lexicographic path order with precedence:
    
      precedence:
      
        first# > n__first > activate# > cons > s
      
      argument filter:
    
        pi(first#) = 2
        pi(s) = []
        pi(cons) = [1, 2]
        pi(activate#) = 1
        pi(n__first) = [1, 2]
    

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: sqr#(s(X)) -> sqr#(X)

and R consists of:

r1: terms(N) -> cons(recip(sqr(N)),n__terms(s(N)))
r2: sqr(|0|()) -> |0|()
r3: sqr(s(X)) -> s(add(sqr(X),dbl(X)))
r4: dbl(|0|()) -> |0|()
r5: dbl(s(X)) -> s(s(dbl(X)))
r6: add(|0|(),X) -> X
r7: add(s(X),Y) -> s(add(X,Y))
r8: first(|0|(),X) -> nil()
r9: first(s(X),cons(Y,Z)) -> cons(Y,n__first(X,activate(Z)))
r10: half(|0|()) -> |0|()
r11: half(s(|0|())) -> |0|()
r12: half(s(s(X))) -> s(half(X))
r13: half(dbl(X)) -> X
r14: terms(X) -> n__terms(X)
r15: first(X1,X2) -> n__first(X1,X2)
r16: activate(n__terms(X)) -> terms(X)
r17: activate(n__first(X1,X2)) -> first(X1,X2)
r18: activate(X) -> X

The set of usable rules consists of

  (no rules)

Take the monotone reduction pair:

  lexicographic combination of reduction pairs:
  
    1. matrix interpretations:
    
      carrier: N^1
      order: standard order
      interpretations:
        sqr#_A(x1) = x1
        s_A(x1) = x1 + 1
    
    2. lexicographic path order with precedence:
    
      precedence:
      
        s > sqr#
      
      argument filter:
    
        pi(sqr#) = 1
        pi(s) = [1]
    

The next rules are strictly ordered:

  p1
  r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13, r14, r15, r16, r17, r18

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: add#(s(X),Y) -> add#(X,Y)

and R consists of:

r1: terms(N) -> cons(recip(sqr(N)),n__terms(s(N)))
r2: sqr(|0|()) -> |0|()
r3: sqr(s(X)) -> s(add(sqr(X),dbl(X)))
r4: dbl(|0|()) -> |0|()
r5: dbl(s(X)) -> s(s(dbl(X)))
r6: add(|0|(),X) -> X
r7: add(s(X),Y) -> s(add(X,Y))
r8: first(|0|(),X) -> nil()
r9: first(s(X),cons(Y,Z)) -> cons(Y,n__first(X,activate(Z)))
r10: half(|0|()) -> |0|()
r11: half(s(|0|())) -> |0|()
r12: half(s(s(X))) -> s(half(X))
r13: half(dbl(X)) -> X
r14: terms(X) -> n__terms(X)
r15: first(X1,X2) -> n__first(X1,X2)
r16: activate(n__terms(X)) -> terms(X)
r17: activate(n__first(X1,X2)) -> first(X1,X2)
r18: activate(X) -> X

The set of usable rules consists of

  (no rules)

Take the reduction pair:

  lexicographic combination of reduction pairs:
  
    1. matrix interpretations:
    
      carrier: N^1
      order: standard order
      interpretations:
        add#_A(x1,x2) = x1
        s_A(x1) = x1 + 1
    
    2. lexicographic path order with precedence:
    
      precedence:
      
        s > add#
      
      argument filter:
    
        pi(add#) = [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: dbl#(s(X)) -> dbl#(X)

and R consists of:

r1: terms(N) -> cons(recip(sqr(N)),n__terms(s(N)))
r2: sqr(|0|()) -> |0|()
r3: sqr(s(X)) -> s(add(sqr(X),dbl(X)))
r4: dbl(|0|()) -> |0|()
r5: dbl(s(X)) -> s(s(dbl(X)))
r6: add(|0|(),X) -> X
r7: add(s(X),Y) -> s(add(X,Y))
r8: first(|0|(),X) -> nil()
r9: first(s(X),cons(Y,Z)) -> cons(Y,n__first(X,activate(Z)))
r10: half(|0|()) -> |0|()
r11: half(s(|0|())) -> |0|()
r12: half(s(s(X))) -> s(half(X))
r13: half(dbl(X)) -> X
r14: terms(X) -> n__terms(X)
r15: first(X1,X2) -> n__first(X1,X2)
r16: activate(n__terms(X)) -> terms(X)
r17: activate(n__first(X1,X2)) -> first(X1,X2)
r18: activate(X) -> X

The set of usable rules consists of

  (no rules)

Take the monotone reduction pair:

  lexicographic combination of reduction pairs:
  
    1. matrix interpretations:
    
      carrier: N^1
      order: standard order
      interpretations:
        dbl#_A(x1) = x1
        s_A(x1) = x1 + 1
    
    2. lexicographic path order with precedence:
    
      precedence:
      
        s > dbl#
      
      argument filter:
    
        pi(dbl#) = 1
        pi(s) = [1]
    

The next rules are strictly ordered:

  p1
  r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13, r14, r15, r16, r17, r18

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: half#(s(s(X))) -> half#(X)

and R consists of:

r1: terms(N) -> cons(recip(sqr(N)),n__terms(s(N)))
r2: sqr(|0|()) -> |0|()
r3: sqr(s(X)) -> s(add(sqr(X),dbl(X)))
r4: dbl(|0|()) -> |0|()
r5: dbl(s(X)) -> s(s(dbl(X)))
r6: add(|0|(),X) -> X
r7: add(s(X),Y) -> s(add(X,Y))
r8: first(|0|(),X) -> nil()
r9: first(s(X),cons(Y,Z)) -> cons(Y,n__first(X,activate(Z)))
r10: half(|0|()) -> |0|()
r11: half(s(|0|())) -> |0|()
r12: half(s(s(X))) -> s(half(X))
r13: half(dbl(X)) -> X
r14: terms(X) -> n__terms(X)
r15: first(X1,X2) -> n__first(X1,X2)
r16: activate(n__terms(X)) -> terms(X)
r17: activate(n__first(X1,X2)) -> first(X1,X2)
r18: activate(X) -> X

The set of usable rules consists of

  (no rules)

Take the monotone reduction pair:

  lexicographic combination of reduction pairs:
  
    1. matrix interpretations:
    
      carrier: N^1
      order: standard order
      interpretations:
        half#_A(x1) = x1
        s_A(x1) = x1 + 1
    
    2. lexicographic path order with precedence:
    
      precedence:
      
        s > half#
      
      argument filter:
    
        pi(half#) = [1]
        pi(s) = [1]
    

The next rules are strictly ordered:

  p1
  r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13, r14, r15, r16, r17, r18

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