(0) Obligation:

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

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
active(sieve(X)) → sieve(active(X))
active(from(X)) → from(active(X))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(head(X)) → head(active(X))
active(tail(X)) → tail(active(X))
active(if(X1, X2, X3)) → if(active(X1), X2, X3)
active(filter(X1, X2)) → filter(active(X1), X2)
active(filter(X1, X2)) → filter(X1, active(X2))
active(divides(X1, X2)) → divides(active(X1), X2)
active(divides(X1, X2)) → divides(X1, active(X2))
sieve(mark(X)) → mark(sieve(X))
from(mark(X)) → mark(from(X))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
head(mark(X)) → mark(head(X))
tail(mark(X)) → mark(tail(X))
if(mark(X1), X2, X3) → mark(if(X1, X2, X3))
filter(mark(X1), X2) → mark(filter(X1, X2))
filter(X1, mark(X2)) → mark(filter(X1, X2))
divides(mark(X1), X2) → mark(divides(X1, X2))
divides(X1, mark(X2)) → mark(divides(X1, X2))
proper(primes) → ok(primes)
proper(sieve(X)) → sieve(proper(X))
proper(from(X)) → from(proper(X))
proper(s(X)) → s(proper(X))
proper(0) → ok(0)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(head(X)) → head(proper(X))
proper(tail(X)) → tail(proper(X))
proper(if(X1, X2, X3)) → if(proper(X1), proper(X2), proper(X3))
proper(true) → ok(true)
proper(false) → ok(false)
proper(filter(X1, X2)) → filter(proper(X1), proper(X2))
proper(divides(X1, X2)) → divides(proper(X1), proper(X2))
sieve(ok(X)) → ok(sieve(X))
from(ok(X)) → ok(from(X))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
head(ok(X)) → ok(head(X))
tail(ok(X)) → ok(tail(X))
if(ok(X1), ok(X2), ok(X3)) → ok(if(X1, X2, X3))
filter(ok(X1), ok(X2)) → ok(filter(X1, X2))
divides(ok(X1), ok(X2)) → ok(divides(X1, X2))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

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:

ACTIVE(primes) → SIEVE(from(s(s(0))))
ACTIVE(primes) → FROM(s(s(0)))
ACTIVE(primes) → S(s(0))
ACTIVE(primes) → S(0)
ACTIVE(from(X)) → CONS(X, from(s(X)))
ACTIVE(from(X)) → FROM(s(X))
ACTIVE(from(X)) → S(X)
ACTIVE(filter(s(s(X)), cons(Y, Z))) → IF(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y))))
ACTIVE(filter(s(s(X)), cons(Y, Z))) → DIVIDES(s(s(X)), Y)
ACTIVE(filter(s(s(X)), cons(Y, Z))) → FILTER(s(s(X)), Z)
ACTIVE(filter(s(s(X)), cons(Y, Z))) → CONS(Y, filter(X, sieve(Y)))
ACTIVE(filter(s(s(X)), cons(Y, Z))) → FILTER(X, sieve(Y))
ACTIVE(filter(s(s(X)), cons(Y, Z))) → SIEVE(Y)
ACTIVE(sieve(cons(X, Y))) → CONS(X, filter(X, sieve(Y)))
ACTIVE(sieve(cons(X, Y))) → FILTER(X, sieve(Y))
ACTIVE(sieve(cons(X, Y))) → SIEVE(Y)
ACTIVE(sieve(X)) → SIEVE(active(X))
ACTIVE(sieve(X)) → ACTIVE(X)
ACTIVE(from(X)) → FROM(active(X))
ACTIVE(from(X)) → ACTIVE(X)
ACTIVE(s(X)) → S(active(X))
ACTIVE(s(X)) → ACTIVE(X)
ACTIVE(cons(X1, X2)) → CONS(active(X1), X2)
ACTIVE(cons(X1, X2)) → ACTIVE(X1)
ACTIVE(head(X)) → HEAD(active(X))
ACTIVE(head(X)) → ACTIVE(X)
ACTIVE(tail(X)) → TAIL(active(X))
ACTIVE(tail(X)) → ACTIVE(X)
ACTIVE(if(X1, X2, X3)) → IF(active(X1), X2, X3)
ACTIVE(if(X1, X2, X3)) → ACTIVE(X1)
ACTIVE(filter(X1, X2)) → FILTER(active(X1), X2)
ACTIVE(filter(X1, X2)) → ACTIVE(X1)
ACTIVE(filter(X1, X2)) → FILTER(X1, active(X2))
ACTIVE(filter(X1, X2)) → ACTIVE(X2)
ACTIVE(divides(X1, X2)) → DIVIDES(active(X1), X2)
ACTIVE(divides(X1, X2)) → ACTIVE(X1)
ACTIVE(divides(X1, X2)) → DIVIDES(X1, active(X2))
ACTIVE(divides(X1, X2)) → ACTIVE(X2)
SIEVE(mark(X)) → SIEVE(X)
FROM(mark(X)) → FROM(X)
S(mark(X)) → S(X)
CONS(mark(X1), X2) → CONS(X1, X2)
HEAD(mark(X)) → HEAD(X)
TAIL(mark(X)) → TAIL(X)
IF(mark(X1), X2, X3) → IF(X1, X2, X3)
FILTER(mark(X1), X2) → FILTER(X1, X2)
FILTER(X1, mark(X2)) → FILTER(X1, X2)
DIVIDES(mark(X1), X2) → DIVIDES(X1, X2)
DIVIDES(X1, mark(X2)) → DIVIDES(X1, X2)
PROPER(sieve(X)) → SIEVE(proper(X))
PROPER(sieve(X)) → PROPER(X)
PROPER(from(X)) → FROM(proper(X))
PROPER(from(X)) → PROPER(X)
PROPER(s(X)) → S(proper(X))
PROPER(s(X)) → PROPER(X)
PROPER(cons(X1, X2)) → CONS(proper(X1), proper(X2))
PROPER(cons(X1, X2)) → PROPER(X1)
PROPER(cons(X1, X2)) → PROPER(X2)
PROPER(head(X)) → HEAD(proper(X))
PROPER(head(X)) → PROPER(X)
PROPER(tail(X)) → TAIL(proper(X))
PROPER(tail(X)) → PROPER(X)
PROPER(if(X1, X2, X3)) → IF(proper(X1), proper(X2), proper(X3))
PROPER(if(X1, X2, X3)) → PROPER(X1)
PROPER(if(X1, X2, X3)) → PROPER(X2)
PROPER(if(X1, X2, X3)) → PROPER(X3)
PROPER(filter(X1, X2)) → FILTER(proper(X1), proper(X2))
PROPER(filter(X1, X2)) → PROPER(X1)
PROPER(filter(X1, X2)) → PROPER(X2)
PROPER(divides(X1, X2)) → DIVIDES(proper(X1), proper(X2))
PROPER(divides(X1, X2)) → PROPER(X1)
PROPER(divides(X1, X2)) → PROPER(X2)
SIEVE(ok(X)) → SIEVE(X)
FROM(ok(X)) → FROM(X)
S(ok(X)) → S(X)
CONS(ok(X1), ok(X2)) → CONS(X1, X2)
HEAD(ok(X)) → HEAD(X)
TAIL(ok(X)) → TAIL(X)
IF(ok(X1), ok(X2), ok(X3)) → IF(X1, X2, X3)
FILTER(ok(X1), ok(X2)) → FILTER(X1, X2)
DIVIDES(ok(X1), ok(X2)) → DIVIDES(X1, X2)
TOP(mark(X)) → TOP(proper(X))
TOP(mark(X)) → PROPER(X)
TOP(ok(X)) → TOP(active(X))
TOP(ok(X)) → ACTIVE(X)

The TRS R consists of the following rules:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
active(sieve(X)) → sieve(active(X))
active(from(X)) → from(active(X))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(head(X)) → head(active(X))
active(tail(X)) → tail(active(X))
active(if(X1, X2, X3)) → if(active(X1), X2, X3)
active(filter(X1, X2)) → filter(active(X1), X2)
active(filter(X1, X2)) → filter(X1, active(X2))
active(divides(X1, X2)) → divides(active(X1), X2)
active(divides(X1, X2)) → divides(X1, active(X2))
sieve(mark(X)) → mark(sieve(X))
from(mark(X)) → mark(from(X))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
head(mark(X)) → mark(head(X))
tail(mark(X)) → mark(tail(X))
if(mark(X1), X2, X3) → mark(if(X1, X2, X3))
filter(mark(X1), X2) → mark(filter(X1, X2))
filter(X1, mark(X2)) → mark(filter(X1, X2))
divides(mark(X1), X2) → mark(divides(X1, X2))
divides(X1, mark(X2)) → mark(divides(X1, X2))
proper(primes) → ok(primes)
proper(sieve(X)) → sieve(proper(X))
proper(from(X)) → from(proper(X))
proper(s(X)) → s(proper(X))
proper(0) → ok(0)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(head(X)) → head(proper(X))
proper(tail(X)) → tail(proper(X))
proper(if(X1, X2, X3)) → if(proper(X1), proper(X2), proper(X3))
proper(true) → ok(true)
proper(false) → ok(false)
proper(filter(X1, X2)) → filter(proper(X1), proper(X2))
proper(divides(X1, X2)) → divides(proper(X1), proper(X2))
sieve(ok(X)) → ok(sieve(X))
from(ok(X)) → ok(from(X))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
head(ok(X)) → ok(head(X))
tail(ok(X)) → ok(tail(X))
if(ok(X1), ok(X2), ok(X3)) → ok(if(X1, X2, X3))
filter(ok(X1), ok(X2)) → ok(filter(X1, X2))
divides(ok(X1), ok(X2)) → ok(divides(X1, X2))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

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 12 SCCs with 38 less nodes.

(4) Complex Obligation (AND)

(5) Obligation:

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

DIVIDES(X1, mark(X2)) → DIVIDES(X1, X2)
DIVIDES(mark(X1), X2) → DIVIDES(X1, X2)
DIVIDES(ok(X1), ok(X2)) → DIVIDES(X1, X2)

The TRS R consists of the following rules:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
active(sieve(X)) → sieve(active(X))
active(from(X)) → from(active(X))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(head(X)) → head(active(X))
active(tail(X)) → tail(active(X))
active(if(X1, X2, X3)) → if(active(X1), X2, X3)
active(filter(X1, X2)) → filter(active(X1), X2)
active(filter(X1, X2)) → filter(X1, active(X2))
active(divides(X1, X2)) → divides(active(X1), X2)
active(divides(X1, X2)) → divides(X1, active(X2))
sieve(mark(X)) → mark(sieve(X))
from(mark(X)) → mark(from(X))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
head(mark(X)) → mark(head(X))
tail(mark(X)) → mark(tail(X))
if(mark(X1), X2, X3) → mark(if(X1, X2, X3))
filter(mark(X1), X2) → mark(filter(X1, X2))
filter(X1, mark(X2)) → mark(filter(X1, X2))
divides(mark(X1), X2) → mark(divides(X1, X2))
divides(X1, mark(X2)) → mark(divides(X1, X2))
proper(primes) → ok(primes)
proper(sieve(X)) → sieve(proper(X))
proper(from(X)) → from(proper(X))
proper(s(X)) → s(proper(X))
proper(0) → ok(0)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(head(X)) → head(proper(X))
proper(tail(X)) → tail(proper(X))
proper(if(X1, X2, X3)) → if(proper(X1), proper(X2), proper(X3))
proper(true) → ok(true)
proper(false) → ok(false)
proper(filter(X1, X2)) → filter(proper(X1), proper(X2))
proper(divides(X1, X2)) → divides(proper(X1), proper(X2))
sieve(ok(X)) → ok(sieve(X))
from(ok(X)) → ok(from(X))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
head(ok(X)) → ok(head(X))
tail(ok(X)) → ok(tail(X))
if(ok(X1), ok(X2), ok(X3)) → ok(if(X1, X2, X3))
filter(ok(X1), ok(X2)) → ok(filter(X1, X2))
divides(ok(X1), ok(X2)) → ok(divides(X1, X2))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

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

(6) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


DIVIDES(ok(X1), ok(X2)) → DIVIDES(X1, X2)
The remaining pairs can at least be oriented weakly.
Used ordering: Combined order from the following AFS and order.
DIVIDES(x1, x2)  =  x1
mark(x1)  =  x1
ok(x1)  =  ok(x1)
active(x1)  =  active(x1)
primes  =  primes
sieve(x1)  =  x1
from(x1)  =  x1
s(x1)  =  s(x1)
0  =  0
cons(x1, x2)  =  cons(x1, x2)
head(x1)  =  x1
tail(x1)  =  tail(x1)
if(x1, x2, x3)  =  if(x1, x2, x3)
true  =  true
false  =  false
filter(x1, x2)  =  filter(x1, x2)
divides(x1, x2)  =  divides(x2)
proper(x1)  =  proper(x1)
top(x1)  =  top

Recursive Path Order [RPO].
Precedence:
proper1 > primes > s1 > filter2 > cons2 > ok1
proper1 > primes > s1 > filter2 > divides1 > ok1
proper1 > primes > 0 > ok1
proper1 > tail1 > ok1
proper1 > if3 > ok1
proper1 > true > ok1
proper1 > false > ok1
top > active1 > s1 > filter2 > cons2 > ok1
top > active1 > s1 > filter2 > divides1 > ok1
top > active1 > tail1 > ok1
top > active1 > if3 > ok1

The following usable rules [FROCOS05] were oriented:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
active(sieve(X)) → sieve(active(X))
active(from(X)) → from(active(X))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(head(X)) → head(active(X))
active(tail(X)) → tail(active(X))
active(if(X1, X2, X3)) → if(active(X1), X2, X3)
active(filter(X1, X2)) → filter(active(X1), X2)
active(filter(X1, X2)) → filter(X1, active(X2))
active(divides(X1, X2)) → divides(active(X1), X2)
active(divides(X1, X2)) → divides(X1, active(X2))
sieve(mark(X)) → mark(sieve(X))
from(mark(X)) → mark(from(X))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
head(mark(X)) → mark(head(X))
tail(mark(X)) → mark(tail(X))
if(mark(X1), X2, X3) → mark(if(X1, X2, X3))
filter(mark(X1), X2) → mark(filter(X1, X2))
filter(X1, mark(X2)) → mark(filter(X1, X2))
divides(mark(X1), X2) → mark(divides(X1, X2))
divides(X1, mark(X2)) → mark(divides(X1, X2))
proper(primes) → ok(primes)
proper(sieve(X)) → sieve(proper(X))
proper(from(X)) → from(proper(X))
proper(s(X)) → s(proper(X))
proper(0) → ok(0)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(head(X)) → head(proper(X))
proper(tail(X)) → tail(proper(X))
proper(if(X1, X2, X3)) → if(proper(X1), proper(X2), proper(X3))
proper(true) → ok(true)
proper(false) → ok(false)
proper(filter(X1, X2)) → filter(proper(X1), proper(X2))
proper(divides(X1, X2)) → divides(proper(X1), proper(X2))
sieve(ok(X)) → ok(sieve(X))
from(ok(X)) → ok(from(X))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
head(ok(X)) → ok(head(X))
tail(ok(X)) → ok(tail(X))
if(ok(X1), ok(X2), ok(X3)) → ok(if(X1, X2, X3))
filter(ok(X1), ok(X2)) → ok(filter(X1, X2))
divides(ok(X1), ok(X2)) → ok(divides(X1, X2))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

(7) Obligation:

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

DIVIDES(X1, mark(X2)) → DIVIDES(X1, X2)
DIVIDES(mark(X1), X2) → DIVIDES(X1, X2)

The TRS R consists of the following rules:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
active(sieve(X)) → sieve(active(X))
active(from(X)) → from(active(X))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(head(X)) → head(active(X))
active(tail(X)) → tail(active(X))
active(if(X1, X2, X3)) → if(active(X1), X2, X3)
active(filter(X1, X2)) → filter(active(X1), X2)
active(filter(X1, X2)) → filter(X1, active(X2))
active(divides(X1, X2)) → divides(active(X1), X2)
active(divides(X1, X2)) → divides(X1, active(X2))
sieve(mark(X)) → mark(sieve(X))
from(mark(X)) → mark(from(X))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
head(mark(X)) → mark(head(X))
tail(mark(X)) → mark(tail(X))
if(mark(X1), X2, X3) → mark(if(X1, X2, X3))
filter(mark(X1), X2) → mark(filter(X1, X2))
filter(X1, mark(X2)) → mark(filter(X1, X2))
divides(mark(X1), X2) → mark(divides(X1, X2))
divides(X1, mark(X2)) → mark(divides(X1, X2))
proper(primes) → ok(primes)
proper(sieve(X)) → sieve(proper(X))
proper(from(X)) → from(proper(X))
proper(s(X)) → s(proper(X))
proper(0) → ok(0)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(head(X)) → head(proper(X))
proper(tail(X)) → tail(proper(X))
proper(if(X1, X2, X3)) → if(proper(X1), proper(X2), proper(X3))
proper(true) → ok(true)
proper(false) → ok(false)
proper(filter(X1, X2)) → filter(proper(X1), proper(X2))
proper(divides(X1, X2)) → divides(proper(X1), proper(X2))
sieve(ok(X)) → ok(sieve(X))
from(ok(X)) → ok(from(X))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
head(ok(X)) → ok(head(X))
tail(ok(X)) → ok(tail(X))
if(ok(X1), ok(X2), ok(X3)) → ok(if(X1, X2, X3))
filter(ok(X1), ok(X2)) → ok(filter(X1, X2))
divides(ok(X1), ok(X2)) → ok(divides(X1, X2))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

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

(8) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


DIVIDES(X1, mark(X2)) → DIVIDES(X1, X2)
The remaining pairs can at least be oriented weakly.
Used ordering: Combined order from the following AFS and order.
DIVIDES(x1, x2)  =  x2
mark(x1)  =  mark(x1)
active(x1)  =  active(x1)
primes  =  primes
sieve(x1)  =  x1
from(x1)  =  from(x1)
s(x1)  =  s(x1)
0  =  0
cons(x1, x2)  =  cons(x1, x2)
head(x1)  =  head(x1)
tail(x1)  =  x1
if(x1, x2, x3)  =  if(x1, x2, x3)
true  =  true
false  =  false
filter(x1, x2)  =  filter(x1, x2)
divides(x1, x2)  =  divides(x1, x2)
proper(x1)  =  proper(x1)
ok(x1)  =  x1
top(x1)  =  top

Recursive Path Order [RPO].
Precedence:
active1 > from1 > s1 > mark1
active1 > 0 > mark1
active1 > cons2 > filter2 > s1 > mark1
active1 > cons2 > filter2 > if3 > mark1
active1 > head1 > mark1
active1 > divides2 > mark1
true > mark1
proper1 > primes > s1 > mark1
proper1 > from1 > s1 > mark1
proper1 > 0 > mark1
proper1 > cons2 > filter2 > s1 > mark1
proper1 > cons2 > filter2 > if3 > mark1
proper1 > head1 > mark1
proper1 > false > mark1
proper1 > divides2 > mark1
top > mark1

The following usable rules [FROCOS05] were oriented:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
active(sieve(X)) → sieve(active(X))
active(from(X)) → from(active(X))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(head(X)) → head(active(X))
active(tail(X)) → tail(active(X))
active(if(X1, X2, X3)) → if(active(X1), X2, X3)
active(filter(X1, X2)) → filter(active(X1), X2)
active(filter(X1, X2)) → filter(X1, active(X2))
active(divides(X1, X2)) → divides(active(X1), X2)
active(divides(X1, X2)) → divides(X1, active(X2))
sieve(mark(X)) → mark(sieve(X))
from(mark(X)) → mark(from(X))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
head(mark(X)) → mark(head(X))
tail(mark(X)) → mark(tail(X))
if(mark(X1), X2, X3) → mark(if(X1, X2, X3))
filter(mark(X1), X2) → mark(filter(X1, X2))
filter(X1, mark(X2)) → mark(filter(X1, X2))
divides(mark(X1), X2) → mark(divides(X1, X2))
divides(X1, mark(X2)) → mark(divides(X1, X2))
proper(primes) → ok(primes)
proper(sieve(X)) → sieve(proper(X))
proper(from(X)) → from(proper(X))
proper(s(X)) → s(proper(X))
proper(0) → ok(0)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(head(X)) → head(proper(X))
proper(tail(X)) → tail(proper(X))
proper(if(X1, X2, X3)) → if(proper(X1), proper(X2), proper(X3))
proper(true) → ok(true)
proper(false) → ok(false)
proper(filter(X1, X2)) → filter(proper(X1), proper(X2))
proper(divides(X1, X2)) → divides(proper(X1), proper(X2))
sieve(ok(X)) → ok(sieve(X))
from(ok(X)) → ok(from(X))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
head(ok(X)) → ok(head(X))
tail(ok(X)) → ok(tail(X))
if(ok(X1), ok(X2), ok(X3)) → ok(if(X1, X2, X3))
filter(ok(X1), ok(X2)) → ok(filter(X1, X2))
divides(ok(X1), ok(X2)) → ok(divides(X1, X2))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

(9) Obligation:

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

DIVIDES(mark(X1), X2) → DIVIDES(X1, X2)

The TRS R consists of the following rules:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
active(sieve(X)) → sieve(active(X))
active(from(X)) → from(active(X))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(head(X)) → head(active(X))
active(tail(X)) → tail(active(X))
active(if(X1, X2, X3)) → if(active(X1), X2, X3)
active(filter(X1, X2)) → filter(active(X1), X2)
active(filter(X1, X2)) → filter(X1, active(X2))
active(divides(X1, X2)) → divides(active(X1), X2)
active(divides(X1, X2)) → divides(X1, active(X2))
sieve(mark(X)) → mark(sieve(X))
from(mark(X)) → mark(from(X))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
head(mark(X)) → mark(head(X))
tail(mark(X)) → mark(tail(X))
if(mark(X1), X2, X3) → mark(if(X1, X2, X3))
filter(mark(X1), X2) → mark(filter(X1, X2))
filter(X1, mark(X2)) → mark(filter(X1, X2))
divides(mark(X1), X2) → mark(divides(X1, X2))
divides(X1, mark(X2)) → mark(divides(X1, X2))
proper(primes) → ok(primes)
proper(sieve(X)) → sieve(proper(X))
proper(from(X)) → from(proper(X))
proper(s(X)) → s(proper(X))
proper(0) → ok(0)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(head(X)) → head(proper(X))
proper(tail(X)) → tail(proper(X))
proper(if(X1, X2, X3)) → if(proper(X1), proper(X2), proper(X3))
proper(true) → ok(true)
proper(false) → ok(false)
proper(filter(X1, X2)) → filter(proper(X1), proper(X2))
proper(divides(X1, X2)) → divides(proper(X1), proper(X2))
sieve(ok(X)) → ok(sieve(X))
from(ok(X)) → ok(from(X))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
head(ok(X)) → ok(head(X))
tail(ok(X)) → ok(tail(X))
if(ok(X1), ok(X2), ok(X3)) → ok(if(X1, X2, X3))
filter(ok(X1), ok(X2)) → ok(filter(X1, X2))
divides(ok(X1), ok(X2)) → ok(divides(X1, X2))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

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

