Term Rewriting System R:
[X, Y, Z, X1, X2]
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

Innermost Termination of R to be shown.



   R
Removing Redundant Rules for Innermost Termination



Removing the following rules from R which left hand sides contain non normal subterms

head(cons(X, Y)) -> X
tail(cons(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))))
sieve(cons(X, Y)) -> cons(X, nfilter(X, sieve(activate(Y))))


   R
RRRI
       →TRS2
Removing Redundant Rules



Removing the following rules from R which fullfill a polynomial ordering:

primes -> sieve(from(s(s(0))))

where the Polynomial interpretation:
  POL(from(x1))=  2·x1  
  POL(activate(x1))=  2·x1  
  POL(filter(x1, x2))=  x1 + x2  
  POL(false)=  0  
  POL(true)=  0  
  POL(n__from(x1))=  x1  
  POL(n__cons(x1, x2))=  x1 + x2  
  POL(if(x1, x2, x3))=  x1 + 2·x2 + 2·x3  
  POL(sieve(x1))=  x1  
  POL(0)=  0  
  POL(n__filter(x1, x2))=  x1 + x2  
  POL(cons(x1, x2))=  x1 + x2  
  POL(primes)=  1  
  POL(s(x1))=  x1  
was used.

Not all Rules of R can be deleted, so we still have to regard a part of R.


   R
RRRI
       →TRS2
RRRPolo
           →TRS3
Removing Redundant Rules



Removing the following rules from R which fullfill a polynomial ordering:

cons(X1, X2) -> ncons(X1, X2)
activate(nfilter(X1, X2)) -> filter(X1, X2)
activate(X) -> X
from(X) -> nfrom(X)

where the Polynomial interpretation:
  POL(n__from(x1))=  x1  
  POL(from(x1))=  1 + 2·x1  
  POL(n__cons(x1, x2))=  x1 + x2  
  POL(activate(x1))=  1 + 2·x1  
  POL(filter(x1, x2))=  x1 + x2  
  POL(if(x1, x2, x3))=  x1 + 2·x2 + 2·x3  
  POL(n__filter(x1, x2))=  x1 + x2  
  POL(false)=  1  
  POL(cons(x1, x2))=  1 + x1 + x2  
  POL(true)=  1  
  POL(s(x1))=  x1  
was used.

Not all Rules of R can be deleted, so we still have to regard a part of R.


   R
RRRI
       →TRS2
RRRPolo
           →TRS3
RRRPolo
             ...
               →TRS4
Removing Redundant Rules



Removing the following rules from R which fullfill a polynomial ordering:

if(false, X, Y) -> activate(Y)

where the Polynomial interpretation:
  POL(n__from(x1))=  x1  
  POL(from(x1))=  2·x1  
  POL(n__cons(x1, x2))=  x1 + x2  
  POL(activate(x1))=  2·x1  
  POL(filter(x1, x2))=  x1 + x2  
  POL(if(x1, x2, x3))=  x1 + 2·x2 + 2·x3  
  POL(n__filter(x1, x2))=  x1 + x2  
  POL(cons(x1, x2))=  x1 + x2  
  POL(false)=  1  
  POL(true)=  0  
  POL(s(x1))=  x1  
was used.

Not all Rules of R can be deleted, so we still have to regard a part of R.


   R
RRRI
       →TRS2
RRRPolo
           →TRS3
RRRPolo
             ...
               →TRS5
Removing Redundant Rules



Removing the following rules from R which fullfill a polynomial ordering:

filter(X1, X2) -> nfilter(X1, X2)

where the Polynomial interpretation:
  POL(from(x1))=  2·x1  
  POL(n__from(x1))=  x1  
  POL(n__cons(x1, x2))=  x1 + x2  
  POL(activate(x1))=  2·x1  
  POL(filter(x1, x2))=  1 + x1 + x2  
  POL(if(x1, x2, x3))=  x1 + 2·x2 + x3  
  POL(n__filter(x1, x2))=  x1 + x2  
  POL(cons(x1, x2))=  x1 + x2  
  POL(true)=  0  
  POL(s(x1))=  x1  
was used.

Not all Rules of R can be deleted, so we still have to regard a part of R.


   R
RRRI
       →TRS2
RRRPolo
           →TRS3
RRRPolo
             ...
               →TRS6
Removing Redundant Rules



Removing the following rules from R which fullfill a polynomial ordering:

from(X) -> cons(X, nfrom(s(X)))

where the Polynomial interpretation:
  POL(n__from(x1))=  1 + x1  
  POL(from(x1))=  2 + 2·x1  
  POL(n__cons(x1, x2))=  x1 + x2  
  POL(activate(x1))=  2·x1  
  POL(if(x1, x2, x3))=  x1 + 2·x2 + x3  
  POL(cons(x1, x2))=  x1 + x2  
  POL(true)=  0  
  POL(s(x1))=  x1  
was used.

Not all Rules of R can be deleted, so we still have to regard a part of R.


   R
RRRI
       →TRS2
RRRPolo
           →TRS3
RRRPolo
             ...
               →TRS7
Removing Redundant Rules



Removing the following rules from R which fullfill a polynomial ordering:

if(true, X, Y) -> activate(X)

where the Polynomial interpretation:
  POL(n__from(x1))=  x1  
  POL(from(x1))=  x1  
  POL(n__cons(x1, x2))=  x1 + x2  
  POL(activate(x1))=  x1  
  POL(if(x1, x2, x3))=  1 + x1 + x2 + x3  
  POL(cons(x1, x2))=  x1 + x2  
  POL(true)=  0  
was used.

Not all Rules of R can be deleted, so we still have to regard a part of R.


   R
RRRI
       →TRS2
RRRPolo
           →TRS3
RRRPolo
             ...
               →TRS8
Removing Redundant Rules



Removing the following rules from R which fullfill a polynomial ordering:

activate(nfrom(X)) -> from(X)

where the Polynomial interpretation:
  POL(n__cons(x1, x2))=  x1 + x2  
  POL(n__from(x1))=  1 + x1  
  POL(from(x1))=  x1  
  POL(activate(x1))=  x1  
  POL(cons(x1, x2))=  x1 + x2  
was used.

Not all Rules of R can be deleted, so we still have to regard a part of R.


   R
RRRI
       →TRS2
RRRPolo
           →TRS3
RRRPolo
             ...
               →TRS9
Removing Redundant Rules



Removing the following rules from R which fullfill a polynomial ordering:

activate(ncons(X1, X2)) -> cons(X1, X2)

where the Polynomial interpretation:
  POL(n__cons(x1, x2))=  x1 + x2  
  POL(activate(x1))=  1 + x1  
  POL(cons(x1, x2))=  x1 + x2  
was used.

All Rules of R can be deleted.


   R
RRRI
       →TRS2
RRRPolo
           →TRS3
RRRPolo
             ...
               →TRS10
Dependency Pair Analysis



R contains no Dependency Pairs and therefore no SCCs.

Innermost Termination of R successfully shown.
Duration:
0:00 minutes