Term Rewriting System R:
[X, Y, Z]
primes -> sieve(from(s(s(0))))
from(X) -> cons(X, from(s(X)))
head(cons(X, Y)) -> X
tail(cons(X, Y)) -> Y
if(true, X, Y) -> X
if(false, X, Y) -> Y
filter(s(s(X)), cons(Y, Z)) -> if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y))))
sieve(cons(X, Y)) -> cons(X, filter(X, sieve(Y)))

Innermost 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)))
FROM(X) -> FROM(s(X))
FILTER(s(s(X)), cons(Y, Z)) -> IF(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y))))
FILTER(s(s(X)), cons(Y, Z)) -> FILTER(s(s(X)), Z)
FILTER(s(s(X)), cons(Y, Z)) -> FILTER(X, sieve(Y))
FILTER(s(s(X)), cons(Y, Z)) -> SIEVE(Y)
SIEVE(cons(X, Y)) -> FILTER(X, sieve(Y))
SIEVE(cons(X, Y)) -> SIEVE(Y)

Furthermore, R contains two SCCs.


   R
DPs
       →DP Problem 1
Narrowing Transformation
       →DP Problem 2
Remaining


Dependency Pairs:

SIEVE(cons(X, Y)) -> SIEVE(Y)
FILTER(s(s(X)), cons(Y, Z)) -> SIEVE(Y)
FILTER(s(s(X)), cons(Y, Z)) -> FILTER(X, sieve(Y))
FILTER(s(s(X)), cons(Y, Z)) -> FILTER(s(s(X)), Z)
SIEVE(cons(X, Y)) -> FILTER(X, sieve(Y))


Rules:


primes -> sieve(from(s(s(0))))
from(X) -> cons(X, from(s(X)))
head(cons(X, Y)) -> X
tail(cons(X, Y)) -> Y
if(true, X, Y) -> X
if(false, X, Y) -> Y
filter(s(s(X)), cons(Y, Z)) -> if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y))))
sieve(cons(X, Y)) -> cons(X, filter(X, sieve(Y)))


Strategy:

innermost




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

FILTER(s(s(X)), cons(Y, Z)) -> FILTER(X, sieve(Y))
one new Dependency Pair is created:

FILTER(s(s(X)), cons(cons(X'', Y''), Z)) -> FILTER(X, cons(X'', filter(X'', sieve(Y''))))

The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
Nar
           →DP Problem 3
Narrowing Transformation
       →DP Problem 2
Remaining


Dependency Pairs:

FILTER(s(s(X)), cons(cons(X'', Y''), Z)) -> FILTER(X, cons(X'', filter(X'', sieve(Y''))))
FILTER(s(s(X)), cons(Y, Z)) -> SIEVE(Y)
FILTER(s(s(X)), cons(Y, Z)) -> FILTER(s(s(X)), Z)
SIEVE(cons(X, Y)) -> FILTER(X, sieve(Y))
SIEVE(cons(X, Y)) -> SIEVE(Y)


Rules:


primes -> sieve(from(s(s(0))))
from(X) -> cons(X, from(s(X)))
head(cons(X, Y)) -> X
tail(cons(X, Y)) -> Y
if(true, X, Y) -> X
if(false, X, Y) -> Y
filter(s(s(X)), cons(Y, Z)) -> if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y))))
sieve(cons(X, Y)) -> cons(X, filter(X, sieve(Y)))


Strategy:

innermost




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

SIEVE(cons(X, Y)) -> FILTER(X, sieve(Y))
one new Dependency Pair is created:

SIEVE(cons(X, cons(X'', Y''))) -> FILTER(X, cons(X'', filter(X'', sieve(Y''))))

The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
Nar
           →DP Problem 3
Nar
             ...
               →DP Problem 4
Forward Instantiation Transformation
       →DP Problem 2
Remaining


Dependency Pairs:

SIEVE(cons(X, cons(X'', Y''))) -> FILTER(X, cons(X'', filter(X'', sieve(Y''))))
SIEVE(cons(X, Y)) -> SIEVE(Y)
FILTER(s(s(X)), cons(Y, Z)) -> SIEVE(Y)
FILTER(s(s(X)), cons(Y, Z)) -> FILTER(s(s(X)), Z)
FILTER(s(s(X)), cons(cons(X'', Y''), Z)) -> FILTER(X, cons(X'', filter(X'', sieve(Y''))))


Rules:


primes -> sieve(from(s(s(0))))
from(X) -> cons(X, from(s(X)))
head(cons(X, Y)) -> X
tail(cons(X, Y)) -> Y
if(true, X, Y) -> X
if(false, X, Y) -> Y
filter(s(s(X)), cons(Y, Z)) -> if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y))))
sieve(cons(X, Y)) -> cons(X, filter(X, sieve(Y)))


