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

minus(s(x), y) → if(gt(s(x), y), x, y)
if(true, x, y) → s(minus(x, y))
if(false, x, y) → 0
gcd(x, y) → if1(ge(x, y), x, y)
if1(true, x, y) → if2(gt(y, 0), x, y)
if1(false, x, y) → gcd(y, x)
if2(true, x, y) → gcd(minus(x, y), y)
if2(false, x, y) → x
gt(0, y) → false
gt(s(x), 0) → true
gt(s(x), s(y)) → gt(x, y)
ge(x, 0) → true
ge(0, s(x)) → false
ge(s(x), s(y)) → ge(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:


minus'(s'(x), y) → if'(gt'(s'(x), y), x, y)
if'(true', x, y) → s'(minus'(x, y))
if'(false', x, y) → 0'
gcd'(x, y) → if1'(ge'(x, y), x, y)
if1'(true', x, y) → if2'(gt'(y, 0'), x, y)
if1'(false', x, y) → gcd'(y, x)
if2'(true', x, y) → gcd'(minus'(x, y), y)
if2'(false', x, y) → x
gt'(0', y) → false'
gt'(s'(x), 0') → true'
gt'(s'(x), s'(y)) → gt'(x, y)
ge'(x, 0') → true'
ge'(0', s'(x)) → false'
ge'(s'(x), s'(y)) → ge'(x, y)

Rewrite Strategy: INNERMOST


Infered types.


Rules:
minus'(s'(x), y) → if'(gt'(s'(x), y), x, y)
if'(true', x, y) → s'(minus'(x, y))
if'(false', x, y) → 0'
gcd'(x, y) → if1'(ge'(x, y), x, y)
if1'(true', x, y) → if2'(gt'(y, 0'), x, y)
if1'(false', x, y) → gcd'(y, x)
if2'(true', x, y) → gcd'(minus'(x, y), y)
if2'(false', x, y) → x
gt'(0', y) → false'
gt'(s'(x), 0') → true'
gt'(s'(x), s'(y)) → gt'(x, y)
ge'(x, 0') → true'
ge'(0', s'(x)) → false'
ge'(s'(x), s'(y)) → ge'(x, y)

Types:
minus' :: s':0' → s':0' → s':0'
s' :: s':0' → s':0'
if' :: true':false' → s':0' → s':0' → s':0'
gt' :: s':0' → s':0' → true':false'
true' :: true':false'
false' :: true':false'
0' :: s':0'
gcd' :: s':0' → s':0' → s':0'
if1' :: true':false' → s':0' → s':0' → s':0'
ge' :: s':0' → s':0' → true':false'
if2' :: true':false' → s':0' → s':0' → s':0'
_hole_s':0'1 :: s':0'
_hole_true':false'2 :: true':false'
_gen_s':0'3 :: Nat → s':0'


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

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


Rules:
minus'(s'(x), y) → if'(gt'(s'(x), y), x, y)
if'(true', x, y) → s'(minus'(x, y))
if'(false', x, y) → 0'
gcd'(x, y) → if1'(ge'(x, y), x, y)
if1'(true', x, y) → if2'(gt'(y, 0'), x, y)
if1'(false', x, y) → gcd'(y, x)
if2'(true', x, y) → gcd'(minus'(x, y), y)
if2'(false', x, y) → x
gt'(0', y) → false'
gt'(s'(x), 0') → true'
gt'(s'(x), s'(y)) → gt'(x, y)
ge'(x, 0') → true'
ge'(0', s'(x)) → false'
ge'(s'(x), s'(y)) → ge'(x, y)

Types:
minus' :: s':0' → s':0' → s':0'
s' :: s':0' → s':0'
if' :: true':false' → s':0' → s':0' → s':0'
gt' :: s':0' → s':0' → true':false'
true' :: true':false'
false' :: true':false'
0' :: s':0'
gcd' :: s':0' → s':0' → s':0'
if1' :: true':false' → s':0' → s':0' → s':0'
ge' :: s':0' → s':0' → true':false'
if2' :: true':false' → s':0' → s':0' → s':0'
_hole_s':0'1 :: s':0'
_hole_true':false'2 :: true':false'
_gen_s':0'3 :: Nat → s':0'

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

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

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


