Term Rewriting System R:
[N, X, Y, Z, X1, X2]
terms(N) -> cons(recip(sqr(N)), nterms(ns(N)))
terms(X) -> nterms(X)
sqr(0) -> 0
dbl(0) -> 0
dbl(s(X)) -> s(s(dbl(X)))
first(0, X) -> nil
first(s(X), cons(Y, Z)) -> cons(Y, nfirst(X, activate(Z)))
first(X1, X2) -> nfirst(X1, X2)
s(X) -> ns(X)
activate(nterms(X)) -> terms(activate(X))
activate(ns(X)) -> s(activate(X))
activate(nfirst(X1, X2)) -> first(activate(X1), activate(X2))
activate(X) -> X

Termination of R to be shown.

`   R`
`     ↳Dependency Pair Analysis`

R contains the following Dependency Pairs:

TERMS(N) -> SQR(N)
SQR(s(X)) -> SQR(X)
SQR(s(X)) -> DBL(X)
DBL(s(X)) -> S(s(dbl(X)))
DBL(s(X)) -> S(dbl(X))
DBL(s(X)) -> DBL(X)
FIRST(s(X), cons(Y, Z)) -> ACTIVATE(Z)
ACTIVATE(nterms(X)) -> TERMS(activate(X))
ACTIVATE(nterms(X)) -> ACTIVATE(X)
ACTIVATE(ns(X)) -> S(activate(X))
ACTIVATE(ns(X)) -> ACTIVATE(X)
ACTIVATE(nfirst(X1, X2)) -> FIRST(activate(X1), activate(X2))
ACTIVATE(nfirst(X1, X2)) -> ACTIVATE(X1)
ACTIVATE(nfirst(X1, X2)) -> ACTIVATE(X2)

Furthermore, R contains four SCCs.

`   R`
`     ↳DPs`
`       →DP Problem 1`
`         ↳Argument Filtering and Ordering`
`       →DP Problem 2`
`         ↳AFS`
`       →DP Problem 3`
`         ↳AFS`
`       →DP Problem 4`
`         ↳AFS`

Dependency Pair:

Rules:

terms(N) -> cons(recip(sqr(N)), nterms(ns(N)))
terms(X) -> nterms(X)
sqr(0) -> 0
dbl(0) -> 0
dbl(s(X)) -> s(s(dbl(X)))
first(0, X) -> nil
first(s(X), cons(Y, Z)) -> cons(Y, nfirst(X, activate(Z)))
first(X1, X2) -> nfirst(X1, X2)
s(X) -> ns(X)
activate(nterms(X)) -> terms(activate(X))
activate(ns(X)) -> s(activate(X))
activate(nfirst(X1, X2)) -> first(activate(X1), activate(X2))
activate(X) -> X

The following dependency pair can be strictly oriented:

There are no usable rules using the Ce-refinement that need to be oriented.
Used ordering: Polynomial ordering with Polynomial interpretation:
 POL(s(x1)) =  1 + x1 POL(ADD(x1, x2)) =  x1 + x2

resulting in one new DP problem.
Used Argument Filtering System:
s(x1) -> s(x1)

`   R`
`     ↳DPs`
`       →DP Problem 1`
`         ↳AFS`
`           →DP Problem 5`
`             ↳Dependency Graph`
`       →DP Problem 2`
`         ↳AFS`
`       →DP Problem 3`
`         ↳AFS`
`       →DP Problem 4`
`         ↳AFS`

Dependency Pair:

Rules:

terms(N) -> cons(recip(sqr(N)), nterms(ns(N)))
terms(X) -> nterms(X)
sqr(0) -> 0
dbl(0) -> 0
dbl(s(X)) -> s(s(dbl(X)))
first(0, X) -> nil
first(s(X), cons(Y, Z)) -> cons(Y, nfirst(X, activate(Z)))
first(X1, X2) -> nfirst(X1, X2)
s(X) -> ns(X)
activate(nterms(X)) -> terms(activate(X))
activate(ns(X)) -> s(activate(X))
activate(nfirst(X1, X2)) -> first(activate(X1), activate(X2))
activate(X) -> X