(10) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


DIVIDES(mark(X1), X2) → DIVIDES(X1, X2)
The remaining pairs can at least be oriented weakly.
Used ordering: Combined order from the following AFS and order.
DIVIDES(x1, x2)  =  DIVIDES(x1)
mark(x1)  =  mark(x1)
active(x1)  =  active(x1)
primes  =  primes
sieve(x1)  =  sieve(x1)
from(x1)  =  from(x1)
s(x1)  =  s(x1)
0  =  0
cons(x1, x2)  =  cons(x1, x2)
head(x1)  =  head(x1)
tail(x1)  =  tail(x1)
if(x1, x2, x3)  =  if(x1, x2, x3)
true  =  true
false  =  false
filter(x1, x2)  =  filter(x1, x2)
divides(x1, x2)  =  divides(x1, x2)
proper(x1)  =  proper(x1)
ok(x1)  =  x1
top(x1)  =  top

Recursive Path Order [RPO].
Precedence:
DIVIDES1 > top
active1 > from1 > mark1 > top
active1 > 0 > top
active1 > head1 > mark1 > top
active1 > tail1 > mark1 > top
active1 > filter2 > sieve1 > cons2 > mark1 > top
active1 > filter2 > s1 > cons2 > mark1 > top
active1 > filter2 > s1 > if3 > mark1 > top
active1 > filter2 > divides2 > mark1 > top
proper1 > primes > from1 > mark1 > top
proper1 > 0 > top
proper1 > head1 > mark1 > top
proper1 > tail1 > mark1 > top
proper1 > true > mark1 > top
proper1 > false > top
proper1 > filter2 > sieve1 > cons2 > mark1 > top
proper1 > filter2 > s1 > cons2 > mark1 > top
proper1 > filter2 > s1 > if3 > mark1 > top
proper1 > filter2 > divides2 > mark1 > top

The following usable rules [FROCOS05] were oriented:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
active(sieve(X)) → sieve(active(X))
active(from(X)) → from(active(X))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(head(X)) → head(active(X))
active(tail(X)) → tail(active(X))
active(if(X1, X2, X3)) → if(active(X1), X2, X3)
active(filter(X1, X2)) → filter(active(X1), X2)
active(filter(X1, X2)) → filter(X1, active(X2))
active(divides(X1, X2)) → divides(active(X1), X2)
active(divides(X1, X2)) → divides(X1, active(X2))
sieve(mark(X)) → mark(sieve(X))
from(mark(X)) → mark(from(X))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
head(mark(X)) → mark(head(X))
tail(mark(X)) → mark(tail(X))
if(mark(X1), X2, X3) → mark(if(X1, X2, X3))
filter(mark(X1), X2) → mark(filter(X1, X2))
filter(X1, mark(X2)) → mark(filter(X1, X2))
divides(mark(X1), X2) → mark(divides(X1, X2))
divides(X1, mark(X2)) → mark(divides(X1, X2))
proper(primes) → ok(primes)
proper(sieve(X)) → sieve(proper(X))
proper(from(X)) → from(proper(X))
proper(s(X)) → s(proper(X))
proper(0) → ok(0)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(head(X)) → head(proper(X))
proper(tail(X)) → tail(proper(X))
proper(if(X1, X2, X3)) → if(proper(X1), proper(X2), proper(X3))
proper(true) → ok(true)
proper(false) → ok(false)
proper(filter(X1, X2)) → filter(proper(X1), proper(X2))
proper(divides(X1, X2)) → divides(proper(X1), proper(X2))
sieve(ok(X)) → ok(sieve(X))
from(ok(X)) → ok(from(X))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
head(ok(X)) → ok(head(X))
tail(ok(X)) → ok(tail(X))
if(ok(X1), ok(X2), ok(X3)) → ok(if(X1, X2, X3))
filter(ok(X1), ok(X2)) → ok(filter(X1, X2))
divides(ok(X1), ok(X2)) → ok(divides(X1, X2))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

(11) Obligation:

Q DP problem:
P is empty.
The TRS R consists of the following rules:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
active(sieve(X)) → sieve(active(X))
active(from(X)) → from(active(X))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(head(X)) → head(active(X))
active(tail(X)) → tail(active(X))
active(if(X1, X2, X3)) → if(active(X1), X2, X3)
active(filter(X1, X2)) → filter(active(X1), X2)
active(filter(X1, X2)) → filter(X1, active(X2))
active(divides(X1, X2)) → divides(active(X1), X2)
active(divides(X1, X2)) → divides(X1, active(X2))
sieve(mark(X)) → mark(sieve(X))
from(mark(X)) → mark(from(X))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
head(mark(X)) → mark(head(X))
tail(mark(X)) → mark(tail(X))
if(mark(X1), X2, X3) → mark(if(X1, X2, X3))
filter(mark(X1), X2) → mark(filter(X1, X2))
filter(X1, mark(X2)) → mark(filter(X1, X2))
divides(mark(X1), X2) → mark(divides(X1, X2))
divides(X1, mark(X2)) → mark(divides(X1, X2))
proper(primes) → ok(primes)
proper(sieve(X)) → sieve(proper(X))
proper(from(X)) → from(proper(X))
proper(s(X)) → s(proper(X))
proper(0) → ok(0)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(head(X)) → head(proper(X))
proper(tail(X)) → tail(proper(X))
proper(if(X1, X2, X3)) → if(proper(X1), proper(X2), proper(X3))
proper(true) → ok(true)
proper(false) → ok(false)
proper(filter(X1, X2)) → filter(proper(X1), proper(X2))
proper(divides(X1, X2)) → divides(proper(X1), proper(X2))
sieve(ok(X)) → ok(sieve(X))
from(ok(X)) → ok(from(X))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
head(ok(X)) → ok(head(X))
tail(ok(X)) → ok(tail(X))
if(ok(X1), ok(X2), ok(X3)) → ok(if(X1, X2, X3))
filter(ok(X1), ok(X2)) → ok(filter(X1, X2))
divides(ok(X1), ok(X2)) → ok(divides(X1, X2))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

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

(12) PisEmptyProof (EQUIVALENT transformation)

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

(13) TRUE

(14) Obligation:

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

FILTER(X1, mark(X2)) → FILTER(X1, X2)
FILTER(mark(X1), X2) → FILTER(X1, X2)
FILTER(ok(X1), ok(X2)) → FILTER(X1, X2)

The TRS R consists of the following rules:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
active(sieve(X)) → sieve(active(X))
active(from(X)) → from(active(X))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(head(X)) → head(active(X))
active(tail(X)) → tail(active(X))
active(if(X1, X2, X3)) → if(active(X1), X2, X3)
active(filter(X1, X2)) → filter(active(X1), X2)
active(filter(X1, X2)) → filter(X1, active(X2))
active(divides(X1, X2)) → divides(active(X1), X2)
active(divides(X1, X2)) → divides(X1, active(X2))
sieve(mark(X)) → mark(sieve(X))
from(mark(X)) → mark(from(X))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
head(mark(X)) → mark(head(X))
tail(mark(X)) → mark(tail(X))
if(mark(X1), X2, X3) → mark(if(X1, X2, X3))
filter(mark(X1), X2) → mark(filter(X1, X2))
filter(X1, mark(X2)) → mark(filter(X1, X2))
divides(mark(X1), X2) → mark(divides(X1, X2))
divides(X1, mark(X2)) → mark(divides(X1, X2))
proper(primes) → ok(primes)
proper(sieve(X)) → sieve(proper(X))
proper(from(X)) → from(proper(X))
proper(s(X)) → s(proper(X))
proper(0) → ok(0)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(head(X)) → head(proper(X))
proper(tail(X)) → tail(proper(X))
proper(if(X1, X2, X3)) → if(proper(X1), proper(X2), proper(X3))
proper(true) → ok(true)
proper(false) → ok(false)
proper(filter(X1, X2)) → filter(proper(X1), proper(X2))
proper(divides(X1, X2)) → divides(proper(X1), proper(X2))
sieve(ok(X)) → ok(sieve(X))
from(ok(X)) → ok(from(X))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
head(ok(X)) → ok(head(X))
tail(ok(X)) → ok(tail(X))
if(ok(X1), ok(X2), ok(X3)) → ok(if(X1, X2, X3))
filter(ok(X1), ok(X2)) → ok(filter(X1, X2))
divides(ok(X1), ok(X2)) → ok(divides(X1, X2))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

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

(15) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


FILTER(ok(X1), ok(X2)) → FILTER(X1, X2)
The remaining pairs can at least be oriented weakly.
Used ordering: Combined order from the following AFS and order.
FILTER(x1, x2)  =  x1
mark(x1)  =  x1
ok(x1)  =  ok(x1)
active(x1)  =  active(x1)
primes  =  primes
sieve(x1)  =  x1
from(x1)  =  x1
s(x1)  =  s(x1)
0  =  0
cons(x1, x2)  =  cons(x1, x2)
head(x1)  =  x1
tail(x1)  =  tail(x1)
if(x1, x2, x3)  =  if(x1, x2, x3)
true  =  true
false  =  false
filter(x1, x2)  =  filter(x1, x2)
divides(x1, x2)  =  divides(x2)
proper(x1)  =  proper(x1)
top(x1)  =  top

Recursive Path Order [RPO].
Precedence:
proper1 > primes > s1 > filter2 > cons2 > ok1
proper1 > primes > s1 > filter2 > divides1 > ok1
proper1 > primes > 0 > ok1
proper1 > tail1 > ok1
proper1 > if3 > ok1
proper1 > true > ok1
proper1 > false > ok1
top > active1 > s1 > filter2 > cons2 > ok1
top > active1 > s1 > filter2 > divides1 > ok1
top > active1 > tail1 > ok1
top > active1 > if3 > ok1

The following usable rules [FROCOS05] were oriented:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
active(sieve(X)) → sieve(active(X))
active(from(X)) → from(active(X))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(head(X)) → head(active(X))
active(tail(X)) → tail(active(X))
active(if(X1, X2, X3)) → if(active(X1), X2, X3)
active(filter(X1, X2)) → filter(active(X1), X2)
active(filter(X1, X2)) → filter(X1, active(X2))
active(divides(X1, X2)) → divides(active(X1), X2)
active(divides(X1, X2)) → divides(X1, active(X2))
sieve(mark(X)) → mark(sieve(X))
from(mark(X)) → mark(from(X))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
head(mark(X)) → mark(head(X))
tail(mark(X)) → mark(tail(X))
if(mark(X1), X2, X3) → mark(if(X1, X2, X3))
filter(mark(X1), X2) → mark(filter(X1, X2))
filter(X1, mark(X2)) → mark(filter(X1, X2))
divides(mark(X1), X2) → mark(divides(X1, X2))
divides(X1, mark(X2)) → mark(divides(X1, X2))
proper(primes) → ok(primes)
proper(sieve(X)) → sieve(proper(X))
proper(from(X)) → from(proper(X))
proper(s(X)) → s(proper(X))
proper(0) → ok(0)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(head(X)) → head(proper(X))
proper(tail(X)) → tail(proper(X))
proper(if(X1, X2, X3)) → if(proper(X1), proper(X2), proper(X3))
proper(true) → ok(true)
proper(false) → ok(false)
proper(filter(X1, X2)) → filter(proper(X1), proper(X2))
proper(divides(X1, X2)) → divides(proper(X1), proper(X2))
sieve(ok(X)) → ok(sieve(X))
from(ok(X)) → ok(from(X))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
head(ok(X)) → ok(head(X))
tail(ok(X)) → ok(tail(X))
if(ok(X1), ok(X2), ok(X3)) → ok(if(X1, X2, X3))
filter(ok(X1), ok(X2)) → ok(filter(X1, X2))
divides(ok(X1), ok(X2)) → ok(divides(X1, X2))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

(16) Obligation:

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

FILTER(X1, mark(X2)) → FILTER(X1, X2)
FILTER(mark(X1), X2) → FILTER(X1, X2)

The TRS R consists of the following rules:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
active(sieve(X)) → sieve(active(X))
active(from(X)) → from(active(X))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(head(X)) → head(active(X))
active(tail(X)) → tail(active(X))
active(if(X1, X2, X3)) → if(active(X1), X2, X3)
active(filter(X1, X2)) → filter(active(X1), X2)
active(filter(X1, X2)) → filter(X1, active(X2))
active(divides(X1, X2)) → divides(active(X1), X2)
active(divides(X1, X2)) → divides(X1, active(X2))
sieve(mark(X)) → mark(sieve(X))
from(mark(X)) → mark(from(X))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
head(mark(X)) → mark(head(X))
tail(mark(X)) → mark(tail(X))
if(mark(X1), X2, X3) → mark(if(X1, X2, X3))
filter(mark(X1), X2) → mark(filter(X1, X2))
filter(X1, mark(X2)) → mark(filter(X1, X2))
divides(mark(X1), X2) → mark(divides(X1, X2))
divides(X1, mark(X2)) → mark(divides(X1, X2))
proper(primes) → ok(primes)
proper(sieve(X)) → sieve(proper(X))
proper(from(X)) → from(proper(X))
proper(s(X)) → s(proper(X))
proper(0) → ok(0)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(head(X)) → head(proper(X))
proper(tail(X)) → tail(proper(X))
proper(if(X1, X2, X3)) → if(proper(X1), proper(X2), proper(X3))
proper(true) → ok(true)
proper(false) → ok(false)
proper(filter(X1, X2)) → filter(proper(X1), proper(X2))
proper(divides(X1, X2)) → divides(proper(X1), proper(X2))
sieve(ok(X)) → ok(sieve(X))
from(ok(X)) → ok(from(X))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
head(ok(X)) → ok(head(X))
tail(ok(X)) → ok(tail(X))
if(ok(X1), ok(X2), ok(X3)) → ok(if(X1, X2, X3))
filter(ok(X1), ok(X2)) → ok(filter(X1, X2))
divides(ok(X1), ok(X2)) → ok(divides(X1, X2))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

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

(17) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


FILTER(X1, mark(X2)) → FILTER(X1, X2)
The remaining pairs can at least be oriented weakly.
Used ordering: Combined order from the following AFS and order.
FILTER(x1, x2)  =  x2
mark(x1)  =  mark(x1)
active(x1)  =  active(x1)
primes  =  primes
sieve(x1)  =  x1
from(x1)  =  from(x1)
s(x1)  =  s(x1)
0  =  0
cons(x1, x2)  =  cons(x1, x2)
head(x1)  =  head(x1)
tail(x1)  =  x1
if(x1, x2, x3)  =  if(x1, x2, x3)
true  =  true
false  =  false
filter(x1, x2)  =  filter(x1, x2)
divides(x1, x2)  =  divides(x1, x2)
proper(x1)  =  proper(x1)
ok(x1)  =  x1
top(x1)  =  top

Recursive Path Order [RPO].
Precedence:
active1 > from1 > s1 > mark1
active1 > 0 > mark1
active1 > cons2 > filter2 > s1 > mark1
active1 > cons2 > filter2 > if3 > mark1
active1 > head1 > mark1
active1 > divides2 > mark1
true > mark1
proper1 > primes > s1 > mark1
proper1 > from1 > s1 > mark1
proper1 > 0 > mark1
proper1 > cons2 > filter2 > s1 > mark1
proper1 > cons2 > filter2 > if3 > mark1
proper1 > head1 > mark1
proper1 > false > mark1
proper1 > divides2 > mark1
top > mark1

The following usable rules [FROCOS05] were oriented:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
active(sieve(X)) → sieve(active(X))
active(from(X)) → from(active(X))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(head(X)) → head(active(X))
active(tail(X)) → tail(active(X))
active(if(X1, X2, X3)) → if(active(X1), X2, X3)
active(filter(X1, X2)) → filter(active(X1), X2)
active(filter(X1, X2)) → filter(X1, active(X2))
active(divides(X1, X2)) → divides(active(X1), X2)
active(divides(X1, X2)) → divides(X1, active(X2))
sieve(mark(X)) → mark(sieve(X))
from(mark(X)) → mark(from(X))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
head(mark(X)) → mark(head(X))
tail(mark(X)) → mark(tail(X))
if(mark(X1), X2, X3) → mark(if(X1, X2, X3))
filter(mark(X1), X2) → mark(filter(X1, X2))
filter(X1, mark(X2)) → mark(filter(X1, X2))
divides(mark(X1), X2) → mark(divides(X1, X2))
divides(X1, mark(X2)) → mark(divides(X1, X2))
proper(primes) → ok(primes)
proper(sieve(X)) → sieve(proper(X))
proper(from(X)) → from(proper(X))
proper(s(X)) → s(proper(X))
proper(0) → ok(0)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(head(X)) → head(proper(X))
proper(tail(X)) → tail(proper(X))
proper(if(X1, X2, X3)) → if(proper(X1), proper(X2), proper(X3))
proper(true) → ok(true)
proper(false) → ok(false)
proper(filter(X1, X2)) → filter(proper(X1), proper(X2))
proper(divides(X1, X2)) → divides(proper(X1), proper(X2))
sieve(ok(X)) → ok(sieve(X))
from(ok(X)) → ok(from(X))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
head(ok(X)) → ok(head(X))
tail(ok(X)) → ok(tail(X))
if(ok(X1), ok(X2), ok(X3)) → ok(if(X1, X2, X3))
filter(ok(X1), ok(X2)) → ok(filter(X1, X2))
divides(ok(X1), ok(X2)) → ok(divides(X1, X2))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

(18) Obligation:

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

FILTER(mark(X1), X2) → FILTER(X1, X2)

The TRS R consists of the following rules:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
active(sieve(X)) → sieve(active(X))
active(from(X)) → from(active(X))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(head(X)) → head(active(X))
active(tail(X)) → tail(active(X))
active(if(X1, X2, X3)) → if(active(X1), X2, X3)
active(filter(X1, X2)) → filter(active(X1), X2)
active(filter(X1, X2)) → filter(X1, active(X2))
active(divides(X1, X2)) → divides(active(X1), X2)
active(divides(X1, X2)) → divides(X1, active(X2))
sieve(mark(X)) → mark(sieve(X))
from(mark(X)) → mark(from(X))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
head(mark(X)) → mark(head(X))
tail(mark(X)) → mark(tail(X))
if(mark(X1), X2, X3) → mark(if(X1, X2, X3))
filter(mark(X1), X2) → mark(filter(X1, X2))
filter(X1, mark(X2)) → mark(filter(X1, X2))
divides(mark(X1), X2) → mark(divides(X1, X2))
divides(X1, mark(X2)) → mark(divides(X1, X2))
proper(primes) → ok(primes)
proper(sieve(X)) → sieve(proper(X))
proper(from(X)) → from(proper(X))
proper(s(X)) → s(proper(X))
proper(0) → ok(0)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(head(X)) → head(proper(X))
proper(tail(X)) → tail(proper(X))
proper(if(X1, X2, X3)) → if(proper(X1), proper(X2), proper(X3))
proper(true) → ok(true)
proper(false) → ok(false)
proper(filter(X1, X2)) → filter(proper(X1), proper(X2))
proper(divides(X1, X2)) → divides(proper(X1), proper(X2))
sieve(ok(X)) → ok(sieve(X))
from(ok(X)) → ok(from(X))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
head(ok(X)) → ok(head(X))
tail(ok(X)) → ok(tail(X))
if(ok(X1), ok(X2), ok(X3)) → ok(if(X1, X2, X3))
filter(ok(X1), ok(X2)) → ok(filter(X1, X2))
divides(ok(X1), ok(X2)) → ok(divides(X1, X2))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

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

(19) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


FILTER(mark(X1), X2) → FILTER(X1, X2)
The remaining pairs can at least be oriented weakly.
Used ordering: Combined order from the following AFS and order.
FILTER(x1, x2)  =  FILTER(x1)
mark(x1)  =  mark(x1)
active(x1)  =  active(x1)
primes  =  primes
sieve(x1)  =  sieve(x1)
from(x1)  =  from(x1)
s(x1)  =  s(x1)
0  =  0
cons(x1, x2)  =  cons(x1, x2)
head(x1)  =  head(x1)
tail(x1)  =  tail(x1)
if(x1, x2, x3)  =  if(x1, x2, x3)
true  =  true
false  =  false
filter(x1, x2)  =  filter(x1, x2)
divides(x1, x2)  =  divides(x1, x2)
proper(x1)  =  proper(x1)
ok(x1)  =  x1
top(x1)  =  top

Recursive Path Order [RPO].
Precedence:
FILTER1 > top
active1 > from1 > mark1 > top
active1 > 0 > top
active1 > head1 > mark1 > top
active1 > tail1 > mark1 > top
active1 > filter2 > sieve1 > cons2 > mark1 > top
active1 > filter2 > s1 > cons2 > mark1 > top
active1 > filter2 > s1 > if3 > mark1 > top
active1 > filter2 > divides2 > mark1 > top
proper1 > primes > from1 > mark1 > top
proper1 > 0 > top
proper1 > head1 > mark1 > top
proper1 > tail1 > mark1 > top
proper1 > true > mark1 > top
proper1 > false > top
proper1 > filter2 > sieve1 > cons2 > mark1 > top
proper1 > filter2 > s1 > cons2 > mark1 > top
proper1 > filter2 > s1 > if3 > mark1 > top
proper1 > filter2 > divides2 > mark1 > top