Proved the following rewrite lemma:
gt'(_gen_s':0'3(_n5), _gen_s':0'3(_n5)) → false', rt ∈ Ω(1 + n5)

Induction Base:
gt'(_gen_s':0'3(0), _gen_s':0'3(0)) →RΩ(1)
false'

Induction Step:
gt'(_gen_s':0'3(+(_$n6, 1)), _gen_s':0'3(+(_$n6, 1))) →RΩ(1)
gt'(_gen_s':0'3(_$n6), _gen_s':0'3(_$n6)) →IH
false'

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


Rules:
minus'(s'(x), y) → if'(gt'(s'(x), y), x, y)
if'(true', x, y) → s'(minus'(x, y))
if'(false', x, y) → 0'
gcd'(x, y) → if1'(ge'(x, y), x, y)
if1'(true', x, y) → if2'(gt'(y, 0'), x, y)
if1'(false', x, y) → gcd'(y, x)
if2'(true', x, y) → gcd'(minus'(x, y), y)
if2'(false', x, y) → x
gt'(0', y) → false'
gt'(s'(x), 0') → true'
gt'(s'(x), s'(y)) → gt'(x, y)
ge'(x, 0') → true'
ge'(0', s'(x)) → false'
ge'(s'(x), s'(y)) → ge'(x, y)

Types:
minus' :: s':0' → s':0' → s':0'
s' :: s':0' → s':0'
if' :: true':false' → s':0' → s':0' → s':0'
gt' :: s':0' → s':0' → true':false'
true' :: true':false'
false' :: true':false'
0' :: s':0'
gcd' :: s':0' → s':0' → s':0'
if1' :: true':false' → s':0' → s':0' → s':0'
ge' :: s':0' → s':0' → true':false'
if2' :: true':false' → s':0' → s':0' → s':0'
_hole_s':0'1 :: s':0'
_hole_true':false'2 :: true':false'
_gen_s':0'3 :: Nat → s':0'

Lemmas:
gt'(_gen_s':0'3(_n5), _gen_s':0'3(_n5)) → false', rt ∈ Ω(1 + n5)

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

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

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


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


Rules:
minus'(s'(x), y) → if'(gt'(s'(x), y), x, y)
if'(true', x, y) → s'(minus'(x, y))
if'(false', x, y) → 0'
gcd'(x, y) → if1'(ge'(x, y), x, y)
if1'(true', x, y) → if2'(gt'(y, 0'), x, y)
if1'(false', x, y) → gcd'(y, x)
if2'(true', x, y) → gcd'(minus'(x, y), y)
if2'(false', x, y) → x
gt'(0', y) → false'
gt'(s'(x), 0') → true'
gt'(s'(x), s'(y)) → gt'(x, y)
ge'(x, 0') → true'
ge'(0', s'(x)) → false'
ge'(s'(x), s'(y)) → ge'(x, y)

Types:
minus' :: s':0' → s':0' → s':0'
s' :: s':0' → s':0'
if' :: true':false' → s':0' → s':0' → s':0'
gt' :: s':0' → s':0' → true':false'
true' :: true':false'
false' :: true':false'
0' :: s':0'
gcd' :: s':0' → s':0' → s':0'
if1' :: true':false' → s':0' → s':0' → s':0'
ge' :: s':0' → s':0' → true':false'
if2' :: true':false' → s':0' → s':0' → s':0'
_hole_s':0'1 :: s':0'
_hole_true':false'2 :: true':false'
_gen_s':0'3 :: Nat → s':0'

Lemmas:
gt'(_gen_s':0'3(_n5), _gen_s':0'3(_n5)) → false', rt ∈ Ω(1 + n5)

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

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

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


Proved the following rewrite lemma:
ge'(_gen_s':0'3(_n842), _gen_s':0'3(_n842)) → true', rt ∈ Ω(1 + n842)