Using the Dependency Graph resulted in no new DP problems.

`   R`
`     ↳DPs`
`       →DP Problem 1`
`         ↳AFS`
`       →DP Problem 2`
`         ↳Argument Filtering and Ordering`
`       →DP Problem 3`
`         ↳AFS`
`       →DP Problem 4`
`         ↳AFS`

Dependency Pair:

DBL(s(X)) -> DBL(X)

Rules:

terms(N) -> cons(recip(sqr(N)), nterms(ns(N)))
terms(X) -> nterms(X)
sqr(0) -> 0
dbl(0) -> 0
dbl(s(X)) -> s(s(dbl(X)))
first(0, X) -> nil
first(s(X), cons(Y, Z)) -> cons(Y, nfirst(X, activate(Z)))
first(X1, X2) -> nfirst(X1, X2)
s(X) -> ns(X)
activate(nterms(X)) -> terms(activate(X))
activate(ns(X)) -> s(activate(X))
activate(nfirst(X1, X2)) -> first(activate(X1), activate(X2))
activate(X) -> X

The following dependency pair can be strictly oriented:

DBL(s(X)) -> DBL(X)

There are no usable rules using the Ce-refinement that need to be oriented.
Used ordering: Polynomial ordering with Polynomial interpretation:
 POL(s(x1)) =  1 + x1 POL(DBL(x1)) =  x1

resulting in one new DP problem.
Used Argument Filtering System:
DBL(x1) -> DBL(x1)
s(x1) -> s(x1)

`   R`
`     ↳DPs`
`       →DP Problem 1`
`         ↳AFS`
`       →DP Problem 2`
`         ↳AFS`
`           →DP Problem 6`
`             ↳Dependency Graph`
`       →DP Problem 3`
`         ↳AFS`
`       →DP Problem 4`
`         ↳AFS`

Dependency Pair:

Rules:

terms(N) -> cons(recip(sqr(N)), nterms(ns(N)))
terms(X) -> nterms(X)
sqr(0) -> 0
dbl(0) -> 0
dbl(s(X)) -> s(s(dbl(X)))
first(0, X) -> nil
first(s(X), cons(Y, Z)) -> cons(Y, nfirst(X, activate(Z)))
first(X1, X2) -> nfirst(X1, X2)
s(X) -> ns(X)
activate(nterms(X)) -> terms(activate(X))
activate(ns(X)) -> s(activate(X))
activate(nfirst(X1, X2)) -> first(activate(X1), activate(X2))
activate(X) -> X

Using the Dependency Graph resulted in no new DP problems.

`   R`
`     ↳DPs`
`       →DP Problem 1`
`         ↳AFS`
`       →DP Problem 2`
`         ↳AFS`
`       →DP Problem 3`
`         ↳Argument Filtering and Ordering`
`       →DP Problem 4`
`         ↳AFS`

Dependency Pair:

SQR(s(X)) -> SQR(X)

Rules:

terms(N) -> cons(recip(sqr(N)), nterms(ns(N)))
terms(X) -> nterms(X)
sqr(0) -> 0
dbl(0) -> 0
dbl(s(X)) -> s(s(dbl(X)))
first(0, X) -> nil
first(s(X), cons(Y, Z)) -> cons(Y, nfirst(X, activate(Z)))
first(X1, X2) -> nfirst(X1, X2)
s(X) -> ns(X)
activate(nterms(X)) -> terms(activate(X))
activate(ns(X)) -> s(activate(X))
activate(nfirst(X1, X2)) -> first(activate(X1), activate(X2))
activate(X) -> X

The following dependency pair can be strictly oriented:

SQR(s(X)) -> SQR(X)

There are no usable rules using the Ce-refinement that need to be oriented.
Used ordering: Polynomial ordering with Polynomial interpretation:
 POL(s(x1)) =  1 + x1 POL(SQR(x1)) =  x1

resulting in one new DP problem.
Used Argument Filtering System:
SQR(x1) -> SQR(x1)
s(x1) -> s(x1)

