(VAR X Y Z)
(STRATEGY CONTEXTSENSITIVE 
  (f 1)
  (cons 1)
  (g 1)
  (0)
  (s 1)
  (sel 1 2)
)
(RULES 
f(X) -> cons(X,f(g(X)))
g(0) -> s(0)
g(s(X)) -> s(s(g(X)))
sel(0,cons(X,Y)) -> X
sel(s(X),cons(Y,Z)) -> sel(X,Z)
)

The TRS is orthogonal, thus termination of innermost context-sensitive rewriting is equivalent to termination of context-sensitive rewriting.

Proving termination of context-sensitive rewriting for Ex4_Zan97:

-> Dependency pairs:
nF_g(s(X)) -> nF_g(X)
nF_sel(s(X),cons(Y,Z)) -> nF_sel(X,Z)
nF_sel(s(X),cons(Y,Z)) -> Z

-> Proof of termination for Ex4_Zan97_1_1:
-> -> Dependency pairs in cycle:
nF_sel(s(X),cons(Y,Z)) -> nF_sel(X,Z)

Termination proved: Cycles verify subterm criterion.

-> Proof of termination for Ex4_Zan97_1_2:
-> -> Dependency pairs in cycle:
nF_g(s(X)) -> nF_g(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.