(0) Obligation:

Q restricted rewrite system:
The TRS R consists of the following rules:

first(0, X) → nil
first(s(X), cons(Y, Z)) → cons(Y, n__first(X, activate(Z)))
from(X) → cons(X, n__from(s(X)))
first(X1, X2) → n__first(X1, X2)
from(X) → n__from(X)
activate(n__first(X1, X2)) → first(X1, X2)
activate(n__from(X)) → from(X)
activate(X) → X

Q is empty.

(1) DependencyPairsProof (EQUIVALENT transformation)

Using Dependency Pairs [AG00,LPAR04] we result in the following initial DP problem.

(2) Obligation:

Q DP problem:
The TRS P consists of the following rules:

FIRST(s(X), cons(Y, Z)) → ACTIVATE(Z)
ACTIVATE(n__first(X1, X2)) → FIRST(X1, X2)
ACTIVATE(n__from(X)) → FROM(X)

The TRS R consists of the following rules:

first(0, X) → nil
first(s(X), cons(Y, Z)) → cons(Y, n__first(X, activate(Z)))
from(X) → cons(X, n__from(s(X)))
first(X1, X2) → n__first(X1, X2)
from(X) → n__from(X)
activate(n__first(X1, X2)) → first(X1, X2)
activate(n__from(X)) → from(X)
activate(X) → X

Q is empty.
We have to consider all minimal (P,Q,R)-chains.

(3) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 1 SCC with 1 less node.

(4) Obligation:

Q DP problem:
The TRS P consists of the following rules:

ACTIVATE(n__first(X1, X2)) → FIRST(X1, X2)
FIRST(s(X), cons(Y, Z)) → ACTIVATE(Z)

The TRS R consists of the following rules:

first(0, X) → nil
first(s(X), cons(Y, Z)) → cons(Y, n__first(X, activate(Z)))
from(X) → cons(X, n__from(s(X)))
first(X1, X2) → n__first(X1, X2)
from(X) → n__from(X)
activate(n__first(X1, X2)) → first(X1, X2)
activate(n__from(X)) → from(X)
activate(X) → X

Q is empty.
We have to consider all minimal (P,Q,R)-chains.

(5) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


FIRST(s(X), cons(Y, Z)) → ACTIVATE(Z)
The remaining pairs can at least be oriented weakly.
Used ordering: SCNP Order with the following components:
Level mapping:
Top level AFS:
ACTIVATE(x0, x1)  =  ACTIVATE(x1)
FIRST(x0, x1, x2)  =  FIRST(x1, x2)

Tags:
ACTIVATE has argument tags [0,3] and root tag 1
FIRST has argument tags [7,3,3] and root tag 1

Comparison: MAX
Underlying order for the size change arcs and the rules of R:
Polynomial interpretation [POLO]:

POL(ACTIVATE(x1)) = x1   
POL(FIRST(x1, x2)) = 1   
POL(cons(x1, x2)) = 1 + x2   
POL(n__first(x1, x2)) = x1 + x2   
POL(s(x1)) = 0   

The following usable rules [FROCOS05] were oriented: none

(6) Obligation:

Q DP problem:
The TRS P consists of the following rules:

ACTIVATE(n__first(X1, X2)) → FIRST(X1, X2)

The TRS R consists of the following rules:

first(0, X) → nil
first(s(X), cons(Y, Z)) → cons(Y, n__first(X, activate(Z)))
from(X) → cons(X, n__from(s(X)))
first(X1, X2) → n__first(X1, X2)
from(X) → n__from(X)
activate(n__first(X1, X2)) → first(X1, X2)
activate(n__from(X)) → from(X)
activate(X) → X

Q is empty.
We have to consider all minimal (P,Q,R)-chains.

(7) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 0 SCCs with 1 less node.

(8) TRUE