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)
half(0) → 0
half(s(0)) → 0
half(s(s(X))) → s(half(X))
half(dbl(X)) → X
Renamed function symbols to avoid clashes with predefined symbol.
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)
half'(0') → 0'
half'(s'(0')) → 0'
half'(s'(s'(X))) → s'(half'(X))
half'(dbl'(X)) → X
Infered types.
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)
half'(0') → 0'
half'(s'(0')) → 0'
half'(s'(s'(X))) → s'(half'(X))
half'(dbl'(X)) → X
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'
half' :: 0':s' → 0':s'
_hole_cons':nil'1 :: cons':nil'
_hole_0':s'2 :: 0':s'
_hole_recip'3 :: recip'
_gen_0':s'4 :: Nat → 0':s'
Heuristically decided to analyse the following defined symbols:
sqr', add', dbl', half'
They will be analysed ascendingly in the following order:
add' < sqr'
dbl' < sqr'
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)
half'(0') → 0'
half'(s'(0')) → 0'
half'(s'(s'(X))) → s'(half'(X))
half'(dbl'(X)) → X
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'
half' :: 0':s' → 0':s'
_hole_cons':nil'1 :: cons':nil'
_hole_0':s'2 :: 0':s'
_hole_recip'3 :: recip'
_gen_0':s'4 :: Nat → 0':s'
Generator Equations:
_gen_0':s'4(0) ⇔ 0'
_gen_0':s'4(+(x, 1)) ⇔ s'(_gen_0':s'4(x))
The following defined symbols remain to be analysed:
add', sqr', dbl', half'
They will be analysed ascendingly in the following order:
add' < sqr'
dbl' < sqr'
Proved the following rewrite lemma:
add'(_gen_0':s'4(_n6), _gen_0':s'4(b)) → _gen_0':s'4(+(_n6, b)), rt ∈ Ω(1 + n6)
Induction Base:
add'(_gen_0':s'4(0), _gen_0':s'4(b)) →RΩ(1)
_gen_0':s'4(b)
Induction Step:
add'(_gen_0':s'4(+(_$n7, 1)), _gen_0':s'4(_b139)) →RΩ(1)
s'(add'(_gen_0':s'4(_$n7), _gen_0':s'4(_b139))) →IH
s'(_gen_0':s'4(+(_$n7, _b139)))
We have rt ∈ Ω(n) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
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)
half'(0') → 0'
half'(s'(0')) → 0'
half'(s'(s'(X))) → s'(half'(X))
half'(dbl'(X)) → X
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'
half' :: 0':s' → 0':s'
_hole_cons':nil'1 :: cons':nil'
_hole_0':s'2 :: 0':s'
_hole_recip'3 :: recip'
_gen_0':s'4 :: Nat → 0':s'
Lemmas:
add'(_gen_0':s'4(_n6), _gen_0':s'4(b)) → _gen_0':s'4(+(_n6, b)), rt ∈ Ω(1 + n6)
Generator Equations:
_gen_0':s'4(0) ⇔ 0'
_gen_0':s'4(+(x, 1)) ⇔ s'(_gen_0':s'4(x))
The following defined symbols remain to be analysed:
dbl', sqr', half'
They will be analysed ascendingly in the following order:
dbl' < sqr'
Proved the following rewrite lemma:
dbl'(_gen_0':s'4(_n638)) → _gen_0':s'4(*(2, _n638)), rt ∈ Ω(1 + n638)
Induction Base:
dbl'(_gen_0':s'4(0)) →RΩ(1)
0'
Induction Step:
dbl'(_gen_0':s'4(+(_$n639, 1))) →RΩ(1)
s'(s'(dbl'(_gen_0':s'4(_$n639)))) →IH
s'(s'(_gen_0':s'4(*(2, _$n639))))
We have rt ∈ Ω(n) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
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)
half'(0') → 0'
half'(s'(0')) → 0'
half'(s'(s'(X))) → s'(half'(X))
half'(dbl'(X)) → X
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'
half' :: 0':s' → 0':s'
_hole_cons':nil'1 :: cons':nil'
_hole_0':s'2 :: 0':s'
_hole_recip'3 :: recip'
_gen_0':s'4 :: Nat → 0':s'
Lemmas:
add'(_gen_0':s'4(_n6), _gen_0':s'4(b)) → _gen_0':s'4(+(_n6, b)), rt ∈ Ω(1 + n6)
dbl'(_gen_0':s'4(_n638)) → _gen_0':s'4(*(2, _n638)), rt ∈ Ω(1 + n638)
Generator Equations:
_gen_0':s'4(0) ⇔ 0'
_gen_0':s'4(+(x, 1)) ⇔ s'(_gen_0':s'4(x))
The following defined symbols remain to be analysed:
sqr', half'
Proved the following rewrite lemma:
sqr'(_gen_0':s'4(_n1064)) → _gen_0':s'4(*(_n1064, _n1064)), rt ∈ Ω(1 + n1064 + n10642 + n10643)
Induction Base:
sqr'(_gen_0':s'4(0)) →RΩ(1)
0'
Induction Step:
sqr'(_gen_0':s'4(+(_$n1065, 1))) →RΩ(1)
s'(add'(sqr'(_gen_0':s'4(_$n1065)), dbl'(_gen_0':s'4(_$n1065)))) →IH
s'(add'(_gen_0':s'4(*(_$n1065, _$n1065)), dbl'(_gen_0':s'4(_$n1065)))) →LΩ(1 + $n1065)
s'(add'(_gen_0':s'4(*(_$n1065, _$n1065)), _gen_0':s'4(*(2, _$n1065)))) →LΩ(1 + $n10652)
s'(_gen_0':s'4(+(*(_$n1065, _$n1065), *(2, _$n1065))))
We have rt ∈ Ω(n3) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n3).
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)
half'(0') → 0'
half'(s'(0')) → 0'
half'(s'(s'(X))) → s'(half'(X))
half'(dbl'(X)) → X
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'
half' :: 0':s' → 0':s'
_hole_cons':nil'1 :: cons':nil'
_hole_0':s'2 :: 0':s'
_hole_recip'3 :: recip'
_gen_0':s'4 :: Nat → 0':s'
Lemmas:
add'(_gen_0':s'4(_n6), _gen_0':s'4(b)) → _gen_0':s'4(+(_n6, b)), rt ∈ Ω(1 + n6)
dbl'(_gen_0':s'4(_n638)) → _gen_0':s'4(*(2, _n638)), rt ∈ Ω(1 + n638)
sqr'(_gen_0':s'4(_n1064)) → _gen_0':s'4(*(_n1064, _n1064)), rt ∈ Ω(1 + n1064 + n10642 + n10643)
Generator Equations:
_gen_0':s'4(0) ⇔ 0'
_gen_0':s'4(+(x, 1)) ⇔ s'(_gen_0':s'4(x))
The following defined symbols remain to be analysed:
half'
Proved the following rewrite lemma:
half'(_gen_0':s'4(*(2, _n1928))) → _gen_0':s'4(_n1928), rt ∈ Ω(1 + n1928)
Induction Base:
half'(_gen_0':s'4(*(2, 0))) →RΩ(1)
0'
Induction Step:
half'(_gen_0':s'4(*(2, +(_$n1929, 1)))) →RΩ(1)
s'(half'(_gen_0':s'4(*(2, _$n1929)))) →IH
s'(_gen_0':s'4(_$n1929))
We have rt ∈ Ω(n) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
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)
half'(0') → 0'
half'(s'(0')) → 0'
half'(s'(s'(X))) → s'(half'(X))
half'(dbl'(X)) → X
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'
half' :: 0':s' → 0':s'
_hole_cons':nil'1 :: cons':nil'
_hole_0':s'2 :: 0':s'
_hole_recip'3 :: recip'
_gen_0':s'4 :: Nat → 0':s'
Lemmas:
add'(_gen_0':s'4(_n6), _gen_0':s'4(b)) → _gen_0':s'4(+(_n6, b)), rt ∈ Ω(1 + n6)
dbl'(_gen_0':s'4(_n638)) → _gen_0':s'4(*(2, _n638)), rt ∈ Ω(1 + n638)
sqr'(_gen_0':s'4(_n1064)) → _gen_0':s'4(*(_n1064, _n1064)), rt ∈ Ω(1 + n1064 + n10642 + n10643)
half'(_gen_0':s'4(*(2, _n1928))) → _gen_0':s'4(_n1928), rt ∈ Ω(1 + n1928)
Generator Equations:
_gen_0':s'4(0) ⇔ 0'
_gen_0':s'4(+(x, 1)) ⇔ s'(_gen_0':s'4(x))
No more defined symbols left to analyse.
The lowerbound Ω(n3) was proven with the following lemma:
sqr'(_gen_0':s'4(_n1064)) → _gen_0':s'4(*(_n1064, _n1064)), rt ∈ Ω(1 + n1064 + n10642 + n10643)