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

times(x, plus(y, 1)) → plus(times(x, plus(y, times(1, 0))), x)
times(x, 1) → x
times(x, 0) → 0
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, 1')) → plus'(times'(x, plus'(y, times'(1', 0'))), x)
times'(x, 1') → x
times'(x, 0') → 0'
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, 1')) → plus'(times'(x, plus'(y, times'(1', 0'))), x)
times'(x, 1') → x
times'(x, 0') → 0'
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' :: 1':0':s':zero':true':false' → 1':0':s':zero':true':false' → 1':0':s':zero':true':false'
plus' :: 1':0':s':zero':true':false' → 1':0':s':zero':true':false' → 1':0':s':zero':true':false'
1' :: 1':0':s':zero':true':false'
0' :: 1':0':s':zero':true':false'
s' :: 1':0':s':zero':true':false' → 1':0':s':zero':true':false'
if' :: 1':0':s':zero':true':false' → 1':0':s':zero':true':false' → 1':0':s':zero':true':false' → 1':0':s':zero':true':false'
gt' :: 1':0':s':zero':true':false' → 1':0':s':zero':true':false' → 1':0':s':zero':true':false'
not' :: 1':0':s':zero':true':false' → 1':0':s':zero':true':false'
id' :: 1':0':s':zero':true':false' → 1':0':s':zero':true':false'
zero' :: 1':0':s':zero':true':false'
true' :: 1':0':s':zero':true':false'
false' :: 1':0':s':zero':true':false'
_hole_1':0':s':zero':true':false'1 :: 1':0':s':zero':true':false'
_gen_1':0':s':zero':true':false'2 :: Nat → 1':0':s':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, 1')) → plus'(times'(x, plus'(y, times'(1', 0'))), x)
times'(x, 1') → x
times'(x, 0') → 0'
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' :: 1':0':s':zero':true':false' → 1':0':s':zero':true':false' → 1':0':s':zero':true':false'
plus' :: 1':0':s':zero':true':false' → 1':0':s':zero':true':false' → 1':0':s':zero':true':false'
1' :: 1':0':s':zero':true':false'
0' :: 1':0':s':zero':true':false'
s' :: 1':0':s':zero':true':false' → 1':0':s':zero':true':false'
if' :: 1':0':s':zero':true':false' → 1':0':s':zero':true':false' → 1':0':s':zero':true':false' → 1':0':s':zero':true':false'
gt' :: 1':0':s':zero':true':false' → 1':0':s':zero':true':false' → 1':0':s':zero':true':false'
not' :: 1':0':s':zero':true':false' → 1':0':s':zero':true':false'
id' :: 1':0':s':zero':true':false' → 1':0':s':zero':true':false'
zero' :: 1':0':s':zero':true':false'
true' :: 1':0':s':zero':true':false'
false' :: 1':0':s':zero':true':false'
_hole_1':0':s':zero':true':false'1 :: 1':0':s':zero':true':false'
_gen_1':0':s':zero':true':false'2 :: Nat → 1':0':s':zero':true':false'

Generator Equations:
_gen_1':0':s':zero':true':false'2(0) ⇔ 1'
_gen_1':0':s':zero':true':false'2(+(x, 1)) ⇔ s'(_gen_1':0':s':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_1':0':s':zero':true':false'2(+(1, _n4)), _gen_1':0':s':zero':true':false'2(+(1, _n4))) → _*3, rt ∈ Ω(n4)

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