`   R`
`     ↳DPs`
`       →DP Problem 1`
`         ↳AFS`
`       →DP Problem 2`
`         ↳AFS`
`       →DP Problem 3`
`         ↳AFS`
`           →DP Problem 7`
`             ↳Dependency Graph`
`       →DP Problem 4`
`         ↳AFS`

Dependency Pair:

Rules:

terms(N) -> cons(recip(sqr(N)), nterms(ns(N)))
terms(X) -> nterms(X)
sqr(0) -> 0
dbl(0) -> 0
dbl(s(X)) -> s(s(dbl(X)))
first(0, X) -> nil
first(s(X), cons(Y, Z)) -> cons(Y, nfirst(X, activate(Z)))
first(X1, X2) -> nfirst(X1, X2)
s(X) -> ns(X)
activate(nterms(X)) -> terms(activate(X))
activate(ns(X)) -> s(activate(X))
activate(nfirst(X1, X2)) -> first(activate(X1), activate(X2))
activate(X) -> X

Using the Dependency Graph resulted in no new DP problems.

`   R`
`     ↳DPs`
`       →DP Problem 1`
`         ↳AFS`
`       →DP Problem 2`
`         ↳AFS`
`       →DP Problem 3`
`         ↳AFS`
`       →DP Problem 4`
`         ↳Argument Filtering and Ordering`

Dependency Pairs:

ACTIVATE(nfirst(X1, X2)) -> ACTIVATE(X2)
ACTIVATE(nfirst(X1, X2)) -> ACTIVATE(X1)
ACTIVATE(nfirst(X1, X2)) -> FIRST(activate(X1), activate(X2))
ACTIVATE(ns(X)) -> ACTIVATE(X)
ACTIVATE(nterms(X)) -> ACTIVATE(X)
FIRST(s(X), cons(Y, Z)) -> ACTIVATE(Z)

Rules:

terms(N) -> cons(recip(sqr(N)), nterms(ns(N)))
terms(X) -> nterms(X)
sqr(0) -> 0
dbl(0) -> 0
dbl(s(X)) -> s(s(dbl(X)))
first(0, X) -> nil
first(s(X), cons(Y, Z)) -> cons(Y, nfirst(X, activate(Z)))
first(X1, X2) -> nfirst(X1, X2)
s(X) -> ns(X)
activate(nterms(X)) -> terms(activate(X))
activate(ns(X)) -> s(activate(X))
activate(nfirst(X1, X2)) -> first(activate(X1), activate(X2))
activate(X) -> X

The following dependency pair can be strictly oriented:

ACTIVATE(nterms(X)) -> ACTIVATE(X)

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

activate(nterms(X)) -> terms(activate(X))
activate(ns(X)) -> s(activate(X))
activate(nfirst(X1, X2)) -> first(activate(X1), activate(X2))
activate(X) -> X
first(0, X) -> nil
first(s(X), cons(Y, Z)) -> cons(Y, nfirst(X, activate(Z)))
first(X1, X2) -> nfirst(X1, X2)
terms(N) -> cons(recip(sqr(N)), nterms(ns(N)))
terms(X) -> nterms(X)
s(X) -> ns(X)
sqr(0) -> 0
dbl(0) -> 0
dbl(s(X)) -> s(s(dbl(X)))

Used ordering: Polynomial ordering with Polynomial interpretation:
 POL(activate(x1)) =  x1 POL(n__terms(x1)) =  1 + x1 POL(sqr) =  0 POL(n__s(x1)) =  x1 POL(terms(x1)) =  1 + x1 POL(ACTIVATE(x1)) =  x1 POL(add(x1, x2)) =  x1 + x2 POL(first(x1, x2)) =  x1 + x2 POL(0) =  0 POL(cons(x1, x2)) =  x1 + x2 POL(FIRST(x1, x2)) =  x1 + x2 POL(dbl) =  0 POL(nil) =  0 POL(s(x1)) =  x1 POL(recip(x1)) =  x1 POL(n__first(x1, x2)) =  x1 + x2