Induction Base:
ge'(_gen_s':0'3(0), _gen_s':0'3(0)) →RΩ(1)
true'

Induction Step:
ge'(_gen_s':0'3(+(_$n843, 1)), _gen_s':0'3(+(_$n843, 1))) →RΩ(1)
ge'(_gen_s':0'3(_$n843), _gen_s':0'3(_$n843)) →IH
true'

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


Rules:
minus'(s'(x), y) → if'(gt'(s'(x), y), x, y)
if'(true', x, y) → s'(minus'(x, y))
if'(false', x, y) → 0'
gcd'(x, y) → if1'(ge'(x, y), x, y)
if1'(true', x, y) → if2'(gt'(y, 0'), x, y)
if1'(false', x, y) → gcd'(y, x)
if2'(true', x, y) → gcd'(minus'(x, y), y)
if2'(false', x, y) → x
gt'(0', y) → false'
gt'(s'(x), 0') → true'
gt'(s'(x), s'(y)) → gt'(x, y)
ge'(x, 0') → true'
ge'(0', s'(x)) → false'
ge'(s'(x), s'(y)) → ge'(x, y)

Types:
minus' :: s':0' → s':0' → s':0'
s' :: s':0' → s':0'
if' :: true':false' → s':0' → s':0' → s':0'
gt' :: s':0' → s':0' → true':false'
true' :: true':false'
false' :: true':false'
0' :: s':0'
gcd' :: s':0' → s':0' → s':0'
if1' :: true':false' → s':0' → s':0' → s':0'
ge' :: s':0' → s':0' → true':false'
if2' :: true':false' → s':0' → s':0' → s':0'
_hole_s':0'1 :: s':0'
_hole_true':false'2 :: true':false'
_gen_s':0'3 :: Nat → s':0'

Lemmas:
gt'(_gen_s':0'3(_n5), _gen_s':0'3(_n5)) → false', rt ∈ Ω(1 + n5)
ge'(_gen_s':0'3(_n842), _gen_s':0'3(_n842)) → true', rt ∈ Ω(1 + n842)

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

The following defined symbols remain to be analysed:
gcd'


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


Rules:
minus'(s'(x), y) → if'(gt'(s'(x), y), x, y)
if'(true', x, y) → s'(minus'(x, y))
if'(false', x, y) → 0'
gcd'(x, y) → if1'(ge'(x, y), x, y)
if1'(true', x, y) → if2'(gt'(y, 0'), x, y)
if1'(false', x, y) → gcd'(y, x)
if2'(true', x, y) → gcd'(minus'(x, y), y)
if2'(false', x, y) → x
gt'(0', y) → false'
gt'(s'(x), 0') → true'
gt'(s'(x), s'(y)) → gt'(x, y)
ge'(x, 0') → true'
ge'(0', s'(x)) → false'
ge'(s'(x), s'(y)) → ge'(x, y)

Types:
minus' :: s':0' → s':0' → s':0'
s' :: s':0' → s':0'
if' :: true':false' → s':0' → s':0' → s':0'
gt' :: s':0' → s':0' → true':false'
true' :: true':false'
false' :: true':false'
0' :: s':0'
gcd' :: s':0' → s':0' → s':0'
if1' :: true':false' → s':0' → s':0' → s':0'
ge' :: s':0' → s':0' → true':false'
if2' :: true':false' → s':0' → s':0' → s':0'
_hole_s':0'1 :: s':0'
_hole_true':false'2 :: true':false'
_gen_s':0'3 :: Nat → s':0'

Lemmas:
gt'(_gen_s':0'3(_n5), _gen_s':0'3(_n5)) → false', rt ∈ Ω(1 + n5)
ge'(_gen_s':0'3(_n842), _gen_s':0'3(_n842)) → true', rt ∈ Ω(1 + n842)

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

No more defined symbols left to analyse.


The lowerbound Ω(n) was proven with the following lemma:
gt'(_gen_s':0'3(_n5), _gen_s':0'3(_n5)) → false', rt ∈ Ω(1 + n5)