(0) Obligation:

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

zeroscons(0, n__zeros)
and(tt, X) → activate(X)
length(nil) → 0
length(cons(N, L)) → s(length(activate(L)))
take(0, IL) → nil
take(s(M), cons(N, IL)) → cons(N, n__take(M, activate(IL)))
zerosn__zeros
take(X1, X2) → n__take(X1, X2)
activate(n__zeros) → zeros
activate(n__take(X1, X2)) → take(X1, X2)
activate(X) → X

Q is empty.

(1) QTRSRRRProof (EQUIVALENT transformation)

Used ordering:
Polynomial interpretation [POLO]:

POL(0) = 0   
POL(activate(x1)) = 1 + x1   
POL(and(x1, x2)) = 2 + x1 + x2   
POL(cons(x1, x2)) = 1 + x1 + x2   
POL(length(x1)) = 1 + x1   
POL(n__take(x1, x2)) = x1 + x2   
POL(n__zeros) = 0   
POL(nil) = 0   
POL(s(x1)) = x1   
POL(take(x1, x2)) = 1 + x1 + x2   
POL(tt) = 0   
POL(zeros) = 1   
With this ordering the following rules can be removed by the rule removal processor [LPAR04] because they are oriented strictly:

and(tt, X) → activate(X)
length(nil) → 0
take(0, IL) → nil
zerosn__zeros
take(X1, X2) → n__take(X1, X2)
activate(X) → X


(2) Obligation:

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

zeroscons(0, n__zeros)
length(cons(N, L)) → s(length(activate(L)))
take(s(M), cons(N, IL)) → cons(N, n__take(M, activate(IL)))
activate(n__zeros) → zeros
activate(n__take(X1, X2)) → take(X1, X2)

Q is empty.

(3) Overlay + Local Confluence (EQUIVALENT transformation)

The TRS is overlay and locally confluent. By [NOC] we can switch to innermost.

(4) Obligation:

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

zeroscons(0, n__zeros)
length(cons(N, L)) → s(length(activate(L)))
take(s(M), cons(N, IL)) → cons(N, n__take(M, activate(IL)))
activate(n__zeros) → zeros
activate(n__take(X1, X2)) → take(X1, X2)

The set Q consists of the following terms:

zeros
length(cons(x0, x1))
take(s(x0), cons(x1, x2))
activate(n__zeros)
activate(n__take(x0, x1))

(5) DependencyPairsProof (EQUIVALENT transformation)

Using Dependency Pairs [AG00,LPAR04] we result in the following initial DP problem.

(6) Obligation:

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

LENGTH(cons(N, L)) → LENGTH(activate(L))
LENGTH(cons(N, L)) → ACTIVATE(L)
TAKE(s(M), cons(N, IL)) → ACTIVATE(IL)
ACTIVATE(n__zeros) → ZEROS
ACTIVATE(n__take(X1, X2)) → TAKE(X1, X2)

The TRS R consists of the following rules:

zeroscons(0, n__zeros)
length(cons(N, L)) → s(length(activate(L)))
take(s(M), cons(N, IL)) → cons(N, n__take(M, activate(IL)))
activate(n__zeros) → zeros
activate(n__take(X1, X2)) → take(X1, X2)

The set Q consists of the following terms:

zeros
length(cons(x0, x1))
take(s(x0), cons(x1, x2))
activate(n__zeros)
activate(n__take(x0, x1))

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

(7) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 2 SCCs with 2 less nodes.

(8) Complex Obligation (AND)

(9) Obligation:

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

ACTIVATE(n__take(X1, X2)) → TAKE(X1, X2)
TAKE(s(M), cons(N, IL)) → ACTIVATE(IL)

The TRS R consists of the following rules:

zeroscons(0, n__zeros)
length(cons(N, L)) → s(length(activate(L)))
take(s(M), cons(N, IL)) → cons(N, n__take(M, activate(IL)))
activate(n__zeros) → zeros
activate(n__take(X1, X2)) → take(X1, X2)

The set Q consists of the following terms:

zeros
length(cons(x0, x1))
take(s(x0), cons(x1, x2))
activate(n__zeros)
activate(n__take(x0, x1))

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

(10) UsableRulesProof (EQUIVALENT transformation)

As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [LPAR04] we can delete all non-usable rules [FROCOS05] from R.

