(0) Obligation:
Q restricted rewrite system:
The TRS R consists of the following rules:
terms(N) → cons(recip(sqr(N)))
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)) → cons(Y)
Q is empty.
(1) QTRSRRRProof (EQUIVALENT transformation)
Used ordering:
Combined order from the following AFS and order.
terms(
x1) =
terms(
x1)
cons(
x1) =
x1
recip(
x1) =
x1
sqr(
x1) =
sqr(
x1)
0 =
0
s(
x1) =
s(
x1)
add(
x1,
x2) =
add(
x1,
x2)
dbl(
x1) =
dbl(
x1)
first(
x1,
x2) =
first(
x1,
x2)
nil =
nil
Recursive path order with status [RPO].
Quasi-Precedence:
[terms1, sqr1] > 0 > nil > s1
[terms1, sqr1] > add2 > s1
[terms1, sqr1] > dbl1 > s1
first2 > nil > s1
Status:
terms1: [1]
sqr1: [1]
0: multiset
s1: multiset
add2: [1,2]
dbl1: multiset
first2: [1,2]
nil: multiset
With this ordering the following rules can be removed by the rule removal processor [LPAR04] because they are oriented strictly:
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)) → cons(Y)
(2) Obligation:
Q restricted rewrite system:
The TRS R consists of the following rules:
terms(N) → cons(recip(sqr(N)))
Q is empty.
(3) QTRSRRRProof (EQUIVALENT transformation)
Used ordering:
Knuth-Bendix order [KBO] with precedence:
sqr1 > recip1 > terms1 > cons1
and weight map:
terms_1=3
cons_1=1
recip_1=1
sqr_1=1
The variable weight is 1With this ordering the following rules can be removed by the rule removal processor [LPAR04] because they are oriented strictly:
terms(N) → cons(recip(sqr(N)))
(4) Obligation:
Q restricted rewrite system:
R is empty.
Q is empty.
(5) RisEmptyProof (EQUIVALENT transformation)
The TRS R is empty. Hence, termination is trivially proven.
(6) YES