Term Rewriting System R:
[X, Y, Z, X1, X2]
primes -> sieve(from(s(s(0))))
from(X) -> cons(X, nfrom(ns(X)))
from(X) -> nfrom(X)
tail(cons(X, Y)) -> activate(Y)
if(true, X, Y) -> activate(X)
if(false, X, Y) -> activate(Y)
filter(s(s(X)), cons(Y, Z)) -> if(divides(s(s(X)), Y), nfilter(ns(ns(X)), activate(Z)), ncons(Y, nfilter(X, nsieve(Y))))
filter(X1, X2) -> nfilter(X1, X2)
sieve(cons(X, Y)) -> cons(X, nfilter(X, nsieve(activate(Y))))
sieve(X) -> nsieve(X)
s(X) -> ns(X)
cons(X1, X2) -> ncons(X1, X2)
activate(nfrom(X)) -> from(activate(X))
activate(ns(X)) -> s(activate(X))
activate(nfilter(X1, X2)) -> filter(activate(X1), activate(X2))
activate(ncons(X1, X2)) -> cons(activate(X1), X2)
activate(nsieve(X)) -> sieve(activate(X))
activate(X) -> X

Termination of R to be shown.

`   R`
`     ↳Dependency Pair Analysis`

R contains the following Dependency Pairs:

PRIMES -> SIEVE(from(s(s(0))))
PRIMES -> FROM(s(s(0)))
PRIMES -> S(s(0))
PRIMES -> S(0)
FROM(X) -> CONS(X, nfrom(ns(X)))
TAIL(cons(X, Y)) -> ACTIVATE(Y)
IF(true, X, Y) -> ACTIVATE(X)
IF(false, X, Y) -> ACTIVATE(Y)
FILTER(s(s(X)), cons(Y, Z)) -> IF(divides(s(s(X)), Y), nfilter(ns(ns(X)), activate(Z)), ncons(Y, nfilter(X, nsieve(Y))))
FILTER(s(s(X)), cons(Y, Z)) -> ACTIVATE(Z)
SIEVE(cons(X, Y)) -> CONS(X, nfilter(X, nsieve(activate(Y))))
SIEVE(cons(X, Y)) -> ACTIVATE(Y)
ACTIVATE(nfrom(X)) -> FROM(activate(X))
ACTIVATE(nfrom(X)) -> ACTIVATE(X)
ACTIVATE(ns(X)) -> S(activate(X))
ACTIVATE(ns(X)) -> ACTIVATE(X)
ACTIVATE(nfilter(X1, X2)) -> FILTER(activate(X1), activate(X2))
ACTIVATE(nfilter(X1, X2)) -> ACTIVATE(X1)
ACTIVATE(nfilter(X1, X2)) -> ACTIVATE(X2)
ACTIVATE(ncons(X1, X2)) -> CONS(activate(X1), X2)
ACTIVATE(ncons(X1, X2)) -> ACTIVATE(X1)
ACTIVATE(nsieve(X)) -> SIEVE(activate(X))
ACTIVATE(nsieve(X)) -> ACTIVATE(X)

Furthermore, R contains one SCC.

`   R`
`     ↳DPs`
`       →DP Problem 1`
`         ↳Narrowing Transformation`

Dependency Pairs:

ACTIVATE(nsieve(X)) -> ACTIVATE(X)
ACTIVATE(nsieve(X)) -> SIEVE(activate(X))
ACTIVATE(ncons(X1, X2)) -> ACTIVATE(X1)
ACTIVATE(nfilter(X1, X2)) -> ACTIVATE(X2)
ACTIVATE(nfilter(X1, X2)) -> ACTIVATE(X1)
FILTER(s(s(X)), cons(Y, Z)) -> ACTIVATE(Z)
ACTIVATE(nfilter(X1, X2)) -> FILTER(activate(X1), activate(X2))
ACTIVATE(ns(X)) -> ACTIVATE(X)
ACTIVATE(nfrom(X)) -> ACTIVATE(X)
SIEVE(cons(X, Y)) -> ACTIVATE(Y)

