(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(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)
ok(x1)  =  x1
active(x1)  =  active(x1)
primes  =  primes
sieve(x1)  =  sieve(x1)
from(x1)  =  from(x1)
s(x1)  =  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)  =  x1
top(x1)  =  top

Lexicographic path order with status [LPO].
Quasi-Precedence:
active1 > from1 > [mark1, primes, tail1] > DIVIDES1
active1 > 0 > DIVIDES1
active1 > [cons2, divides2] > filter2 > sieve1 > [mark1, primes, tail1] > DIVIDES1
active1 > [cons2, divides2] > filter2 > if3 > [mark1, primes, tail1] > DIVIDES1
true > [mark1, primes, tail1] > DIVIDES1
false > [mark1, primes, tail1] > DIVIDES1
top > DIVIDES1

Status:
DIVIDES1: [1]
mark1: [1]
active1: [1]
primes: []
sieve1: [1]
from1: [1]
0: []
cons2: [1,2]
tail1: [1]
if3: [1,3,2]
true: []
false: []
filter2: [1,2]
divides2: [2,1]
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))

(7) Obligation:

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

DIVIDES(X1, mark(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.

(8) 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)  =  DIVIDES(x1)
mark(x1)  =  mark
ok(x1)  =  ok(x1)
active(x1)  =  x1
primes  =  primes
sieve(x1)  =  x1
from(x1)  =  x1
s(x1)  =  x1
0  =  0
cons(x1, x2)  =  x2
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

Lexicographic path order with status [LPO].
Quasi-Precedence:
DIVIDES1 > [mark, primes, true, false]
top > proper > ok1 > [mark, primes, true, false]
top > proper > 0 > [mark, primes, true, false]

Status:
DIVIDES1: [1]
mark: []
ok1: [1]
primes: []
0: []
true: []
false: []
proper: []
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))

(9) Obligation:

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

DIVIDES(X1, mark(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(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)  =  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)  =  x1
ok(x1)  =  x1
top(x1)  =  top

Lexicographic path order with status [LPO].
Quasi-Precedence:
primes > [active1, sieve1, s1, 0, cons2, head1, if3, filter2, divides2] > [mark1, from1, tail1]
false > [mark1, from1, tail1]
top > [active1, sieve1, s1, 0, cons2, head1, if3, filter2, divides2] > [mark1, from1, tail1]

Status:
mark1: [1]
active1: [1]
primes: []
sieve1: [1]
from1: [1]
s1: [1]
0: []
cons2: [1,2]
head1: [1]
tail1: [1]
if3: [3,1,2]
true: []
false: []
filter2: [2,1]
divides2: [1,2]
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(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)
ok(x1)  =  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)  =  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

Lexicographic path order with status [LPO].
Quasi-Precedence:
primes > [active1, from1, cons2, if3, filter2, divides2] > [mark1, s1, top]
primes > [active1, from1, cons2, if3, filter2, divides2] > 0

Status:
FILTER1: [1]
mark1: [1]
active1: [1]
primes: []
from1: [1]
s1: [1]
0: []
cons2: [1,2]
if3: [1,3,2]
true: []
false: []
filter2: [1,2]
divides2: [1,2]
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))

(16) Obligation:

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

FILTER(X1, mark(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.

(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)  =  FILTER(x2)
mark(x1)  =  mark(x1)
ok(x1)  =  x1
active(x1)  =  active(x1)
primes  =  primes
sieve(x1)  =  x1
from(x1)  =  from(x1)
s(x1)  =  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)  =  x1
top(x1)  =  top

Lexicographic path order with status [LPO].
Quasi-Precedence:
[active1, filter2] > [primes, 0] > FILTER1
[active1, filter2] > cons2 > if3 > [mark1, from1, tail1, true] > FILTER1
[active1, filter2] > cons2 > divides2 > [mark1, from1, tail1, true] > FILTER1
false > FILTER1
top > FILTER1

Status:
FILTER1: [1]
mark1: [1]
active1: [1]
primes: []
from1: [1]
0: []
cons2: [2,1]
tail1: [1]
if3: [2,3,1]
true: []
false: []
filter2: [2,1]
divides2: [2,1]
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))

(18) Obligation:

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

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.

