Term Rewriting System R:
[X, XS, N, X1, X2]
from(X) -> cons(X, nfrom(s(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))
activate(nfrom(X)) -> from(X)
activate(ntake(X1, X2)) -> take(X1, X2)
activate(X) -> X

Innermost 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(X)
ACTIVATE(ntake(X1, X2)) -> TAKE(X1, X2)

Furthermore, R contains two SCCs.

R
DPs
→DP Problem 1
Polynomial Ordering
→DP Problem 2
Polo

Dependency Pairs:

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

Rules:

from(X) -> cons(X, nfrom(s(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))
activate(nfrom(X)) -> from(X)
activate(ntake(X1, X2)) -> take(X1, X2)
activate(X) -> X

Strategy:

innermost

The following dependency pair can be strictly oriented:

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

There are no usable rules for innermost w.r.t. to the implicit AFS that need to be oriented.

Used ordering: Polynomial ordering with Polynomial interpretation:
 POL(cons(x1, x2)) =  x2 POL(n__take(x1, x2)) =  1 + x2 POL(TAKE(x1, x2)) =  x2 POL(s(x1)) =  x1 POL(ACTIVATE(x1)) =  x1

resulting in one new DP problem.

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

Dependency Pair:

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

Rules:

from(X) -> cons(X, nfrom(s(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))
activate(nfrom(X)) -> from(X)
activate(ntake(X1, X2)) -> take(X1, X2)
activate(X) -> X

Strategy:

innermost

Using the Dependency Graph resulted in no new DP problems.

R
DPs
→DP Problem 1
Polo
→DP Problem 2
Polynomial Ordering

Dependency Pair:

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

Rules:

from(X) -> cons(X, nfrom(s(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))
activate(nfrom(X)) -> from(X)
activate(ntake(X1, X2)) -> take(X1, X2)
activate(X) -> X

Strategy:

innermost

The following dependency pair can be strictly oriented:

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

There are no usable rules for innermost w.r.t. to the implicit AFS that need to be oriented.

Used ordering: Polynomial ordering with Polynomial interpretation:
 POL(n__from(x1)) =  0 POL(from(x1)) =  0 POL(activate(x1)) =  0 POL(0) =  0 POL(n__take(x1, x2)) =  0 POL(cons(x1, x2)) =  0 POL(SEL(x1, x2)) =  x1 POL(take(x1, x2)) =  0 POL(nil) =  0 POL(s(x1)) =  1 + x1

resulting in one new DP problem.

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

Dependency Pair:

Rules:

from(X) -> cons(X, nfrom(s(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))
activate(nfrom(X)) -> from(X)
activate(ntake(X1, X2)) -> take(X1, X2)
activate(X) -> X

Strategy:

innermost

Using the Dependency Graph resulted in no new DP problems.

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