Term Rewriting System R:
[N, X, Y, Z, X1, X2]
terms(N) -> cons(recip(sqr(N)), nterms(s(N)))
terms(X) -> nterms(X)
sqr(0) -> 0
sqr(s(X)) -> s(add(sqr(X), dbl(X)))
dbl(0) -> 0
dbl(s(X)) -> s(s(dbl(X)))
add(0, X) -> X
add(s(X), Y) -> s(add(X, Y))
first(0, X) -> nil
first(s(X), cons(Y, Z)) -> cons(Y, nfirst(X, activate(Z)))
first(X1, X2) -> nfirst(X1, X2)
activate(nterms(X)) -> terms(X)
activate(nfirst(X1, X2)) -> first(X1, 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)) -> ADD(sqr(X), dbl(X))
SQR(s(X)) -> SQR(X)
SQR(s(X)) -> DBL(X)
DBL(s(X)) -> DBL(X)
ADD(s(X), Y) -> ADD(X, Y)
FIRST(s(X), cons(Y, Z)) -> ACTIVATE(Z)
ACTIVATE(nterms(X)) -> TERMS(X)
ACTIVATE(nfirst(X1, X2)) -> FIRST(X1, X2)

Furthermore, R contains four SCCs.


   R
DPs
       →DP Problem 1
Size-Change Principle
       →DP Problem 2
SCP
       →DP Problem 3
SCP
       →DP Problem 4
SCP


Dependency Pair:

ADD(s(X), Y) -> ADD(X, Y)


Rules:


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





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

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

DP: empty set
Oriented Rules: none

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

with Argument Filtering System:
s(x1) -> s(x1)

We obtain no new DP problems.


   R
DPs
       →DP Problem 1
SCP
       →DP Problem 2
Size-Change Principle
       →DP Problem 3
SCP
       →DP Problem 4
SCP


Dependency Pair:

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


Rules:


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





We number the DPs as follows:
  1. DBL(s(X)) -> DBL(X)
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:
s(x1) -> s(x1)

We obtain no new DP problems.


   R
DPs
       →DP Problem 1
SCP
       →DP Problem 2
SCP
       →DP Problem 3
Size-Change Principle
       →DP Problem 4
SCP


Dependency Pair:

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


Rules:


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





We number the DPs as follows:
  1. SQR(s(X)) -> SQR(X)
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:
s(x1) -> s(x1)

We obtain no new DP problems.


   R
DPs
       →DP Problem 1
SCP
       →DP Problem 2
SCP
       →DP Problem 3
SCP
       →DP Problem 4
Size-Change Principle


Dependency Pairs:

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


Rules:


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





We number the DPs as follows:
  1. ACTIVATE(nfirst(X1, X2)) -> FIRST(X1, X2)
  2. FIRST(s(X), cons(Y, Z)) -> ACTIVATE(Z)
and get the following Size-Change Graph(s):
{1} , {1}
1>1
1>2
{2} , {2}
2>1

which lead(s) to this/these maximal multigraph(s):
{2} , {1}
2>1
2>2
{1} , {2}
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)
nfirst(x1, x2) -> nfirst(x1, x2)

We obtain no new DP problems.

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