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

times(x, plus(y, s(z))) → plus(times(x, plus(y, times(s(z), 0))), times(x, s(z)))
times(x, 0) → 0
times(x, s(y)) → plus(times(x, y), x)
plus(s(x), s(y)) → s(s(plus(if(gt(x, y), x, y), if(not(gt(x, y)), id(x), id(y)))))
plus(s(x), x) → plus(if(gt(x, x), id(x), id(x)), s(x))
plus(zero, y) → y
plus(id(x), s(y)) → s(plus(x, if(gt(s(y), y), y, s(y))))
id(x) → x
if(true, x, y) → x
if(false, x, y) → y
not(x) → if(x, false, true)
gt(s(x), zero) → true
gt(zero, y) → false
gt(s(x), s(y)) → gt(x, y)

Rewrite Strategy: INNERMOST


Renamed function symbols to avoid clashes with predefined symbol.


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


times'(x, plus'(y, s'(z))) → plus'(times'(x, plus'(y, times'(s'(z), 0'))), times'(x, s'(z)))
times'(x, 0') → 0'
times'(x, s'(y)) → plus'(times'(x, y), x)
plus'(s'(x), s'(y)) → s'(s'(plus'(if'(gt'(x, y), x, y), if'(not'(gt'(x, y)), id'(x), id'(y)))))
plus'(s'(x), x) → plus'(if'(gt'(x, x), id'(x), id'(x)), s'(x))
plus'(zero', y) → y
plus'(id'(x), s'(y)) → s'(plus'(x, if'(gt'(s'(y), y), y, s'(y))))
id'(x) → x
if'(true', x, y) → x
if'(false', x, y) → y
not'(x) → if'(x, false', true')
gt'(s'(x), zero') → true'
gt'(zero', y) → false'
gt'(s'(x), s'(y)) → gt'(x, y)

Rewrite Strategy: INNERMOST


Infered types.


Rules:
times'(x, plus'(y, s'(z))) → plus'(times'(x, plus'(y, times'(s'(z), 0'))), times'(x, s'(z)))
times'(x, 0') → 0'
times'(x, s'(y)) → plus'(times'(x, y), x)
plus'(s'(x), s'(y)) → s'(s'(plus'(if'(gt'(x, y), x, y), if'(not'(gt'(x, y)), id'(x), id'(y)))))
plus'(s'(x), x) → plus'(if'(gt'(x, x), id'(x), id'(x)), s'(x))
plus'(zero', y) → y
plus'(id'(x), s'(y)) → s'(plus'(x, if'(gt'(s'(y), y), y, s'(y))))
id'(x) → x
if'(true', x, y) → x
if'(false', x, y) → y
not'(x) → if'(x, false', true')
gt'(s'(x), zero') → true'
gt'(zero', y) → false'
gt'(s'(x), s'(y)) → gt'(x, y)

Types:
times' :: s':0':zero':true':false' → s':0':zero':true':false' → s':0':zero':true':false'
plus' :: s':0':zero':true':false' → s':0':zero':true':false' → s':0':zero':true':false'
s' :: s':0':zero':true':false' → s':0':zero':true':false'
0' :: s':0':zero':true':false'
if' :: s':0':zero':true':false' → s':0':zero':true':false' → s':0':zero':true':false' → s':0':zero':true':false'
gt' :: s':0':zero':true':false' → s':0':zero':true':false' → s':0':zero':true':false'
not' :: s':0':zero':true':false' → s':0':zero':true':false'
id' :: s':0':zero':true':false' → s':0':zero':true':false'
zero' :: s':0':zero':true':false'
true' :: s':0':zero':true':false'
false' :: s':0':zero':true':false'
_hole_s':0':zero':true':false'1 :: s':0':zero':true':false'
_gen_s':0':zero':true':false'2 :: Nat → s':0':zero':true':false'


Heuristically decided to analyse the following defined symbols:
times', plus', gt'

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


Rules:
times'(x, plus'(y, s'(z))) → plus'(times'(x, plus'(y, times'(s'(z), 0'))), times'(x, s'(z)))
times'(x, 0') → 0'
times'(x, s'(y)) → plus'(times'(x, y), x)
plus'(s'(x), s'(y)) → s'(s'(plus'(if'(gt'(x, y), x, y), if'(not'(gt'(x, y)), id'(x), id'(y)))))
plus'(s'(x), x) → plus'(if'(gt'(x, x), id'(x), id'(x)), s'(x))
plus'(zero', y) → y
plus'(id'(x), s'(y)) → s'(plus'(x, if'(gt'(s'(y), y), y, s'(y))))
id'(x) → x
if'(true', x, y) → x
if'(false', x, y) → y
not'(x) → if'(x, false', true')
gt'(s'(x), zero') → true'
gt'(zero', y) → false'
gt'(s'(x), s'(y)) → gt'(x, y)

