Runtime Complexity TRS:
The TRS R consists of the following rules:
half(x) → if(ge(x, s(s(0))), x)
if(false, x) → 0
if(true, x) → s(half(p(p(x))))
p(0) → 0
p(s(x)) → x
ge(x, 0) → true
ge(0, s(x)) → false
ge(s(x), s(y)) → ge(x, y)
log(0) → 0
log(s(x)) → s(log(half(s(x))))
Renamed function symbols to avoid clashes with predefined symbol.
Runtime Complexity TRS:
The TRS R consists of the following rules:
half'(x) → if'(ge'(x, s'(s'(0'))), x)
if'(false', x) → 0'
if'(true', x) → s'(half'(p'(p'(x))))
p'(0') → 0'
p'(s'(x)) → x
ge'(x, 0') → true'
ge'(0', s'(x)) → false'
ge'(s'(x), s'(y)) → ge'(x, y)
log'(0') → 0'
log'(s'(x)) → s'(log'(half'(s'(x))))
Infered types.
Rules:
half'(x) → if'(ge'(x, s'(s'(0'))), x)
if'(false', x) → 0'
if'(true', x) → s'(half'(p'(p'(x))))
p'(0') → 0'
p'(s'(x)) → x
ge'(x, 0') → true'
ge'(0', s'(x)) → false'
ge'(s'(x), s'(y)) → ge'(x, y)
log'(0') → 0'
log'(s'(x)) → s'(log'(half'(s'(x))))
Types:
half' :: 0':s' → 0':s'
if' :: false':true' → 0':s' → 0':s'
ge' :: 0':s' → 0':s' → false':true'
s' :: 0':s' → 0':s'
0' :: 0':s'
false' :: false':true'
true' :: false':true'
p' :: 0':s' → 0':s'
log' :: 0':s' → 0':s'
_hole_0':s'1 :: 0':s'
_hole_false':true'2 :: false':true'
_gen_0':s'3 :: Nat → 0':s'
Heuristically decided to analyse the following defined symbols:
half', ge', log'
They will be analysed ascendingly in the following order:
ge' < half'
half' < log'
Rules:
half'(x) → if'(ge'(x, s'(s'(0'))), x)
if'(false', x) → 0'
if'(true', x) → s'(half'(p'(p'(x))))
p'(0') → 0'
p'(s'(x)) → x
ge'(x, 0') → true'
ge'(0', s'(x)) → false'
ge'(s'(x), s'(y)) → ge'(x, y)
log'(0') → 0'
log'(s'(x)) → s'(log'(half'(s'(x))))
Types:
half' :: 0':s' → 0':s'
if' :: false':true' → 0':s' → 0':s'
ge' :: 0':s' → 0':s' → false':true'
s' :: 0':s' → 0':s'
0' :: 0':s'
false' :: false':true'
true' :: false':true'
p' :: 0':s' → 0':s'
log' :: 0':s' → 0':s'
_hole_0':s'1 :: 0':s'
_hole_false':true'2 :: false':true'
_gen_0':s'3 :: Nat → 0':s'
Generator Equations:
_gen_0':s'3(0) ⇔ 0'
_gen_0':s'3(+(x, 1)) ⇔ s'(_gen_0':s'3(x))
The following defined symbols remain to be analysed:
ge', half', log'
They will be analysed ascendingly in the following order:
ge' < half'
half' < log'
Proved the following rewrite lemma:
ge'(_gen_0':s'3(_n5), _gen_0':s'3(_n5)) → true', rt ∈ Ω(1 + n5)
Induction Base:
ge'(_gen_0':s'3(0), _gen_0':s'3(0)) →RΩ(1)
true'
Induction Step:
ge'(_gen_0':s'3(+(_$n6, 1)), _gen_0':s'3(+(_$n6, 1))) →RΩ(1)
ge'(_gen_0':s'3(_$n6), _gen_0':s'3(_$n6)) →IH
true'
We have rt ∈ Ω(n) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
Rules:
half'(x) → if'(ge'(x, s'(s'(0'))), x)
if'(false', x) → 0'
if'(true', x) → s'(half'(p'(p'(x))))
p'(0') → 0'
p'(s'(x)) → x
ge'(x, 0') → true'
ge'(0', s'(x)) → false'
ge'(s'(x), s'(y)) → ge'(x, y)
log'(0') → 0'
log'(s'(x)) → s'(log'(half'(s'(x))))
Types:
half' :: 0':s' → 0':s'
if' :: false':true' → 0':s' → 0':s'
ge' :: 0':s' → 0':s' → false':true'
s' :: 0':s' → 0':s'
0' :: 0':s'
false' :: false':true'
true' :: false':true'
p' :: 0':s' → 0':s'
log' :: 0':s' → 0':s'
_hole_0':s'1 :: 0':s'
_hole_false':true'2 :: false':true'
_gen_0':s'3 :: Nat → 0':s'
Lemmas:
ge'(_gen_0':s'3(_n5), _gen_0':s'3(_n5)) → true', rt ∈ Ω(1 + n5)
Generator Equations:
_gen_0':s'3(0) ⇔ 0'
_gen_0':s'3(+(x, 1)) ⇔ s'(_gen_0':s'3(x))
The following defined symbols remain to be analysed:
half', log'
They will be analysed ascendingly in the following order:
half' < log'
Could not prove a rewrite lemma for the defined symbol half'.
Rules:
half'(x) → if'(ge'(x, s'(s'(0'))), x)
if'(false', x) → 0'
if'(true', x) → s'(half'(p'(p'(x))))
p'(0') → 0'
p'(s'(x)) → x
ge'(x, 0') → true'
ge'(0', s'(x)) → false'
ge'(s'(x), s'(y)) → ge'(x, y)
log'(0') → 0'
log'(s'(x)) → s'(log'(half'(s'(x))))
Types:
half' :: 0':s' → 0':s'
if' :: false':true' → 0':s' → 0':s'
ge' :: 0':s' → 0':s' → false':true'
s' :: 0':s' → 0':s'
0' :: 0':s'
false' :: false':true'
true' :: false':true'
p' :: 0':s' → 0':s'
log' :: 0':s' → 0':s'
_hole_0':s'1 :: 0':s'
_hole_false':true'2 :: false':true'
_gen_0':s'3 :: Nat → 0':s'
Lemmas:
ge'(_gen_0':s'3(_n5), _gen_0':s'3(_n5)) → true', rt ∈ Ω(1 + n5)
Generator Equations:
_gen_0':s'3(0) ⇔ 0'
_gen_0':s'3(+(x, 1)) ⇔ s'(_gen_0':s'3(x))
The following defined symbols remain to be analysed:
log'
Could not prove a rewrite lemma for the defined symbol log'.
Rules:
half'(x) → if'(ge'(x, s'(s'(0'))), x)
if'(false', x) → 0'
if'(true', x) → s'(half'(p'(p'(x))))
p'(0') → 0'
p'(s'(x)) → x
ge'(x, 0') → true'
ge'(0', s'(x)) → false'
ge'(s'(x), s'(y)) → ge'(x, y)
log'(0') → 0'
log'(s'(x)) → s'(log'(half'(s'(x))))
Types:
half' :: 0':s' → 0':s'
if' :: false':true' → 0':s' → 0':s'
ge' :: 0':s' → 0':s' → false':true'
s' :: 0':s' → 0':s'
0' :: 0':s'
false' :: false':true'
true' :: false':true'
p' :: 0':s' → 0':s'
log' :: 0':s' → 0':s'
_hole_0':s'1 :: 0':s'
_hole_false':true'2 :: false':true'
_gen_0':s'3 :: Nat → 0':s'
Lemmas:
ge'(_gen_0':s'3(_n5), _gen_0':s'3(_n5)) → true', rt ∈ Ω(1 + n5)
Generator Equations:
_gen_0':s'3(0) ⇔ 0'
_gen_0':s'3(+(x, 1)) ⇔ s'(_gen_0':s'3(x))
No more defined symbols left to analyse.
The lowerbound Ω(n) was proven with the following lemma:
ge'(_gen_0':s'3(_n5), _gen_0':s'3(_n5)) → true', rt ∈ Ω(1 + n5)