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)
half(0) -> 0
half(s(0)) -> 0
half(s(s(X))) -> s(half(X))
half(dbl(X)) -> X
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)
HALF(s(s(X))) -> HALF(X)
ACTIVATE(nterms(X)) -> TERMS(X)
ACTIVATE(nfirst(X1, X2)) -> FIRST(X1, X2)

Furthermore, R contains five SCCs.


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


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)
half(0) -> 0
half(s(0)) -> 0
half(s(s(X))) -> s(half(X))
half(dbl(X)) -> X
activate(nterms(X)) -> terms(X)
activate(nfirst(X1, X2)) -> first(X1, X2)
activate(X) -> X





The following dependency pair can be strictly oriented:

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


The following rules can be oriented:

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)
half(0) -> 0
half(s(0)) -> 0
half(s(s(X))) -> s(half(X))
half(dbl(X)) -> X
activate(nterms(X)) -> terms(X)
activate(nfirst(X1, X2)) -> first(X1, X2)
activate(X) -> X


Used ordering: Lexicographic Path Order with Non-Strict Precedence with Quasi Precedence:
{first, nil, nfirst} > {terms, activate} > nterms
{first, nil, nfirst} > {terms, activate} > cons
{first, nil, nfirst} > {terms, activate} > recip
{first, nil, nfirst} > {terms, activate} > sqr > add > {half, s}
{first, nil, nfirst} > {terms, activate} > sqr > dbl > {half, s}

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


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


Dependency Pair:


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)
half(0) -> 0
half(s(0)) -> 0
half(s(s(X))) -> s(half(X))
half(dbl(X)) -> X
activate(nterms(X)) -> terms(X)
activate(nfirst(X1, X2)) -> first(X1, 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
       →DP Problem 5
AFS


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)
half(0) -> 0
half(s(0)) -> 0
half(s(s(X))) -> s(half(X))
half(dbl(X)) -> X
activate(nterms(X)) -> terms(X)
activate(nfirst(X1, X2)) -> first(X1, X2)
activate(X) -> X





The following dependency pair can be strictly oriented:

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


The following rules can be oriented:

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)
half(0) -> 0
half(s(0)) -> 0
half(s(s(X))) -> s(half(X))
half(dbl(X)) -> X
activate(nterms(X)) -> terms(X)
activate(nfirst(X1, X2)) -> first(X1, X2)
activate(X) -> X


Used ordering: Lexicographic Path Order with Non-Strict Precedence with Quasi Precedence:
{0, nil}
{first, nfirst} > {terms, activate} > nterms
{first, nfirst} > {terms, activate} > {dbl, sqr} > add > s
{first, nfirst} > {terms, activate} > cons
{first, nfirst} > {terms, activate} > recip
half > s

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


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


Dependency Pair:


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)
half(0) -> 0
half(s(0)) -> 0
half(s(s(X))) -> s(half(X))
half(dbl(X)) -> X
activate(nterms(X)) -> terms(X)
activate(nfirst(X1, X2)) -> first(X1, 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
       →DP Problem 5
AFS


Dependency Pair:

HALF(s(s(X))) -> HALF(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)
half(0) -> 0
half(s(0)) -> 0
half(s(s(X))) -> s(half(X))
half(dbl(X)) -> X
activate(nterms(X)) -> terms(X)
activate(nfirst(X1, X2)) -> first(X1, X2)
activate(X) -> X





The following dependency pair can be strictly oriented:

HALF(s(s(X))) -> HALF(X)


The following rules can be oriented:

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)
half(0) -> 0
half(s(0)) -> 0
half(s(s(X))) -> s(half(X))
half(dbl(X)) -> X
activate(nterms(X)) -> terms(X)
activate(nfirst(X1, X2)) -> first(X1, X2)
activate(X) -> X


Used ordering: Lexicographic Path Order with Non-Strict Precedence with Quasi Precedence:
0 > nil
{first, nfirst} > activate > terms > nterms > nil
{first, nfirst} > activate > terms > cons > nil
{first, nfirst} > activate > terms > recip > nil
{first, nfirst} > activate > terms > sqr > add > {half, s} > nil
{first, nfirst} > activate > terms > sqr > dbl > {half, s} > nil
HALF > nil

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


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


Dependency Pair:


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)
half(0) -> 0
half(s(0)) -> 0
half(s(s(X))) -> s(half(X))
half(dbl(X)) -> X
activate(nterms(X)) -> terms(X)
activate(nfirst(X1, X2)) -> first(X1, 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
       →DP Problem 5
AFS


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)
half(0) -> 0
half(s(0)) -> 0
half(s(s(X))) -> s(half(X))
half(dbl(X)) -> X
activate(nterms(X)) -> terms(X)
activate(nfirst(X1, X2)) -> first(X1, X2)
activate(X) -> X





The following dependency pair can be strictly oriented:

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


The following rules can be oriented:

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)
half(0) -> 0
half(s(0)) -> 0
half(s(s(X))) -> s(half(X))
half(dbl(X)) -> X
activate(nterms(X)) -> terms(X)
activate(nfirst(X1, X2)) -> first(X1, X2)
activate(X) -> X


Used ordering: Lexicographic Path Order with Non-Strict Precedence with Quasi Precedence:
SQR > nil
0 > nil
{first, nfirst} > {terms, activate} > nterms > nil
{first, nfirst} > {terms, activate} > {dbl, sqr} > add > s > half > nil
{first, nfirst} > {terms, activate} > cons > nil
{first, nfirst} > {terms, activate} > recip > nil

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


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


Dependency Pair:


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)
half(0) -> 0
half(s(0)) -> 0
half(s(s(X))) -> s(half(X))
half(dbl(X)) -> X
activate(nterms(X)) -> terms(X)
activate(nfirst(X1, X2)) -> first(X1, 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
AFS
       →DP Problem 5
Argument Filtering and Ordering


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)
half(0) -> 0
half(s(0)) -> 0
half(s(s(X))) -> s(half(X))
half(dbl(X)) -> X
activate(nterms(X)) -> terms(X)
activate(nfirst(X1, X2)) -> first(X1, X2)
activate(X) -> X





The following dependency pairs can be strictly oriented:

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


The following rules can be oriented:

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)
half(0) -> 0
half(s(0)) -> 0
half(s(s(X))) -> s(half(X))
half(dbl(X)) -> X
activate(nterms(X)) -> terms(X)
activate(nfirst(X1, X2)) -> first(X1, X2)
activate(X) -> X


Used ordering: Lexicographic Path Order with Non-Strict Precedence with Quasi Precedence:
0 > nil
{first, FIRST, nfirst} > activate > terms > nterms > nil
{first, FIRST, nfirst} > activate > terms > cons > nil
{first, FIRST, nfirst} > activate > terms > recip > nil
{first, FIRST, nfirst} > activate > terms > sqr > add > {half, s} > nil
{first, FIRST, nfirst} > activate > terms > sqr > dbl > {half, s} > nil
{first, FIRST, nfirst} > ACTIVATE > nil

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


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


Dependency Pair:


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)
half(0) -> 0
half(s(0)) -> 0
half(s(s(X))) -> s(half(X))
half(dbl(X)) -> X
activate(nterms(X)) -> terms(X)
activate(nfirst(X1, X2)) -> first(X1, X2)
activate(X) -> X





Using the Dependency Graph resulted in no new DP problems.

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