(0) Obligation:
Runtime Complexity TRS:
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)
Rewrite Strategy: FULL
(1) DecreasingLoopProof (EQUIVALENT transformation)
The following loop(s) give(s) rise to the lower bound Ω(n1):
The rewrite sequence
sqr(s(X)) →+ s(add(sqr(X), dbl(X)))
gives rise to a decreasing loop by considering the right hand sides subterm at position [0,0].
The pumping substitution is [X / s(X)].
The result substitution is [ ].
(2) BOUNDS(n^1, INF)
(3) RenamingProof (EQUIVALENT transformation)
Renamed function symbols to avoid clashes with predefined symbol.
(4) Obligation:
Runtime Complexity Relative TRS:
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)
S is empty.
Rewrite Strategy: FULL
(5) TypeInferenceProof (BOTH BOUNDS(ID, ID) transformation)
Infered types.
(6) Obligation:
TRS:
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)
Types:
terms :: 0':s → cons:nil
cons :: recip → cons:nil
recip :: 0':s → recip
sqr :: 0':s → 0':s
0' :: 0':s
s :: 0':s → 0':s
add :: 0':s → 0':s → 0':s
dbl :: 0':s → 0':s
first :: 0':s → cons:nil → cons:nil
nil :: cons:nil
hole_cons:nil1_0 :: cons:nil
hole_0':s2_0 :: 0':s
hole_recip3_0 :: recip
gen_0':s4_0 :: Nat → 0':s
(7) OrderProof (LOWER BOUND(ID) transformation)
Heuristically decided to analyse the following defined symbols:
sqr,
add,
dblThey will be analysed ascendingly in the following order:
add < sqr
dbl < sqr
(8) Obligation:
TRS:
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) →
Xadd(
s(
X),
Y) →
s(
add(
X,
Y))
first(
0',
X) →
nilfirst(
s(
X),
cons(
Y)) →
cons(
Y)
Types:
terms :: 0':s → cons:nil
cons :: recip → cons:nil
recip :: 0':s → recip
sqr :: 0':s → 0':s
0' :: 0':s
s :: 0':s → 0':s
add :: 0':s → 0':s → 0':s
dbl :: 0':s → 0':s
first :: 0':s → cons:nil → cons:nil
nil :: cons:nil
hole_cons:nil1_0 :: cons:nil
hole_0':s2_0 :: 0':s
hole_recip3_0 :: recip
gen_0':s4_0 :: Nat → 0':s
Generator Equations:
gen_0':s4_0(0) ⇔ 0'
gen_0':s4_0(+(x, 1)) ⇔ s(gen_0':s4_0(x))
The following defined symbols remain to be analysed:
add, sqr, dbl
They will be analysed ascendingly in the following order:
add < sqr
dbl < sqr
(9) RewriteLemmaProof (LOWER BOUND(ID) transformation)
Proved the following rewrite lemma:
add(
gen_0':s4_0(
n6_0),
gen_0':s4_0(
b)) →
gen_0':s4_0(
+(
n6_0,
b)), rt ∈ Ω(1 + n6
0)
Induction Base:
add(gen_0':s4_0(0), gen_0':s4_0(b)) →RΩ(1)
gen_0':s4_0(b)
Induction Step:
add(gen_0':s4_0(+(n6_0, 1)), gen_0':s4_0(b)) →RΩ(1)
s(add(gen_0':s4_0(n6_0), gen_0':s4_0(b))) →IH
s(gen_0':s4_0(+(b, c7_0)))
We have rt ∈ Ω(n1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
(10) Complex Obligation (BEST)
(11) Obligation:
TRS:
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) →
Xadd(
s(
X),
Y) →
s(
add(
X,
Y))
first(
0',
X) →
nilfirst(
s(
X),
cons(
Y)) →
cons(
Y)
Types:
terms :: 0':s → cons:nil
cons :: recip → cons:nil
recip :: 0':s → recip
sqr :: 0':s → 0':s
0' :: 0':s
s :: 0':s → 0':s
add :: 0':s → 0':s → 0':s
dbl :: 0':s → 0':s
first :: 0':s → cons:nil → cons:nil
nil :: cons:nil
hole_cons:nil1_0 :: cons:nil
hole_0':s2_0 :: 0':s
hole_recip3_0 :: recip
gen_0':s4_0 :: Nat → 0':s
Lemmas:
add(gen_0':s4_0(n6_0), gen_0':s4_0(b)) → gen_0':s4_0(+(n6_0, b)), rt ∈ Ω(1 + n60)
Generator Equations:
gen_0':s4_0(0) ⇔ 0'
gen_0':s4_0(+(x, 1)) ⇔ s(gen_0':s4_0(x))
The following defined symbols remain to be analysed:
dbl, sqr
They will be analysed ascendingly in the following order:
dbl < sqr
(12) RewriteLemmaProof (LOWER BOUND(ID) transformation)
Proved the following rewrite lemma:
dbl(
gen_0':s4_0(
n495_0)) →
gen_0':s4_0(
*(
2,
n495_0)), rt ∈ Ω(1 + n495
0)
Induction Base:
dbl(gen_0':s4_0(0)) →RΩ(1)
0'
Induction Step:
dbl(gen_0':s4_0(+(n495_0, 1))) →RΩ(1)
s(s(dbl(gen_0':s4_0(n495_0)))) →IH
s(s(gen_0':s4_0(*(2, c496_0))))
We have rt ∈ Ω(n1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
(13) Complex Obligation (BEST)
(14) Obligation:
TRS:
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) →
Xadd(
s(
X),
Y) →
s(
add(
X,
Y))
first(
0',
X) →
nilfirst(
s(
X),
cons(
Y)) →
cons(
Y)
Types:
terms :: 0':s → cons:nil
cons :: recip → cons:nil
recip :: 0':s → recip
sqr :: 0':s → 0':s
0' :: 0':s
s :: 0':s → 0':s
add :: 0':s → 0':s → 0':s
dbl :: 0':s → 0':s
first :: 0':s → cons:nil → cons:nil
nil :: cons:nil
hole_cons:nil1_0 :: cons:nil
hole_0':s2_0 :: 0':s
hole_recip3_0 :: recip
gen_0':s4_0 :: Nat → 0':s
Lemmas:
add(gen_0':s4_0(n6_0), gen_0':s4_0(b)) → gen_0':s4_0(+(n6_0, b)), rt ∈ Ω(1 + n60)
dbl(gen_0':s4_0(n495_0)) → gen_0':s4_0(*(2, n495_0)), rt ∈ Ω(1 + n4950)
Generator Equations:
gen_0':s4_0(0) ⇔ 0'
gen_0':s4_0(+(x, 1)) ⇔ s(gen_0':s4_0(x))
The following defined symbols remain to be analysed:
sqr
(15) RewriteLemmaProof (LOWER BOUND(ID) transformation)
Proved the following rewrite lemma:
sqr(
gen_0':s4_0(
n739_0)) →
gen_0':s4_0(
*(
n739_0,
n739_0)), rt ∈ Ω(1 + n739
0 + n739
02 + n739
03)
Induction Base:
sqr(gen_0':s4_0(0)) →RΩ(1)
0'
Induction Step:
sqr(gen_0':s4_0(+(n739_0, 1))) →RΩ(1)
s(add(sqr(gen_0':s4_0(n739_0)), dbl(gen_0':s4_0(n739_0)))) →IH
s(add(gen_0':s4_0(*(c740_0, c740_0)), dbl(gen_0':s4_0(n739_0)))) →LΩ(1 + n7390)
s(add(gen_0':s4_0(*(n739_0, n739_0)), gen_0':s4_0(*(2, n739_0)))) →LΩ(1 + n73902)
s(gen_0':s4_0(+(*(n739_0, n739_0), *(2, n739_0))))
We have rt ∈ Ω(n3) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n3).
(16) Complex Obligation (BEST)
(17) Obligation:
TRS:
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) →
Xadd(
s(
X),
Y) →
s(
add(
X,
Y))
first(
0',
X) →
nilfirst(
s(
X),
cons(
Y)) →
cons(
Y)
Types:
terms :: 0':s → cons:nil
cons :: recip → cons:nil
recip :: 0':s → recip
sqr :: 0':s → 0':s
0' :: 0':s
s :: 0':s → 0':s
add :: 0':s → 0':s → 0':s
dbl :: 0':s → 0':s
first :: 0':s → cons:nil → cons:nil
nil :: cons:nil
hole_cons:nil1_0 :: cons:nil
hole_0':s2_0 :: 0':s
hole_recip3_0 :: recip
gen_0':s4_0 :: Nat → 0':s
Lemmas:
add(gen_0':s4_0(n6_0), gen_0':s4_0(b)) → gen_0':s4_0(+(n6_0, b)), rt ∈ Ω(1 + n60)
dbl(gen_0':s4_0(n495_0)) → gen_0':s4_0(*(2, n495_0)), rt ∈ Ω(1 + n4950)
sqr(gen_0':s4_0(n739_0)) → gen_0':s4_0(*(n739_0, n739_0)), rt ∈ Ω(1 + n7390 + n73902 + n73903)
Generator Equations:
gen_0':s4_0(0) ⇔ 0'
gen_0':s4_0(+(x, 1)) ⇔ s(gen_0':s4_0(x))
No more defined symbols left to analyse.
(18) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n3) was proven with the following lemma:
sqr(gen_0':s4_0(n739_0)) → gen_0':s4_0(*(n739_0, n739_0)), rt ∈ Ω(1 + n7390 + n73902 + n73903)
(19) BOUNDS(n^3, INF)
(20) Obligation:
TRS:
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) →
Xadd(
s(
X),
Y) →
s(
add(
X,
Y))
first(
0',
X) →
nilfirst(
s(
X),
cons(
Y)) →
cons(
Y)
Types:
terms :: 0':s → cons:nil
cons :: recip → cons:nil
recip :: 0':s → recip
sqr :: 0':s → 0':s
0' :: 0':s
s :: 0':s → 0':s
add :: 0':s → 0':s → 0':s
dbl :: 0':s → 0':s
first :: 0':s → cons:nil → cons:nil
nil :: cons:nil
hole_cons:nil1_0 :: cons:nil
hole_0':s2_0 :: 0':s
hole_recip3_0 :: recip
gen_0':s4_0 :: Nat → 0':s
Lemmas:
add(gen_0':s4_0(n6_0), gen_0':s4_0(b)) → gen_0':s4_0(+(n6_0, b)), rt ∈ Ω(1 + n60)
dbl(gen_0':s4_0(n495_0)) → gen_0':s4_0(*(2, n495_0)), rt ∈ Ω(1 + n4950)
sqr(gen_0':s4_0(n739_0)) → gen_0':s4_0(*(n739_0, n739_0)), rt ∈ Ω(1 + n7390 + n73902 + n73903)
Generator Equations:
gen_0':s4_0(0) ⇔ 0'
gen_0':s4_0(+(x, 1)) ⇔ s(gen_0':s4_0(x))
No more defined symbols left to analyse.
(21) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n3) was proven with the following lemma:
sqr(gen_0':s4_0(n739_0)) → gen_0':s4_0(*(n739_0, n739_0)), rt ∈ Ω(1 + n7390 + n73902 + n73903)
(22) BOUNDS(n^3, INF)
(23) Obligation:
TRS:
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) →
Xadd(
s(
X),
Y) →
s(
add(
X,
Y))
first(
0',
X) →
nilfirst(
s(
X),
cons(
Y)) →
cons(
Y)
Types:
terms :: 0':s → cons:nil
cons :: recip → cons:nil
recip :: 0':s → recip
sqr :: 0':s → 0':s
0' :: 0':s
s :: 0':s → 0':s
add :: 0':s → 0':s → 0':s
dbl :: 0':s → 0':s
first :: 0':s → cons:nil → cons:nil
nil :: cons:nil
hole_cons:nil1_0 :: cons:nil
hole_0':s2_0 :: 0':s
hole_recip3_0 :: recip
gen_0':s4_0 :: Nat → 0':s
Lemmas:
add(gen_0':s4_0(n6_0), gen_0':s4_0(b)) → gen_0':s4_0(+(n6_0, b)), rt ∈ Ω(1 + n60)
dbl(gen_0':s4_0(n495_0)) → gen_0':s4_0(*(2, n495_0)), rt ∈ Ω(1 + n4950)
Generator Equations:
gen_0':s4_0(0) ⇔ 0'
gen_0':s4_0(+(x, 1)) ⇔ s(gen_0':s4_0(x))
No more defined symbols left to analyse.
(24) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
add(gen_0':s4_0(n6_0), gen_0':s4_0(b)) → gen_0':s4_0(+(n6_0, b)), rt ∈ Ω(1 + n60)
(25) BOUNDS(n^1, INF)
(26) Obligation:
TRS:
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) →
Xadd(
s(
X),
Y) →
s(
add(
X,
Y))
first(
0',
X) →
nilfirst(
s(
X),
cons(
Y)) →
cons(
Y)
Types:
terms :: 0':s → cons:nil
cons :: recip → cons:nil
recip :: 0':s → recip
sqr :: 0':s → 0':s
0' :: 0':s
s :: 0':s → 0':s
add :: 0':s → 0':s → 0':s
dbl :: 0':s → 0':s
first :: 0':s → cons:nil → cons:nil
nil :: cons:nil
hole_cons:nil1_0 :: cons:nil
hole_0':s2_0 :: 0':s
hole_recip3_0 :: recip
gen_0':s4_0 :: Nat → 0':s
Lemmas:
add(gen_0':s4_0(n6_0), gen_0':s4_0(b)) → gen_0':s4_0(+(n6_0, b)), rt ∈ Ω(1 + n60)
Generator Equations:
gen_0':s4_0(0) ⇔ 0'
gen_0':s4_0(+(x, 1)) ⇔ s(gen_0':s4_0(x))
No more defined symbols left to analyse.
(27) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
add(gen_0':s4_0(n6_0), gen_0':s4_0(b)) → gen_0':s4_0(+(n6_0, b)), rt ∈ Ω(1 + n60)
(28) BOUNDS(n^1, INF)