Term Rewriting System R:
[X, Y, X1, X2, X3, Z]
aprimes -> asieve(afrom(s(s(0))))
aprimes -> primes
afrom(X) -> cons(mark(X), from(s(X)))
afrom(X) -> from(X)
atail(cons(X, Y)) -> mark(Y)
atail(X) -> tail(X)
aif(true, X, Y) -> mark(X)
aif(false, X, Y) -> mark(Y)
aif(X1, X2, X3) -> if(X1, X2, X3)
afilter(s(s(X)), cons(Y, Z)) -> aif(divides(s(s(mark(X))), mark(Y)), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y))))
afilter(X1, X2) -> filter(X1, X2)
asieve(cons(X, Y)) -> cons(mark(X), filter(X, sieve(Y)))
asieve(X) -> sieve(X)
mark(primes) -> aprimes
mark(sieve(X)) -> asieve(mark(X))
mark(from(X)) -> afrom(mark(X))
mark(tail(X)) -> atail(mark(X))
mark(if(X1, X2, X3)) -> aif(mark(X1), X2, X3)
mark(filter(X1, X2)) -> afilter(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))

Termination of R to be shown.

`   R`
`     ↳Dependency Pair Analysis`

R contains the following Dependency Pairs:

APRIMES -> ASIEVE(afrom(s(s(0))))
APRIMES -> AFROM(s(s(0)))
AFROM(X) -> MARK(X)
ATAIL(cons(X, Y)) -> MARK(Y)
AIF(true, X, Y) -> MARK(X)
AIF(false, X, Y) -> MARK(Y)
AFILTER(s(s(X)), cons(Y, Z)) -> AIF(divides(s(s(mark(X))), mark(Y)), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y))))
AFILTER(s(s(X)), cons(Y, Z)) -> MARK(X)
AFILTER(s(s(X)), cons(Y, Z)) -> MARK(Y)
ASIEVE(cons(X, Y)) -> MARK(X)
MARK(primes) -> APRIMES
MARK(sieve(X)) -> ASIEVE(mark(X))
MARK(sieve(X)) -> MARK(X)
MARK(from(X)) -> AFROM(mark(X))
MARK(from(X)) -> MARK(X)
MARK(tail(X)) -> ATAIL(mark(X))
MARK(tail(X)) -> MARK(X)
MARK(if(X1, X2, X3)) -> AIF(mark(X1), X2, X3)
MARK(if(X1, X2, X3)) -> MARK(X1)
MARK(filter(X1, X2)) -> AFILTER(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)

Furthermore, R contains one SCC.

`   R`
`     ↳DPs`
`       →DP Problem 1`
`         ↳Remaining Obligation(s)`

The following remains to be proven:
Dependency Pairs:

AIF(false, X, Y) -> MARK(Y)
AFILTER(s(s(X)), cons(Y, Z)) -> MARK(Y)
MARK(divides(X1, X2)) -> MARK(X2)
MARK(divides(X1, X2)) -> MARK(X1)
MARK(cons(X1, X2)) -> MARK(X1)
MARK(s(X)) -> MARK(X)
MARK(filter(X1, X2)) -> MARK(X2)
MARK(filter(X1, X2)) -> MARK(X1)
AFILTER(s(s(X)), cons(Y, Z)) -> MARK(X)
MARK(filter(X1, X2)) -> AFILTER(mark(X1), mark(X2))
MARK(if(X1, X2, X3)) -> MARK(X1)
AIF(true, X, Y) -> MARK(X)
MARK(if(X1, X2, X3)) -> AIF(mark(X1), X2, X3)
MARK(tail(X)) -> MARK(X)
ATAIL(cons(X, Y)) -> MARK(Y)
MARK(tail(X)) -> ATAIL(mark(X))
MARK(from(X)) -> MARK(X)
MARK(from(X)) -> AFROM(mark(X))
MARK(sieve(X)) -> MARK(X)
MARK(sieve(X)) -> ASIEVE(mark(X))
AFROM(X) -> MARK(X)
APRIMES -> AFROM(s(s(0)))
MARK(primes) -> APRIMES
ASIEVE(cons(X, Y)) -> MARK(X)
APRIMES -> ASIEVE(afrom(s(s(0))))

Rules:

aprimes -> asieve(afrom(s(s(0))))
aprimes -> primes
afrom(X) -> cons(mark(X), from(s(X)))
afrom(X) -> from(X)
atail(cons(X, Y)) -> mark(Y)
atail(X) -> tail(X)
aif(true, X, Y) -> mark(X)
aif(false, X, Y) -> mark(Y)
aif(X1, X2, X3) -> if(X1, X2, X3)
afilter(s(s(X)), cons(Y, Z)) -> aif(divides(s(s(mark(X))), mark(Y)), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y))))
afilter(X1, X2) -> filter(X1, X2)
asieve(cons(X, Y)) -> cons(mark(X), filter(X, sieve(Y)))
asieve(X) -> sieve(X)
mark(primes) -> aprimes
mark(sieve(X)) -> asieve(mark(X))
mark(from(X)) -> afrom(mark(X))
mark(tail(X)) -> atail(mark(X))
mark(if(X1, X2, X3)) -> aif(mark(X1), X2, X3)
mark(filter(X1, X2)) -> afilter(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))

Termination of R could not be shown.
Duration:
0:39 minutes