(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(X1, mark(X2)) → DIVIDES(X1, X2)
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(x2)
mark(x1)  =  mark(x1)
ok(x1)  =  ok(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)  =  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:
proper1 > [active1, cons2, if3, divides2] > from1 > ok1 > [DIVIDES1, mark1, top]
proper1 > [active1, cons2, if3, divides2] > 0 > [DIVIDES1, mark1, top]
proper1 > [active1, cons2, if3, divides2] > filter2 > ok1 > [DIVIDES1, mark1, top]
proper1 > primes > 0 > [DIVIDES1, mark1, top]
proper1 > true > [DIVIDES1, mark1, top]
proper1 > false > [DIVIDES1, mark1, top]

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

(7) Obligation:

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

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

The TRS R consists of the following rules:

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

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

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

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

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

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

(10) PisEmptyProof (EQUIVALENT transformation)

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

(11) TRUE

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

(13) 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)
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)  =  FILTER(x2)
mark(x1)  =  mark(x1)
ok(x1)  =  ok(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)  =  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:
proper1 > [active1, cons2, if3, divides2] > from1 > ok1 > [FILTER1, mark1, top]
proper1 > [active1, cons2, if3, divides2] > 0 > [FILTER1, mark1, top]
proper1 > [active1, cons2, if3, divides2] > filter2 > ok1 > [FILTER1, mark1, top]
proper1 > primes > 0 > [FILTER1, mark1, top]
proper1 > true > [FILTER1, mark1, top]
proper1 > false > [FILTER1, mark1, top]

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

(14) Obligation:

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

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

The TRS R consists of the following rules:

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

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

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

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

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

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

(17) PisEmptyProof (EQUIVALENT transformation)

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

(18) TRUE

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

(20) 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, x3)
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)  =  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, sieve1, filter2] > 0 > [IF3, top]
[active1, sieve1, filter2] > cons2 > [mark1, from1] > [IF3, top]
[active1, sieve1, filter2] > if3 > [mark1, from1] > [IF3, top]
[active1, sieve1, filter2] > divides2 > [mark1, from1] > [IF3, top]
primes > [mark1, from1] > [IF3, top]
primes > 0 > [IF3, top]
true > [IF3, top]
false > [IF3, top]

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

(21) Obligation:

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

IF(ok(X1), ok(X2), ok(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.

(22) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


IF(ok(X1), ok(X2), ok(X3)) → IF(X1, X2, X3)
The remaining pairs can at least be oriented weakly.
Used ordering: Combined order from the following AFS and order.
IF(x1, x2, x3)  =  IF(x3)
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)  =  cons(x1)
head(x1)  =  x1
tail(x1)  =  x1
if(x1, x2, x3)  =  if(x1)
true  =  true
false  =  false
filter(x1, x2)  =  x2
divides(x1, x2)  =  divides(x1)
proper(x1)  =  proper(x1)
top(x1)  =  top

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

Status:
IF1: [1]
ok1: [1]
active1: [1]
primes: []
mark: []
0: []
cons1: [1]
if1: [1]
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))

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

(24) PisEmptyProof (EQUIVALENT transformation)

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

(25) TRUE

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

(27) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


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

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

Status:
ok1: [1]
active1: [1]
primes: []
0: []
cons2: [1,2]
if2: [1,2]
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))

(28) Obligation:

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

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.

(29) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


TAIL(mark(X)) → TAIL(X)
The remaining pairs can at least be oriented weakly.
Used ordering: Combined order from the following AFS and order.
TAIL(x1)  =  TAIL(x1)
mark(x1)  =  mark(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)  =  x1
if(x1, x2, x3)  =  if(x1, x2, x3)
true  =  true
false  =  false
filter(x1, x2)  =  filter(x1, x2)
divides(x1, x2)  =  divides(x1, x2)
proper(x1)  =  proper(x1)
ok(x1)  =  ok(x1)
top(x1)  =  top

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

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

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

(31) PisEmptyProof (EQUIVALENT transformation)

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

(32) TRUE

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

(34) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


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

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

Status:
ok1: [1]
active1: [1]
primes: []
0: []
cons2: [1,2]
if2: [1,2]
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))

(35) Obligation:

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

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(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)  =  HEAD(x1)
mark(x1)  =  mark(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)  =  x1
if(x1, x2, x3)  =  if(x1, x2, x3)
true  =  true
false  =  false
filter(x1, x2)  =  filter(x1, x2)
divides(x1, x2)  =  divides(x1, x2)
proper(x1)  =  proper(x1)
ok(x1)  =  ok(x1)
top(x1)  =  top

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

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