resulting in one new DP problem.
Used Argument Filtering System:
ACTIVATE(x1) -> ACTIVATE(x1)
nterms(x1) -> nterms(x1)
ns(x1) -> ns(x1)
FIRST(x1, x2) -> FIRST(x1, x2)
s(x1) -> s(x1)
cons(x1, x2) -> cons(x1, x2)
nfirst(x1, x2) -> nfirst(x1, x2)
activate(x1) -> activate(x1)
terms(x1) -> terms(x1)
first(x1, x2) -> first(x1, x2)
recip(x1) -> recip(x1)
sqr(x1) -> sqr
dbl(x1) -> dbl

`   R`
`     ↳DPs`
`       →DP Problem 1`
`         ↳AFS`
`       →DP Problem 2`
`         ↳AFS`
`       →DP Problem 3`
`         ↳AFS`
`       →DP Problem 4`
`         ↳AFS`
`           →DP Problem 8`
`             ↳Argument Filtering and Ordering`

Dependency Pairs:

ACTIVATE(nfirst(X1, X2)) -> ACTIVATE(X2)
ACTIVATE(nfirst(X1, X2)) -> ACTIVATE(X1)
ACTIVATE(nfirst(X1, X2)) -> FIRST(activate(X1), activate(X2))
ACTIVATE(ns(X)) -> ACTIVATE(X)
FIRST(s(X), cons(Y, Z)) -> ACTIVATE(Z)

Rules:

terms(N) -> cons(recip(sqr(N)), nterms(ns(N)))
terms(X) -> nterms(X)
sqr(0) -> 0
dbl(0) -> 0
dbl(s(X)) -> s(s(dbl(X)))
first(0, X) -> nil
first(s(X), cons(Y, Z)) -> cons(Y, nfirst(X, activate(Z)))
first(X1, X2) -> nfirst(X1, X2)
s(X) -> ns(X)
activate(nterms(X)) -> terms(activate(X))
activate(ns(X)) -> s(activate(X))
activate(nfirst(X1, X2)) -> first(activate(X1), activate(X2))
activate(X) -> X

The following dependency pairs can be strictly oriented:

ACTIVATE(nfirst(X1, X2)) -> ACTIVATE(X2)
ACTIVATE(nfirst(X1, X2)) -> ACTIVATE(X1)
FIRST(s(X), cons(Y, Z)) -> ACTIVATE(Z)

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

activate(nterms(X)) -> terms(activate(X))
activate(ns(X)) -> s(activate(X))
activate(nfirst(X1, X2)) -> first(activate(X1), activate(X2))
activate(X) -> X
first(0, X) -> nil
first(s(X), cons(Y, Z)) -> cons(Y, nfirst(X, activate(Z)))
first(X1, X2) -> nfirst(X1, X2)
terms(N) -> cons(recip(sqr(N)), nterms(ns(N)))
terms(X) -> nterms(X)
s(X) -> ns(X)
sqr(0) -> 0
dbl(0) -> 0
dbl(s(X)) -> s(s(dbl(X)))

Used ordering: Polynomial ordering with Polynomial interpretation:
 POL(activate(x1)) =  x1 POL(n__terms(x1)) =  x1 POL(sqr) =  0 POL(n__s(x1)) =  x1 POL(terms(x1)) =  x1 POL(ACTIVATE(x1)) =  x1 POL(add(x1, x2)) =  x1 + x2 POL(first(x1, x2)) =  1 + x1 + x2 POL(0) =  0 POL(cons(x1, x2)) =  x1 + x2 POL(FIRST(x1, x2)) =  1 + x1 + x2 POL(dbl) =  0 POL(nil) =  0 POL(s(x1)) =  x1 POL(recip(x1)) =  x1 POL(n__first(x1, x2)) =  1 + x1 + x2

resulting in one new DP problem.
Used Argument Filtering System:
ACTIVATE(x1) -> ACTIVATE(x1)
ns(x1) -> ns(x1)
FIRST(x1, x2) -> FIRST(x1, x2)
s(x1) -> s(x1)
cons(x1, x2) -> cons(x1, x2)
nfirst(x1, x2) -> nfirst(x1, x2)
activate(x1) -> activate(x1)
nterms(x1) -> nterms(x1)
terms(x1) -> terms(x1)
first(x1, x2) -> first(x1, x2)
recip(x1) -> recip(x1)
sqr(x1) -> sqr
dbl(x1) -> dbl

