Runtime Complexity TRS:
The TRS R consists of the following rules:

ge(0, 0) → true
ge(s(x), 0) → ge(x, 0)
ge(0, s(0)) → false
ge(0, s(s(x))) → ge(0, s(x))
ge(s(x), s(y)) → ge(x, y)
minus(0, 0) → 0
minus(0, s(x)) → minus(0, x)
minus(s(x), 0) → s(minus(x, 0))
minus(s(x), s(y)) → minus(x, y)
plus(0, 0) → 0
plus(0, s(x)) → s(plus(0, x))
plus(s(x), y) → s(plus(x, y))
div(x, y) → ify(ge(y, s(0)), x, y)
ify(false, x, y) → divByZeroError
ify(true, x, y) → if(ge(x, y), x, y)
if(false, x, y) → 0
if(true, x, y) → s(div(minus(x, y), y))
div(plus(x, y), z) → plus(div(x, z), div(y, z))

Rewrite Strategy: INNERMOST


Renamed function symbols to avoid clashes with predefined symbol.


Runtime Complexity TRS:
The TRS R consists of the following rules:


ge'(0', 0') → true'
ge'(s'(x), 0') → ge'(x, 0')
ge'(0', s'(0')) → false'
ge'(0', s'(s'(x))) → ge'(0', s'(x))
ge'(s'(x), s'(y)) → ge'(x, y)
minus'(0', 0') → 0'
minus'(0', s'(x)) → minus'(0', x)
minus'(s'(x), 0') → s'(minus'(x, 0'))
minus'(s'(x), s'(y)) → minus'(x, y)
plus'(0', 0') → 0'
plus'(0', s'(x)) → s'(plus'(0', x))
plus'(s'(x), y) → s'(plus'(x, y))
div'(x, y) → ify'(ge'(y, s'(0')), x, y)
ify'(false', x, y) → divByZeroError'
ify'(true', x, y) → if'(ge'(x, y), x, y)
if'(false', x, y) → 0'
if'(true', x, y) → s'(div'(minus'(x, y), y))
div'(plus'(x, y), z) → plus'(div'(x, z), div'(y, z))

Rewrite Strategy: INNERMOST


Infered types.


Rules:
ge'(0', 0') → true'
ge'(s'(x), 0') → ge'(x, 0')
ge'(0', s'(0')) → false'
ge'(0', s'(s'(x))) → ge'(0', s'(x))
ge'(s'(x), s'(y)) → ge'(x, y)
minus'(0', 0') → 0'
minus'(0', s'(x)) → minus'(0', x)
minus'(s'(x), 0') → s'(minus'(x, 0'))
minus'(s'(x), s'(y)) → minus'(x, y)
plus'(0', 0') → 0'
plus'(0', s'(x)) → s'(plus'(0', x))
plus'(s'(x), y) → s'(plus'(x, y))
div'(x, y) → ify'(ge'(y, s'(0')), x, y)
ify'(false', x, y) → divByZeroError'
ify'(true', x, y) → if'(ge'(x, y), x, y)
if'(false', x, y) → 0'
if'(true', x, y) → s'(div'(minus'(x, y), y))
div'(plus'(x, y), z) → plus'(div'(x, z), div'(y, z))

Types:
ge' :: 0':s':divByZeroError' → 0':s':divByZeroError' → true':false'
0' :: 0':s':divByZeroError'
true' :: true':false'
s' :: 0':s':divByZeroError' → 0':s':divByZeroError'
false' :: true':false'
minus' :: 0':s':divByZeroError' → 0':s':divByZeroError' → 0':s':divByZeroError'
plus' :: 0':s':divByZeroError' → 0':s':divByZeroError' → 0':s':divByZeroError'
div' :: 0':s':divByZeroError' → 0':s':divByZeroError' → 0':s':divByZeroError'
ify' :: true':false' → 0':s':divByZeroError' → 0':s':divByZeroError' → 0':s':divByZeroError'
divByZeroError' :: 0':s':divByZeroError'
if' :: true':false' → 0':s':divByZeroError' → 0':s':divByZeroError' → 0':s':divByZeroError'
_hole_true':false'1 :: true':false'
_hole_0':s':divByZeroError'2 :: 0':s':divByZeroError'
_gen_0':s':divByZeroError'3 :: Nat → 0':s':divByZeroError'