(11) Obligation:

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

ACTIVATE(n__take(X1, X2)) → TAKE(X1, X2)
TAKE(s(M), cons(N, IL)) → ACTIVATE(IL)

R is empty.
The set Q consists of the following terms:

zeros
length(cons(x0, x1))
take(s(x0), cons(x1, x2))
activate(n__zeros)
activate(n__take(x0, x1))

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

(12) QReductionProof (EQUIVALENT transformation)

We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.[THIEMANN].

zeros
length(cons(x0, x1))
take(s(x0), cons(x1, x2))
activate(n__zeros)
activate(n__take(x0, x1))

(13) Obligation:

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

ACTIVATE(n__take(X1, X2)) → TAKE(X1, X2)
TAKE(s(M), cons(N, IL)) → ACTIVATE(IL)

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

(14) QDPSizeChangeProof (EQUIVALENT transformation)

By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:

  • TAKE(s(M), cons(N, IL)) → ACTIVATE(IL)
    The graph contains the following edges 2 > 1

  • ACTIVATE(n__take(X1, X2)) → TAKE(X1, X2)
    The graph contains the following edges 1 > 1, 1 > 2

(15) TRUE

(16) Obligation:

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

LENGTH(cons(N, L)) → LENGTH(activate(L))

The TRS R consists of the following rules:

zeroscons(0, n__zeros)
length(cons(N, L)) → s(length(activate(L)))
take(s(M), cons(N, IL)) → cons(N, n__take(M, activate(IL)))
activate(n__zeros) → zeros
activate(n__take(X1, X2)) → take(X1, X2)

The set Q consists of the following terms:

zeros
length(cons(x0, x1))
take(s(x0), cons(x1, x2))
activate(n__zeros)
activate(n__take(x0, x1))

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

(17) UsableRulesProof (EQUIVALENT transformation)

As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [LPAR04] we can delete all non-usable rules [FROCOS05] from R.

(18) Obligation:

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

LENGTH(cons(N, L)) → LENGTH(activate(L))

The TRS R consists of the following rules:

activate(n__zeros) → zeros
activate(n__take(X1, X2)) → take(X1, X2)
take(s(M), cons(N, IL)) → cons(N, n__take(M, activate(IL)))
zeroscons(0, n__zeros)

The set Q consists of the following terms:

zeros
length(cons(x0, x1))
take(s(x0), cons(x1, x2))
activate(n__zeros)
activate(n__take(x0, x1))

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

(19) QReductionProof (EQUIVALENT transformation)

We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.[THIEMANN].

length(cons(x0, x1))

(20) Obligation:

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

LENGTH(cons(N, L)) → LENGTH(activate(L))

The TRS R consists of the following rules:

activate(n__zeros) → zeros
activate(n__take(X1, X2)) → take(X1, X2)
take(s(M), cons(N, IL)) → cons(N, n__take(M, activate(IL)))
zeroscons(0, n__zeros)

The set Q consists of the following terms:

zeros
take(s(x0), cons(x1, x2))
activate(n__zeros)
activate(n__take(x0, x1))

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

(21) UsableRulesReductionPairsProof (EQUIVALENT transformation)

By using the usable rules with reduction pair processor [LPAR04] with a polynomial ordering [POLO], all dependency pairs and the corresponding usable rules [FROCOS05] can be oriented non-strictly. All non-usable rules are removed, and those dependency pairs and usable rules that have been oriented strictly or contain non-usable symbols in their left-hand side are removed as well.

No dependency pairs are removed.

The following rules are removed from R:

activate(n__take(X1, X2)) → take(X1, X2)
take(s(M), cons(N, IL)) → cons(N, n__take(M, activate(IL)))
Used ordering: POLO with Polynomial interpretation [POLO]:

POL(0) = 0   
POL(LENGTH(x1)) = x1   
POL(activate(x1)) = x1   
POL(cons(x1, x2)) = x1 + 2·x2   
POL(n__take(x1, x2)) = 1 + 2·x1 + x2   
POL(n__zeros) = 0   
POL(s(x1)) = 2 + 2·x1   
POL(take(x1, x2)) = 2·x1 + x2   
POL(zeros) = 0   

(22) Obligation:

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

LENGTH(cons(N, L)) → LENGTH(activate(L))

The TRS R consists of the following rules:

activate(n__zeros) → zeros
zeroscons(0, n__zeros)

The set Q consists of the following terms:

zeros
take(s(x0), cons(x1, x2))
activate(n__zeros)
activate(n__take(x0, x1))

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

(23) QReductionProof (EQUIVALENT transformation)

We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.[THIEMANN].

take(s(x0), cons(x1, x2))

(24) Obligation:

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

LENGTH(cons(N, L)) → LENGTH(activate(L))

The TRS R consists of the following rules:

activate(n__zeros) → zeros
zeroscons(0, n__zeros)

The set Q consists of the following terms:

zeros
activate(n__zeros)
activate(n__take(x0, x1))

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

(25) Narrowing (EQUIVALENT transformation)

By narrowing [LPAR04] the rule LENGTH(cons(N, L)) → LENGTH(activate(L)) at position [0] we obtained the following new rules [LPAR04]:

LENGTH(cons(y0, n__zeros)) → LENGTH(zeros)

(26) Obligation:

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

LENGTH(cons(y0, n__zeros)) → LENGTH(zeros)

The TRS R consists of the following rules:

activate(n__zeros) → zeros
zeroscons(0, n__zeros)

The set Q consists of the following terms:

zeros
activate(n__zeros)
activate(n__take(x0, x1))

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

(27) UsableRulesProof (EQUIVALENT transformation)

As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [LPAR04] we can delete all non-usable rules [FROCOS05] from R.

(28) Obligation:

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

LENGTH(cons(y0, n__zeros)) → LENGTH(zeros)

The TRS R consists of the following rules:

zeroscons(0, n__zeros)

The set Q consists of the following terms:

zeros
activate(n__zeros)
activate(n__take(x0, x1))

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

(29) QReductionProof (EQUIVALENT transformation)

We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.[THIEMANN].

activate(n__zeros)
activate(n__take(x0, x1))

(30) Obligation:

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

LENGTH(cons(y0, n__zeros)) → LENGTH(zeros)

The TRS R consists of the following rules:

zeroscons(0, n__zeros)

The set Q consists of the following terms:

zeros

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

(31) Rewriting (EQUIVALENT transformation)

By rewriting [LPAR04] the rule LENGTH(cons(y0, n__zeros)) → LENGTH(zeros) at position [0] we obtained the following new rules [LPAR04]:

LENGTH(cons(y0, n__zeros)) → LENGTH(cons(0, n__zeros))

(32) Obligation:

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

LENGTH(cons(y0, n__zeros)) → LENGTH(cons(0, n__zeros))

The TRS R consists of the following rules:

zeroscons(0, n__zeros)

The set Q consists of the following terms:

zeros

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

(33) UsableRulesProof (EQUIVALENT transformation)

As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [LPAR04] we can delete all non-usable rules [FROCOS05] from R.

(34) Obligation:

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

LENGTH(cons(y0, n__zeros)) → LENGTH(cons(0, n__zeros))

R is empty.
The set Q consists of the following terms:

zeros

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

(35) QReductionProof (EQUIVALENT transformation)

We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.[THIEMANN].

zeros

(36) Obligation:

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

LENGTH(cons(y0, n__zeros)) → LENGTH(cons(0, n__zeros))

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

(37) Instantiation (EQUIVALENT transformation)

By instantiating [LPAR04] the rule LENGTH(cons(y0, n__zeros)) → LENGTH(cons(0, n__zeros)) we obtained the following new rules [LPAR04]:

LENGTH(cons(0, n__zeros)) → LENGTH(cons(0, n__zeros))

(38) Obligation:

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

LENGTH(cons(0, n__zeros)) → LENGTH(cons(0, n__zeros))

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

(39) NonTerminationProof (EQUIVALENT transformation)

We used the non-termination processor [FROCOS05] to show that the DP problem is infinite.
Found a loop by semiunifying a rule from P directly.

s = LENGTH(cons(0, n__zeros)) evaluates to t =LENGTH(cons(0, n__zeros))

Thus s starts an infinite chain as s semiunifies with t with the following substitutions:
  • Matcher: [ ]
  • Semiunifier: [ ]




Rewriting sequence

The DP semiunifies directly so there is only one rewrite step from LENGTH(cons(0, n__zeros)) to LENGTH(cons(0, n__zeros)).



(40) FALSE