The following usable rules [FROCOS05] were oriented:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
active(sieve(X)) → sieve(active(X))
active(from(X)) → from(active(X))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(head(X)) → head(active(X))
active(tail(X)) → tail(active(X))
active(if(X1, X2, X3)) → if(active(X1), X2, X3)
active(filter(X1, X2)) → filter(active(X1), X2)
active(filter(X1, X2)) → filter(X1, active(X2))
active(divides(X1, X2)) → divides(active(X1), X2)
active(divides(X1, X2)) → divides(X1, active(X2))
sieve(mark(X)) → mark(sieve(X))
from(mark(X)) → mark(from(X))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
head(mark(X)) → mark(head(X))
tail(mark(X)) → mark(tail(X))
if(mark(X1), X2, X3) → mark(if(X1, X2, X3))
filter(mark(X1), X2) → mark(filter(X1, X2))
filter(X1, mark(X2)) → mark(filter(X1, X2))
divides(mark(X1), X2) → mark(divides(X1, X2))
divides(X1, mark(X2)) → mark(divides(X1, X2))
proper(primes) → ok(primes)
proper(sieve(X)) → sieve(proper(X))
proper(from(X)) → from(proper(X))
proper(s(X)) → s(proper(X))
proper(0) → ok(0)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(head(X)) → head(proper(X))
proper(tail(X)) → tail(proper(X))
proper(if(X1, X2, X3)) → if(proper(X1), proper(X2), proper(X3))
proper(true) → ok(true)
proper(false) → ok(false)
proper(filter(X1, X2)) → filter(proper(X1), proper(X2))
proper(divides(X1, X2)) → divides(proper(X1), proper(X2))
sieve(ok(X)) → ok(sieve(X))
from(ok(X)) → ok(from(X))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
head(ok(X)) → ok(head(X))
tail(ok(X)) → ok(tail(X))
if(ok(X1), ok(X2), ok(X3)) → ok(if(X1, X2, X3))
filter(ok(X1), ok(X2)) → ok(filter(X1, X2))
divides(ok(X1), ok(X2)) → ok(divides(X1, X2))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

(20) Obligation:

Q DP problem:
P is empty.
The TRS R consists of the following rules:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
active(sieve(X)) → sieve(active(X))
active(from(X)) → from(active(X))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(head(X)) → head(active(X))
active(tail(X)) → tail(active(X))
active(if(X1, X2, X3)) → if(active(X1), X2, X3)
active(filter(X1, X2)) → filter(active(X1), X2)
active(filter(X1, X2)) → filter(X1, active(X2))
active(divides(X1, X2)) → divides(active(X1), X2)
active(divides(X1, X2)) → divides(X1, active(X2))
sieve(mark(X)) → mark(sieve(X))
from(mark(X)) → mark(from(X))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
head(mark(X)) → mark(head(X))
tail(mark(X)) → mark(tail(X))
if(mark(X1), X2, X3) → mark(if(X1, X2, X3))
filter(mark(X1), X2) → mark(filter(X1, X2))
filter(X1, mark(X2)) → mark(filter(X1, X2))
divides(mark(X1), X2) → mark(divides(X1, X2))
divides(X1, mark(X2)) → mark(divides(X1, X2))
proper(primes) → ok(primes)
proper(sieve(X)) → sieve(proper(X))
proper(from(X)) → from(proper(X))
proper(s(X)) → s(proper(X))
proper(0) → ok(0)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(head(X)) → head(proper(X))
proper(tail(X)) → tail(proper(X))
proper(if(X1, X2, X3)) → if(proper(X1), proper(X2), proper(X3))
proper(true) → ok(true)
proper(false) → ok(false)
proper(filter(X1, X2)) → filter(proper(X1), proper(X2))
proper(divides(X1, X2)) → divides(proper(X1), proper(X2))
sieve(ok(X)) → ok(sieve(X))
from(ok(X)) → ok(from(X))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
head(ok(X)) → ok(head(X))
tail(ok(X)) → ok(tail(X))
if(ok(X1), ok(X2), ok(X3)) → ok(if(X1, X2, X3))
filter(ok(X1), ok(X2)) → ok(filter(X1, X2))
divides(ok(X1), ok(X2)) → ok(divides(X1, X2))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

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

(21) PisEmptyProof (EQUIVALENT transformation)

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

(22) TRUE

(23) Obligation:

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

IF(ok(X1), ok(X2), ok(X3)) → IF(X1, X2, X3)
IF(mark(X1), X2, X3) → IF(X1, X2, X3)

The TRS R consists of the following rules:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
active(sieve(X)) → sieve(active(X))
active(from(X)) → from(active(X))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(head(X)) → head(active(X))
active(tail(X)) → tail(active(X))
active(if(X1, X2, X3)) → if(active(X1), X2, X3)
active(filter(X1, X2)) → filter(active(X1), X2)
active(filter(X1, X2)) → filter(X1, active(X2))
active(divides(X1, X2)) → divides(active(X1), X2)
active(divides(X1, X2)) → divides(X1, active(X2))
sieve(mark(X)) → mark(sieve(X))
from(mark(X)) → mark(from(X))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
head(mark(X)) → mark(head(X))
tail(mark(X)) → mark(tail(X))
if(mark(X1), X2, X3) → mark(if(X1, X2, X3))
filter(mark(X1), X2) → mark(filter(X1, X2))
filter(X1, mark(X2)) → mark(filter(X1, X2))
divides(mark(X1), X2) → mark(divides(X1, X2))
divides(X1, mark(X2)) → mark(divides(X1, X2))
proper(primes) → ok(primes)
proper(sieve(X)) → sieve(proper(X))
proper(from(X)) → from(proper(X))
proper(s(X)) → s(proper(X))
proper(0) → ok(0)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(head(X)) → head(proper(X))
proper(tail(X)) → tail(proper(X))
proper(if(X1, X2, X3)) → if(proper(X1), proper(X2), proper(X3))
proper(true) → ok(true)
proper(false) → ok(false)
proper(filter(X1, X2)) → filter(proper(X1), proper(X2))
proper(divides(X1, X2)) → divides(proper(X1), proper(X2))
sieve(ok(X)) → ok(sieve(X))
from(ok(X)) → ok(from(X))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
head(ok(X)) → ok(head(X))
tail(ok(X)) → ok(tail(X))
if(ok(X1), ok(X2), ok(X3)) → ok(if(X1, X2, X3))
filter(ok(X1), ok(X2)) → ok(filter(X1, X2))
divides(ok(X1), ok(X2)) → ok(divides(X1, X2))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

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

(24) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


IF(ok(X1), ok(X2), ok(X3)) → IF(X1, X2, X3)
The remaining pairs can at least be oriented weakly.
Used ordering: Combined order from the following AFS and order.
IF(x1, x2, x3)  =  IF(x2)
ok(x1)  =  ok(x1)
mark(x1)  =  mark
active(x1)  =  x1
primes  =  primes
sieve(x1)  =  x1
from(x1)  =  from(x1)
s(x1)  =  s(x1)
0  =  0
cons(x1, x2)  =  cons(x1, x2)
head(x1)  =  x1
tail(x1)  =  tail(x1)
if(x1, x2, x3)  =  x3
true  =  true
false  =  false
filter(x1, x2)  =  x2
divides(x1, x2)  =  x2
proper(x1)  =  proper(x1)
top(x1)  =  top

Recursive Path Order [RPO].
Precedence:
IF1 > mark
true > ok1 > mark
proper1 > primes > ok1 > mark
proper1 > from1 > s1 > ok1 > mark
proper1 > 0 > ok1 > mark
proper1 > cons2 > s1 > ok1 > mark
proper1 > tail1 > ok1 > mark
proper1 > false > ok1 > mark
top > mark

The following usable rules [FROCOS05] were oriented:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
active(sieve(X)) → sieve(active(X))
active(from(X)) → from(active(X))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(head(X)) → head(active(X))
active(tail(X)) → tail(active(X))
active(if(X1, X2, X3)) → if(active(X1), X2, X3)
active(filter(X1, X2)) → filter(active(X1), X2)
active(filter(X1, X2)) → filter(X1, active(X2))
active(divides(X1, X2)) → divides(active(X1), X2)
active(divides(X1, X2)) → divides(X1, active(X2))
sieve(mark(X)) → mark(sieve(X))
from(mark(X)) → mark(from(X))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
head(mark(X)) → mark(head(X))
tail(mark(X)) → mark(tail(X))
if(mark(X1), X2, X3) → mark(if(X1, X2, X3))
filter(mark(X1), X2) → mark(filter(X1, X2))
filter(X1, mark(X2)) → mark(filter(X1, X2))
divides(mark(X1), X2) → mark(divides(X1, X2))
divides(X1, mark(X2)) → mark(divides(X1, X2))
proper(primes) → ok(primes)
proper(sieve(X)) → sieve(proper(X))
proper(from(X)) → from(proper(X))
proper(s(X)) → s(proper(X))
proper(0) → ok(0)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(head(X)) → head(proper(X))
proper(tail(X)) → tail(proper(X))
proper(if(X1, X2, X3)) → if(proper(X1), proper(X2), proper(X3))
proper(true) → ok(true)
proper(false) → ok(false)
proper(filter(X1, X2)) → filter(proper(X1), proper(X2))
proper(divides(X1, X2)) → divides(proper(X1), proper(X2))
sieve(ok(X)) → ok(sieve(X))
from(ok(X)) → ok(from(X))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
head(ok(X)) → ok(head(X))
tail(ok(X)) → ok(tail(X))
if(ok(X1), ok(X2), ok(X3)) → ok(if(X1, X2, X3))
filter(ok(X1), ok(X2)) → ok(filter(X1, X2))
divides(ok(X1), ok(X2)) → ok(divides(X1, X2))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

(25) Obligation:

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

IF(mark(X1), X2, X3) → IF(X1, X2, X3)

The TRS R consists of the following rules:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
active(sieve(X)) → sieve(active(X))
active(from(X)) → from(active(X))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(head(X)) → head(active(X))
active(tail(X)) → tail(active(X))
active(if(X1, X2, X3)) → if(active(X1), X2, X3)
active(filter(X1, X2)) → filter(active(X1), X2)
active(filter(X1, X2)) → filter(X1, active(X2))
active(divides(X1, X2)) → divides(active(X1), X2)
active(divides(X1, X2)) → divides(X1, active(X2))
sieve(mark(X)) → mark(sieve(X))
from(mark(X)) → mark(from(X))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
head(mark(X)) → mark(head(X))
tail(mark(X)) → mark(tail(X))
if(mark(X1), X2, X3) → mark(if(X1, X2, X3))
filter(mark(X1), X2) → mark(filter(X1, X2))
filter(X1, mark(X2)) → mark(filter(X1, X2))
divides(mark(X1), X2) → mark(divides(X1, X2))
divides(X1, mark(X2)) → mark(divides(X1, X2))
proper(primes) → ok(primes)
proper(sieve(X)) → sieve(proper(X))
proper(from(X)) → from(proper(X))
proper(s(X)) → s(proper(X))
proper(0) → ok(0)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(head(X)) → head(proper(X))
proper(tail(X)) → tail(proper(X))
proper(if(X1, X2, X3)) → if(proper(X1), proper(X2), proper(X3))
proper(true) → ok(true)
proper(false) → ok(false)
proper(filter(X1, X2)) → filter(proper(X1), proper(X2))
proper(divides(X1, X2)) → divides(proper(X1), proper(X2))
sieve(ok(X)) → ok(sieve(X))
from(ok(X)) → ok(from(X))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
head(ok(X)) → ok(head(X))
tail(ok(X)) → ok(tail(X))
if(ok(X1), ok(X2), ok(X3)) → ok(if(X1, X2, X3))
filter(ok(X1), ok(X2)) → ok(filter(X1, X2))
divides(ok(X1), ok(X2)) → ok(divides(X1, X2))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

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

(26) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


IF(mark(X1), X2, X3) → IF(X1, X2, X3)
The remaining pairs can at least be oriented weakly.
Used ordering: Combined order from the following AFS and order.
IF(x1, x2, x3)  =  x1
mark(x1)  =  mark(x1)
active(x1)  =  active(x1)
primes  =  primes
sieve(x1)  =  x1
from(x1)  =  from(x1)
s(x1)  =  s(x1)
0  =  0
cons(x1, x2)  =  cons(x1, x2)
head(x1)  =  x1
tail(x1)  =  tail(x1)
if(x1, x2, x3)  =  if(x1, x2, x3)
true  =  true
false  =  false
filter(x1, x2)  =  filter(x1, x2)
divides(x1, x2)  =  divides(x1, x2)
proper(x1)  =  proper(x1)
ok(x1)  =  x1
top(x1)  =  top

Recursive Path Order [RPO].
Precedence:
true > mark1
top > active1 > from1 > mark1
top > active1 > 0
top > active1 > cons2 > s1 > mark1
top > active1 > cons2 > if3 > mark1
top > active1 > cons2 > divides2 > mark1
top > active1 > tail1 > mark1
top > active1 > filter2 > s1 > mark1
top > active1 > filter2 > if3 > mark1
top > active1 > filter2 > divides2 > mark1
top > proper1 > primes
top > proper1 > from1 > mark1
top > proper1 > 0
top > proper1 > cons2 > s1 > mark1
top > proper1 > cons2 > if3 > mark1
top > proper1 > cons2 > divides2 > mark1
top > proper1 > tail1 > mark1
top > proper1 > false
top > proper1 > filter2 > s1 > mark1
top > proper1 > filter2 > if3 > mark1
top > proper1 > filter2 > divides2 > mark1

The following usable rules [FROCOS05] were oriented:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
active(sieve(X)) → sieve(active(X))
active(from(X)) → from(active(X))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(head(X)) → head(active(X))
active(tail(X)) → tail(active(X))
active(if(X1, X2, X3)) → if(active(X1), X2, X3)
active(filter(X1, X2)) → filter(active(X1), X2)
active(filter(X1, X2)) → filter(X1, active(X2))
active(divides(X1, X2)) → divides(active(X1), X2)
active(divides(X1, X2)) → divides(X1, active(X2))
sieve(mark(X)) → mark(sieve(X))
from(mark(X)) → mark(from(X))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
head(mark(X)) → mark(head(X))
tail(mark(X)) → mark(tail(X))
if(mark(X1), X2, X3) → mark(if(X1, X2, X3))
filter(mark(X1), X2) → mark(filter(X1, X2))
filter(X1, mark(X2)) → mark(filter(X1, X2))
divides(mark(X1), X2) → mark(divides(X1, X2))
divides(X1, mark(X2)) → mark(divides(X1, X2))
proper(primes) → ok(primes)
proper(sieve(X)) → sieve(proper(X))
proper(from(X)) → from(proper(X))
proper(s(X)) → s(proper(X))
proper(0) → ok(0)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(head(X)) → head(proper(X))
proper(tail(X)) → tail(proper(X))
proper(if(X1, X2, X3)) → if(proper(X1), proper(X2), proper(X3))
proper(true) → ok(true)
proper(false) → ok(false)
proper(filter(X1, X2)) → filter(proper(X1), proper(X2))
proper(divides(X1, X2)) → divides(proper(X1), proper(X2))
sieve(ok(X)) → ok(sieve(X))
from(ok(X)) → ok(from(X))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
head(ok(X)) → ok(head(X))
tail(ok(X)) → ok(tail(X))
if(ok(X1), ok(X2), ok(X3)) → ok(if(X1, X2, X3))
filter(ok(X1), ok(X2)) → ok(filter(X1, X2))
divides(ok(X1), ok(X2)) → ok(divides(X1, X2))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

(27) Obligation:

Q DP problem:
P is empty.
The TRS R consists of the following rules:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
active(sieve(X)) → sieve(active(X))
active(from(X)) → from(active(X))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(head(X)) → head(active(X))
active(tail(X)) → tail(active(X))
active(if(X1, X2, X3)) → if(active(X1), X2, X3)
active(filter(X1, X2)) → filter(active(X1), X2)
active(filter(X1, X2)) → filter(X1, active(X2))
active(divides(X1, X2)) → divides(active(X1), X2)
active(divides(X1, X2)) → divides(X1, active(X2))
sieve(mark(X)) → mark(sieve(X))
from(mark(X)) → mark(from(X))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
head(mark(X)) → mark(head(X))
tail(mark(X)) → mark(tail(X))
if(mark(X1), X2, X3) → mark(if(X1, X2, X3))
filter(mark(X1), X2) → mark(filter(X1, X2))
filter(X1, mark(X2)) → mark(filter(X1, X2))
divides(mark(X1), X2) → mark(divides(X1, X2))
divides(X1, mark(X2)) → mark(divides(X1, X2))
proper(primes) → ok(primes)
proper(sieve(X)) → sieve(proper(X))
proper(from(X)) → from(proper(X))
proper(s(X)) → s(proper(X))
proper(0) → ok(0)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(head(X)) → head(proper(X))
proper(tail(X)) → tail(proper(X))
proper(if(X1, X2, X3)) → if(proper(X1), proper(X2), proper(X3))
proper(true) → ok(true)
proper(false) → ok(false)
proper(filter(X1, X2)) → filter(proper(X1), proper(X2))
proper(divides(X1, X2)) → divides(proper(X1), proper(X2))
sieve(ok(X)) → ok(sieve(X))
from(ok(X)) → ok(from(X))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
head(ok(X)) → ok(head(X))
tail(ok(X)) → ok(tail(X))
if(ok(X1), ok(X2), ok(X3)) → ok(if(X1, X2, X3))
filter(ok(X1), ok(X2)) → ok(filter(X1, X2))
divides(ok(X1), ok(X2)) → ok(divides(X1, X2))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

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

(28) PisEmptyProof (EQUIVALENT transformation)

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

(29) TRUE

(30) Obligation:

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

TAIL(ok(X)) → TAIL(X)
TAIL(mark(X)) → TAIL(X)

The TRS R consists of the following rules:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
active(sieve(X)) → sieve(active(X))
active(from(X)) → from(active(X))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(head(X)) → head(active(X))
active(tail(X)) → tail(active(X))
active(if(X1, X2, X3)) → if(active(X1), X2, X3)
active(filter(X1, X2)) → filter(active(X1), X2)
active(filter(X1, X2)) → filter(X1, active(X2))
active(divides(X1, X2)) → divides(active(X1), X2)
active(divides(X1, X2)) → divides(X1, active(X2))
sieve(mark(X)) → mark(sieve(X))
from(mark(X)) → mark(from(X))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
head(mark(X)) → mark(head(X))
tail(mark(X)) → mark(tail(X))
if(mark(X1), X2, X3) → mark(if(X1, X2, X3))
filter(mark(X1), X2) → mark(filter(X1, X2))
filter(X1, mark(X2)) → mark(filter(X1, X2))
divides(mark(X1), X2) → mark(divides(X1, X2))
divides(X1, mark(X2)) → mark(divides(X1, X2))
proper(primes) → ok(primes)
proper(sieve(X)) → sieve(proper(X))
proper(from(X)) → from(proper(X))
proper(s(X)) → s(proper(X))
proper(0) → ok(0)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(head(X)) → head(proper(X))
proper(tail(X)) → tail(proper(X))
proper(if(X1, X2, X3)) → if(proper(X1), proper(X2), proper(X3))
proper(true) → ok(true)
proper(false) → ok(false)
proper(filter(X1, X2)) → filter(proper(X1), proper(X2))
proper(divides(X1, X2)) → divides(proper(X1), proper(X2))
sieve(ok(X)) → ok(sieve(X))
from(ok(X)) → ok(from(X))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
head(ok(X)) → ok(head(X))
tail(ok(X)) → ok(tail(X))
if(ok(X1), ok(X2), ok(X3)) → ok(if(X1, X2, X3))
filter(ok(X1), ok(X2)) → ok(filter(X1, X2))
divides(ok(X1), ok(X2)) → ok(divides(X1, X2))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

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

(31) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


TAIL(mark(X)) → TAIL(X)
The remaining pairs can at least be oriented weakly.
Used ordering: Combined order from the following AFS and order.
TAIL(x1)  =  x1
ok(x1)  =  x1
mark(x1)  =  mark(x1)
active(x1)  =  active(x1)
primes  =  primes
sieve(x1)  =  sieve(x1)
from(x1)  =  x1
s(x1)  =  x1
0  =  0
cons(x1, x2)  =  cons(x1, x2)
head(x1)  =  x1
tail(x1)  =  x1
if(x1, x2, x3)  =  if(x1, x2, x3)
true  =  true
false  =  false
filter(x1, x2)  =  filter(x1, x2)
divides(x1, x2)  =  divides(x1, x2)
proper(x1)  =  proper(x1)
top(x1)  =  top

Recursive Path Order [RPO].
Precedence:
true > mark1
false > mark1
proper1 > primes > sieve1 > cons2 > filter2 > mark1
proper1 > primes > sieve1 > cons2 > divides2 > mark1
proper1 > primes > 0 > mark1
proper1 > if3 > mark1
top > active1 > sieve1 > cons2 > filter2 > mark1
top > active1 > sieve1 > cons2 > divides2 > mark1
top > active1 > 0 > mark1
top > active1 > if3 > mark1

The following usable rules [FROCOS05] were oriented:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
active(sieve(X)) → sieve(active(X))
active(from(X)) → from(active(X))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(head(X)) → head(active(X))
active(tail(X)) → tail(active(X))
active(if(X1, X2, X3)) → if(active(X1), X2, X3)
active(filter(X1, X2)) → filter(active(X1), X2)
active(filter(X1, X2)) → filter(X1, active(X2))
active(divides(X1, X2)) → divides(active(X1), X2)
active(divides(X1, X2)) → divides(X1, active(X2))
sieve(mark(X)) → mark(sieve(X))
from(mark(X)) → mark(from(X))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
head(mark(X)) → mark(head(X))
tail(mark(X)) → mark(tail(X))
if(mark(X1), X2, X3) → mark(if(X1, X2, X3))
filter(mark(X1), X2) → mark(filter(X1, X2))
filter(X1, mark(X2)) → mark(filter(X1, X2))
divides(mark(X1), X2) → mark(divides(X1, X2))
divides(X1, mark(X2)) → mark(divides(X1, X2))
proper(primes) → ok(primes)
proper(sieve(X)) → sieve(proper(X))
proper(from(X)) → from(proper(X))
proper(s(X)) → s(proper(X))
proper(0) → ok(0)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(head(X)) → head(proper(X))
proper(tail(X)) → tail(proper(X))
proper(if(X1, X2, X3)) → if(proper(X1), proper(X2), proper(X3))
proper(true) → ok(true)
proper(false) → ok(false)
proper(filter(X1, X2)) → filter(proper(X1), proper(X2))
proper(divides(X1, X2)) → divides(proper(X1), proper(X2))
sieve(ok(X)) → ok(sieve(X))
from(ok(X)) → ok(from(X))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
head(ok(X)) → ok(head(X))
tail(ok(X)) → ok(tail(X))
if(ok(X1), ok(X2), ok(X3)) → ok(if(X1, X2, X3))
filter(ok(X1), ok(X2)) → ok(filter(X1, X2))
divides(ok(X1), ok(X2)) → ok(divides(X1, X2))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

