Term Rewriting System R:
[X, Z, Y]
from(X) -> cons(X, from(s(X)))
first(0, Z) -> nil
first(s(X), cons(Y, Z)) -> cons(Y, first(X, Z))
sel(0, cons(X, Z)) -> X
sel(s(X), cons(Y, Z)) -> sel(X, Z)

Termination of R to be shown.



   R
Overlay and local confluence Check



The TRS is overlay and locally confluent (all critical pairs are trivially joinable).Hence, we can switch to innermost.


   R
OC
       →TRS2
Dependency Pair Analysis



R contains the following Dependency Pairs:

FROM(X) -> FROM(s(X))
FIRST(s(X), cons(Y, Z)) -> FIRST(X, Z)
SEL(s(X), cons(Y, Z)) -> SEL(X, Z)

Furthermore, R contains three SCCs.


   R
OC
       →TRS2
DPs
           →DP Problem 1
Usable Rules (Innermost)


Dependency Pair:

FROM(X) -> FROM(s(X))


Rules:


from(X) -> cons(X, from(s(X)))
first(0, Z) -> nil
first(s(X), cons(Y, Z)) -> cons(Y, first(X, Z))
sel(0, cons(X, Z)) -> X
sel(s(X), cons(Y, Z)) -> sel(X, Z)


Strategy:

innermost




As we are in the innermost case, we can delete all 5 non-usable-rules.


   R
OC
       →TRS2
DPs
           →DP Problem 1
UsableRules
             ...
               →DP Problem 4
Non Termination


Dependency Pair:

FROM(X) -> FROM(s(X))


Rule:

none


Strategy:

innermost




Found an infinite P-chain over R:
P =

FROM(X) -> FROM(s(X))

R = none

s = FROM(X)
evaluates to t =FROM(s(X))

Thus, s starts an infinite chain as s matches t.

Non-Termination of R could be shown.
Duration:
0:01 minutes