(19) 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
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)  =  head(x1)
tail(x1)  =  x1
if(x1, x2, x3)  =  x1
true  =  true
false  =  false
filter(x1, x2)  =  filter(x2)
divides(x1, x2)  =  divides(x2)
proper(x1)  =  proper(x1)
top(x1)  =  top

Lexicographic path order with status [LPO].
Quasi-Precedence:
primes > [ok1, head1, filter1] > mark
0 > [ok1, head1, filter1] > mark
true > [ok1, head1, filter1] > mark
false > [ok1, head1, filter1] > mark
top > active1 > [divides1, proper1] > [ok1, head1, filter1] > mark

Status:
ok1: [1]
active1: [1]
primes: []
mark: []
0: []
head1: [1]
true: []
false: []
filter1: [1]
divides1: [1]
proper1: [1]
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)  =  x3
ok(x1)  =  ok(x1)
mark(x1)  =  mark
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)  =  head(x1)
tail(x1)  =  tail(x1)
if(x1, x2, x3)  =  if(x3)
true  =  true
false  =  false
filter(x1, x2)  =  x1
divides(x1, x2)  =  x2
proper(x1)  =  proper(x1)
top(x1)  =  top

Lexicographic path order with status [LPO].
Quasi-Precedence:
active1 > [cons2, tail1, if1, true, proper1] > [ok1, s1, head1] > [mark, false, top]
active1 > [cons2, tail1, if1, true, proper1] > 0 > [mark, false, top]
primes > [ok1, s1, head1] > [mark, false, top]
primes > 0 > [mark, false, top]

Status:
ok1: [1]
mark: []
active1: [1]
primes: []
s1: [1]
0: []
cons2: [1,2]
head1: [1]
tail1: [1]
if1: [1]
true: []
false: []
proper1: [1]
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))

(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)  =  IF(x1, x2)
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)  =  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)  =  x1
ok(x1)  =  x1
top(x1)  =  top

Lexicographic path order with status [LPO].
Quasi-Precedence:
[active1, filter2, top] > 0
[active1, filter2, top] > cons2 > [s1, if3] > sieve1 > mark1
[active1, filter2, top] > cons2 > [s1, if3] > divides2 > mark1
primes > [s1, if3] > sieve1 > mark1
primes > [s1, if3] > divides2 > mark1
primes > 0
true > mark1
false > mark1

Status:
IF2: [1,2]
mark1: [1]
active1: [1]
primes: []
sieve1: [1]
s1: [1]
0: []
cons2: [1,2]
if3: [1,3,2]
true: []
false: []
filter2: [2,1]
divides2: [1,2]
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))

(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(ok(X)) → TAIL(X)
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)  =  ok(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)  =  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)
top(x1)  =  top

Lexicographic path order with status [LPO].
Quasi-Precedence:
[active1, from1, head1, if3, proper1] > primes > [mark1, s1, false] > ok1
[active1, from1, head1, if3, proper1] > primes > 0 > ok1
[active1, from1, head1, if3, proper1] > true > [mark1, s1, false] > ok1
[active1, from1, head1, if3, proper1] > filter2 > cons2 > [mark1, s1, false] > ok1
[active1, from1, head1, if3, proper1] > filter2 > divides2 > [mark1, s1, false] > ok1

Status:
ok1: [1]
mark1: [1]
active1: [1]
primes: []
from1: [1]
s1: [1]
0: []
cons2: [2,1]
head1: [1]
if3: [3,2,1]
true: []
false: []
filter2: [2,1]
divides2: [2,1]
proper1: [1]
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))

(32) 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.

(33) PisEmptyProof (EQUIVALENT transformation)

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

(34) TRUE

(35) 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.

(36) 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)
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)  =  ok(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)  =  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)
top(x1)  =  top

Lexicographic path order with status [LPO].
Quasi-Precedence:
[active1, from1, head1, if3, proper1] > primes > [mark1, s1, false] > ok1
[active1, from1, head1, if3, proper1] > primes > 0 > ok1
[active1, from1, head1, if3, proper1] > true > [mark1, s1, false] > ok1
[active1, from1, head1, if3, proper1] > filter2 > cons2 > [mark1, s1, false] > ok1
[active1, from1, head1, if3, proper1] > filter2 > divides2 > [mark1, s1, false] > ok1

