(0) Obligation:

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

active(fst(0, Z)) → mark(nil)
active(fst(s(X), cons(Y, Z))) → mark(cons(Y, fst(X, Z)))
active(from(X)) → mark(cons(X, from(s(X))))
active(add(0, X)) → mark(X)
active(add(s(X), Y)) → mark(s(add(X, Y)))
active(len(nil)) → mark(0)
active(len(cons(X, Z))) → mark(s(len(Z)))
active(cons(X1, X2)) → cons(active(X1), X2)
active(fst(X1, X2)) → fst(active(X1), X2)
active(fst(X1, X2)) → fst(X1, active(X2))
active(from(X)) → from(active(X))
active(add(X1, X2)) → add(active(X1), X2)
active(add(X1, X2)) → add(X1, active(X2))
active(len(X)) → len(active(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
fst(mark(X1), X2) → mark(fst(X1, X2))
fst(X1, mark(X2)) → mark(fst(X1, X2))
from(mark(X)) → mark(from(X))
add(mark(X1), X2) → mark(add(X1, X2))
add(X1, mark(X2)) → mark(add(X1, X2))
len(mark(X)) → mark(len(X))
proper(0) → ok(0)
proper(s(X)) → s(proper(X))
proper(nil) → ok(nil)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(fst(X1, X2)) → fst(proper(X1), proper(X2))
proper(from(X)) → from(proper(X))
proper(add(X1, X2)) → add(proper(X1), proper(X2))
proper(len(X)) → len(proper(X))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
fst(ok(X1), ok(X2)) → ok(fst(X1, X2))
from(ok(X)) → ok(from(X))
add(ok(X1), ok(X2)) → ok(add(X1, X2))
len(ok(X)) → ok(len(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(fst(s(X), cons(Y, Z))) → CONS(Y, fst(X, Z))
ACTIVE(fst(s(X), cons(Y, Z))) → FST(X, Z)
ACTIVE(from(X)) → CONS(X, from(s(X)))
ACTIVE(from(X)) → FROM(s(X))
ACTIVE(from(X)) → S(X)
ACTIVE(add(s(X), Y)) → S(add(X, Y))
ACTIVE(add(s(X), Y)) → ADD(X, Y)
ACTIVE(len(cons(X, Z))) → S(len(Z))
ACTIVE(len(cons(X, Z))) → LEN(Z)
ACTIVE(cons(X1, X2)) → CONS(active(X1), X2)
ACTIVE(cons(X1, X2)) → ACTIVE(X1)
ACTIVE(fst(X1, X2)) → FST(active(X1), X2)
ACTIVE(fst(X1, X2)) → ACTIVE(X1)
ACTIVE(fst(X1, X2)) → FST(X1, active(X2))
ACTIVE(fst(X1, X2)) → ACTIVE(X2)
ACTIVE(from(X)) → FROM(active(X))
ACTIVE(from(X)) → ACTIVE(X)
ACTIVE(add(X1, X2)) → ADD(active(X1), X2)
ACTIVE(add(X1, X2)) → ACTIVE(X1)
ACTIVE(add(X1, X2)) → ADD(X1, active(X2))
ACTIVE(add(X1, X2)) → ACTIVE(X2)
ACTIVE(len(X)) → LEN(active(X))
ACTIVE(len(X)) → ACTIVE(X)
CONS(mark(X1), X2) → CONS(X1, X2)
FST(mark(X1), X2) → FST(X1, X2)
FST(X1, mark(X2)) → FST(X1, X2)
FROM(mark(X)) → FROM(X)
ADD(mark(X1), X2) → ADD(X1, X2)
ADD(X1, mark(X2)) → ADD(X1, X2)
LEN(mark(X)) → LEN(X)
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(fst(X1, X2)) → FST(proper(X1), proper(X2))
PROPER(fst(X1, X2)) → PROPER(X1)
PROPER(fst(X1, X2)) → PROPER(X2)
PROPER(from(X)) → FROM(proper(X))
PROPER(from(X)) → PROPER(X)
PROPER(add(X1, X2)) → ADD(proper(X1), proper(X2))
PROPER(add(X1, X2)) → PROPER(X1)
PROPER(add(X1, X2)) → PROPER(X2)
PROPER(len(X)) → LEN(proper(X))
PROPER(len(X)) → PROPER(X)
S(ok(X)) → S(X)
CONS(ok(X1), ok(X2)) → CONS(X1, X2)
FST(ok(X1), ok(X2)) → FST(X1, X2)
FROM(ok(X)) → FROM(X)
ADD(ok(X1), ok(X2)) → ADD(X1, X2)
LEN(ok(X)) → LEN(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(fst(0, Z)) → mark(nil)
active(fst(s(X), cons(Y, Z))) → mark(cons(Y, fst(X, Z)))
active(from(X)) → mark(cons(X, from(s(X))))
active(add(0, X)) → mark(X)
active(add(s(X), Y)) → mark(s(add(X, Y)))
active(len(nil)) → mark(0)
active(len(cons(X, Z))) → mark(s(len(Z)))
active(cons(X1, X2)) → cons(active(X1), X2)
active(fst(X1, X2)) → fst(active(X1), X2)
active(fst(X1, X2)) → fst(X1, active(X2))
active(from(X)) → from(active(X))
active(add(X1, X2)) → add(active(X1), X2)
active(add(X1, X2)) → add(X1, active(X2))
active(len(X)) → len(active(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
fst(mark(X1), X2) → mark(fst(X1, X2))
fst(X1, mark(X2)) → mark(fst(X1, X2))
from(mark(X)) → mark(from(X))
add(mark(X1), X2) → mark(add(X1, X2))
add(X1, mark(X2)) → mark(add(X1, X2))
len(mark(X)) → mark(len(X))
proper(0) → ok(0)
proper(s(X)) → s(proper(X))
proper(nil) → ok(nil)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(fst(X1, X2)) → fst(proper(X1), proper(X2))
proper(from(X)) → from(proper(X))
proper(add(X1, X2)) → add(proper(X1), proper(X2))
proper(len(X)) → len(proper(X))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
fst(ok(X1), ok(X2)) → ok(fst(X1, X2))
from(ok(X)) → ok(from(X))
add(ok(X1), ok(X2)) → ok(add(X1, X2))
len(ok(X)) → ok(len(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 9 SCCs with 24 less nodes.

(4) Complex Obligation (AND)

(5) Obligation:

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

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

The TRS R consists of the following rules:

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

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

LEN(ok(X)) → LEN(X)
LEN(mark(X)) → LEN(X)

The TRS R consists of the following rules:

active(fst(0, Z)) → mark(nil)
active(fst(s(X), cons(Y, Z))) → mark(cons(Y, fst(X, Z)))
active(from(X)) → mark(cons(X, from(s(X))))
active(add(0, X)) → mark(X)
active(add(s(X), Y)) → mark(s(add(X, Y)))
active(len(nil)) → mark(0)
active(len(cons(X, Z))) → mark(s(len(Z)))
active(cons(X1, X2)) → cons(active(X1), X2)
active(fst(X1, X2)) → fst(active(X1), X2)
active(fst(X1, X2)) → fst(X1, active(X2))
active(from(X)) → from(active(X))
active(add(X1, X2)) → add(active(X1), X2)
active(add(X1, X2)) → add(X1, active(X2))
active(len(X)) → len(active(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
fst(mark(X1), X2) → mark(fst(X1, X2))
fst(X1, mark(X2)) → mark(fst(X1, X2))
from(mark(X)) → mark(from(X))
add(mark(X1), X2) → mark(add(X1, X2))
add(X1, mark(X2)) → mark(add(X1, X2))
len(mark(X)) → mark(len(X))
proper(0) → ok(0)
proper(s(X)) → s(proper(X))
proper(nil) → ok(nil)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(fst(X1, X2)) → fst(proper(X1), proper(X2))
proper(from(X)) → from(proper(X))
proper(add(X1, X2)) → add(proper(X1), proper(X2))
proper(len(X)) → len(proper(X))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
fst(ok(X1), ok(X2)) → ok(fst(X1, X2))
from(ok(X)) → ok(from(X))
add(ok(X1), ok(X2)) → ok(add(X1, X2))
len(ok(X)) → ok(len(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.

(7) Obligation:

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

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

The TRS R consists of the following rules:

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

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

The TRS R consists of the following rules:

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

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

The TRS R consists of the following rules:

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

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

The TRS R consists of the following rules:

active(fst(0, Z)) → mark(nil)
active(fst(s(X), cons(Y, Z))) → mark(cons(Y, fst(X, Z)))
active(from(X)) → mark(cons(X, from(s(X))))
active(add(0, X)) → mark(X)
active(add(s(X), Y)) → mark(s(add(X, Y)))
active(len(nil)) → mark(0)
active(len(cons(X, Z))) → mark(s(len(Z)))
active(cons(X1, X2)) → cons(active(X1), X2)
active(fst(X1, X2)) → fst(active(X1), X2)
active(fst(X1, X2)) → fst(X1, active(X2))
active(from(X)) → from(active(X))
active(add(X1, X2)) → add(active(X1), X2)
active(add(X1, X2)) → add(X1, active(X2))
active(len(X)) → len(active(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
fst(mark(X1), X2) → mark(fst(X1, X2))
fst(X1, mark(X2)) → mark(fst(X1, X2))
from(mark(X)) → mark(from(X))
add(mark(X1), X2) → mark(add(X1, X2))
add(X1, mark(X2)) → mark(add(X1, X2))
len(mark(X)) → mark(len(X))
proper(0) → ok(0)
proper(s(X)) → s(proper(X))
proper(nil) → ok(nil)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(fst(X1, X2)) → fst(proper(X1), proper(X2))
proper(from(X)) → from(proper(X))
proper(add(X1, X2)) → add(proper(X1), proper(X2))
proper(len(X)) → len(proper(X))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
fst(ok(X1), ok(X2)) → ok(fst(X1, X2))
from(ok(X)) → ok(from(X))
add(ok(X1), ok(X2)) → ok(add(X1, X2))
len(ok(X)) → ok(len(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(cons(X1, X2)) → PROPER(X1)
PROPER(s(X)) → PROPER(X)
PROPER(cons(X1, X2)) → PROPER(X2)
PROPER(fst(X1, X2)) → PROPER(X1)
PROPER(fst(X1, X2)) → PROPER(X2)
PROPER(from(X)) → PROPER(X)
PROPER(add(X1, X2)) → PROPER(X1)
PROPER(add(X1, X2)) → PROPER(X2)
PROPER(len(X)) → PROPER(X)

The TRS R consists of the following rules:

active(fst(0, Z)) → mark(nil)
active(fst(s(X), cons(Y, Z))) → mark(cons(Y, fst(X, Z)))
active(from(X)) → mark(cons(X, from(s(X))))
active(add(0, X)) → mark(X)
active(add(s(X), Y)) → mark(s(add(X, Y)))
active(len(nil)) → mark(0)
active(len(cons(X, Z))) → mark(s(len(Z)))
active(cons(X1, X2)) → cons(active(X1), X2)
active(fst(X1, X2)) → fst(active(X1), X2)
active(fst(X1, X2)) → fst(X1, active(X2))
active(from(X)) → from(active(X))
active(add(X1, X2)) → add(active(X1), X2)
active(add(X1, X2)) → add(X1, active(X2))
active(len(X)) → len(active(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
fst(mark(X1), X2) → mark(fst(X1, X2))
fst(X1, mark(X2)) → mark(fst(X1, X2))
from(mark(X)) → mark(from(X))
add(mark(X1), X2) → mark(add(X1, X2))
add(X1, mark(X2)) → mark(add(X1, X2))
len(mark(X)) → mark(len(X))
proper(0) → ok(0)
proper(s(X)) → s(proper(X))
proper(nil) → ok(nil)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(fst(X1, X2)) → fst(proper(X1), proper(X2))
proper(from(X)) → from(proper(X))
proper(add(X1, X2)) → add(proper(X1), proper(X2))
proper(len(X)) → len(proper(X))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
fst(ok(X1), ok(X2)) → ok(fst(X1, X2))
from(ok(X)) → ok(from(X))
add(ok(X1), ok(X2)) → ok(add(X1, X2))
len(ok(X)) → ok(len(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(fst(X1, X2)) → ACTIVE(X1)
ACTIVE(cons(X1, X2)) → ACTIVE(X1)
ACTIVE(fst(X1, X2)) → ACTIVE(X2)
ACTIVE(from(X)) → ACTIVE(X)
ACTIVE(add(X1, X2)) → ACTIVE(X1)
ACTIVE(add(X1, X2)) → ACTIVE(X2)
ACTIVE(len(X)) → ACTIVE(X)

The TRS R consists of the following rules:

active(fst(0, Z)) → mark(nil)
active(fst(s(X), cons(Y, Z))) → mark(cons(Y, fst(X, Z)))
active(from(X)) → mark(cons(X, from(s(X))))
active(add(0, X)) → mark(X)
active(add(s(X), Y)) → mark(s(add(X, Y)))
active(len(nil)) → mark(0)
active(len(cons(X, Z))) → mark(s(len(Z)))
active(cons(X1, X2)) → cons(active(X1), X2)
active(fst(X1, X2)) → fst(active(X1), X2)
active(fst(X1, X2)) → fst(X1, active(X2))
active(from(X)) → from(active(X))
active(add(X1, X2)) → add(active(X1), X2)
active(add(X1, X2)) → add(X1, active(X2))
active(len(X)) → len(active(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
fst(mark(X1), X2) → mark(fst(X1, X2))
fst(X1, mark(X2)) → mark(fst(X1, X2))
from(mark(X)) → mark(from(X))
add(mark(X1), X2) → mark(add(X1, X2))
add(X1, mark(X2)) → mark(add(X1, X2))
len(mark(X)) → mark(len(X))
proper(0) → ok(0)
proper(s(X)) → s(proper(X))
proper(nil) → ok(nil)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(fst(X1, X2)) → fst(proper(X1), proper(X2))
proper(from(X)) → from(proper(X))
proper(add(X1, X2)) → add(proper(X1), proper(X2))
proper(len(X)) → len(proper(X))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
fst(ok(X1), ok(X2)) → ok(fst(X1, X2))
from(ok(X)) → ok(from(X))
add(ok(X1), ok(X2)) → ok(add(X1, X2))
len(ok(X)) → ok(len(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(fst(0, Z)) → mark(nil)
active(fst(s(X), cons(Y, Z))) → mark(cons(Y, fst(X, Z)))
active(from(X)) → mark(cons(X, from(s(X))))
active(add(0, X)) → mark(X)
active(add(s(X), Y)) → mark(s(add(X, Y)))
active(len(nil)) → mark(0)
active(len(cons(X, Z))) → mark(s(len(Z)))
active(cons(X1, X2)) → cons(active(X1), X2)
active(fst(X1, X2)) → fst(active(X1), X2)
active(fst(X1, X2)) → fst(X1, active(X2))
active(from(X)) → from(active(X))
active(add(X1, X2)) → add(active(X1), X2)
active(add(X1, X2)) → add(X1, active(X2))
active(len(X)) → len(active(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
fst(mark(X1), X2) → mark(fst(X1, X2))
fst(X1, mark(X2)) → mark(fst(X1, X2))
from(mark(X)) → mark(from(X))
add(mark(X1), X2) → mark(add(X1, X2))
add(X1, mark(X2)) → mark(add(X1, X2))
len(mark(X)) → mark(len(X))
proper(0) → ok(0)
proper(s(X)) → s(proper(X))
proper(nil) → ok(nil)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(fst(X1, X2)) → fst(proper(X1), proper(X2))
proper(from(X)) → from(proper(X))
proper(add(X1, X2)) → add(proper(X1), proper(X2))
proper(len(X)) → len(proper(X))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
fst(ok(X1), ok(X2)) → ok(fst(X1, X2))
from(ok(X)) → ok(from(X))
add(ok(X1), ok(X2)) → ok(add(X1, X2))
len(ok(X)) → ok(len(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.