Heuristically decided to analyse the following defined symbols:
ge', minus', plus', div'

They will be analysed ascendingly in the following order:
ge' < div'
minus' < div'
plus' < div'


Rules:
ge'(0', 0') → true'
ge'(s'(x), 0') → ge'(x, 0')
ge'(0', s'(0')) → false'
ge'(0', s'(s'(x))) → ge'(0', s'(x))
ge'(s'(x), s'(y)) → ge'(x, y)
minus'(0', 0') → 0'
minus'(0', s'(x)) → minus'(0', x)
minus'(s'(x), 0') → s'(minus'(x, 0'))
minus'(s'(x), s'(y)) → minus'(x, y)
plus'(0', 0') → 0'
plus'(0', s'(x)) → s'(plus'(0', x))
plus'(s'(x), y) → s'(plus'(x, y))
div'(x, y) → ify'(ge'(y, s'(0')), x, y)
ify'(false', x, y) → divByZeroError'
ify'(true', x, y) → if'(ge'(x, y), x, y)
if'(false', x, y) → 0'
if'(true', x, y) → s'(div'(minus'(x, y), y))
div'(plus'(x, y), z) → plus'(div'(x, z), div'(y, z))

Types:
ge' :: 0':s':divByZeroError' → 0':s':divByZeroError' → true':false'
0' :: 0':s':divByZeroError'
true' :: true':false'
s' :: 0':s':divByZeroError' → 0':s':divByZeroError'
false' :: true':false'
minus' :: 0':s':divByZeroError' → 0':s':divByZeroError' → 0':s':divByZeroError'
plus' :: 0':s':divByZeroError' → 0':s':divByZeroError' → 0':s':divByZeroError'
div' :: 0':s':divByZeroError' → 0':s':divByZeroError' → 0':s':divByZeroError'
ify' :: true':false' → 0':s':divByZeroError' → 0':s':divByZeroError' → 0':s':divByZeroError'
divByZeroError' :: 0':s':divByZeroError'
if' :: true':false' → 0':s':divByZeroError' → 0':s':divByZeroError' → 0':s':divByZeroError'
_hole_true':false'1 :: true':false'
_hole_0':s':divByZeroError'2 :: 0':s':divByZeroError'
_gen_0':s':divByZeroError'3 :: Nat → 0':s':divByZeroError'

Generator Equations:
_gen_0':s':divByZeroError'3(0) ⇔ 0'
_gen_0':s':divByZeroError'3(+(x, 1)) ⇔ s'(_gen_0':s':divByZeroError'3(x))

The following defined symbols remain to be analysed:
ge', minus', plus', div'

They will be analysed ascendingly in the following order:
ge' < div'
minus' < div'
plus' < div'


Proved the following rewrite lemma:
ge'(_gen_0':s':divByZeroError'3(+(1, _n5)), _gen_0':s':divByZeroError'3(0)) → _*4, rt ∈ Ω(n5)

Induction Base:
ge'(_gen_0':s':divByZeroError'3(+(1, 0)), _gen_0':s':divByZeroError'3(0))

Induction Step:
ge'(_gen_0':s':divByZeroError'3(+(1, +(_$n6, 1))), _gen_0':s':divByZeroError'3(0)) →RΩ(1)
ge'(_gen_0':s':divByZeroError'3(+(1, _$n6)), 0') →IH
_*4

We have rt ∈ Ω(n) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).


Rules:
ge'(0', 0') → true'
ge'(s'(x), 0') → ge'(x, 0')
ge'(0', s'(0')) → false'
ge'(0', s'(s'(x))) → ge'(0', s'(x))
ge'(s'(x), s'(y)) → ge'(x, y)
minus'(0', 0') → 0'
minus'(0', s'(x)) → minus'(0', x)
minus'(s'(x), 0') → s'(minus'(x, 0'))
minus'(s'(x), s'(y)) → minus'(x, y)
plus'(0', 0') → 0'
plus'(0', s'(x)) → s'(plus'(0', x))
plus'(s'(x), y) → s'(plus'(x, y))
div'(x, y) → ify'(ge'(y, s'(0')), x, y)
ify'(false', x, y) → divByZeroError'
ify'(true', x, y) → if'(ge'(x, y), x, y)
if'(false', x, y) → 0'
if'(true', x, y) → s'(div'(minus'(x, y), y))
div'(plus'(x, y), z) → plus'(div'(x, z), div'(y, z))

