(VAR N X Y Z)
(STRATEGY CONTEXTSENSITIVE 
  (terms 1)
  (cons 1)
  (recip 1)
  (sqr 1)
  (s 1)
  (0)
  (add 1 2)
  (dbl 1)
  (first 1 2)
  (nil)
  (half 1)
)
(RULES 
terms(N) -> cons(recip(sqr(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,first(X,Z))
half(0) -> 0
half(s(0)) -> 0
half(s(s(X))) -> s(half(X))
half(dbl(X)) -> X
)

Proving termination of context-sensitive rewriting for ExSec11_1_Luc02a:

-> Dependency pairs:
nF_terms(N) -> nF_sqr(N)
nF_sqr(s(X)) -> nF_add(sqr(X),dbl(X))
nF_sqr(s(X)) -> nF_sqr(X)
nF_sqr(s(X)) -> nF_dbl(X)
nF_dbl(s(X)) -> nF_dbl(X)
nF_add(s(X),Y) -> nF_add(X,Y)
nF_half(s(s(X))) -> nF_half(X)

-> Proof of termination for ExSec11_1_Luc02a_1_1:
-> -> Dependency pairs in cycle:
nF_half(s(s(X))) -> nF_half(X)

Termination proved: Cycles verify subterm criterion.

-> Proof of termination for ExSec11_1_Luc02a_1_2:
-> -> Dependency pairs in cycle:
nF_sqr(s(X)) -> nF_sqr(X)

Termination proved: Cycles verify subterm criterion.

-> Proof of termination for ExSec11_1_Luc02a_1_3:
-> -> Dependency pairs in cycle:
nF_add(s(X),Y) -> nF_add(X,Y)

Termination proved: Cycles verify subterm criterion.

-> Proof of termination for ExSec11_1_Luc02a_1_4:
-> -> Dependency pairs in cycle:
nF_dbl(s(X)) -> nF_dbl(X)

Termination proved: Cycles verify subterm criterion.

SETTINGS:
Base ordering: Polynomial ordering
Proof mode: SCCs in CSDG + base ordering
Upper bound for coeffs: 1
Rationals below 1 for all non-replacing args: No
Polynomial interpretation: Linear
Coeffs in polynomials: No rationals
Delta: automatic



Termination was proved succesfully.