Term Rewriting System R:
[X, Y, M, N, X1, X2, X3]
afilter(cons(X, Y), 0, M) -> cons(0, filter(Y, M, M))
afilter(cons(X, Y), s(N), M) -> cons(mark(X), filter(Y, N, M))
afilter(X1, X2, X3) -> filter(X1, X2, X3)
asieve(cons(0, Y)) -> cons(0, sieve(Y))
asieve(cons(s(N), Y)) -> cons(s(mark(N)), sieve(filter(Y, N, N)))
asieve(X) -> sieve(X)
anats(N) -> cons(mark(N), nats(s(N)))
anats(X) -> nats(X)
azprimes -> asieve(anats(s(s(0))))
azprimes -> zprimes
mark(filter(X1, X2, X3)) -> afilter(mark(X1), mark(X2), mark(X3))
mark(sieve(X)) -> asieve(mark(X))
mark(nats(X)) -> anats(mark(X))
mark(zprimes) -> azprimes
mark(cons(X1, X2)) -> cons(mark(X1), X2)
mark(0) -> 0
mark(s(X)) -> s(mark(X))

Innermost Termination of R to be shown.



   R
Dependency Pair Analysis



R contains the following Dependency Pairs:

AFILTER(cons(X, Y), s(N), M) -> MARK(X)
ASIEVE(cons(s(N), Y)) -> MARK(N)
ANATS(N) -> MARK(N)
AZPRIMES -> ASIEVE(anats(s(s(0))))
AZPRIMES -> ANATS(s(s(0)))
MARK(filter(X1, X2, X3)) -> AFILTER(mark(X1), mark(X2), mark(X3))
MARK(filter(X1, X2, X3)) -> MARK(X1)
MARK(filter(X1, X2, X3)) -> MARK(X2)
MARK(filter(X1, X2, X3)) -> MARK(X3)
MARK(sieve(X)) -> ASIEVE(mark(X))
MARK(sieve(X)) -> MARK(X)
MARK(nats(X)) -> ANATS(mark(X))
MARK(nats(X)) -> MARK(X)
MARK(zprimes) -> AZPRIMES
MARK(cons(X1, X2)) -> MARK(X1)
MARK(s(X)) -> MARK(X)

Furthermore, R contains one SCC.


   R
DPs
       →DP Problem 1
Narrowing Transformation


Dependency Pairs:

MARK(s(X)) -> MARK(X)
MARK(cons(X1, X2)) -> MARK(X1)
AZPRIMES -> ANATS(s(s(0)))
AZPRIMES -> ASIEVE(anats(s(s(0))))
MARK(zprimes) -> AZPRIMES
MARK(nats(X)) -> MARK(X)
ANATS(N) -> MARK(N)
MARK(nats(X)) -> ANATS(mark(X))
MARK(sieve(X)) -> MARK(X)
ASIEVE(cons(s(N), Y)) -> MARK(N)
MARK(sieve(X)) -> ASIEVE(mark(X))
MARK(filter(X1, X2, X3)) -> MARK(X3)
MARK(filter(X1, X2, X3)) -> MARK(X2)
MARK(filter(X1, X2, X3)) -> MARK(X1)
MARK(filter(X1, X2, X3)) -> AFILTER(mark(X1), mark(X2), mark(X3))
AFILTER(cons(X, Y), s(N), M) -> MARK(X)


Rules:


afilter(cons(X, Y), 0, M) -> cons(0, filter(Y, M, M))
afilter(cons(X, Y), s(N), M) -> cons(mark(X), filter(Y, N, M))
afilter(X1, X2, X3) -> filter(X1, X2, X3)
asieve(cons(0, Y)) -> cons(0, sieve(Y))
asieve(cons(s(N), Y)) -> cons(s(mark(N)), sieve(filter(Y, N, N)))
asieve(X) -> sieve(X)
anats(N) -> cons(mark(N), nats(s(N)))
anats(X) -> nats(X)
azprimes -> asieve(anats(s(s(0))))
azprimes -> zprimes
mark(filter(X1, X2, X3)) -> afilter(mark(X1), mark(X2), mark(X3))
mark(sieve(X)) -> asieve(mark(X))
mark(nats(X)) -> anats(mark(X))
mark(zprimes) -> azprimes
mark(cons(X1, X2)) -> cons(mark(X1), X2)
mark(0) -> 0
mark(s(X)) -> s(mark(X))


