(0) Obligation:

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

active(f(X)) → mark(cons(X, f(g(X))))
active(g(0)) → mark(s(0))
active(g(s(X))) → mark(s(s(g(X))))
active(sel(0, cons(X, Y))) → mark(X)
active(sel(s(X), cons(Y, Z))) → mark(sel(X, Z))
active(f(X)) → f(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(g(X)) → g(active(X))
active(s(X)) → s(active(X))
active(sel(X1, X2)) → sel(active(X1), X2)
active(sel(X1, X2)) → sel(X1, active(X2))
f(mark(X)) → mark(f(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
g(mark(X)) → mark(g(X))
s(mark(X)) → mark(s(X))
sel(mark(X1), X2) → mark(sel(X1, X2))
sel(X1, mark(X2)) → mark(sel(X1, X2))
proper(f(X)) → f(proper(X))
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(g(X)) → g(proper(X))
proper(0) → ok(0)
proper(s(X)) → s(proper(X))
proper(sel(X1, X2)) → sel(proper(X1), proper(X2))
f(ok(X)) → ok(f(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
g(ok(X)) → ok(g(X))
s(ok(X)) → ok(s(X))
sel(ok(X1), ok(X2)) → ok(sel(X1, X2))
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(f(X)) → CONS(X, f(g(X)))
ACTIVE(f(X)) → F(g(X))
ACTIVE(f(X)) → G(X)
ACTIVE(g(0)) → S(0)
ACTIVE(g(s(X))) → S(s(g(X)))
ACTIVE(g(s(X))) → S(g(X))
ACTIVE(g(s(X))) → G(X)
ACTIVE(sel(s(X), cons(Y, Z))) → SEL(X, Z)
ACTIVE(f(X)) → F(active(X))
ACTIVE(f(X)) → ACTIVE(X)
ACTIVE(cons(X1, X2)) → CONS(active(X1), X2)
ACTIVE(cons(X1, X2)) → ACTIVE(X1)
ACTIVE(g(X)) → G(active(X))
ACTIVE(g(X)) → ACTIVE(X)
ACTIVE(s(X)) → S(active(X))
ACTIVE(s(X)) → ACTIVE(X)
ACTIVE(sel(X1, X2)) → SEL(active(X1), X2)
ACTIVE(sel(X1, X2)) → ACTIVE(X1)
ACTIVE(sel(X1, X2)) → SEL(X1, active(X2))
ACTIVE(sel(X1, X2)) → ACTIVE(X2)
F(mark(X)) → F(X)
CONS(mark(X1), X2) → CONS(X1, X2)
G(mark(X)) → G(X)
S(mark(X)) → S(X)
SEL(mark(X1), X2) → SEL(X1, X2)
SEL(X1, mark(X2)) → SEL(X1, X2)
PROPER(f(X)) → F(proper(X))
PROPER(f(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(g(X)) → G(proper(X))
PROPER(g(X)) → PROPER(X)
PROPER(s(X)) → S(proper(X))
PROPER(s(X)) → PROPER(X)
PROPER(sel(X1, X2)) → SEL(proper(X1), proper(X2))
PROPER(sel(X1, X2)) → PROPER(X1)
PROPER(sel(X1, X2)) → PROPER(X2)
F(ok(X)) → F(X)
CONS(ok(X1), ok(X2)) → CONS(X1, X2)
G(ok(X)) → G(X)
S(ok(X)) → S(X)
SEL(ok(X1), ok(X2)) → SEL(X1, X2)
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(f(X)) → mark(cons(X, f(g(X))))
active(g(0)) → mark(s(0))
active(g(s(X))) → mark(s(s(g(X))))
active(sel(0, cons(X, Y))) → mark(X)
active(sel(s(X), cons(Y, Z))) → mark(sel(X, Z))
active(f(X)) → f(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(g(X)) → g(active(X))
active(s(X)) → s(active(X))
active(sel(X1, X2)) → sel(active(X1), X2)
active(sel(X1, X2)) → sel(X1, active(X2))
f(mark(X)) → mark(f(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
g(mark(X)) → mark(g(X))
s(mark(X)) → mark(s(X))
sel(mark(X1), X2) → mark(sel(X1, X2))
sel(X1, mark(X2)) → mark(sel(X1, X2))
proper(f(X)) → f(proper(X))
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(g(X)) → g(proper(X))
proper(0) → ok(0)
proper(s(X)) → s(proper(X))
proper(sel(X1, X2)) → sel(proper(X1), proper(X2))
f(ok(X)) → ok(f(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
g(ok(X)) → ok(g(X))
s(ok(X)) → ok(s(X))
sel(ok(X1), ok(X2)) → ok(sel(X1, X2))
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 8 SCCs with 21 less nodes.

(4) Complex Obligation (AND)

(5) Obligation:

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

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

The TRS R consists of the following rules:

active(f(X)) → mark(cons(X, f(g(X))))
active(g(0)) → mark(s(0))
active(g(s(X))) → mark(s(s(g(X))))
active(sel(0, cons(X, Y))) → mark(X)
active(sel(s(X), cons(Y, Z))) → mark(sel(X, Z))
active(f(X)) → f(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(g(X)) → g(active(X))
active(s(X)) → s(active(X))
active(sel(X1, X2)) → sel(active(X1), X2)
active(sel(X1, X2)) → sel(X1, active(X2))
f(mark(X)) → mark(f(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
g(mark(X)) → mark(g(X))
s(mark(X)) → mark(s(X))
sel(mark(X1), X2) → mark(sel(X1, X2))
sel(X1, mark(X2)) → mark(sel(X1, X2))
proper(f(X)) → f(proper(X))
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(g(X)) → g(proper(X))
proper(0) → ok(0)
proper(s(X)) → s(proper(X))
proper(sel(X1, X2)) → sel(proper(X1), proper(X2))
f(ok(X)) → ok(f(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
g(ok(X)) → ok(g(X))
s(ok(X)) → ok(s(X))
sel(ok(X1), ok(X2)) → ok(sel(X1, X2))
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:

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

The TRS R consists of the following rules:

active(f(X)) → mark(cons(X, f(g(X))))
active(g(0)) → mark(s(0))
active(g(s(X))) → mark(s(s(g(X))))
active(sel(0, cons(X, Y))) → mark(X)
active(sel(s(X), cons(Y, Z))) → mark(sel(X, Z))
active(f(X)) → f(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(g(X)) → g(active(X))
active(s(X)) → s(active(X))
active(sel(X1, X2)) → sel(active(X1), X2)
active(sel(X1, X2)) → sel(X1, active(X2))
f(mark(X)) → mark(f(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
g(mark(X)) → mark(g(X))
s(mark(X)) → mark(s(X))
sel(mark(X1), X2) → mark(sel(X1, X2))
sel(X1, mark(X2)) → mark(sel(X1, X2))
proper(f(X)) → f(proper(X))
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(g(X)) → g(proper(X))
proper(0) → ok(0)
proper(s(X)) → s(proper(X))
proper(sel(X1, X2)) → sel(proper(X1), proper(X2))
f(ok(X)) → ok(f(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
g(ok(X)) → ok(g(X))
s(ok(X)) → ok(s(X))
sel(ok(X1), ok(X2)) → ok(sel(X1, X2))
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:

G(ok(X)) → G(X)
G(mark(X)) → G(X)

The TRS R consists of the following rules:

active(f(X)) → mark(cons(X, f(g(X))))
active(g(0)) → mark(s(0))
active(g(s(X))) → mark(s(s(g(X))))
active(sel(0, cons(X, Y))) → mark(X)
active(sel(s(X), cons(Y, Z))) → mark(sel(X, Z))
active(f(X)) → f(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(g(X)) → g(active(X))
active(s(X)) → s(active(X))
active(sel(X1, X2)) → sel(active(X1), X2)
active(sel(X1, X2)) → sel(X1, active(X2))
f(mark(X)) → mark(f(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
g(mark(X)) → mark(g(X))
s(mark(X)) → mark(s(X))
sel(mark(X1), X2) → mark(sel(X1, X2))
sel(X1, mark(X2)) → mark(sel(X1, X2))
proper(f(X)) → f(proper(X))
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(g(X)) → g(proper(X))
proper(0) → ok(0)
proper(s(X)) → s(proper(X))
proper(sel(X1, X2)) → sel(proper(X1), proper(X2))
f(ok(X)) → ok(f(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
g(ok(X)) → ok(g(X))
s(ok(X)) → ok(s(X))
sel(ok(X1), ok(X2)) → ok(sel(X1, X2))
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(f(X)) → mark(cons(X, f(g(X))))
active(g(0)) → mark(s(0))
active(g(s(X))) → mark(s(s(g(X))))
active(sel(0, cons(X, Y))) → mark(X)
active(sel(s(X), cons(Y, Z))) → mark(sel(X, Z))
active(f(X)) → f(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(g(X)) → g(active(X))
active(s(X)) → s(active(X))
active(sel(X1, X2)) → sel(active(X1), X2)
active(sel(X1, X2)) → sel(X1, active(X2))
f(mark(X)) → mark(f(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
g(mark(X)) → mark(g(X))
s(mark(X)) → mark(s(X))
sel(mark(X1), X2) → mark(sel(X1, X2))
sel(X1, mark(X2)) → mark(sel(X1, X2))
proper(f(X)) → f(proper(X))
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(g(X)) → g(proper(X))
proper(0) → ok(0)
proper(s(X)) → s(proper(X))
proper(sel(X1, X2)) → sel(proper(X1), proper(X2))
f(ok(X)) → ok(f(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
g(ok(X)) → ok(g(X))
s(ok(X)) → ok(s(X))
sel(ok(X1), ok(X2)) → ok(sel(X1, X2))
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:

F(ok(X)) → F(X)
F(mark(X)) → F(X)

The TRS R consists of the following rules:

active(f(X)) → mark(cons(X, f(g(X))))
active(g(0)) → mark(s(0))
active(g(s(X))) → mark(s(s(g(X))))
active(sel(0, cons(X, Y))) → mark(X)
active(sel(s(X), cons(Y, Z))) → mark(sel(X, Z))
active(f(X)) → f(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(g(X)) → g(active(X))
active(s(X)) → s(active(X))
active(sel(X1, X2)) → sel(active(X1), X2)
active(sel(X1, X2)) → sel(X1, active(X2))
f(mark(X)) → mark(f(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
g(mark(X)) → mark(g(X))
s(mark(X)) → mark(s(X))
sel(mark(X1), X2) → mark(sel(X1, X2))
sel(X1, mark(X2)) → mark(sel(X1, X2))
proper(f(X)) → f(proper(X))
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(g(X)) → g(proper(X))
proper(0) → ok(0)
proper(s(X)) → s(proper(X))
proper(sel(X1, X2)) → sel(proper(X1), proper(X2))
f(ok(X)) → ok(f(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
g(ok(X)) → ok(g(X))
s(ok(X)) → ok(s(X))
sel(ok(X1), ok(X2)) → ok(sel(X1, X2))
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:

PROPER(cons(X1, X2)) → PROPER(X1)
PROPER(f(X)) → PROPER(X)
PROPER(cons(X1, X2)) → PROPER(X2)
PROPER(g(X)) → PROPER(X)
PROPER(s(X)) → PROPER(X)
PROPER(sel(X1, X2)) → PROPER(X1)
PROPER(sel(X1, X2)) → PROPER(X2)

The TRS R consists of the following rules:

active(f(X)) → mark(cons(X, f(g(X))))
active(g(0)) → mark(s(0))
active(g(s(X))) → mark(s(s(g(X))))
active(sel(0, cons(X, Y))) → mark(X)
active(sel(s(X), cons(Y, Z))) → mark(sel(X, Z))
active(f(X)) → f(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(g(X)) → g(active(X))
active(s(X)) → s(active(X))
active(sel(X1, X2)) → sel(active(X1), X2)
active(sel(X1, X2)) → sel(X1, active(X2))
f(mark(X)) → mark(f(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
g(mark(X)) → mark(g(X))
s(mark(X)) → mark(s(X))
sel(mark(X1), X2) → mark(sel(X1, X2))
sel(X1, mark(X2)) → mark(sel(X1, X2))
proper(f(X)) → f(proper(X))
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(g(X)) → g(proper(X))
proper(0) → ok(0)
proper(s(X)) → s(proper(X))
proper(sel(X1, X2)) → sel(proper(X1), proper(X2))
f(ok(X)) → ok(f(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
g(ok(X)) → ok(g(X))
s(ok(X)) → ok(s(X))
sel(ok(X1), ok(X2)) → ok(sel(X1, X2))
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:

ACTIVE(cons(X1, X2)) → ACTIVE(X1)
ACTIVE(f(X)) → ACTIVE(X)
ACTIVE(g(X)) → ACTIVE(X)
ACTIVE(s(X)) → ACTIVE(X)
ACTIVE(sel(X1, X2)) → ACTIVE(X1)
ACTIVE(sel(X1, X2)) → ACTIVE(X2)

The TRS R consists of the following rules:

active(f(X)) → mark(cons(X, f(g(X))))
active(g(0)) → mark(s(0))
active(g(s(X))) → mark(s(s(g(X))))
active(sel(0, cons(X, Y))) → mark(X)
active(sel(s(X), cons(Y, Z))) → mark(sel(X, Z))
active(f(X)) → f(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(g(X)) → g(active(X))
active(s(X)) → s(active(X))
active(sel(X1, X2)) → sel(active(X1), X2)
active(sel(X1, X2)) → sel(X1, active(X2))
f(mark(X)) → mark(f(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
g(mark(X)) → mark(g(X))
s(mark(X)) → mark(s(X))
sel(mark(X1), X2) → mark(sel(X1, X2))
sel(X1, mark(X2)) → mark(sel(X1, X2))
proper(f(X)) → f(proper(X))
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(g(X)) → g(proper(X))
proper(0) → ok(0)
proper(s(X)) → s(proper(X))
proper(sel(X1, X2)) → sel(proper(X1), proper(X2))
f(ok(X)) → ok(f(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
g(ok(X)) → ok(g(X))
s(ok(X)) → ok(s(X))
sel(ok(X1), ok(X2)) → ok(sel(X1, X2))
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:

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

The TRS R consists of the following rules:

active(f(X)) → mark(cons(X, f(g(X))))
active(g(0)) → mark(s(0))
active(g(s(X))) → mark(s(s(g(X))))
active(sel(0, cons(X, Y))) → mark(X)
active(sel(s(X), cons(Y, Z))) → mark(sel(X, Z))
active(f(X)) → f(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(g(X)) → g(active(X))
active(s(X)) → s(active(X))
active(sel(X1, X2)) → sel(active(X1), X2)
active(sel(X1, X2)) → sel(X1, active(X2))
f(mark(X)) → mark(f(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
g(mark(X)) → mark(g(X))
s(mark(X)) → mark(s(X))
sel(mark(X1), X2) → mark(sel(X1, X2))
sel(X1, mark(X2)) → mark(sel(X1, X2))
proper(f(X)) → f(proper(X))
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(g(X)) → g(proper(X))
proper(0) → ok(0)
proper(s(X)) → s(proper(X))
proper(sel(X1, X2)) → sel(proper(X1), proper(X2))
f(ok(X)) → ok(f(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
g(ok(X)) → ok(g(X))
s(ok(X)) → ok(s(X))
sel(ok(X1), ok(X2)) → ok(sel(X1, X2))
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.