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