Status:
ok1: [1]
mark1: [1]
active1: [1]
primes: []
from1: [1]
s1: [1]
0: []
cons2: [2,1]
head1: [1]
if3: [3,2,1]
true: []
false: []
filter2: [2,1]
divides2: [2,1]
proper1: [1]
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))

(37) 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.

(38) PisEmptyProof (EQUIVALENT transformation)

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

(39) TRUE

(40) 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.

(41) 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)  =  x1
ok(x1)  =  x1
mark(x1)  =  mark(x1)
active(x1)  =  active(x1)
primes  =  primes
sieve(x1)  =  sieve(x1)
from(x1)  =  from(x1)
s(x1)  =  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)  =  x1
top(x1)  =  top

Lexicographic path order with status [LPO].
Quasi-Precedence:
primes > [mark1, from1, tail1]
true > [mark1, from1, tail1]
false > [mark1, from1, tail1]
top > active1 > sieve1 > [cons2, filter2] > if3 > [mark1, from1, tail1]
top > active1 > sieve1 > [cons2, filter2] > divides2 > [mark1, from1, tail1]
top > active1 > 0 > [mark1, from1, tail1]

Status:
mark1: [1]
active1: [1]
primes: []
sieve1: [1]
from1: [1]
0: []
cons2: [2,1]
tail1: [1]
if3: [3,1,2]
true: []
false: []
filter2: [1,2]
divides2: [1,2]
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))

(42) 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.

(43) 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)  =  from(x1)
s(x1)  =  s(x1)
0  =  0
cons(x1, x2)  =  x1
head(x1)  =  x1
tail(x1)  =  tail(x1)
if(x1, x2, x3)  =  x3
true  =  true
false  =  false
filter(x1, x2)  =  x1
divides(x1, x2)  =  x2
proper(x1)  =  proper(x1)
top(x1)  =  top

Lexicographic path order with status [LPO].
Quasi-Precedence:
active1 > [s1, tail1, proper1, top] > from1 > [ok1, mark, 0, false]
primes > [s1, tail1, proper1, top] > from1 > [ok1, mark, 0, false]
true > [ok1, mark, 0, false]

Status:
ok1: [1]
active1: [1]
primes: []
mark: []
from1: [1]
s1: [1]
0: []
tail1: [1]
true: []
false: []
proper1: [1]
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))

(44) 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.

(45) PisEmptyProof (EQUIVALENT transformation)

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

(46) TRUE

(47) 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.

(48) 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)
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)  =  ok(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)  =  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)
top(x1)  =  top

Lexicographic path order with status [LPO].
Quasi-Precedence:
[active1, from1, head1, if3, proper1] > primes > [mark1, s1, false] > ok1
[active1, from1, head1, if3, proper1] > primes > 0 > ok1
[active1, from1, head1, if3, proper1] > true > [mark1, s1, false] > ok1
[active1, from1, head1, if3, proper1] > filter2 > cons2 > [mark1, s1, false] > ok1
[active1, from1, head1, if3, proper1] > filter2 > divides2 > [mark1, s1, false] > ok1

Status:
ok1: [1]
mark1: [1]
active1: [1]
primes: []
from1: [1]
s1: [1]
0: []
cons2: [2,1]
head1: [1]
if3: [3,2,1]
true: []
false: []
filter2: [2,1]
divides2: [2,1]
proper1: [1]
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))

(49) 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.

(50) PisEmptyProof (EQUIVALENT transformation)

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

(51) TRUE

(52) 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.

(53) 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)
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)  =  ok(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)  =  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)
top(x1)  =  top

Lexicographic path order with status [LPO].
Quasi-Precedence:
[active1, from1, head1, if3, proper1] > primes > [mark1, s1, false] > ok1
[active1, from1, head1, if3, proper1] > primes > 0 > ok1
[active1, from1, head1, if3, proper1] > true > [mark1, s1, false] > ok1
[active1, from1, head1, if3, proper1] > filter2 > cons2 > [mark1, s1, false] > ok1
[active1, from1, head1, if3, proper1] > filter2 > divides2 > [mark1, s1, false] > ok1

Status:
ok1: [1]
mark1: [1]
active1: [1]
primes: []
from1: [1]
s1: [1]
0: []
cons2: [2,1]
head1: [1]
if3: [3,2,1]
true: []
false: []
filter2: [2,1]
divides2: [2,1]
proper1: [1]
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))