(32) Obligation:

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

TAIL(ok(X)) → TAIL(X)

The TRS R consists of the following rules:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
active(sieve(X)) → sieve(active(X))
active(from(X)) → from(active(X))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(head(X)) → head(active(X))
active(tail(X)) → tail(active(X))
active(if(X1, X2, X3)) → if(active(X1), X2, X3)
active(filter(X1, X2)) → filter(active(X1), X2)
active(filter(X1, X2)) → filter(X1, active(X2))
active(divides(X1, X2)) → divides(active(X1), X2)
active(divides(X1, X2)) → divides(X1, active(X2))
sieve(mark(X)) → mark(sieve(X))
from(mark(X)) → mark(from(X))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
head(mark(X)) → mark(head(X))
tail(mark(X)) → mark(tail(X))
if(mark(X1), X2, X3) → mark(if(X1, X2, X3))
filter(mark(X1), X2) → mark(filter(X1, X2))
filter(X1, mark(X2)) → mark(filter(X1, X2))
divides(mark(X1), X2) → mark(divides(X1, X2))
divides(X1, mark(X2)) → mark(divides(X1, X2))
proper(primes) → ok(primes)
proper(sieve(X)) → sieve(proper(X))
proper(from(X)) → from(proper(X))
proper(s(X)) → s(proper(X))
proper(0) → ok(0)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(head(X)) → head(proper(X))
proper(tail(X)) → tail(proper(X))
proper(if(X1, X2, X3)) → if(proper(X1), proper(X2), proper(X3))
proper(true) → ok(true)
proper(false) → ok(false)
proper(filter(X1, X2)) → filter(proper(X1), proper(X2))
proper(divides(X1, X2)) → divides(proper(X1), proper(X2))
sieve(ok(X)) → ok(sieve(X))
from(ok(X)) → ok(from(X))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
head(ok(X)) → ok(head(X))
tail(ok(X)) → ok(tail(X))
if(ok(X1), ok(X2), ok(X3)) → ok(if(X1, X2, X3))
filter(ok(X1), ok(X2)) → ok(filter(X1, X2))
divides(ok(X1), ok(X2)) → ok(divides(X1, X2))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

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

(33) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


TAIL(ok(X)) → TAIL(X)
The remaining pairs can at least be oriented weakly.
Used ordering: Combined order from the following AFS and order.
TAIL(x1)  =  x1
ok(x1)  =  ok(x1)
active(x1)  =  active(x1)
primes  =  primes
mark(x1)  =  mark
sieve(x1)  =  x1
from(x1)  =  x1
s(x1)  =  s(x1)
0  =  0
cons(x1, x2)  =  x1
head(x1)  =  head(x1)
tail(x1)  =  tail(x1)
if(x1, x2, x3)  =  if(x2, x3)
true  =  true
false  =  false
filter(x1, x2)  =  filter(x1, x2)
divides(x1, x2)  =  divides(x1)
proper(x1)  =  proper(x1)
top(x1)  =  top

Recursive Path Order [RPO].
Precedence:
0 > ok1
proper1 > primes > s1 > ok1
proper1 > if2 > active1 > head1 > mark > s1 > ok1
proper1 > if2 > active1 > head1 > mark > tail1 > ok1
proper1 > if2 > active1 > head1 > mark > filter2 > ok1
proper1 > if2 > active1 > divides1 > mark > s1 > ok1
proper1 > if2 > active1 > divides1 > mark > tail1 > ok1
proper1 > if2 > active1 > divides1 > mark > filter2 > ok1
proper1 > true
proper1 > false
top > active1 > head1 > mark > s1 > ok1
top > active1 > head1 > mark > tail1 > ok1
top > active1 > head1 > mark > filter2 > ok1
top > active1 > divides1 > mark > s1 > ok1
top > active1 > divides1 > mark > tail1 > ok1
top > active1 > divides1 > mark > filter2 > ok1

The following usable rules [FROCOS05] were oriented:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
active(sieve(X)) → sieve(active(X))
active(from(X)) → from(active(X))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(head(X)) → head(active(X))
active(tail(X)) → tail(active(X))
active(if(X1, X2, X3)) → if(active(X1), X2, X3)
active(filter(X1, X2)) → filter(active(X1), X2)
active(filter(X1, X2)) → filter(X1, active(X2))
active(divides(X1, X2)) → divides(active(X1), X2)
active(divides(X1, X2)) → divides(X1, active(X2))
sieve(mark(X)) → mark(sieve(X))
from(mark(X)) → mark(from(X))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
head(mark(X)) → mark(head(X))
tail(mark(X)) → mark(tail(X))
if(mark(X1), X2, X3) → mark(if(X1, X2, X3))
filter(mark(X1), X2) → mark(filter(X1, X2))
filter(X1, mark(X2)) → mark(filter(X1, X2))
divides(mark(X1), X2) → mark(divides(X1, X2))
divides(X1, mark(X2)) → mark(divides(X1, X2))
proper(primes) → ok(primes)
proper(sieve(X)) → sieve(proper(X))
proper(from(X)) → from(proper(X))
proper(s(X)) → s(proper(X))
proper(0) → ok(0)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(head(X)) → head(proper(X))
proper(tail(X)) → tail(proper(X))
proper(if(X1, X2, X3)) → if(proper(X1), proper(X2), proper(X3))
proper(true) → ok(true)
proper(false) → ok(false)
proper(filter(X1, X2)) → filter(proper(X1), proper(X2))
proper(divides(X1, X2)) → divides(proper(X1), proper(X2))
sieve(ok(X)) → ok(sieve(X))
from(ok(X)) → ok(from(X))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
head(ok(X)) → ok(head(X))
tail(ok(X)) → ok(tail(X))
if(ok(X1), ok(X2), ok(X3)) → ok(if(X1, X2, X3))
filter(ok(X1), ok(X2)) → ok(filter(X1, X2))
divides(ok(X1), ok(X2)) → ok(divides(X1, X2))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

(34) Obligation:

Q DP problem:
P is empty.
The TRS R consists of the following rules:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
active(sieve(X)) → sieve(active(X))
active(from(X)) → from(active(X))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(head(X)) → head(active(X))
active(tail(X)) → tail(active(X))
active(if(X1, X2, X3)) → if(active(X1), X2, X3)
active(filter(X1, X2)) → filter(active(X1), X2)
active(filter(X1, X2)) → filter(X1, active(X2))
active(divides(X1, X2)) → divides(active(X1), X2)
active(divides(X1, X2)) → divides(X1, active(X2))
sieve(mark(X)) → mark(sieve(X))
from(mark(X)) → mark(from(X))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
head(mark(X)) → mark(head(X))
tail(mark(X)) → mark(tail(X))
if(mark(X1), X2, X3) → mark(if(X1, X2, X3))
filter(mark(X1), X2) → mark(filter(X1, X2))
filter(X1, mark(X2)) → mark(filter(X1, X2))
divides(mark(X1), X2) → mark(divides(X1, X2))
divides(X1, mark(X2)) → mark(divides(X1, X2))
proper(primes) → ok(primes)
proper(sieve(X)) → sieve(proper(X))
proper(from(X)) → from(proper(X))
proper(s(X)) → s(proper(X))
proper(0) → ok(0)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(head(X)) → head(proper(X))
proper(tail(X)) → tail(proper(X))
proper(if(X1, X2, X3)) → if(proper(X1), proper(X2), proper(X3))
proper(true) → ok(true)
proper(false) → ok(false)
proper(filter(X1, X2)) → filter(proper(X1), proper(X2))
proper(divides(X1, X2)) → divides(proper(X1), proper(X2))
sieve(ok(X)) → ok(sieve(X))
from(ok(X)) → ok(from(X))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
head(ok(X)) → ok(head(X))
tail(ok(X)) → ok(tail(X))
if(ok(X1), ok(X2), ok(X3)) → ok(if(X1, X2, X3))
filter(ok(X1), ok(X2)) → ok(filter(X1, X2))
divides(ok(X1), ok(X2)) → ok(divides(X1, X2))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

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

(35) PisEmptyProof (EQUIVALENT transformation)

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

(36) TRUE

(37) Obligation:

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

HEAD(ok(X)) → HEAD(X)
HEAD(mark(X)) → HEAD(X)

The TRS R consists of the following rules:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
active(sieve(X)) → sieve(active(X))
active(from(X)) → from(active(X))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(head(X)) → head(active(X))
active(tail(X)) → tail(active(X))
active(if(X1, X2, X3)) → if(active(X1), X2, X3)
active(filter(X1, X2)) → filter(active(X1), X2)
active(filter(X1, X2)) → filter(X1, active(X2))
active(divides(X1, X2)) → divides(active(X1), X2)
active(divides(X1, X2)) → divides(X1, active(X2))
sieve(mark(X)) → mark(sieve(X))
from(mark(X)) → mark(from(X))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
head(mark(X)) → mark(head(X))
tail(mark(X)) → mark(tail(X))
if(mark(X1), X2, X3) → mark(if(X1, X2, X3))
filter(mark(X1), X2) → mark(filter(X1, X2))
filter(X1, mark(X2)) → mark(filter(X1, X2))
divides(mark(X1), X2) → mark(divides(X1, X2))
divides(X1, mark(X2)) → mark(divides(X1, X2))
proper(primes) → ok(primes)
proper(sieve(X)) → sieve(proper(X))
proper(from(X)) → from(proper(X))
proper(s(X)) → s(proper(X))
proper(0) → ok(0)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(head(X)) → head(proper(X))
proper(tail(X)) → tail(proper(X))
proper(if(X1, X2, X3)) → if(proper(X1), proper(X2), proper(X3))
proper(true) → ok(true)
proper(false) → ok(false)
proper(filter(X1, X2)) → filter(proper(X1), proper(X2))
proper(divides(X1, X2)) → divides(proper(X1), proper(X2))
sieve(ok(X)) → ok(sieve(X))
from(ok(X)) → ok(from(X))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
head(ok(X)) → ok(head(X))
tail(ok(X)) → ok(tail(X))
if(ok(X1), ok(X2), ok(X3)) → ok(if(X1, X2, X3))
filter(ok(X1), ok(X2)) → ok(filter(X1, X2))
divides(ok(X1), ok(X2)) → ok(divides(X1, X2))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

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

(38) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


HEAD(mark(X)) → HEAD(X)
The remaining pairs can at least be oriented weakly.
Used ordering: Combined order from the following AFS and order.
HEAD(x1)  =  x1
ok(x1)  =  x1
mark(x1)  =  mark(x1)
active(x1)  =  active(x1)
primes  =  primes
sieve(x1)  =  sieve(x1)
from(x1)  =  x1
s(x1)  =  x1
0  =  0
cons(x1, x2)  =  cons(x1, x2)
head(x1)  =  x1
tail(x1)  =  x1
if(x1, x2, x3)  =  if(x1, x2, x3)
true  =  true
false  =  false
filter(x1, x2)  =  filter(x1, x2)
divides(x1, x2)  =  divides(x1, x2)
proper(x1)  =  proper(x1)
top(x1)  =  top

Recursive Path Order [RPO].
Precedence:
true > mark1
false > mark1
proper1 > primes > sieve1 > cons2 > filter2 > mark1
proper1 > primes > sieve1 > cons2 > divides2 > mark1
proper1 > primes > 0 > mark1
proper1 > if3 > mark1
top > active1 > sieve1 > cons2 > filter2 > mark1
top > active1 > sieve1 > cons2 > divides2 > mark1
top > active1 > 0 > mark1
top > active1 > if3 > mark1

The following usable rules [FROCOS05] were oriented:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
active(sieve(X)) → sieve(active(X))
active(from(X)) → from(active(X))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(head(X)) → head(active(X))
active(tail(X)) → tail(active(X))
active(if(X1, X2, X3)) → if(active(X1), X2, X3)
active(filter(X1, X2)) → filter(active(X1), X2)
active(filter(X1, X2)) → filter(X1, active(X2))
active(divides(X1, X2)) → divides(active(X1), X2)
active(divides(X1, X2)) → divides(X1, active(X2))
sieve(mark(X)) → mark(sieve(X))
from(mark(X)) → mark(from(X))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
head(mark(X)) → mark(head(X))
tail(mark(X)) → mark(tail(X))
if(mark(X1), X2, X3) → mark(if(X1, X2, X3))
filter(mark(X1), X2) → mark(filter(X1, X2))
filter(X1, mark(X2)) → mark(filter(X1, X2))
divides(mark(X1), X2) → mark(divides(X1, X2))
divides(X1, mark(X2)) → mark(divides(X1, X2))
proper(primes) → ok(primes)
proper(sieve(X)) → sieve(proper(X))
proper(from(X)) → from(proper(X))
proper(s(X)) → s(proper(X))
proper(0) → ok(0)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(head(X)) → head(proper(X))
proper(tail(X)) → tail(proper(X))
proper(if(X1, X2, X3)) → if(proper(X1), proper(X2), proper(X3))
proper(true) → ok(true)
proper(false) → ok(false)
proper(filter(X1, X2)) → filter(proper(X1), proper(X2))
proper(divides(X1, X2)) → divides(proper(X1), proper(X2))
sieve(ok(X)) → ok(sieve(X))
from(ok(X)) → ok(from(X))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
head(ok(X)) → ok(head(X))
tail(ok(X)) → ok(tail(X))
if(ok(X1), ok(X2), ok(X3)) → ok(if(X1, X2, X3))
filter(ok(X1), ok(X2)) → ok(filter(X1, X2))
divides(ok(X1), ok(X2)) → ok(divides(X1, X2))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

(39) Obligation:

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

HEAD(ok(X)) → HEAD(X)

The TRS R consists of the following rules:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
active(sieve(X)) → sieve(active(X))
active(from(X)) → from(active(X))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(head(X)) → head(active(X))
active(tail(X)) → tail(active(X))
active(if(X1, X2, X3)) → if(active(X1), X2, X3)
active(filter(X1, X2)) → filter(active(X1), X2)
active(filter(X1, X2)) → filter(X1, active(X2))
active(divides(X1, X2)) → divides(active(X1), X2)
active(divides(X1, X2)) → divides(X1, active(X2))
sieve(mark(X)) → mark(sieve(X))
from(mark(X)) → mark(from(X))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
head(mark(X)) → mark(head(X))
tail(mark(X)) → mark(tail(X))
if(mark(X1), X2, X3) → mark(if(X1, X2, X3))
filter(mark(X1), X2) → mark(filter(X1, X2))
filter(X1, mark(X2)) → mark(filter(X1, X2))
divides(mark(X1), X2) → mark(divides(X1, X2))
divides(X1, mark(X2)) → mark(divides(X1, X2))
proper(primes) → ok(primes)
proper(sieve(X)) → sieve(proper(X))
proper(from(X)) → from(proper(X))
proper(s(X)) → s(proper(X))
proper(0) → ok(0)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(head(X)) → head(proper(X))
proper(tail(X)) → tail(proper(X))
proper(if(X1, X2, X3)) → if(proper(X1), proper(X2), proper(X3))
proper(true) → ok(true)
proper(false) → ok(false)
proper(filter(X1, X2)) → filter(proper(X1), proper(X2))
proper(divides(X1, X2)) → divides(proper(X1), proper(X2))
sieve(ok(X)) → ok(sieve(X))
from(ok(X)) → ok(from(X))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
head(ok(X)) → ok(head(X))
tail(ok(X)) → ok(tail(X))
if(ok(X1), ok(X2), ok(X3)) → ok(if(X1, X2, X3))
filter(ok(X1), ok(X2)) → ok(filter(X1, X2))
divides(ok(X1), ok(X2)) → ok(divides(X1, X2))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

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

(40) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


HEAD(ok(X)) → HEAD(X)
The remaining pairs can at least be oriented weakly.
Used ordering: Combined order from the following AFS and order.
HEAD(x1)  =  x1
ok(x1)  =  ok(x1)
active(x1)  =  active(x1)
primes  =  primes
mark(x1)  =  mark
sieve(x1)  =  x1
from(x1)  =  x1
s(x1)  =  s(x1)
0  =  0
cons(x1, x2)  =  x1
head(x1)  =  head(x1)
tail(x1)  =  tail(x1)
if(x1, x2, x3)  =  if(x2, x3)
true  =  true
false  =  false
filter(x1, x2)  =  filter(x1, x2)
divides(x1, x2)  =  divides(x1)
proper(x1)  =  proper(x1)
top(x1)  =  top

Recursive Path Order [RPO].
Precedence:
0 > ok1
proper1 > primes > s1 > ok1
proper1 > if2 > active1 > head1 > mark > s1 > ok1
proper1 > if2 > active1 > head1 > mark > tail1 > ok1
proper1 > if2 > active1 > head1 > mark > filter2 > ok1
proper1 > if2 > active1 > divides1 > mark > s1 > ok1
proper1 > if2 > active1 > divides1 > mark > tail1 > ok1
proper1 > if2 > active1 > divides1 > mark > filter2 > ok1
proper1 > true
proper1 > false
top > active1 > head1 > mark > s1 > ok1
top > active1 > head1 > mark > tail1 > ok1
top > active1 > head1 > mark > filter2 > ok1
top > active1 > divides1 > mark > s1 > ok1
top > active1 > divides1 > mark > tail1 > ok1
top > active1 > divides1 > mark > filter2 > ok1

The following usable rules [FROCOS05] were oriented:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
active(sieve(X)) → sieve(active(X))
active(from(X)) → from(active(X))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(head(X)) → head(active(X))
active(tail(X)) → tail(active(X))
active(if(X1, X2, X3)) → if(active(X1), X2, X3)
active(filter(X1, X2)) → filter(active(X1), X2)
active(filter(X1, X2)) → filter(X1, active(X2))
active(divides(X1, X2)) → divides(active(X1), X2)
active(divides(X1, X2)) → divides(X1, active(X2))
sieve(mark(X)) → mark(sieve(X))
from(mark(X)) → mark(from(X))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
head(mark(X)) → mark(head(X))
tail(mark(X)) → mark(tail(X))
if(mark(X1), X2, X3) → mark(if(X1, X2, X3))
filter(mark(X1), X2) → mark(filter(X1, X2))
filter(X1, mark(X2)) → mark(filter(X1, X2))
divides(mark(X1), X2) → mark(divides(X1, X2))
divides(X1, mark(X2)) → mark(divides(X1, X2))
proper(primes) → ok(primes)
proper(sieve(X)) → sieve(proper(X))
proper(from(X)) → from(proper(X))
proper(s(X)) → s(proper(X))
proper(0) → ok(0)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(head(X)) → head(proper(X))
proper(tail(X)) → tail(proper(X))
proper(if(X1, X2, X3)) → if(proper(X1), proper(X2), proper(X3))
proper(true) → ok(true)
proper(false) → ok(false)
proper(filter(X1, X2)) → filter(proper(X1), proper(X2))
proper(divides(X1, X2)) → divides(proper(X1), proper(X2))
sieve(ok(X)) → ok(sieve(X))
from(ok(X)) → ok(from(X))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
head(ok(X)) → ok(head(X))
tail(ok(X)) → ok(tail(X))
if(ok(X1), ok(X2), ok(X3)) → ok(if(X1, X2, X3))
filter(ok(X1), ok(X2)) → ok(filter(X1, X2))
divides(ok(X1), ok(X2)) → ok(divides(X1, X2))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

(41) Obligation:

Q DP problem:
P is empty.
The TRS R consists of the following rules:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
active(sieve(X)) → sieve(active(X))
active(from(X)) → from(active(X))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(head(X)) → head(active(X))
active(tail(X)) → tail(active(X))
active(if(X1, X2, X3)) → if(active(X1), X2, X3)
active(filter(X1, X2)) → filter(active(X1), X2)
active(filter(X1, X2)) → filter(X1, active(X2))
active(divides(X1, X2)) → divides(active(X1), X2)
active(divides(X1, X2)) → divides(X1, active(X2))
sieve(mark(X)) → mark(sieve(X))
from(mark(X)) → mark(from(X))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
head(mark(X)) → mark(head(X))
tail(mark(X)) → mark(tail(X))
if(mark(X1), X2, X3) → mark(if(X1, X2, X3))
filter(mark(X1), X2) → mark(filter(X1, X2))
filter(X1, mark(X2)) → mark(filter(X1, X2))
divides(mark(X1), X2) → mark(divides(X1, X2))
divides(X1, mark(X2)) → mark(divides(X1, X2))
proper(primes) → ok(primes)
proper(sieve(X)) → sieve(proper(X))
proper(from(X)) → from(proper(X))
proper(s(X)) → s(proper(X))
proper(0) → ok(0)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(head(X)) → head(proper(X))
proper(tail(X)) → tail(proper(X))
proper(if(X1, X2, X3)) → if(proper(X1), proper(X2), proper(X3))
proper(true) → ok(true)
proper(false) → ok(false)
proper(filter(X1, X2)) → filter(proper(X1), proper(X2))
proper(divides(X1, X2)) → divides(proper(X1), proper(X2))
sieve(ok(X)) → ok(sieve(X))
from(ok(X)) → ok(from(X))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
head(ok(X)) → ok(head(X))
tail(ok(X)) → ok(tail(X))
if(ok(X1), ok(X2), ok(X3)) → ok(if(X1, X2, X3))
filter(ok(X1), ok(X2)) → ok(filter(X1, X2))
divides(ok(X1), ok(X2)) → ok(divides(X1, X2))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

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

(42) PisEmptyProof (EQUIVALENT transformation)

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

(43) TRUE

(44) Obligation:

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

CONS(ok(X1), ok(X2)) → CONS(X1, X2)
CONS(mark(X1), X2) → CONS(X1, X2)