Strategy:

innermost




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

FILTER(s(s(X)), cons(Y, Z)) -> FILTER(s(s(X)), Z)
two new Dependency Pairs are created:

FILTER(s(s(X'')), cons(Y, cons(Y'', Z''))) -> FILTER(s(s(X'')), cons(Y'', Z''))
FILTER(s(s(X'')), cons(Y, cons(cons(X'''', Y''''), Z''))) -> FILTER(s(s(X'')), cons(cons(X'''', Y''''), Z''))

The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
Nar
           →DP Problem 3
Nar
             ...
               →DP Problem 5
Forward Instantiation Transformation
       →DP Problem 2
Remaining


Dependency Pairs:

FILTER(s(s(X'')), cons(Y, cons(cons(X'''', Y''''), Z''))) -> FILTER(s(s(X'')), cons(cons(X'''', Y''''), Z''))
FILTER(s(s(X'')), cons(Y, cons(Y'', Z''))) -> FILTER(s(s(X'')), cons(Y'', Z''))
FILTER(s(s(X)), cons(cons(X'', Y''), Z)) -> FILTER(X, cons(X'', filter(X'', sieve(Y''))))
SIEVE(cons(X, Y)) -> SIEVE(Y)
FILTER(s(s(X)), cons(Y, Z)) -> SIEVE(Y)
SIEVE(cons(X, cons(X'', Y''))) -> FILTER(X, cons(X'', filter(X'', sieve(Y''))))


Rules:


primes -> sieve(from(s(s(0))))
from(X) -> cons(X, from(s(X)))
head(cons(X, Y)) -> X
tail(cons(X, Y)) -> Y
if(true, X, Y) -> X
if(false, X, Y) -> Y
filter(s(s(X)), cons(Y, Z)) -> if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y))))
sieve(cons(X, Y)) -> cons(X, filter(X, sieve(Y)))


Strategy:

innermost




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

FILTER(s(s(X)), cons(Y, Z)) -> SIEVE(Y)
two new Dependency Pairs are created:

FILTER(s(s(X)), cons(cons(X'', Y''), Z)) -> SIEVE(cons(X'', Y''))
FILTER(s(s(X)), cons(cons(X'', cons(X'''', Y'''')), Z)) -> SIEVE(cons(X'', cons(X'''', Y'''')))

The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
Nar
           →DP Problem 3
Nar
             ...
               →DP Problem 6
Forward Instantiation Transformation
       →DP Problem 2
Remaining


Dependency Pairs:

FILTER(s(s(X)), cons(cons(X'', cons(X'''', Y'''')), Z)) -> SIEVE(cons(X'', cons(X'''', Y'''')))
SIEVE(cons(X, cons(X'', Y''))) -> FILTER(X, cons(X'', filter(X'', sieve(Y''))))
SIEVE(cons(X, Y)) -> SIEVE(Y)
FILTER(s(s(X)), cons(cons(X'', Y''), Z)) -> SIEVE(cons(X'', Y''))
FILTER(s(s(X'')), cons(Y, cons(Y'', Z''))) -> FILTER(s(s(X'')), cons(Y'', Z''))
FILTER(s(s(X)), cons(cons(X'', Y''), Z)) -> FILTER(X, cons(X'', filter(X'', sieve(Y''))))
FILTER(s(s(X'')), cons(Y, cons(cons(X'''', Y''''), Z''))) -> FILTER(s(s(X'')), cons(cons(X'''', Y''''), Z''))


Rules:


primes -> sieve(from(s(s(0))))
from(X) -> cons(X, from(s(X)))
head(cons(X, Y)) -> X
tail(cons(X, Y)) -> Y
if(true, X, Y) -> X
if(false, X, Y) -> Y
filter(s(s(X)), cons(Y, Z)) -> if(divides(s(s(X)), Y), filter(s(s(X)), Z), cons(Y, filter(X, sieve(Y))))
sieve(cons(X, Y)) -> cons(X, filter(X, sieve(Y)))


Strategy:

innermost




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

SIEVE(cons(X, Y)) -> SIEVE(Y)
two new Dependency Pairs are created:

SIEVE(cons(X, cons(X'', Y''))) -> SIEVE(cons(X'', Y''))
SIEVE(cons(X, cons(X'', cons(X'''', Y'''')))) -> SIEVE(cons(X'', cons(X'''', Y'''')))

The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
Nar
       →DP Problem 2
Remaining Obligation(s)




The following remains to be proven:


   R
DPs
       →DP Problem 1
Nar
       →DP Problem 2
Remaining Obligation(s)




The following remains to be proven:

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