(0) Obligation:
Q restricted rewrite system:
The TRS R consists of the following rules:
terms(N) → cons(recip(sqr(N)), n__terms(s(N)))
sqr(0) → 0
sqr(s(X)) → s(n__add(sqr(activate(X)), dbl(activate(X))))
dbl(0) → 0
dbl(s(X)) → s(n__s(n__dbl(activate(X))))
add(0, X) → X
add(s(X), Y) → s(n__add(activate(X), Y))
first(0, X) → nil
first(s(X), cons(Y, Z)) → cons(Y, n__first(activate(X), activate(Z)))
terms(X) → n__terms(X)
add(X1, X2) → n__add(X1, X2)
s(X) → n__s(X)
dbl(X) → n__dbl(X)
first(X1, X2) → n__first(X1, X2)
activate(n__terms(X)) → terms(X)
activate(n__add(X1, X2)) → add(X1, X2)
activate(n__s(X)) → s(X)
activate(n__dbl(X)) → dbl(X)
activate(n__first(X1, X2)) → first(X1, X2)
activate(X) → X
Q is empty.
(1) DependencyPairsProof (EQUIVALENT transformation)
Using Dependency Pairs [AG00,LPAR04] we result in the following initial DP problem.
(2) Obligation:
Q DP problem:
The TRS P consists of the following rules:
TERMS(N) → SQR(N)
TERMS(N) → S(N)
SQR(s(X)) → S(n__add(sqr(activate(X)), dbl(activate(X))))
SQR(s(X)) → SQR(activate(X))
SQR(s(X)) → ACTIVATE(X)
SQR(s(X)) → DBL(activate(X))
DBL(s(X)) → S(n__s(n__dbl(activate(X))))
DBL(s(X)) → ACTIVATE(X)
ADD(s(X), Y) → S(n__add(activate(X), Y))
ADD(s(X), Y) → ACTIVATE(X)
FIRST(s(X), cons(Y, Z)) → ACTIVATE(X)
FIRST(s(X), cons(Y, Z)) → ACTIVATE(Z)
ACTIVATE(n__terms(X)) → TERMS(X)
ACTIVATE(n__add(X1, X2)) → ADD(X1, X2)
ACTIVATE(n__s(X)) → S(X)
ACTIVATE(n__dbl(X)) → DBL(X)
ACTIVATE(n__first(X1, X2)) → FIRST(X1, X2)
The TRS R consists of the following rules:
terms(N) → cons(recip(sqr(N)), n__terms(s(N)))
sqr(0) → 0
sqr(s(X)) → s(n__add(sqr(activate(X)), dbl(activate(X))))
dbl(0) → 0
dbl(s(X)) → s(n__s(n__dbl(activate(X))))
add(0, X) → X
add(s(X), Y) → s(n__add(activate(X), Y))
first(0, X) → nil
first(s(X), cons(Y, Z)) → cons(Y, n__first(activate(X), activate(Z)))
terms(X) → n__terms(X)
add(X1, X2) → n__add(X1, X2)
s(X) → n__s(X)
dbl(X) → n__dbl(X)
first(X1, X2) → n__first(X1, X2)
activate(n__terms(X)) → terms(X)
activate(n__add(X1, X2)) → add(X1, X2)
activate(n__s(X)) → s(X)
activate(n__dbl(X)) → dbl(X)
activate(n__first(X1, X2)) → first(X1, X2)
activate(X) → X
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
(3) DependencyGraphProof (EQUIVALENT transformation)
The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 1 SCC with 5 less nodes.
(4) Obligation:
Q DP problem:
The TRS P consists of the following rules:
SQR(s(X)) → SQR(activate(X))
SQR(s(X)) → ACTIVATE(X)
ACTIVATE(n__terms(X)) → TERMS(X)
TERMS(N) → SQR(N)
SQR(s(X)) → DBL(activate(X))
DBL(s(X)) → ACTIVATE(X)
ACTIVATE(n__add(X1, X2)) → ADD(X1, X2)
ADD(s(X), Y) → ACTIVATE(X)
ACTIVATE(n__dbl(X)) → DBL(X)
ACTIVATE(n__first(X1, X2)) → FIRST(X1, X2)
FIRST(s(X), cons(Y, Z)) → ACTIVATE(X)
FIRST(s(X), cons(Y, Z)) → ACTIVATE(Z)
The TRS R consists of the following rules:
terms(N) → cons(recip(sqr(N)), n__terms(s(N)))
sqr(0) → 0
sqr(s(X)) → s(n__add(sqr(activate(X)), dbl(activate(X))))
dbl(0) → 0
dbl(s(X)) → s(n__s(n__dbl(activate(X))))
add(0, X) → X
add(s(X), Y) → s(n__add(activate(X), Y))
first(0, X) → nil
first(s(X), cons(Y, Z)) → cons(Y, n__first(activate(X), activate(Z)))
terms(X) → n__terms(X)
add(X1, X2) → n__add(X1, X2)
s(X) → n__s(X)
dbl(X) → n__dbl(X)
first(X1, X2) → n__first(X1, X2)
activate(n__terms(X)) → terms(X)
activate(n__add(X1, X2)) → add(X1, X2)
activate(n__s(X)) → s(X)
activate(n__dbl(X)) → dbl(X)
activate(n__first(X1, X2)) → first(X1, X2)
activate(X) → X
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
(5) QDPOrderProof (EQUIVALENT transformation)
We use the reduction pair processor [LPAR04].
The following pairs can be oriented strictly and are deleted.
FIRST(s(X), cons(Y, Z)) → ACTIVATE(X)
FIRST(s(X), cons(Y, Z)) → ACTIVATE(Z)
The remaining pairs can at least be oriented weakly.
Used ordering: Matrix interpretation [MATRO] with arctic natural numbers [ARCTIC]:
POL(SQR(x1)) = | 0A | + | 0A | · | x1 |
POL(activate(x1)) = | 0A | + | 0A | · | x1 |
POL(ACTIVATE(x1)) = | 0A | + | 0A | · | x1 |
POL(n__terms(x1)) = | -I | + | 0A | · | x1 |
POL(TERMS(x1)) = | 0A | + | 0A | · | x1 |
POL(DBL(x1)) = | 0A | + | 0A | · | x1 |
POL(n__add(x1, x2)) = | -I | + | 0A | · | x1 | + | 5A | · | x2 |
POL(ADD(x1, x2)) = | -I | + | 0A | · | x1 | + | 5A | · | x2 |
POL(n__dbl(x1)) = | 0A | + | 0A | · | x1 |
POL(n__first(x1, x2)) = | -I | + | 5A | · | x1 | + | 5A | · | x2 |
POL(FIRST(x1, x2)) = | 0A | + | 1A | · | x1 | + | 5A | · | x2 |
POL(cons(x1, x2)) = | -I | + | -I | · | x1 | + | 0A | · | x2 |
POL(dbl(x1)) = | 0A | + | 0A | · | x1 |
POL(n__s(x1)) = | 0A | + | 0A | · | x1 |
POL(first(x1, x2)) = | 0A | + | 5A | · | x1 | + | 5A | · | x2 |
POL(add(x1, x2)) = | 0A | + | 0A | · | x1 | + | 5A | · | x2 |
POL(terms(x1)) = | 0A | + | 0A | · | x1 |
POL(sqr(x1)) = | 0A | + | 5A | · | x1 |
POL(recip(x1)) = | -I | + | 0A | · | x1 |
The following usable rules [FROCOS05] were oriented:
activate(n__dbl(X)) → dbl(X)
activate(n__s(X)) → s(X)
activate(X) → X
activate(n__first(X1, X2)) → first(X1, X2)
s(X) → n__s(X)
add(X1, X2) → n__add(X1, X2)
terms(X) → n__terms(X)
first(s(X), cons(Y, Z)) → cons(Y, n__first(activate(X), activate(Z)))
activate(n__add(X1, X2)) → add(X1, X2)
activate(n__terms(X)) → terms(X)
first(X1, X2) → n__first(X1, X2)
dbl(X) → n__dbl(X)
dbl(0) → 0
sqr(s(X)) → s(n__add(sqr(activate(X)), dbl(activate(X))))
sqr(0) → 0
terms(N) → cons(recip(sqr(N)), n__terms(s(N)))
first(0, X) → nil
add(s(X), Y) → s(n__add(activate(X), Y))
add(0, X) → X
dbl(s(X)) → s(n__s(n__dbl(activate(X))))
(6) Obligation:
Q DP problem:
The TRS P consists of the following rules:
SQR(s(X)) → SQR(activate(X))
SQR(s(X)) → ACTIVATE(X)
ACTIVATE(n__terms(X)) → TERMS(X)
TERMS(N) → SQR(N)
SQR(s(X)) → DBL(activate(X))
DBL(s(X)) → ACTIVATE(X)
ACTIVATE(n__add(X1, X2)) → ADD(X1, X2)
ADD(s(X), Y) → ACTIVATE(X)
ACTIVATE(n__dbl(X)) → DBL(X)
ACTIVATE(n__first(X1, X2)) → FIRST(X1, X2)
The TRS R consists of the following rules:
terms(N) → cons(recip(sqr(N)), n__terms(s(N)))
sqr(0) → 0
sqr(s(X)) → s(n__add(sqr(activate(X)), dbl(activate(X))))
dbl(0) → 0
dbl(s(X)) → s(n__s(n__dbl(activate(X))))
add(0, X) → X
add(s(X), Y) → s(n__add(activate(X), Y))
first(0, X) → nil
first(s(X), cons(Y, Z)) → cons(Y, n__first(activate(X), activate(Z)))
terms(X) → n__terms(X)
add(X1, X2) → n__add(X1, X2)
s(X) → n__s(X)
dbl(X) → n__dbl(X)
first(X1, X2) → n__first(X1, X2)
activate(n__terms(X)) → terms(X)
activate(n__add(X1, X2)) → add(X1, X2)
activate(n__s(X)) → s(X)
activate(n__dbl(X)) → dbl(X)
activate(n__first(X1, X2)) → first(X1, X2)
activate(X) → X
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
(7) DependencyGraphProof (EQUIVALENT transformation)
The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 1 SCC with 1 less node.
(8) Obligation:
Q DP problem:
The TRS P consists of the following rules:
SQR(s(X)) → ACTIVATE(X)
ACTIVATE(n__terms(X)) → TERMS(X)
TERMS(N) → SQR(N)
SQR(s(X)) → SQR(activate(X))
SQR(s(X)) → DBL(activate(X))
DBL(s(X)) → ACTIVATE(X)
ACTIVATE(n__add(X1, X2)) → ADD(X1, X2)
ADD(s(X), Y) → ACTIVATE(X)
ACTIVATE(n__dbl(X)) → DBL(X)
The TRS R consists of the following rules:
terms(N) → cons(recip(sqr(N)), n__terms(s(N)))
sqr(0) → 0
sqr(s(X)) → s(n__add(sqr(activate(X)), dbl(activate(X))))
dbl(0) → 0
dbl(s(X)) → s(n__s(n__dbl(activate(X))))
add(0, X) → X
add(s(X), Y) → s(n__add(activate(X), Y))
first(0, X) → nil
first(s(X), cons(Y, Z)) → cons(Y, n__first(activate(X), activate(Z)))
terms(X) → n__terms(X)
add(X1, X2) → n__add(X1, X2)
s(X) → n__s(X)
dbl(X) → n__dbl(X)
first(X1, X2) → n__first(X1, X2)
activate(n__terms(X)) → terms(X)
activate(n__add(X1, X2)) → add(X1, X2)
activate(n__s(X)) → s(X)
activate(n__dbl(X)) → dbl(X)
activate(n__first(X1, X2)) → first(X1, X2)
activate(X) → X
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
(9) QDPOrderProof (EQUIVALENT transformation)
We use the reduction pair processor [LPAR04].
The following pairs can be oriented strictly and are deleted.
TERMS(N) → SQR(N)
The remaining pairs can at least be oriented weakly.
Used ordering: Matrix interpretation [MATRO] with arctic natural numbers [ARCTIC]:
POL(SQR(x1)) = | 0A | + | 0A | · | x1 |
POL(ACTIVATE(x1)) = | 1A | + | 0A | · | x1 |
POL(n__terms(x1)) = | -I | + | 1A | · | x1 |
POL(TERMS(x1)) = | 1A | + | 1A | · | x1 |
POL(activate(x1)) = | -I | + | 0A | · | x1 |
POL(DBL(x1)) = | 0A | + | 0A | · | x1 |
POL(n__add(x1, x2)) = | 0A | + | 0A | · | x1 | + | 0A | · | x2 |
POL(ADD(x1, x2)) = | 1A | + | 0A | · | x1 | + | 0A | · | x2 |
POL(n__dbl(x1)) = | -I | + | 0A | · | x1 |
POL(dbl(x1)) = | -I | + | 0A | · | x1 |
POL(n__s(x1)) = | 1A | + | 0A | · | x1 |
POL(n__first(x1, x2)) = | -I | + | 0A | · | x1 | + | 1A | · | x2 |
POL(first(x1, x2)) = | -I | + | 0A | · | x1 | + | 1A | · | x2 |
POL(add(x1, x2)) = | 0A | + | 0A | · | x1 | + | 0A | · | x2 |
POL(terms(x1)) = | -I | + | 1A | · | x1 |
POL(cons(x1, x2)) = | -I | + | 0A | · | x1 | + | -I | · | x2 |
POL(sqr(x1)) = | -I | + | 0A | · | x1 |
POL(recip(x1)) = | -I | + | 0A | · | x1 |
The following usable rules [FROCOS05] were oriented:
activate(n__dbl(X)) → dbl(X)
activate(n__s(X)) → s(X)
activate(X) → X
activate(n__first(X1, X2)) → first(X1, X2)
s(X) → n__s(X)
add(X1, X2) → n__add(X1, X2)
terms(X) → n__terms(X)
first(s(X), cons(Y, Z)) → cons(Y, n__first(activate(X), activate(Z)))
activate(n__add(X1, X2)) → add(X1, X2)
activate(n__terms(X)) → terms(X)
first(X1, X2) → n__first(X1, X2)
dbl(X) → n__dbl(X)
dbl(0) → 0
sqr(s(X)) → s(n__add(sqr(activate(X)), dbl(activate(X))))
sqr(0) → 0
terms(N) → cons(recip(sqr(N)), n__terms(s(N)))
first(0, X) → nil
add(s(X), Y) → s(n__add(activate(X), Y))
add(0, X) → X
dbl(s(X)) → s(n__s(n__dbl(activate(X))))
(10) Obligation:
Q DP problem:
The TRS P consists of the following rules:
SQR(s(X)) → ACTIVATE(X)
ACTIVATE(n__terms(X)) → TERMS(X)
SQR(s(X)) → SQR(activate(X))
SQR(s(X)) → DBL(activate(X))
DBL(s(X)) → ACTIVATE(X)
ACTIVATE(n__add(X1, X2)) → ADD(X1, X2)
ADD(s(X), Y) → ACTIVATE(X)
ACTIVATE(n__dbl(X)) → DBL(X)
The TRS R consists of the following rules:
terms(N) → cons(recip(sqr(N)), n__terms(s(N)))
sqr(0) → 0
sqr(s(X)) → s(n__add(sqr(activate(X)), dbl(activate(X))))
dbl(0) → 0
dbl(s(X)) → s(n__s(n__dbl(activate(X))))
add(0, X) → X
add(s(X), Y) → s(n__add(activate(X), Y))
first(0, X) → nil
first(s(X), cons(Y, Z)) → cons(Y, n__first(activate(X), activate(Z)))
terms(X) → n__terms(X)
add(X1, X2) → n__add(X1, X2)
s(X) → n__s(X)
dbl(X) → n__dbl(X)
first(X1, X2) → n__first(X1, X2)
activate(n__terms(X)) → terms(X)
activate(n__add(X1, X2)) → add(X1, X2)
activate(n__s(X)) → s(X)
activate(n__dbl(X)) → dbl(X)
activate(n__first(X1, X2)) → first(X1, X2)
activate(X) → X
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
(11) DependencyGraphProof (EQUIVALENT transformation)
The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 2 SCCs with 3 less nodes.
(12) Complex Obligation (AND)
(13) Obligation:
Q DP problem:
The TRS P consists of the following rules:
ACTIVATE(n__add(X1, X2)) → ADD(X1, X2)
ADD(s(X), Y) → ACTIVATE(X)
ACTIVATE(n__dbl(X)) → DBL(X)
DBL(s(X)) → ACTIVATE(X)
The TRS R consists of the following rules:
terms(N) → cons(recip(sqr(N)), n__terms(s(N)))
sqr(0) → 0
sqr(s(X)) → s(n__add(sqr(activate(X)), dbl(activate(X))))
dbl(0) → 0
dbl(s(X)) → s(n__s(n__dbl(activate(X))))
add(0, X) → X
add(s(X), Y) → s(n__add(activate(X), Y))
first(0, X) → nil
first(s(X), cons(Y, Z)) → cons(Y, n__first(activate(X), activate(Z)))
terms(X) → n__terms(X)
add(X1, X2) → n__add(X1, X2)
s(X) → n__s(X)
dbl(X) → n__dbl(X)
first(X1, X2) → n__first(X1, X2)
activate(n__terms(X)) → terms(X)
activate(n__add(X1, X2)) → add(X1, X2)
activate(n__s(X)) → s(X)
activate(n__dbl(X)) → dbl(X)
activate(n__first(X1, X2)) → first(X1, X2)
activate(X) → X
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
(14) UsableRulesProof (EQUIVALENT transformation)
We can use the usable rules and reduction pair processor [LPAR04] with the Ce-compatible extension of the polynomial order that maps every function symbol to the sum of its arguments. Then, we can delete all non-usable rules [FROCOS05] from R.
(15) Obligation:
Q DP problem:
The TRS P consists of the following rules:
ACTIVATE(n__add(X1, X2)) → ADD(X1, X2)
ADD(s(X), Y) → ACTIVATE(X)
ACTIVATE(n__dbl(X)) → DBL(X)
DBL(s(X)) → ACTIVATE(X)
R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
(16) QDPSizeChangeProof (EQUIVALENT transformation)
By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] we have proven that there are no infinite chains for this DP problem.
From the DPs we obtained the following set of size-change graphs:
- ADD(s(X), Y) → ACTIVATE(X)
The graph contains the following edges 1 > 1
- DBL(s(X)) → ACTIVATE(X)
The graph contains the following edges 1 > 1
- ACTIVATE(n__add(X1, X2)) → ADD(X1, X2)
The graph contains the following edges 1 > 1, 1 > 2
- ACTIVATE(n__dbl(X)) → DBL(X)
The graph contains the following edges 1 > 1
(17) TRUE
(18) Obligation:
Q DP problem:
The TRS P consists of the following rules:
SQR(s(X)) → SQR(activate(X))
The TRS R consists of the following rules:
terms(N) → cons(recip(sqr(N)), n__terms(s(N)))
sqr(0) → 0
sqr(s(X)) → s(n__add(sqr(activate(X)), dbl(activate(X))))
dbl(0) → 0
dbl(s(X)) → s(n__s(n__dbl(activate(X))))
add(0, X) → X
add(s(X), Y) → s(n__add(activate(X), Y))
first(0, X) → nil
first(s(X), cons(Y, Z)) → cons(Y, n__first(activate(X), activate(Z)))
terms(X) → n__terms(X)
add(X1, X2) → n__add(X1, X2)
s(X) → n__s(X)
dbl(X) → n__dbl(X)
first(X1, X2) → n__first(X1, X2)
activate(n__terms(X)) → terms(X)
activate(n__add(X1, X2)) → add(X1, X2)
activate(n__s(X)) → s(X)
activate(n__dbl(X)) → dbl(X)
activate(n__first(X1, X2)) → first(X1, X2)
activate(X) → X
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
(19) QDPOrderProof (EQUIVALENT transformation)
We use the reduction pair processor [LPAR04].
The following pairs can be oriented strictly and are deleted.
SQR(s(X)) → SQR(activate(X))
The remaining pairs can at least be oriented weakly.
Used ordering: Combined order from the following AFS and order.
SQR(
x1) =
x1
s(
x1) =
s(
x1)
activate(
x1) =
activate(
x1)
n__dbl(
x1) =
n__dbl(
x1)
dbl(
x1) =
dbl(
x1)
n__s(
x1) =
n__s(
x1)
n__first(
x1,
x2) =
n__first(
x2)
first(
x1,
x2) =
first(
x2)
add(
x1,
x2) =
add(
x1,
x2)
n__add(
x1,
x2) =
n__add(
x1,
x2)
terms(
x1) =
terms
n__terms(
x1) =
n__terms
cons(
x1,
x2) =
x1
0 =
0
sqr(
x1) =
sqr(
x1)
recip(
x1) =
recip
nil =
nil
Recursive path order with status [RPO].
Quasi-Precedence:
sqr1 > [ndbl1, dbl1] > [s1, ns1] > [activate1, first1] > nfirst1
sqr1 > [ndbl1, dbl1] > [s1, ns1] > [activate1, first1] > [terms, recip] > nterms
sqr1 > [ndbl1, dbl1] > [s1, ns1] > [activate1, first1] > nil
sqr1 > [ndbl1, dbl1] > 0 > nil
sqr1 > [add2, nadd2] > [s1, ns1] > [activate1, first1] > nfirst1
sqr1 > [add2, nadd2] > [s1, ns1] > [activate1, first1] > [terms, recip] > nterms
sqr1 > [add2, nadd2] > [s1, ns1] > [activate1, first1] > nil
Status:
ndbl1: [1]
sqr1: multiset
activate1: [1]
ns1: [1]
nterms: multiset
recip: []
0: multiset
add2: multiset
nadd2: multiset
nfirst1: multiset
dbl1: [1]
s1: [1]
first1: [1]
nil: multiset
terms: []
The following usable rules [FROCOS05] were oriented:
activate(n__dbl(X)) → dbl(X)
activate(n__s(X)) → s(X)
activate(X) → X
activate(n__first(X1, X2)) → first(X1, X2)
s(X) → n__s(X)
add(X1, X2) → n__add(X1, X2)
terms(X) → n__terms(X)
first(s(X), cons(Y, Z)) → cons(Y, n__first(activate(X), activate(Z)))
activate(n__add(X1, X2)) → add(X1, X2)
activate(n__terms(X)) → terms(X)
first(X1, X2) → n__first(X1, X2)
dbl(X) → n__dbl(X)
dbl(0) → 0
sqr(s(X)) → s(n__add(sqr(activate(X)), dbl(activate(X))))
sqr(0) → 0
terms(N) → cons(recip(sqr(N)), n__terms(s(N)))
first(0, X) → nil
add(s(X), Y) → s(n__add(activate(X), Y))
add(0, X) → X
dbl(s(X)) → s(n__s(n__dbl(activate(X))))
(20) Obligation:
Q DP problem:
P is empty.
The TRS R consists of the following rules:
terms(N) → cons(recip(sqr(N)), n__terms(s(N)))
sqr(0) → 0
sqr(s(X)) → s(n__add(sqr(activate(X)), dbl(activate(X))))
dbl(0) → 0
dbl(s(X)) → s(n__s(n__dbl(activate(X))))
add(0, X) → X
add(s(X), Y) → s(n__add(activate(X), Y))
first(0, X) → nil
first(s(X), cons(Y, Z)) → cons(Y, n__first(activate(X), activate(Z)))
terms(X) → n__terms(X)
add(X1, X2) → n__add(X1, X2)
s(X) → n__s(X)
dbl(X) → n__dbl(X)
first(X1, X2) → n__first(X1, X2)
activate(n__terms(X)) → terms(X)
activate(n__add(X1, X2)) → add(X1, X2)
activate(n__s(X)) → s(X)
activate(n__dbl(X)) → dbl(X)
activate(n__first(X1, X2)) → first(X1, X2)
activate(X) → X
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
(21) PisEmptyProof (EQUIVALENT transformation)
The TRS P is empty. Hence, there is no (P,Q,R) chain.
(22) TRUE