Term Rewriting System R:
[X, Y, X1, X2, Z]
and(true, X) -> activate(X)
and(false, Y) -> false
if(true, X, Y) -> activate(X)
if(false, X, Y) -> activate(Y)
add(0, X) -> activate(X)
add(s(X), Y) -> s(nadd(activate(X), activate(Y)))
add(X1, X2) -> nadd(X1, X2)
first(0, X) -> nil
first(s(X), cons(Y, Z)) -> cons(activate(Y), nfirst(activate(X), activate(Z)))
first(X1, X2) -> nfirst(X1, X2)
from(X) -> cons(activate(X), nfrom(ns(activate(X))))
from(X) -> nfrom(X)
s(X) -> ns(X)
activate(nadd(X1, X2)) -> add(X1, X2)
activate(nfirst(X1, X2)) -> first(X1, X2)
activate(nfrom(X)) -> from(X)
activate(ns(X)) -> s(X)
activate(X) -> X

Termination of R to be shown.



   R
Dependency Pair Analysis



R contains the following Dependency Pairs:

AND(true, X) -> ACTIVATE(X)
IF(true, X, Y) -> ACTIVATE(X)
IF(false, X, Y) -> ACTIVATE(Y)
ADD(0, X) -> ACTIVATE(X)
ADD(s(X), Y) -> S(nadd(activate(X), activate(Y)))
ADD(s(X), Y) -> ACTIVATE(X)
ADD(s(X), Y) -> ACTIVATE(Y)
FIRST(s(X), cons(Y, Z)) -> ACTIVATE(Y)
FIRST(s(X), cons(Y, Z)) -> ACTIVATE(X)
FIRST(s(X), cons(Y, Z)) -> ACTIVATE(Z)
FROM(X) -> ACTIVATE(X)
ACTIVATE(nadd(X1, X2)) -> ADD(X1, X2)
ACTIVATE(nfirst(X1, X2)) -> FIRST(X1, X2)
ACTIVATE(nfrom(X)) -> FROM(X)
ACTIVATE(ns(X)) -> S(X)

Furthermore, R contains one SCC.


   R
DPs
       →DP Problem 1
Size-Change Principle


Dependency Pairs:

ADD(s(X), Y) -> ACTIVATE(Y)
ADD(s(X), Y) -> ACTIVATE(X)
FIRST(s(X), cons(Y, Z)) -> ACTIVATE(Z)
FIRST(s(X), cons(Y, Z)) -> ACTIVATE(X)
FROM(X) -> ACTIVATE(X)
ACTIVATE(nfrom(X)) -> FROM(X)
FIRST(s(X), cons(Y, Z)) -> ACTIVATE(Y)
ACTIVATE(nfirst(X1, X2)) -> FIRST(X1, X2)
ADD(0, X) -> ACTIVATE(X)
ACTIVATE(nadd(X1, X2)) -> ADD(X1, X2)


Rules:


and(true, X) -> activate(X)
and(false, Y) -> false
if(true, X, Y) -> activate(X)
if(false, X, Y) -> activate(Y)
add(0, X) -> activate(X)
add(s(X), Y) -> s(nadd(activate(X), activate(Y)))
add(X1, X2) -> nadd(X1, X2)
first(0, X) -> nil
first(s(X), cons(Y, Z)) -> cons(activate(Y), nfirst(activate(X), activate(Z)))
first(X1, X2) -> nfirst(X1, X2)
from(X) -> cons(activate(X), nfrom(ns(activate(X))))
from(X) -> nfrom(X)
s(X) -> ns(X)
activate(nadd(X1, X2)) -> add(X1, X2)
activate(nfirst(X1, X2)) -> first(X1, X2)
activate(nfrom(X)) -> from(X)
activate(ns(X)) -> s(X)
activate(X) -> X





We number the DPs as follows:
  1. ADD(s(X), Y) -> ACTIVATE(Y)
  2. ADD(s(X), Y) -> ACTIVATE(X)
  3. FIRST(s(X), cons(Y, Z)) -> ACTIVATE(Z)
  4. FIRST(s(X), cons(Y, Z)) -> ACTIVATE(X)
  5. FROM(X) -> ACTIVATE(X)
  6. ACTIVATE(nfrom(X)) -> FROM(X)
  7. FIRST(s(X), cons(Y, Z)) -> ACTIVATE(Y)
  8. ACTIVATE(nfirst(X1, X2)) -> FIRST(X1, X2)
  9. ADD(0, X) -> ACTIVATE(X)
  10. ACTIVATE(nadd(X1, X2)) -> ADD(X1, X2)
and get the following Size-Change Graph(s):
{9, 2, 1} , {9, 2, 1}
2=1
{9, 2, 1} , {9, 2, 1}
1>1
{7, 4, 3} , {7, 4, 3}
2>1
{7, 4, 3} , {7, 4, 3}
1>1
{5} , {5}
1=1
{6} , {6}
1>1
{8} , {8}
1>1
1>2
{10} , {10}
1>1
1>2

which lead(s) to this/these maximal multigraph(s):
{6} , {5}
1>1
{5} , {6}
1>1
{8} , {7, 4, 3}
1>1
{10} , {9, 2, 1}
1>1
{9, 2, 1} , {10}
1>1
1>2
{7, 4, 3} , {8}
2>1
2>2
{7, 4, 3} , {8}
1>1
1>2
{9, 2, 1} , {10}
2>1
2>2
{8} , {5}
1>1
{8} , {9, 2, 1}
1>1
{10} , {5}
1>1
{10} , {7, 4, 3}
1>1
{6} , {9, 2, 1}
1>1
{6} , {7, 4, 3}
1>1

DP: empty set
Oriented Rules: none

We used the order Homeomorphic Embedding Order with Non-Strict Precedence.
trivial

with Argument Filtering System:
nfrom(x1) -> nfrom(x1)
cons(x1, x2) -> cons(x1, x2)
s(x1) -> s(x1)
nadd(x1, x2) -> nadd(x1, x2)
nfirst(x1, x2) -> nfirst(x1, x2)

We obtain no new DP problems.

Termination of R successfully shown.
Duration:
0:00 minutes