Types:
ge' :: 0':s':divByZeroError' → 0':s':divByZeroError' → true':false'
0' :: 0':s':divByZeroError'
true' :: true':false'
s' :: 0':s':divByZeroError' → 0':s':divByZeroError'
false' :: true':false'
minus' :: 0':s':divByZeroError' → 0':s':divByZeroError' → 0':s':divByZeroError'
plus' :: 0':s':divByZeroError' → 0':s':divByZeroError' → 0':s':divByZeroError'
div' :: 0':s':divByZeroError' → 0':s':divByZeroError' → 0':s':divByZeroError'
ify' :: true':false' → 0':s':divByZeroError' → 0':s':divByZeroError' → 0':s':divByZeroError'
divByZeroError' :: 0':s':divByZeroError'
if' :: true':false' → 0':s':divByZeroError' → 0':s':divByZeroError' → 0':s':divByZeroError'
_hole_true':false'1 :: true':false'
_hole_0':s':divByZeroError'2 :: 0':s':divByZeroError'
_gen_0':s':divByZeroError'3 :: Nat → 0':s':divByZeroError'

Lemmas:
ge'(_gen_0':s':divByZeroError'3(+(1, _n5)), _gen_0':s':divByZeroError'3(0)) → _*4, rt ∈ Ω(n5)

Generator Equations:
_gen_0':s':divByZeroError'3(0) ⇔ 0'
_gen_0':s':divByZeroError'3(+(x, 1)) ⇔ s'(_gen_0':s':divByZeroError'3(x))

The following defined symbols remain to be analysed:
minus', plus', div'

They will be analysed ascendingly in the following order:
minus' < div'
plus' < div'


Proved the following rewrite lemma:
minus'(_gen_0':s':divByZeroError'3(0), _gen_0':s':divByZeroError'3(_n3518)) → _gen_0':s':divByZeroError'3(0), rt ∈ Ω(1 + n3518)

Induction Base:
minus'(_gen_0':s':divByZeroError'3(0), _gen_0':s':divByZeroError'3(0)) →RΩ(1)
0'

Induction Step:
minus'(_gen_0':s':divByZeroError'3(0), _gen_0':s':divByZeroError'3(+(_$n3519, 1))) →RΩ(1)
minus'(0', _gen_0':s':divByZeroError'3(_$n3519)) →IH
_gen_0':s':divByZeroError'3(0)

We have rt ∈ Ω(n) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).


Rules:
ge'(0', 0') → true'
ge'(s'(x), 0') → ge'(x, 0')
ge'(0', s'(0')) → false'
ge'(0', s'(s'(x))) → ge'(0', s'(x))
ge'(s'(x), s'(y)) → ge'(x, y)
minus'(0', 0') → 0'
minus'(0', s'(x)) → minus'(0', x)
minus'(s'(x), 0') → s'(minus'(x, 0'))
minus'(s'(x), s'(y)) → minus'(x, y)
plus'(0', 0') → 0'
plus'(0', s'(x)) → s'(plus'(0', x))
plus'(s'(x), y) → s'(plus'(x, y))
div'(x, y) → ify'(ge'(y, s'(0')), x, y)
ify'(false', x, y) → divByZeroError'
ify'(true', x, y) → if'(ge'(x, y), x, y)
if'(false', x, y) → 0'
if'(true', x, y) → s'(div'(minus'(x, y), y))
div'(plus'(x, y), z) → plus'(div'(x, z), div'(y, z))