(54) 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.

(55) PisEmptyProof (EQUIVALENT transformation)

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

(56) TRUE

(57) 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.

(58) 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)
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)  =  ok(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)  =  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)
top(x1)  =  top

Lexicographic path order with status [LPO].
Quasi-Precedence:
[active1, from1, head1, if3, proper1] > primes > [mark1, s1, false] > ok1
[active1, from1, head1, if3, proper1] > primes > 0 > ok1
[active1, from1, head1, if3, proper1] > true > [mark1, s1, false] > ok1
[active1, from1, head1, if3, proper1] > filter2 > cons2 > [mark1, s1, false] > ok1
[active1, from1, head1, if3, proper1] > filter2 > divides2 > [mark1, s1, false] > ok1

Status:
ok1: [1]
mark1: [1]
active1: [1]
primes: []
from1: [1]
s1: [1]
0: []
cons2: [2,1]
head1: [1]
if3: [3,2,1]
true: []
false: []
filter2: [2,1]
divides2: [2,1]
proper1: [1]
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))

(59) 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.

(60) PisEmptyProof (EQUIVALENT transformation)

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

(61) TRUE

(62) 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.

(63) 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(cons(X1, X2)) → PROPER(X1)
PROPER(cons(X1, X2)) → PROPER(X2)
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)  =  from(x1)
sieve(x1)  =  x1
s(x1)  =  x1
cons(x1, x2)  =  cons(x1, x2)
head(x1)  =  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)  =  x1
primes  =  primes
mark(x1)  =  mark
0  =  0
true  =  true
false  =  false
proper(x1)  =  proper(x1)
ok(x1)  =  ok(x1)
top(x1)  =  top

Lexicographic path order with status [LPO].
Quasi-Precedence:
[if3, primes, 0, proper1] > from1 > cons2 > [divides2, mark, false] > ok1
[if3, primes, 0, proper1] > filter2 > cons2 > [divides2, mark, false] > ok1
[if3, primes, 0, proper1] > true > [divides2, mark, false] > ok1

Status:
from1: [1]
cons2: [1,2]
if3: [1,3,2]
filter2: [1,2]
divides2: [2,1]
primes: []
mark: []
0: []
true: []
false: []
proper1: [1]
ok1: [1]
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))

(64) Obligation:

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

PROPER(sieve(X)) → PROPER(X)
PROPER(s(X)) → PROPER(X)
PROPER(head(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.

(65) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


PROPER(sieve(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)
sieve(x1)  =  sieve(x1)
s(x1)  =  x1
head(x1)  =  x1
tail(x1)  =  x1
active(x1)  =  active(x1)
primes  =  primes
mark(x1)  =  x1
from(x1)  =  from(x1)
0  =  0
cons(x1, x2)  =  cons(x1, x2)
if(x1, x2, x3)  =  if(x1, x2, x3)
true  =  true
false  =  false
filter(x1, x2)  =  filter(x1, x2)
divides(x1, x2)  =  x1
proper(x1)  =  x1
ok(x1)  =  x1
top(x1)  =  top

Lexicographic path order with status [LPO].
Quasi-Precedence:
PROPER1 > [sieve1, top]
[active1, from1, cons2] > 0 > [sieve1, top]
[active1, from1, cons2] > filter2 > if3 > [sieve1, top]
primes > 0 > [sieve1, top]
true > [sieve1, top]
false > [sieve1, top]

Status:
PROPER1: [1]
sieve1: [1]
active1: [1]
primes: []
from1: [1]
0: []
cons2: [1,2]
if3: [1,2,3]
true: []
false: []
filter2: [1,2]
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))

(66) Obligation:

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

PROPER(s(X)) → PROPER(X)
PROPER(head(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.

(67) 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)  =  x1
s(x1)  =  s(x1)
head(x1)  =  x1
tail(x1)  =  x1
active(x1)  =  active(x1)
primes  =  primes
mark(x1)  =  mark
sieve(x1)  =  sieve
from(x1)  =  from
0  =  0
cons(x1, x2)  =  cons
if(x1, x2, x3)  =  if
true  =  true
false  =  false
filter(x1, x2)  =  x2
divides(x1, x2)  =  divides(x1)
proper(x1)  =  proper(x1)
ok(x1)  =  x1
top(x1)  =  top

Lexicographic path order with status [LPO].
Quasi-Precedence:
0 > [s1, primes, mark, sieve, from, true, divides1, top]
[cons, if] > active1 > [s1, primes, mark, sieve, from, true, divides1, top]
[cons, if] > proper1 > [s1, primes, mark, sieve, from, true, divides1, top]
false > [s1, primes, mark, sieve, from, true, divides1, top]

Status:
s1: [1]
active1: [1]
primes: []
mark: []
sieve: []
from: []
0: []
cons: []
if: []
true: []
false: []
divides1: [1]
proper1: [1]
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))

