Term Rewriting System R:
[X, XS, N, X1, X2]
from(X) -> cons(X, nfrom(ns(X)))
from(X) -> nfrom(X)
head(cons(X, XS)) -> X
2nd(cons(X, XS)) -> head(activate(XS))
take(0, XS) -> nil
take(s(N), cons(X, XS)) -> cons(X, ntake(N, activate(XS)))
take(X1, X2) -> ntake(X1, X2)
sel(0, cons(X, XS)) -> X
sel(s(N), cons(X, XS)) -> sel(N, activate(XS))
s(X) -> ns(X)
activate(nfrom(X)) -> from(activate(X))
activate(ns(X)) -> s(activate(X))
activate(ntake(X1, X2)) -> take(activate(X1), activate(X2))
activate(X) -> X

Termination of R to be shown.



   R
Dependency Pair Analysis



R contains the following Dependency Pairs:

2ND(cons(X, XS)) -> HEAD(activate(XS))
2ND(cons(X, XS)) -> ACTIVATE(XS)
TAKE(s(N), cons(X, XS)) -> ACTIVATE(XS)
SEL(s(N), cons(X, XS)) -> SEL(N, activate(XS))
SEL(s(N), cons(X, XS)) -> ACTIVATE(XS)
ACTIVATE(nfrom(X)) -> FROM(activate(X))
ACTIVATE(nfrom(X)) -> ACTIVATE(X)
ACTIVATE(ns(X)) -> S(activate(X))
ACTIVATE(ns(X)) -> ACTIVATE(X)
ACTIVATE(ntake(X1, X2)) -> TAKE(activate(X1), activate(X2))
ACTIVATE(ntake(X1, X2)) -> ACTIVATE(X1)
ACTIVATE(ntake(X1, X2)) -> ACTIVATE(X2)

Furthermore, R contains two SCCs.


   R
DPs
       →DP Problem 1
Negative Polynomial Order
       →DP Problem 2
SCP


Dependency Pairs:

ACTIVATE(ntake(X1, X2)) -> ACTIVATE(X2)
ACTIVATE(ntake(X1, X2)) -> ACTIVATE(X1)
TAKE(s(N), cons(X, XS)) -> ACTIVATE(XS)
ACTIVATE(ntake(X1, X2)) -> TAKE(activate(X1), activate(X2))
ACTIVATE(ns(X)) -> ACTIVATE(X)
ACTIVATE(nfrom(X)) -> ACTIVATE(X)


Rules:


from(X) -> cons(X, nfrom(ns(X)))
from(X) -> nfrom(X)
head(cons(X, XS)) -> X
2nd(cons(X, XS)) -> head(activate(XS))
take(0, XS) -> nil
take(s(N), cons(X, XS)) -> cons(X, ntake(N, activate(XS)))
take(X1, X2) -> ntake(X1, X2)
sel(0, cons(X, XS)) -> X
sel(s(N), cons(X, XS)) -> sel(N, activate(XS))
s(X) -> ns(X)
activate(nfrom(X)) -> from(activate(X))
activate(ns(X)) -> s(activate(X))
activate(ntake(X1, X2)) -> take(activate(X1), activate(X2))
activate(X) -> X





The following Dependency Pairs can be strictly oriented using the given order.

ACTIVATE(ntake(X1, X2)) -> ACTIVATE(X2)
ACTIVATE(ntake(X1, X2)) -> ACTIVATE(X1)
ACTIVATE(ntake(X1, X2)) -> TAKE(activate(X1), activate(X2))


Moreover, the following usable rules (regarding the implicit AFS) are oriented.

activate(nfrom(X)) -> from(activate(X))
activate(ns(X)) -> s(activate(X))
activate(ntake(X1, X2)) -> take(activate(X1), activate(X2))
activate(X) -> X
from(X) -> cons(X, nfrom(ns(X)))
from(X) -> nfrom(X)
s(X) -> ns(X)
take(0, XS) -> nil
take(s(N), cons(X, XS)) -> cons(X, ntake(N, activate(XS)))
take(X1, X2) -> ntake(X1, X2)


Used ordering:
Polynomial Order with Interpretation:

POL( ACTIVATE(x1) ) = x1

POL( ntake(x1, x2) ) = x1 + x2 + 1

POL( TAKE(x1, x2) ) = x2

POL( activate(x1) ) = x1

POL( nfrom(x1) ) = x1

POL( cons(x1, x2) ) = x2

POL( ns(x1) ) = x1

POL( from(x1) ) = x1