The TRS R consists of the following rules:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
active(sieve(X)) → sieve(active(X))
active(from(X)) → from(active(X))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(head(X)) → head(active(X))
active(tail(X)) → tail(active(X))
active(if(X1, X2, X3)) → if(active(X1), X2, X3)
active(filter(X1, X2)) → filter(active(X1), X2)
active(filter(X1, X2)) → filter(X1, active(X2))
active(divides(X1, X2)) → divides(active(X1), X2)
active(divides(X1, X2)) → divides(X1, active(X2))
sieve(mark(X)) → mark(sieve(X))
from(mark(X)) → mark(from(X))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
head(mark(X)) → mark(head(X))
tail(mark(X)) → mark(tail(X))
if(mark(X1), X2, X3) → mark(if(X1, X2, X3))
filter(mark(X1), X2) → mark(filter(X1, X2))
filter(X1, mark(X2)) → mark(filter(X1, X2))
divides(mark(X1), X2) → mark(divides(X1, X2))
divides(X1, mark(X2)) → mark(divides(X1, X2))
proper(primes) → ok(primes)
proper(sieve(X)) → sieve(proper(X))
proper(from(X)) → from(proper(X))
proper(s(X)) → s(proper(X))
proper(0) → ok(0)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(head(X)) → head(proper(X))
proper(tail(X)) → tail(proper(X))
proper(if(X1, X2, X3)) → if(proper(X1), proper(X2), proper(X3))
proper(true) → ok(true)
proper(false) → ok(false)
proper(filter(X1, X2)) → filter(proper(X1), proper(X2))
proper(divides(X1, X2)) → divides(proper(X1), proper(X2))
sieve(ok(X)) → ok(sieve(X))
from(ok(X)) → ok(from(X))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
head(ok(X)) → ok(head(X))
tail(ok(X)) → ok(tail(X))
if(ok(X1), ok(X2), ok(X3)) → ok(if(X1, X2, X3))
filter(ok(X1), ok(X2)) → ok(filter(X1, X2))
divides(ok(X1), ok(X2)) → ok(divides(X1, X2))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

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

(45) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


CONS(mark(X1), X2) → CONS(X1, X2)
The remaining pairs can at least be oriented weakly.
Used ordering: Combined order from the following AFS and order.
CONS(x1, x2)  =  CONS(x1)
ok(x1)  =  x1
mark(x1)  =  mark(x1)
active(x1)  =  active(x1)
primes  =  primes
sieve(x1)  =  sieve(x1)
from(x1)  =  x1
s(x1)  =  s(x1)
0  =  0
cons(x1, x2)  =  cons(x1, x2)
head(x1)  =  head(x1)
tail(x1)  =  tail(x1)
if(x1, x2, x3)  =  if(x1, x2, x3)
true  =  true
false  =  false
filter(x1, x2)  =  filter(x1, x2)
divides(x1, x2)  =  divides(x1, x2)
proper(x1)  =  x1
top(x1)  =  top

Recursive Path Order [RPO].
Precedence:
active1 > sieve1 > filter2 > cons2 > mark1 > CONS1
active1 > sieve1 > filter2 > cons2 > mark1 > top
active1 > s1 > cons2 > mark1 > CONS1
active1 > s1 > cons2 > mark1 > top
active1 > 0
active1 > head1 > mark1 > CONS1
active1 > head1 > mark1 > top
active1 > tail1 > mark1 > CONS1
active1 > tail1 > mark1 > top
active1 > if3 > mark1 > CONS1
active1 > if3 > mark1 > top
active1 > divides2 > mark1 > CONS1
active1 > divides2 > mark1 > top
primes > mark1 > CONS1
primes > mark1 > top
primes > 0
true > mark1 > CONS1
true > mark1 > top
false > mark1 > CONS1
false > mark1 > top

The following usable rules [FROCOS05] were oriented:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
active(sieve(X)) → sieve(active(X))
active(from(X)) → from(active(X))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(head(X)) → head(active(X))
active(tail(X)) → tail(active(X))
active(if(X1, X2, X3)) → if(active(X1), X2, X3)
active(filter(X1, X2)) → filter(active(X1), X2)
active(filter(X1, X2)) → filter(X1, active(X2))
active(divides(X1, X2)) → divides(active(X1), X2)
active(divides(X1, X2)) → divides(X1, active(X2))
sieve(mark(X)) → mark(sieve(X))
from(mark(X)) → mark(from(X))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
head(mark(X)) → mark(head(X))
tail(mark(X)) → mark(tail(X))
if(mark(X1), X2, X3) → mark(if(X1, X2, X3))
filter(mark(X1), X2) → mark(filter(X1, X2))
filter(X1, mark(X2)) → mark(filter(X1, X2))
divides(mark(X1), X2) → mark(divides(X1, X2))
divides(X1, mark(X2)) → mark(divides(X1, X2))
proper(primes) → ok(primes)
proper(sieve(X)) → sieve(proper(X))
proper(from(X)) → from(proper(X))
proper(s(X)) → s(proper(X))
proper(0) → ok(0)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(head(X)) → head(proper(X))
proper(tail(X)) → tail(proper(X))
proper(if(X1, X2, X3)) → if(proper(X1), proper(X2), proper(X3))
proper(true) → ok(true)
proper(false) → ok(false)
proper(filter(X1, X2)) → filter(proper(X1), proper(X2))
proper(divides(X1, X2)) → divides(proper(X1), proper(X2))
sieve(ok(X)) → ok(sieve(X))
from(ok(X)) → ok(from(X))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
head(ok(X)) → ok(head(X))
tail(ok(X)) → ok(tail(X))
if(ok(X1), ok(X2), ok(X3)) → ok(if(X1, X2, X3))
filter(ok(X1), ok(X2)) → ok(filter(X1, X2))
divides(ok(X1), ok(X2)) → ok(divides(X1, X2))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

(46) Obligation:

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

CONS(ok(X1), ok(X2)) → CONS(X1, X2)

The TRS R consists of the following rules:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
active(sieve(X)) → sieve(active(X))
active(from(X)) → from(active(X))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(head(X)) → head(active(X))
active(tail(X)) → tail(active(X))
active(if(X1, X2, X3)) → if(active(X1), X2, X3)
active(filter(X1, X2)) → filter(active(X1), X2)
active(filter(X1, X2)) → filter(X1, active(X2))
active(divides(X1, X2)) → divides(active(X1), X2)
active(divides(X1, X2)) → divides(X1, active(X2))
sieve(mark(X)) → mark(sieve(X))
from(mark(X)) → mark(from(X))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
head(mark(X)) → mark(head(X))
tail(mark(X)) → mark(tail(X))
if(mark(X1), X2, X3) → mark(if(X1, X2, X3))
filter(mark(X1), X2) → mark(filter(X1, X2))
filter(X1, mark(X2)) → mark(filter(X1, X2))
divides(mark(X1), X2) → mark(divides(X1, X2))
divides(X1, mark(X2)) → mark(divides(X1, X2))
proper(primes) → ok(primes)
proper(sieve(X)) → sieve(proper(X))
proper(from(X)) → from(proper(X))
proper(s(X)) → s(proper(X))
proper(0) → ok(0)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(head(X)) → head(proper(X))
proper(tail(X)) → tail(proper(X))
proper(if(X1, X2, X3)) → if(proper(X1), proper(X2), proper(X3))
proper(true) → ok(true)
proper(false) → ok(false)
proper(filter(X1, X2)) → filter(proper(X1), proper(X2))
proper(divides(X1, X2)) → divides(proper(X1), proper(X2))
sieve(ok(X)) → ok(sieve(X))
from(ok(X)) → ok(from(X))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
head(ok(X)) → ok(head(X))
tail(ok(X)) → ok(tail(X))
if(ok(X1), ok(X2), ok(X3)) → ok(if(X1, X2, X3))
filter(ok(X1), ok(X2)) → ok(filter(X1, X2))
divides(ok(X1), ok(X2)) → ok(divides(X1, X2))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

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

(47) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


CONS(ok(X1), ok(X2)) → CONS(X1, X2)
The remaining pairs can at least be oriented weakly.
Used ordering: Combined order from the following AFS and order.
CONS(x1, x2)  =  x2
ok(x1)  =  ok(x1)
active(x1)  =  active(x1)
primes  =  primes
mark(x1)  =  mark
sieve(x1)  =  x1
from(x1)  =  x1
s(x1)  =  x1
0  =  0
cons(x1, x2)  =  x1
head(x1)  =  x1
tail(x1)  =  x1
if(x1, x2, x3)  =  x2
true  =  true
false  =  false
filter(x1, x2)  =  x2
divides(x1, x2)  =  x2
proper(x1)  =  proper
top(x1)  =  top

Recursive Path Order [RPO].
Precedence:
active1 > 0 > ok1 > mark
proper > primes > ok1 > mark
proper > 0 > ok1 > mark
proper > true > mark
proper > false > mark
top > mark

The following usable rules [FROCOS05] were oriented:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
active(sieve(X)) → sieve(active(X))
active(from(X)) → from(active(X))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(head(X)) → head(active(X))
active(tail(X)) → tail(active(X))
active(if(X1, X2, X3)) → if(active(X1), X2, X3)
active(filter(X1, X2)) → filter(active(X1), X2)
active(filter(X1, X2)) → filter(X1, active(X2))
active(divides(X1, X2)) → divides(active(X1), X2)
active(divides(X1, X2)) → divides(X1, active(X2))
sieve(mark(X)) → mark(sieve(X))
from(mark(X)) → mark(from(X))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
head(mark(X)) → mark(head(X))
tail(mark(X)) → mark(tail(X))
if(mark(X1), X2, X3) → mark(if(X1, X2, X3))
filter(mark(X1), X2) → mark(filter(X1, X2))
filter(X1, mark(X2)) → mark(filter(X1, X2))
divides(mark(X1), X2) → mark(divides(X1, X2))
divides(X1, mark(X2)) → mark(divides(X1, X2))
proper(primes) → ok(primes)
proper(sieve(X)) → sieve(proper(X))
proper(from(X)) → from(proper(X))
proper(s(X)) → s(proper(X))
proper(0) → ok(0)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(head(X)) → head(proper(X))
proper(tail(X)) → tail(proper(X))
proper(if(X1, X2, X3)) → if(proper(X1), proper(X2), proper(X3))
proper(true) → ok(true)
proper(false) → ok(false)
proper(filter(X1, X2)) → filter(proper(X1), proper(X2))
proper(divides(X1, X2)) → divides(proper(X1), proper(X2))
sieve(ok(X)) → ok(sieve(X))
from(ok(X)) → ok(from(X))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
head(ok(X)) → ok(head(X))
tail(ok(X)) → ok(tail(X))
if(ok(X1), ok(X2), ok(X3)) → ok(if(X1, X2, X3))
filter(ok(X1), ok(X2)) → ok(filter(X1, X2))
divides(ok(X1), ok(X2)) → ok(divides(X1, X2))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

(48) Obligation:

Q DP problem:
P is empty.
The TRS R consists of the following rules:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
active(sieve(X)) → sieve(active(X))
active(from(X)) → from(active(X))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(head(X)) → head(active(X))
active(tail(X)) → tail(active(X))
active(if(X1, X2, X3)) → if(active(X1), X2, X3)
active(filter(X1, X2)) → filter(active(X1), X2)
active(filter(X1, X2)) → filter(X1, active(X2))
active(divides(X1, X2)) → divides(active(X1), X2)
active(divides(X1, X2)) → divides(X1, active(X2))
sieve(mark(X)) → mark(sieve(X))
from(mark(X)) → mark(from(X))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
head(mark(X)) → mark(head(X))
tail(mark(X)) → mark(tail(X))
if(mark(X1), X2, X3) → mark(if(X1, X2, X3))
filter(mark(X1), X2) → mark(filter(X1, X2))
filter(X1, mark(X2)) → mark(filter(X1, X2))
divides(mark(X1), X2) → mark(divides(X1, X2))
divides(X1, mark(X2)) → mark(divides(X1, X2))
proper(primes) → ok(primes)
proper(sieve(X)) → sieve(proper(X))
proper(from(X)) → from(proper(X))
proper(s(X)) → s(proper(X))
proper(0) → ok(0)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(head(X)) → head(proper(X))
proper(tail(X)) → tail(proper(X))
proper(if(X1, X2, X3)) → if(proper(X1), proper(X2), proper(X3))
proper(true) → ok(true)
proper(false) → ok(false)
proper(filter(X1, X2)) → filter(proper(X1), proper(X2))
proper(divides(X1, X2)) → divides(proper(X1), proper(X2))
sieve(ok(X)) → ok(sieve(X))
from(ok(X)) → ok(from(X))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
head(ok(X)) → ok(head(X))
tail(ok(X)) → ok(tail(X))
if(ok(X1), ok(X2), ok(X3)) → ok(if(X1, X2, X3))
filter(ok(X1), ok(X2)) → ok(filter(X1, X2))
divides(ok(X1), ok(X2)) → ok(divides(X1, X2))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

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

(49) PisEmptyProof (EQUIVALENT transformation)

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

(50) TRUE

(51) Obligation:

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

S(ok(X)) → S(X)
S(mark(X)) → S(X)

The TRS R consists of the following rules:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
active(sieve(X)) → sieve(active(X))
active(from(X)) → from(active(X))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(head(X)) → head(active(X))
active(tail(X)) → tail(active(X))
active(if(X1, X2, X3)) → if(active(X1), X2, X3)
active(filter(X1, X2)) → filter(active(X1), X2)
active(filter(X1, X2)) → filter(X1, active(X2))
active(divides(X1, X2)) → divides(active(X1), X2)
active(divides(X1, X2)) → divides(X1, active(X2))
sieve(mark(X)) → mark(sieve(X))
from(mark(X)) → mark(from(X))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
head(mark(X)) → mark(head(X))
tail(mark(X)) → mark(tail(X))
if(mark(X1), X2, X3) → mark(if(X1, X2, X3))
filter(mark(X1), X2) → mark(filter(X1, X2))
filter(X1, mark(X2)) → mark(filter(X1, X2))
divides(mark(X1), X2) → mark(divides(X1, X2))
divides(X1, mark(X2)) → mark(divides(X1, X2))
proper(primes) → ok(primes)
proper(sieve(X)) → sieve(proper(X))
proper(from(X)) → from(proper(X))
proper(s(X)) → s(proper(X))
proper(0) → ok(0)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(head(X)) → head(proper(X))
proper(tail(X)) → tail(proper(X))
proper(if(X1, X2, X3)) → if(proper(X1), proper(X2), proper(X3))
proper(true) → ok(true)
proper(false) → ok(false)
proper(filter(X1, X2)) → filter(proper(X1), proper(X2))
proper(divides(X1, X2)) → divides(proper(X1), proper(X2))
sieve(ok(X)) → ok(sieve(X))
from(ok(X)) → ok(from(X))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
head(ok(X)) → ok(head(X))
tail(ok(X)) → ok(tail(X))
if(ok(X1), ok(X2), ok(X3)) → ok(if(X1, X2, X3))
filter(ok(X1), ok(X2)) → ok(filter(X1, X2))
divides(ok(X1), ok(X2)) → ok(divides(X1, X2))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

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

(52) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


S(mark(X)) → S(X)
The remaining pairs can at least be oriented weakly.
Used ordering: Combined order from the following AFS and order.
S(x1)  =  x1
ok(x1)  =  x1
mark(x1)  =  mark(x1)
active(x1)  =  active(x1)
primes  =  primes
sieve(x1)  =  sieve(x1)
from(x1)  =  x1
s(x1)  =  x1
0  =  0
cons(x1, x2)  =  cons(x1, x2)
head(x1)  =  x1
tail(x1)  =  x1
if(x1, x2, x3)  =  if(x1, x2, x3)
true  =  true
false  =  false
filter(x1, x2)  =  filter(x1, x2)
divides(x1, x2)  =  divides(x1, x2)
proper(x1)  =  proper(x1)
top(x1)  =  top

Recursive Path Order [RPO].
Precedence:
true > mark1
false > mark1
proper1 > primes > sieve1 > cons2 > filter2 > mark1
proper1 > primes > sieve1 > cons2 > divides2 > mark1
proper1 > primes > 0 > mark1
proper1 > if3 > mark1
top > active1 > sieve1 > cons2 > filter2 > mark1
top > active1 > sieve1 > cons2 > divides2 > mark1
top > active1 > 0 > mark1
top > active1 > if3 > mark1

The following usable rules [FROCOS05] were oriented:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
active(sieve(X)) → sieve(active(X))
active(from(X)) → from(active(X))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(head(X)) → head(active(X))
active(tail(X)) → tail(active(X))
active(if(X1, X2, X3)) → if(active(X1), X2, X3)
active(filter(X1, X2)) → filter(active(X1), X2)
active(filter(X1, X2)) → filter(X1, active(X2))
active(divides(X1, X2)) → divides(active(X1), X2)
active(divides(X1, X2)) → divides(X1, active(X2))
sieve(mark(X)) → mark(sieve(X))
from(mark(X)) → mark(from(X))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
head(mark(X)) → mark(head(X))
tail(mark(X)) → mark(tail(X))
if(mark(X1), X2, X3) → mark(if(X1, X2, X3))
filter(mark(X1), X2) → mark(filter(X1, X2))
filter(X1, mark(X2)) → mark(filter(X1, X2))
divides(mark(X1), X2) → mark(divides(X1, X2))
divides(X1, mark(X2)) → mark(divides(X1, X2))
proper(primes) → ok(primes)
proper(sieve(X)) → sieve(proper(X))
proper(from(X)) → from(proper(X))
proper(s(X)) → s(proper(X))
proper(0) → ok(0)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(head(X)) → head(proper(X))
proper(tail(X)) → tail(proper(X))
proper(if(X1, X2, X3)) → if(proper(X1), proper(X2), proper(X3))
proper(true) → ok(true)
proper(false) → ok(false)
proper(filter(X1, X2)) → filter(proper(X1), proper(X2))
proper(divides(X1, X2)) → divides(proper(X1), proper(X2))
sieve(ok(X)) → ok(sieve(X))
from(ok(X)) → ok(from(X))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
head(ok(X)) → ok(head(X))
tail(ok(X)) → ok(tail(X))
if(ok(X1), ok(X2), ok(X3)) → ok(if(X1, X2, X3))
filter(ok(X1), ok(X2)) → ok(filter(X1, X2))
divides(ok(X1), ok(X2)) → ok(divides(X1, X2))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

(53) Obligation:

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

S(ok(X)) → S(X)

The TRS R consists of the following rules:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
active(sieve(X)) → sieve(active(X))
active(from(X)) → from(active(X))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(head(X)) → head(active(X))
active(tail(X)) → tail(active(X))
active(if(X1, X2, X3)) → if(active(X1), X2, X3)
active(filter(X1, X2)) → filter(active(X1), X2)
active(filter(X1, X2)) → filter(X1, active(X2))
active(divides(X1, X2)) → divides(active(X1), X2)
active(divides(X1, X2)) → divides(X1, active(X2))
sieve(mark(X)) → mark(sieve(X))
from(mark(X)) → mark(from(X))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
head(mark(X)) → mark(head(X))
tail(mark(X)) → mark(tail(X))
if(mark(X1), X2, X3) → mark(if(X1, X2, X3))
filter(mark(X1), X2) → mark(filter(X1, X2))
filter(X1, mark(X2)) → mark(filter(X1, X2))
divides(mark(X1), X2) → mark(divides(X1, X2))
divides(X1, mark(X2)) → mark(divides(X1, X2))
proper(primes) → ok(primes)
proper(sieve(X)) → sieve(proper(X))
proper(from(X)) → from(proper(X))
proper(s(X)) → s(proper(X))
proper(0) → ok(0)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(head(X)) → head(proper(X))
proper(tail(X)) → tail(proper(X))
proper(if(X1, X2, X3)) → if(proper(X1), proper(X2), proper(X3))
proper(true) → ok(true)
proper(false) → ok(false)
proper(filter(X1, X2)) → filter(proper(X1), proper(X2))
proper(divides(X1, X2)) → divides(proper(X1), proper(X2))
sieve(ok(X)) → ok(sieve(X))
from(ok(X)) → ok(from(X))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
head(ok(X)) → ok(head(X))
tail(ok(X)) → ok(tail(X))
if(ok(X1), ok(X2), ok(X3)) → ok(if(X1, X2, X3))
filter(ok(X1), ok(X2)) → ok(filter(X1, X2))
divides(ok(X1), ok(X2)) → ok(divides(X1, X2))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

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

(54) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


S(ok(X)) → S(X)
The remaining pairs can at least be oriented weakly.
Used ordering: Combined order from the following AFS and order.
S(x1)  =  x1
ok(x1)  =  ok(x1)
active(x1)  =  active(x1)
primes  =  primes
mark(x1)  =  mark
sieve(x1)  =  x1
from(x1)  =  x1
s(x1)  =  s(x1)
0  =  0
cons(x1, x2)  =  x1
head(x1)  =  head(x1)
tail(x1)  =  tail(x1)
if(x1, x2, x3)  =  if(x2, x3)
true  =  true
false  =  false
filter(x1, x2)  =  filter(x1, x2)
divides(x1, x2)  =  divides(x1)
proper(x1)  =  proper(x1)
top(x1)  =  top

Recursive Path Order [RPO].
Precedence:
0 > ok1
proper1 > primes > s1 > ok1
proper1 > if2 > active1 > head1 > mark > s1 > ok1
proper1 > if2 > active1 > head1 > mark > tail1 > ok1
proper1 > if2 > active1 > head1 > mark > filter2 > ok1
proper1 > if2 > active1 > divides1 > mark > s1 > ok1
proper1 > if2 > active1 > divides1 > mark > tail1 > ok1
proper1 > if2 > active1 > divides1 > mark > filter2 > ok1
proper1 > true
proper1 > false
top > active1 > head1 > mark > s1 > ok1
top > active1 > head1 > mark > tail1 > ok1
top > active1 > head1 > mark > filter2 > ok1
top > active1 > divides1 > mark > s1 > ok1
top > active1 > divides1 > mark > tail1 > ok1
top > active1 > divides1 > mark > filter2 > ok1

The following usable rules [FROCOS05] were oriented:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
active(sieve(X)) → sieve(active(X))
active(from(X)) → from(active(X))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(head(X)) → head(active(X))
active(tail(X)) → tail(active(X))
active(if(X1, X2, X3)) → if(active(X1), X2, X3)
active(filter(X1, X2)) → filter(active(X1), X2)
active(filter(X1, X2)) → filter(X1, active(X2))
active(divides(X1, X2)) → divides(active(X1), X2)
active(divides(X1, X2)) → divides(X1, active(X2))
sieve(mark(X)) → mark(sieve(X))
from(mark(X)) → mark(from(X))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
head(mark(X)) → mark(head(X))
tail(mark(X)) → mark(tail(X))
if(mark(X1), X2, X3) → mark(if(X1, X2, X3))
filter(mark(X1), X2) → mark(filter(X1, X2))
filter(X1, mark(X2)) → mark(filter(X1, X2))
divides(mark(X1), X2) → mark(divides(X1, X2))
divides(X1, mark(X2)) → mark(divides(X1, X2))
proper(primes) → ok(primes)
proper(sieve(X)) → sieve(proper(X))
proper(from(X)) → from(proper(X))
proper(s(X)) → s(proper(X))
proper(0) → ok(0)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(head(X)) → head(proper(X))
proper(tail(X)) → tail(proper(X))
proper(if(X1, X2, X3)) → if(proper(X1), proper(X2), proper(X3))
proper(true) → ok(true)
proper(false) → ok(false)
proper(filter(X1, X2)) → filter(proper(X1), proper(X2))
proper(divides(X1, X2)) → divides(proper(X1), proper(X2))
sieve(ok(X)) → ok(sieve(X))
from(ok(X)) → ok(from(X))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
head(ok(X)) → ok(head(X))
tail(ok(X)) → ok(tail(X))
if(ok(X1), ok(X2), ok(X3)) → ok(if(X1, X2, X3))
filter(ok(X1), ok(X2)) → ok(filter(X1, X2))
divides(ok(X1), ok(X2)) → ok(divides(X1, X2))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