(68) Obligation:

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

PROPER(head(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.

(69) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


PROPER(head(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)
head(x1)  =  head(x1)
tail(x1)  =  x1
active(x1)  =  active(x1)
primes  =  primes
mark(x1)  =  mark
sieve(x1)  =  sieve
from(x1)  =  x1
s(x1)  =  s
0  =  0
cons(x1, x2)  =  x2
if(x1, x2, x3)  =  if(x2, x3)
true  =  true
false  =  false
filter(x1, x2)  =  filter
divides(x1, x2)  =  divides(x1)
proper(x1)  =  proper(x1)
ok(x1)  =  x1
top(x1)  =  top

Lexicographic path order with status [LPO].
Quasi-Precedence:
[0, if2, true, proper1] > [active1, divides1] > sieve > [PROPER1, head1, mark, s, false, filter]
[0, if2, true, proper1] > primes > sieve > [PROPER1, head1, mark, s, false, filter]
top > [active1, divides1] > sieve > [PROPER1, head1, mark, s, false, filter]

Status:
PROPER1: [1]
head1: [1]
active1: [1]
primes: []
mark: []
sieve: []
s: []
0: []
if2: [1,2]
true: []
false: []
filter: []
divides1: [1]
proper1: [1]
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))

(70) Obligation:

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

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.

(71) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


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)  =  PROPER(x1)
tail(x1)  =  tail(x1)
active(x1)  =  active(x1)
primes  =  primes
mark(x1)  =  x1
sieve(x1)  =  sieve(x1)
from(x1)  =  from(x1)
s(x1)  =  x1
0  =  0
cons(x1, x2)  =  cons(x1, x2)
head(x1)  =  head(x1)
if(x1, x2, x3)  =  if(x2, x3)
true  =  true
false  =  false
filter(x1, x2)  =  filter(x2)
divides(x1, x2)  =  divides
proper(x1)  =  x1
ok(x1)  =  x1
top(x1)  =  top

Lexicographic path order with status [LPO].
Quasi-Precedence:
primes > [tail1, active1, from1, 0, head1, if2, filter1] > PROPER1 > [sieve1, divides]
primes > [tail1, active1, from1, 0, head1, if2, filter1] > cons2 > [sieve1, divides]
true > [sieve1, divides]
false > [sieve1, divides]
top > [tail1, active1, from1, 0, head1, if2, filter1] > PROPER1 > [sieve1, divides]
top > [tail1, active1, from1, 0, head1, if2, filter1] > cons2 > [sieve1, divides]

Status:
PROPER1: [1]
tail1: [1]
active1: [1]
primes: []
sieve1: [1]
from1: [1]
0: []
cons2: [2,1]
head1: [1]
if2: [2,1]
true: []
false: []
filter1: [1]
divides: []
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))

(72) 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.

(73) PisEmptyProof (EQUIVALENT transformation)

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

(74) TRUE

(75) 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.

(76) 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(cons(X1, X2)) → ACTIVE(X1)
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 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)  =  x1
s(x1)  =  x1
cons(x1, x2)  =  cons(x1, x2)
head(x1)  =  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)  =  x1
0  =  0
true  =  true
false  =  false
proper(x1)  =  x1
ok(x1)  =  ok
top(x1)  =  top

Lexicographic path order with status [LPO].
Quasi-Precedence:
top > [from1, cons2, active1] > if3 > [ACTIVE1, filter2] > [primes, 0, true, false, ok]
top > [from1, cons2, active1] > divides2 > [ACTIVE1, filter2] > [primes, 0, true, false, ok]