Strategy:

innermost




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

AZPRIMES -> ASIEVE(anats(s(s(0))))
two new Dependency Pairs are created:

AZPRIMES -> ASIEVE(cons(mark(s(s(0))), nats(s(s(s(0))))))
AZPRIMES -> ASIEVE(nats(s(s(0))))

The transformation is resulting in one new DP problem:



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


Dependency Pairs:

MARK(cons(X1, X2)) -> MARK(X1)
AZPRIMES -> ASIEVE(cons(mark(s(s(0))), nats(s(s(s(0))))))
AZPRIMES -> ANATS(s(s(0)))
MARK(zprimes) -> AZPRIMES
MARK(nats(X)) -> MARK(X)
ANATS(N) -> MARK(N)
MARK(nats(X)) -> ANATS(mark(X))
MARK(sieve(X)) -> MARK(X)
ASIEVE(cons(s(N), Y)) -> MARK(N)
MARK(sieve(X)) -> ASIEVE(mark(X))
MARK(filter(X1, X2, X3)) -> MARK(X3)
MARK(filter(X1, X2, X3)) -> MARK(X2)
MARK(filter(X1, X2, X3)) -> MARK(X1)
AFILTER(cons(X, Y), s(N), M) -> MARK(X)
MARK(filter(X1, X2, X3)) -> AFILTER(mark(X1), mark(X2), mark(X3))
MARK(s(X)) -> MARK(X)


Rules:


afilter(cons(X, Y), 0, M) -> cons(0, filter(Y, M, M))
afilter(cons(X, Y), s(N), M) -> cons(mark(X), filter(Y, N, M))
afilter(X1, X2, X3) -> filter(X1, X2, X3)
asieve(cons(0, Y)) -> cons(0, sieve(Y))
asieve(cons(s(N), Y)) -> cons(s(mark(N)), sieve(filter(Y, N, N)))
asieve(X) -> sieve(X)
anats(N) -> cons(mark(N), nats(s(N)))
anats(X) -> nats(X)
azprimes -> asieve(anats(s(s(0))))
azprimes -> zprimes
mark(filter(X1, X2, X3)) -> afilter(mark(X1), mark(X2), mark(X3))
mark(sieve(X)) -> asieve(mark(X))
mark(nats(X)) -> anats(mark(X))
mark(zprimes) -> azprimes
mark(cons(X1, X2)) -> cons(mark(X1), X2)
mark(0) -> 0
mark(s(X)) -> s(mark(X))


Strategy:

innermost




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

MARK(filter(X1, X2, X3)) -> AFILTER(mark(X1), mark(X2), mark(X3))
21 new Dependency Pairs are created:

MARK(filter(filter(X1'', X2'', X3''), X2, X3)) -> AFILTER(afilter(mark(X1''), mark(X2''), mark(X3'')), mark(X2), mark(X3))
MARK(filter(sieve(X'), X2, X3)) -> AFILTER(asieve(mark(X')), mark(X2), mark(X3))
MARK(filter(nats(X'), X2, X3)) -> AFILTER(anats(mark(X')), mark(X2), mark(X3))
MARK(filter(zprimes, X2, X3)) -> AFILTER(azprimes, mark(X2), mark(X3))
MARK(filter(cons(X1'', X2''), X2, X3)) -> AFILTER(cons(mark(X1''), X2''), mark(X2), mark(X3))
MARK(filter(0, X2, X3)) -> AFILTER(0, mark(X2), mark(X3))
MARK(filter(s(X'), X2, X3)) -> AFILTER(s(mark(X')), mark(X2), mark(X3))
MARK(filter(X1, filter(X1'', X2'', X3''), X3)) -> AFILTER(mark(X1), afilter(mark(X1''), mark(X2''), mark(X3'')), mark(X3))
MARK(filter(X1, sieve(X'), X3)) -> AFILTER(mark(X1), asieve(mark(X')), mark(X3))
MARK(filter(X1, nats(X'), X3)) -> AFILTER(mark(X1), anats(mark(X')), mark(X3))
MARK(filter(X1, zprimes, X3)) -> AFILTER(mark(X1), azprimes, mark(X3))
MARK(filter(X1, cons(X1'', X2''), X3)) -> AFILTER(mark(X1), cons(mark(X1''), X2''), mark(X3))
MARK(filter(X1, 0, X3)) -> AFILTER(mark(X1), 0, mark(X3))
MARK(filter(X1, s(X'), X3)) -> AFILTER(mark(X1), s(mark(X')), mark(X3))
MARK(filter(X1, X2, filter(X1'', X2'', X3''))) -> AFILTER(mark(X1), mark(X2), afilter(mark(X1''), mark(X2''), mark(X3'')))
MARK(filter(X1, X2, sieve(X'))) -> AFILTER(mark(X1), mark(X2), asieve(mark(X')))
MARK(filter(X1, X2, nats(X'))) -> AFILTER(mark(X1), mark(X2), anats(mark(X')))
MARK(filter(X1, X2, zprimes)) -> AFILTER(mark(X1), mark(X2), azprimes)
MARK(filter(X1, X2, cons(X1'', X2''))) -> AFILTER(mark(X1), mark(X2), cons(mark(X1''), X2''))
MARK(filter(X1, X2, 0)) -> AFILTER(mark(X1), mark(X2), 0)
MARK(filter(X1, X2, s(X'))) -> AFILTER(mark(X1), mark(X2), s(mark(X')))

The transformation is resulting in one new DP problem:



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


Dependency Pairs:

MARK(filter(X1, X2, s(X'))) -> AFILTER(mark(X1), mark(X2), s(mark(X')))
MARK(filter(X1, X2, 0)) -> AFILTER(mark(X1), mark(X2), 0)
MARK(filter(X1, X2, cons(X1'', X2''))) -> AFILTER(mark(X1), mark(X2), cons(mark(X1''), X2''))
MARK(filter(X1, X2, zprimes)) -> AFILTER(mark(X1), mark(X2), azprimes)
MARK(filter(X1, X2, nats(X'))) -> AFILTER(mark(X1), mark(X2), anats(mark(X')))
MARK(filter(X1, X2, sieve(X'))) -> AFILTER(mark(X1), mark(X2), asieve(mark(X')))
MARK(filter(X1, X2, filter(X1'', X2'', X3''))) -> AFILTER(mark(X1), mark(X2), afilter(mark(X1''), mark(X2''), mark(X3'')))
MARK(filter(X1, s(X'), X3)) -> AFILTER(mark(X1), s(mark(X')), mark(X3))
MARK(filter(X1, zprimes, X3)) -> AFILTER(mark(X1), azprimes, mark(X3))
MARK(filter(X1, nats(X'), X3)) -> AFILTER(mark(X1), anats(mark(X')), mark(X3))
MARK(filter(X1, sieve(X'), X3)) -> AFILTER(mark(X1), asieve(mark(X')), mark(X3))
MARK(filter(X1, filter(X1'', X2'', X3''), X3)) -> AFILTER(mark(X1), afilter(mark(X1''), mark(X2''), mark(X3'')), mark(X3))
MARK(filter(cons(X1'', X2''), X2, X3)) -> AFILTER(cons(mark(X1''), X2''), mark(X2), mark(X3))
MARK(filter(zprimes, X2, X3)) -> AFILTER(azprimes, mark(X2), mark(X3))
MARK(filter(nats(X'), X2, X3)) -> AFILTER(anats(mark(X')), mark(X2), mark(X3))
MARK(filter(sieve(X'), X2, X3)) -> AFILTER(asieve(mark(X')), mark(X2), mark(X3))
AFILTER(cons(X, Y), s(N), M) -> MARK(X)
MARK(filter(filter(X1'', X2'', X3''), X2, X3)) -> AFILTER(afilter(mark(X1''), mark(X2''), mark(X3'')), mark(X2), mark(X3))
MARK(s(X)) -> MARK(X)
AZPRIMES -> ASIEVE(cons(mark(s(s(0))), nats(s(s(s(0))))))
AZPRIMES -> ANATS(s(s(0)))
MARK(zprimes) -> AZPRIMES
MARK(nats(X)) -> MARK(X)
ANATS(N) -> MARK(N)
MARK(nats(X)) -> ANATS(mark(X))
MARK(sieve(X)) -> MARK(X)
ASIEVE(cons(s(N), Y)) -> MARK(N)
MARK(sieve(X)) -> ASIEVE(mark(X))
MARK(filter(X1, X2, X3)) -> MARK(X3)
MARK(filter(X1, X2, X3)) -> MARK(X2)
MARK(filter(X1, X2, X3)) -> MARK(X1)
MARK(cons(X1, X2)) -> MARK(X1)


