(0) Obligation:

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

active(first(0, X)) → mark(nil)
active(first(s(X), cons(Y, Z))) → mark(cons(Y, first(X, Z)))
active(from(X)) → mark(cons(X, from(s(X))))
active(first(X1, X2)) → first(active(X1), X2)
active(first(X1, X2)) → first(X1, active(X2))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(from(X)) → from(active(X))
first(mark(X1), X2) → mark(first(X1, X2))
first(X1, mark(X2)) → mark(first(X1, X2))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
from(mark(X)) → mark(from(X))
proper(first(X1, X2)) → first(proper(X1), proper(X2))
proper(0) → ok(0)
proper(nil) → ok(nil)
proper(s(X)) → s(proper(X))
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(from(X)) → from(proper(X))
first(ok(X1), ok(X2)) → ok(first(X1, X2))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
from(ok(X)) → ok(from(X))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(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:

ACTIVE(first(s(X), cons(Y, Z))) → CONS(Y, first(X, Z))
ACTIVE(first(s(X), cons(Y, Z))) → FIRST(X, Z)
ACTIVE(from(X)) → CONS(X, from(s(X)))
ACTIVE(from(X)) → FROM(s(X))
ACTIVE(from(X)) → S(X)
ACTIVE(first(X1, X2)) → FIRST(active(X1), X2)
ACTIVE(first(X1, X2)) → ACTIVE(X1)
ACTIVE(first(X1, X2)) → FIRST(X1, active(X2))
ACTIVE(first(X1, X2)) → ACTIVE(X2)
ACTIVE(s(X)) → S(active(X))
ACTIVE(s(X)) → ACTIVE(X)
ACTIVE(cons(X1, X2)) → CONS(active(X1), X2)
ACTIVE(cons(X1, X2)) → ACTIVE(X1)
ACTIVE(from(X)) → FROM(active(X))
ACTIVE(from(X)) → ACTIVE(X)
FIRST(mark(X1), X2) → FIRST(X1, X2)
FIRST(X1, mark(X2)) → FIRST(X1, X2)
S(mark(X)) → S(X)
CONS(mark(X1), X2) → CONS(X1, X2)
FROM(mark(X)) → FROM(X)
PROPER(first(X1, X2)) → FIRST(proper(X1), proper(X2))
PROPER(first(X1, X2)) → PROPER(X1)
PROPER(first(X1, X2)) → PROPER(X2)
PROPER(s(X)) → S(proper(X))
PROPER(s(X)) → PROPER(X)
PROPER(cons(X1, X2)) → CONS(proper(X1), proper(X2))
PROPER(cons(X1, X2)) → PROPER(X1)
PROPER(cons(X1, X2)) → PROPER(X2)
PROPER(from(X)) → FROM(proper(X))
PROPER(from(X)) → PROPER(X)
FIRST(ok(X1), ok(X2)) → FIRST(X1, X2)
S(ok(X)) → S(X)
CONS(ok(X1), ok(X2)) → CONS(X1, X2)
FROM(ok(X)) → FROM(X)
TOP(mark(X)) → TOP(proper(X))
TOP(mark(X)) → PROPER(X)
TOP(ok(X)) → TOP(active(X))
TOP(ok(X)) → ACTIVE(X)

The TRS R consists of the following rules:

active(first(0, X)) → mark(nil)
active(first(s(X), cons(Y, Z))) → mark(cons(Y, first(X, Z)))
active(from(X)) → mark(cons(X, from(s(X))))
active(first(X1, X2)) → first(active(X1), X2)
active(first(X1, X2)) → first(X1, active(X2))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(from(X)) → from(active(X))
first(mark(X1), X2) → mark(first(X1, X2))
first(X1, mark(X2)) → mark(first(X1, X2))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
from(mark(X)) → mark(from(X))
proper(first(X1, X2)) → first(proper(X1), proper(X2))
proper(0) → ok(0)
proper(nil) → ok(nil)
proper(s(X)) → s(proper(X))
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(from(X)) → from(proper(X))
first(ok(X1), ok(X2)) → ok(first(X1, X2))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
from(ok(X)) → ok(from(X))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(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 7 SCCs with 16 less nodes.

(4) Complex Obligation (AND)

(5) Obligation:

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

FROM(ok(X)) → FROM(X)
FROM(mark(X)) → FROM(X)

The TRS R consists of the following rules:

active(first(0, X)) → mark(nil)
active(first(s(X), cons(Y, Z))) → mark(cons(Y, first(X, Z)))
active(from(X)) → mark(cons(X, from(s(X))))
active(first(X1, X2)) → first(active(X1), X2)
active(first(X1, X2)) → first(X1, active(X2))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(from(X)) → from(active(X))
first(mark(X1), X2) → mark(first(X1, X2))
first(X1, mark(X2)) → mark(first(X1, X2))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
from(mark(X)) → mark(from(X))
proper(first(X1, X2)) → first(proper(X1), proper(X2))
proper(0) → ok(0)
proper(nil) → ok(nil)
proper(s(X)) → s(proper(X))
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(from(X)) → from(proper(X))
first(ok(X1), ok(X2)) → ok(first(X1, X2))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
from(ok(X)) → ok(from(X))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

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

(6) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


FROM(ok(X)) → FROM(X)
The remaining pairs can at least be oriented weakly.
Used ordering: Combined order from the following AFS and order.
FROM(x1)  =  x1
ok(x1)  =  ok(x1)
mark(x1)  =  x1
active(x1)  =  x1
first(x1, x2)  =  x2
0  =  0
nil  =  nil
s(x1)  =  x1
cons(x1, x2)  =  x2
from(x1)  =  x1
proper(x1)  =  proper
top(x1)  =  top

Lexicographic path order with status [LPO].
Quasi-Precedence:
proper > ok1 > nil
proper > 0 > nil
top > nil

Status:
trivial


The following usable rules [FROCOS05] were oriented:

active(first(0, X)) → mark(nil)
active(first(s(X), cons(Y, Z))) → mark(cons(Y, first(X, Z)))
active(from(X)) → mark(cons(X, from(s(X))))
active(first(X1, X2)) → first(active(X1), X2)
active(first(X1, X2)) → first(X1, active(X2))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(from(X)) → from(active(X))
first(mark(X1), X2) → mark(first(X1, X2))
first(X1, mark(X2)) → mark(first(X1, X2))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
from(mark(X)) → mark(from(X))
proper(first(X1, X2)) → first(proper(X1), proper(X2))
proper(0) → ok(0)
proper(nil) → ok(nil)
proper(s(X)) → s(proper(X))
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(from(X)) → from(proper(X))
first(ok(X1), ok(X2)) → ok(first(X1, X2))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
from(ok(X)) → ok(from(X))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

(7) Obligation:

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

FROM(mark(X)) → FROM(X)

The TRS R consists of the following rules:

active(first(0, X)) → mark(nil)
active(first(s(X), cons(Y, Z))) → mark(cons(Y, first(X, Z)))
active(from(X)) → mark(cons(X, from(s(X))))
active(first(X1, X2)) → first(active(X1), X2)
active(first(X1, X2)) → first(X1, active(X2))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(from(X)) → from(active(X))
first(mark(X1), X2) → mark(first(X1, X2))
first(X1, mark(X2)) → mark(first(X1, X2))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
from(mark(X)) → mark(from(X))
proper(first(X1, X2)) → first(proper(X1), proper(X2))
proper(0) → ok(0)
proper(nil) → ok(nil)
proper(s(X)) → s(proper(X))
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(from(X)) → from(proper(X))
first(ok(X1), ok(X2)) → ok(first(X1, X2))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
from(ok(X)) → ok(from(X))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

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

(8) Obligation:

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

CONS(ok(X1), ok(X2)) → CONS(X1, X2)
CONS(mark(X1), X2) → CONS(X1, X2)

The TRS R consists of the following rules:

active(first(0, X)) → mark(nil)
active(first(s(X), cons(Y, Z))) → mark(cons(Y, first(X, Z)))
active(from(X)) → mark(cons(X, from(s(X))))
active(first(X1, X2)) → first(active(X1), X2)
active(first(X1, X2)) → first(X1, active(X2))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(from(X)) → from(active(X))
first(mark(X1), X2) → mark(first(X1, X2))
first(X1, mark(X2)) → mark(first(X1, X2))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
from(mark(X)) → mark(from(X))
proper(first(X1, X2)) → first(proper(X1), proper(X2))
proper(0) → ok(0)
proper(nil) → ok(nil)
proper(s(X)) → s(proper(X))
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(from(X)) → from(proper(X))
first(ok(X1), ok(X2)) → ok(first(X1, X2))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
from(ok(X)) → ok(from(X))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

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

(9) Obligation:

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

S(ok(X)) → S(X)
S(mark(X)) → S(X)

The TRS R consists of the following rules:

active(first(0, X)) → mark(nil)
active(first(s(X), cons(Y, Z))) → mark(cons(Y, first(X, Z)))
active(from(X)) → mark(cons(X, from(s(X))))
active(first(X1, X2)) → first(active(X1), X2)
active(first(X1, X2)) → first(X1, active(X2))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(from(X)) → from(active(X))
first(mark(X1), X2) → mark(first(X1, X2))
first(X1, mark(X2)) → mark(first(X1, X2))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
from(mark(X)) → mark(from(X))
proper(first(X1, X2)) → first(proper(X1), proper(X2))
proper(0) → ok(0)
proper(nil) → ok(nil)
proper(s(X)) → s(proper(X))
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(from(X)) → from(proper(X))
first(ok(X1), ok(X2)) → ok(first(X1, X2))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
from(ok(X)) → ok(from(X))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

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

(10) Obligation:

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

FIRST(X1, mark(X2)) → FIRST(X1, X2)
FIRST(mark(X1), X2) → FIRST(X1, X2)
FIRST(ok(X1), ok(X2)) → FIRST(X1, X2)

The TRS R consists of the following rules:

active(first(0, X)) → mark(nil)
active(first(s(X), cons(Y, Z))) → mark(cons(Y, first(X, Z)))
active(from(X)) → mark(cons(X, from(s(X))))
active(first(X1, X2)) → first(active(X1), X2)
active(first(X1, X2)) → first(X1, active(X2))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(from(X)) → from(active(X))
first(mark(X1), X2) → mark(first(X1, X2))
first(X1, mark(X2)) → mark(first(X1, X2))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
from(mark(X)) → mark(from(X))
proper(first(X1, X2)) → first(proper(X1), proper(X2))
proper(0) → ok(0)
proper(nil) → ok(nil)
proper(s(X)) → s(proper(X))
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(from(X)) → from(proper(X))
first(ok(X1), ok(X2)) → ok(first(X1, X2))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
from(ok(X)) → ok(from(X))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

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

(11) Obligation:

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

PROPER(first(X1, X2)) → PROPER(X2)
PROPER(first(X1, X2)) → PROPER(X1)
PROPER(s(X)) → PROPER(X)
PROPER(cons(X1, X2)) → PROPER(X1)
PROPER(cons(X1, X2)) → PROPER(X2)
PROPER(from(X)) → PROPER(X)

The TRS R consists of the following rules:

active(first(0, X)) → mark(nil)
active(first(s(X), cons(Y, Z))) → mark(cons(Y, first(X, Z)))
active(from(X)) → mark(cons(X, from(s(X))))
active(first(X1, X2)) → first(active(X1), X2)
active(first(X1, X2)) → first(X1, active(X2))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(from(X)) → from(active(X))
first(mark(X1), X2) → mark(first(X1, X2))
first(X1, mark(X2)) → mark(first(X1, X2))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
from(mark(X)) → mark(from(X))
proper(first(X1, X2)) → first(proper(X1), proper(X2))
proper(0) → ok(0)
proper(nil) → ok(nil)
proper(s(X)) → s(proper(X))
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(from(X)) → from(proper(X))
first(ok(X1), ok(X2)) → ok(first(X1, X2))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
from(ok(X)) → ok(from(X))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

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

(12) Obligation:

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

ACTIVE(first(X1, X2)) → ACTIVE(X2)
ACTIVE(first(X1, X2)) → ACTIVE(X1)
ACTIVE(s(X)) → ACTIVE(X)
ACTIVE(cons(X1, X2)) → ACTIVE(X1)
ACTIVE(from(X)) → ACTIVE(X)

The TRS R consists of the following rules:

active(first(0, X)) → mark(nil)
active(first(s(X), cons(Y, Z))) → mark(cons(Y, first(X, Z)))
active(from(X)) → mark(cons(X, from(s(X))))
active(first(X1, X2)) → first(active(X1), X2)
active(first(X1, X2)) → first(X1, active(X2))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(from(X)) → from(active(X))
first(mark(X1), X2) → mark(first(X1, X2))
first(X1, mark(X2)) → mark(first(X1, X2))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
from(mark(X)) → mark(from(X))
proper(first(X1, X2)) → first(proper(X1), proper(X2))
proper(0) → ok(0)
proper(nil) → ok(nil)
proper(s(X)) → s(proper(X))
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(from(X)) → from(proper(X))
first(ok(X1), ok(X2)) → ok(first(X1, X2))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
from(ok(X)) → ok(from(X))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

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

(13) Obligation:

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

TOP(ok(X)) → TOP(active(X))
TOP(mark(X)) → TOP(proper(X))

The TRS R consists of the following rules:

active(first(0, X)) → mark(nil)
active(first(s(X), cons(Y, Z))) → mark(cons(Y, first(X, Z)))
active(from(X)) → mark(cons(X, from(s(X))))
active(first(X1, X2)) → first(active(X1), X2)
active(first(X1, X2)) → first(X1, active(X2))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(from(X)) → from(active(X))
first(mark(X1), X2) → mark(first(X1, X2))
first(X1, mark(X2)) → mark(first(X1, X2))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
from(mark(X)) → mark(from(X))
proper(first(X1, X2)) → first(proper(X1), proper(X2))
proper(0) → ok(0)
proper(nil) → ok(nil)
proper(s(X)) → s(proper(X))
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(from(X)) → from(proper(X))
first(ok(X1), ok(X2)) → ok(first(X1, X2))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
from(ok(X)) → ok(from(X))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

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