POL( s(x1) ) = x1

POL( take(x1, x2) ) = x1 + x2 + 1

POL( 0 ) = 0

POL( nil ) = 0


This results in one new DP problem.


   R
DPs
       →DP Problem 1
Neg POLO
           →DP Problem 3
Dependency Graph
       →DP Problem 2
SCP


Dependency Pairs:

TAKE(s(N), cons(X, XS)) -> ACTIVATE(XS)
ACTIVATE(ns(X)) -> ACTIVATE(X)
ACTIVATE(nfrom(X)) -> ACTIVATE(X)


Rules:


from(X) -> cons(X, nfrom(ns(X)))
from(X) -> nfrom(X)
head(cons(X, XS)) -> X
2nd(cons(X, XS)) -> head(activate(XS))
take(0, XS) -> nil
take(s(N), cons(X, XS)) -> cons(X, ntake(N, activate(XS)))
take(X1, X2) -> ntake(X1, X2)
sel(0, cons(X, XS)) -> X
sel(s(N), cons(X, XS)) -> sel(N, activate(XS))
s(X) -> ns(X)
activate(nfrom(X)) -> from(activate(X))
activate(ns(X)) -> s(activate(X))
activate(ntake(X1, X2)) -> take(activate(X1), activate(X2))
activate(X) -> X





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


   R
DPs
       →DP Problem 1
Neg POLO
           →DP Problem 3
DGraph
             ...
               →DP Problem 4
Size-Change Principle
       →DP Problem 2
SCP


Dependency Pairs:

ACTIVATE(ns(X)) -> ACTIVATE(X)
ACTIVATE(nfrom(X)) -> ACTIVATE(X)


Rules:


from(X) -> cons(X, nfrom(ns(X)))
from(X) -> nfrom(X)
head(cons(X, XS)) -> X
2nd(cons(X, XS)) -> head(activate(XS))
take(0, XS) -> nil
take(s(N), cons(X, XS)) -> cons(X, ntake(N, activate(XS)))
take(X1, X2) -> ntake(X1, X2)
sel(0, cons(X, XS)) -> X
sel(s(N), cons(X, XS)) -> sel(N, activate(XS))
s(X) -> ns(X)
activate(nfrom(X)) -> from(activate(X))
activate(ns(X)) -> s(activate(X))
activate(ntake(X1, X2)) -> take(activate(X1), activate(X2))
activate(X) -> X





We number the DPs as follows:
  1. ACTIVATE(ns(X)) -> ACTIVATE(X)
  2. ACTIVATE(nfrom(X)) -> ACTIVATE(X)
and get the following Size-Change Graph(s):
{2, 1} , {2, 1}
1>1

which lead(s) to this/these maximal multigraph(s):
{2, 1} , {2, 1}
1>1

DP: empty set
Oriented Rules: none

We used the order Homeomorphic Embedding Order with Non-Strict Precedence.
trivial

with Argument Filtering System:
nfrom(x1) -> nfrom(x1)
ns(x1) -> ns(x1)

We obtain no new DP problems.


   R
DPs
       →DP Problem 1
Neg POLO
       →DP Problem 2
Size-Change Principle


Dependency Pair:

SEL(s(N), cons(X, XS)) -> SEL(N, activate(XS))


Rules:


from(X) -> cons(X, nfrom(ns(X)))
from(X) -> nfrom(X)
head(cons(X, XS)) -> X
2nd(cons(X, XS)) -> head(activate(XS))
take(0, XS) -> nil
take(s(N), cons(X, XS)) -> cons(X, ntake(N, activate(XS)))
take(X1, X2) -> ntake(X1, X2)
sel(0, cons(X, XS)) -> X
sel(s(N), cons(X, XS)) -> sel(N, activate(XS))
s(X) -> ns(X)
activate(nfrom(X)) -> from(activate(X))
activate(ns(X)) -> s(activate(X))
activate(ntake(X1, X2)) -> take(activate(X1), activate(X2))
activate(X) -> X





We number the DPs as follows:
  1. SEL(s(N), cons(X, XS)) -> SEL(N, activate(XS))
and get the following Size-Change Graph(s):
{1} , {1}
1>1

which lead(s) to this/these maximal multigraph(s):
{1} , {1}
1>1

DP: empty set
Oriented Rules: none

We used the order Homeomorphic Embedding Order with Non-Strict Precedence.
trivial

with Argument Filtering System:
cons(x1, x2) -> cons(x1, x2)
s(x1) -> s(x1)

We obtain no new DP problems.

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