Rules:

primes -> sieve(from(s(s(0))))
from(X) -> cons(X, nfrom(ns(X)))
from(X) -> nfrom(X)
tail(cons(X, Y)) -> activate(Y)
if(true, X, Y) -> activate(X)
if(false, X, Y) -> activate(Y)
filter(s(s(X)), cons(Y, Z)) -> if(divides(s(s(X)), Y), nfilter(ns(ns(X)), activate(Z)), ncons(Y, nfilter(X, nsieve(Y))))
filter(X1, X2) -> nfilter(X1, X2)
sieve(cons(X, Y)) -> cons(X, nfilter(X, nsieve(activate(Y))))
sieve(X) -> nsieve(X)
s(X) -> ns(X)
cons(X1, X2) -> ncons(X1, X2)
activate(nfrom(X)) -> from(activate(X))
activate(ns(X)) -> s(activate(X))
activate(nfilter(X1, X2)) -> filter(activate(X1), activate(X2))
activate(ncons(X1, X2)) -> cons(activate(X1), X2)
activate(nsieve(X)) -> sieve(activate(X))
activate(X) -> X

On this DP problem, a Narrowing SCC transformation can be performed.
As a result of transforming the rule

ACTIVATE(nfilter(X1, X2)) -> FILTER(activate(X1), activate(X2))
12 new Dependency Pairs are created:

ACTIVATE(nfilter(nfrom(X'), X2)) -> FILTER(from(activate(X')), activate(X2))
ACTIVATE(nfilter(ns(X'), X2)) -> FILTER(s(activate(X')), activate(X2))
ACTIVATE(nfilter(nfilter(X1'', X2''), X2)) -> FILTER(filter(activate(X1''), activate(X2'')), activate(X2))
ACTIVATE(nfilter(ncons(X1'', X2''), X2)) -> FILTER(cons(activate(X1''), X2''), activate(X2))
ACTIVATE(nfilter(nsieve(X'), X2)) -> FILTER(sieve(activate(X')), activate(X2))
ACTIVATE(nfilter(X1', X2)) -> FILTER(X1', activate(X2))
ACTIVATE(nfilter(X1, nfrom(X'))) -> FILTER(activate(X1), from(activate(X')))
ACTIVATE(nfilter(X1, ns(X'))) -> FILTER(activate(X1), s(activate(X')))
ACTIVATE(nfilter(X1, nfilter(X1'', X2''))) -> FILTER(activate(X1), filter(activate(X1''), activate(X2'')))
ACTIVATE(nfilter(X1, ncons(X1'', X2''))) -> FILTER(activate(X1), cons(activate(X1''), X2''))
ACTIVATE(nfilter(X1, nsieve(X'))) -> FILTER(activate(X1), sieve(activate(X')))
ACTIVATE(nfilter(X1, X2')) -> FILTER(activate(X1), X2')

The transformation is resulting in one new DP problem:

`   R`
`     ↳DPs`
`       →DP Problem 1`
`         ↳Nar`
`           →DP Problem 2`
`             ↳Narrowing Transformation`

Dependency Pairs:

ACTIVATE(nfilter(X1, X2')) -> FILTER(activate(X1), X2')
ACTIVATE(nfilter(X1, nsieve(X'))) -> FILTER(activate(X1), sieve(activate(X')))
ACTIVATE(nfilter(X1, ncons(X1'', X2''))) -> FILTER(activate(X1), cons(activate(X1''), X2''))
ACTIVATE(nfilter(X1, nfilter(X1'', X2''))) -> FILTER(activate(X1), filter(activate(X1''), activate(X2'')))
ACTIVATE(nfilter(X1, ns(X'))) -> FILTER(activate(X1), s(activate(X')))
ACTIVATE(nfilter(X1, nfrom(X'))) -> FILTER(activate(X1), from(activate(X')))
ACTIVATE(nfilter(X1', X2)) -> FILTER(X1', activate(X2))
ACTIVATE(nfilter(nsieve(X'), X2)) -> FILTER(sieve(activate(X')), activate(X2))
ACTIVATE(nfilter(ncons(X1'', X2''), X2)) -> FILTER(cons(activate(X1''), X2''), activate(X2))
ACTIVATE(nfilter(nfilter(X1'', X2''), X2)) -> FILTER(filter(activate(X1''), activate(X2'')), activate(X2))
ACTIVATE(nfilter(ns(X'), X2)) -> FILTER(s(activate(X')), activate(X2))
FILTER(s(s(X)), cons(Y, Z)) -> ACTIVATE(Z)
ACTIVATE(nfilter(nfrom(X'), X2)) -> FILTER(from(activate(X')), activate(X2))
SIEVE(cons(X, Y)) -> ACTIVATE(Y)
ACTIVATE(nsieve(X)) -> SIEVE(activate(X))
ACTIVATE(ncons(X1, X2)) -> ACTIVATE(X1)
ACTIVATE(nfilter(X1, X2)) -> ACTIVATE(X2)
ACTIVATE(nfilter(X1, X2)) -> ACTIVATE(X1)
ACTIVATE(ns(X)) -> ACTIVATE(X)
ACTIVATE(nfrom(X)) -> ACTIVATE(X)
ACTIVATE(nsieve(X)) -> ACTIVATE(X)

Rules:

primes -> sieve(from(s(s(0))))
from(X) -> cons(X, nfrom(ns(X)))
from(X) -> nfrom(X)
tail(cons(X, Y)) -> activate(Y)
if(true, X, Y) -> activate(X)
if(false, X, Y) -> activate(Y)
filter(s(s(X)), cons(Y, Z)) -> if(divides(s(s(X)), Y), nfilter(ns(ns(X)), activate(Z)), ncons(Y, nfilter(X, nsieve(Y))))
filter(X1, X2) -> nfilter(X1, X2)
sieve(cons(X, Y)) -> cons(X, nfilter(X, nsieve(activate(Y))))
sieve(X) -> nsieve(X)
s(X) -> ns(X)
cons(X1, X2) -> ncons(X1, X2)
activate(nfrom(X)) -> from(activate(X))
activate(ns(X)) -> s(activate(X))
activate(nfilter(X1, X2)) -> filter(activate(X1), activate(X2))
activate(ncons(X1, X2)) -> cons(activate(X1), X2)
activate(nsieve(X)) -> sieve(activate(X))
activate(X) -> X

On this DP problem, a Narrowing SCC transformation can be performed.
As a result of transforming the rule

ACTIVATE(nsieve(X)) -> SIEVE(activate(X))
six new Dependency Pairs are created:

ACTIVATE(nsieve(nfrom(X''))) -> SIEVE(from(activate(X'')))
ACTIVATE(nsieve(ns(X''))) -> SIEVE(s(activate(X'')))
ACTIVATE(nsieve(nfilter(X1', X2'))) -> SIEVE(filter(activate(X1'), activate(X2')))
ACTIVATE(nsieve(ncons(X1', X2'))) -> SIEVE(cons(activate(X1'), X2'))
ACTIVATE(nsieve(nsieve(X''))) -> SIEVE(sieve(activate(X'')))
ACTIVATE(nsieve(X'')) -> SIEVE(X'')

The transformation is resulting in one new DP problem:

`   R`
`     ↳DPs`
`       →DP Problem 1`
`         ↳Nar`
`           →DP Problem 2`
`             ↳Nar`
`             ...`
`               →DP Problem 3`
`                 ↳Remaining Obligation(s)`

The following remains to be proven:
Dependency Pairs:

ACTIVATE(nsieve(X'')) -> SIEVE(X'')
ACTIVATE(nsieve(nsieve(X''))) -> SIEVE(sieve(activate(X'')))
ACTIVATE(nsieve(ncons(X1', X2'))) -> SIEVE(cons(activate(X1'), X2'))
ACTIVATE(nsieve(nfilter(X1', X2'))) -> SIEVE(filter(activate(X1'), activate(X2')))
ACTIVATE(nsieve(ns(X''))) -> SIEVE(s(activate(X'')))
SIEVE(cons(X, Y)) -> ACTIVATE(Y)
ACTIVATE(nsieve(nfrom(X''))) -> SIEVE(from(activate(X'')))
ACTIVATE(nfilter(X1, nsieve(X'))) -> FILTER(activate(X1), sieve(activate(X')))
ACTIVATE(nfilter(X1, ncons(X1'', X2''))) -> FILTER(activate(X1), cons(activate(X1''), X2''))
ACTIVATE(nfilter(X1, nfilter(X1'', X2''))) -> FILTER(activate(X1), filter(activate(X1''), activate(X2'')))
ACTIVATE(nfilter(X1, ns(X'))) -> FILTER(activate(X1), s(activate(X')))
ACTIVATE(nfilter(X1, nfrom(X'))) -> FILTER(activate(X1), from(activate(X')))
ACTIVATE(nfilter(X1', X2)) -> FILTER(X1', activate(X2))
ACTIVATE(nfilter(nsieve(X'), X2)) -> FILTER(sieve(activate(X')), activate(X2))
ACTIVATE(nfilter(ncons(X1'', X2''), X2)) -> FILTER(cons(activate(X1''), X2''), activate(X2))
ACTIVATE(nfilter(nfilter(X1'', X2''), X2)) -> FILTER(filter(activate(X1''), activate(X2'')), activate(X2))
ACTIVATE(nfilter(ns(X'), X2)) -> FILTER(s(activate(X')), activate(X2))
ACTIVATE(nfilter(nfrom(X'), X2)) -> FILTER(from(activate(X')), activate(X2))
ACTIVATE(nsieve(X)) -> ACTIVATE(X)
ACTIVATE(ncons(X1, X2)) -> ACTIVATE(X1)
ACTIVATE(nfilter(X1, X2)) -> ACTIVATE(X2)
ACTIVATE(nfilter(X1, X2)) -> ACTIVATE(X1)
ACTIVATE(ns(X)) -> ACTIVATE(X)
ACTIVATE(nfrom(X)) -> ACTIVATE(X)
FILTER(s(s(X)), cons(Y, Z)) -> ACTIVATE(Z)
ACTIVATE(nfilter(X1, X2')) -> FILTER(activate(X1), X2')

Rules:

primes -> sieve(from(s(s(0))))
from(X) -> cons(X, nfrom(ns(X)))
from(X) -> nfrom(X)
tail(cons(X, Y)) -> activate(Y)
if(true, X, Y) -> activate(X)
if(false, X, Y) -> activate(Y)
filter(s(s(X)), cons(Y, Z)) -> if(divides(s(s(X)), Y), nfilter(ns(ns(X)), activate(Z)), ncons(Y, nfilter(X, nsieve(Y))))
filter(X1, X2) -> nfilter(X1, X2)
sieve(cons(X, Y)) -> cons(X, nfilter(X, nsieve(activate(Y))))
sieve(X) -> nsieve(X)
s(X) -> ns(X)
cons(X1, X2) -> ncons(X1, X2)
activate(nfrom(X)) -> from(activate(X))
activate(ns(X)) -> s(activate(X))
activate(nfilter(X1, X2)) -> filter(activate(X1), activate(X2))
activate(ncons(X1, X2)) -> cons(activate(X1), X2)
activate(nsieve(X)) -> sieve(activate(X))
activate(X) -> X

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