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

ge(x, 0) → true
ge(0, s(y)) → false
ge(s(x), s(y)) → ge(x, y)
minus(x, 0) → x
minus(0, y) → 0
minus(s(x), s(y)) → minus(x, y)
id_inc(x) → x
id_inc(x) → s(x)
div(x, y) → if(ge(y, s(0)), ge(x, y), x, y)
if(false, b, x, y) → div_by_zero
if(true, false, x, y) → 0
if(true, true, x, y) → id_inc(div(minus(x, y), y))

Rewrite Strategy: INNERMOST


Renamed function symbols to avoid clashes with predefined symbol.


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


ge'(x, 0') → true'
ge'(0', s'(y)) → false'
ge'(s'(x), s'(y)) → ge'(x, y)
minus'(x, 0') → x
minus'(0', y) → 0'
minus'(s'(x), s'(y)) → minus'(x, y)
id_inc'(x) → x
id_inc'(x) → s'(x)
div'(x, y) → if'(ge'(y, s'(0')), ge'(x, y), x, y)
if'(false', b, x, y) → div_by_zero'
if'(true', false', x, y) → 0'
if'(true', true', x, y) → id_inc'(div'(minus'(x, y), y))

Rewrite Strategy: INNERMOST


Infered types.


Rules:
ge'(x, 0') → true'
ge'(0', s'(y)) → false'
ge'(s'(x), s'(y)) → ge'(x, y)
minus'(x, 0') → x
minus'(0', y) → 0'
minus'(s'(x), s'(y)) → minus'(x, y)
id_inc'(x) → x
id_inc'(x) → s'(x)
div'(x, y) → if'(ge'(y, s'(0')), ge'(x, y), x, y)
if'(false', b, x, y) → div_by_zero'
if'(true', false', x, y) → 0'
if'(true', true', x, y) → id_inc'(div'(minus'(x, y), y))

Types:
ge' :: 0':s':div_by_zero' → 0':s':div_by_zero' → true':false'
0' :: 0':s':div_by_zero'
true' :: true':false'
s' :: 0':s':div_by_zero' → 0':s':div_by_zero'
false' :: true':false'
minus' :: 0':s':div_by_zero' → 0':s':div_by_zero' → 0':s':div_by_zero'
id_inc' :: 0':s':div_by_zero' → 0':s':div_by_zero'
div' :: 0':s':div_by_zero' → 0':s':div_by_zero' → 0':s':div_by_zero'
if' :: true':false' → true':false' → 0':s':div_by_zero' → 0':s':div_by_zero' → 0':s':div_by_zero'
div_by_zero' :: 0':s':div_by_zero'
_hole_true':false'1 :: true':false'
_hole_0':s':div_by_zero'2 :: 0':s':div_by_zero'
_gen_0':s':div_by_zero'3 :: Nat → 0':s':div_by_zero'


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

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


Rules:
ge'(x, 0') → true'
ge'(0', s'(y)) → false'
ge'(s'(x), s'(y)) → ge'(x, y)
minus'(x, 0') → x
minus'(0', y) → 0'
minus'(s'(x), s'(y)) → minus'(x, y)
id_inc'(x) → x
id_inc'(x) → s'(x)
div'(x, y) → if'(ge'(y, s'(0')), ge'(x, y), x, y)
if'(false', b, x, y) → div_by_zero'
if'(true', false', x, y) → 0'
if'(true', true', x, y) → id_inc'(div'(minus'(x, y), y))

Types:
ge' :: 0':s':div_by_zero' → 0':s':div_by_zero' → true':false'
0' :: 0':s':div_by_zero'
true' :: true':false'
s' :: 0':s':div_by_zero' → 0':s':div_by_zero'
false' :: true':false'
minus' :: 0':s':div_by_zero' → 0':s':div_by_zero' → 0':s':div_by_zero'
id_inc' :: 0':s':div_by_zero' → 0':s':div_by_zero'
div' :: 0':s':div_by_zero' → 0':s':div_by_zero' → 0':s':div_by_zero'
if' :: true':false' → true':false' → 0':s':div_by_zero' → 0':s':div_by_zero' → 0':s':div_by_zero'
div_by_zero' :: 0':s':div_by_zero'
_hole_true':false'1 :: true':false'
_hole_0':s':div_by_zero'2 :: 0':s':div_by_zero'
_gen_0':s':div_by_zero'3 :: Nat → 0':s':div_by_zero'

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

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

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


Proved the following rewrite lemma:
ge'(_gen_0':s':div_by_zero'3(_n5), _gen_0':s':div_by_zero'3(_n5)) → true', rt ∈ Ω(1 + n5)

Induction Base:
ge'(_gen_0':s':div_by_zero'3(0), _gen_0':s':div_by_zero'3(0)) →RΩ(1)
true'

Induction Step:
ge'(_gen_0':s':div_by_zero'3(+(_$n6, 1)), _gen_0':s':div_by_zero'3(+(_$n6, 1))) →RΩ(1)
ge'(_gen_0':s':div_by_zero'3(_$n6), _gen_0':s':div_by_zero'3(_$n6)) →IH
true'

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


Rules:
ge'(x, 0') → true'
ge'(0', s'(y)) → false'
ge'(s'(x), s'(y)) → ge'(x, y)
minus'(x, 0') → x
minus'(0', y) → 0'
minus'(s'(x), s'(y)) → minus'(x, y)
id_inc'(x) → x
id_inc'(x) → s'(x)
div'(x, y) → if'(ge'(y, s'(0')), ge'(x, y), x, y)
if'(false', b, x, y) → div_by_zero'
if'(true', false', x, y) → 0'
if'(true', true', x, y) → id_inc'(div'(minus'(x, y), y))