Rules:


afilter(cons(X, Y), 0, M) -> cons(0, filter(Y, M, M))
afilter(cons(X, Y), s(N), M) -> cons(mark(X), filter(Y, N, M))
afilter(X1, X2, X3) -> filter(X1, X2, X3)
asieve(cons(0, Y)) -> cons(0, sieve(Y))
asieve(cons(s(N), Y)) -> cons(s(mark(N)), sieve(filter(Y, N, N)))
asieve(X) -> sieve(X)
anats(N) -> cons(mark(N), nats(s(N)))
anats(X) -> nats(X)
azprimes -> asieve(anats(s(s(0))))
azprimes -> zprimes
mark(filter(X1, X2, X3)) -> afilter(mark(X1), mark(X2), mark(X3))
mark(sieve(X)) -> asieve(mark(X))
mark(nats(X)) -> anats(mark(X))
mark(zprimes) -> azprimes
mark(cons(X1, X2)) -> cons(mark(X1), X2)
mark(0) -> 0
mark(s(X)) -> s(mark(X))


Strategy:

innermost




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

MARK(sieve(X)) -> ASIEVE(mark(X))
seven new Dependency Pairs are created:

MARK(sieve(filter(X1', X2', X3'))) -> ASIEVE(afilter(mark(X1'), mark(X2'), mark(X3')))
MARK(sieve(sieve(X''))) -> ASIEVE(asieve(mark(X'')))
MARK(sieve(nats(X''))) -> ASIEVE(anats(mark(X'')))
MARK(sieve(zprimes)) -> ASIEVE(azprimes)
MARK(sieve(cons(X1', X2'))) -> ASIEVE(cons(mark(X1'), X2'))
MARK(sieve(0)) -> ASIEVE(0)
MARK(sieve(s(X''))) -> ASIEVE(s(mark(X'')))

The transformation is resulting in one new DP problem:



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




The following remains to be proven:
Dependency Pairs:

MARK(sieve(cons(X1', X2'))) -> ASIEVE(cons(mark(X1'), X2'))
MARK(sieve(zprimes)) -> ASIEVE(azprimes)
MARK(sieve(nats(X''))) -> ASIEVE(anats(mark(X'')))
MARK(sieve(sieve(X''))) -> ASIEVE(asieve(mark(X'')))
MARK(sieve(filter(X1', X2', X3'))) -> ASIEVE(afilter(mark(X1'), mark(X2'), mark(X3')))
MARK(filter(X1, X2, 0)) -> AFILTER(mark(X1), mark(X2), 0)
MARK(filter(X1, X2, cons(X1'', X2''))) -> AFILTER(mark(X1), mark(X2), cons(mark(X1''), X2''))
MARK(filter(X1, X2, zprimes)) -> AFILTER(mark(X1), mark(X2), azprimes)
MARK(filter(X1, X2, nats(X'))) -> AFILTER(mark(X1), mark(X2), anats(mark(X')))
MARK(filter(X1, X2, sieve(X'))) -> AFILTER(mark(X1), mark(X2), asieve(mark(X')))
MARK(filter(X1, X2, filter(X1'', X2'', X3''))) -> AFILTER(mark(X1), mark(X2), afilter(mark(X1''), mark(X2''), mark(X3'')))
MARK(filter(X1, s(X'), X3)) -> AFILTER(mark(X1), s(mark(X')), mark(X3))
MARK(filter(X1, zprimes, X3)) -> AFILTER(mark(X1), azprimes, mark(X3))
MARK(filter(X1, nats(X'), X3)) -> AFILTER(mark(X1), anats(mark(X')), mark(X3))
MARK(filter(X1, sieve(X'), X3)) -> AFILTER(mark(X1), asieve(mark(X')), mark(X3))
MARK(filter(X1, filter(X1'', X2'', X3''), X3)) -> AFILTER(mark(X1), afilter(mark(X1''), mark(X2''), mark(X3'')), mark(X3))
MARK(filter(cons(X1'', X2''), X2, X3)) -> AFILTER(cons(mark(X1''), X2''), mark(X2), mark(X3))
MARK(filter(zprimes, X2, X3)) -> AFILTER(azprimes, mark(X2), mark(X3))
MARK(filter(nats(X'), X2, X3)) -> AFILTER(anats(mark(X')), mark(X2), mark(X3))
MARK(filter(sieve(X'), X2, X3)) -> AFILTER(asieve(mark(X')), mark(X2), mark(X3))
MARK(filter(filter(X1'', X2'', X3''), X2, X3)) -> AFILTER(afilter(mark(X1''), mark(X2''), mark(X3'')), mark(X2), mark(X3))
MARK(s(X)) -> MARK(X)
MARK(cons(X1, X2)) -> MARK(X1)
ASIEVE(cons(s(N), Y)) -> MARK(N)
AZPRIMES -> ASIEVE(cons(mark(s(s(0))), nats(s(s(s(0))))))
AZPRIMES -> ANATS(s(s(0)))
MARK(zprimes) -> AZPRIMES
MARK(nats(X)) -> MARK(X)
ANATS(N) -> MARK(N)
MARK(nats(X)) -> ANATS(mark(X))
MARK(sieve(X)) -> MARK(X)
MARK(filter(X1, X2, X3)) -> MARK(X3)
MARK(filter(X1, X2, X3)) -> MARK(X2)
MARK(filter(X1, X2, X3)) -> MARK(X1)
AFILTER(cons(X, Y), s(N), M) -> MARK(X)
MARK(filter(X1, X2, s(X'))) -> AFILTER(mark(X1), mark(X2), s(mark(X')))


Rules:


afilter(cons(X, Y), 0, M) -> cons(0, filter(Y, M, M))
afilter(cons(X, Y), s(N), M) -> cons(mark(X), filter(Y, N, M))
afilter(X1, X2, X3) -> filter(X1, X2, X3)
asieve(cons(0, Y)) -> cons(0, sieve(Y))
asieve(cons(s(N), Y)) -> cons(s(mark(N)), sieve(filter(Y, N, N)))
asieve(X) -> sieve(X)
anats(N) -> cons(mark(N), nats(s(N)))
anats(X) -> nats(X)
azprimes -> asieve(anats(s(s(0))))
azprimes -> zprimes
mark(filter(X1, X2, X3)) -> afilter(mark(X1), mark(X2), mark(X3))
mark(sieve(X)) -> asieve(mark(X))
mark(nats(X)) -> anats(mark(X))
mark(zprimes) -> azprimes
mark(cons(X1, X2)) -> cons(mark(X1), X2)
mark(0) -> 0
mark(s(X)) -> s(mark(X))


Strategy:

innermost



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