Types:
times' :: s':0':zero':true':false' → s':0':zero':true':false' → s':0':zero':true':false'
plus' :: s':0':zero':true':false' → s':0':zero':true':false' → s':0':zero':true':false'
s' :: s':0':zero':true':false' → s':0':zero':true':false'
0' :: s':0':zero':true':false'
if' :: s':0':zero':true':false' → s':0':zero':true':false' → s':0':zero':true':false' → s':0':zero':true':false'
gt' :: s':0':zero':true':false' → s':0':zero':true':false' → s':0':zero':true':false'
not' :: s':0':zero':true':false' → s':0':zero':true':false'
id' :: s':0':zero':true':false' → s':0':zero':true':false'
zero' :: s':0':zero':true':false'
true' :: s':0':zero':true':false'
false' :: s':0':zero':true':false'
_hole_s':0':zero':true':false'1 :: s':0':zero':true':false'
_gen_s':0':zero':true':false'2 :: Nat → s':0':zero':true':false'

Generator Equations:
_gen_s':0':zero':true':false'2(0) ⇔ 0'
_gen_s':0':zero':true':false'2(+(x, 1)) ⇔ s'(_gen_s':0':zero':true':false'2(x))

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

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


Proved the following rewrite lemma:
gt'(_gen_s':0':zero':true':false'2(+(1, _n4)), _gen_s':0':zero':true':false'2(+(1, _n4))) → _*3, rt ∈ Ω(n4)

Induction Base:
gt'(_gen_s':0':zero':true':false'2(+(1, 0)), _gen_s':0':zero':true':false'2(+(1, 0)))

Induction Step:
gt'(_gen_s':0':zero':true':false'2(+(1, +(_$n5, 1))), _gen_s':0':zero':true':false'2(+(1, +(_$n5, 1)))) →RΩ(1)
gt'(_gen_s':0':zero':true':false'2(+(1, _$n5)), _gen_s':0':zero':true':false'2(+(1, _$n5))) →IH
_*3

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


Rules:
times'(x, plus'(y, s'(z))) → plus'(times'(x, plus'(y, times'(s'(z), 0'))), times'(x, s'(z)))
times'(x, 0') → 0'
times'(x, s'(y)) → plus'(times'(x, y), x)
plus'(s'(x), s'(y)) → s'(s'(plus'(if'(gt'(x, y), x, y), if'(not'(gt'(x, y)), id'(x), id'(y)))))
plus'(s'(x), x) → plus'(if'(gt'(x, x), id'(x), id'(x)), s'(x))
plus'(zero', y) → y
plus'(id'(x), s'(y)) → s'(plus'(x, if'(gt'(s'(y), y), y, s'(y))))
id'(x) → x
if'(true', x, y) → x
if'(false', x, y) → y
not'(x) → if'(x, false', true')
gt'(s'(x), zero') → true'
gt'(zero', y) → false'
gt'(s'(x), s'(y)) → gt'(x, y)

Types:
times' :: s':0':zero':true':false' → s':0':zero':true':false' → s':0':zero':true':false'
plus' :: s':0':zero':true':false' → s':0':zero':true':false' → s':0':zero':true':false'
s' :: s':0':zero':true':false' → s':0':zero':true':false'
0' :: s':0':zero':true':false'
if' :: s':0':zero':true':false' → s':0':zero':true':false' → s':0':zero':true':false' → s':0':zero':true':false'
gt' :: s':0':zero':true':false' → s':0':zero':true':false' → s':0':zero':true':false'
not' :: s':0':zero':true':false' → s':0':zero':true':false'
id' :: s':0':zero':true':false' → s':0':zero':true':false'
zero' :: s':0':zero':true':false'
true' :: s':0':zero':true':false'
false' :: s':0':zero':true':false'
_hole_s':0':zero':true':false'1 :: s':0':zero':true':false'
_gen_s':0':zero':true':false'2 :: Nat → s':0':zero':true':false'

Lemmas:
gt'(_gen_s':0':zero':true':false'2(+(1, _n4)), _gen_s':0':zero':true':false'2(+(1, _n4))) → _*3, rt ∈ Ω(n4)

Generator Equations:
_gen_s':0':zero':true':false'2(0) ⇔ 0'
_gen_s':0':zero':true':false'2(+(x, 1)) ⇔ s'(_gen_s':0':zero':true':false'2(x))

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

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


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


Rules:
times'(x, plus'(y, s'(z))) → plus'(times'(x, plus'(y, times'(s'(z), 0'))), times'(x, s'(z)))
times'(x, 0') → 0'
times'(x, s'(y)) → plus'(times'(x, y), x)
plus'(s'(x), s'(y)) → s'(s'(plus'(if'(gt'(x, y), x, y), if'(not'(gt'(x, y)), id'(x), id'(y)))))
plus'(s'(x), x) → plus'(if'(gt'(x, x), id'(x), id'(x)), s'(x))
plus'(zero', y) → y
plus'(id'(x), s'(y)) → s'(plus'(x, if'(gt'(s'(y), y), y, s'(y))))
id'(x) → x
if'(true', x, y) → x
if'(false', x, y) → y
not'(x) → if'(x, false', true')
gt'(s'(x), zero') → true'
gt'(zero', y) → false'
gt'(s'(x), s'(y)) → gt'(x, y)

