Consider the TRS R consisting of the rewrite rules

1: from(X) -> cons(X,n__from(n__s(X)))
2: first(0,Z) -> nil
3: first(s(X),cons(Y,Z)) -> cons(Y,n__first(X,activate(Z)))
4: sel(0,cons(X,Z)) -> X
5: sel(s(X),cons(Y,Z)) -> sel(X,activate(Z))
6: from(X) -> n__from(X)
7: s(X) -> n__s(X)
8: first(X1,X2) -> n__first(X1,X2)
9: activate(n__from(X)) -> from(activate(X))
10: activate(n__s(X)) -> s(activate(X))
11: activate(n__first(X1,X2)) -> first(activate(X1),activate(X2))
12: activate(X) -> X

There are 10 dependency pairs:

13: FIRST(s(X),cons(Y,Z)) -> ACTIVATE(Z)
14: SEL(s(X),cons(Y,Z)) -> SEL(X,activate(Z))
15: SEL(s(X),cons(Y,Z)) -> ACTIVATE(Z)
16: ACTIVATE(n__from(X)) -> FROM(activate(X))
17: ACTIVATE(n__from(X)) -> ACTIVATE(X)
18: ACTIVATE(n__s(X)) -> S(activate(X))
19: ACTIVATE(n__s(X)) -> ACTIVATE(X)
20: ACTIVATE(n__first(X1,X2)) -> FIRST(activate(X1),activate(X2))
21: ACTIVATE(n__first(X1,X2)) -> ACTIVATE(X1)
22: ACTIVATE(n__first(X1,X2)) -> ACTIVATE(X2)

The approximated dependency graph contains 2 SCCs:
{13,17,19-22}
and {14}.

- Consider the SCC {13,17,19-22}.
The usable rules are {1-3,6-12}.
By taking the polynomial interpretation
[0] = [nil] = 1,
[activate](x) = [n__s](x) = [s](x) = x,
[ACTIVATE](x) = [from](x) = [n__from](x) = x + 1,
[first](x,y) = [FIRST](x,y) = [n__first](x,y) = x + y + 1
and [cons](x,y) = y,
the rules in {1,3,6-13,19}
are weakly decreasing and
the rules in {2,17,20-22}
are strictly decreasing.
There is one new SCC.

- Consider the SCC {19}.
There are no usable rules.
By taking the polynomial interpretation
[ACTIVATE](x) = [n__s](x) = x + 1,
rule 19
is strictly decreasing.


- Consider the SCC {14}.
The usable rules are {1-3,6-12}.
By taking the polynomial interpretation
[0] = [nil] = 1,
[activate](x) = x,
[cons](x,y) = [from](x) = [n__from](x) = [n__s](x) = [s](x) = [SEL](x,y) = x + 1
and [first](x,y) = [n__first](x,y) = x + y + 1,
the rules in {1,6-12}
are weakly decreasing and
the rules in {2,3,14}
are strictly decreasing.

Hence the TRS is terminating.