(0) Obligation:
Q restricted rewrite system:
The TRS R consists of the following rules:
a__primes → a__sieve(a__from(s(s(0))))
a__from(X) → cons(mark(X), from(s(X)))
a__head(cons(X, Y)) → mark(X)
a__tail(cons(X, Y)) → mark(Y)
a__if(true, X, Y) → mark(X)
a__if(false, X, Y) → mark(Y)
a__filter(s(s(X)), cons(Y, Z)) → a__if(divides(s(s(mark(X))), mark(Y)), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y))))
a__sieve(cons(X, Y)) → cons(mark(X), filter(X, sieve(Y)))
mark(primes) → a__primes
mark(sieve(X)) → a__sieve(mark(X))
mark(from(X)) → a__from(mark(X))
mark(head(X)) → a__head(mark(X))
mark(tail(X)) → a__tail(mark(X))
mark(if(X1, X2, X3)) → a__if(mark(X1), X2, X3)
mark(filter(X1, X2)) → a__filter(mark(X1), mark(X2))
mark(s(X)) → s(mark(X))
mark(0) → 0
mark(cons(X1, X2)) → cons(mark(X1), X2)
mark(true) → true
mark(false) → false
mark(divides(X1, X2)) → divides(mark(X1), mark(X2))
a__primes → primes
a__sieve(X) → sieve(X)
a__from(X) → from(X)
a__head(X) → head(X)
a__tail(X) → tail(X)
a__if(X1, X2, X3) → if(X1, X2, X3)
a__filter(X1, X2) → filter(X1, X2)
Q is empty.
(1) DependencyPairsProof (EQUIVALENT transformation)
Using Dependency Pairs [AG00,LPAR04] we result in the following initial DP problem.
(2) Obligation:
Q DP problem:
The TRS P consists of the following rules:
A__PRIMES → A__SIEVE(a__from(s(s(0))))
A__PRIMES → A__FROM(s(s(0)))
A__FROM(X) → MARK(X)
A__HEAD(cons(X, Y)) → MARK(X)
A__TAIL(cons(X, Y)) → MARK(Y)
A__IF(true, X, Y) → MARK(X)
A__IF(false, X, Y) → MARK(Y)
A__FILTER(s(s(X)), cons(Y, Z)) → A__IF(divides(s(s(mark(X))), mark(Y)), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y))))
A__FILTER(s(s(X)), cons(Y, Z)) → MARK(X)
A__FILTER(s(s(X)), cons(Y, Z)) → MARK(Y)
A__SIEVE(cons(X, Y)) → MARK(X)
MARK(primes) → A__PRIMES
MARK(sieve(X)) → A__SIEVE(mark(X))
MARK(sieve(X)) → MARK(X)
MARK(from(X)) → A__FROM(mark(X))
MARK(from(X)) → MARK(X)
MARK(head(X)) → A__HEAD(mark(X))
MARK(head(X)) → MARK(X)
MARK(tail(X)) → A__TAIL(mark(X))
MARK(tail(X)) → MARK(X)
MARK(if(X1, X2, X3)) → A__IF(mark(X1), X2, X3)
MARK(if(X1, X2, X3)) → MARK(X1)
MARK(filter(X1, X2)) → A__FILTER(mark(X1), mark(X2))
MARK(filter(X1, X2)) → MARK(X1)
MARK(filter(X1, X2)) → MARK(X2)
MARK(s(X)) → MARK(X)
MARK(cons(X1, X2)) → MARK(X1)
MARK(divides(X1, X2)) → MARK(X1)
MARK(divides(X1, X2)) → MARK(X2)
The TRS R consists of the following rules:
a__primes → a__sieve(a__from(s(s(0))))
a__from(X) → cons(mark(X), from(s(X)))
a__head(cons(X, Y)) → mark(X)
a__tail(cons(X, Y)) → mark(Y)
a__if(true, X, Y) → mark(X)
a__if(false, X, Y) → mark(Y)
a__filter(s(s(X)), cons(Y, Z)) → a__if(divides(s(s(mark(X))), mark(Y)), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y))))
a__sieve(cons(X, Y)) → cons(mark(X), filter(X, sieve(Y)))
mark(primes) → a__primes
mark(sieve(X)) → a__sieve(mark(X))
mark(from(X)) → a__from(mark(X))
mark(head(X)) → a__head(mark(X))
mark(tail(X)) → a__tail(mark(X))
mark(if(X1, X2, X3)) → a__if(mark(X1), X2, X3)
mark(filter(X1, X2)) → a__filter(mark(X1), mark(X2))
mark(s(X)) → s(mark(X))
mark(0) → 0
mark(cons(X1, X2)) → cons(mark(X1), X2)
mark(true) → true
mark(false) → false
mark(divides(X1, X2)) → divides(mark(X1), mark(X2))
a__primes → primes
a__sieve(X) → sieve(X)
a__from(X) → from(X)
a__head(X) → head(X)
a__tail(X) → tail(X)
a__if(X1, X2, X3) → if(X1, X2, X3)
a__filter(X1, X2) → filter(X1, X2)
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
(3) DependencyGraphProof (EQUIVALENT transformation)
The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 1 SCC with 1 less node.
(4) Obligation:
Q DP problem:
The TRS P consists of the following rules:
A__SIEVE(cons(X, Y)) → MARK(X)
MARK(primes) → A__PRIMES
A__PRIMES → A__SIEVE(a__from(s(s(0))))
A__PRIMES → A__FROM(s(s(0)))
A__FROM(X) → MARK(X)
MARK(sieve(X)) → A__SIEVE(mark(X))
MARK(sieve(X)) → MARK(X)
MARK(from(X)) → A__FROM(mark(X))
MARK(from(X)) → MARK(X)
MARK(head(X)) → A__HEAD(mark(X))
A__HEAD(cons(X, Y)) → MARK(X)
MARK(head(X)) → MARK(X)
MARK(tail(X)) → A__TAIL(mark(X))
A__TAIL(cons(X, Y)) → MARK(Y)
MARK(tail(X)) → MARK(X)
MARK(if(X1, X2, X3)) → A__IF(mark(X1), X2, X3)
A__IF(true, X, Y) → MARK(X)
MARK(if(X1, X2, X3)) → MARK(X1)
MARK(filter(X1, X2)) → A__FILTER(mark(X1), mark(X2))
A__FILTER(s(s(X)), cons(Y, Z)) → MARK(X)
MARK(filter(X1, X2)) → MARK(X1)
MARK(filter(X1, X2)) → MARK(X2)
MARK(s(X)) → MARK(X)
MARK(cons(X1, X2)) → MARK(X1)
MARK(divides(X1, X2)) → MARK(X1)
MARK(divides(X1, X2)) → MARK(X2)
A__FILTER(s(s(X)), cons(Y, Z)) → MARK(Y)
A__IF(false, X, Y) → MARK(Y)
The TRS R consists of the following rules:
a__primes → a__sieve(a__from(s(s(0))))
a__from(X) → cons(mark(X), from(s(X)))
a__head(cons(X, Y)) → mark(X)
a__tail(cons(X, Y)) → mark(Y)
a__if(true, X, Y) → mark(X)
a__if(false, X, Y) → mark(Y)
a__filter(s(s(X)), cons(Y, Z)) → a__if(divides(s(s(mark(X))), mark(Y)), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y))))
a__sieve(cons(X, Y)) → cons(mark(X), filter(X, sieve(Y)))
mark(primes) → a__primes
mark(sieve(X)) → a__sieve(mark(X))
mark(from(X)) → a__from(mark(X))
mark(head(X)) → a__head(mark(X))
mark(tail(X)) → a__tail(mark(X))
mark(if(X1, X2, X3)) → a__if(mark(X1), X2, X3)
mark(filter(X1, X2)) → a__filter(mark(X1), mark(X2))
mark(s(X)) → s(mark(X))
mark(0) → 0
mark(cons(X1, X2)) → cons(mark(X1), X2)
mark(true) → true
mark(false) → false
mark(divides(X1, X2)) → divides(mark(X1), mark(X2))
a__primes → primes
a__sieve(X) → sieve(X)
a__from(X) → from(X)
a__head(X) → head(X)
a__tail(X) → tail(X)
a__if(X1, X2, X3) → if(X1, X2, X3)
a__filter(X1, X2) → filter(X1, X2)
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
(5) QDPOrderProof (EQUIVALENT transformation)
We use the reduction pair processor [LPAR04,JAR06].
The following pairs can be oriented strictly and are deleted.
A__PRIMES → A__FROM(s(s(0)))
The remaining pairs can at least be oriented weakly.
Used ordering: Matrix interpretation [MATRO] with arctic natural numbers [ARCTIC]:
POL(A__SIEVE(x1)) = | 4A | + | 0A | · | x1 |
POL(cons(x1, x2)) = | -I | + | 0A | · | x1 | + | 0A | · | x2 |
POL(MARK(x1)) = | 4A | + | 0A | · | x1 |
POL(a__from(x1)) = | -I | + | 1A | · | x1 |
POL(A__FROM(x1)) = | 4A | + | 0A | · | x1 |
POL(sieve(x1)) = | 2A | + | 0A | · | x1 |
POL(mark(x1)) = | -I | + | 0A | · | x1 |
POL(from(x1)) = | -I | + | 1A | · | x1 |
POL(head(x1)) = | -I | + | 2A | · | x1 |
POL(A__HEAD(x1)) = | 4A | + | 1A | · | x1 |
POL(tail(x1)) = | -I | + | 0A | · | x1 |
POL(A__TAIL(x1)) = | 4A | + | 0A | · | x1 |
POL(if(x1, x2, x3)) = | 1A | + | 0A | · | x1 | + | 0A | · | x2 | + | 0A | · | x3 |
POL(A__IF(x1, x2, x3)) = | 4A | + | -I | · | x1 | + | 0A | · | x2 | + | 0A | · | x3 |
POL(filter(x1, x2)) = | 2A | + | 0A | · | x1 | + | 0A | · | x2 |
POL(A__FILTER(x1, x2)) = | 4A | + | 0A | · | x1 | + | 0A | · | x2 |
POL(divides(x1, x2)) = | 1A | + | 0A | · | x1 | + | 0A | · | x2 |
POL(a__sieve(x1)) = | 2A | + | 0A | · | x1 |
POL(a__head(x1)) = | -I | + | 2A | · | x1 |
POL(a__tail(x1)) = | -I | + | 0A | · | x1 |
POL(a__if(x1, x2, x3)) = | 1A | + | 0A | · | x1 | + | 0A | · | x2 | + | 0A | · | x3 |
POL(a__filter(x1, x2)) = | 2A | + | 0A | · | x1 | + | 0A | · | x2 |
The following usable rules [FROCOS05] with respect to the argument filtering of the ordering [JAR06] were oriented:
a__from(X) → cons(mark(X), from(s(X)))
a__from(X) → from(X)
mark(primes) → a__primes
mark(sieve(X)) → a__sieve(mark(X))
mark(from(X)) → a__from(mark(X))
mark(head(X)) → a__head(mark(X))
a__head(cons(X, Y)) → mark(X)
mark(tail(X)) → a__tail(mark(X))
a__tail(cons(X, Y)) → mark(Y)
mark(if(X1, X2, X3)) → a__if(mark(X1), X2, X3)
a__if(true, X, Y) → mark(X)
a__if(false, X, Y) → mark(Y)
mark(filter(X1, X2)) → a__filter(mark(X1), mark(X2))
mark(s(X)) → s(mark(X))
mark(0) → 0
mark(cons(X1, X2)) → cons(mark(X1), X2)
mark(true) → true
mark(false) → false
mark(divides(X1, X2)) → divides(mark(X1), mark(X2))
a__primes → primes
a__primes → a__sieve(a__from(s(s(0))))
a__sieve(X) → sieve(X)
a__sieve(cons(X, Y)) → cons(mark(X), filter(X, sieve(Y)))
a__head(X) → head(X)
a__tail(X) → tail(X)
a__if(X1, X2, X3) → if(X1, X2, X3)
a__filter(X1, X2) → filter(X1, X2)
a__filter(s(s(X)), cons(Y, Z)) → a__if(divides(s(s(mark(X))), mark(Y)), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y))))
(6) Obligation:
Q DP problem:
The TRS P consists of the following rules:
A__SIEVE(cons(X, Y)) → MARK(X)
MARK(primes) → A__PRIMES
A__PRIMES → A__SIEVE(a__from(s(s(0))))
A__FROM(X) → MARK(X)
MARK(sieve(X)) → A__SIEVE(mark(X))
MARK(sieve(X)) → MARK(X)
MARK(from(X)) → A__FROM(mark(X))
MARK(from(X)) → MARK(X)
MARK(head(X)) → A__HEAD(mark(X))
A__HEAD(cons(X, Y)) → MARK(X)
MARK(head(X)) → MARK(X)
MARK(tail(X)) → A__TAIL(mark(X))
A__TAIL(cons(X, Y)) → MARK(Y)
MARK(tail(X)) → MARK(X)
MARK(if(X1, X2, X3)) → A__IF(mark(X1), X2, X3)
A__IF(true, X, Y) → MARK(X)
MARK(if(X1, X2, X3)) → MARK(X1)
MARK(filter(X1, X2)) → A__FILTER(mark(X1), mark(X2))
A__FILTER(s(s(X)), cons(Y, Z)) → MARK(X)
MARK(filter(X1, X2)) → MARK(X1)
MARK(filter(X1, X2)) → MARK(X2)
MARK(s(X)) → MARK(X)
MARK(cons(X1, X2)) → MARK(X1)
MARK(divides(X1, X2)) → MARK(X1)
MARK(divides(X1, X2)) → MARK(X2)
A__FILTER(s(s(X)), cons(Y, Z)) → MARK(Y)
A__IF(false, X, Y) → MARK(Y)
The TRS R consists of the following rules:
a__primes → a__sieve(a__from(s(s(0))))
a__from(X) → cons(mark(X), from(s(X)))
a__head(cons(X, Y)) → mark(X)
a__tail(cons(X, Y)) → mark(Y)
a__if(true, X, Y) → mark(X)
a__if(false, X, Y) → mark(Y)
a__filter(s(s(X)), cons(Y, Z)) → a__if(divides(s(s(mark(X))), mark(Y)), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y))))
a__sieve(cons(X, Y)) → cons(mark(X), filter(X, sieve(Y)))
mark(primes) → a__primes
mark(sieve(X)) → a__sieve(mark(X))
mark(from(X)) → a__from(mark(X))
mark(head(X)) → a__head(mark(X))
mark(tail(X)) → a__tail(mark(X))
mark(if(X1, X2, X3)) → a__if(mark(X1), X2, X3)
mark(filter(X1, X2)) → a__filter(mark(X1), mark(X2))
mark(s(X)) → s(mark(X))
mark(0) → 0
mark(cons(X1, X2)) → cons(mark(X1), X2)
mark(true) → true
mark(false) → false
mark(divides(X1, X2)) → divides(mark(X1), mark(X2))
a__primes → primes
a__sieve(X) → sieve(X)
a__from(X) → from(X)
a__head(X) → head(X)
a__tail(X) → tail(X)
a__if(X1, X2, X3) → if(X1, X2, X3)
a__filter(X1, X2) → filter(X1, X2)
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
(7) QDPOrderProof (EQUIVALENT transformation)
We use the reduction pair processor [LPAR04,JAR06].
The following pairs can be oriented strictly and are deleted.
MARK(from(X)) → MARK(X)
The remaining pairs can at least be oriented weakly.
Used ordering: Matrix interpretation [MATRO] with arctic natural numbers [ARCTIC]:
POL(A__SIEVE(x1)) = | 4A | + | 1A | · | x1 |
POL(cons(x1, x2)) = | 1A | + | 0A | · | x1 | + | 0A | · | x2 |
POL(MARK(x1)) = | 4A | + | 1A | · | x1 |
POL(a__from(x1)) = | 4A | + | 1A | · | x1 |
POL(A__FROM(x1)) = | 4A | + | 2A | · | x1 |
POL(sieve(x1)) = | 2A | + | 0A | · | x1 |
POL(mark(x1)) = | 1A | + | 0A | · | x1 |
POL(from(x1)) = | 4A | + | 1A | · | x1 |
POL(head(x1)) = | -I | + | 0A | · | x1 |
POL(A__HEAD(x1)) = | 4A | + | 1A | · | x1 |
POL(tail(x1)) = | 3A | + | 0A | · | x1 |
POL(A__TAIL(x1)) = | 4A | + | 1A | · | x1 |
POL(if(x1, x2, x3)) = | -I | + | 0A | · | x1 | + | 0A | · | x2 | + | 0A | · | x3 |
POL(A__IF(x1, x2, x3)) = | 4A | + | -I | · | x1 | + | 1A | · | x2 | + | 1A | · | x3 |
POL(filter(x1, x2)) = | -I | + | 0A | · | x1 | + | 0A | · | x2 |
POL(A__FILTER(x1, x2)) = | 2A | + | 1A | · | x1 | + | 1A | · | x2 |
POL(divides(x1, x2)) = | -I | + | 0A | · | x1 | + | 0A | · | x2 |
POL(a__sieve(x1)) = | 2A | + | 0A | · | x1 |
POL(a__head(x1)) = | -I | + | 0A | · | x1 |
POL(a__tail(x1)) = | 3A | + | 0A | · | x1 |
POL(a__if(x1, x2, x3)) = | 1A | + | 0A | · | x1 | + | 0A | · | x2 | + | 0A | · | x3 |
POL(a__filter(x1, x2)) = | 1A | + | 0A | · | x1 | + | 0A | · | x2 |
The following usable rules [FROCOS05] with respect to the argument filtering of the ordering [JAR06] were oriented:
a__from(X) → cons(mark(X), from(s(X)))
a__from(X) → from(X)
mark(primes) → a__primes
mark(sieve(X)) → a__sieve(mark(X))
mark(from(X)) → a__from(mark(X))
mark(head(X)) → a__head(mark(X))
a__head(cons(X, Y)) → mark(X)
mark(tail(X)) → a__tail(mark(X))
a__tail(cons(X, Y)) → mark(Y)
mark(if(X1, X2, X3)) → a__if(mark(X1), X2, X3)
a__if(true, X, Y) → mark(X)
a__if(false, X, Y) → mark(Y)
mark(filter(X1, X2)) → a__filter(mark(X1), mark(X2))
mark(s(X)) → s(mark(X))
mark(0) → 0
mark(cons(X1, X2)) → cons(mark(X1), X2)
mark(true) → true
mark(false) → false
mark(divides(X1, X2)) → divides(mark(X1), mark(X2))
a__primes → primes
a__primes → a__sieve(a__from(s(s(0))))
a__sieve(X) → sieve(X)
a__sieve(cons(X, Y)) → cons(mark(X), filter(X, sieve(Y)))
a__head(X) → head(X)
a__tail(X) → tail(X)
a__if(X1, X2, X3) → if(X1, X2, X3)
a__filter(X1, X2) → filter(X1, X2)
a__filter(s(s(X)), cons(Y, Z)) → a__if(divides(s(s(mark(X))), mark(Y)), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y))))
(8) Obligation:
Q DP problem:
The TRS P consists of the following rules:
A__SIEVE(cons(X, Y)) → MARK(X)
MARK(primes) → A__PRIMES
A__PRIMES → A__SIEVE(a__from(s(s(0))))
A__FROM(X) → MARK(X)
MARK(sieve(X)) → A__SIEVE(mark(X))
MARK(sieve(X)) → MARK(X)
MARK(from(X)) → A__FROM(mark(X))
MARK(head(X)) → A__HEAD(mark(X))
A__HEAD(cons(X, Y)) → MARK(X)
MARK(head(X)) → MARK(X)
MARK(tail(X)) → A__TAIL(mark(X))
A__TAIL(cons(X, Y)) → MARK(Y)
MARK(tail(X)) → MARK(X)
MARK(if(X1, X2, X3)) → A__IF(mark(X1), X2, X3)
A__IF(true, X, Y) → MARK(X)
MARK(if(X1, X2, X3)) → MARK(X1)
MARK(filter(X1, X2)) → A__FILTER(mark(X1), mark(X2))
A__FILTER(s(s(X)), cons(Y, Z)) → MARK(X)
MARK(filter(X1, X2)) → MARK(X1)
MARK(filter(X1, X2)) → MARK(X2)
MARK(s(X)) → MARK(X)
MARK(cons(X1, X2)) → MARK(X1)
MARK(divides(X1, X2)) → MARK(X1)
MARK(divides(X1, X2)) → MARK(X2)
A__FILTER(s(s(X)), cons(Y, Z)) → MARK(Y)
A__IF(false, X, Y) → MARK(Y)
The TRS R consists of the following rules:
a__primes → a__sieve(a__from(s(s(0))))
a__from(X) → cons(mark(X), from(s(X)))
a__head(cons(X, Y)) → mark(X)
a__tail(cons(X, Y)) → mark(Y)
a__if(true, X, Y) → mark(X)
a__if(false, X, Y) → mark(Y)
a__filter(s(s(X)), cons(Y, Z)) → a__if(divides(s(s(mark(X))), mark(Y)), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y))))
a__sieve(cons(X, Y)) → cons(mark(X), filter(X, sieve(Y)))
mark(primes) → a__primes
mark(sieve(X)) → a__sieve(mark(X))
mark(from(X)) → a__from(mark(X))
mark(head(X)) → a__head(mark(X))
mark(tail(X)) → a__tail(mark(X))
mark(if(X1, X2, X3)) → a__if(mark(X1), X2, X3)
mark(filter(X1, X2)) → a__filter(mark(X1), mark(X2))
mark(s(X)) → s(mark(X))
mark(0) → 0
mark(cons(X1, X2)) → cons(mark(X1), X2)
mark(true) → true
mark(false) → false
mark(divides(X1, X2)) → divides(mark(X1), mark(X2))
a__primes → primes
a__sieve(X) → sieve(X)
a__from(X) → from(X)
a__head(X) → head(X)
a__tail(X) → tail(X)
a__if(X1, X2, X3) → if(X1, X2, X3)
a__filter(X1, X2) → filter(X1, X2)
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
(9) QDPOrderProof (EQUIVALENT transformation)
We use the reduction pair processor [LPAR04,JAR06].
The following pairs can be oriented strictly and are deleted.
MARK(primes) → A__PRIMES
A__TAIL(cons(X, Y)) → MARK(Y)
MARK(tail(X)) → MARK(X)
The remaining pairs can at least be oriented weakly.
Used ordering: Matrix interpretation [MATRO] with arctic natural numbers [ARCTIC]:
POL(A__SIEVE(x1)) = | 3A | + | 0A | · | x1 |
POL(cons(x1, x2)) = | -I | + | 1A | · | x1 | + | 0A | · | x2 |
POL(MARK(x1)) = | 3A | + | 1A | · | x1 |
POL(a__from(x1)) = | 0A | + | 3A | · | x1 |
POL(A__FROM(x1)) = | 3A | + | 1A | · | x1 |
POL(sieve(x1)) = | -I | + | 0A | · | x1 |
POL(mark(x1)) = | -I | + | 0A | · | x1 |
POL(from(x1)) = | 0A | + | 3A | · | x1 |
POL(head(x1)) = | -I | + | 0A | · | x1 |
POL(A__HEAD(x1)) = | 3A | + | 0A | · | x1 |
POL(tail(x1)) = | 3A | + | 5A | · | x1 |
POL(A__TAIL(x1)) = | 4A | + | 5A | · | x1 |
POL(if(x1, x2, x3)) = | -I | + | 1A | · | x1 | + | 0A | · | x2 | + | 0A | · | x3 |
POL(A__IF(x1, x2, x3)) = | 3A | + | -I | · | x1 | + | 1A | · | x2 | + | 1A | · | x3 |
POL(filter(x1, x2)) = | -I | + | 1A | · | x1 | + | 0A | · | x2 |
POL(A__FILTER(x1, x2)) = | 3A | + | 2A | · | x1 | + | 0A | · | x2 |
POL(divides(x1, x2)) = | -I | + | 0A | · | x1 | + | 0A | · | x2 |
POL(a__sieve(x1)) = | -I | + | 0A | · | x1 |
POL(a__head(x1)) = | -I | + | 0A | · | x1 |
POL(a__tail(x1)) = | 3A | + | 5A | · | x1 |
POL(a__if(x1, x2, x3)) = | -I | + | 1A | · | x1 | + | 0A | · | x2 | + | 0A | · | x3 |
POL(a__filter(x1, x2)) = | -I | + | 1A | · | x1 | + | 0A | · | x2 |
The following usable rules [FROCOS05] with respect to the argument filtering of the ordering [JAR06] were oriented:
a__from(X) → cons(mark(X), from(s(X)))
a__from(X) → from(X)
mark(primes) → a__primes
mark(sieve(X)) → a__sieve(mark(X))
mark(from(X)) → a__from(mark(X))
mark(head(X)) → a__head(mark(X))
a__head(cons(X, Y)) → mark(X)
mark(tail(X)) → a__tail(mark(X))
a__tail(cons(X, Y)) → mark(Y)
mark(if(X1, X2, X3)) → a__if(mark(X1), X2, X3)
a__if(true, X, Y) → mark(X)
a__if(false, X, Y) → mark(Y)
mark(filter(X1, X2)) → a__filter(mark(X1), mark(X2))
mark(s(X)) → s(mark(X))
mark(0) → 0
mark(cons(X1, X2)) → cons(mark(X1), X2)
mark(true) → true
mark(false) → false
mark(divides(X1, X2)) → divides(mark(X1), mark(X2))
a__primes → primes
a__primes → a__sieve(a__from(s(s(0))))
a__sieve(X) → sieve(X)
a__sieve(cons(X, Y)) → cons(mark(X), filter(X, sieve(Y)))
a__head(X) → head(X)
a__tail(X) → tail(X)
a__if(X1, X2, X3) → if(X1, X2, X3)
a__filter(X1, X2) → filter(X1, X2)
a__filter(s(s(X)), cons(Y, Z)) → a__if(divides(s(s(mark(X))), mark(Y)), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y))))
(10) Obligation:
Q DP problem:
The TRS P consists of the following rules:
A__SIEVE(cons(X, Y)) → MARK(X)
A__PRIMES → A__SIEVE(a__from(s(s(0))))
A__FROM(X) → MARK(X)
MARK(sieve(X)) → A__SIEVE(mark(X))
MARK(sieve(X)) → MARK(X)
MARK(from(X)) → A__FROM(mark(X))
MARK(head(X)) → A__HEAD(mark(X))
A__HEAD(cons(X, Y)) → MARK(X)
MARK(head(X)) → MARK(X)
MARK(tail(X)) → A__TAIL(mark(X))
MARK(if(X1, X2, X3)) → A__IF(mark(X1), X2, X3)
A__IF(true, X, Y) → MARK(X)
MARK(if(X1, X2, X3)) → MARK(X1)
MARK(filter(X1, X2)) → A__FILTER(mark(X1), mark(X2))
A__FILTER(s(s(X)), cons(Y, Z)) → MARK(X)
MARK(filter(X1, X2)) → MARK(X1)
MARK(filter(X1, X2)) → MARK(X2)
MARK(s(X)) → MARK(X)
MARK(cons(X1, X2)) → MARK(X1)
MARK(divides(X1, X2)) → MARK(X1)
MARK(divides(X1, X2)) → MARK(X2)
A__FILTER(s(s(X)), cons(Y, Z)) → MARK(Y)
A__IF(false, X, Y) → MARK(Y)
The TRS R consists of the following rules:
a__primes → a__sieve(a__from(s(s(0))))
a__from(X) → cons(mark(X), from(s(X)))
a__head(cons(X, Y)) → mark(X)
a__tail(cons(X, Y)) → mark(Y)
a__if(true, X, Y) → mark(X)
a__if(false, X, Y) → mark(Y)
a__filter(s(s(X)), cons(Y, Z)) → a__if(divides(s(s(mark(X))), mark(Y)), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y))))
a__sieve(cons(X, Y)) → cons(mark(X), filter(X, sieve(Y)))
mark(primes) → a__primes
mark(sieve(X)) → a__sieve(mark(X))
mark(from(X)) → a__from(mark(X))
mark(head(X)) → a__head(mark(X))
mark(tail(X)) → a__tail(mark(X))
mark(if(X1, X2, X3)) → a__if(mark(X1), X2, X3)
mark(filter(X1, X2)) → a__filter(mark(X1), mark(X2))
mark(s(X)) → s(mark(X))
mark(0) → 0
mark(cons(X1, X2)) → cons(mark(X1), X2)
mark(true) → true
mark(false) → false
mark(divides(X1, X2)) → divides(mark(X1), mark(X2))
a__primes → primes
a__sieve(X) → sieve(X)
a__from(X) → from(X)
a__head(X) → head(X)
a__tail(X) → tail(X)
a__if(X1, X2, X3) → if(X1, X2, X3)
a__filter(X1, X2) → filter(X1, X2)
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
(11) DependencyGraphProof (EQUIVALENT transformation)
The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 1 SCC with 2 less nodes.
(12) Obligation:
Q DP problem:
The TRS P consists of the following rules:
MARK(sieve(X)) → A__SIEVE(mark(X))
A__SIEVE(cons(X, Y)) → MARK(X)
MARK(sieve(X)) → MARK(X)
MARK(from(X)) → A__FROM(mark(X))
A__FROM(X) → MARK(X)
MARK(head(X)) → A__HEAD(mark(X))
A__HEAD(cons(X, Y)) → MARK(X)
MARK(head(X)) → MARK(X)
MARK(if(X1, X2, X3)) → A__IF(mark(X1), X2, X3)
A__IF(true, X, Y) → MARK(X)
MARK(if(X1, X2, X3)) → MARK(X1)
MARK(filter(X1, X2)) → A__FILTER(mark(X1), mark(X2))
A__FILTER(s(s(X)), cons(Y, Z)) → MARK(X)
MARK(filter(X1, X2)) → MARK(X1)
MARK(filter(X1, X2)) → MARK(X2)
MARK(s(X)) → MARK(X)
MARK(cons(X1, X2)) → MARK(X1)
MARK(divides(X1, X2)) → MARK(X1)
MARK(divides(X1, X2)) → MARK(X2)
A__FILTER(s(s(X)), cons(Y, Z)) → MARK(Y)
A__IF(false, X, Y) → MARK(Y)
The TRS R consists of the following rules:
a__primes → a__sieve(a__from(s(s(0))))
a__from(X) → cons(mark(X), from(s(X)))
a__head(cons(X, Y)) → mark(X)
a__tail(cons(X, Y)) → mark(Y)
a__if(true, X, Y) → mark(X)
a__if(false, X, Y) → mark(Y)
a__filter(s(s(X)), cons(Y, Z)) → a__if(divides(s(s(mark(X))), mark(Y)), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y))))
a__sieve(cons(X, Y)) → cons(mark(X), filter(X, sieve(Y)))
mark(primes) → a__primes
mark(sieve(X)) → a__sieve(mark(X))
mark(from(X)) → a__from(mark(X))
mark(head(X)) → a__head(mark(X))
mark(tail(X)) → a__tail(mark(X))
mark(if(X1, X2, X3)) → a__if(mark(X1), X2, X3)
mark(filter(X1, X2)) → a__filter(mark(X1), mark(X2))
mark(s(X)) → s(mark(X))
mark(0) → 0
mark(cons(X1, X2)) → cons(mark(X1), X2)
mark(true) → true
mark(false) → false
mark(divides(X1, X2)) → divides(mark(X1), mark(X2))
a__primes → primes
a__sieve(X) → sieve(X)
a__from(X) → from(X)
a__head(X) → head(X)
a__tail(X) → tail(X)
a__if(X1, X2, X3) → if(X1, X2, X3)
a__filter(X1, X2) → filter(X1, X2)
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
(13) QDPOrderProof (EQUIVALENT transformation)
We use the reduction pair processor [LPAR04,JAR06].
The following pairs can be oriented strictly and are deleted.
A__FILTER(s(s(X)), cons(Y, Z)) → MARK(Y)
The remaining pairs can at least be oriented weakly.
Used ordering: Matrix interpretation [MATRO] with arctic natural numbers [ARCTIC]:
POL(MARK(x1)) = | 0A | + | 1A | · | x1 |
POL(sieve(x1)) = | -I | + | 0A | · | x1 |
POL(A__SIEVE(x1)) = | 0A | + | 0A | · | x1 |
POL(mark(x1)) = | -I | + | 0A | · | x1 |
POL(cons(x1, x2)) = | -I | + | 1A | · | x1 | + | 0A | · | x2 |
POL(from(x1)) = | 4A | + | 4A | · | x1 |
POL(A__FROM(x1)) = | 0A | + | 5A | · | x1 |
POL(head(x1)) = | -I | + | 0A | · | x1 |
POL(A__HEAD(x1)) = | 0A | + | 0A | · | x1 |
POL(if(x1, x2, x3)) = | 0A | + | 0A | · | x1 | + | 0A | · | x2 | + | 0A | · | x3 |
POL(A__IF(x1, x2, x3)) = | 1A | + | -I | · | x1 | + | 1A | · | x2 | + | 1A | · | x3 |
POL(filter(x1, x2)) = | -I | + | 0A | · | x1 | + | 0A | · | x2 |
POL(A__FILTER(x1, x2)) = | 0A | + | 1A | · | x1 | + | 1A | · | x2 |
POL(divides(x1, x2)) = | -I | + | 0A | · | x1 | + | 0A | · | x2 |
POL(a__sieve(x1)) = | -I | + | 0A | · | x1 |
POL(a__from(x1)) = | 4A | + | 4A | · | x1 |
POL(a__head(x1)) = | -I | + | 0A | · | x1 |
POL(tail(x1)) = | 4A | + | 0A | · | x1 |
POL(a__tail(x1)) = | 4A | + | 0A | · | x1 |
POL(a__if(x1, x2, x3)) = | 0A | + | 0A | · | x1 | + | 0A | · | x2 | + | 0A | · | x3 |
POL(a__filter(x1, x2)) = | -I | + | 0A | · | x1 | + | 0A | · | x2 |
The following usable rules [FROCOS05] with respect to the argument filtering of the ordering [JAR06] were oriented:
mark(primes) → a__primes
mark(sieve(X)) → a__sieve(mark(X))
mark(from(X)) → a__from(mark(X))
mark(head(X)) → a__head(mark(X))
a__head(cons(X, Y)) → mark(X)
mark(tail(X)) → a__tail(mark(X))
a__tail(cons(X, Y)) → mark(Y)
mark(if(X1, X2, X3)) → a__if(mark(X1), X2, X3)
a__if(true, X, Y) → mark(X)
a__if(false, X, Y) → mark(Y)
mark(filter(X1, X2)) → a__filter(mark(X1), mark(X2))
mark(s(X)) → s(mark(X))
mark(0) → 0
mark(cons(X1, X2)) → cons(mark(X1), X2)
mark(true) → true
mark(false) → false
mark(divides(X1, X2)) → divides(mark(X1), mark(X2))
a__from(X) → cons(mark(X), from(s(X)))
a__primes → primes
a__primes → a__sieve(a__from(s(s(0))))
a__from(X) → from(X)
a__sieve(X) → sieve(X)
a__sieve(cons(X, Y)) → cons(mark(X), filter(X, sieve(Y)))
a__head(X) → head(X)
a__tail(X) → tail(X)
a__if(X1, X2, X3) → if(X1, X2, X3)
a__filter(X1, X2) → filter(X1, X2)
a__filter(s(s(X)), cons(Y, Z)) → a__if(divides(s(s(mark(X))), mark(Y)), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y))))
(14) Obligation:
Q DP problem:
The TRS P consists of the following rules:
MARK(sieve(X)) → A__SIEVE(mark(X))
A__SIEVE(cons(X, Y)) → MARK(X)
MARK(sieve(X)) → MARK(X)
MARK(from(X)) → A__FROM(mark(X))
A__FROM(X) → MARK(X)
MARK(head(X)) → A__HEAD(mark(X))
A__HEAD(cons(X, Y)) → MARK(X)
MARK(head(X)) → MARK(X)
MARK(if(X1, X2, X3)) → A__IF(mark(X1), X2, X3)
A__IF(true, X, Y) → MARK(X)
MARK(if(X1, X2, X3)) → MARK(X1)
MARK(filter(X1, X2)) → A__FILTER(mark(X1), mark(X2))
A__FILTER(s(s(X)), cons(Y, Z)) → MARK(X)
MARK(filter(X1, X2)) → MARK(X1)
MARK(filter(X1, X2)) → MARK(X2)
MARK(s(X)) → MARK(X)
MARK(cons(X1, X2)) → MARK(X1)
MARK(divides(X1, X2)) → MARK(X1)
MARK(divides(X1, X2)) → MARK(X2)
A__IF(false, X, Y) → MARK(Y)
The TRS R consists of the following rules:
a__primes → a__sieve(a__from(s(s(0))))
a__from(X) → cons(mark(X), from(s(X)))
a__head(cons(X, Y)) → mark(X)
a__tail(cons(X, Y)) → mark(Y)
a__if(true, X, Y) → mark(X)
a__if(false, X, Y) → mark(Y)
a__filter(s(s(X)), cons(Y, Z)) → a__if(divides(s(s(mark(X))), mark(Y)), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y))))
a__sieve(cons(X, Y)) → cons(mark(X), filter(X, sieve(Y)))
mark(primes) → a__primes
mark(sieve(X)) → a__sieve(mark(X))
mark(from(X)) → a__from(mark(X))
mark(head(X)) → a__head(mark(X))
mark(tail(X)) → a__tail(mark(X))
mark(if(X1, X2, X3)) → a__if(mark(X1), X2, X3)
mark(filter(X1, X2)) → a__filter(mark(X1), mark(X2))
mark(s(X)) → s(mark(X))
mark(0) → 0
mark(cons(X1, X2)) → cons(mark(X1), X2)
mark(true) → true
mark(false) → false
mark(divides(X1, X2)) → divides(mark(X1), mark(X2))
a__primes → primes
a__sieve(X) → sieve(X)
a__from(X) → from(X)
a__head(X) → head(X)
a__tail(X) → tail(X)
a__if(X1, X2, X3) → if(X1, X2, X3)
a__filter(X1, X2) → filter(X1, X2)
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
(15) QDPOrderProof (EQUIVALENT transformation)
We use the reduction pair processor [LPAR04,JAR06].
The following pairs can be oriented strictly and are deleted.
MARK(from(X)) → A__FROM(mark(X))
The remaining pairs can at least be oriented weakly.
Used ordering: Matrix interpretation [MATRO] with arctic natural numbers [ARCTIC]:
POL(MARK(x1)) = | 1A | + | 0A | · | x1 |
POL(sieve(x1)) = | 4A | + | 0A | · | x1 |
POL(A__SIEVE(x1)) = | 4A | + | 0A | · | x1 |
POL(mark(x1)) = | 0A | + | 0A | · | x1 |
POL(cons(x1, x2)) = | 0A | + | 0A | · | x1 | + | 0A | · | x2 |
POL(from(x1)) = | 3A | + | 1A | · | x1 |
POL(A__FROM(x1)) = | 1A | + | 0A | · | x1 |
POL(head(x1)) = | 1A | + | 1A | · | x1 |
POL(A__HEAD(x1)) = | 1A | + | 0A | · | x1 |
POL(if(x1, x2, x3)) = | -I | + | 0A | · | x1 | + | 0A | · | x2 | + | 0A | · | x3 |
POL(A__IF(x1, x2, x3)) = | 1A | + | -I | · | x1 | + | 0A | · | x2 | + | 0A | · | x3 |
POL(filter(x1, x2)) = | 4A | + | 0A | · | x1 | + | 0A | · | x2 |
POL(A__FILTER(x1, x2)) = | 4A | + | 0A | · | x1 | + | 0A | · | x2 |
POL(divides(x1, x2)) = | 1A | + | 0A | · | x1 | + | 0A | · | x2 |
POL(a__sieve(x1)) = | 4A | + | 0A | · | x1 |
POL(a__from(x1)) = | 3A | + | 1A | · | x1 |
POL(a__head(x1)) = | 1A | + | 1A | · | x1 |
POL(tail(x1)) = | 5A | + | 4A | · | x1 |
POL(a__tail(x1)) = | 5A | + | 4A | · | x1 |
POL(a__if(x1, x2, x3)) = | 0A | + | 0A | · | x1 | + | 0A | · | x2 | + | 0A | · | x3 |
POL(a__filter(x1, x2)) = | 4A | + | 0A | · | x1 | + | 0A | · | x2 |
The following usable rules [FROCOS05] with respect to the argument filtering of the ordering [JAR06] were oriented:
mark(primes) → a__primes
mark(sieve(X)) → a__sieve(mark(X))
mark(from(X)) → a__from(mark(X))
mark(head(X)) → a__head(mark(X))
a__head(cons(X, Y)) → mark(X)
mark(tail(X)) → a__tail(mark(X))
a__tail(cons(X, Y)) → mark(Y)
mark(if(X1, X2, X3)) → a__if(mark(X1), X2, X3)
a__if(true, X, Y) → mark(X)
a__if(false, X, Y) → mark(Y)
mark(filter(X1, X2)) → a__filter(mark(X1), mark(X2))
mark(s(X)) → s(mark(X))
mark(0) → 0
mark(cons(X1, X2)) → cons(mark(X1), X2)
mark(true) → true
mark(false) → false
mark(divides(X1, X2)) → divides(mark(X1), mark(X2))
a__from(X) → cons(mark(X), from(s(X)))
a__primes → primes
a__primes → a__sieve(a__from(s(s(0))))
a__from(X) → from(X)
a__sieve(X) → sieve(X)
a__sieve(cons(X, Y)) → cons(mark(X), filter(X, sieve(Y)))
a__head(X) → head(X)
a__tail(X) → tail(X)
a__if(X1, X2, X3) → if(X1, X2, X3)
a__filter(X1, X2) → filter(X1, X2)
a__filter(s(s(X)), cons(Y, Z)) → a__if(divides(s(s(mark(X))), mark(Y)), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y))))
(16) Obligation:
Q DP problem:
The TRS P consists of the following rules:
MARK(sieve(X)) → A__SIEVE(mark(X))
A__SIEVE(cons(X, Y)) → MARK(X)
MARK(sieve(X)) → MARK(X)
A__FROM(X) → MARK(X)
MARK(head(X)) → A__HEAD(mark(X))
A__HEAD(cons(X, Y)) → MARK(X)
MARK(head(X)) → MARK(X)
MARK(if(X1, X2, X3)) → A__IF(mark(X1), X2, X3)
A__IF(true, X, Y) → MARK(X)
MARK(if(X1, X2, X3)) → MARK(X1)
MARK(filter(X1, X2)) → A__FILTER(mark(X1), mark(X2))
A__FILTER(s(s(X)), cons(Y, Z)) → MARK(X)
MARK(filter(X1, X2)) → MARK(X1)
MARK(filter(X1, X2)) → MARK(X2)
MARK(s(X)) → MARK(X)
MARK(cons(X1, X2)) → MARK(X1)
MARK(divides(X1, X2)) → MARK(X1)
MARK(divides(X1, X2)) → MARK(X2)
A__IF(false, X, Y) → MARK(Y)
The TRS R consists of the following rules:
a__primes → a__sieve(a__from(s(s(0))))
a__from(X) → cons(mark(X), from(s(X)))
a__head(cons(X, Y)) → mark(X)
a__tail(cons(X, Y)) → mark(Y)
a__if(true, X, Y) → mark(X)
a__if(false, X, Y) → mark(Y)
a__filter(s(s(X)), cons(Y, Z)) → a__if(divides(s(s(mark(X))), mark(Y)), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y))))
a__sieve(cons(X, Y)) → cons(mark(X), filter(X, sieve(Y)))
mark(primes) → a__primes
mark(sieve(X)) → a__sieve(mark(X))
mark(from(X)) → a__from(mark(X))
mark(head(X)) → a__head(mark(X))
mark(tail(X)) → a__tail(mark(X))
mark(if(X1, X2, X3)) → a__if(mark(X1), X2, X3)
mark(filter(X1, X2)) → a__filter(mark(X1), mark(X2))
mark(s(X)) → s(mark(X))
mark(0) → 0
mark(cons(X1, X2)) → cons(mark(X1), X2)
mark(true) → true
mark(false) → false
mark(divides(X1, X2)) → divides(mark(X1), mark(X2))
a__primes → primes
a__sieve(X) → sieve(X)
a__from(X) → from(X)
a__head(X) → head(X)
a__tail(X) → tail(X)
a__if(X1, X2, X3) → if(X1, X2, X3)
a__filter(X1, X2) → filter(X1, X2)
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
(17) DependencyGraphProof (EQUIVALENT transformation)
The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 1 SCC with 1 less node.
(18) Obligation:
Q DP problem:
The TRS P consists of the following rules:
A__SIEVE(cons(X, Y)) → MARK(X)
MARK(sieve(X)) → A__SIEVE(mark(X))
MARK(sieve(X)) → MARK(X)
MARK(head(X)) → A__HEAD(mark(X))
A__HEAD(cons(X, Y)) → MARK(X)
MARK(head(X)) → MARK(X)
MARK(if(X1, X2, X3)) → A__IF(mark(X1), X2, X3)
A__IF(true, X, Y) → MARK(X)
MARK(if(X1, X2, X3)) → MARK(X1)
MARK(filter(X1, X2)) → A__FILTER(mark(X1), mark(X2))
A__FILTER(s(s(X)), cons(Y, Z)) → MARK(X)
MARK(filter(X1, X2)) → MARK(X1)
MARK(filter(X1, X2)) → MARK(X2)
MARK(s(X)) → MARK(X)
MARK(cons(X1, X2)) → MARK(X1)
MARK(divides(X1, X2)) → MARK(X1)
MARK(divides(X1, X2)) → MARK(X2)
A__IF(false, X, Y) → MARK(Y)
The TRS R consists of the following rules:
a__primes → a__sieve(a__from(s(s(0))))
a__from(X) → cons(mark(X), from(s(X)))
a__head(cons(X, Y)) → mark(X)
a__tail(cons(X, Y)) → mark(Y)
a__if(true, X, Y) → mark(X)
a__if(false, X, Y) → mark(Y)
a__filter(s(s(X)), cons(Y, Z)) → a__if(divides(s(s(mark(X))), mark(Y)), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y))))
a__sieve(cons(X, Y)) → cons(mark(X), filter(X, sieve(Y)))
mark(primes) → a__primes
mark(sieve(X)) → a__sieve(mark(X))
mark(from(X)) → a__from(mark(X))
mark(head(X)) → a__head(mark(X))
mark(tail(X)) → a__tail(mark(X))
mark(if(X1, X2, X3)) → a__if(mark(X1), X2, X3)
mark(filter(X1, X2)) → a__filter(mark(X1), mark(X2))
mark(s(X)) → s(mark(X))
mark(0) → 0
mark(cons(X1, X2)) → cons(mark(X1), X2)
mark(true) → true
mark(false) → false
mark(divides(X1, X2)) → divides(mark(X1), mark(X2))
a__primes → primes
a__sieve(X) → sieve(X)
a__from(X) → from(X)
a__head(X) → head(X)
a__tail(X) → tail(X)
a__if(X1, X2, X3) → if(X1, X2, X3)
a__filter(X1, X2) → filter(X1, X2)
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
(19) QDPOrderProof (EQUIVALENT transformation)
We use the reduction pair processor [LPAR04,JAR06].
The following pairs can be oriented strictly and are deleted.
A__HEAD(cons(X, Y)) → MARK(X)
The remaining pairs can at least be oriented weakly.
Used ordering: Matrix interpretation [MATRO] with arctic natural numbers [ARCTIC]:
POL(A__SIEVE(x1)) = | 5A | + | 1A | · | x1 |
POL(cons(x1, x2)) = | 1A | + | 0A | · | x1 | + | 0A | · | x2 |
POL(MARK(x1)) = | 4A | + | 1A | · | x1 |
POL(sieve(x1)) = | 4A | + | 0A | · | x1 |
POL(mark(x1)) = | -I | + | 0A | · | x1 |
POL(head(x1)) = | -I | + | 3A | · | x1 |
POL(A__HEAD(x1)) = | 3A | + | 4A | · | x1 |
POL(if(x1, x2, x3)) = | -I | + | 0A | · | x1 | + | 0A | · | x2 | + | 0A | · | x3 |
POL(A__IF(x1, x2, x3)) = | 4A | + | -I | · | x1 | + | 1A | · | x2 | + | 1A | · | x3 |
POL(filter(x1, x2)) = | 4A | + | 0A | · | x1 | + | 0A | · | x2 |
POL(A__FILTER(x1, x2)) = | 4A | + | 1A | · | x1 | + | -I | · | x2 |
POL(divides(x1, x2)) = | -I | + | 0A | · | x1 | + | 0A | · | x2 |
POL(a__sieve(x1)) = | 4A | + | 0A | · | x1 |
POL(from(x1)) = | 1A | + | 5A | · | x1 |
POL(a__from(x1)) = | 1A | + | 5A | · | x1 |
POL(a__head(x1)) = | -I | + | 3A | · | x1 |
POL(tail(x1)) = | 3A | + | 2A | · | x1 |
POL(a__tail(x1)) = | 3A | + | 2A | · | x1 |
POL(a__if(x1, x2, x3)) = | -I | + | 0A | · | x1 | + | 0A | · | x2 | + | 0A | · | x3 |
POL(a__filter(x1, x2)) = | 4A | + | 0A | · | x1 | + | 0A | · | x2 |
The following usable rules [FROCOS05] with respect to the argument filtering of the ordering [JAR06] were oriented:
mark(primes) → a__primes
mark(sieve(X)) → a__sieve(mark(X))
mark(from(X)) → a__from(mark(X))
mark(head(X)) → a__head(mark(X))
a__head(cons(X, Y)) → mark(X)
mark(tail(X)) → a__tail(mark(X))
a__tail(cons(X, Y)) → mark(Y)
mark(if(X1, X2, X3)) → a__if(mark(X1), X2, X3)
a__if(true, X, Y) → mark(X)
a__if(false, X, Y) → mark(Y)
mark(filter(X1, X2)) → a__filter(mark(X1), mark(X2))
mark(s(X)) → s(mark(X))
mark(0) → 0
mark(cons(X1, X2)) → cons(mark(X1), X2)
mark(true) → true
mark(false) → false
mark(divides(X1, X2)) → divides(mark(X1), mark(X2))
a__from(X) → cons(mark(X), from(s(X)))
a__primes → primes
a__primes → a__sieve(a__from(s(s(0))))
a__from(X) → from(X)
a__sieve(X) → sieve(X)
a__sieve(cons(X, Y)) → cons(mark(X), filter(X, sieve(Y)))
a__head(X) → head(X)
a__tail(X) → tail(X)
a__if(X1, X2, X3) → if(X1, X2, X3)
a__filter(X1, X2) → filter(X1, X2)
a__filter(s(s(X)), cons(Y, Z)) → a__if(divides(s(s(mark(X))), mark(Y)), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y))))
(20) Obligation:
Q DP problem:
The TRS P consists of the following rules:
A__SIEVE(cons(X, Y)) → MARK(X)
MARK(sieve(X)) → A__SIEVE(mark(X))
MARK(sieve(X)) → MARK(X)
MARK(head(X)) → A__HEAD(mark(X))
MARK(head(X)) → MARK(X)
MARK(if(X1, X2, X3)) → A__IF(mark(X1), X2, X3)
A__IF(true, X, Y) → MARK(X)
MARK(if(X1, X2, X3)) → MARK(X1)
MARK(filter(X1, X2)) → A__FILTER(mark(X1), mark(X2))
A__FILTER(s(s(X)), cons(Y, Z)) → MARK(X)
MARK(filter(X1, X2)) → MARK(X1)
MARK(filter(X1, X2)) → MARK(X2)
MARK(s(X)) → MARK(X)
MARK(cons(X1, X2)) → MARK(X1)
MARK(divides(X1, X2)) → MARK(X1)
MARK(divides(X1, X2)) → MARK(X2)
A__IF(false, X, Y) → MARK(Y)
The TRS R consists of the following rules:
a__primes → a__sieve(a__from(s(s(0))))
a__from(X) → cons(mark(X), from(s(X)))
a__head(cons(X, Y)) → mark(X)
a__tail(cons(X, Y)) → mark(Y)
a__if(true, X, Y) → mark(X)
a__if(false, X, Y) → mark(Y)
a__filter(s(s(X)), cons(Y, Z)) → a__if(divides(s(s(mark(X))), mark(Y)), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y))))
a__sieve(cons(X, Y)) → cons(mark(X), filter(X, sieve(Y)))
mark(primes) → a__primes
mark(sieve(X)) → a__sieve(mark(X))
mark(from(X)) → a__from(mark(X))
mark(head(X)) → a__head(mark(X))
mark(tail(X)) → a__tail(mark(X))
mark(if(X1, X2, X3)) → a__if(mark(X1), X2, X3)
mark(filter(X1, X2)) → a__filter(mark(X1), mark(X2))
mark(s(X)) → s(mark(X))
mark(0) → 0
mark(cons(X1, X2)) → cons(mark(X1), X2)
mark(true) → true
mark(false) → false
mark(divides(X1, X2)) → divides(mark(X1), mark(X2))
a__primes → primes
a__sieve(X) → sieve(X)
a__from(X) → from(X)
a__head(X) → head(X)
a__tail(X) → tail(X)
a__if(X1, X2, X3) → if(X1, X2, X3)
a__filter(X1, X2) → filter(X1, X2)
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
(21) DependencyGraphProof (EQUIVALENT transformation)
The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 1 SCC with 1 less node.
(22) Obligation:
Q DP problem:
The TRS P consists of the following rules:
MARK(sieve(X)) → A__SIEVE(mark(X))
A__SIEVE(cons(X, Y)) → MARK(X)
MARK(sieve(X)) → MARK(X)
MARK(head(X)) → MARK(X)
MARK(if(X1, X2, X3)) → A__IF(mark(X1), X2, X3)
A__IF(true, X, Y) → MARK(X)
MARK(if(X1, X2, X3)) → MARK(X1)
MARK(filter(X1, X2)) → A__FILTER(mark(X1), mark(X2))
A__FILTER(s(s(X)), cons(Y, Z)) → MARK(X)
MARK(filter(X1, X2)) → MARK(X1)
MARK(filter(X1, X2)) → MARK(X2)
MARK(s(X)) → MARK(X)
MARK(cons(X1, X2)) → MARK(X1)
MARK(divides(X1, X2)) → MARK(X1)
MARK(divides(X1, X2)) → MARK(X2)
A__IF(false, X, Y) → MARK(Y)
The TRS R consists of the following rules:
a__primes → a__sieve(a__from(s(s(0))))
a__from(X) → cons(mark(X), from(s(X)))
a__head(cons(X, Y)) → mark(X)
a__tail(cons(X, Y)) → mark(Y)
a__if(true, X, Y) → mark(X)
a__if(false, X, Y) → mark(Y)
a__filter(s(s(X)), cons(Y, Z)) → a__if(divides(s(s(mark(X))), mark(Y)), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y))))
a__sieve(cons(X, Y)) → cons(mark(X), filter(X, sieve(Y)))
mark(primes) → a__primes
mark(sieve(X)) → a__sieve(mark(X))
mark(from(X)) → a__from(mark(X))
mark(head(X)) → a__head(mark(X))
mark(tail(X)) → a__tail(mark(X))
mark(if(X1, X2, X3)) → a__if(mark(X1), X2, X3)
mark(filter(X1, X2)) → a__filter(mark(X1), mark(X2))
mark(s(X)) → s(mark(X))
mark(0) → 0
mark(cons(X1, X2)) → cons(mark(X1), X2)
mark(true) → true
mark(false) → false
mark(divides(X1, X2)) → divides(mark(X1), mark(X2))
a__primes → primes
a__sieve(X) → sieve(X)
a__from(X) → from(X)
a__head(X) → head(X)
a__tail(X) → tail(X)
a__if(X1, X2, X3) → if(X1, X2, X3)
a__filter(X1, X2) → filter(X1, X2)
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
(23) QDPOrderProof (EQUIVALENT transformation)
We use the reduction pair processor [LPAR04,JAR06].
The following pairs can be oriented strictly and are deleted.
MARK(cons(X1, X2)) → MARK(X1)
The remaining pairs can at least be oriented weakly.
Used ordering: Matrix interpretation [MATRO] with arctic natural numbers [ARCTIC]:
POL(MARK(x1)) = | 5A | + | 5A | · | x1 |
POL(sieve(x1)) = | 0A | + | 0A | · | x1 |
POL(A__SIEVE(x1)) = | 5A | + | 2A | · | x1 |
POL(mark(x1)) = | 0A | + | 0A | · | x1 |
POL(cons(x1, x2)) = | 3A | + | 3A | · | x1 | + | 0A | · | x2 |
POL(head(x1)) = | 5A | + | 0A | · | x1 |
POL(if(x1, x2, x3)) = | -I | + | 0A | · | x1 | + | 0A | · | x2 | + | 0A | · | x3 |
POL(A__IF(x1, x2, x3)) = | 5A | + | -I | · | x1 | + | 5A | · | x2 | + | 5A | · | x3 |
POL(filter(x1, x2)) = | -I | + | 0A | · | x1 | + | 0A | · | x2 |
POL(A__FILTER(x1, x2)) = | 5A | + | 5A | · | x1 | + | 2A | · | x2 |
POL(divides(x1, x2)) = | -I | + | 0A | · | x1 | + | 0A | · | x2 |
POL(a__sieve(x1)) = | 0A | + | 0A | · | x1 |
POL(from(x1)) = | 5A | + | 5A | · | x1 |
POL(a__from(x1)) = | 5A | + | 5A | · | x1 |
POL(a__head(x1)) = | 5A | + | 0A | · | x1 |
POL(tail(x1)) = | 4A | + | 2A | · | x1 |
POL(a__tail(x1)) = | 4A | + | 2A | · | x1 |
POL(a__if(x1, x2, x3)) = | 0A | + | 0A | · | x1 | + | 0A | · | x2 | + | 0A | · | x3 |
POL(a__filter(x1, x2)) = | 0A | + | 0A | · | x1 | + | 0A | · | x2 |
The following usable rules [FROCOS05] with respect to the argument filtering of the ordering [JAR06] were oriented:
mark(primes) → a__primes
mark(sieve(X)) → a__sieve(mark(X))
mark(from(X)) → a__from(mark(X))
mark(head(X)) → a__head(mark(X))
a__head(cons(X, Y)) → mark(X)
mark(tail(X)) → a__tail(mark(X))
a__tail(cons(X, Y)) → mark(Y)
mark(if(X1, X2, X3)) → a__if(mark(X1), X2, X3)
a__if(true, X, Y) → mark(X)
a__if(false, X, Y) → mark(Y)
mark(filter(X1, X2)) → a__filter(mark(X1), mark(X2))
mark(s(X)) → s(mark(X))
mark(0) → 0
mark(cons(X1, X2)) → cons(mark(X1), X2)
mark(true) → true
mark(false) → false
mark(divides(X1, X2)) → divides(mark(X1), mark(X2))
a__from(X) → cons(mark(X), from(s(X)))
a__primes → primes
a__primes → a__sieve(a__from(s(s(0))))
a__from(X) → from(X)
a__sieve(X) → sieve(X)
a__sieve(cons(X, Y)) → cons(mark(X), filter(X, sieve(Y)))
a__head(X) → head(X)
a__tail(X) → tail(X)
a__if(X1, X2, X3) → if(X1, X2, X3)
a__filter(X1, X2) → filter(X1, X2)
a__filter(s(s(X)), cons(Y, Z)) → a__if(divides(s(s(mark(X))), mark(Y)), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y))))
(24) Obligation:
Q DP problem:
The TRS P consists of the following rules:
MARK(sieve(X)) → A__SIEVE(mark(X))
A__SIEVE(cons(X, Y)) → MARK(X)
MARK(sieve(X)) → MARK(X)
MARK(head(X)) → MARK(X)
MARK(if(X1, X2, X3)) → A__IF(mark(X1), X2, X3)
A__IF(true, X, Y) → MARK(X)
MARK(if(X1, X2, X3)) → MARK(X1)
MARK(filter(X1, X2)) → A__FILTER(mark(X1), mark(X2))
A__FILTER(s(s(X)), cons(Y, Z)) → MARK(X)
MARK(filter(X1, X2)) → MARK(X1)
MARK(filter(X1, X2)) → MARK(X2)
MARK(s(X)) → MARK(X)
MARK(divides(X1, X2)) → MARK(X1)
MARK(divides(X1, X2)) → MARK(X2)
A__IF(false, X, Y) → MARK(Y)
The TRS R consists of the following rules:
a__primes → a__sieve(a__from(s(s(0))))
a__from(X) → cons(mark(X), from(s(X)))
a__head(cons(X, Y)) → mark(X)
a__tail(cons(X, Y)) → mark(Y)
a__if(true, X, Y) → mark(X)
a__if(false, X, Y) → mark(Y)
a__filter(s(s(X)), cons(Y, Z)) → a__if(divides(s(s(mark(X))), mark(Y)), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y))))
a__sieve(cons(X, Y)) → cons(mark(X), filter(X, sieve(Y)))
mark(primes) → a__primes
mark(sieve(X)) → a__sieve(mark(X))
mark(from(X)) → a__from(mark(X))
mark(head(X)) → a__head(mark(X))
mark(tail(X)) → a__tail(mark(X))
mark(if(X1, X2, X3)) → a__if(mark(X1), X2, X3)
mark(filter(X1, X2)) → a__filter(mark(X1), mark(X2))
mark(s(X)) → s(mark(X))
mark(0) → 0
mark(cons(X1, X2)) → cons(mark(X1), X2)
mark(true) → true
mark(false) → false
mark(divides(X1, X2)) → divides(mark(X1), mark(X2))
a__primes → primes
a__sieve(X) → sieve(X)
a__from(X) → from(X)
a__head(X) → head(X)
a__tail(X) → tail(X)
a__if(X1, X2, X3) → if(X1, X2, X3)
a__filter(X1, X2) → filter(X1, X2)
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
(25) QDPOrderProof (EQUIVALENT transformation)
We use the reduction pair processor [LPAR04,JAR06].
The following pairs can be oriented strictly and are deleted.
MARK(sieve(X)) → A__SIEVE(mark(X))
MARK(sieve(X)) → MARK(X)
MARK(head(X)) → MARK(X)
MARK(filter(X1, X2)) → A__FILTER(mark(X1), mark(X2))
MARK(filter(X1, X2)) → MARK(X1)
MARK(divides(X1, X2)) → MARK(X1)
The remaining pairs can at least be oriented weakly.
Used ordering: Matrix interpretation [MATRO] with arctic natural numbers [ARCTIC]:
POL(MARK(x1)) = | 2A | + | 2A | · | x1 |
POL(sieve(x1)) = | 3A | + | 2A | · | x1 |
POL(A__SIEVE(x1)) = | -I | + | 0A | · | x1 |
POL(mark(x1)) = | 0A | + | 0A | · | x1 |
POL(cons(x1, x2)) = | 3A | + | 2A | · | x1 | + | 0A | · | x2 |
POL(head(x1)) = | 4A | + | 4A | · | x1 |
POL(if(x1, x2, x3)) = | 1A | + | 0A | · | x1 | + | 0A | · | x2 | + | 0A | · | x3 |
POL(A__IF(x1, x2, x3)) = | 3A | + | -I | · | x1 | + | 2A | · | x2 | + | 2A | · | x3 |
POL(filter(x1, x2)) = | 3A | + | 3A | · | x1 | + | 0A | · | x2 |
POL(A__FILTER(x1, x2)) = | 0A | + | 2A | · | x1 | + | -I | · | x2 |
POL(divides(x1, x2)) = | 2A | + | 2A | · | x1 | + | 0A | · | x2 |
POL(a__sieve(x1)) = | 3A | + | 2A | · | x1 |
POL(from(x1)) = | 3A | + | 2A | · | x1 |
POL(a__from(x1)) = | 3A | + | 2A | · | x1 |
POL(a__head(x1)) = | 4A | + | 4A | · | x1 |
POL(tail(x1)) = | 3A | + | 1A | · | x1 |
POL(a__tail(x1)) = | 3A | + | 1A | · | x1 |
POL(a__if(x1, x2, x3)) = | 1A | + | 0A | · | x1 | + | 0A | · | x2 | + | 0A | · | x3 |
POL(a__filter(x1, x2)) = | 3A | + | 3A | · | x1 | + | 0A | · | x2 |
The following usable rules [FROCOS05] with respect to the argument filtering of the ordering [JAR06] were oriented:
mark(primes) → a__primes
mark(sieve(X)) → a__sieve(mark(X))
mark(from(X)) → a__from(mark(X))
mark(head(X)) → a__head(mark(X))
a__head(cons(X, Y)) → mark(X)
mark(tail(X)) → a__tail(mark(X))
a__tail(cons(X, Y)) → mark(Y)
mark(if(X1, X2, X3)) → a__if(mark(X1), X2, X3)
a__if(true, X, Y) → mark(X)
a__if(false, X, Y) → mark(Y)
mark(filter(X1, X2)) → a__filter(mark(X1), mark(X2))
mark(s(X)) → s(mark(X))
mark(0) → 0
mark(cons(X1, X2)) → cons(mark(X1), X2)
mark(true) → true
mark(false) → false
mark(divides(X1, X2)) → divides(mark(X1), mark(X2))
a__from(X) → cons(mark(X), from(s(X)))
a__primes → primes
a__primes → a__sieve(a__from(s(s(0))))
a__from(X) → from(X)
a__sieve(X) → sieve(X)
a__sieve(cons(X, Y)) → cons(mark(X), filter(X, sieve(Y)))
a__head(X) → head(X)
a__tail(X) → tail(X)
a__if(X1, X2, X3) → if(X1, X2, X3)
a__filter(X1, X2) → filter(X1, X2)
a__filter(s(s(X)), cons(Y, Z)) → a__if(divides(s(s(mark(X))), mark(Y)), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y))))
(26) Obligation:
Q DP problem:
The TRS P consists of the following rules:
A__SIEVE(cons(X, Y)) → MARK(X)
MARK(if(X1, X2, X3)) → A__IF(mark(X1), X2, X3)
A__IF(true, X, Y) → MARK(X)
MARK(if(X1, X2, X3)) → MARK(X1)
A__FILTER(s(s(X)), cons(Y, Z)) → MARK(X)
MARK(filter(X1, X2)) → MARK(X2)
MARK(s(X)) → MARK(X)
MARK(divides(X1, X2)) → MARK(X2)
A__IF(false, X, Y) → MARK(Y)
The TRS R consists of the following rules:
a__primes → a__sieve(a__from(s(s(0))))
a__from(X) → cons(mark(X), from(s(X)))
a__head(cons(X, Y)) → mark(X)
a__tail(cons(X, Y)) → mark(Y)
a__if(true, X, Y) → mark(X)
a__if(false, X, Y) → mark(Y)
a__filter(s(s(X)), cons(Y, Z)) → a__if(divides(s(s(mark(X))), mark(Y)), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y))))
a__sieve(cons(X, Y)) → cons(mark(X), filter(X, sieve(Y)))
mark(primes) → a__primes
mark(sieve(X)) → a__sieve(mark(X))
mark(from(X)) → a__from(mark(X))
mark(head(X)) → a__head(mark(X))
mark(tail(X)) → a__tail(mark(X))
mark(if(X1, X2, X3)) → a__if(mark(X1), X2, X3)
mark(filter(X1, X2)) → a__filter(mark(X1), mark(X2))
mark(s(X)) → s(mark(X))
mark(0) → 0
mark(cons(X1, X2)) → cons(mark(X1), X2)
mark(true) → true
mark(false) → false
mark(divides(X1, X2)) → divides(mark(X1), mark(X2))
a__primes → primes
a__sieve(X) → sieve(X)
a__from(X) → from(X)
a__head(X) → head(X)
a__tail(X) → tail(X)
a__if(X1, X2, X3) → if(X1, X2, X3)
a__filter(X1, X2) → filter(X1, X2)
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
(27) DependencyGraphProof (EQUIVALENT transformation)
The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 1 SCC with 2 less nodes.
(28) Obligation:
Q DP problem:
The TRS P consists of the following rules:
A__IF(true, X, Y) → MARK(X)
MARK(if(X1, X2, X3)) → A__IF(mark(X1), X2, X3)
A__IF(false, X, Y) → MARK(Y)
MARK(if(X1, X2, X3)) → MARK(X1)
MARK(filter(X1, X2)) → MARK(X2)
MARK(s(X)) → MARK(X)
MARK(divides(X1, X2)) → MARK(X2)
The TRS R consists of the following rules:
a__primes → a__sieve(a__from(s(s(0))))
a__from(X) → cons(mark(X), from(s(X)))
a__head(cons(X, Y)) → mark(X)
a__tail(cons(X, Y)) → mark(Y)
a__if(true, X, Y) → mark(X)
a__if(false, X, Y) → mark(Y)
a__filter(s(s(X)), cons(Y, Z)) → a__if(divides(s(s(mark(X))), mark(Y)), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y))))
a__sieve(cons(X, Y)) → cons(mark(X), filter(X, sieve(Y)))
mark(primes) → a__primes
mark(sieve(X)) → a__sieve(mark(X))
mark(from(X)) → a__from(mark(X))
mark(head(X)) → a__head(mark(X))
mark(tail(X)) → a__tail(mark(X))
mark(if(X1, X2, X3)) → a__if(mark(X1), X2, X3)
mark(filter(X1, X2)) → a__filter(mark(X1), mark(X2))
mark(s(X)) → s(mark(X))
mark(0) → 0
mark(cons(X1, X2)) → cons(mark(X1), X2)
mark(true) → true
mark(false) → false
mark(divides(X1, X2)) → divides(mark(X1), mark(X2))
a__primes → primes
a__sieve(X) → sieve(X)
a__from(X) → from(X)
a__head(X) → head(X)
a__tail(X) → tail(X)
a__if(X1, X2, X3) → if(X1, X2, X3)
a__filter(X1, X2) → filter(X1, X2)
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
(29) 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:
- MARK(if(X1, X2, X3)) → A__IF(mark(X1), X2, X3)
The graph contains the following edges 1 > 2, 1 > 3
- MARK(if(X1, X2, X3)) → MARK(X1)
The graph contains the following edges 1 > 1
- MARK(filter(X1, X2)) → MARK(X2)
The graph contains the following edges 1 > 1
- MARK(s(X)) → MARK(X)
The graph contains the following edges 1 > 1
- MARK(divides(X1, X2)) → MARK(X2)
The graph contains the following edges 1 > 1
- A__IF(true, X, Y) → MARK(X)
The graph contains the following edges 2 >= 1
- A__IF(false, X, Y) → MARK(Y)
The graph contains the following edges 3 >= 1
(30) YES