(55) Obligation:

Q DP problem:
P is empty.
The TRS R consists of the following rules:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
active(sieve(X)) → sieve(active(X))
active(from(X)) → from(active(X))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(head(X)) → head(active(X))
active(tail(X)) → tail(active(X))
active(if(X1, X2, X3)) → if(active(X1), X2, X3)
active(filter(X1, X2)) → filter(active(X1), X2)
active(filter(X1, X2)) → filter(X1, active(X2))
active(divides(X1, X2)) → divides(active(X1), X2)
active(divides(X1, X2)) → divides(X1, active(X2))
sieve(mark(X)) → mark(sieve(X))
from(mark(X)) → mark(from(X))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
head(mark(X)) → mark(head(X))
tail(mark(X)) → mark(tail(X))
if(mark(X1), X2, X3) → mark(if(X1, X2, X3))
filter(mark(X1), X2) → mark(filter(X1, X2))
filter(X1, mark(X2)) → mark(filter(X1, X2))
divides(mark(X1), X2) → mark(divides(X1, X2))
divides(X1, mark(X2)) → mark(divides(X1, X2))
proper(primes) → ok(primes)
proper(sieve(X)) → sieve(proper(X))
proper(from(X)) → from(proper(X))
proper(s(X)) → s(proper(X))
proper(0) → ok(0)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(head(X)) → head(proper(X))
proper(tail(X)) → tail(proper(X))
proper(if(X1, X2, X3)) → if(proper(X1), proper(X2), proper(X3))
proper(true) → ok(true)
proper(false) → ok(false)
proper(filter(X1, X2)) → filter(proper(X1), proper(X2))
proper(divides(X1, X2)) → divides(proper(X1), proper(X2))
sieve(ok(X)) → ok(sieve(X))
from(ok(X)) → ok(from(X))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
head(ok(X)) → ok(head(X))
tail(ok(X)) → ok(tail(X))
if(ok(X1), ok(X2), ok(X3)) → ok(if(X1, X2, X3))
filter(ok(X1), ok(X2)) → ok(filter(X1, X2))
divides(ok(X1), ok(X2)) → ok(divides(X1, X2))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

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

(56) PisEmptyProof (EQUIVALENT transformation)

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

(57) TRUE

(58) Obligation:

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

FROM(ok(X)) → FROM(X)
FROM(mark(X)) → FROM(X)

The TRS R consists of the following rules:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
active(sieve(X)) → sieve(active(X))
active(from(X)) → from(active(X))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(head(X)) → head(active(X))
active(tail(X)) → tail(active(X))
active(if(X1, X2, X3)) → if(active(X1), X2, X3)
active(filter(X1, X2)) → filter(active(X1), X2)
active(filter(X1, X2)) → filter(X1, active(X2))
active(divides(X1, X2)) → divides(active(X1), X2)
active(divides(X1, X2)) → divides(X1, active(X2))
sieve(mark(X)) → mark(sieve(X))
from(mark(X)) → mark(from(X))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
head(mark(X)) → mark(head(X))
tail(mark(X)) → mark(tail(X))
if(mark(X1), X2, X3) → mark(if(X1, X2, X3))
filter(mark(X1), X2) → mark(filter(X1, X2))
filter(X1, mark(X2)) → mark(filter(X1, X2))
divides(mark(X1), X2) → mark(divides(X1, X2))
divides(X1, mark(X2)) → mark(divides(X1, X2))
proper(primes) → ok(primes)
proper(sieve(X)) → sieve(proper(X))
proper(from(X)) → from(proper(X))
proper(s(X)) → s(proper(X))
proper(0) → ok(0)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(head(X)) → head(proper(X))
proper(tail(X)) → tail(proper(X))
proper(if(X1, X2, X3)) → if(proper(X1), proper(X2), proper(X3))
proper(true) → ok(true)
proper(false) → ok(false)
proper(filter(X1, X2)) → filter(proper(X1), proper(X2))
proper(divides(X1, X2)) → divides(proper(X1), proper(X2))
sieve(ok(X)) → ok(sieve(X))
from(ok(X)) → ok(from(X))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
head(ok(X)) → ok(head(X))
tail(ok(X)) → ok(tail(X))
if(ok(X1), ok(X2), ok(X3)) → ok(if(X1, X2, X3))
filter(ok(X1), ok(X2)) → ok(filter(X1, X2))
divides(ok(X1), ok(X2)) → ok(divides(X1, X2))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

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

(59) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


FROM(mark(X)) → FROM(X)
The remaining pairs can at least be oriented weakly.
Used ordering: Combined order from the following AFS and order.
FROM(x1)  =  x1
ok(x1)  =  x1
mark(x1)  =  mark(x1)
active(x1)  =  active(x1)
primes  =  primes
sieve(x1)  =  sieve(x1)
from(x1)  =  x1
s(x1)  =  x1
0  =  0
cons(x1, x2)  =  cons(x1, x2)
head(x1)  =  x1
tail(x1)  =  x1
if(x1, x2, x3)  =  if(x1, x2, x3)
true  =  true
false  =  false
filter(x1, x2)  =  filter(x1, x2)
divides(x1, x2)  =  divides(x1, x2)
proper(x1)  =  proper(x1)
top(x1)  =  top

Recursive Path Order [RPO].
Precedence:
true > mark1
false > mark1
proper1 > primes > sieve1 > cons2 > filter2 > mark1
proper1 > primes > sieve1 > cons2 > divides2 > mark1
proper1 > primes > 0 > mark1
proper1 > if3 > mark1
top > active1 > sieve1 > cons2 > filter2 > mark1
top > active1 > sieve1 > cons2 > divides2 > mark1
top > active1 > 0 > mark1
top > active1 > if3 > mark1

The following usable rules [FROCOS05] were oriented:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
active(sieve(X)) → sieve(active(X))
active(from(X)) → from(active(X))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(head(X)) → head(active(X))
active(tail(X)) → tail(active(X))
active(if(X1, X2, X3)) → if(active(X1), X2, X3)
active(filter(X1, X2)) → filter(active(X1), X2)
active(filter(X1, X2)) → filter(X1, active(X2))
active(divides(X1, X2)) → divides(active(X1), X2)
active(divides(X1, X2)) → divides(X1, active(X2))
sieve(mark(X)) → mark(sieve(X))
from(mark(X)) → mark(from(X))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
head(mark(X)) → mark(head(X))
tail(mark(X)) → mark(tail(X))
if(mark(X1), X2, X3) → mark(if(X1, X2, X3))
filter(mark(X1), X2) → mark(filter(X1, X2))
filter(X1, mark(X2)) → mark(filter(X1, X2))
divides(mark(X1), X2) → mark(divides(X1, X2))
divides(X1, mark(X2)) → mark(divides(X1, X2))
proper(primes) → ok(primes)
proper(sieve(X)) → sieve(proper(X))
proper(from(X)) → from(proper(X))
proper(s(X)) → s(proper(X))
proper(0) → ok(0)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(head(X)) → head(proper(X))
proper(tail(X)) → tail(proper(X))
proper(if(X1, X2, X3)) → if(proper(X1), proper(X2), proper(X3))
proper(true) → ok(true)
proper(false) → ok(false)
proper(filter(X1, X2)) → filter(proper(X1), proper(X2))
proper(divides(X1, X2)) → divides(proper(X1), proper(X2))
sieve(ok(X)) → ok(sieve(X))
from(ok(X)) → ok(from(X))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
head(ok(X)) → ok(head(X))
tail(ok(X)) → ok(tail(X))
if(ok(X1), ok(X2), ok(X3)) → ok(if(X1, X2, X3))
filter(ok(X1), ok(X2)) → ok(filter(X1, X2))
divides(ok(X1), ok(X2)) → ok(divides(X1, X2))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

(60) Obligation:

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

FROM(ok(X)) → FROM(X)

The TRS R consists of the following rules:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
active(sieve(X)) → sieve(active(X))
active(from(X)) → from(active(X))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(head(X)) → head(active(X))
active(tail(X)) → tail(active(X))
active(if(X1, X2, X3)) → if(active(X1), X2, X3)
active(filter(X1, X2)) → filter(active(X1), X2)
active(filter(X1, X2)) → filter(X1, active(X2))
active(divides(X1, X2)) → divides(active(X1), X2)
active(divides(X1, X2)) → divides(X1, active(X2))
sieve(mark(X)) → mark(sieve(X))
from(mark(X)) → mark(from(X))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
head(mark(X)) → mark(head(X))
tail(mark(X)) → mark(tail(X))
if(mark(X1), X2, X3) → mark(if(X1, X2, X3))
filter(mark(X1), X2) → mark(filter(X1, X2))
filter(X1, mark(X2)) → mark(filter(X1, X2))
divides(mark(X1), X2) → mark(divides(X1, X2))
divides(X1, mark(X2)) → mark(divides(X1, X2))
proper(primes) → ok(primes)
proper(sieve(X)) → sieve(proper(X))
proper(from(X)) → from(proper(X))
proper(s(X)) → s(proper(X))
proper(0) → ok(0)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(head(X)) → head(proper(X))
proper(tail(X)) → tail(proper(X))
proper(if(X1, X2, X3)) → if(proper(X1), proper(X2), proper(X3))
proper(true) → ok(true)
proper(false) → ok(false)
proper(filter(X1, X2)) → filter(proper(X1), proper(X2))
proper(divides(X1, X2)) → divides(proper(X1), proper(X2))
sieve(ok(X)) → ok(sieve(X))
from(ok(X)) → ok(from(X))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
head(ok(X)) → ok(head(X))
tail(ok(X)) → ok(tail(X))
if(ok(X1), ok(X2), ok(X3)) → ok(if(X1, X2, X3))
filter(ok(X1), ok(X2)) → ok(filter(X1, X2))
divides(ok(X1), ok(X2)) → ok(divides(X1, X2))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

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

(61) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


FROM(ok(X)) → FROM(X)
The remaining pairs can at least be oriented weakly.
Used ordering: Combined order from the following AFS and order.
FROM(x1)  =  x1
ok(x1)  =  ok(x1)
active(x1)  =  active(x1)
primes  =  primes
mark(x1)  =  mark
sieve(x1)  =  x1
from(x1)  =  x1
s(x1)  =  s(x1)
0  =  0
cons(x1, x2)  =  x1
head(x1)  =  head(x1)
tail(x1)  =  tail(x1)
if(x1, x2, x3)  =  if(x2, x3)
true  =  true
false  =  false
filter(x1, x2)  =  filter(x1, x2)
divides(x1, x2)  =  divides(x1)
proper(x1)  =  proper(x1)
top(x1)  =  top

Recursive Path Order [RPO].
Precedence:
0 > ok1
proper1 > primes > s1 > ok1
proper1 > if2 > active1 > head1 > mark > s1 > ok1
proper1 > if2 > active1 > head1 > mark > tail1 > ok1
proper1 > if2 > active1 > head1 > mark > filter2 > ok1
proper1 > if2 > active1 > divides1 > mark > s1 > ok1
proper1 > if2 > active1 > divides1 > mark > tail1 > ok1
proper1 > if2 > active1 > divides1 > mark > filter2 > ok1
proper1 > true
proper1 > false
top > active1 > head1 > mark > s1 > ok1
top > active1 > head1 > mark > tail1 > ok1
top > active1 > head1 > mark > filter2 > ok1
top > active1 > divides1 > mark > s1 > ok1
top > active1 > divides1 > mark > tail1 > ok1
top > active1 > divides1 > mark > filter2 > ok1

The following usable rules [FROCOS05] were oriented:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
active(sieve(X)) → sieve(active(X))
active(from(X)) → from(active(X))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(head(X)) → head(active(X))
active(tail(X)) → tail(active(X))
active(if(X1, X2, X3)) → if(active(X1), X2, X3)
active(filter(X1, X2)) → filter(active(X1), X2)
active(filter(X1, X2)) → filter(X1, active(X2))
active(divides(X1, X2)) → divides(active(X1), X2)
active(divides(X1, X2)) → divides(X1, active(X2))
sieve(mark(X)) → mark(sieve(X))
from(mark(X)) → mark(from(X))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
head(mark(X)) → mark(head(X))
tail(mark(X)) → mark(tail(X))
if(mark(X1), X2, X3) → mark(if(X1, X2, X3))
filter(mark(X1), X2) → mark(filter(X1, X2))
filter(X1, mark(X2)) → mark(filter(X1, X2))
divides(mark(X1), X2) → mark(divides(X1, X2))
divides(X1, mark(X2)) → mark(divides(X1, X2))
proper(primes) → ok(primes)
proper(sieve(X)) → sieve(proper(X))
proper(from(X)) → from(proper(X))
proper(s(X)) → s(proper(X))
proper(0) → ok(0)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(head(X)) → head(proper(X))
proper(tail(X)) → tail(proper(X))
proper(if(X1, X2, X3)) → if(proper(X1), proper(X2), proper(X3))
proper(true) → ok(true)
proper(false) → ok(false)
proper(filter(X1, X2)) → filter(proper(X1), proper(X2))
proper(divides(X1, X2)) → divides(proper(X1), proper(X2))
sieve(ok(X)) → ok(sieve(X))
from(ok(X)) → ok(from(X))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
head(ok(X)) → ok(head(X))
tail(ok(X)) → ok(tail(X))
if(ok(X1), ok(X2), ok(X3)) → ok(if(X1, X2, X3))
filter(ok(X1), ok(X2)) → ok(filter(X1, X2))
divides(ok(X1), ok(X2)) → ok(divides(X1, X2))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

(62) Obligation:

Q DP problem:
P is empty.
The TRS R consists of the following rules:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
active(sieve(X)) → sieve(active(X))
active(from(X)) → from(active(X))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(head(X)) → head(active(X))
active(tail(X)) → tail(active(X))
active(if(X1, X2, X3)) → if(active(X1), X2, X3)
active(filter(X1, X2)) → filter(active(X1), X2)
active(filter(X1, X2)) → filter(X1, active(X2))
active(divides(X1, X2)) → divides(active(X1), X2)
active(divides(X1, X2)) → divides(X1, active(X2))
sieve(mark(X)) → mark(sieve(X))
from(mark(X)) → mark(from(X))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
head(mark(X)) → mark(head(X))
tail(mark(X)) → mark(tail(X))
if(mark(X1), X2, X3) → mark(if(X1, X2, X3))
filter(mark(X1), X2) → mark(filter(X1, X2))
filter(X1, mark(X2)) → mark(filter(X1, X2))
divides(mark(X1), X2) → mark(divides(X1, X2))
divides(X1, mark(X2)) → mark(divides(X1, X2))
proper(primes) → ok(primes)
proper(sieve(X)) → sieve(proper(X))
proper(from(X)) → from(proper(X))
proper(s(X)) → s(proper(X))
proper(0) → ok(0)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(head(X)) → head(proper(X))
proper(tail(X)) → tail(proper(X))
proper(if(X1, X2, X3)) → if(proper(X1), proper(X2), proper(X3))
proper(true) → ok(true)
proper(false) → ok(false)
proper(filter(X1, X2)) → filter(proper(X1), proper(X2))
proper(divides(X1, X2)) → divides(proper(X1), proper(X2))
sieve(ok(X)) → ok(sieve(X))
from(ok(X)) → ok(from(X))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
head(ok(X)) → ok(head(X))
tail(ok(X)) → ok(tail(X))
if(ok(X1), ok(X2), ok(X3)) → ok(if(X1, X2, X3))
filter(ok(X1), ok(X2)) → ok(filter(X1, X2))
divides(ok(X1), ok(X2)) → ok(divides(X1, X2))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

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

(63) PisEmptyProof (EQUIVALENT transformation)

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

(64) TRUE

(65) Obligation:

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

SIEVE(ok(X)) → SIEVE(X)
SIEVE(mark(X)) → SIEVE(X)

The TRS R consists of the following rules:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
active(sieve(X)) → sieve(active(X))
active(from(X)) → from(active(X))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(head(X)) → head(active(X))
active(tail(X)) → tail(active(X))
active(if(X1, X2, X3)) → if(active(X1), X2, X3)
active(filter(X1, X2)) → filter(active(X1), X2)
active(filter(X1, X2)) → filter(X1, active(X2))
active(divides(X1, X2)) → divides(active(X1), X2)
active(divides(X1, X2)) → divides(X1, active(X2))
sieve(mark(X)) → mark(sieve(X))
from(mark(X)) → mark(from(X))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
head(mark(X)) → mark(head(X))
tail(mark(X)) → mark(tail(X))
if(mark(X1), X2, X3) → mark(if(X1, X2, X3))
filter(mark(X1), X2) → mark(filter(X1, X2))
filter(X1, mark(X2)) → mark(filter(X1, X2))
divides(mark(X1), X2) → mark(divides(X1, X2))
divides(X1, mark(X2)) → mark(divides(X1, X2))
proper(primes) → ok(primes)
proper(sieve(X)) → sieve(proper(X))
proper(from(X)) → from(proper(X))
proper(s(X)) → s(proper(X))
proper(0) → ok(0)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(head(X)) → head(proper(X))
proper(tail(X)) → tail(proper(X))
proper(if(X1, X2, X3)) → if(proper(X1), proper(X2), proper(X3))
proper(true) → ok(true)
proper(false) → ok(false)
proper(filter(X1, X2)) → filter(proper(X1), proper(X2))
proper(divides(X1, X2)) → divides(proper(X1), proper(X2))
sieve(ok(X)) → ok(sieve(X))
from(ok(X)) → ok(from(X))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
head(ok(X)) → ok(head(X))
tail(ok(X)) → ok(tail(X))
if(ok(X1), ok(X2), ok(X3)) → ok(if(X1, X2, X3))
filter(ok(X1), ok(X2)) → ok(filter(X1, X2))
divides(ok(X1), ok(X2)) → ok(divides(X1, X2))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

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

(66) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


SIEVE(mark(X)) → SIEVE(X)
The remaining pairs can at least be oriented weakly.
Used ordering: Combined order from the following AFS and order.
SIEVE(x1)  =  x1
ok(x1)  =  x1
mark(x1)  =  mark(x1)
active(x1)  =  active(x1)
primes  =  primes
sieve(x1)  =  sieve(x1)
from(x1)  =  x1
s(x1)  =  x1
0  =  0
cons(x1, x2)  =  cons(x1, x2)
head(x1)  =  x1
tail(x1)  =  x1
if(x1, x2, x3)  =  if(x1, x2, x3)
true  =  true
false  =  false
filter(x1, x2)  =  filter(x1, x2)
divides(x1, x2)  =  divides(x1, x2)
proper(x1)  =  proper(x1)
top(x1)  =  top

Recursive Path Order [RPO].
Precedence:
true > mark1
false > mark1
proper1 > primes > sieve1 > cons2 > filter2 > mark1
proper1 > primes > sieve1 > cons2 > divides2 > mark1
proper1 > primes > 0 > mark1
proper1 > if3 > mark1
top > active1 > sieve1 > cons2 > filter2 > mark1
top > active1 > sieve1 > cons2 > divides2 > mark1
top > active1 > 0 > mark1
top > active1 > if3 > mark1

The following usable rules [FROCOS05] were oriented:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
active(sieve(X)) → sieve(active(X))
active(from(X)) → from(active(X))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(head(X)) → head(active(X))
active(tail(X)) → tail(active(X))
active(if(X1, X2, X3)) → if(active(X1), X2, X3)
active(filter(X1, X2)) → filter(active(X1), X2)
active(filter(X1, X2)) → filter(X1, active(X2))
active(divides(X1, X2)) → divides(active(X1), X2)
active(divides(X1, X2)) → divides(X1, active(X2))
sieve(mark(X)) → mark(sieve(X))
from(mark(X)) → mark(from(X))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
head(mark(X)) → mark(head(X))
tail(mark(X)) → mark(tail(X))
if(mark(X1), X2, X3) → mark(if(X1, X2, X3))
filter(mark(X1), X2) → mark(filter(X1, X2))
filter(X1, mark(X2)) → mark(filter(X1, X2))
divides(mark(X1), X2) → mark(divides(X1, X2))
divides(X1, mark(X2)) → mark(divides(X1, X2))
proper(primes) → ok(primes)
proper(sieve(X)) → sieve(proper(X))
proper(from(X)) → from(proper(X))
proper(s(X)) → s(proper(X))
proper(0) → ok(0)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(head(X)) → head(proper(X))
proper(tail(X)) → tail(proper(X))
proper(if(X1, X2, X3)) → if(proper(X1), proper(X2), proper(X3))
proper(true) → ok(true)
proper(false) → ok(false)
proper(filter(X1, X2)) → filter(proper(X1), proper(X2))
proper(divides(X1, X2)) → divides(proper(X1), proper(X2))
sieve(ok(X)) → ok(sieve(X))
from(ok(X)) → ok(from(X))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
head(ok(X)) → ok(head(X))
tail(ok(X)) → ok(tail(X))
if(ok(X1), ok(X2), ok(X3)) → ok(if(X1, X2, X3))
filter(ok(X1), ok(X2)) → ok(filter(X1, X2))
divides(ok(X1), ok(X2)) → ok(divides(X1, X2))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

(67) Obligation:

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

SIEVE(ok(X)) → SIEVE(X)