Types:
ge' :: 0':s':divByZeroError' → 0':s':divByZeroError' → true':false'
0' :: 0':s':divByZeroError'
true' :: true':false'
s' :: 0':s':divByZeroError' → 0':s':divByZeroError'
false' :: true':false'
minus' :: 0':s':divByZeroError' → 0':s':divByZeroError' → 0':s':divByZeroError'
plus' :: 0':s':divByZeroError' → 0':s':divByZeroError' → 0':s':divByZeroError'
div' :: 0':s':divByZeroError' → 0':s':divByZeroError' → 0':s':divByZeroError'
ify' :: true':false' → 0':s':divByZeroError' → 0':s':divByZeroError' → 0':s':divByZeroError'
divByZeroError' :: 0':s':divByZeroError'
if' :: true':false' → 0':s':divByZeroError' → 0':s':divByZeroError' → 0':s':divByZeroError'
_hole_true':false'1 :: true':false'
_hole_0':s':divByZeroError'2 :: 0':s':divByZeroError'
_gen_0':s':divByZeroError'3 :: Nat → 0':s':divByZeroError'

Lemmas:
ge'(_gen_0':s':divByZeroError'3(+(1, _n5)), _gen_0':s':divByZeroError'3(0)) → _*4, rt ∈ Ω(n5)
minus'(_gen_0':s':divByZeroError'3(0), _gen_0':s':divByZeroError'3(_n3518)) → _gen_0':s':divByZeroError'3(0), rt ∈ Ω(1 + n3518)

Generator Equations:
_gen_0':s':divByZeroError'3(0) ⇔ 0'
_gen_0':s':divByZeroError'3(+(x, 1)) ⇔ s'(_gen_0':s':divByZeroError'3(x))

The following defined symbols remain to be analysed:
plus', div'

They will be analysed ascendingly in the following order:
plus' < div'


Proved the following rewrite lemma:
plus'(_gen_0':s':divByZeroError'3(0), _gen_0':s':divByZeroError'3(_n5276)) → _gen_0':s':divByZeroError'3(_n5276), rt ∈ Ω(1 + n5276)

Induction Base:
plus'(_gen_0':s':divByZeroError'3(0), _gen_0':s':divByZeroError'3(0)) →RΩ(1)
0'

Induction Step:
plus'(_gen_0':s':divByZeroError'3(0), _gen_0':s':divByZeroError'3(+(_$n5277, 1))) →RΩ(1)
s'(plus'(0', _gen_0':s':divByZeroError'3(_$n5277))) →IH
s'(_gen_0':s':divByZeroError'3(_$n5277))

We have rt ∈ Ω(n) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).


Rules:
ge'(0', 0') → true'
ge'(s'(x), 0') → ge'(x, 0')
ge'(0', s'(0')) → false'
ge'(0', s'(s'(x))) → ge'(0', s'(x))
ge'(s'(x), s'(y)) → ge'(x, y)
minus'(0', 0') → 0'
minus'(0', s'(x)) → minus'(0', x)
minus'(s'(x), 0') → s'(minus'(x, 0'))
minus'(s'(x), s'(y)) → minus'(x, y)
plus'(0', 0') → 0'
plus'(0', s'(x)) → s'(plus'(0', x))
plus'(s'(x), y) → s'(plus'(x, y))
div'(x, y) → ify'(ge'(y, s'(0')), x, y)
ify'(false', x, y) → divByZeroError'
ify'(true', x, y) → if'(ge'(x, y), x, y)
if'(false', x, y) → 0'
if'(true', x, y) → s'(div'(minus'(x, y), y))
div'(plus'(x, y), z) → plus'(div'(x, z), div'(y, z))

Types:
ge' :: 0':s':divByZeroError' → 0':s':divByZeroError' → true':false'
0' :: 0':s':divByZeroError'
true' :: true':false'
s' :: 0':s':divByZeroError' → 0':s':divByZeroError'
false' :: true':false'
minus' :: 0':s':divByZeroError' → 0':s':divByZeroError' → 0':s':divByZeroError'
plus' :: 0':s':divByZeroError' → 0':s':divByZeroError' → 0':s':divByZeroError'
div' :: 0':s':divByZeroError' → 0':s':divByZeroError' → 0':s':divByZeroError'
ify' :: true':false' → 0':s':divByZeroError' → 0':s':divByZeroError' → 0':s':divByZeroError'
divByZeroError' :: 0':s':divByZeroError'
if' :: true':false' → 0':s':divByZeroError' → 0':s':divByZeroError' → 0':s':divByZeroError'
_hole_true':false'1 :: true':false'
_hole_0':s':divByZeroError'2 :: 0':s':divByZeroError'
_gen_0':s':divByZeroError'3 :: Nat → 0':s':divByZeroError'