Status:
ACTIVE1: [1]
from1: [1]
cons2: [1,2]
if3: [3,2,1]
filter2: [2,1]
divides2: [2,1]
active1: [1]
primes: []
0: []
true: []
false: []
ok: []
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))

(77) Obligation:

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

ACTIVE(sieve(X)) → ACTIVE(X)
ACTIVE(s(X)) → ACTIVE(X)
ACTIVE(head(X)) → ACTIVE(X)
ACTIVE(tail(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.

(78) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


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

Lexicographic path order with status [LPO].
Quasi-Precedence:
ACTIVE1 > [sieve1, top]
[active1, from1, cons2] > 0 > [sieve1, top]
[active1, from1, cons2] > filter2 > if3 > [sieve1, top]
primes > 0 > [sieve1, top]
true > [sieve1, top]
false > [sieve1, top]

Status:
ACTIVE1: [1]
sieve1: [1]
active1: [1]
primes: []
from1: [1]
0: []
cons2: [1,2]
if3: [1,2,3]
true: []
false: []
filter2: [1,2]
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))

(79) Obligation:

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

ACTIVE(s(X)) → ACTIVE(X)
ACTIVE(head(X)) → ACTIVE(X)
ACTIVE(tail(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.

(80) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


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

Lexicographic path order with status [LPO].
Quasi-Precedence:
0 > [s1, primes, mark, sieve, from, true, divides1, top]
[cons, if] > active1 > [s1, primes, mark, sieve, from, true, divides1, top]
[cons, if] > proper1 > [s1, primes, mark, sieve, from, true, divides1, top]
false > [s1, primes, mark, sieve, from, true, divides1, top]

Status:
s1: [1]
active1: [1]
primes: []
mark: []
sieve: []
from: []
0: []
cons: []
if: []
true: []
false: []
divides1: [1]
proper1: [1]
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))

(81) Obligation:

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

ACTIVE(head(X)) → ACTIVE(X)
ACTIVE(tail(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.

(82) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


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

Lexicographic path order with status [LPO].
Quasi-Precedence:
[0, if2, true, proper1] > [active1, divides1] > sieve > [ACTIVE1, head1, mark, s, false, filter]
[0, if2, true, proper1] > primes > sieve > [ACTIVE1, head1, mark, s, false, filter]
top > [active1, divides1] > sieve > [ACTIVE1, head1, mark, s, false, filter]

Status:
ACTIVE1: [1]
head1: [1]
active1: [1]
primes: []
mark: []
sieve: []
s: []
0: []
if2: [1,2]
true: []
false: []
filter: []
divides1: [1]
proper1: [1]
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(tail(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.

(84) 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)
The remaining pairs can at least be oriented weakly.
Used ordering: Combined order from the following AFS and order.
ACTIVE(x1)  =  ACTIVE(x1)
tail(x1)  =  tail(x1)
active(x1)  =  active(x1)
primes  =  primes
mark(x1)  =  x1
sieve(x1)  =  sieve(x1)
from(x1)  =  from(x1)
s(x1)  =  x1
0  =  0
cons(x1, x2)  =  cons(x1, x2)
head(x1)  =  head(x1)
if(x1, x2, x3)  =  if(x2, x3)
true  =  true
false  =  false
filter(x1, x2)  =  filter(x2)
divides(x1, x2)  =  divides
proper(x1)  =  x1
ok(x1)  =  x1
top(x1)  =  top

Lexicographic path order with status [LPO].
Quasi-Precedence:
primes > [tail1, active1, from1, 0, head1, if2, filter1] > ACTIVE1 > [sieve1, divides]
primes > [tail1, active1, from1, 0, head1, if2, filter1] > cons2 > [sieve1, divides]
true > [sieve1, divides]
false > [sieve1, divides]
top > [tail1, active1, from1, 0, head1, if2, filter1] > ACTIVE1 > [sieve1, divides]
top > [tail1, active1, from1, 0, head1, if2, filter1] > cons2 > [sieve1, divides]

Status:
ACTIVE1: [1]
tail1: [1]
active1: [1]
primes: []
sieve1: [1]
from1: [1]
0: []
cons2: [2,1]
head1: [1]
if2: [2,1]
true: []
false: []
filter1: [1]
divides: []
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))

(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.