(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(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)
mark(x1)  =  mark
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)
true  =  true
false  =  false
filter(x1, x2)  =  filter(x1, x2)
divides(x1, x2)  =  divides(x2)
proper(x1)  =  proper(x1)
top(x1)  =  top

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

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

(42) Obligation:

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

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.

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

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

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

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

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

Status:
ok1: [1]
active1: [1]
primes: []
0: []
cons2: [1,2]
if2: [1,2]
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))

(49) Obligation:

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

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.

(50) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


S(mark(X)) → S(X)
The remaining pairs can at least be oriented weakly.
Used ordering: Combined order from the following AFS and order.
S(x1)  =  S(x1)
mark(x1)  =  mark(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)  =  x1
if(x1, x2, x3)  =  if(x1, x2, x3)
true  =  true
false  =  false
filter(x1, x2)  =  filter(x1, x2)
divides(x1, x2)  =  divides(x1, x2)
proper(x1)  =  proper(x1)
ok(x1)  =  ok(x1)
top(x1)  =  top

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

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

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

(52) PisEmptyProof (EQUIVALENT transformation)

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

(53) TRUE

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

(55) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


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

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

Status:
ok1: [1]
active1: [1]
primes: []
0: []
cons2: [1,2]
if2: [1,2]
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))

(56) Obligation:

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

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.

(57) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


FROM(mark(X)) → FROM(X)
The remaining pairs can at least be oriented weakly.
Used ordering: Combined order from the following AFS and order.
FROM(x1)  =  FROM(x1)
mark(x1)  =  mark(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)  =  x1
if(x1, x2, x3)  =  if(x1, x2, x3)
true  =  true
false  =  false
filter(x1, x2)  =  filter(x1, x2)
divides(x1, x2)  =  divides(x1, x2)
proper(x1)  =  proper(x1)
ok(x1)  =  ok(x1)
top(x1)  =  top

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

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

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

(59) PisEmptyProof (EQUIVALENT transformation)

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

(60) TRUE

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

(62) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


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

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

Status:
ok1: [1]
active1: [1]
primes: []
0: []
cons2: [1,2]
if2: [1,2]
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))

(63) Obligation:

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

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.

(64) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


SIEVE(mark(X)) → SIEVE(X)
The remaining pairs can at least be oriented weakly.
Used ordering: Combined order from the following AFS and order.
SIEVE(x1)  =  SIEVE(x1)
mark(x1)  =  mark(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)  =  x1
if(x1, x2, x3)  =  if(x1, x2, x3)
true  =  true
false  =  false
filter(x1, x2)  =  filter(x1, x2)
divides(x1, x2)  =  divides(x1, x2)
proper(x1)  =  proper(x1)
ok(x1)  =  ok(x1)
top(x1)  =  top

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

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

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

(66) PisEmptyProof (EQUIVALENT transformation)

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

(67) TRUE

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

(69) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


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

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

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

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

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

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

Status:
s1: [1]
head1: [1]
tail1: [1]
primes: []
mark: []
sieve1: [1]
from1: [1]
0: []
cons2: [2,1]
true: []
false: []
filter2: [2,1]
divides2: [2,1]
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))

(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)  =  x1
from(x1)  =  from(x1)
sieve(x1)  =  x1
s(x1)  =  x1
cons(x1, x2)  =  cons(x1)
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)  =  x1
ok(x1)  =  x1
top(x1)  =  top

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

Status:
from1: [1]
cons1: [1]
if3: [2,3,1]
filter2: [2,1]
divides2: [2,1]
primes: []
mark: []
0: []
true: []
false: []
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)
ACTIVE(s(X)) → ACTIVE(X)
ACTIVE(head(X)) → ACTIVE(X)
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)  =  x1
sieve(x1)  =  sieve(x1)
s(x1)  =  s(x1)
head(x1)  =  head(x1)
tail(x1)  =  tail(x1)
active(x1)  =  x1
primes  =  primes
mark(x1)  =  mark
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)  =  divides(x1, x2)
proper(x1)  =  x1
ok(x1)  =  ok
top(x1)  =  top

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

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

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

(80) PisEmptyProof (EQUIVALENT transformation)

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

(81) TRUE

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