The TRS R consists of the following rules:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
active(sieve(X)) → sieve(active(X))
active(from(X)) → from(active(X))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(head(X)) → head(active(X))
active(tail(X)) → tail(active(X))
active(if(X1, X2, X3)) → if(active(X1), X2, X3)
active(filter(X1, X2)) → filter(active(X1), X2)
active(filter(X1, X2)) → filter(X1, active(X2))
active(divides(X1, X2)) → divides(active(X1), X2)
active(divides(X1, X2)) → divides(X1, active(X2))
sieve(mark(X)) → mark(sieve(X))
from(mark(X)) → mark(from(X))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
head(mark(X)) → mark(head(X))
tail(mark(X)) → mark(tail(X))
if(mark(X1), X2, X3) → mark(if(X1, X2, X3))
filter(mark(X1), X2) → mark(filter(X1, X2))
filter(X1, mark(X2)) → mark(filter(X1, X2))
divides(mark(X1), X2) → mark(divides(X1, X2))
divides(X1, mark(X2)) → mark(divides(X1, X2))
proper(primes) → ok(primes)
proper(sieve(X)) → sieve(proper(X))
proper(from(X)) → from(proper(X))
proper(s(X)) → s(proper(X))
proper(0) → ok(0)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(head(X)) → head(proper(X))
proper(tail(X)) → tail(proper(X))
proper(if(X1, X2, X3)) → if(proper(X1), proper(X2), proper(X3))
proper(true) → ok(true)
proper(false) → ok(false)
proper(filter(X1, X2)) → filter(proper(X1), proper(X2))
proper(divides(X1, X2)) → divides(proper(X1), proper(X2))
sieve(ok(X)) → ok(sieve(X))
from(ok(X)) → ok(from(X))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
head(ok(X)) → ok(head(X))
tail(ok(X)) → ok(tail(X))
if(ok(X1), ok(X2), ok(X3)) → ok(if(X1, X2, X3))
filter(ok(X1), ok(X2)) → ok(filter(X1, X2))
divides(ok(X1), ok(X2)) → ok(divides(X1, X2))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

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

(68) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


SIEVE(ok(X)) → SIEVE(X)
The remaining pairs can at least be oriented weakly.
Used ordering: Combined order from the following AFS and order.
SIEVE(x1)  =  x1
ok(x1)  =  ok(x1)
active(x1)  =  active(x1)
primes  =  primes
mark(x1)  =  mark
sieve(x1)  =  x1
from(x1)  =  x1
s(x1)  =  s(x1)
0  =  0
cons(x1, x2)  =  x1
head(x1)  =  head(x1)
tail(x1)  =  tail(x1)
if(x1, x2, x3)  =  if(x2, x3)
true  =  true
false  =  false
filter(x1, x2)  =  filter(x1, x2)
divides(x1, x2)  =  divides(x1)
proper(x1)  =  proper(x1)
top(x1)  =  top

Recursive Path Order [RPO].
Precedence:
0 > ok1
proper1 > primes > s1 > ok1
proper1 > if2 > active1 > head1 > mark > s1 > ok1
proper1 > if2 > active1 > head1 > mark > tail1 > ok1
proper1 > if2 > active1 > head1 > mark > filter2 > ok1
proper1 > if2 > active1 > divides1 > mark > s1 > ok1
proper1 > if2 > active1 > divides1 > mark > tail1 > ok1
proper1 > if2 > active1 > divides1 > mark > filter2 > ok1
proper1 > true
proper1 > false
top > active1 > head1 > mark > s1 > ok1
top > active1 > head1 > mark > tail1 > ok1
top > active1 > head1 > mark > filter2 > ok1
top > active1 > divides1 > mark > s1 > ok1
top > active1 > divides1 > mark > tail1 > ok1
top > active1 > divides1 > mark > filter2 > ok1

The following usable rules [FROCOS05] were oriented:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
active(sieve(X)) → sieve(active(X))
active(from(X)) → from(active(X))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(head(X)) → head(active(X))
active(tail(X)) → tail(active(X))
active(if(X1, X2, X3)) → if(active(X1), X2, X3)
active(filter(X1, X2)) → filter(active(X1), X2)
active(filter(X1, X2)) → filter(X1, active(X2))
active(divides(X1, X2)) → divides(active(X1), X2)
active(divides(X1, X2)) → divides(X1, active(X2))
sieve(mark(X)) → mark(sieve(X))
from(mark(X)) → mark(from(X))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
head(mark(X)) → mark(head(X))
tail(mark(X)) → mark(tail(X))
if(mark(X1), X2, X3) → mark(if(X1, X2, X3))
filter(mark(X1), X2) → mark(filter(X1, X2))
filter(X1, mark(X2)) → mark(filter(X1, X2))
divides(mark(X1), X2) → mark(divides(X1, X2))
divides(X1, mark(X2)) → mark(divides(X1, X2))
proper(primes) → ok(primes)
proper(sieve(X)) → sieve(proper(X))
proper(from(X)) → from(proper(X))
proper(s(X)) → s(proper(X))
proper(0) → ok(0)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(head(X)) → head(proper(X))
proper(tail(X)) → tail(proper(X))
proper(if(X1, X2, X3)) → if(proper(X1), proper(X2), proper(X3))
proper(true) → ok(true)
proper(false) → ok(false)
proper(filter(X1, X2)) → filter(proper(X1), proper(X2))
proper(divides(X1, X2)) → divides(proper(X1), proper(X2))
sieve(ok(X)) → ok(sieve(X))
from(ok(X)) → ok(from(X))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
head(ok(X)) → ok(head(X))
tail(ok(X)) → ok(tail(X))
if(ok(X1), ok(X2), ok(X3)) → ok(if(X1, X2, X3))
filter(ok(X1), ok(X2)) → ok(filter(X1, X2))
divides(ok(X1), ok(X2)) → ok(divides(X1, X2))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

(69) Obligation:

Q DP problem:
P is empty.
The TRS R consists of the following rules:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
active(sieve(X)) → sieve(active(X))
active(from(X)) → from(active(X))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(head(X)) → head(active(X))
active(tail(X)) → tail(active(X))
active(if(X1, X2, X3)) → if(active(X1), X2, X3)
active(filter(X1, X2)) → filter(active(X1), X2)
active(filter(X1, X2)) → filter(X1, active(X2))
active(divides(X1, X2)) → divides(active(X1), X2)
active(divides(X1, X2)) → divides(X1, active(X2))
sieve(mark(X)) → mark(sieve(X))
from(mark(X)) → mark(from(X))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
head(mark(X)) → mark(head(X))
tail(mark(X)) → mark(tail(X))
if(mark(X1), X2, X3) → mark(if(X1, X2, X3))
filter(mark(X1), X2) → mark(filter(X1, X2))
filter(X1, mark(X2)) → mark(filter(X1, X2))
divides(mark(X1), X2) → mark(divides(X1, X2))
divides(X1, mark(X2)) → mark(divides(X1, X2))
proper(primes) → ok(primes)
proper(sieve(X)) → sieve(proper(X))
proper(from(X)) → from(proper(X))
proper(s(X)) → s(proper(X))
proper(0) → ok(0)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(head(X)) → head(proper(X))
proper(tail(X)) → tail(proper(X))
proper(if(X1, X2, X3)) → if(proper(X1), proper(X2), proper(X3))
proper(true) → ok(true)
proper(false) → ok(false)
proper(filter(X1, X2)) → filter(proper(X1), proper(X2))
proper(divides(X1, X2)) → divides(proper(X1), proper(X2))
sieve(ok(X)) → ok(sieve(X))
from(ok(X)) → ok(from(X))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
head(ok(X)) → ok(head(X))
tail(ok(X)) → ok(tail(X))
if(ok(X1), ok(X2), ok(X3)) → ok(if(X1, X2, X3))
filter(ok(X1), ok(X2)) → ok(filter(X1, X2))
divides(ok(X1), ok(X2)) → ok(divides(X1, X2))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

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

(70) PisEmptyProof (EQUIVALENT transformation)

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

(71) TRUE

(72) Obligation:

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

PROPER(from(X)) → PROPER(X)
PROPER(sieve(X)) → PROPER(X)
PROPER(s(X)) → PROPER(X)
PROPER(cons(X1, X2)) → PROPER(X1)
PROPER(cons(X1, X2)) → PROPER(X2)
PROPER(head(X)) → PROPER(X)
PROPER(tail(X)) → PROPER(X)
PROPER(if(X1, X2, X3)) → PROPER(X1)
PROPER(if(X1, X2, X3)) → PROPER(X2)
PROPER(if(X1, X2, X3)) → PROPER(X3)
PROPER(filter(X1, X2)) → PROPER(X1)
PROPER(filter(X1, X2)) → PROPER(X2)
PROPER(divides(X1, X2)) → PROPER(X1)
PROPER(divides(X1, X2)) → PROPER(X2)

The TRS R consists of the following rules:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
active(sieve(X)) → sieve(active(X))
active(from(X)) → from(active(X))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(head(X)) → head(active(X))
active(tail(X)) → tail(active(X))
active(if(X1, X2, X3)) → if(active(X1), X2, X3)
active(filter(X1, X2)) → filter(active(X1), X2)
active(filter(X1, X2)) → filter(X1, active(X2))
active(divides(X1, X2)) → divides(active(X1), X2)
active(divides(X1, X2)) → divides(X1, active(X2))
sieve(mark(X)) → mark(sieve(X))
from(mark(X)) → mark(from(X))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
head(mark(X)) → mark(head(X))
tail(mark(X)) → mark(tail(X))
if(mark(X1), X2, X3) → mark(if(X1, X2, X3))
filter(mark(X1), X2) → mark(filter(X1, X2))
filter(X1, mark(X2)) → mark(filter(X1, X2))
divides(mark(X1), X2) → mark(divides(X1, X2))
divides(X1, mark(X2)) → mark(divides(X1, X2))
proper(primes) → ok(primes)
proper(sieve(X)) → sieve(proper(X))
proper(from(X)) → from(proper(X))
proper(s(X)) → s(proper(X))
proper(0) → ok(0)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(head(X)) → head(proper(X))
proper(tail(X)) → tail(proper(X))
proper(if(X1, X2, X3)) → if(proper(X1), proper(X2), proper(X3))
proper(true) → ok(true)
proper(false) → ok(false)
proper(filter(X1, X2)) → filter(proper(X1), proper(X2))
proper(divides(X1, X2)) → divides(proper(X1), proper(X2))
sieve(ok(X)) → ok(sieve(X))
from(ok(X)) → ok(from(X))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
head(ok(X)) → ok(head(X))
tail(ok(X)) → ok(tail(X))
if(ok(X1), ok(X2), ok(X3)) → ok(if(X1, X2, X3))
filter(ok(X1), ok(X2)) → ok(filter(X1, X2))
divides(ok(X1), ok(X2)) → ok(divides(X1, X2))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

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

(73) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


PROPER(cons(X1, X2)) → PROPER(X1)
PROPER(cons(X1, X2)) → PROPER(X2)
PROPER(head(X)) → PROPER(X)
PROPER(if(X1, X2, X3)) → PROPER(X1)
PROPER(if(X1, X2, X3)) → PROPER(X2)
PROPER(if(X1, X2, X3)) → PROPER(X3)
PROPER(filter(X1, X2)) → PROPER(X1)
PROPER(filter(X1, X2)) → PROPER(X2)
PROPER(divides(X1, X2)) → PROPER(X1)
PROPER(divides(X1, X2)) → PROPER(X2)
The remaining pairs can at least be oriented weakly.
Used ordering: Combined order from the following AFS and order.
PROPER(x1)  =  x1
from(x1)  =  x1
sieve(x1)  =  x1
s(x1)  =  x1
cons(x1, x2)  =  cons(x1, x2)
head(x1)  =  head(x1)
tail(x1)  =  x1
if(x1, x2, x3)  =  if(x1, x2, x3)
filter(x1, x2)  =  filter(x1, x2)
divides(x1, x2)  =  divides(x1, x2)
active(x1)  =  active(x1)
primes  =  primes
mark(x1)  =  mark
0  =  0
true  =  true
false  =  false
proper(x1)  =  proper(x1)
ok(x1)  =  x1
top(x1)  =  top

Recursive Path Order [RPO].
Precedence:
primes > mark > proper1 > head1
primes > mark > proper1 > if3
primes > mark > proper1 > filter2 > cons2
primes > mark > proper1 > divides2
primes > mark > proper1 > 0
true > mark > proper1 > head1
true > mark > proper1 > if3
true > mark > proper1 > filter2 > cons2
true > mark > proper1 > divides2
true > mark > proper1 > 0
false > mark > proper1 > head1
false > mark > proper1 > if3
false > mark > proper1 > filter2 > cons2
false > mark > proper1 > divides2
false > mark > proper1 > 0
top > active1 > mark > proper1 > head1
top > active1 > mark > proper1 > if3
top > active1 > mark > proper1 > filter2 > cons2
top > active1 > mark > proper1 > divides2
top > active1 > mark > proper1 > 0

The following usable rules [FROCOS05] were oriented:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
active(sieve(X)) → sieve(active(X))
active(from(X)) → from(active(X))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(head(X)) → head(active(X))
active(tail(X)) → tail(active(X))
active(if(X1, X2, X3)) → if(active(X1), X2, X3)
active(filter(X1, X2)) → filter(active(X1), X2)
active(filter(X1, X2)) → filter(X1, active(X2))
active(divides(X1, X2)) → divides(active(X1), X2)
active(divides(X1, X2)) → divides(X1, active(X2))
sieve(mark(X)) → mark(sieve(X))
from(mark(X)) → mark(from(X))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
head(mark(X)) → mark(head(X))
tail(mark(X)) → mark(tail(X))
if(mark(X1), X2, X3) → mark(if(X1, X2, X3))
filter(mark(X1), X2) → mark(filter(X1, X2))
filter(X1, mark(X2)) → mark(filter(X1, X2))
divides(mark(X1), X2) → mark(divides(X1, X2))
divides(X1, mark(X2)) → mark(divides(X1, X2))
proper(primes) → ok(primes)
proper(sieve(X)) → sieve(proper(X))
proper(from(X)) → from(proper(X))
proper(s(X)) → s(proper(X))
proper(0) → ok(0)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(head(X)) → head(proper(X))
proper(tail(X)) → tail(proper(X))
proper(if(X1, X2, X3)) → if(proper(X1), proper(X2), proper(X3))
proper(true) → ok(true)
proper(false) → ok(false)
proper(filter(X1, X2)) → filter(proper(X1), proper(X2))
proper(divides(X1, X2)) → divides(proper(X1), proper(X2))
sieve(ok(X)) → ok(sieve(X))
from(ok(X)) → ok(from(X))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
head(ok(X)) → ok(head(X))
tail(ok(X)) → ok(tail(X))
if(ok(X1), ok(X2), ok(X3)) → ok(if(X1, X2, X3))
filter(ok(X1), ok(X2)) → ok(filter(X1, X2))
divides(ok(X1), ok(X2)) → ok(divides(X1, X2))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

(74) Obligation:

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

PROPER(from(X)) → PROPER(X)
PROPER(sieve(X)) → PROPER(X)
PROPER(s(X)) → PROPER(X)
PROPER(tail(X)) → PROPER(X)

The TRS R consists of the following rules:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
active(sieve(X)) → sieve(active(X))
active(from(X)) → from(active(X))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(head(X)) → head(active(X))
active(tail(X)) → tail(active(X))
active(if(X1, X2, X3)) → if(active(X1), X2, X3)
active(filter(X1, X2)) → filter(active(X1), X2)
active(filter(X1, X2)) → filter(X1, active(X2))
active(divides(X1, X2)) → divides(active(X1), X2)
active(divides(X1, X2)) → divides(X1, active(X2))
sieve(mark(X)) → mark(sieve(X))
from(mark(X)) → mark(from(X))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
head(mark(X)) → mark(head(X))
tail(mark(X)) → mark(tail(X))
if(mark(X1), X2, X3) → mark(if(X1, X2, X3))
filter(mark(X1), X2) → mark(filter(X1, X2))
filter(X1, mark(X2)) → mark(filter(X1, X2))
divides(mark(X1), X2) → mark(divides(X1, X2))
divides(X1, mark(X2)) → mark(divides(X1, X2))
proper(primes) → ok(primes)
proper(sieve(X)) → sieve(proper(X))
proper(from(X)) → from(proper(X))
proper(s(X)) → s(proper(X))
proper(0) → ok(0)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(head(X)) → head(proper(X))
proper(tail(X)) → tail(proper(X))
proper(if(X1, X2, X3)) → if(proper(X1), proper(X2), proper(X3))
proper(true) → ok(true)
proper(false) → ok(false)
proper(filter(X1, X2)) → filter(proper(X1), proper(X2))
proper(divides(X1, X2)) → divides(proper(X1), proper(X2))
sieve(ok(X)) → ok(sieve(X))
from(ok(X)) → ok(from(X))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
head(ok(X)) → ok(head(X))
tail(ok(X)) → ok(tail(X))
if(ok(X1), ok(X2), ok(X3)) → ok(if(X1, X2, X3))
filter(ok(X1), ok(X2)) → ok(filter(X1, X2))
divides(ok(X1), ok(X2)) → ok(divides(X1, X2))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

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

(75) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


PROPER(from(X)) → PROPER(X)
PROPER(sieve(X)) → PROPER(X)
PROPER(tail(X)) → PROPER(X)
The remaining pairs can at least be oriented weakly.
Used ordering: Combined order from the following AFS and order.
PROPER(x1)  =  x1
from(x1)  =  from(x1)
sieve(x1)  =  sieve(x1)
s(x1)  =  x1
tail(x1)  =  tail(x1)
active(x1)  =  x1
primes  =  primes
mark(x1)  =  mark
0  =  0
cons(x1, x2)  =  cons(x1, x2)
head(x1)  =  head(x1)
if(x1, x2, x3)  =  if(x1, x3)
true  =  true
false  =  false
filter(x1, x2)  =  filter(x1, x2)
divides(x1, x2)  =  divides(x1)
proper(x1)  =  x1
ok(x1)  =  ok
top(x1)  =  top

Recursive Path Order [RPO].
Precedence:
sieve1 > mark > filter2 > ok
tail1 > mark > filter2 > ok
primes > from1 > mark > filter2 > ok
0 > ok
cons2 > if2 > mark > filter2 > ok
cons2 > divides1 > mark > filter2 > ok
head1 > mark > filter2 > ok
true > mark > filter2 > ok
false > mark > filter2 > ok
top > ok

The following usable rules [FROCOS05] were oriented:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
active(sieve(X)) → sieve(active(X))
active(from(X)) → from(active(X))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(head(X)) → head(active(X))
active(tail(X)) → tail(active(X))
active(if(X1, X2, X3)) → if(active(X1), X2, X3)
active(filter(X1, X2)) → filter(active(X1), X2)
active(filter(X1, X2)) → filter(X1, active(X2))
active(divides(X1, X2)) → divides(active(X1), X2)
active(divides(X1, X2)) → divides(X1, active(X2))
sieve(mark(X)) → mark(sieve(X))
from(mark(X)) → mark(from(X))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
head(mark(X)) → mark(head(X))
tail(mark(X)) → mark(tail(X))
if(mark(X1), X2, X3) → mark(if(X1, X2, X3))
filter(mark(X1), X2) → mark(filter(X1, X2))
filter(X1, mark(X2)) → mark(filter(X1, X2))
divides(mark(X1), X2) → mark(divides(X1, X2))
divides(X1, mark(X2)) → mark(divides(X1, X2))
proper(primes) → ok(primes)
proper(sieve(X)) → sieve(proper(X))
proper(from(X)) → from(proper(X))
proper(s(X)) → s(proper(X))
proper(0) → ok(0)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(head(X)) → head(proper(X))
proper(tail(X)) → tail(proper(X))
proper(if(X1, X2, X3)) → if(proper(X1), proper(X2), proper(X3))
proper(true) → ok(true)
proper(false) → ok(false)
proper(filter(X1, X2)) → filter(proper(X1), proper(X2))
proper(divides(X1, X2)) → divides(proper(X1), proper(X2))
sieve(ok(X)) → ok(sieve(X))
from(ok(X)) → ok(from(X))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
head(ok(X)) → ok(head(X))
tail(ok(X)) → ok(tail(X))
if(ok(X1), ok(X2), ok(X3)) → ok(if(X1, X2, X3))
filter(ok(X1), ok(X2)) → ok(filter(X1, X2))
divides(ok(X1), ok(X2)) → ok(divides(X1, X2))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

(76) Obligation:

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

PROPER(s(X)) → PROPER(X)

The TRS R consists of the following rules:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
active(sieve(X)) → sieve(active(X))
active(from(X)) → from(active(X))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(head(X)) → head(active(X))
active(tail(X)) → tail(active(X))
active(if(X1, X2, X3)) → if(active(X1), X2, X3)
active(filter(X1, X2)) → filter(active(X1), X2)
active(filter(X1, X2)) → filter(X1, active(X2))
active(divides(X1, X2)) → divides(active(X1), X2)
active(divides(X1, X2)) → divides(X1, active(X2))
sieve(mark(X)) → mark(sieve(X))
from(mark(X)) → mark(from(X))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
head(mark(X)) → mark(head(X))
tail(mark(X)) → mark(tail(X))
if(mark(X1), X2, X3) → mark(if(X1, X2, X3))
filter(mark(X1), X2) → mark(filter(X1, X2))
filter(X1, mark(X2)) → mark(filter(X1, X2))
divides(mark(X1), X2) → mark(divides(X1, X2))
divides(X1, mark(X2)) → mark(divides(X1, X2))
proper(primes) → ok(primes)
proper(sieve(X)) → sieve(proper(X))
proper(from(X)) → from(proper(X))
proper(s(X)) → s(proper(X))
proper(0) → ok(0)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(head(X)) → head(proper(X))
proper(tail(X)) → tail(proper(X))
proper(if(X1, X2, X3)) → if(proper(X1), proper(X2), proper(X3))
proper(true) → ok(true)
proper(false) → ok(false)
proper(filter(X1, X2)) → filter(proper(X1), proper(X2))
proper(divides(X1, X2)) → divides(proper(X1), proper(X2))
sieve(ok(X)) → ok(sieve(X))
from(ok(X)) → ok(from(X))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
head(ok(X)) → ok(head(X))
tail(ok(X)) → ok(tail(X))
if(ok(X1), ok(X2), ok(X3)) → ok(if(X1, X2, X3))
filter(ok(X1), ok(X2)) → ok(filter(X1, X2))
divides(ok(X1), ok(X2)) → ok(divides(X1, X2))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

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

(77) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


PROPER(s(X)) → PROPER(X)
The remaining pairs can at least be oriented weakly.
Used ordering: Combined order from the following AFS and order.
PROPER(x1)  =  PROPER(x1)
s(x1)  =  s(x1)
active(x1)  =  active(x1)
primes  =  primes
mark(x1)  =  mark
sieve(x1)  =  sieve(x1)
from(x1)  =  x1
0  =  0
cons(x1, x2)  =  x1
head(x1)  =  x1
tail(x1)  =  tail
if(x1, x2, x3)  =  if(x2, x3)
true  =  true
false  =  false
filter(x1, x2)  =  filter(x2)
divides(x1, x2)  =  divides(x1)
proper(x1)  =  proper(x1)
ok(x1)  =  x1
top(x1)  =  top