`   R`
`     ↳DPs`
`       →DP Problem 1`
`         ↳AFS`
`       →DP Problem 2`
`         ↳AFS`
`       →DP Problem 3`
`         ↳AFS`
`       →DP Problem 4`
`         ↳AFS`
`           →DP Problem 8`
`             ↳AFS`
`             ...`
`               →DP Problem 9`
`                 ↳Dependency Graph`

Dependency Pairs:

ACTIVATE(nfirst(X1, X2)) -> FIRST(activate(X1), activate(X2))
ACTIVATE(ns(X)) -> ACTIVATE(X)

Rules:

terms(N) -> cons(recip(sqr(N)), nterms(ns(N)))
terms(X) -> nterms(X)
sqr(0) -> 0
dbl(0) -> 0
dbl(s(X)) -> s(s(dbl(X)))
first(0, X) -> nil
first(s(X), cons(Y, Z)) -> cons(Y, nfirst(X, activate(Z)))
first(X1, X2) -> nfirst(X1, X2)
s(X) -> ns(X)
activate(nterms(X)) -> terms(activate(X))
activate(ns(X)) -> s(activate(X))
activate(nfirst(X1, X2)) -> first(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`
`         ↳AFS`
`       →DP Problem 2`
`         ↳AFS`
`       →DP Problem 3`
`         ↳AFS`
`       →DP Problem 4`
`         ↳AFS`
`           →DP Problem 8`
`             ↳AFS`
`             ...`
`               →DP Problem 10`
`                 ↳Argument Filtering and Ordering`

Dependency Pair:

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

Rules:

terms(N) -> cons(recip(sqr(N)), nterms(ns(N)))
terms(X) -> nterms(X)
sqr(0) -> 0
dbl(0) -> 0
dbl(s(X)) -> s(s(dbl(X)))
first(0, X) -> nil
first(s(X), cons(Y, Z)) -> cons(Y, nfirst(X, activate(Z)))
first(X1, X2) -> nfirst(X1, X2)
s(X) -> ns(X)
activate(nterms(X)) -> terms(activate(X))
activate(ns(X)) -> s(activate(X))
activate(nfirst(X1, X2)) -> first(activate(X1), activate(X2))
activate(X) -> X

The following dependency pair can be strictly oriented:

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

There are no usable rules using the Ce-refinement that need to be oriented.
Used ordering: Polynomial ordering with Polynomial interpretation:
 POL(n__s(x1)) =  1 + x1 POL(ACTIVATE(x1)) =  x1

resulting in one new DP problem.
Used Argument Filtering System:
ACTIVATE(x1) -> ACTIVATE(x1)
ns(x1) -> ns(x1)

`   R`
`     ↳DPs`
`       →DP Problem 1`
`         ↳AFS`
`       →DP Problem 2`
`         ↳AFS`
`       →DP Problem 3`
`         ↳AFS`
`       →DP Problem 4`
`         ↳AFS`
`           →DP Problem 8`
`             ↳AFS`
`             ...`
`               →DP Problem 11`
`                 ↳Dependency Graph`

Dependency Pair:

Rules:

terms(N) -> cons(recip(sqr(N)), nterms(ns(N)))
terms(X) -> nterms(X)
sqr(0) -> 0
dbl(0) -> 0
dbl(s(X)) -> s(s(dbl(X)))
first(0, X) -> nil
first(s(X), cons(Y, Z)) -> cons(Y, nfirst(X, activate(Z)))
first(X1, X2) -> nfirst(X1, X2)
s(X) -> ns(X)
activate(nterms(X)) -> terms(activate(X))
activate(ns(X)) -> s(activate(X))
activate(nfirst(X1, X2)) -> first(activate(X1), activate(X2))
activate(X) -> X

Using the Dependency Graph resulted in no new DP problems.

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