Induction Step:
gt'(_gen_1':0':s':zero':true':false'2(+(1, +(_$n5, 1))), _gen_1':0':s':zero':true':false'2(+(1, +(_$n5, 1)))) →RΩ(1)
gt'(_gen_1':0':s':zero':true':false'2(+(1, _$n5)), _gen_1':0':s':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, 1')) → plus'(times'(x, plus'(y, times'(1', 0'))), x)
times'(x, 1') → x
times'(x, 0') → 0'
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' :: 1':0':s':zero':true':false' → 1':0':s':zero':true':false' → 1':0':s':zero':true':false'
plus' :: 1':0':s':zero':true':false' → 1':0':s':zero':true':false' → 1':0':s':zero':true':false'
1' :: 1':0':s':zero':true':false'
0' :: 1':0':s':zero':true':false'
s' :: 1':0':s':zero':true':false' → 1':0':s':zero':true':false'
if' :: 1':0':s':zero':true':false' → 1':0':s':zero':true':false' → 1':0':s':zero':true':false' → 1':0':s':zero':true':false'
gt' :: 1':0':s':zero':true':false' → 1':0':s':zero':true':false' → 1':0':s':zero':true':false'
not' :: 1':0':s':zero':true':false' → 1':0':s':zero':true':false'
id' :: 1':0':s':zero':true':false' → 1':0':s':zero':true':false'
zero' :: 1':0':s':zero':true':false'
true' :: 1':0':s':zero':true':false'
false' :: 1':0':s':zero':true':false'
_hole_1':0':s':zero':true':false'1 :: 1':0':s':zero':true':false'
_gen_1':0':s':zero':true':false'2 :: Nat → 1':0':s':zero':true':false'

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

Generator Equations:
_gen_1':0':s':zero':true':false'2(0) ⇔ 1'
_gen_1':0':s':zero':true':false'2(+(x, 1)) ⇔ s'(_gen_1':0':s':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, 1')) → plus'(times'(x, plus'(y, times'(1', 0'))), x)
times'(x, 1') → x
times'(x, 0') → 0'
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' :: 1':0':s':zero':true':false' → 1':0':s':zero':true':false' → 1':0':s':zero':true':false'
plus' :: 1':0':s':zero':true':false' → 1':0':s':zero':true':false' → 1':0':s':zero':true':false'
1' :: 1':0':s':zero':true':false'
0' :: 1':0':s':zero':true':false'
s' :: 1':0':s':zero':true':false' → 1':0':s':zero':true':false'
if' :: 1':0':s':zero':true':false' → 1':0':s':zero':true':false' → 1':0':s':zero':true':false' → 1':0':s':zero':true':false'
gt' :: 1':0':s':zero':true':false' → 1':0':s':zero':true':false' → 1':0':s':zero':true':false'
not' :: 1':0':s':zero':true':false' → 1':0':s':zero':true':false'
id' :: 1':0':s':zero':true':false' → 1':0':s':zero':true':false'
zero' :: 1':0':s':zero':true':false'
true' :: 1':0':s':zero':true':false'
false' :: 1':0':s':zero':true':false'
_hole_1':0':s':zero':true':false'1 :: 1':0':s':zero':true':false'
_gen_1':0':s':zero':true':false'2 :: Nat → 1':0':s':zero':true':false'

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

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

The following defined symbols remain to be analysed:
times'


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


Rules:
times'(x, plus'(y, 1')) → plus'(times'(x, plus'(y, times'(1', 0'))), x)
times'(x, 1') → x
times'(x, 0') → 0'
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' :: 1':0':s':zero':true':false' → 1':0':s':zero':true':false' → 1':0':s':zero':true':false'
plus' :: 1':0':s':zero':true':false' → 1':0':s':zero':true':false' → 1':0':s':zero':true':false'
1' :: 1':0':s':zero':true':false'
0' :: 1':0':s':zero':true':false'
s' :: 1':0':s':zero':true':false' → 1':0':s':zero':true':false'
if' :: 1':0':s':zero':true':false' → 1':0':s':zero':true':false' → 1':0':s':zero':true':false' → 1':0':s':zero':true':false'
gt' :: 1':0':s':zero':true':false' → 1':0':s':zero':true':false' → 1':0':s':zero':true':false'
not' :: 1':0':s':zero':true':false' → 1':0':s':zero':true':false'
id' :: 1':0':s':zero':true':false' → 1':0':s':zero':true':false'
zero' :: 1':0':s':zero':true':false'
true' :: 1':0':s':zero':true':false'
false' :: 1':0':s':zero':true':false'
_hole_1':0':s':zero':true':false'1 :: 1':0':s':zero':true':false'
_gen_1':0':s':zero':true':false'2 :: Nat → 1':0':s':zero':true':false'

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

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

No more defined symbols left to analyse.


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