Recursive Path Order [RPO].
Precedence:
true > mark
false > mark
proper1 > primes > 0
proper1 > tail > active1 > s1 > PROPER1
proper1 > tail > active1 > s1 > divides1 > mark
proper1 > tail > active1 > sieve1 > mark
proper1 > tail > active1 > 0
proper1 > tail > active1 > filter1 > divides1 > mark
proper1 > if2 > active1 > s1 > PROPER1
proper1 > if2 > active1 > s1 > divides1 > mark
proper1 > if2 > active1 > sieve1 > mark
proper1 > if2 > active1 > 0
proper1 > if2 > active1 > filter1 > divides1 > mark

The following usable rules [FROCOS05] were oriented:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
active(sieve(X)) → sieve(active(X))
active(from(X)) → from(active(X))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(head(X)) → head(active(X))
active(tail(X)) → tail(active(X))
active(if(X1, X2, X3)) → if(active(X1), X2, X3)
active(filter(X1, X2)) → filter(active(X1), X2)
active(filter(X1, X2)) → filter(X1, active(X2))
active(divides(X1, X2)) → divides(active(X1), X2)
active(divides(X1, X2)) → divides(X1, active(X2))
sieve(mark(X)) → mark(sieve(X))
from(mark(X)) → mark(from(X))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
head(mark(X)) → mark(head(X))
tail(mark(X)) → mark(tail(X))
if(mark(X1), X2, X3) → mark(if(X1, X2, X3))
filter(mark(X1), X2) → mark(filter(X1, X2))
filter(X1, mark(X2)) → mark(filter(X1, X2))
divides(mark(X1), X2) → mark(divides(X1, X2))
divides(X1, mark(X2)) → mark(divides(X1, X2))
proper(primes) → ok(primes)
proper(sieve(X)) → sieve(proper(X))
proper(from(X)) → from(proper(X))
proper(s(X)) → s(proper(X))
proper(0) → ok(0)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(head(X)) → head(proper(X))
proper(tail(X)) → tail(proper(X))
proper(if(X1, X2, X3)) → if(proper(X1), proper(X2), proper(X3))
proper(true) → ok(true)
proper(false) → ok(false)
proper(filter(X1, X2)) → filter(proper(X1), proper(X2))
proper(divides(X1, X2)) → divides(proper(X1), proper(X2))
sieve(ok(X)) → ok(sieve(X))
from(ok(X)) → ok(from(X))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
head(ok(X)) → ok(head(X))
tail(ok(X)) → ok(tail(X))
if(ok(X1), ok(X2), ok(X3)) → ok(if(X1, X2, X3))
filter(ok(X1), ok(X2)) → ok(filter(X1, X2))
divides(ok(X1), ok(X2)) → ok(divides(X1, X2))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

(78) Obligation:

Q DP problem:
P is empty.
The TRS R consists of the following rules:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
active(sieve(X)) → sieve(active(X))
active(from(X)) → from(active(X))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(head(X)) → head(active(X))
active(tail(X)) → tail(active(X))
active(if(X1, X2, X3)) → if(active(X1), X2, X3)
active(filter(X1, X2)) → filter(active(X1), X2)
active(filter(X1, X2)) → filter(X1, active(X2))
active(divides(X1, X2)) → divides(active(X1), X2)
active(divides(X1, X2)) → divides(X1, active(X2))
sieve(mark(X)) → mark(sieve(X))
from(mark(X)) → mark(from(X))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
head(mark(X)) → mark(head(X))
tail(mark(X)) → mark(tail(X))
if(mark(X1), X2, X3) → mark(if(X1, X2, X3))
filter(mark(X1), X2) → mark(filter(X1, X2))
filter(X1, mark(X2)) → mark(filter(X1, X2))
divides(mark(X1), X2) → mark(divides(X1, X2))
divides(X1, mark(X2)) → mark(divides(X1, X2))
proper(primes) → ok(primes)
proper(sieve(X)) → sieve(proper(X))
proper(from(X)) → from(proper(X))
proper(s(X)) → s(proper(X))
proper(0) → ok(0)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(head(X)) → head(proper(X))
proper(tail(X)) → tail(proper(X))
proper(if(X1, X2, X3)) → if(proper(X1), proper(X2), proper(X3))
proper(true) → ok(true)
proper(false) → ok(false)
proper(filter(X1, X2)) → filter(proper(X1), proper(X2))
proper(divides(X1, X2)) → divides(proper(X1), proper(X2))
sieve(ok(X)) → ok(sieve(X))
from(ok(X)) → ok(from(X))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
head(ok(X)) → ok(head(X))
tail(ok(X)) → ok(tail(X))
if(ok(X1), ok(X2), ok(X3)) → ok(if(X1, X2, X3))
filter(ok(X1), ok(X2)) → ok(filter(X1, X2))
divides(ok(X1), ok(X2)) → ok(divides(X1, X2))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

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

(79) PisEmptyProof (EQUIVALENT transformation)

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

(80) TRUE

(81) Obligation:

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

ACTIVE(from(X)) → ACTIVE(X)
ACTIVE(sieve(X)) → ACTIVE(X)
ACTIVE(s(X)) → ACTIVE(X)
ACTIVE(cons(X1, X2)) → ACTIVE(X1)
ACTIVE(head(X)) → ACTIVE(X)
ACTIVE(tail(X)) → ACTIVE(X)
ACTIVE(if(X1, X2, X3)) → ACTIVE(X1)
ACTIVE(filter(X1, X2)) → ACTIVE(X1)
ACTIVE(filter(X1, X2)) → ACTIVE(X2)
ACTIVE(divides(X1, X2)) → ACTIVE(X1)
ACTIVE(divides(X1, X2)) → ACTIVE(X2)

The TRS R consists of the following rules:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
active(sieve(X)) → sieve(active(X))
active(from(X)) → from(active(X))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(head(X)) → head(active(X))
active(tail(X)) → tail(active(X))
active(if(X1, X2, X3)) → if(active(X1), X2, X3)
active(filter(X1, X2)) → filter(active(X1), X2)
active(filter(X1, X2)) → filter(X1, active(X2))
active(divides(X1, X2)) → divides(active(X1), X2)
active(divides(X1, X2)) → divides(X1, active(X2))
sieve(mark(X)) → mark(sieve(X))
from(mark(X)) → mark(from(X))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
head(mark(X)) → mark(head(X))
tail(mark(X)) → mark(tail(X))
if(mark(X1), X2, X3) → mark(if(X1, X2, X3))
filter(mark(X1), X2) → mark(filter(X1, X2))
filter(X1, mark(X2)) → mark(filter(X1, X2))
divides(mark(X1), X2) → mark(divides(X1, X2))
divides(X1, mark(X2)) → mark(divides(X1, X2))
proper(primes) → ok(primes)
proper(sieve(X)) → sieve(proper(X))
proper(from(X)) → from(proper(X))
proper(s(X)) → s(proper(X))
proper(0) → ok(0)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(head(X)) → head(proper(X))
proper(tail(X)) → tail(proper(X))
proper(if(X1, X2, X3)) → if(proper(X1), proper(X2), proper(X3))
proper(true) → ok(true)
proper(false) → ok(false)
proper(filter(X1, X2)) → filter(proper(X1), proper(X2))
proper(divides(X1, X2)) → divides(proper(X1), proper(X2))
sieve(ok(X)) → ok(sieve(X))
from(ok(X)) → ok(from(X))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
head(ok(X)) → ok(head(X))
tail(ok(X)) → ok(tail(X))
if(ok(X1), ok(X2), ok(X3)) → ok(if(X1, X2, X3))
filter(ok(X1), ok(X2)) → ok(filter(X1, X2))
divides(ok(X1), ok(X2)) → ok(divides(X1, X2))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

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

(82) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


ACTIVE(tail(X)) → ACTIVE(X)
ACTIVE(filter(X1, X2)) → ACTIVE(X1)
ACTIVE(filter(X1, X2)) → ACTIVE(X2)
ACTIVE(divides(X1, X2)) → ACTIVE(X1)
ACTIVE(divides(X1, X2)) → ACTIVE(X2)
The remaining pairs can at least be oriented weakly.
Used ordering: Combined order from the following AFS and order.
ACTIVE(x1)  =  ACTIVE(x1)
from(x1)  =  x1
sieve(x1)  =  x1
s(x1)  =  x1
cons(x1, x2)  =  x1
head(x1)  =  x1
tail(x1)  =  tail(x1)
if(x1, x2, x3)  =  x1
filter(x1, x2)  =  filter(x1, x2)
divides(x1, x2)  =  divides(x1, x2)
active(x1)  =  active(x1)
primes  =  primes
mark(x1)  =  mark
0  =  0
true  =  true
false  =  false
proper(x1)  =  x1
ok(x1)  =  x1
top(x1)  =  top

Recursive Path Order [RPO].
Precedence:
active1 > tail1 > mark > divides2
active1 > tail1 > mark > top
active1 > filter2 > ACTIVE1
active1 > filter2 > mark > divides2
active1 > filter2 > mark > top
active1 > 0
primes > mark > divides2
primes > mark > top
primes > 0
true > mark > divides2
true > mark > top

The following usable rules [FROCOS05] were oriented:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
active(sieve(X)) → sieve(active(X))
active(from(X)) → from(active(X))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(head(X)) → head(active(X))
active(tail(X)) → tail(active(X))
active(if(X1, X2, X3)) → if(active(X1), X2, X3)
active(filter(X1, X2)) → filter(active(X1), X2)
active(filter(X1, X2)) → filter(X1, active(X2))
active(divides(X1, X2)) → divides(active(X1), X2)
active(divides(X1, X2)) → divides(X1, active(X2))
sieve(mark(X)) → mark(sieve(X))
from(mark(X)) → mark(from(X))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
head(mark(X)) → mark(head(X))
tail(mark(X)) → mark(tail(X))
if(mark(X1), X2, X3) → mark(if(X1, X2, X3))
filter(mark(X1), X2) → mark(filter(X1, X2))
filter(X1, mark(X2)) → mark(filter(X1, X2))
divides(mark(X1), X2) → mark(divides(X1, X2))
divides(X1, mark(X2)) → mark(divides(X1, X2))
proper(primes) → ok(primes)
proper(sieve(X)) → sieve(proper(X))
proper(from(X)) → from(proper(X))
proper(s(X)) → s(proper(X))
proper(0) → ok(0)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(head(X)) → head(proper(X))
proper(tail(X)) → tail(proper(X))
proper(if(X1, X2, X3)) → if(proper(X1), proper(X2), proper(X3))
proper(true) → ok(true)
proper(false) → ok(false)
proper(filter(X1, X2)) → filter(proper(X1), proper(X2))
proper(divides(X1, X2)) → divides(proper(X1), proper(X2))
sieve(ok(X)) → ok(sieve(X))
from(ok(X)) → ok(from(X))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
head(ok(X)) → ok(head(X))
tail(ok(X)) → ok(tail(X))
if(ok(X1), ok(X2), ok(X3)) → ok(if(X1, X2, X3))
filter(ok(X1), ok(X2)) → ok(filter(X1, X2))
divides(ok(X1), ok(X2)) → ok(divides(X1, X2))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

(83) Obligation:

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

ACTIVE(from(X)) → ACTIVE(X)
ACTIVE(sieve(X)) → ACTIVE(X)
ACTIVE(s(X)) → ACTIVE(X)
ACTIVE(cons(X1, X2)) → ACTIVE(X1)
ACTIVE(head(X)) → ACTIVE(X)
ACTIVE(if(X1, X2, X3)) → ACTIVE(X1)

The TRS R consists of the following rules:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
active(sieve(X)) → sieve(active(X))
active(from(X)) → from(active(X))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(head(X)) → head(active(X))
active(tail(X)) → tail(active(X))
active(if(X1, X2, X3)) → if(active(X1), X2, X3)
active(filter(X1, X2)) → filter(active(X1), X2)
active(filter(X1, X2)) → filter(X1, active(X2))
active(divides(X1, X2)) → divides(active(X1), X2)
active(divides(X1, X2)) → divides(X1, active(X2))
sieve(mark(X)) → mark(sieve(X))
from(mark(X)) → mark(from(X))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
head(mark(X)) → mark(head(X))
tail(mark(X)) → mark(tail(X))
if(mark(X1), X2, X3) → mark(if(X1, X2, X3))
filter(mark(X1), X2) → mark(filter(X1, X2))
filter(X1, mark(X2)) → mark(filter(X1, X2))
divides(mark(X1), X2) → mark(divides(X1, X2))
divides(X1, mark(X2)) → mark(divides(X1, X2))
proper(primes) → ok(primes)
proper(sieve(X)) → sieve(proper(X))
proper(from(X)) → from(proper(X))
proper(s(X)) → s(proper(X))
proper(0) → ok(0)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(head(X)) → head(proper(X))
proper(tail(X)) → tail(proper(X))
proper(if(X1, X2, X3)) → if(proper(X1), proper(X2), proper(X3))
proper(true) → ok(true)
proper(false) → ok(false)
proper(filter(X1, X2)) → filter(proper(X1), proper(X2))
proper(divides(X1, X2)) → divides(proper(X1), proper(X2))
sieve(ok(X)) → ok(sieve(X))
from(ok(X)) → ok(from(X))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
head(ok(X)) → ok(head(X))
tail(ok(X)) → ok(tail(X))
if(ok(X1), ok(X2), ok(X3)) → ok(if(X1, X2, X3))
filter(ok(X1), ok(X2)) → ok(filter(X1, X2))
divides(ok(X1), ok(X2)) → ok(divides(X1, X2))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

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

(84) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


ACTIVE(from(X)) → ACTIVE(X)
ACTIVE(sieve(X)) → ACTIVE(X)
ACTIVE(s(X)) → ACTIVE(X)
ACTIVE(cons(X1, X2)) → ACTIVE(X1)
ACTIVE(head(X)) → ACTIVE(X)
ACTIVE(if(X1, X2, X3)) → ACTIVE(X1)
The remaining pairs can at least be oriented weakly.
Used ordering: Combined order from the following AFS and order.
ACTIVE(x1)  =  ACTIVE(x1)
from(x1)  =  from(x1)
sieve(x1)  =  sieve(x1)
s(x1)  =  s(x1)
cons(x1, x2)  =  cons(x1, x2)
head(x1)  =  head(x1)
if(x1, x2, x3)  =  if(x1, x2, x3)
active(x1)  =  active(x1)
primes  =  primes
mark(x1)  =  mark
0  =  0
tail(x1)  =  x1
true  =  true
false  =  false
filter(x1, x2)  =  filter(x1, x2)
divides(x1, x2)  =  divides
proper(x1)  =  x1
ok(x1)  =  x1
top(x1)  =  top

Recursive Path Order [RPO].
Precedence:
active1 > from1 > s1 > ACTIVE1
active1 > from1 > s1 > sieve1 > cons2 > mark
active1 > from1 > s1 > if3 > mark
active1 > head1 > ACTIVE1
active1 > head1 > mark
active1 > 0
active1 > filter2 > s1 > ACTIVE1
active1 > filter2 > s1 > sieve1 > cons2 > mark
active1 > filter2 > s1 > if3 > mark
active1 > divides > mark

The following usable rules [FROCOS05] were oriented:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
active(sieve(X)) → sieve(active(X))
active(from(X)) → from(active(X))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(head(X)) → head(active(X))
active(tail(X)) → tail(active(X))
active(if(X1, X2, X3)) → if(active(X1), X2, X3)
active(filter(X1, X2)) → filter(active(X1), X2)
active(filter(X1, X2)) → filter(X1, active(X2))
active(divides(X1, X2)) → divides(active(X1), X2)
active(divides(X1, X2)) → divides(X1, active(X2))
sieve(mark(X)) → mark(sieve(X))
from(mark(X)) → mark(from(X))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
head(mark(X)) → mark(head(X))
tail(mark(X)) → mark(tail(X))
if(mark(X1), X2, X3) → mark(if(X1, X2, X3))
filter(mark(X1), X2) → mark(filter(X1, X2))
filter(X1, mark(X2)) → mark(filter(X1, X2))
divides(mark(X1), X2) → mark(divides(X1, X2))
divides(X1, mark(X2)) → mark(divides(X1, X2))
proper(primes) → ok(primes)
proper(sieve(X)) → sieve(proper(X))
proper(from(X)) → from(proper(X))
proper(s(X)) → s(proper(X))
proper(0) → ok(0)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(head(X)) → head(proper(X))
proper(tail(X)) → tail(proper(X))
proper(if(X1, X2, X3)) → if(proper(X1), proper(X2), proper(X3))
proper(true) → ok(true)
proper(false) → ok(false)
proper(filter(X1, X2)) → filter(proper(X1), proper(X2))
proper(divides(X1, X2)) → divides(proper(X1), proper(X2))
sieve(ok(X)) → ok(sieve(X))
from(ok(X)) → ok(from(X))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
head(ok(X)) → ok(head(X))
tail(ok(X)) → ok(tail(X))
if(ok(X1), ok(X2), ok(X3)) → ok(if(X1, X2, X3))
filter(ok(X1), ok(X2)) → ok(filter(X1, X2))
divides(ok(X1), ok(X2)) → ok(divides(X1, X2))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

(85) Obligation:

Q DP problem:
P is empty.
The TRS R consists of the following rules:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
active(sieve(X)) → sieve(active(X))
active(from(X)) → from(active(X))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(head(X)) → head(active(X))
active(tail(X)) → tail(active(X))
active(if(X1, X2, X3)) → if(active(X1), X2, X3)
active(filter(X1, X2)) → filter(active(X1), X2)
active(filter(X1, X2)) → filter(X1, active(X2))
active(divides(X1, X2)) → divides(active(X1), X2)
active(divides(X1, X2)) → divides(X1, active(X2))
sieve(mark(X)) → mark(sieve(X))
from(mark(X)) → mark(from(X))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
head(mark(X)) → mark(head(X))
tail(mark(X)) → mark(tail(X))
if(mark(X1), X2, X3) → mark(if(X1, X2, X3))
filter(mark(X1), X2) → mark(filter(X1, X2))
filter(X1, mark(X2)) → mark(filter(X1, X2))
divides(mark(X1), X2) → mark(divides(X1, X2))
divides(X1, mark(X2)) → mark(divides(X1, X2))
proper(primes) → ok(primes)
proper(sieve(X)) → sieve(proper(X))
proper(from(X)) → from(proper(X))
proper(s(X)) → s(proper(X))
proper(0) → ok(0)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(head(X)) → head(proper(X))
proper(tail(X)) → tail(proper(X))
proper(if(X1, X2, X3)) → if(proper(X1), proper(X2), proper(X3))
proper(true) → ok(true)
proper(false) → ok(false)
proper(filter(X1, X2)) → filter(proper(X1), proper(X2))
proper(divides(X1, X2)) → divides(proper(X1), proper(X2))
sieve(ok(X)) → ok(sieve(X))
from(ok(X)) → ok(from(X))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
head(ok(X)) → ok(head(X))
tail(ok(X)) → ok(tail(X))
if(ok(X1), ok(X2), ok(X3)) → ok(if(X1, X2, X3))
filter(ok(X1), ok(X2)) → ok(filter(X1, X2))
divides(ok(X1), ok(X2)) → ok(divides(X1, X2))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

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

(86) PisEmptyProof (EQUIVALENT transformation)

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

(87) TRUE

(88) Obligation:

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

TOP(ok(X)) → TOP(active(X))
TOP(mark(X)) → TOP(proper(X))

The TRS R consists of the following rules:

active(primes) → mark(sieve(from(s(s(0)))))
active(from(X)) → mark(cons(X, from(s(X))))
active(head(cons(X, Y))) → mark(X)
active(tail(cons(X, Y))) → mark(Y)
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(filter(s(s(X)), cons(Y, Z))) → mark(if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y)))))
active(sieve(cons(X, Y))) → mark(cons(X, filter(X, sieve(Y))))
active(sieve(X)) → sieve(active(X))
active(from(X)) → from(active(X))
active(s(X)) → s(active(X))
active(cons(X1, X2)) → cons(active(X1), X2)
active(head(X)) → head(active(X))
active(tail(X)) → tail(active(X))
active(if(X1, X2, X3)) → if(active(X1), X2, X3)
active(filter(X1, X2)) → filter(active(X1), X2)
active(filter(X1, X2)) → filter(X1, active(X2))
active(divides(X1, X2)) → divides(active(X1), X2)
active(divides(X1, X2)) → divides(X1, active(X2))
sieve(mark(X)) → mark(sieve(X))
from(mark(X)) → mark(from(X))
s(mark(X)) → mark(s(X))
cons(mark(X1), X2) → mark(cons(X1, X2))
head(mark(X)) → mark(head(X))
tail(mark(X)) → mark(tail(X))
if(mark(X1), X2, X3) → mark(if(X1, X2, X3))
filter(mark(X1), X2) → mark(filter(X1, X2))
filter(X1, mark(X2)) → mark(filter(X1, X2))
divides(mark(X1), X2) → mark(divides(X1, X2))
divides(X1, mark(X2)) → mark(divides(X1, X2))
proper(primes) → ok(primes)
proper(sieve(X)) → sieve(proper(X))
proper(from(X)) → from(proper(X))
proper(s(X)) → s(proper(X))
proper(0) → ok(0)
proper(cons(X1, X2)) → cons(proper(X1), proper(X2))
proper(head(X)) → head(proper(X))
proper(tail(X)) → tail(proper(X))
proper(if(X1, X2, X3)) → if(proper(X1), proper(X2), proper(X3))
proper(true) → ok(true)
proper(false) → ok(false)
proper(filter(X1, X2)) → filter(proper(X1), proper(X2))
proper(divides(X1, X2)) → divides(proper(X1), proper(X2))
sieve(ok(X)) → ok(sieve(X))
from(ok(X)) → ok(from(X))
s(ok(X)) → ok(s(X))
cons(ok(X1), ok(X2)) → ok(cons(X1, X2))
head(ok(X)) → ok(head(X))
tail(ok(X)) → ok(tail(X))
if(ok(X1), ok(X2), ok(X3)) → ok(if(X1, X2, X3))
filter(ok(X1), ok(X2)) → ok(filter(X1, X2))
divides(ok(X1), ok(X2)) → ok(divides(X1, X2))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

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