Types:
ge' :: 0':s':div_by_zero' → 0':s':div_by_zero' → true':false'
0' :: 0':s':div_by_zero'
true' :: true':false'
s' :: 0':s':div_by_zero' → 0':s':div_by_zero'
false' :: true':false'
minus' :: 0':s':div_by_zero' → 0':s':div_by_zero' → 0':s':div_by_zero'
id_inc' :: 0':s':div_by_zero' → 0':s':div_by_zero'
div' :: 0':s':div_by_zero' → 0':s':div_by_zero' → 0':s':div_by_zero'
if' :: true':false' → true':false' → 0':s':div_by_zero' → 0':s':div_by_zero' → 0':s':div_by_zero'
div_by_zero' :: 0':s':div_by_zero'
_hole_true':false'1 :: true':false'
_hole_0':s':div_by_zero'2 :: 0':s':div_by_zero'
_gen_0':s':div_by_zero'3 :: Nat → 0':s':div_by_zero'

Lemmas:
ge'(_gen_0':s':div_by_zero'3(_n5), _gen_0':s':div_by_zero'3(_n5)) → true', rt ∈ Ω(1 + n5)

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

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

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


Proved the following rewrite lemma:
minus'(_gen_0':s':div_by_zero'3(_n641), _gen_0':s':div_by_zero'3(_n641)) → _gen_0':s':div_by_zero'3(0), rt ∈ Ω(1 + n641)

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

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

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


Rules:
ge'(x, 0') → true'
ge'(0', s'(y)) → false'
ge'(s'(x), s'(y)) → ge'(x, y)
minus'(x, 0') → x
minus'(0', y) → 0'
minus'(s'(x), s'(y)) → minus'(x, y)
id_inc'(x) → x
id_inc'(x) → s'(x)
div'(x, y) → if'(ge'(y, s'(0')), ge'(x, y), x, y)
if'(false', b, x, y) → div_by_zero'
if'(true', false', x, y) → 0'
if'(true', true', x, y) → id_inc'(div'(minus'(x, y), y))

Types:
ge' :: 0':s':div_by_zero' → 0':s':div_by_zero' → true':false'
0' :: 0':s':div_by_zero'
true' :: true':false'
s' :: 0':s':div_by_zero' → 0':s':div_by_zero'
false' :: true':false'
minus' :: 0':s':div_by_zero' → 0':s':div_by_zero' → 0':s':div_by_zero'
id_inc' :: 0':s':div_by_zero' → 0':s':div_by_zero'
div' :: 0':s':div_by_zero' → 0':s':div_by_zero' → 0':s':div_by_zero'
if' :: true':false' → true':false' → 0':s':div_by_zero' → 0':s':div_by_zero' → 0':s':div_by_zero'
div_by_zero' :: 0':s':div_by_zero'
_hole_true':false'1 :: true':false'
_hole_0':s':div_by_zero'2 :: 0':s':div_by_zero'
_gen_0':s':div_by_zero'3 :: Nat → 0':s':div_by_zero'

Lemmas:
ge'(_gen_0':s':div_by_zero'3(_n5), _gen_0':s':div_by_zero'3(_n5)) → true', rt ∈ Ω(1 + n5)
minus'(_gen_0':s':div_by_zero'3(_n641), _gen_0':s':div_by_zero'3(_n641)) → _gen_0':s':div_by_zero'3(0), rt ∈ Ω(1 + n641)

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

The following defined symbols remain to be analysed:
div'


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


Rules:
ge'(x, 0') → true'
ge'(0', s'(y)) → false'
ge'(s'(x), s'(y)) → ge'(x, y)
minus'(x, 0') → x
minus'(0', y) → 0'
minus'(s'(x), s'(y)) → minus'(x, y)
id_inc'(x) → x
id_inc'(x) → s'(x)
div'(x, y) → if'(ge'(y, s'(0')), ge'(x, y), x, y)
if'(false', b, x, y) → div_by_zero'
if'(true', false', x, y) → 0'
if'(true', true', x, y) → id_inc'(div'(minus'(x, y), y))

Types:
ge' :: 0':s':div_by_zero' → 0':s':div_by_zero' → true':false'
0' :: 0':s':div_by_zero'
true' :: true':false'
s' :: 0':s':div_by_zero' → 0':s':div_by_zero'
false' :: true':false'
minus' :: 0':s':div_by_zero' → 0':s':div_by_zero' → 0':s':div_by_zero'
id_inc' :: 0':s':div_by_zero' → 0':s':div_by_zero'
div' :: 0':s':div_by_zero' → 0':s':div_by_zero' → 0':s':div_by_zero'
if' :: true':false' → true':false' → 0':s':div_by_zero' → 0':s':div_by_zero' → 0':s':div_by_zero'
div_by_zero' :: 0':s':div_by_zero'
_hole_true':false'1 :: true':false'
_hole_0':s':div_by_zero'2 :: 0':s':div_by_zero'
_gen_0':s':div_by_zero'3 :: Nat → 0':s':div_by_zero'

Lemmas:
ge'(_gen_0':s':div_by_zero'3(_n5), _gen_0':s':div_by_zero'3(_n5)) → true', rt ∈ Ω(1 + n5)
minus'(_gen_0':s':div_by_zero'3(_n641), _gen_0':s':div_by_zero'3(_n641)) → _gen_0':s':div_by_zero'3(0), rt ∈ Ω(1 + n641)

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

No more defined symbols left to analyse.


The lowerbound Ω(n) was proven with the following lemma:
ge'(_gen_0':s':div_by_zero'3(_n5), _gen_0':s':div_by_zero'3(_n5)) → true', rt ∈ Ω(1 + n5)