Termination w.r.t. Q of the following Term Rewriting System could be disproven:
Q restricted rewrite system:
The TRS R consists of the following rules:
primes → sieve(from(s(s(0))))
from(X) → cons(X, n__from(s(X)))
head(cons(X, Y)) → X
tail(cons(X, Y)) → activate(Y)
if(true, X, Y) → activate(X)
if(false, X, Y) → activate(Y)
filter(s(s(X)), cons(Y, Z)) → if(divides(s(s(X)), Y), n__filter(s(s(X)), activate(Z)), n__cons(Y, n__filter(X, sieve(Y))))
sieve(cons(X, Y)) → cons(X, n__filter(X, sieve(activate(Y))))
from(X) → n__from(X)
filter(X1, X2) → n__filter(X1, X2)
cons(X1, X2) → n__cons(X1, X2)
activate(n__from(X)) → from(X)
activate(n__filter(X1, X2)) → filter(X1, X2)
activate(n__cons(X1, X2)) → cons(X1, X2)
activate(X) → X
Q is empty.
↳ QTRS
↳ DependencyPairsProof
Q restricted rewrite system:
The TRS R consists of the following rules:
primes → sieve(from(s(s(0))))
from(X) → cons(X, n__from(s(X)))
head(cons(X, Y)) → X
tail(cons(X, Y)) → activate(Y)
if(true, X, Y) → activate(X)
if(false, X, Y) → activate(Y)
filter(s(s(X)), cons(Y, Z)) → if(divides(s(s(X)), Y), n__filter(s(s(X)), activate(Z)), n__cons(Y, n__filter(X, sieve(Y))))
sieve(cons(X, Y)) → cons(X, n__filter(X, sieve(activate(Y))))
from(X) → n__from(X)
filter(X1, X2) → n__filter(X1, X2)
cons(X1, X2) → n__cons(X1, X2)
activate(n__from(X)) → from(X)
activate(n__filter(X1, X2)) → filter(X1, X2)
activate(n__cons(X1, X2)) → cons(X1, X2)
activate(X) → X
Q is empty.
Using Dependency Pairs [1,15] we result in the following initial DP problem:
Q DP problem:
The TRS P consists of the following rules:
SIEVE(cons(X, Y)) → ACTIVATE(Y)
FROM(X) → CONS(X, n__from(s(X)))
ACTIVATE(n__filter(X1, X2)) → FILTER(X1, X2)
SIEVE(cons(X, Y)) → CONS(X, n__filter(X, sieve(activate(Y))))
FILTER(s(s(X)), cons(Y, Z)) → SIEVE(Y)
IF(true, X, Y) → ACTIVATE(X)
PRIMES → FROM(s(s(0)))
FILTER(s(s(X)), cons(Y, Z)) → ACTIVATE(Z)
IF(false, X, Y) → ACTIVATE(Y)
FILTER(s(s(X)), cons(Y, Z)) → IF(divides(s(s(X)), Y), n__filter(s(s(X)), activate(Z)), n__cons(Y, n__filter(X, sieve(Y))))
ACTIVATE(n__cons(X1, X2)) → CONS(X1, X2)
ACTIVATE(n__from(X)) → FROM(X)
SIEVE(cons(X, Y)) → SIEVE(activate(Y))
PRIMES → SIEVE(from(s(s(0))))
TAIL(cons(X, Y)) → ACTIVATE(Y)
The TRS R consists of the following rules:
primes → sieve(from(s(s(0))))
from(X) → cons(X, n__from(s(X)))
head(cons(X, Y)) → X
tail(cons(X, Y)) → activate(Y)
if(true, X, Y) → activate(X)
if(false, X, Y) → activate(Y)
filter(s(s(X)), cons(Y, Z)) → if(divides(s(s(X)), Y), n__filter(s(s(X)), activate(Z)), n__cons(Y, n__filter(X, sieve(Y))))
sieve(cons(X, Y)) → cons(X, n__filter(X, sieve(activate(Y))))
from(X) → n__from(X)
filter(X1, X2) → n__filter(X1, X2)
cons(X1, X2) → n__cons(X1, X2)
activate(n__from(X)) → from(X)
activate(n__filter(X1, X2)) → filter(X1, X2)
activate(n__cons(X1, X2)) → cons(X1, X2)
activate(X) → X
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
↳ QTRS
↳ DependencyPairsProof
↳ QDP
↳ DependencyGraphProof
Q DP problem:
The TRS P consists of the following rules:
SIEVE(cons(X, Y)) → ACTIVATE(Y)
FROM(X) → CONS(X, n__from(s(X)))
ACTIVATE(n__filter(X1, X2)) → FILTER(X1, X2)
SIEVE(cons(X, Y)) → CONS(X, n__filter(X, sieve(activate(Y))))
FILTER(s(s(X)), cons(Y, Z)) → SIEVE(Y)
IF(true, X, Y) → ACTIVATE(X)
PRIMES → FROM(s(s(0)))
FILTER(s(s(X)), cons(Y, Z)) → ACTIVATE(Z)
IF(false, X, Y) → ACTIVATE(Y)
FILTER(s(s(X)), cons(Y, Z)) → IF(divides(s(s(X)), Y), n__filter(s(s(X)), activate(Z)), n__cons(Y, n__filter(X, sieve(Y))))
ACTIVATE(n__cons(X1, X2)) → CONS(X1, X2)
ACTIVATE(n__from(X)) → FROM(X)
SIEVE(cons(X, Y)) → SIEVE(activate(Y))
PRIMES → SIEVE(from(s(s(0))))
TAIL(cons(X, Y)) → ACTIVATE(Y)
The TRS R consists of the following rules:
primes → sieve(from(s(s(0))))
from(X) → cons(X, n__from(s(X)))
head(cons(X, Y)) → X
tail(cons(X, Y)) → activate(Y)
if(true, X, Y) → activate(X)
if(false, X, Y) → activate(Y)
filter(s(s(X)), cons(Y, Z)) → if(divides(s(s(X)), Y), n__filter(s(s(X)), activate(Z)), n__cons(Y, n__filter(X, sieve(Y))))
sieve(cons(X, Y)) → cons(X, n__filter(X, sieve(activate(Y))))
from(X) → n__from(X)
filter(X1, X2) → n__filter(X1, X2)
cons(X1, X2) → n__cons(X1, X2)
activate(n__from(X)) → from(X)
activate(n__filter(X1, X2)) → filter(X1, X2)
activate(n__cons(X1, X2)) → cons(X1, X2)
activate(X) → X
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 1 SCC with 10 less nodes.
↳ QTRS
↳ DependencyPairsProof
↳ QDP
↳ DependencyGraphProof
↳ QDP
↳ QDPOrderProof
Q DP problem:
The TRS P consists of the following rules:
SIEVE(cons(X, Y)) → ACTIVATE(Y)
ACTIVATE(n__filter(X1, X2)) → FILTER(X1, X2)
FILTER(s(s(X)), cons(Y, Z)) → SIEVE(Y)
SIEVE(cons(X, Y)) → SIEVE(activate(Y))
FILTER(s(s(X)), cons(Y, Z)) → ACTIVATE(Z)
The TRS R consists of the following rules:
primes → sieve(from(s(s(0))))
from(X) → cons(X, n__from(s(X)))
head(cons(X, Y)) → X
tail(cons(X, Y)) → activate(Y)
if(true, X, Y) → activate(X)
if(false, X, Y) → activate(Y)
filter(s(s(X)), cons(Y, Z)) → if(divides(s(s(X)), Y), n__filter(s(s(X)), activate(Z)), n__cons(Y, n__filter(X, sieve(Y))))
sieve(cons(X, Y)) → cons(X, n__filter(X, sieve(activate(Y))))
from(X) → n__from(X)
filter(X1, X2) → n__filter(X1, X2)
cons(X1, X2) → n__cons(X1, X2)
activate(n__from(X)) → from(X)
activate(n__filter(X1, X2)) → filter(X1, X2)
activate(n__cons(X1, X2)) → cons(X1, X2)
activate(X) → X
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
We use the reduction pair processor [15].
The following pairs can be oriented strictly and are deleted.
SIEVE(cons(X, Y)) → ACTIVATE(Y)
The remaining pairs can at least be oriented weakly.
ACTIVATE(n__filter(X1, X2)) → FILTER(X1, X2)
FILTER(s(s(X)), cons(Y, Z)) → SIEVE(Y)
SIEVE(cons(X, Y)) → SIEVE(activate(Y))
FILTER(s(s(X)), cons(Y, Z)) → ACTIVATE(Z)
Used ordering: Matrix interpretation [3]:
Non-tuple symbols:
M( cons(x1, x2) ) = | | + | | · | x1 | + | | · | x2 |
M( if(x1, ..., x3) ) = | | + | | · | x1 | + | | · | x2 | + | | · | x3 |
M( filter(x1, x2) ) = | | + | | · | x1 | + | | · | x2 |
M( n__cons(x1, x2) ) = | | + | | · | x1 | + | | · | x2 |
M( divides(x1, x2) ) = | | + | | · | x1 | + | | · | x2 |
M( n__filter(x1, x2) ) = | | + | | · | x1 | + | | · | x2 |
Tuple symbols:
M( ACTIVATE(x1) ) = | 0 | + | | · | x1 |
M( FILTER(x1, x2) ) = | 0 | + | | · | x1 | + | | · | x2 |
Matrix type:
We used a basic matrix type which is not further parametrizeable.
As matrix orders are CE-compatible, we used usable rules w.r.t. argument filtering in the order.
The following usable rules [17] were oriented:
filter(s(s(X)), cons(Y, Z)) → if(divides(s(s(X)), Y), n__filter(s(s(X)), activate(Z)), n__cons(Y, n__filter(X, sieve(Y))))
cons(X1, X2) → n__cons(X1, X2)
filter(X1, X2) → n__filter(X1, X2)
from(X) → n__from(X)
sieve(cons(X, Y)) → cons(X, n__filter(X, sieve(activate(Y))))
activate(X) → X
activate(n__cons(X1, X2)) → cons(X1, X2)
activate(n__filter(X1, X2)) → filter(X1, X2)
activate(n__from(X)) → from(X)
from(X) → cons(X, n__from(s(X)))
↳ QTRS
↳ DependencyPairsProof
↳ QDP
↳ DependencyGraphProof
↳ QDP
↳ QDPOrderProof
↳ QDP
↳ DependencyGraphProof
Q DP problem:
The TRS P consists of the following rules:
ACTIVATE(n__filter(X1, X2)) → FILTER(X1, X2)
FILTER(s(s(X)), cons(Y, Z)) → SIEVE(Y)
SIEVE(cons(X, Y)) → SIEVE(activate(Y))
FILTER(s(s(X)), cons(Y, Z)) → ACTIVATE(Z)
The TRS R consists of the following rules:
primes → sieve(from(s(s(0))))
from(X) → cons(X, n__from(s(X)))
head(cons(X, Y)) → X
tail(cons(X, Y)) → activate(Y)
if(true, X, Y) → activate(X)
if(false, X, Y) → activate(Y)
filter(s(s(X)), cons(Y, Z)) → if(divides(s(s(X)), Y), n__filter(s(s(X)), activate(Z)), n__cons(Y, n__filter(X, sieve(Y))))
sieve(cons(X, Y)) → cons(X, n__filter(X, sieve(activate(Y))))
from(X) → n__from(X)
filter(X1, X2) → n__filter(X1, X2)
cons(X1, X2) → n__cons(X1, X2)
activate(n__from(X)) → from(X)
activate(n__filter(X1, X2)) → filter(X1, X2)
activate(n__cons(X1, X2)) → cons(X1, X2)
activate(X) → X
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 2 SCCs with 1 less node.
↳ QTRS
↳ DependencyPairsProof
↳ QDP
↳ DependencyGraphProof
↳ QDP
↳ QDPOrderProof
↳ QDP
↳ DependencyGraphProof
↳ AND
↳ QDP
↳ Narrowing
↳ QDP
Q DP problem:
The TRS P consists of the following rules:
SIEVE(cons(X, Y)) → SIEVE(activate(Y))
The TRS R consists of the following rules:
primes → sieve(from(s(s(0))))
from(X) → cons(X, n__from(s(X)))
head(cons(X, Y)) → X
tail(cons(X, Y)) → activate(Y)
if(true, X, Y) → activate(X)
if(false, X, Y) → activate(Y)
filter(s(s(X)), cons(Y, Z)) → if(divides(s(s(X)), Y), n__filter(s(s(X)), activate(Z)), n__cons(Y, n__filter(X, sieve(Y))))
sieve(cons(X, Y)) → cons(X, n__filter(X, sieve(activate(Y))))
from(X) → n__from(X)
filter(X1, X2) → n__filter(X1, X2)
cons(X1, X2) → n__cons(X1, X2)
activate(n__from(X)) → from(X)
activate(n__filter(X1, X2)) → filter(X1, X2)
activate(n__cons(X1, X2)) → cons(X1, X2)
activate(X) → X
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By narrowing [15] the rule SIEVE(cons(X, Y)) → SIEVE(activate(Y)) at position [0] we obtained the following new rules:
SIEVE(cons(y0, n__from(x0))) → SIEVE(from(x0))
SIEVE(cons(y0, x0)) → SIEVE(x0)
SIEVE(cons(y0, n__cons(x0, x1))) → SIEVE(cons(x0, x1))
SIEVE(cons(y0, n__filter(x0, x1))) → SIEVE(filter(x0, x1))
↳ QTRS
↳ DependencyPairsProof
↳ QDP
↳ DependencyGraphProof
↳ QDP
↳ QDPOrderProof
↳ QDP
↳ DependencyGraphProof
↳ AND
↳ QDP
↳ Narrowing
↳ QDP
↳ Narrowing
↳ QDP
Q DP problem:
The TRS P consists of the following rules:
SIEVE(cons(y0, n__from(x0))) → SIEVE(from(x0))
SIEVE(cons(y0, n__cons(x0, x1))) → SIEVE(cons(x0, x1))
SIEVE(cons(y0, x0)) → SIEVE(x0)
SIEVE(cons(y0, n__filter(x0, x1))) → SIEVE(filter(x0, x1))
The TRS R consists of the following rules:
primes → sieve(from(s(s(0))))
from(X) → cons(X, n__from(s(X)))
head(cons(X, Y)) → X
tail(cons(X, Y)) → activate(Y)
if(true, X, Y) → activate(X)
if(false, X, Y) → activate(Y)
filter(s(s(X)), cons(Y, Z)) → if(divides(s(s(X)), Y), n__filter(s(s(X)), activate(Z)), n__cons(Y, n__filter(X, sieve(Y))))
sieve(cons(X, Y)) → cons(X, n__filter(X, sieve(activate(Y))))
from(X) → n__from(X)
filter(X1, X2) → n__filter(X1, X2)
cons(X1, X2) → n__cons(X1, X2)
activate(n__from(X)) → from(X)
activate(n__filter(X1, X2)) → filter(X1, X2)
activate(n__cons(X1, X2)) → cons(X1, X2)
activate(X) → X
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By narrowing [15] the rule SIEVE(cons(y0, n__from(x0))) → SIEVE(from(x0)) at position [0] we obtained the following new rules:
SIEVE(cons(y0, n__from(x0))) → SIEVE(cons(x0, n__from(s(x0))))
SIEVE(cons(y0, n__from(x0))) → SIEVE(n__from(x0))
↳ QTRS
↳ DependencyPairsProof
↳ QDP
↳ DependencyGraphProof
↳ QDP
↳ QDPOrderProof
↳ QDP
↳ DependencyGraphProof
↳ AND
↳ QDP
↳ Narrowing
↳ QDP
↳ Narrowing
↳ QDP
↳ DependencyGraphProof
↳ QDP
Q DP problem:
The TRS P consists of the following rules:
SIEVE(cons(y0, n__from(x0))) → SIEVE(cons(x0, n__from(s(x0))))
SIEVE(cons(y0, n__from(x0))) → SIEVE(n__from(x0))
SIEVE(cons(y0, x0)) → SIEVE(x0)
SIEVE(cons(y0, n__cons(x0, x1))) → SIEVE(cons(x0, x1))
SIEVE(cons(y0, n__filter(x0, x1))) → SIEVE(filter(x0, x1))
The TRS R consists of the following rules:
primes → sieve(from(s(s(0))))
from(X) → cons(X, n__from(s(X)))
head(cons(X, Y)) → X
tail(cons(X, Y)) → activate(Y)
if(true, X, Y) → activate(X)
if(false, X, Y) → activate(Y)
filter(s(s(X)), cons(Y, Z)) → if(divides(s(s(X)), Y), n__filter(s(s(X)), activate(Z)), n__cons(Y, n__filter(X, sieve(Y))))
sieve(cons(X, Y)) → cons(X, n__filter(X, sieve(activate(Y))))
from(X) → n__from(X)
filter(X1, X2) → n__filter(X1, X2)
cons(X1, X2) → n__cons(X1, X2)
activate(n__from(X)) → from(X)
activate(n__filter(X1, X2)) → filter(X1, X2)
activate(n__cons(X1, X2)) → cons(X1, X2)
activate(X) → X
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 1 SCC with 1 less node.
↳ QTRS
↳ DependencyPairsProof
↳ QDP
↳ DependencyGraphProof
↳ QDP
↳ QDPOrderProof
↳ QDP
↳ DependencyGraphProof
↳ AND
↳ QDP
↳ Narrowing
↳ QDP
↳ Narrowing
↳ QDP
↳ DependencyGraphProof
↳ QDP
↳ Narrowing
↳ QDP
Q DP problem:
The TRS P consists of the following rules:
SIEVE(cons(y0, n__from(x0))) → SIEVE(cons(x0, n__from(s(x0))))
SIEVE(cons(y0, n__cons(x0, x1))) → SIEVE(cons(x0, x1))
SIEVE(cons(y0, x0)) → SIEVE(x0)
SIEVE(cons(y0, n__filter(x0, x1))) → SIEVE(filter(x0, x1))
The TRS R consists of the following rules:
primes → sieve(from(s(s(0))))
from(X) → cons(X, n__from(s(X)))
head(cons(X, Y)) → X
tail(cons(X, Y)) → activate(Y)
if(true, X, Y) → activate(X)
if(false, X, Y) → activate(Y)
filter(s(s(X)), cons(Y, Z)) → if(divides(s(s(X)), Y), n__filter(s(s(X)), activate(Z)), n__cons(Y, n__filter(X, sieve(Y))))
sieve(cons(X, Y)) → cons(X, n__filter(X, sieve(activate(Y))))
from(X) → n__from(X)
filter(X1, X2) → n__filter(X1, X2)
cons(X1, X2) → n__cons(X1, X2)
activate(n__from(X)) → from(X)
activate(n__filter(X1, X2)) → filter(X1, X2)
activate(n__cons(X1, X2)) → cons(X1, X2)
activate(X) → X
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By narrowing [15] the rule SIEVE(cons(y0, n__filter(x0, x1))) → SIEVE(filter(x0, x1)) at position [0] we obtained the following new rules:
SIEVE(cons(y0, n__filter(s(s(x0)), cons(x1, x2)))) → SIEVE(if(divides(s(s(x0)), x1), n__filter(s(s(x0)), activate(x2)), n__cons(x1, n__filter(x0, sieve(x1)))))
SIEVE(cons(y0, n__filter(x0, x1))) → SIEVE(n__filter(x0, x1))
↳ QTRS
↳ DependencyPairsProof
↳ QDP
↳ DependencyGraphProof
↳ QDP
↳ QDPOrderProof
↳ QDP
↳ DependencyGraphProof
↳ AND
↳ QDP
↳ Narrowing
↳ QDP
↳ Narrowing
↳ QDP
↳ DependencyGraphProof
↳ QDP
↳ Narrowing
↳ QDP
↳ DependencyGraphProof
↳ QDP
Q DP problem:
The TRS P consists of the following rules:
SIEVE(cons(y0, n__from(x0))) → SIEVE(cons(x0, n__from(s(x0))))
SIEVE(cons(y0, n__filter(s(s(x0)), cons(x1, x2)))) → SIEVE(if(divides(s(s(x0)), x1), n__filter(s(s(x0)), activate(x2)), n__cons(x1, n__filter(x0, sieve(x1)))))
SIEVE(cons(y0, x0)) → SIEVE(x0)
SIEVE(cons(y0, n__cons(x0, x1))) → SIEVE(cons(x0, x1))
SIEVE(cons(y0, n__filter(x0, x1))) → SIEVE(n__filter(x0, x1))
The TRS R consists of the following rules:
primes → sieve(from(s(s(0))))
from(X) → cons(X, n__from(s(X)))
head(cons(X, Y)) → X
tail(cons(X, Y)) → activate(Y)
if(true, X, Y) → activate(X)
if(false, X, Y) → activate(Y)
filter(s(s(X)), cons(Y, Z)) → if(divides(s(s(X)), Y), n__filter(s(s(X)), activate(Z)), n__cons(Y, n__filter(X, sieve(Y))))
sieve(cons(X, Y)) → cons(X, n__filter(X, sieve(activate(Y))))
from(X) → n__from(X)
filter(X1, X2) → n__filter(X1, X2)
cons(X1, X2) → n__cons(X1, X2)
activate(n__from(X)) → from(X)
activate(n__filter(X1, X2)) → filter(X1, X2)
activate(n__cons(X1, X2)) → cons(X1, X2)
activate(X) → X
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 1 SCC with 2 less nodes.
↳ QTRS
↳ DependencyPairsProof
↳ QDP
↳ DependencyGraphProof
↳ QDP
↳ QDPOrderProof
↳ QDP
↳ DependencyGraphProof
↳ AND
↳ QDP
↳ Narrowing
↳ QDP
↳ Narrowing
↳ QDP
↳ DependencyGraphProof
↳ QDP
↳ Narrowing
↳ QDP
↳ DependencyGraphProof
↳ QDP
↳ QDPOrderProof
↳ QDP
Q DP problem:
The TRS P consists of the following rules:
SIEVE(cons(y0, n__from(x0))) → SIEVE(cons(x0, n__from(s(x0))))
SIEVE(cons(y0, n__cons(x0, x1))) → SIEVE(cons(x0, x1))
SIEVE(cons(y0, x0)) → SIEVE(x0)
The TRS R consists of the following rules:
primes → sieve(from(s(s(0))))
from(X) → cons(X, n__from(s(X)))
head(cons(X, Y)) → X
tail(cons(X, Y)) → activate(Y)
if(true, X, Y) → activate(X)
if(false, X, Y) → activate(Y)
filter(s(s(X)), cons(Y, Z)) → if(divides(s(s(X)), Y), n__filter(s(s(X)), activate(Z)), n__cons(Y, n__filter(X, sieve(Y))))
sieve(cons(X, Y)) → cons(X, n__filter(X, sieve(activate(Y))))
from(X) → n__from(X)
filter(X1, X2) → n__filter(X1, X2)
cons(X1, X2) → n__cons(X1, X2)
activate(n__from(X)) → from(X)
activate(n__filter(X1, X2)) → filter(X1, X2)
activate(n__cons(X1, X2)) → cons(X1, X2)
activate(X) → X
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
We use the reduction pair processor [15].
The following pairs can be oriented strictly and are deleted.
SIEVE(cons(y0, x0)) → SIEVE(x0)
The remaining pairs can at least be oriented weakly.
SIEVE(cons(y0, n__from(x0))) → SIEVE(cons(x0, n__from(s(x0))))
SIEVE(cons(y0, n__cons(x0, x1))) → SIEVE(cons(x0, x1))
Used ordering: Polynomial interpretation [25]:
POL(SIEVE(x1)) = x1
POL(cons(x1, x2)) = 1 + x2
POL(n__cons(x1, x2)) = x2
POL(n__from(x1)) = x1
POL(s(x1)) = 0
The following usable rules [17] were oriented:
cons(X1, X2) → n__cons(X1, X2)
↳ QTRS
↳ DependencyPairsProof
↳ QDP
↳ DependencyGraphProof
↳ QDP
↳ QDPOrderProof
↳ QDP
↳ DependencyGraphProof
↳ AND
↳ QDP
↳ Narrowing
↳ QDP
↳ Narrowing
↳ QDP
↳ DependencyGraphProof
↳ QDP
↳ Narrowing
↳ QDP
↳ DependencyGraphProof
↳ QDP
↳ QDPOrderProof
↳ QDP
↳ QDPOrderProof
↳ QDP
Q DP problem:
The TRS P consists of the following rules:
SIEVE(cons(y0, n__from(x0))) → SIEVE(cons(x0, n__from(s(x0))))
SIEVE(cons(y0, n__cons(x0, x1))) → SIEVE(cons(x0, x1))
The TRS R consists of the following rules:
primes → sieve(from(s(s(0))))
from(X) → cons(X, n__from(s(X)))
head(cons(X, Y)) → X
tail(cons(X, Y)) → activate(Y)
if(true, X, Y) → activate(X)
if(false, X, Y) → activate(Y)
filter(s(s(X)), cons(Y, Z)) → if(divides(s(s(X)), Y), n__filter(s(s(X)), activate(Z)), n__cons(Y, n__filter(X, sieve(Y))))
sieve(cons(X, Y)) → cons(X, n__filter(X, sieve(activate(Y))))
from(X) → n__from(X)
filter(X1, X2) → n__filter(X1, X2)
cons(X1, X2) → n__cons(X1, X2)
activate(n__from(X)) → from(X)
activate(n__filter(X1, X2)) → filter(X1, X2)
activate(n__cons(X1, X2)) → cons(X1, X2)
activate(X) → X
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
We use the reduction pair processor [15].
The following pairs can be oriented strictly and are deleted.
SIEVE(cons(y0, n__cons(x0, x1))) → SIEVE(cons(x0, x1))
The remaining pairs can at least be oriented weakly.
SIEVE(cons(y0, n__from(x0))) → SIEVE(cons(x0, n__from(s(x0))))
Used ordering: Polynomial interpretation [25]:
POL(SIEVE(x1)) = x1
POL(cons(x1, x2)) = 1 + x2
POL(n__cons(x1, x2)) = 1 + x2
POL(n__from(x1)) = x1
POL(s(x1)) = 0
The following usable rules [17] were oriented:
cons(X1, X2) → n__cons(X1, X2)
↳ QTRS
↳ DependencyPairsProof
↳ QDP
↳ DependencyGraphProof
↳ QDP
↳ QDPOrderProof
↳ QDP
↳ DependencyGraphProof
↳ AND
↳ QDP
↳ Narrowing
↳ QDP
↳ Narrowing
↳ QDP
↳ DependencyGraphProof
↳ QDP
↳ Narrowing
↳ QDP
↳ DependencyGraphProof
↳ QDP
↳ QDPOrderProof
↳ QDP
↳ QDPOrderProof
↳ QDP
↳ NonTerminationProof
↳ QDP
Q DP problem:
The TRS P consists of the following rules:
SIEVE(cons(y0, n__from(x0))) → SIEVE(cons(x0, n__from(s(x0))))
The TRS R consists of the following rules:
primes → sieve(from(s(s(0))))
from(X) → cons(X, n__from(s(X)))
head(cons(X, Y)) → X
tail(cons(X, Y)) → activate(Y)
if(true, X, Y) → activate(X)
if(false, X, Y) → activate(Y)
filter(s(s(X)), cons(Y, Z)) → if(divides(s(s(X)), Y), n__filter(s(s(X)), activate(Z)), n__cons(Y, n__filter(X, sieve(Y))))
sieve(cons(X, Y)) → cons(X, n__filter(X, sieve(activate(Y))))
from(X) → n__from(X)
filter(X1, X2) → n__filter(X1, X2)
cons(X1, X2) → n__cons(X1, X2)
activate(n__from(X)) → from(X)
activate(n__filter(X1, X2)) → filter(X1, X2)
activate(n__cons(X1, X2)) → cons(X1, X2)
activate(X) → X
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
We used the non-termination processor [17] to show that the DP problem is infinite.
Found a loop by semiunifying a rule from P directly.
The TRS P consists of the following rules:
SIEVE(cons(y0, n__from(x0))) → SIEVE(cons(x0, n__from(s(x0))))
The TRS R consists of the following rules:
primes → sieve(from(s(s(0))))
from(X) → cons(X, n__from(s(X)))
head(cons(X, Y)) → X
tail(cons(X, Y)) → activate(Y)
if(true, X, Y) → activate(X)
if(false, X, Y) → activate(Y)
filter(s(s(X)), cons(Y, Z)) → if(divides(s(s(X)), Y), n__filter(s(s(X)), activate(Z)), n__cons(Y, n__filter(X, sieve(Y))))
sieve(cons(X, Y)) → cons(X, n__filter(X, sieve(activate(Y))))
from(X) → n__from(X)
filter(X1, X2) → n__filter(X1, X2)
cons(X1, X2) → n__cons(X1, X2)
activate(n__from(X)) → from(X)
activate(n__filter(X1, X2)) → filter(X1, X2)
activate(n__cons(X1, X2)) → cons(X1, X2)
activate(X) → X
s = SIEVE(cons(y0, n__from(x0))) evaluates to t =SIEVE(cons(x0, n__from(s(x0))))
Thus s starts an infinite chain as s semiunifies with t with the following substitutions:
- Semiunifier: [ ]
- Matcher: [y0 / x0, x0 / s(x0)]
Rewriting sequence
The DP semiunifies directly so there is only one rewrite step from SIEVE(cons(y0, n__from(x0))) to SIEVE(cons(x0, n__from(s(x0)))).
↳ QTRS
↳ DependencyPairsProof
↳ QDP
↳ DependencyGraphProof
↳ QDP
↳ QDPOrderProof
↳ QDP
↳ DependencyGraphProof
↳ AND
↳ QDP
↳ QDP
Q DP problem:
The TRS P consists of the following rules:
ACTIVATE(n__filter(X1, X2)) → FILTER(X1, X2)
FILTER(s(s(X)), cons(Y, Z)) → ACTIVATE(Z)
The TRS R consists of the following rules:
primes → sieve(from(s(s(0))))
from(X) → cons(X, n__from(s(X)))
head(cons(X, Y)) → X
tail(cons(X, Y)) → activate(Y)
if(true, X, Y) → activate(X)
if(false, X, Y) → activate(Y)
filter(s(s(X)), cons(Y, Z)) → if(divides(s(s(X)), Y), n__filter(s(s(X)), activate(Z)), n__cons(Y, n__filter(X, sieve(Y))))
sieve(cons(X, Y)) → cons(X, n__filter(X, sieve(activate(Y))))
from(X) → n__from(X)
filter(X1, X2) → n__filter(X1, X2)
cons(X1, X2) → n__cons(X1, X2)
activate(n__from(X)) → from(X)
activate(n__filter(X1, X2)) → filter(X1, X2)
activate(n__cons(X1, X2)) → cons(X1, X2)
activate(X) → X
Q is empty.
We have to consider all minimal (P,Q,R)-chains.