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)
minus(x, y) → help(lt(y, x), x, y)
help(true, x, y) → s(minus(x, s(y)))
help(false, x, y) → 0
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)
minus'(x, y) → help'(lt'(y, x), x, y)
help'(true', x, y) → s'(minus'(x, s'(y)))
help'(false', x, y) → 0'
Infered types.
Rules:
lt'(0', s'(x)) → true'
lt'(x, 0') → false'
lt'(s'(x), s'(y)) → lt'(x, y)
minus'(x, y) → help'(lt'(y, x), x, y)
help'(true', x, y) → s'(minus'(x, s'(y)))
help'(false', x, y) → 0'
Types:
lt' :: 0':s' → 0':s' → true':false'
0' :: 0':s'
s' :: 0':s' → 0':s'
true' :: true':false'
false' :: true':false'
minus' :: 0':s' → 0':s' → 0':s'
help' :: true':false' → 0':s' → 0':s' → 0':s'
_hole_true':false'1 :: true':false'
_hole_0':s'2 :: 0':s'
_gen_0':s'3 :: Nat → 0':s'
Heuristically decided to analyse the following defined symbols:
lt', minus'
They will be analysed ascendingly in the following order:
lt' < minus'
Rules:
lt'(0', s'(x)) → true'
lt'(x, 0') → false'
lt'(s'(x), s'(y)) → lt'(x, y)
minus'(x, y) → help'(lt'(y, x), x, y)
help'(true', x, y) → s'(minus'(x, s'(y)))
help'(false', x, y) → 0'
Types:
lt' :: 0':s' → 0':s' → true':false'
0' :: 0':s'
s' :: 0':s' → 0':s'
true' :: true':false'
false' :: true':false'
minus' :: 0':s' → 0':s' → 0':s'
help' :: true':false' → 0':s' → 0':s' → 0':s'
_hole_true':false'1 :: true':false'
_hole_0':s'2 :: 0':s'
_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:
lt', minus'
They will be analysed ascendingly in the following order:
lt' < minus'
Proved the following rewrite lemma:
lt'(_gen_0':s'3(_n5), _gen_0':s'3(+(1, _n5))) → true', rt ∈ Ω(1 + n5)
Induction Base:
lt'(_gen_0':s'3(0), _gen_0':s'3(+(1, 0))) →RΩ(1)
true'
Induction Step:
lt'(_gen_0':s'3(+(_$n6, 1)), _gen_0':s'3(+(1, +(_$n6, 1)))) →RΩ(1)
lt'(_gen_0':s'3(_$n6), _gen_0':s'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)
minus'(x, y) → help'(lt'(y, x), x, y)
help'(true', x, y) → s'(minus'(x, s'(y)))
help'(false', x, y) → 0'
Types:
lt' :: 0':s' → 0':s' → true':false'
0' :: 0':s'
s' :: 0':s' → 0':s'
true' :: true':false'
false' :: true':false'
minus' :: 0':s' → 0':s' → 0':s'
help' :: true':false' → 0':s' → 0':s' → 0':s'
_hole_true':false'1 :: true':false'
_hole_0':s'2 :: 0':s'
_gen_0':s'3 :: Nat → 0':s'
Lemmas:
lt'(_gen_0':s'3(_n5), _gen_0':s'3(+(1, _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:
minus'
Could not prove a rewrite lemma for the defined symbol minus'.
Rules:
lt'(0', s'(x)) → true'
lt'(x, 0') → false'
lt'(s'(x), s'(y)) → lt'(x, y)
minus'(x, y) → help'(lt'(y, x), x, y)
help'(true', x, y) → s'(minus'(x, s'(y)))
help'(false', x, y) → 0'
Types:
lt' :: 0':s' → 0':s' → true':false'
0' :: 0':s'
s' :: 0':s' → 0':s'
true' :: true':false'
false' :: true':false'
minus' :: 0':s' → 0':s' → 0':s'
help' :: true':false' → 0':s' → 0':s' → 0':s'
_hole_true':false'1 :: true':false'
_hole_0':s'2 :: 0':s'
_gen_0':s'3 :: Nat → 0':s'
Lemmas:
lt'(_gen_0':s'3(_n5), _gen_0':s'3(+(1, _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:
lt'(_gen_0':s'3(_n5), _gen_0':s'3(+(1, _n5))) → true', rt ∈ Ω(1 + n5)