Term Rewriting System R:
[X, Y, M, N, X1, X2, X3]
filter(cons(X, Y), 0, M) -> cons(0, nfilter(activate(Y), M, M))
filter(cons(X, Y), s(N), M) -> cons(X, nfilter(activate(Y), N, M))
filter(X1, X2, X3) -> nfilter(X1, X2, X3)
sieve(cons(0, Y)) -> cons(0, nsieve(activate(Y)))
sieve(cons(s(N), Y)) -> cons(s(N), nsieve(filter(activate(Y), N, N)))
sieve(X) -> nsieve(X)
nats(N) -> cons(N, nnats(s(N)))
nats(X) -> nnats(X)
zprimes -> sieve(nats(s(s(0))))
activate(nfilter(X1, X2, X3)) -> filter(X1, X2, X3)
activate(nsieve(X)) -> sieve(X)
activate(nnats(X)) -> nats(X)
activate(X) -> X

Termination of R to be shown.



   R
Dependency Pair Analysis



R contains the following Dependency Pairs:

FILTER(cons(X, Y), 0, M) -> ACTIVATE(Y)
FILTER(cons(X, Y), s(N), M) -> ACTIVATE(Y)
SIEVE(cons(0, Y)) -> ACTIVATE(Y)
SIEVE(cons(s(N), Y)) -> FILTER(activate(Y), N, N)
SIEVE(cons(s(N), Y)) -> ACTIVATE(Y)
ZPRIMES -> SIEVE(nats(s(s(0))))
ZPRIMES -> NATS(s(s(0)))
ACTIVATE(nfilter(X1, X2, X3)) -> FILTER(X1, X2, X3)
ACTIVATE(nsieve(X)) -> SIEVE(X)
ACTIVATE(nnats(X)) -> NATS(X)

Furthermore, R contains one SCC.


   R
DPs
       →DP Problem 1
Polynomial Ordering


Dependency Pairs:

SIEVE(cons(s(N), Y)) -> ACTIVATE(Y)
SIEVE(cons(s(N), Y)) -> FILTER(activate(Y), N, N)
SIEVE(cons(0, Y)) -> ACTIVATE(Y)
ACTIVATE(nsieve(X)) -> SIEVE(X)
FILTER(cons(X, Y), s(N), M) -> ACTIVATE(Y)
ACTIVATE(nfilter(X1, X2, X3)) -> FILTER(X1, X2, X3)
FILTER(cons(X, Y), 0, M) -> ACTIVATE(Y)


Rules:


filter(cons(X, Y), 0, M) -> cons(0, nfilter(activate(Y), M, M))
filter(cons(X, Y), s(N), M) -> cons(X, nfilter(activate(Y), N, M))
filter(X1, X2, X3) -> nfilter(X1, X2, X3)
sieve(cons(0, Y)) -> cons(0, nsieve(activate(Y)))
sieve(cons(s(N), Y)) -> cons(s(N), nsieve(filter(activate(Y), N, N)))
sieve(X) -> nsieve(X)
nats(N) -> cons(N, nnats(s(N)))
nats(X) -> nnats(X)
zprimes -> sieve(nats(s(s(0))))
activate(nfilter(X1, X2, X3)) -> filter(X1, X2, X3)
activate(nsieve(X)) -> sieve(X)
activate(nnats(X)) -> nats(X)
activate(X) -> X





The following dependency pairs can be strictly oriented:

SIEVE(cons(s(N), Y)) -> ACTIVATE(Y)
SIEVE(cons(s(N), Y)) -> FILTER(activate(Y), N, N)
SIEVE(cons(0, Y)) -> ACTIVATE(Y)


Additionally, the following usable rules using the Ce-refinement can be oriented:

activate(nfilter(X1, X2, X3)) -> filter(X1, X2, X3)
activate(nsieve(X)) -> sieve(X)
activate(nnats(X)) -> nats(X)
activate(X) -> X
sieve(cons(0, Y)) -> cons(0, nsieve(activate(Y)))
sieve(cons(s(N), Y)) -> cons(s(N), nsieve(filter(activate(Y), N, N)))
sieve(X) -> nsieve(X)
filter(cons(X, Y), 0, M) -> cons(0, nfilter(activate(Y), M, M))
filter(cons(X, Y), s(N), M) -> cons(X, nfilter(activate(Y), N, M))
filter(X1, X2, X3) -> nfilter(X1, X2, X3)
nats(N) -> cons(N, nnats(s(N)))
nats(X) -> nnats(X)


Used ordering: Polynomial ordering with Polynomial interpretation:
  POL(activate(x1))=  x1  
  POL(filter(x1, x2, x3))=  x1  
  POL(FILTER(x1, x2, x3))=  x1  
  POL(SIEVE(x1))=  1 + x1  
  POL(n__sieve(x1))=  1 + x1  
  POL(ACTIVATE(x1))=  x1  
  POL(sieve(x1))=  1 + x1  
  POL(n__filter(x1, x2, x3))=  x1  
  POL(0)=  0  
  POL(cons(x1, x2))=  x2  
  POL(n__nats(x1))=  0  
  POL(nats(x1))=  0  
  POL(s(x1))=  0  

resulting in one new DP problem.



   R
DPs
       →DP Problem 1
Polo
           →DP Problem 2
Dependency Graph


Dependency Pairs:

ACTIVATE(nsieve(X)) -> SIEVE(X)
FILTER(cons(X, Y), s(N), M) -> ACTIVATE(Y)
ACTIVATE(nfilter(X1, X2, X3)) -> FILTER(X1, X2, X3)
FILTER(cons(X, Y), 0, M) -> ACTIVATE(Y)


Rules:


