(0) Obligation:

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

a__primesa__sieve(a__from(s(s(0))))
a__from(X) → cons(mark(X), from(s(X)))
a__head(cons(X, Y)) → mark(X)
a__tail(cons(X, Y)) → mark(Y)
a__if(true, X, Y) → mark(X)
a__if(false, X, Y) → mark(Y)
a__filter(s(s(X)), cons(Y, Z)) → a__if(divides(s(s(mark(X))), mark(Y)), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y))))
a__sieve(cons(X, Y)) → cons(mark(X), filter(X, sieve(Y)))
mark(primes) → a__primes
mark(sieve(X)) → a__sieve(mark(X))
mark(from(X)) → a__from(mark(X))
mark(head(X)) → a__head(mark(X))
mark(tail(X)) → a__tail(mark(X))
mark(if(X1, X2, X3)) → a__if(mark(X1), X2, X3)
mark(filter(X1, X2)) → a__filter(mark(X1), mark(X2))
mark(s(X)) → s(mark(X))
mark(0) → 0
mark(cons(X1, X2)) → cons(mark(X1), X2)
mark(true) → true
mark(false) → false
mark(divides(X1, X2)) → divides(mark(X1), mark(X2))
a__primesprimes
a__sieve(X) → sieve(X)
a__from(X) → from(X)
a__head(X) → head(X)
a__tail(X) → tail(X)
a__if(X1, X2, X3) → if(X1, X2, X3)
a__filter(X1, X2) → filter(X1, X2)

Q is empty.

(1) DependencyPairsProof (EQUIVALENT transformation)

Using Dependency Pairs [AG00,LPAR04] we result in the following initial DP problem.

(2) Obligation:

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

A__PRIMESA__SIEVE(a__from(s(s(0))))
A__PRIMESA__FROM(s(s(0)))
A__FROM(X) → MARK(X)
A__HEAD(cons(X, Y)) → MARK(X)
A__TAIL(cons(X, Y)) → MARK(Y)
A__IF(true, X, Y) → MARK(X)
A__IF(false, X, Y) → MARK(Y)
A__FILTER(s(s(X)), cons(Y, Z)) → A__IF(divides(s(s(mark(X))), mark(Y)), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y))))
A__FILTER(s(s(X)), cons(Y, Z)) → MARK(X)
A__FILTER(s(s(X)), cons(Y, Z)) → MARK(Y)
A__SIEVE(cons(X, Y)) → MARK(X)
MARK(primes) → A__PRIMES
MARK(sieve(X)) → A__SIEVE(mark(X))
MARK(sieve(X)) → MARK(X)
MARK(from(X)) → A__FROM(mark(X))
MARK(from(X)) → MARK(X)
MARK(head(X)) → A__HEAD(mark(X))
MARK(head(X)) → MARK(X)
MARK(tail(X)) → A__TAIL(mark(X))
MARK(tail(X)) → MARK(X)
MARK(if(X1, X2, X3)) → A__IF(mark(X1), X2, X3)
MARK(if(X1, X2, X3)) → MARK(X1)
MARK(filter(X1, X2)) → A__FILTER(mark(X1), mark(X2))
MARK(filter(X1, X2)) → MARK(X1)
MARK(filter(X1, X2)) → MARK(X2)
MARK(s(X)) → MARK(X)
MARK(cons(X1, X2)) → MARK(X1)
MARK(divides(X1, X2)) → MARK(X1)
MARK(divides(X1, X2)) → MARK(X2)

The TRS R consists of the following rules:

a__primesa__sieve(a__from(s(s(0))))
a__from(X) → cons(mark(X), from(s(X)))
a__head(cons(X, Y)) → mark(X)
a__tail(cons(X, Y)) → mark(Y)
a__if(true, X, Y) → mark(X)
a__if(false, X, Y) → mark(Y)
a__filter(s(s(X)), cons(Y, Z)) → a__if(divides(s(s(mark(X))), mark(Y)), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y))))
a__sieve(cons(X, Y)) → cons(mark(X), filter(X, sieve(Y)))
mark(primes) → a__primes
mark(sieve(X)) → a__sieve(mark(X))
mark(from(X)) → a__from(mark(X))
mark(head(X)) → a__head(mark(X))
mark(tail(X)) → a__tail(mark(X))
mark(if(X1, X2, X3)) → a__if(mark(X1), X2, X3)
mark(filter(X1, X2)) → a__filter(mark(X1), mark(X2))
mark(s(X)) → s(mark(X))
mark(0) → 0
mark(cons(X1, X2)) → cons(mark(X1), X2)
mark(true) → true
mark(false) → false
mark(divides(X1, X2)) → divides(mark(X1), mark(X2))
a__primesprimes
a__sieve(X) → sieve(X)
a__from(X) → from(X)
a__head(X) → head(X)
a__tail(X) → tail(X)
a__if(X1, X2, X3) → if(X1, X2, X3)
a__filter(X1, X2) → filter(X1, X2)

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

(3) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 1 SCC with 1 less node.

(4) Obligation:

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

A__SIEVE(cons(X, Y)) → MARK(X)
MARK(primes) → A__PRIMES
A__PRIMESA__SIEVE(a__from(s(s(0))))
A__PRIMESA__FROM(s(s(0)))
A__FROM(X) → MARK(X)
MARK(sieve(X)) → A__SIEVE(mark(X))
MARK(sieve(X)) → MARK(X)
MARK(from(X)) → A__FROM(mark(X))
MARK(from(X)) → MARK(X)
MARK(head(X)) → A__HEAD(mark(X))
A__HEAD(cons(X, Y)) → MARK(X)
MARK(head(X)) → MARK(X)
MARK(tail(X)) → A__TAIL(mark(X))
A__TAIL(cons(X, Y)) → MARK(Y)
MARK(tail(X)) → MARK(X)
MARK(if(X1, X2, X3)) → A__IF(mark(X1), X2, X3)
A__IF(true, X, Y) → MARK(X)
MARK(if(X1, X2, X3)) → MARK(X1)
MARK(filter(X1, X2)) → A__FILTER(mark(X1), mark(X2))
A__FILTER(s(s(X)), cons(Y, Z)) → MARK(X)
MARK(filter(X1, X2)) → MARK(X1)
MARK(filter(X1, X2)) → MARK(X2)
MARK(s(X)) → MARK(X)
MARK(cons(X1, X2)) → MARK(X1)
MARK(divides(X1, X2)) → MARK(X1)
MARK(divides(X1, X2)) → MARK(X2)
A__FILTER(s(s(X)), cons(Y, Z)) → MARK(Y)
A__IF(false, X, Y) → MARK(Y)

The TRS R consists of the following rules:

a__primesa__sieve(a__from(s(s(0))))
a__from(X) → cons(mark(X), from(s(X)))
a__head(cons(X, Y)) → mark(X)
a__tail(cons(X, Y)) → mark(Y)
a__if(true, X, Y) → mark(X)
a__if(false, X, Y) → mark(Y)
a__filter(s(s(X)), cons(Y, Z)) → a__if(divides(s(s(mark(X))), mark(Y)), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y))))
a__sieve(cons(X, Y)) → cons(mark(X), filter(X, sieve(Y)))
mark(primes) → a__primes
mark(sieve(X)) → a__sieve(mark(X))
mark(from(X)) → a__from(mark(X))
mark(head(X)) → a__head(mark(X))
mark(tail(X)) → a__tail(mark(X))
mark(if(X1, X2, X3)) → a__if(mark(X1), X2, X3)
mark(filter(X1, X2)) → a__filter(mark(X1), mark(X2))
mark(s(X)) → s(mark(X))
mark(0) → 0
mark(cons(X1, X2)) → cons(mark(X1), X2)
mark(true) → true
mark(false) → false
mark(divides(X1, X2)) → divides(mark(X1), mark(X2))
a__primesprimes
a__sieve(X) → sieve(X)
a__from(X) → from(X)
a__head(X) → head(X)
a__tail(X) → tail(X)
a__if(X1, X2, X3) → if(X1, X2, X3)
a__filter(X1, X2) → filter(X1, X2)

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