Lemmas:
ge'(_gen_0':s':divByZeroError'3(+(1, _n5)), _gen_0':s':divByZeroError'3(0)) → _*4, rt ∈ Ω(n5)
minus'(_gen_0':s':divByZeroError'3(0), _gen_0':s':divByZeroError'3(_n3518)) → _gen_0':s':divByZeroError'3(0), rt ∈ Ω(1 + n3518)
plus'(_gen_0':s':divByZeroError'3(0), _gen_0':s':divByZeroError'3(_n5276)) → _gen_0':s':divByZeroError'3(_n5276), rt ∈ Ω(1 + n5276)

Generator Equations:
_gen_0':s':divByZeroError'3(0) ⇔ 0'
_gen_0':s':divByZeroError'3(+(x, 1)) ⇔ s'(_gen_0':s':divByZeroError'3(x))

The following defined symbols remain to be analysed:
div'


Could not prove a rewrite lemma for the defined symbol div'.


Rules:
ge'(0', 0') → true'
ge'(s'(x), 0') → ge'(x, 0')
ge'(0', s'(0')) → false'
ge'(0', s'(s'(x))) → ge'(0', s'(x))
ge'(s'(x), s'(y)) → ge'(x, y)
minus'(0', 0') → 0'
minus'(0', s'(x)) → minus'(0', x)
minus'(s'(x), 0') → s'(minus'(x, 0'))
minus'(s'(x), s'(y)) → minus'(x, y)
plus'(0', 0') → 0'
plus'(0', s'(x)) → s'(plus'(0', x))
plus'(s'(x), y) → s'(plus'(x, y))
div'(x, y) → ify'(ge'(y, s'(0')), x, y)
ify'(false', x, y) → divByZeroError'
ify'(true', x, y) → if'(ge'(x, y), x, y)
if'(false', x, y) → 0'
if'(true', x, y) → s'(div'(minus'(x, y), y))
div'(plus'(x, y), z) → plus'(div'(x, z), div'(y, z))

Types:
ge' :: 0':s':divByZeroError' → 0':s':divByZeroError' → true':false'
0' :: 0':s':divByZeroError'
true' :: true':false'
s' :: 0':s':divByZeroError' → 0':s':divByZeroError'
false' :: true':false'
minus' :: 0':s':divByZeroError' → 0':s':divByZeroError' → 0':s':divByZeroError'
plus' :: 0':s':divByZeroError' → 0':s':divByZeroError' → 0':s':divByZeroError'
div' :: 0':s':divByZeroError' → 0':s':divByZeroError' → 0':s':divByZeroError'
ify' :: true':false' → 0':s':divByZeroError' → 0':s':divByZeroError' → 0':s':divByZeroError'
divByZeroError' :: 0':s':divByZeroError'
if' :: true':false' → 0':s':divByZeroError' → 0':s':divByZeroError' → 0':s':divByZeroError'
_hole_true':false'1 :: true':false'
_hole_0':s':divByZeroError'2 :: 0':s':divByZeroError'
_gen_0':s':divByZeroError'3 :: Nat → 0':s':divByZeroError'

Lemmas:
ge'(_gen_0':s':divByZeroError'3(+(1, _n5)), _gen_0':s':divByZeroError'3(0)) → _*4, rt ∈ Ω(n5)
minus'(_gen_0':s':divByZeroError'3(0), _gen_0':s':divByZeroError'3(_n3518)) → _gen_0':s':divByZeroError'3(0), rt ∈ Ω(1 + n3518)
plus'(_gen_0':s':divByZeroError'3(0), _gen_0':s':divByZeroError'3(_n5276)) → _gen_0':s':divByZeroError'3(_n5276), rt ∈ Ω(1 + n5276)

Generator Equations:
_gen_0':s':divByZeroError'3(0) ⇔ 0'
_gen_0':s':divByZeroError'3(+(x, 1)) ⇔ s'(_gen_0':s':divByZeroError'3(x))

No more defined symbols left to analyse.


The lowerbound Ω(n) was proven with the following lemma:
ge'(_gen_0':s':divByZeroError'3(+(1, _n5)), _gen_0':s':divByZeroError'3(0)) → _*4, rt ∈ Ω(n5)