filter(cons(X, Y), 0, M) -> cons(0, nfilter(activate(Y), M, M))
filter(cons(X, Y), s(N), M) -> cons(X, nfilter(activate(Y), N, M))
filter(X1, X2, X3) -> nfilter(X1, X2, X3)
sieve(cons(0, Y)) -> cons(0, nsieve(activate(Y)))
sieve(cons(s(N), Y)) -> cons(s(N), nsieve(filter(activate(Y), N, N)))
sieve(X) -> nsieve(X)
nats(N) -> cons(N, nnats(s(N)))
nats(X) -> nnats(X)
zprimes -> sieve(nats(s(s(0))))
activate(nfilter(X1, X2, X3)) -> filter(X1, X2, X3)
activate(nsieve(X)) -> sieve(X)
activate(nnats(X)) -> nats(X)
activate(X) -> X





Using the Dependency Graph the DP problem was split into 1 DP problems.


   R
DPs
       →DP Problem 1
Polo
           →DP Problem 2
DGraph
             ...
               →DP Problem 3
Polynomial Ordering


Dependency Pairs:

FILTER(cons(X, Y), 0, M) -> ACTIVATE(Y)
ACTIVATE(nfilter(X1, X2, X3)) -> FILTER(X1, X2, X3)
FILTER(cons(X, Y), s(N), M) -> ACTIVATE(Y)


Rules:


filter(cons(X, Y), 0, M) -> cons(0, nfilter(activate(Y), M, M))
filter(cons(X, Y), s(N), M) -> cons(X, nfilter(activate(Y), N, M))
filter(X1, X2, X3) -> nfilter(X1, X2, X3)
sieve(cons(0, Y)) -> cons(0, nsieve(activate(Y)))
sieve(cons(s(N), Y)) -> cons(s(N), nsieve(filter(activate(Y), N, N)))
sieve(X) -> nsieve(X)
nats(N) -> cons(N, nnats(s(N)))
nats(X) -> nnats(X)
zprimes -> sieve(nats(s(s(0))))
activate(nfilter(X1, X2, X3)) -> filter(X1, X2, X3)
activate(nsieve(X)) -> sieve(X)
activate(nnats(X)) -> nats(X)
activate(X) -> X





The following dependency pair can be strictly oriented:

FILTER(cons(X, Y), 0, M) -> ACTIVATE(Y)


There are no usable rules using the Ce-refinement that need to be oriented.

Used ordering: Polynomial ordering with Polynomial interpretation:
  POL(FILTER(x1, x2, x3))=  x1 + x2  
  POL(0)=  1  
  POL(n__filter(x1, x2, x3))=  x1 + x2  
  POL(cons(x1, x2))=  x2  
  POL(s(x1))=  0  
  POL(ACTIVATE(x1))=  x1  

resulting in one new DP problem.



   R
DPs
       →DP Problem 1
Polo
           →DP Problem 2
DGraph
             ...
               →DP Problem 4
Polynomial Ordering


Dependency Pairs:

ACTIVATE(nfilter(X1, X2, X3)) -> FILTER(X1, X2, X3)
FILTER(cons(X, Y), s(N), M) -> ACTIVATE(Y)


Rules:


filter(cons(X, Y), 0, M) -> cons(0, nfilter(activate(Y), M, M))
filter(cons(X, Y), s(N), M) -> cons(X, nfilter(activate(Y), N, M))
filter(X1, X2, X3) -> nfilter(X1, X2, X3)
sieve(cons(0, Y)) -> cons(0, nsieve(activate(Y)))
sieve(cons(s(N), Y)) -> cons(s(N), nsieve(filter(activate(Y), N, N)))
sieve(X) -> nsieve(X)
nats(N) -> cons(N, nnats(s(N)))
nats(X) -> nnats(X)
zprimes -> sieve(nats(s(s(0))))
activate(nfilter(X1, X2, X3)) -> filter(X1, X2, X3)
activate(nsieve(X)) -> sieve(X)
activate(nnats(X)) -> nats(X)
activate(X) -> X





The following dependency pair can be strictly oriented:

ACTIVATE(nfilter(X1, X2, X3)) -> FILTER(X1, X2, X3)


There are no usable rules using the Ce-refinement that need to be oriented.

Used ordering: Polynomial ordering with Polynomial interpretation:
  POL(n__filter(x1, x2, x3))=  1 + x1  
  POL(FILTER(x1, x2, x3))=  x1  
  POL(cons(x1, x2))=  x2  
  POL(s(x1))=  0  
  POL(ACTIVATE(x1))=  x1  

resulting in one new DP problem.



   R
DPs
       →DP Problem 1
Polo
           →DP Problem 2
DGraph
             ...
               →DP Problem 5
Dependency Graph


Dependency Pair:

FILTER(cons(X, Y), s(N), M) -> ACTIVATE(Y)


Rules:


filter(cons(X, Y), 0, M) -> cons(0, nfilter(activate(Y), M, M))
filter(cons(X, Y), s(N), M) -> cons(X, nfilter(activate(Y), N, M))
filter(X1, X2, X3) -> nfilter(X1, X2, X3)
sieve(cons(0, Y)) -> cons(0, nsieve(activate(Y)))
sieve(cons(s(N), Y)) -> cons(s(N), nsieve(filter(activate(Y), N, N)))
sieve(X) -> nsieve(X)
nats(N) -> cons(N, nnats(s(N)))
nats(X) -> nnats(X)
zprimes -> sieve(nats(s(s(0))))
activate(nfilter(X1, X2, X3)) -> filter(X1, X2, X3)
activate(nsieve(X)) -> sieve(X)
activate(nnats(X)) -> nats(X)
activate(X) -> X





Using the Dependency Graph resulted in no new DP problems.

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