(0) Obligation:

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

active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, XS))) → mark(X)
active(2nd(cons(X, XS))) → mark(head(XS))
active(take(0, XS)) → mark(nil)
active(take(s(N), cons(X, XS))) → mark(cons(X, take(N, XS)))
active(sel(0, cons(X, XS))) → mark(X)
active(sel(s(N), cons(X, XS))) → mark(sel(N, XS))
active(from(X)) → from(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(s(X)) → s(active(X))
active(head(X)) → head(active(X))
active(2nd(X)) → 2nd(active(X))
active(take(X1, X2)) → take(active(X1), X2)
active(take(X1, X2)) → take(X1, active(X2))
active(sel(X1, X2)) → sel(active(X1), X2)
active(sel(X1, X2)) → sel(X1, active(X2))
from(mark(X)) → mark(from(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
s(mark(X)) → mark(s(X))
head(mark(X)) → mark(head(X))
2nd(mark(X)) → mark(2nd(X))
take(mark(X1), X2) → mark(take(X1, X2))
take(X1, mark(X2)) → mark(take(X1, X2))
sel(mark(X1), X2) → mark(sel(X1, X2))
sel(X1, mark(X2)) → mark(sel(X1, X2))
proper(from(X)) → from(proper(X))
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(s(X)) → s(proper(X))
proper(head(X)) → head(proper(X))
proper(2nd(X)) → 2nd(proper(X))
proper(take(X1, X2)) → take(proper(X1), proper(X2))
proper(0) → ok(0)
proper(nil) → ok(nil)
proper(sel(X1, X2)) → sel(proper(X1), proper(X2))
from(ok(X)) → ok(from(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
s(ok(X)) → ok(s(X))
head(ok(X)) → ok(head(X))
2nd(ok(X)) → ok(2nd(X))
take(ok(X1), ok(X2)) → ok(take(X1, X2))
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) QTRSToCSRProof (EQUIVALENT transformation)

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

active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, XS))) → mark(X)
active(2nd(cons(X, XS))) → mark(head(XS))
active(take(0, XS)) → mark(nil)
active(take(s(N), cons(X, XS))) → mark(cons(X, take(N, XS)))
active(sel(0, cons(X, XS))) → mark(X)
active(sel(s(N), cons(X, XS))) → mark(sel(N, XS))
active(from(X)) → from(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(s(X)) → s(active(X))
active(head(X)) → head(active(X))
active(2nd(X)) → 2nd(active(X))
active(take(X1, X2)) → take(active(X1), X2)
active(take(X1, X2)) → take(X1, active(X2))
active(sel(X1, X2)) → sel(active(X1), X2)
active(sel(X1, X2)) → sel(X1, active(X2))
from(mark(X)) → mark(from(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
s(mark(X)) → mark(s(X))
head(mark(X)) → mark(head(X))
2nd(mark(X)) → mark(2nd(X))
take(mark(X1), X2) → mark(take(X1, X2))
take(X1, mark(X2)) → mark(take(X1, X2))
sel(mark(X1), X2) → mark(sel(X1, X2))
sel(X1, mark(X2)) → mark(sel(X1, X2))
proper(from(X)) → from(proper(X))
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(s(X)) → s(proper(X))
proper(head(X)) → head(proper(X))
proper(2nd(X)) → 2nd(proper(X))
proper(take(X1, X2)) → take(proper(X1), proper(X2))
proper(0) → ok(0)
proper(nil) → ok(nil)
proper(sel(X1, X2)) → sel(proper(X1), proper(X2))
from(ok(X)) → ok(from(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
s(ok(X)) → ok(s(X))
head(ok(X)) → ok(head(X))
2nd(ok(X)) → ok(2nd(X))
take(ok(X1), ok(X2)) → ok(take(X1, X2))
sel(ok(X1), ok(X2)) → ok(sel(X1, X2))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

Q is empty.
Special symbols used for the transformation (see [GM04]):
top: top, active: active, mark: mark, ok: ok, proper: proper
The replacement map contains the following entries:

from: {1}
cons: {1}
s: {1}
head: {1}
2nd: {1}
take: {1, 2}
0: empty set
nil: empty set
sel: {1, 2}
The QTRS contained all rules created by the complete Giesl-Middeldorp transformation. Therefore, the inverse transformation is complete (and sound).

(2) Obligation:

Context-sensitive rewrite system:
The TRS R consists of the following rules:

from(X) → cons(X, from(s(X)))
head(cons(X, XS)) → X
2nd(cons(X, XS)) → head(XS)
take(0, XS) → nil
take(s(N), cons(X, XS)) → cons(X, take(N, XS))
sel(0, cons(X, XS)) → X
sel(s(N), cons(X, XS)) → sel(N, XS)

The replacement map contains the following entries:

from: {1}
cons: {1}
s: {1}
head: {1}
2nd: {1}
take: {1, 2}
0: empty set
nil: empty set
sel: {1, 2}

(3) CSRInnermostProof (EQUIVALENT transformation)

The CSR is orthogonal. By [CS_Inn] we can switch to innermost.

(4) Obligation:

Context-sensitive rewrite system:
The TRS R consists of the following rules:

from(X) → cons(X, from(s(X)))
head(cons(X, XS)) → X
2nd(cons(X, XS)) → head(XS)
take(0, XS) → nil
take(s(N), cons(X, XS)) → cons(X, take(N, XS))
sel(0, cons(X, XS)) → X
sel(s(N), cons(X, XS)) → sel(N, XS)

The replacement map contains the following entries:

from: {1}
cons: {1}
s: {1}
head: {1}
2nd: {1}
take: {1, 2}
0: empty set
nil: empty set
sel: {1, 2}

Innermost Strategy.

(5) CSDependencyPairsProof (EQUIVALENT transformation)

Using Improved CS-DPs [LPAR08] we result in the following initial Q-CSDP problem.

(6) Obligation:

Q-restricted context-sensitive dependency pair problem:
The symbols in {from, s, head, 2nd, take, sel, HEAD, 2ND, SEL, FROM, TAKE} are replacing on all positions.
For all symbols f in {cons} we have µ(f) = {1}.
The symbols in {U} are not replacing on any position.

The ordinary context-sensitive dependency pairs DPo are:

2ND(cons(X, XS)) → HEAD(XS)
SEL(s(N), cons(X, XS)) → SEL(N, XS)

The collapsing dependency pairs are DPc:

2ND(cons(X, XS)) → XS
SEL(s(N), cons(X, XS)) → XS


The hidden terms of R are:

from(s(x0))
take(x0, x1)

Every hiding context is built from:

s on positions {1}
from on positions {1}
take on positions {1, 2}

Hence, the new unhiding pairs DPu are :

2ND(cons(X, XS)) → U(XS)
SEL(s(N), cons(X, XS)) → U(XS)
U(s(x_0)) → U(x_0)
U(from(x_0)) → U(x_0)
U(take(x_0, x_1)) → U(x_0)
U(take(x_0, x_1)) → U(x_1)
U(from(s(x0))) → FROM(s(x0))
U(take(x0, x1)) → TAKE(x0, x1)

The TRS R consists of the following rules:

from(X) → cons(X, from(s(X)))
head(cons(X, XS)) → X
2nd(cons(X, XS)) → head(XS)
take(0, XS) → nil
take(s(N), cons(X, XS)) → cons(X, take(N, XS))
sel(0, cons(X, XS)) → X
sel(s(N), cons(X, XS)) → sel(N, XS)

The set Q consists of the following terms:

from(x0)
head(cons(x0, x1))
2nd(cons(x0, x1))
take(0, x0)
take(s(x0), cons(x1, x2))
sel(0, cons(x0, x1))
sel(s(x0), cons(x1, x2))

(7) QCSDependencyGraphProof (EQUIVALENT transformation)

The approximation of the Context-Sensitive Dependency Graph [LPAR08] contains 2 SCCs with 4 less nodes.

(8) Complex Obligation (AND)

(9) Obligation:

Q-restricted context-sensitive dependency pair problem:
The symbols in {from, s, head, 2nd, take, sel} are replacing on all positions.
For all symbols f in {cons} we have µ(f) = {1}.
The symbols in {U} are not replacing on any position.

The TRS P consists of the following rules:

U(s(x_0)) → U(x_0)
U(from(x_0)) → U(x_0)
U(take(x_0, x_1)) → U(x_0)
U(take(x_0, x_1)) → U(x_1)

The TRS R consists of the following rules:

from(X) → cons(X, from(s(X)))
head(cons(X, XS)) → X
2nd(cons(X, XS)) → head(XS)
take(0, XS) → nil
take(s(N), cons(X, XS)) → cons(X, take(N, XS))
sel(0, cons(X, XS)) → X
sel(s(N), cons(X, XS)) → sel(N, XS)

The set Q consists of the following terms:

from(x0)
head(cons(x0, x1))
2nd(cons(x0, x1))
take(0, x0)
take(s(x0), cons(x1, x2))
sel(0, cons(x0, x1))
sel(s(x0), cons(x1, x2))

(10) QCSDPSubtermProof (EQUIVALENT transformation)

We use the subterm processor [DA_EMMES].


The following pairs can be oriented strictly and are deleted.


U(s(x_0)) → U(x_0)
U(from(x_0)) → U(x_0)
U(take(x_0, x_1)) → U(x_0)
U(take(x_0, x_1)) → U(x_1)
The remaining pairs can at least be oriented weakly.
none
Used ordering: Combined order from the following AFS and order.
U(x1)  =  x1

Subterm Order

(11) Obligation:

Q-restricted context-sensitive dependency pair problem:
The symbols in {from, s, head, 2nd, take, sel} are replacing on all positions.
For all symbols f in {cons} we have µ(f) = {1}.

The TRS P consists of the following rules:
none

The TRS R consists of the following rules:

from(X) → cons(X, from(s(X)))
head(cons(X, XS)) → X
2nd(cons(X, XS)) → head(XS)
take(0, XS) → nil
take(s(N), cons(X, XS)) → cons(X, take(N, XS))
sel(0, cons(X, XS)) → X
sel(s(N), cons(X, XS)) → sel(N, XS)

The set Q consists of the following terms:

from(x0)
head(cons(x0, x1))
2nd(cons(x0, x1))
take(0, x0)
take(s(x0), cons(x1, x2))
sel(0, cons(x0, x1))
sel(s(x0), cons(x1, x2))

(12) PIsEmptyProof (EQUIVALENT transformation)

The TRS P is empty. Hence, there is no (P,Q,R,µ)-chain.

(13) TRUE

(14) Obligation:

Q-restricted context-sensitive dependency pair problem:
The symbols in {from, s, head, 2nd, take, sel, SEL} are replacing on all positions.
For all symbols f in {cons} we have µ(f) = {1}.

The TRS P consists of the following rules:

SEL(s(N), cons(X, XS)) → SEL(N, XS)

The TRS R consists of the following rules:

from(X) → cons(X, from(s(X)))
head(cons(X, XS)) → X
2nd(cons(X, XS)) → head(XS)
take(0, XS) → nil
take(s(N), cons(X, XS)) → cons(X, take(N, XS))
sel(0, cons(X, XS)) → X
sel(s(N), cons(X, XS)) → sel(N, XS)

The set Q consists of the following terms:

from(x0)
head(cons(x0, x1))
2nd(cons(x0, x1))
take(0, x0)
take(s(x0), cons(x1, x2))
sel(0, cons(x0, x1))
sel(s(x0), cons(x1, x2))

(15) QCSDPSubtermProof (EQUIVALENT transformation)

We use the subterm processor [DA_EMMES].


The following pairs can be oriented strictly and are deleted.


SEL(s(N), cons(X, XS)) → SEL(N, XS)
The remaining pairs can at least be oriented weakly.
none
Used ordering: Combined order from the following AFS and order.
SEL(x1, x2)  =  x1

Subterm Order

(16) Obligation:

Q-restricted context-sensitive dependency pair problem:
The symbols in {from, s, head, 2nd, take, sel} are replacing on all positions.
For all symbols f in {cons} we have µ(f) = {1}.

The TRS P consists of the following rules:
none

The TRS R consists of the following rules:

from(X) → cons(X, from(s(X)))
head(cons(X, XS)) → X
2nd(cons(X, XS)) → head(XS)
take(0, XS) → nil
take(s(N), cons(X, XS)) → cons(X, take(N, XS))
sel(0, cons(X, XS)) → X
sel(s(N), cons(X, XS)) → sel(N, XS)

The set Q consists of the following terms:

from(x0)
head(cons(x0, x1))
2nd(cons(x0, x1))
take(0, x0)
take(s(x0), cons(x1, x2))
sel(0, cons(x0, x1))
sel(s(x0), cons(x1, x2))

(17) PIsEmptyProof (EQUIVALENT transformation)

The TRS P is empty. Hence, there is no (P,Q,R,µ)-chain.

(18) TRUE