(0) Obligation:

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

active(and(tt, T)) → mark(T)
active(isNatIList(IL)) → mark(isNatList(IL))
active(isNat(0)) → mark(tt)
active(isNat(s(N))) → mark(isNat(N))
active(isNat(length(L))) → mark(isNatList(L))
active(isNatIList(zeros)) → mark(tt)
active(isNatIList(cons(N, IL))) → mark(and(isNat(N), isNatIList(IL)))
active(isNatList(nil)) → mark(tt)
active(isNatList(cons(N, L))) → mark(and(isNat(N), isNatList(L)))
active(isNatList(take(N, IL))) → mark(and(isNat(N), isNatIList(IL)))
active(zeros) → mark(cons(0, zeros))
active(take(0, IL)) → mark(uTake1(isNatIList(IL)))
active(uTake1(tt)) → mark(nil)
active(take(s(M), cons(N, IL))) → mark(uTake2(and(isNat(M), and(isNat(N), isNatIList(IL))), M, N, IL))
active(uTake2(tt, M, N, IL)) → mark(cons(N, take(M, IL)))
active(length(cons(N, L))) → mark(uLength(and(isNat(N), isNatList(L)), L))
active(uLength(tt, L)) → mark(s(length(L)))
active(and(X1, X2)) → and(active(X1), X2)
active(and(X1, X2)) → and(X1, active(X2))
active(s(X)) → s(active(X))
active(length(X)) → length(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(take(X1, X2)) → take(active(X1), X2)
active(take(X1, X2)) → take(X1, active(X2))
active(uTake1(X)) → uTake1(active(X))
active(uTake2(X1, X2, X3, X4)) → uTake2(active(X1), X2, X3, X4)
active(uLength(X1, X2)) → uLength(active(X1), X2)
and(mark(X1), X2) → mark(and(X1, X2))
and(X1, mark(X2)) → mark(and(X1, X2))
s(mark(X)) → mark(s(X))
length(mark(X)) → mark(length(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
take(mark(X1), X2) → mark(take(X1, X2))
take(X1, mark(X2)) → mark(take(X1, X2))
uTake1(mark(X)) → mark(uTake1(X))
uTake2(mark(X1), X2, X3, X4) → mark(uTake2(X1, X2, X3, X4))
uLength(mark(X1), X2) → mark(uLength(X1, X2))
proper(and(X1, X2)) → and(proper(X1), proper(X2))
proper(tt) → ok(tt)
proper(isNatIList(X)) → isNatIList(proper(X))
proper(isNatList(X)) → isNatList(proper(X))
proper(isNat(X)) → isNat(proper(X))
proper(0) → ok(0)
proper(s(X)) → s(proper(X))
proper(length(X)) → length(proper(X))
proper(zeros) → ok(zeros)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(nil) → ok(nil)
proper(take(X1, X2)) → take(proper(X1), proper(X2))
proper(uTake1(X)) → uTake1(proper(X))
proper(uTake2(X1, X2, X3, X4)) → uTake2(proper(X1), proper(X2), proper(X3), proper(X4))
proper(uLength(X1, X2)) → uLength(proper(X1), proper(X2))
and(ok(X1), ok(X2)) → ok(and(X1, X2))
isNatIList(ok(X)) → ok(isNatIList(X))
isNatList(ok(X)) → ok(isNatList(X))
isNat(ok(X)) → ok(isNat(X))
s(ok(X)) → ok(s(X))
length(ok(X)) → ok(length(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
take(ok(X1), ok(X2)) → ok(take(X1, X2))
uTake1(ok(X)) → ok(uTake1(X))
uTake2(ok(X1), ok(X2), ok(X3), ok(X4)) → ok(uTake2(X1, X2, X3, X4))
uLength(ok(X1), ok(X2)) → ok(uLength(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(and(tt, T)) → mark(T)
active(isNatIList(IL)) → mark(isNatList(IL))
active(isNat(0)) → mark(tt)
active(isNat(s(N))) → mark(isNat(N))
active(isNat(length(L))) → mark(isNatList(L))
active(isNatIList(zeros)) → mark(tt)
active(isNatIList(cons(N, IL))) → mark(and(isNat(N), isNatIList(IL)))
active(isNatList(nil)) → mark(tt)
active(isNatList(cons(N, L))) → mark(and(isNat(N), isNatList(L)))
active(isNatList(take(N, IL))) → mark(and(isNat(N), isNatIList(IL)))
active(zeros) → mark(cons(0, zeros))
active(take(0, IL)) → mark(uTake1(isNatIList(IL)))
active(uTake1(tt)) → mark(nil)
active(take(s(M), cons(N, IL))) → mark(uTake2(and(isNat(M), and(isNat(N), isNatIList(IL))), M, N, IL))
active(uTake2(tt, M, N, IL)) → mark(cons(N, take(M, IL)))
active(length(cons(N, L))) → mark(uLength(and(isNat(N), isNatList(L)), L))
active(uLength(tt, L)) → mark(s(length(L)))
active(and(X1, X2)) → and(active(X1), X2)
active(and(X1, X2)) → and(X1, active(X2))
active(s(X)) → s(active(X))
active(length(X)) → length(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(take(X1, X2)) → take(active(X1), X2)
active(take(X1, X2)) → take(X1, active(X2))
active(uTake1(X)) → uTake1(active(X))
active(uTake2(X1, X2, X3, X4)) → uTake2(active(X1), X2, X3, X4)
active(uLength(X1, X2)) → uLength(active(X1), X2)
and(mark(X1), X2) → mark(and(X1, X2))
and(X1, mark(X2)) → mark(and(X1, X2))
s(mark(X)) → mark(s(X))
length(mark(X)) → mark(length(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
take(mark(X1), X2) → mark(take(X1, X2))
take(X1, mark(X2)) → mark(take(X1, X2))
uTake1(mark(X)) → mark(uTake1(X))
uTake2(mark(X1), X2, X3, X4) → mark(uTake2(X1, X2, X3, X4))
uLength(mark(X1), X2) → mark(uLength(X1, X2))
proper(and(X1, X2)) → and(proper(X1), proper(X2))
proper(tt) → ok(tt)
proper(isNatIList(X)) → isNatIList(proper(X))
proper(isNatList(X)) → isNatList(proper(X))
proper(isNat(X)) → isNat(proper(X))
proper(0) → ok(0)
proper(s(X)) → s(proper(X))
proper(length(X)) → length(proper(X))
proper(zeros) → ok(zeros)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(nil) → ok(nil)
proper(take(X1, X2)) → take(proper(X1), proper(X2))
proper(uTake1(X)) → uTake1(proper(X))
proper(uTake2(X1, X2, X3, X4)) → uTake2(proper(X1), proper(X2), proper(X3), proper(X4))
proper(uLength(X1, X2)) → uLength(proper(X1), proper(X2))
and(ok(X1), ok(X2)) → ok(and(X1, X2))
isNatIList(ok(X)) → ok(isNatIList(X))
isNatList(ok(X)) → ok(isNatList(X))
isNat(ok(X)) → ok(isNat(X))
s(ok(X)) → ok(s(X))
length(ok(X)) → ok(length(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
take(ok(X1), ok(X2)) → ok(take(X1, X2))
uTake1(ok(X)) → ok(uTake1(X))
uTake2(ok(X1), ok(X2), ok(X3), ok(X4)) → ok(uTake2(X1, X2, X3, X4))
uLength(ok(X1), ok(X2)) → ok(uLength(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:

and: {1, 2}
tt: empty set
isNatIList: empty set
isNatList: empty set
isNat: empty set
0: empty set
s: {1}
length: {1}
zeros: empty set
cons: {1}
nil: empty set
take: {1, 2}
uTake1: {1}
uTake2: {1}
uLength: {1}
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:

and(tt, T) → T
isNatIList(IL) → isNatList(IL)
isNat(0) → tt
isNat(s(N)) → isNat(N)
isNat(length(L)) → isNatList(L)
isNatIList(zeros) → tt
isNatIList(cons(N, IL)) → and(isNat(N), isNatIList(IL))
isNatList(nil) → tt
isNatList(cons(N, L)) → and(isNat(N), isNatList(L))
isNatList(take(N, IL)) → and(isNat(N), isNatIList(IL))
zeroscons(0, zeros)
take(0, IL) → uTake1(isNatIList(IL))
uTake1(tt) → nil
take(s(M), cons(N, IL)) → uTake2(and(isNat(M), and(isNat(N), isNatIList(IL))), M, N, IL)
uTake2(tt, M, N, IL) → cons(N, take(M, IL))
length(cons(N, L)) → uLength(and(isNat(N), isNatList(L)), L)
uLength(tt, L) → s(length(L))

The replacement map contains the following entries:

and: {1, 2}
tt: empty set
isNatIList: empty set
isNatList: empty set
isNat: empty set
0: empty set
s: {1}
length: {1}
zeros: empty set
cons: {1}
nil: empty set
take: {1, 2}
uTake1: {1}
uTake2: {1}
uLength: {1}

(3) PoloCSRProof (EQUIVALENT transformation)

The following rules can be removed because they are oriented strictly by a µ-monotonic polynomial ordering:

take(0, IL) → uTake1(isNatIList(IL))
uTake1(tt) → nil
Used ordering:
Polynomial interpretation [POLO]:

POL(0) = 0   
POL(and(x1, x2)) = 2·x1 + 2·x2   
POL(cons(x1, x2)) = x1 + x2   
POL(isNat(x1)) = 0   
POL(isNatIList(x1)) = 0   
POL(isNatList(x1)) = 0   
POL(length(x1)) = x1   
POL(nil) = 0   
POL(s(x1)) = x1   
POL(take(x1, x2)) = 2 + 2·x1 + x2   
POL(tt) = 0   
POL(uLength(x1, x2)) = x1 + x2   
POL(uTake1(x1)) = 1 + x1   
POL(uTake2(x1, x2, x3, x4)) = 2 + 2·x1 + 2·x2 + x3 + x4   
POL(zeros) = 0   


(4) Obligation:

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

and(tt, T) → T
isNatIList(IL) → isNatList(IL)
isNat(0) → tt
isNat(s(N)) → isNat(N)
isNat(length(L)) → isNatList(L)
isNatIList(zeros) → tt
isNatIList(cons(N, IL)) → and(isNat(N), isNatIList(IL))
isNatList(nil) → tt
isNatList(cons(N, L)) → and(isNat(N), isNatList(L))
isNatList(take(N, IL)) → and(isNat(N), isNatIList(IL))
zeroscons(0, zeros)
take(s(M), cons(N, IL)) → uTake2(and(isNat(M), and(isNat(N), isNatIList(IL))), M, N, IL)
uTake2(tt, M, N, IL) → cons(N, take(M, IL))
length(cons(N, L)) → uLength(and(isNat(N), isNatList(L)), L)
uLength(tt, L) → s(length(L))

The replacement map contains the following entries:

and: {1, 2}
tt: empty set
isNatIList: empty set
isNatList: empty set
isNat: empty set
0: empty set
s: {1}
length: {1}
zeros: empty set
cons: {1}
nil: empty set
take: {1, 2}
uTake2: {1}
uLength: {1}

(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 {and, s, length, take, AND, TAKE, LENGTH} are replacing on all positions.
For all symbols f in {cons, uTake2, uLength, UTAKE2, ULENGTH} we have µ(f) = {1}.
The symbols in {isNatIList, isNatList, isNat, ISNATLIST, ISNATILIST, ISNAT, U} are not replacing on any position.

The ordinary context-sensitive dependency pairs DPo are:

ISNATILIST(IL) → ISNATLIST(IL)
ISNAT(s(N)) → ISNAT(N)
ISNAT(length(L)) → ISNATLIST(L)
ISNATILIST(cons(N, IL)) → AND(isNat(N), isNatIList(IL))
ISNATILIST(cons(N, IL)) → ISNAT(N)
ISNATILIST(cons(N, IL)) → ISNATILIST(IL)
ISNATLIST(cons(N, L)) → AND(isNat(N), isNatList(L))
ISNATLIST(cons(N, L)) → ISNAT(N)
ISNATLIST(cons(N, L)) → ISNATLIST(L)
ISNATLIST(take(N, IL)) → AND(isNat(N), isNatIList(IL))
ISNATLIST(take(N, IL)) → ISNAT(N)
ISNATLIST(take(N, IL)) → ISNATILIST(IL)
TAKE(s(M), cons(N, IL)) → UTAKE2(and(isNat(M), and(isNat(N), isNatIList(IL))), M, N, IL)
TAKE(s(M), cons(N, IL)) → AND(isNat(M), and(isNat(N), isNatIList(IL)))
TAKE(s(M), cons(N, IL)) → ISNAT(M)
TAKE(s(M), cons(N, IL)) → AND(isNat(N), isNatIList(IL))
TAKE(s(M), cons(N, IL)) → ISNAT(N)
TAKE(s(M), cons(N, IL)) → ISNATILIST(IL)
LENGTH(cons(N, L)) → ULENGTH(and(isNat(N), isNatList(L)), L)
LENGTH(cons(N, L)) → AND(isNat(N), isNatList(L))
LENGTH(cons(N, L)) → ISNAT(N)
LENGTH(cons(N, L)) → ISNATLIST(L)
ULENGTH(tt, L) → LENGTH(L)

The collapsing dependency pairs are DPc:

UTAKE2(tt, M, N, IL) → N
ULENGTH(tt, L) → L


The hidden terms of R are:

zeros
take(x0, x1)

Every hiding context is built from:

take on positions {1, 2}

Hence, the new unhiding pairs DPu are :

UTAKE2(tt, M, N, IL) → U(N)
ULENGTH(tt, L) → U(L)
U(take(x_0, x_1)) → U(x_0)
U(take(x_0, x_1)) → U(x_1)
U(zeros) → ZEROS
U(take(x0, x1)) → TAKE(x0, x1)

The TRS R consists of the following rules:

and(tt, T) → T
isNatIList(IL) → isNatList(IL)
isNat(0) → tt
isNat(s(N)) → isNat(N)
isNat(length(L)) → isNatList(L)
isNatIList(zeros) → tt
isNatIList(cons(N, IL)) → and(isNat(N), isNatIList(IL))
isNatList(nil) → tt
isNatList(cons(N, L)) → and(isNat(N), isNatList(L))
isNatList(take(N, IL)) → and(isNat(N), isNatIList(IL))
zeroscons(0, zeros)
take(s(M), cons(N, IL)) → uTake2(and(isNat(M), and(isNat(N), isNatIList(IL))), M, N, IL)
uTake2(tt, M, N, IL) → cons(N, take(M, IL))
length(cons(N, L)) → uLength(and(isNat(N), isNatList(L)), L)
uLength(tt, L) → s(length(L))

Q is empty.

(7) QCSDependencyGraphProof (EQUIVALENT transformation)

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

(8) Complex Obligation (AND)

(9) Obligation:

Q-restricted context-sensitive dependency pair problem:
The symbols in {and, s, length, take} are replacing on all positions.
For all symbols f in {cons, uTake2, uLength} we have µ(f) = {1}.
The symbols in {isNatIList, isNatList, isNat, ISNAT, ISNATLIST, ISNATILIST} are not replacing on any position.

The TRS P consists of the following rules:

ISNATLIST(cons(N, L)) → ISNAT(N)
ISNAT(s(N)) → ISNAT(N)
ISNAT(length(L)) → ISNATLIST(L)
ISNATLIST(cons(N, L)) → ISNATLIST(L)
ISNATLIST(take(N, IL)) → ISNAT(N)
ISNATLIST(take(N, IL)) → ISNATILIST(IL)
ISNATILIST(IL) → ISNATLIST(IL)
ISNATILIST(cons(N, IL)) → ISNAT(N)
ISNATILIST(cons(N, IL)) → ISNATILIST(IL)

The TRS R consists of the following rules:

and(tt, T) → T
isNatIList(IL) → isNatList(IL)
isNat(0) → tt
isNat(s(N)) → isNat(N)
isNat(length(L)) → isNatList(L)
isNatIList(zeros) → tt
isNatIList(cons(N, IL)) → and(isNat(N), isNatIList(IL))
isNatList(nil) → tt
isNatList(cons(N, L)) → and(isNat(N), isNatList(L))
isNatList(take(N, IL)) → and(isNat(N), isNatIList(IL))
zeroscons(0, zeros)
take(s(M), cons(N, IL)) → uTake2(and(isNat(M), and(isNat(N), isNatIList(IL))), M, N, IL)
uTake2(tt, M, N, IL) → cons(N, take(M, IL))
length(cons(N, L)) → uLength(and(isNat(N), isNatList(L)), L)
uLength(tt, L) → s(length(L))

Q is empty.

(10) QCSUsableRulesProof (EQUIVALENT transformation)

The following rules are not useable [DA_EMMES] and can be deleted:

and(tt, x0) → x0
isNatIList(x0) → isNatList(x0)
isNat(0) → tt
isNat(s(x0)) → isNat(x0)
isNat(length(x0)) → isNatList(x0)
isNatIList(zeros) → tt
isNatIList(cons(x0, x1)) → and(isNat(x0), isNatIList(x1))
isNatList(nil) → tt
isNatList(cons(x0, x1)) → and(isNat(x0), isNatList(x1))
isNatList(take(x0, x1)) → and(isNat(x0), isNatIList(x1))
zeroscons(0, zeros)
take(s(x0), cons(x1, x2)) → uTake2(and(isNat(x0), and(isNat(x1), isNatIList(x2))), x0, x1, x2)
uTake2(tt, x0, x1, x2) → cons(x1, take(x0, x2))
length(cons(x0, x1)) → uLength(and(isNat(x0), isNatList(x1)), x1)
uLength(tt, x0) → s(length(x0))

(11) Obligation:

Q-restricted context-sensitive dependency pair problem:
The symbols in {s, length, take} are replacing on all positions.
For all symbols f in {cons} we have µ(f) = {1}.
The symbols in {ISNAT, ISNATLIST, ISNATILIST} are not replacing on any position.

The TRS P consists of the following rules:

ISNATLIST(cons(N, L)) → ISNAT(N)
ISNAT(s(N)) → ISNAT(N)
ISNAT(length(L)) → ISNATLIST(L)
ISNATLIST(cons(N, L)) → ISNATLIST(L)
ISNATLIST(take(N, IL)) → ISNAT(N)
ISNATLIST(take(N, IL)) → ISNATILIST(IL)
ISNATILIST(IL) → ISNATLIST(IL)
ISNATILIST(cons(N, IL)) → ISNAT(N)
ISNATILIST(cons(N, IL)) → ISNATILIST(IL)

R is empty.
Q is empty.

(12) QCSDPMuMonotonicPoloProof (EQUIVALENT transformation)

By using the following µ-monotonic polynomial ordering [POLO], at least one Dependency Pair or term rewrite system rule of this Q-CSDP problem can be strictly oriented and thus deleted.
Strictly oriented dependency pairs:

ISNATLIST(cons(N, L)) → ISNAT(N)
ISNAT(s(N)) → ISNAT(N)
ISNAT(length(L)) → ISNATLIST(L)
ISNATLIST(cons(N, L)) → ISNATLIST(L)
ISNATLIST(take(N, IL)) → ISNAT(N)
ISNATLIST(take(N, IL)) → ISNATILIST(IL)
ISNATILIST(IL) → ISNATLIST(IL)
ISNATILIST(cons(N, IL)) → ISNAT(N)
ISNATILIST(cons(N, IL)) → ISNATILIST(IL)


Used ordering: POLO with Polynomial interpretation [POLO]:

POL(ISNAT(x1)) = x1   
POL(ISNATILIST(x1)) = 1 + 2·x1   
POL(ISNATLIST(x1)) = 2·x1   
POL(cons(x1, x2)) = 1 + x1 + 2·x2   
POL(length(x1)) = 2 + 2·x1   
POL(s(x1)) = 2 + 2·x1   
POL(take(x1, x2)) = 1 + x1 + 2·x2   

(13) Obligation:

Q-restricted context-sensitive dependency pair problem:

The TRS P consists of the following rules:
none

R is empty.
Q is empty.

(14) PIsEmptyProof (EQUIVALENT transformation)

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

(15) TRUE

(16) Obligation:

Q-restricted context-sensitive dependency pair problem:
The symbols in {and, s, length, take, TAKE} are replacing on all positions.
For all symbols f in {cons, uTake2, uLength, UTAKE2} we have µ(f) = {1}.
The symbols in {isNatIList, isNatList, isNat, U} are not replacing on any position.

The TRS P consists of the following rules:

TAKE(s(M), cons(N, IL)) → UTAKE2(and(isNat(M), and(isNat(N), isNatIList(IL))), M, N, IL)
UTAKE2(tt, M, N, IL) → U(N)
U(take(x_0, x_1)) → U(x_0)
U(take(x_0, x_1)) → U(x_1)
U(take(x0, x1)) → TAKE(x0, x1)

The TRS R consists of the following rules:

and(tt, T) → T
isNatIList(IL) → isNatList(IL)
isNat(0) → tt
isNat(s(N)) → isNat(N)
isNat(length(L)) → isNatList(L)
isNatIList(zeros) → tt
isNatIList(cons(N, IL)) → and(isNat(N), isNatIList(IL))
isNatList(nil) → tt
isNatList(cons(N, L)) → and(isNat(N), isNatList(L))
isNatList(take(N, IL)) → and(isNat(N), isNatIList(IL))
zeroscons(0, zeros)
take(s(M), cons(N, IL)) → uTake2(and(isNat(M), and(isNat(N), isNatIList(IL))), M, N, IL)
uTake2(tt, M, N, IL) → cons(N, take(M, IL))
length(cons(N, L)) → uLength(and(isNat(N), isNatList(L)), L)
uLength(tt, L) → s(length(L))

Q is empty.

(17) QCSDPSubtermProof (EQUIVALENT transformation)

We use the subterm processor [DA_EMMES].


The following pairs can be oriented strictly and are deleted.


TAKE(s(M), cons(N, IL)) → UTAKE2(and(isNat(M), and(isNat(N), isNatIList(IL))), M, N, IL)
U(take(x_0, x_1)) → U(x_0)
U(take(x_0, x_1)) → U(x_1)
U(take(x0, x1)) → TAKE(x0, x1)
The remaining pairs can at least be oriented weakly.

UTAKE2(tt, M, N, IL) → U(N)
Used ordering: Combined order from the following AFS and order.
UTAKE2(x1, x2, x3, x4)  =  x3
TAKE(x1, x2)  =  x2
U(x1)  =  x1

Subterm Order

(18) Obligation:

Q-restricted context-sensitive dependency pair problem:
The symbols in {and, s, length, take} are replacing on all positions.
For all symbols f in {cons, uTake2, uLength, UTAKE2} we have µ(f) = {1}.
The symbols in {isNatIList, isNatList, isNat, U} are not replacing on any position.

The TRS P consists of the following rules:

UTAKE2(tt, M, N, IL) → U(N)

The TRS R consists of the following rules:

and(tt, T) → T
isNatIList(IL) → isNatList(IL)
isNat(0) → tt
isNat(s(N)) → isNat(N)
isNat(length(L)) → isNatList(L)
isNatIList(zeros) → tt
isNatIList(cons(N, IL)) → and(isNat(N), isNatIList(IL))
isNatList(nil) → tt
isNatList(cons(N, L)) → and(isNat(N), isNatList(L))
isNatList(take(N, IL)) → and(isNat(N), isNatIList(IL))
zeroscons(0, zeros)
take(s(M), cons(N, IL)) → uTake2(and(isNat(M), and(isNat(N), isNatIList(IL))), M, N, IL)
uTake2(tt, M, N, IL) → cons(N, take(M, IL))
length(cons(N, L)) → uLength(and(isNat(N), isNatList(L)), L)
uLength(tt, L) → s(length(L))

Q is empty.

(19) QCSDependencyGraphProof (EQUIVALENT transformation)

The approximation of the Context-Sensitive Dependency Graph [LPAR08] contains 0 SCCs.

(20) TRUE

(21) Obligation:

Q-restricted context-sensitive dependency pair problem:
The symbols in {and, s, length, take, LENGTH} are replacing on all positions.
For all symbols f in {cons, uTake2, uLength, ULENGTH} we have µ(f) = {1}.
The symbols in {isNatIList, isNatList, isNat} are not replacing on any position.

The TRS P consists of the following rules:

ULENGTH(tt, L) → LENGTH(L)
LENGTH(cons(N, L)) → ULENGTH(and(isNat(N), isNatList(L)), L)

The TRS R consists of the following rules:

and(tt, T) → T
isNatIList(IL) → isNatList(IL)
isNat(0) → tt
isNat(s(N)) → isNat(N)
isNat(length(L)) → isNatList(L)
isNatIList(zeros) → tt
isNatIList(cons(N, IL)) → and(isNat(N), isNatIList(IL))
isNatList(nil) → tt
isNatList(cons(N, L)) → and(isNat(N), isNatList(L))
isNatList(take(N, IL)) → and(isNat(N), isNatIList(IL))
zeroscons(0, zeros)
take(s(M), cons(N, IL)) → uTake2(and(isNat(M), and(isNat(N), isNatIList(IL))), M, N, IL)
uTake2(tt, M, N, IL) → cons(N, take(M, IL))
length(cons(N, L)) → uLength(and(isNat(N), isNatList(L)), L)
uLength(tt, L) → s(length(L))

Q is empty.

(22) QCSDPReductionPairProof (EQUIVALENT transformation)

Using the order
Matrix interpretation [MATRO]:
Non-tuple symbols:
M( and(x1, x2) ) =
/0\
\0/
+
/00\
\00/
·x1+
/10\
\01/
·x2

M( take(x1, x2) ) =
/1\
\0/
+
/00\
\10/
·x1+
/10\
\01/
·x2

M( 0 ) =
/1\
\0/

M( cons(x1, x2) ) =
/0\
\0/
+
/00\
\00/
·x1+
/10\
\11/
·x2

M( tt ) =
/1\
\0/

M( uTake2(x1, ..., x4) ) =
/1\
\1/
+
/00\
\00/
·x1+
/00\
\10/
·x2+
/00\
\00/
·x3+
/10\
\11/
·x4

M( isNatList(x1) ) =
/0\
\0/
+
/10\
\00/
·x1

M( zeros ) =
/0\
\0/

M( isNatIList(x1) ) =
/1\
\0/
+
/10\
\00/
·x1

M( s(x1) ) =
/1\
\0/
+
/10\
\00/
·x1

M( isNat(x1) ) =
/0\
\0/
+
/10\
\00/
·x1

M( length(x1) ) =
/0\
\0/
+
/11\
\11/
·x1

M( nil ) =
/1\
\0/

M( uLength(x1, x2) ) =
/0\
\0/
+
/10\
\00/
·x1+
/11\
\11/
·x2

Tuple symbols:
M( LENGTH(x1) ) = 1+
[0,1]
·x1

M( ULENGTH(x1, x2) ) = 0+
[1,0]
·x1+
[0,1]
·x2


Matrix type:
We used a basic matrix type which is not further parametrizeable.


the following usable rules

and(tt, T) → T
isNat(0) → tt
isNat(s(N)) → isNat(N)
isNat(length(L)) → isNatList(L)
length(cons(N, L)) → uLength(and(isNat(N), isNatList(L)), L)
uLength(tt, L) → s(length(L))
isNatList(nil) → tt
isNatList(cons(N, L)) → and(isNat(N), isNatList(L))
isNatList(take(N, IL)) → and(isNat(N), isNatIList(IL))
take(s(M), cons(N, IL)) → uTake2(and(isNat(M), and(isNat(N), isNatIList(IL))), M, N, IL)
uTake2(tt, M, N, IL) → cons(N, take(M, IL))
isNatIList(IL) → isNatList(IL)
isNatIList(zeros) → tt
isNatIList(cons(N, IL)) → and(isNat(N), isNatIList(IL))
zeroscons(0, zeros)

could all be oriented weakly.
Furthermore, the pairs

LENGTH(cons(N, L)) → ULENGTH(and(isNat(N), isNatList(L)), L)

could be oriented strictly and thus removed by the CS-Reduction Pair Processor [LPAR08,DA_EMMES].

(23) Obligation:

Q-restricted context-sensitive dependency pair problem:
The symbols in {and, s, length, take, LENGTH} are replacing on all positions.
For all symbols f in {cons, uTake2, uLength, ULENGTH} we have µ(f) = {1}.
The symbols in {isNatIList, isNatList, isNat} are not replacing on any position.

The TRS P consists of the following rules:

ULENGTH(tt, L) → LENGTH(L)

The TRS R consists of the following rules:

and(tt, T) → T
isNatIList(IL) → isNatList(IL)
isNat(0) → tt
isNat(s(N)) → isNat(N)
isNat(length(L)) → isNatList(L)
isNatIList(zeros) → tt
isNatIList(cons(N, IL)) → and(isNat(N), isNatIList(IL))
isNatList(nil) → tt
isNatList(cons(N, L)) → and(isNat(N), isNatList(L))
isNatList(take(N, IL)) → and(isNat(N), isNatIList(IL))
zeroscons(0, zeros)
take(s(M), cons(N, IL)) → uTake2(and(isNat(M), and(isNat(N), isNatIList(IL))), M, N, IL)
uTake2(tt, M, N, IL) → cons(N, take(M, IL))
length(cons(N, L)) → uLength(and(isNat(N), isNatList(L)), L)
uLength(tt, L) → s(length(L))

Q is empty.

(24) QCSDependencyGraphProof (EQUIVALENT transformation)

The approximation of the Context-Sensitive Dependency Graph [LPAR08] contains 0 SCCs.

(25) TRUE