Types:
times' :: s':0':zero':true':false' → s':0':zero':true':false' → s':0':zero':true':false'
plus' :: s':0':zero':true':false' → s':0':zero':true':false' → s':0':zero':true':false'
s' :: s':0':zero':true':false' → s':0':zero':true':false'
0' :: s':0':zero':true':false'
if' :: s':0':zero':true':false' → s':0':zero':true':false' → s':0':zero':true':false' → s':0':zero':true':false'
gt' :: s':0':zero':true':false' → s':0':zero':true':false' → s':0':zero':true':false'
not' :: s':0':zero':true':false' → s':0':zero':true':false'
id' :: s':0':zero':true':false' → s':0':zero':true':false'
zero' :: s':0':zero':true':false'
true' :: s':0':zero':true':false'
false' :: s':0':zero':true':false'
_hole_s':0':zero':true':false'1 :: s':0':zero':true':false'
_gen_s':0':zero':true':false'2 :: Nat → s':0':zero':true':false'

Lemmas:
gt'(_gen_s':0':zero':true':false'2(+(1, _n4)), _gen_s':0':zero':true':false'2(+(1, _n4))) → _*3, rt ∈ Ω(n4)

Generator Equations:
_gen_s':0':zero':true':false'2(0) ⇔ 0'
_gen_s':0':zero':true':false'2(+(x, 1)) ⇔ s'(_gen_s':0':zero':true':false'2(x))

The following defined symbols remain to be analysed:
times'


Proved the following rewrite lemma:
times'(_gen_s':0':zero':true':false'2(a), _gen_s':0':zero':true':false'2(+(1, _n4430))) → _*3, rt ∈ Ω(n4430)

Induction Base:
times'(_gen_s':0':zero':true':false'2(a), _gen_s':0':zero':true':false'2(+(1, 0)))

Induction Step:
times'(_gen_s':0':zero':true':false'2(_a19998), _gen_s':0':zero':true':false'2(+(1, +(_$n4431, 1)))) →RΩ(1)
plus'(times'(_gen_s':0':zero':true':false'2(_a19998), _gen_s':0':zero':true':false'2(+(1, _$n4431))), _gen_s':0':zero':true':false'2(_a19998)) →IH
plus'(_*3, _gen_s':0':zero':true':false'2(_a19998))

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


Rules:
times'(x, plus'(y, s'(z))) → plus'(times'(x, plus'(y, times'(s'(z), 0'))), times'(x, s'(z)))
times'(x, 0') → 0'
times'(x, s'(y)) → plus'(times'(x, y), x)
plus'(s'(x), s'(y)) → s'(s'(plus'(if'(gt'(x, y), x, y), if'(not'(gt'(x, y)), id'(x), id'(y)))))
plus'(s'(x), x) → plus'(if'(gt'(x, x), id'(x), id'(x)), s'(x))
plus'(zero', y) → y
plus'(id'(x), s'(y)) → s'(plus'(x, if'(gt'(s'(y), y), y, s'(y))))
id'(x) → x
if'(true', x, y) → x
if'(false', x, y) → y
not'(x) → if'(x, false', true')
gt'(s'(x), zero') → true'
gt'(zero', y) → false'
gt'(s'(x), s'(y)) → gt'(x, y)

Types:
times' :: s':0':zero':true':false' → s':0':zero':true':false' → s':0':zero':true':false'
plus' :: s':0':zero':true':false' → s':0':zero':true':false' → s':0':zero':true':false'
s' :: s':0':zero':true':false' → s':0':zero':true':false'
0' :: s':0':zero':true':false'
if' :: s':0':zero':true':false' → s':0':zero':true':false' → s':0':zero':true':false' → s':0':zero':true':false'
gt' :: s':0':zero':true':false' → s':0':zero':true':false' → s':0':zero':true':false'
not' :: s':0':zero':true':false' → s':0':zero':true':false'
id' :: s':0':zero':true':false' → s':0':zero':true':false'
zero' :: s':0':zero':true':false'
true' :: s':0':zero':true':false'
false' :: s':0':zero':true':false'
_hole_s':0':zero':true':false'1 :: s':0':zero':true':false'
_gen_s':0':zero':true':false'2 :: Nat → s':0':zero':true':false'

Lemmas:
gt'(_gen_s':0':zero':true':false'2(+(1, _n4)), _gen_s':0':zero':true':false'2(+(1, _n4))) → _*3, rt ∈ Ω(n4)
times'(_gen_s':0':zero':true':false'2(a), _gen_s':0':zero':true':false'2(+(1, _n4430))) → _*3, rt ∈ Ω(n4430)

Generator Equations:
_gen_s':0':zero':true':false'2(0) ⇔ 0'
_gen_s':0':zero':true':false'2(+(x, 1)) ⇔ s'(_gen_s':0':zero':true':false'2(x))

No more defined symbols left to analyse.


The lowerbound Ω(n) was proven with the following lemma:
gt'(_gen_s':0':zero':true':false'2(+(1, _n4)), _gen_s':0':zero':true':false'2(+(1, _n4))) → _*3, rt ∈ Ω(n4)