(0) Obligation:
Q restricted rewrite system:
The TRS R consists of the following rules:
zeros → cons(0, n__zeros)
U11(tt, L) → U12(tt, activate(L))
U12(tt, L) → s(length(activate(L)))
U21(tt, IL, M, N) → U22(tt, activate(IL), activate(M), activate(N))
U22(tt, IL, M, N) → U23(tt, activate(IL), activate(M), activate(N))
U23(tt, IL, M, N) → cons(activate(N), n__take(activate(M), activate(IL)))
length(nil) → 0
length(cons(N, L)) → U11(tt, activate(L))
take(0, IL) → nil
take(s(M), cons(N, IL)) → U21(tt, activate(IL), M, N)
zeros → n__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(U11(x1, x2)) = x1 + x2
POL(U12(x1, x2)) = x1 + x2
POL(U21(x1, x2, x3, x4)) = x1 + x2 + x3 + x4
POL(U22(x1, x2, x3, x4)) = x1 + x2 + x3 + x4
POL(U23(x1, x2, x3, x4)) = x1 + x2 + x3 + x4
POL(activate(x1)) = x1
POL(cons(x1, x2)) = x1 + x2
POL(length(x1)) = 1 + x1
POL(n__take(x1, x2)) = 1 + x1 + x2
POL(n__zeros) = 0
POL(nil) = 0
POL(s(x1)) = x1
POL(take(x1, x2)) = 1 + x1 + x2
POL(tt) = 1
POL(zeros) = 0
With this ordering the following rules can be removed by the rule removal processor [LPAR04] because they are oriented strictly:
length(nil) → 0
take(0, IL) → nil
(2) Obligation:
Q restricted rewrite system:
The TRS R consists of the following rules:
zeros → cons(0, n__zeros)
U11(tt, L) → U12(tt, activate(L))
U12(tt, L) → s(length(activate(L)))
U21(tt, IL, M, N) → U22(tt, activate(IL), activate(M), activate(N))
U22(tt, IL, M, N) → U23(tt, activate(IL), activate(M), activate(N))
U23(tt, IL, M, N) → cons(activate(N), n__take(activate(M), activate(IL)))
length(cons(N, L)) → U11(tt, activate(L))
take(s(M), cons(N, IL)) → U21(tt, activate(IL), M, N)
zeros → n__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.
(3) DependencyPairsProof (EQUIVALENT transformation)
Using Dependency Pairs [AG00,LPAR04] we result in the following initial DP problem.
(4) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U111(tt, L) → U121(tt, activate(L))
U111(tt, L) → ACTIVATE(L)
U121(tt, L) → LENGTH(activate(L))
U121(tt, L) → ACTIVATE(L)
U211(tt, IL, M, N) → U221(tt, activate(IL), activate(M), activate(N))
U211(tt, IL, M, N) → ACTIVATE(IL)
U211(tt, IL, M, N) → ACTIVATE(M)
U211(tt, IL, M, N) → ACTIVATE(N)
U221(tt, IL, M, N) → U231(tt, activate(IL), activate(M), activate(N))
U221(tt, IL, M, N) → ACTIVATE(IL)
U221(tt, IL, M, N) → ACTIVATE(M)
U221(tt, IL, M, N) → ACTIVATE(N)
U231(tt, IL, M, N) → ACTIVATE(N)
U231(tt, IL, M, N) → ACTIVATE(M)
U231(tt, IL, M, N) → ACTIVATE(IL)
LENGTH(cons(N, L)) → U111(tt, activate(L))
LENGTH(cons(N, L)) → ACTIVATE(L)
TAKE(s(M), cons(N, IL)) → U211(tt, activate(IL), M, N)
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:
zeros → cons(0, n__zeros)
U11(tt, L) → U12(tt, activate(L))
U12(tt, L) → s(length(activate(L)))
U21(tt, IL, M, N) → U22(tt, activate(IL), activate(M), activate(N))
U22(tt, IL, M, N) → U23(tt, activate(IL), activate(M), activate(N))
U23(tt, IL, M, N) → cons(activate(N), n__take(activate(M), activate(IL)))
length(cons(N, L)) → U11(tt, activate(L))
take(s(M), cons(N, IL)) → U21(tt, activate(IL), M, N)
zeros → n__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.
We have to consider all minimal (P,Q,R)-chains.
(5) DependencyGraphProof (EQUIVALENT transformation)
The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 2 SCCs with 4 less nodes.
(6) Complex Obligation (AND)
(7) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U221(tt, IL, M, N) → U231(tt, activate(IL), activate(M), activate(N))
U231(tt, IL, M, N) → ACTIVATE(N)
ACTIVATE(n__take(X1, X2)) → TAKE(X1, X2)
TAKE(s(M), cons(N, IL)) → U211(tt, activate(IL), M, N)
U211(tt, IL, M, N) → U221(tt, activate(IL), activate(M), activate(N))
U221(tt, IL, M, N) → ACTIVATE(IL)
U221(tt, IL, M, N) → ACTIVATE(M)
U221(tt, IL, M, N) → ACTIVATE(N)
U211(tt, IL, M, N) → ACTIVATE(IL)
U211(tt, IL, M, N) → ACTIVATE(M)
U211(tt, IL, M, N) → ACTIVATE(N)
TAKE(s(M), cons(N, IL)) → ACTIVATE(IL)
U231(tt, IL, M, N) → ACTIVATE(M)
U231(tt, IL, M, N) → ACTIVATE(IL)
The TRS R consists of the following rules:
zeros → cons(0, n__zeros)
U11(tt, L) → U12(tt, activate(L))
U12(tt, L) → s(length(activate(L)))
U21(tt, IL, M, N) → U22(tt, activate(IL), activate(M), activate(N))
U22(tt, IL, M, N) → U23(tt, activate(IL), activate(M), activate(N))
U23(tt, IL, M, N) → cons(activate(N), n__take(activate(M), activate(IL)))
length(cons(N, L)) → U11(tt, activate(L))
take(s(M), cons(N, IL)) → U21(tt, activate(IL), M, N)
zeros → n__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.
We have to consider all minimal (P,Q,R)-chains.
(8) UsableRulesProof (EQUIVALENT transformation)
We can use the usable rules and reduction pair processor [LPAR04] with the Ce-compatible extension of the polynomial order that maps every function symbol to the sum of its arguments. Then, we can delete all non-usable rules [FROCOS05] from R.
(9) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U221(tt, IL, M, N) → U231(tt, activate(IL), activate(M), activate(N))
U231(tt, IL, M, N) → ACTIVATE(N)
ACTIVATE(n__take(X1, X2)) → TAKE(X1, X2)
TAKE(s(M), cons(N, IL)) → U211(tt, activate(IL), M, N)
U211(tt, IL, M, N) → U221(tt, activate(IL), activate(M), activate(N))
U221(tt, IL, M, N) → ACTIVATE(IL)
U221(tt, IL, M, N) → ACTIVATE(M)
U221(tt, IL, M, N) → ACTIVATE(N)
U211(tt, IL, M, N) → ACTIVATE(IL)
U211(tt, IL, M, N) → ACTIVATE(M)
U211(tt, IL, M, N) → ACTIVATE(N)
TAKE(s(M), cons(N, IL)) → ACTIVATE(IL)
U231(tt, IL, M, N) → ACTIVATE(M)
U231(tt, IL, M, N) → ACTIVATE(IL)
The TRS R consists of the following rules:
activate(n__zeros) → zeros
activate(n__take(X1, X2)) → take(X1, X2)
activate(X) → X
take(s(M), cons(N, IL)) → U21(tt, activate(IL), M, N)
take(X1, X2) → n__take(X1, X2)
U21(tt, IL, M, N) → U22(tt, activate(IL), activate(M), activate(N))
U22(tt, IL, M, N) → U23(tt, activate(IL), activate(M), activate(N))
U23(tt, IL, M, N) → cons(activate(N), n__take(activate(M), activate(IL)))
zeros → cons(0, n__zeros)
zeros → n__zeros
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
(10) 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.
The following dependency pairs can be deleted:
TAKE(s(M), cons(N, IL)) → U211(tt, activate(IL), M, N)
TAKE(s(M), cons(N, IL)) → ACTIVATE(IL)
The following rules are removed from R:
take(s(M), cons(N, IL)) → U21(tt, activate(IL), M, N)
Used ordering: POLO with Polynomial interpretation [POLO]:
POL(0) = 0
POL(ACTIVATE(x1)) = x1
POL(TAKE(x1, x2)) = x1 + x2
POL(U21(x1, x2, x3, x4)) = x1 + 2·x2 + x3 + 2·x4
POL(U211(x1, x2, x3, x4)) = 2·x1 + x2 + x3 + x4
POL(U22(x1, x2, x3, x4)) = x1 + 2·x2 + x3 + x4
POL(U221(x1, x2, x3, x4)) = 2·x1 + x2 + x3 + x4
POL(U23(x1, x2, x3, x4)) = 2·x1 + 2·x2 + x3 + x4
POL(U231(x1, x2, x3, x4)) = 2·x1 + x2 + x3 + x4
POL(activate(x1)) = x1
POL(cons(x1, x2)) = x1 + x2
POL(n__take(x1, x2)) = x1 + 2·x2
POL(n__zeros) = 0
POL(s(x1)) = x1
POL(take(x1, x2)) = x1 + 2·x2
POL(tt) = 0
POL(zeros) = 0
(11) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U221(tt, IL, M, N) → U231(tt, activate(IL), activate(M), activate(N))
U231(tt, IL, M, N) → ACTIVATE(N)
ACTIVATE(n__take(X1, X2)) → TAKE(X1, X2)
U211(tt, IL, M, N) → U221(tt, activate(IL), activate(M), activate(N))
U221(tt, IL, M, N) → ACTIVATE(IL)
U221(tt, IL, M, N) → ACTIVATE(M)
U221(tt, IL, M, N) → ACTIVATE(N)
U211(tt, IL, M, N) → ACTIVATE(IL)
U211(tt, IL, M, N) → ACTIVATE(M)
U211(tt, IL, M, N) → ACTIVATE(N)
U231(tt, IL, M, N) → ACTIVATE(M)
U231(tt, IL, M, N) → ACTIVATE(IL)
The TRS R consists of the following rules:
activate(n__zeros) → zeros
activate(n__take(X1, X2)) → take(X1, X2)
activate(X) → X
take(X1, X2) → n__take(X1, X2)
U21(tt, IL, M, N) → U22(tt, activate(IL), activate(M), activate(N))
U22(tt, IL, M, N) → U23(tt, activate(IL), activate(M), activate(N))
U23(tt, IL, M, N) → cons(activate(N), n__take(activate(M), activate(IL)))
zeros → cons(0, n__zeros)
zeros → n__zeros
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
(12) DependencyGraphProof (EQUIVALENT transformation)
The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 0 SCCs with 12 less nodes.
(13) TRUE
(14) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U121(tt, L) → LENGTH(activate(L))
LENGTH(cons(N, L)) → U111(tt, activate(L))
U111(tt, L) → U121(tt, activate(L))
The TRS R consists of the following rules:
zeros → cons(0, n__zeros)
U11(tt, L) → U12(tt, activate(L))
U12(tt, L) → s(length(activate(L)))
U21(tt, IL, M, N) → U22(tt, activate(IL), activate(M), activate(N))
U22(tt, IL, M, N) → U23(tt, activate(IL), activate(M), activate(N))
U23(tt, IL, M, N) → cons(activate(N), n__take(activate(M), activate(IL)))
length(cons(N, L)) → U11(tt, activate(L))
take(s(M), cons(N, IL)) → U21(tt, activate(IL), M, N)
zeros → n__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.
We have to consider all minimal (P,Q,R)-chains.
(15) UsableRulesProof (EQUIVALENT transformation)
We can use the usable rules and reduction pair processor [LPAR04] with the Ce-compatible extension of the polynomial order that maps every function symbol to the sum of its arguments. Then, we can delete all non-usable rules [FROCOS05] from R.
(16) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U121(tt, L) → LENGTH(activate(L))
LENGTH(cons(N, L)) → U111(tt, activate(L))
U111(tt, L) → U121(tt, activate(L))
The TRS R consists of the following rules:
activate(n__zeros) → zeros
activate(n__take(X1, X2)) → take(X1, X2)
activate(X) → X
take(s(M), cons(N, IL)) → U21(tt, activate(IL), M, N)
take(X1, X2) → n__take(X1, X2)
U21(tt, IL, M, N) → U22(tt, activate(IL), activate(M), activate(N))
U22(tt, IL, M, N) → U23(tt, activate(IL), activate(M), activate(N))
U23(tt, IL, M, N) → cons(activate(N), n__take(activate(M), activate(IL)))
zeros → cons(0, n__zeros)
zeros → n__zeros
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
(17) 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:
take(s(M), cons(N, IL)) → U21(tt, activate(IL), M, N)
U21(tt, IL, M, N) → U22(tt, activate(IL), activate(M), activate(N))
Used ordering: POLO with Polynomial interpretation [POLO]:
POL(0) = 0
POL(LENGTH(x1)) = 2·x1
POL(U111(x1, x2)) = 2·x1 + 2·x2
POL(U121(x1, x2)) = x1 + 2·x2
POL(U21(x1, x2, x3, x4)) = 2 + 2·x1 + 2·x2 + x3 + x4
POL(U22(x1, x2, x3, x4)) = 2·x1 + 2·x2 + x3 + x4
POL(U23(x1, x2, x3, x4)) = 2·x1 + 2·x2 + x3 + x4
POL(activate(x1)) = x1
POL(cons(x1, x2)) = x1 + x2
POL(n__take(x1, x2)) = x1 + 2·x2
POL(n__zeros) = 0
POL(s(x1)) = 2 + 2·x1
POL(take(x1, x2)) = x1 + 2·x2
POL(tt) = 0
POL(zeros) = 0
(18) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U121(tt, L) → LENGTH(activate(L))
LENGTH(cons(N, L)) → U111(tt, activate(L))
U111(tt, L) → U121(tt, activate(L))
The TRS R consists of the following rules:
activate(n__zeros) → zeros
activate(n__take(X1, X2)) → take(X1, X2)
activate(X) → X
take(X1, X2) → n__take(X1, X2)
U22(tt, IL, M, N) → U23(tt, activate(IL), activate(M), activate(N))
U23(tt, IL, M, N) → cons(activate(N), n__take(activate(M), activate(IL)))
zeros → cons(0, n__zeros)
zeros → n__zeros
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
(19) UsableRulesProof (EQUIVALENT transformation)
We can use the usable rules and reduction pair processor [LPAR04] with the Ce-compatible extension of the polynomial order that maps every function symbol to the sum of its arguments. Then, we can delete all non-usable rules [FROCOS05] from R.
(20) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U121(tt, L) → LENGTH(activate(L))
LENGTH(cons(N, L)) → U111(tt, activate(L))
U111(tt, L) → U121(tt, activate(L))
The TRS R consists of the following rules:
activate(n__zeros) → zeros
activate(n__take(X1, X2)) → take(X1, X2)
activate(X) → X
take(X1, X2) → n__take(X1, X2)
zeros → cons(0, n__zeros)
zeros → n__zeros
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
(21) Narrowing (EQUIVALENT transformation)
By narrowing [LPAR04] the rule
U121(
tt,
L) →
LENGTH(
activate(
L)) at position [0] we obtained the following new rules [LPAR04]:
U121(tt, n__zeros) → LENGTH(zeros)
U121(tt, n__take(x0, x1)) → LENGTH(take(x0, x1))
U121(tt, x0) → LENGTH(x0)
(22) Obligation:
Q DP problem:
The TRS P consists of the following rules:
LENGTH(cons(N, L)) → U111(tt, activate(L))
U111(tt, L) → U121(tt, activate(L))
U121(tt, n__zeros) → LENGTH(zeros)
U121(tt, n__take(x0, x1)) → LENGTH(take(x0, x1))
U121(tt, x0) → LENGTH(x0)
The TRS R consists of the following rules:
activate(n__zeros) → zeros
activate(n__take(X1, X2)) → take(X1, X2)
activate(X) → X
take(X1, X2) → n__take(X1, X2)
zeros → cons(0, n__zeros)
zeros → n__zeros
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
(23) Narrowing (EQUIVALENT transformation)
By narrowing [LPAR04] the rule
U121(
tt,
n__zeros) →
LENGTH(
zeros) at position [0] we obtained the following new rules [LPAR04]:
U121(tt, n__zeros) → LENGTH(cons(0, n__zeros))
U121(tt, n__zeros) → LENGTH(n__zeros)
(24) Obligation:
Q DP problem:
The TRS P consists of the following rules:
LENGTH(cons(N, L)) → U111(tt, activate(L))
U111(tt, L) → U121(tt, activate(L))
U121(tt, n__take(x0, x1)) → LENGTH(take(x0, x1))
U121(tt, x0) → LENGTH(x0)
U121(tt, n__zeros) → LENGTH(cons(0, n__zeros))
U121(tt, n__zeros) → LENGTH(n__zeros)
The TRS R consists of the following rules:
activate(n__zeros) → zeros
activate(n__take(X1, X2)) → take(X1, X2)
activate(X) → X
take(X1, X2) → n__take(X1, X2)
zeros → cons(0, n__zeros)
zeros → n__zeros
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
(25) DependencyGraphProof (EQUIVALENT transformation)
The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 1 SCC with 1 less node.
(26) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U111(tt, L) → U121(tt, activate(L))
U121(tt, n__take(x0, x1)) → LENGTH(take(x0, x1))
LENGTH(cons(N, L)) → U111(tt, activate(L))
U121(tt, x0) → LENGTH(x0)
U121(tt, n__zeros) → LENGTH(cons(0, n__zeros))
The TRS R consists of the following rules:
activate(n__zeros) → zeros
activate(n__take(X1, X2)) → take(X1, X2)
activate(X) → X
take(X1, X2) → n__take(X1, X2)
zeros → cons(0, n__zeros)
zeros → n__zeros
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
(27) Narrowing (EQUIVALENT transformation)
By narrowing [LPAR04] the rule
U121(
tt,
n__take(
x0,
x1)) →
LENGTH(
take(
x0,
x1)) at position [0] we obtained the following new rules [LPAR04]:
U121(tt, n__take(x0, x1)) → LENGTH(n__take(x0, x1))
(28) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U111(tt, L) → U121(tt, activate(L))
LENGTH(cons(N, L)) → U111(tt, activate(L))
U121(tt, x0) → LENGTH(x0)
U121(tt, n__zeros) → LENGTH(cons(0, n__zeros))
U121(tt, n__take(x0, x1)) → LENGTH(n__take(x0, x1))
The TRS R consists of the following rules:
activate(n__zeros) → zeros
activate(n__take(X1, X2)) → take(X1, X2)
activate(X) → X
take(X1, X2) → n__take(X1, X2)
zeros → cons(0, n__zeros)
zeros → n__zeros
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
(29) DependencyGraphProof (EQUIVALENT transformation)
The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 1 SCC with 1 less node.
(30) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U121(tt, x0) → LENGTH(x0)
LENGTH(cons(N, L)) → U111(tt, activate(L))
U111(tt, L) → U121(tt, activate(L))
U121(tt, n__zeros) → LENGTH(cons(0, n__zeros))
The TRS R consists of the following rules:
activate(n__zeros) → zeros
activate(n__take(X1, X2)) → take(X1, X2)
activate(X) → X
take(X1, X2) → n__take(X1, X2)
zeros → cons(0, n__zeros)
zeros → n__zeros
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
(31) NonTerminationProof (EQUIVALENT transformation)
We used the non-termination processor [FROCOS05] to show that the DP problem is infinite.
Found a loop by narrowing to the left:
s =
U111(
tt,
activate(
n__zeros)) evaluates to t =
U111(
tt,
activate(
n__zeros))
Thus s starts an infinite chain as s semiunifies with t with the following substitutions:
- Semiunifier: [ ]
- Matcher: [ ]
Rewriting sequenceU111(tt, activate(n__zeros)) →
U111(
tt,
n__zeros)
with rule
activate(
X) →
X at position [1] and matcher [
X /
n__zeros]
U111(tt, n__zeros) →
U121(
tt,
activate(
n__zeros))
with rule
U111(
tt,
L) →
U121(
tt,
activate(
L)) at position [] and matcher [
L /
n__zeros]
U121(tt, activate(n__zeros)) →
U121(
tt,
n__zeros)
with rule
activate(
X) →
X at position [1] and matcher [
X /
n__zeros]
U121(tt, n__zeros) →
LENGTH(
cons(
0,
n__zeros))
with rule
U121(
tt,
n__zeros) →
LENGTH(
cons(
0,
n__zeros)) at position [] and matcher [ ]
LENGTH(cons(0, n__zeros)) →
U111(
tt,
activate(
n__zeros))
with rule
LENGTH(
cons(
N,
L)) →
U111(
tt,
activate(
L))
Now applying the matcher to the start term leads to a term which is equal to the last term in the rewriting sequence
All these steps are and every following step will be a correct step w.r.t to Q.
(32) FALSE