R
↳Dependency Pair Analysis
PRIMES -> SIEVE(from(s(s(0))))
PRIMES -> FROM(s(s(0)))
FROM(X) -> CONS(X, nfrom(s(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(s(s(X)), activate(Z)), ncons(Y, nfilter(X, sieve(Y))))
FILTER(s(s(X)), cons(Y, Z)) -> ACTIVATE(Z)
FILTER(s(s(X)), cons(Y, Z)) -> SIEVE(Y)
SIEVE(cons(X, Y)) -> CONS(X, nfilter(X, sieve(activate(Y))))
SIEVE(cons(X, Y)) -> SIEVE(activate(Y))
SIEVE(cons(X, Y)) -> ACTIVATE(Y)
ACTIVATE(nfrom(X)) -> FROM(X)
ACTIVATE(nfilter(X1, X2)) -> FILTER(X1, X2)
ACTIVATE(ncons(X1, X2)) -> CONS(X1, X2)
R
↳DPs
→DP Problem 1
↳Narrowing Transformation
FILTER(s(s(X)), cons(Y, Z)) -> SIEVE(Y)
FILTER(s(s(X)), cons(Y, Z)) -> ACTIVATE(Z)
ACTIVATE(nfilter(X1, X2)) -> FILTER(X1, X2)
SIEVE(cons(X, Y)) -> ACTIVATE(Y)
SIEVE(cons(X, Y)) -> SIEVE(activate(Y))
primes -> sieve(from(s(s(0))))
from(X) -> cons(X, nfrom(s(X)))
from(X) -> nfrom(X)
head(cons(X, Y)) -> 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(s(s(X)), activate(Z)), ncons(Y, nfilter(X, sieve(Y))))
filter(X1, X2) -> nfilter(X1, X2)
sieve(cons(X, Y)) -> cons(X, nfilter(X, sieve(activate(Y))))
cons(X1, X2) -> ncons(X1, X2)
activate(nfrom(X)) -> from(X)
activate(nfilter(X1, X2)) -> filter(X1, X2)
activate(ncons(X1, X2)) -> cons(X1, X2)
activate(X) -> X
four new Dependency Pairs are created:
SIEVE(cons(X, Y)) -> SIEVE(activate(Y))
SIEVE(cons(X, nfrom(X''))) -> SIEVE(from(X''))
SIEVE(cons(X, nfilter(X1', X2'))) -> SIEVE(filter(X1', X2'))
SIEVE(cons(X, ncons(X1', X2'))) -> SIEVE(cons(X1', X2'))
SIEVE(cons(X, Y')) -> SIEVE(Y')
R
↳DPs
→DP Problem 1
↳Nar
→DP Problem 2
↳Narrowing Transformation
SIEVE(cons(X, Y')) -> SIEVE(Y')
SIEVE(cons(X, ncons(X1', X2'))) -> SIEVE(cons(X1', X2'))
SIEVE(cons(X, nfilter(X1', X2'))) -> SIEVE(filter(X1', X2'))
SIEVE(cons(X, nfrom(X''))) -> SIEVE(from(X''))
FILTER(s(s(X)), cons(Y, Z)) -> ACTIVATE(Z)
ACTIVATE(nfilter(X1, X2)) -> FILTER(X1, X2)
SIEVE(cons(X, Y)) -> ACTIVATE(Y)
FILTER(s(s(X)), cons(Y, Z)) -> SIEVE(Y)
primes -> sieve(from(s(s(0))))
from(X) -> cons(X, nfrom(s(X)))
from(X) -> nfrom(X)
head(cons(X, Y)) -> 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(s(s(X)), activate(Z)), ncons(Y, nfilter(X, sieve(Y))))
filter(X1, X2) -> nfilter(X1, X2)
sieve(cons(X, Y)) -> cons(X, nfilter(X, sieve(activate(Y))))
cons(X1, X2) -> ncons(X1, X2)
activate(nfrom(X)) -> from(X)
activate(nfilter(X1, X2)) -> filter(X1, X2)
activate(ncons(X1, X2)) -> cons(X1, X2)
activate(X) -> X
two new Dependency Pairs are created:
SIEVE(cons(X, nfrom(X''))) -> SIEVE(from(X''))
SIEVE(cons(X, nfrom(X'''))) -> SIEVE(cons(X''', nfrom(s(X'''))))
SIEVE(cons(X, nfrom(X'''))) -> SIEVE(nfrom(X'''))
R
↳DPs
→DP Problem 1
↳Nar
→DP Problem 2
↳Nar
...
→DP Problem 3
↳Narrowing Transformation
SIEVE(cons(X, nfrom(X'''))) -> SIEVE(cons(X''', nfrom(s(X'''))))
SIEVE(cons(X, ncons(X1', X2'))) -> SIEVE(cons(X1', X2'))
SIEVE(cons(X, nfilter(X1', X2'))) -> SIEVE(filter(X1', X2'))
FILTER(s(s(X)), cons(Y, Z)) -> SIEVE(Y)
FILTER(s(s(X)), cons(Y, Z)) -> ACTIVATE(Z)
ACTIVATE(nfilter(X1, X2)) -> FILTER(X1, X2)
SIEVE(cons(X, Y)) -> ACTIVATE(Y)
SIEVE(cons(X, Y')) -> SIEVE(Y')
primes -> sieve(from(s(s(0))))
from(X) -> cons(X, nfrom(s(X)))
from(X) -> nfrom(X)
head(cons(X, Y)) -> 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(s(s(X)), activate(Z)), ncons(Y, nfilter(X, sieve(Y))))
filter(X1, X2) -> nfilter(X1, X2)
sieve(cons(X, Y)) -> cons(X, nfilter(X, sieve(activate(Y))))
cons(X1, X2) -> ncons(X1, X2)
activate(nfrom(X)) -> from(X)
activate(nfilter(X1, X2)) -> filter(X1, X2)
activate(ncons(X1, X2)) -> cons(X1, X2)
activate(X) -> X
two new Dependency Pairs are created:
SIEVE(cons(X, nfilter(X1', X2'))) -> SIEVE(filter(X1', X2'))
SIEVE(cons(X, nfilter(s(s(X'')), cons(Y', Z')))) -> SIEVE(if(divides(s(s(X'')), Y'), nfilter(s(s(X'')), activate(Z')), ncons(Y', nfilter(X'', sieve(Y')))))
SIEVE(cons(X, nfilter(X1'', X2''))) -> SIEVE(nfilter(X1'', X2''))
R
↳DPs
→DP Problem 1
↳Nar
→DP Problem 2
↳Nar
...
→DP Problem 4
↳Remaining Obligation(s)
SIEVE(cons(X, nfilter(s(s(X'')), cons(Y', Z')))) -> SIEVE(if(divides(s(s(X'')), Y'), nfilter(s(s(X'')), activate(Z')), ncons(Y', nfilter(X'', sieve(Y')))))
SIEVE(cons(X, Y')) -> SIEVE(Y')
SIEVE(cons(X, ncons(X1', X2'))) -> SIEVE(cons(X1', X2'))
FILTER(s(s(X)), cons(Y, Z)) -> SIEVE(Y)
FILTER(s(s(X)), cons(Y, Z)) -> ACTIVATE(Z)
ACTIVATE(nfilter(X1, X2)) -> FILTER(X1, X2)
SIEVE(cons(X, Y)) -> ACTIVATE(Y)
SIEVE(cons(X, nfrom(X'''))) -> SIEVE(cons(X''', nfrom(s(X'''))))
primes -> sieve(from(s(s(0))))
from(X) -> cons(X, nfrom(s(X)))
from(X) -> nfrom(X)
head(cons(X, Y)) -> 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(s(s(X)), activate(Z)), ncons(Y, nfilter(X, sieve(Y))))
filter(X1, X2) -> nfilter(X1, X2)
sieve(cons(X, Y)) -> cons(X, nfilter(X, sieve(activate(Y))))
cons(X1, X2) -> ncons(X1, X2)
activate(nfrom(X)) -> from(X)
activate(nfilter(X1, X2)) -> filter(X1, X2)
activate(ncons(X1, X2)) -> cons(X1, X2)
activate(X) -> X