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

min(x, 0) → 0
min(0, y) → 0
min(s(x), s(y)) → s(min(x, y))
max(x, 0) → x
max(0, y) → y
max(s(x), s(y)) → s(max(x, y))
-(x, 0) → x
-(s(x), s(y)) → -(x, y)
gcd(s(x), s(y), z) → gcd(-(max(x, y), min(x, y)), s(min(x, y)), z)
gcd(x, s(y), s(z)) → gcd(x, -(max(y, z), min(y, z)), s(min(y, z)))
gcd(s(x), y, s(z)) → gcd(-(max(x, z), min(x, z)), y, s(min(x, z)))
gcd(x, 0, 0) → x
gcd(0, y, 0) → y
gcd(0, 0, z) → z

Rewrite Strategy: INNERMOST


Renamed function symbols to avoid clashes with predefined symbol.


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


min'(x, 0') → 0'
min'(0', y) → 0'
min'(s'(x), s'(y)) → s'(min'(x, y))
max'(x, 0') → x
max'(0', y) → y
max'(s'(x), s'(y)) → s'(max'(x, y))
-'(x, 0') → x
-'(s'(x), s'(y)) → -'(x, y)
gcd'(s'(x), s'(y), z) → gcd'(-'(max'(x, y), min'(x, y)), s'(min'(x, y)), z)
gcd'(x, s'(y), s'(z)) → gcd'(x, -'(max'(y, z), min'(y, z)), s'(min'(y, z)))
gcd'(s'(x), y, s'(z)) → gcd'(-'(max'(x, z), min'(x, z)), y, s'(min'(x, z)))
gcd'(x, 0', 0') → x
gcd'(0', y, 0') → y
gcd'(0', 0', z) → z

Rewrite Strategy: INNERMOST


Infered types.


Rules:
min'(x, 0') → 0'
min'(0', y) → 0'
min'(s'(x), s'(y)) → s'(min'(x, y))
max'(x, 0') → x
max'(0', y) → y
max'(s'(x), s'(y)) → s'(max'(x, y))
-'(x, 0') → x
-'(s'(x), s'(y)) → -'(x, y)
gcd'(s'(x), s'(y), z) → gcd'(-'(max'(x, y), min'(x, y)), s'(min'(x, y)), z)
gcd'(x, s'(y), s'(z)) → gcd'(x, -'(max'(y, z), min'(y, z)), s'(min'(y, z)))
gcd'(s'(x), y, s'(z)) → gcd'(-'(max'(x, z), min'(x, z)), y, s'(min'(x, z)))
gcd'(x, 0', 0') → x
gcd'(0', y, 0') → y
gcd'(0', 0', z) → z

Types:
min' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
max' :: 0':s' → 0':s' → 0':s'
-' :: 0':s' → 0':s' → 0':s'
gcd' :: 0':s' → 0':s' → 0':s' → 0':s'
_hole_0':s'1 :: 0':s'
_gen_0':s'2 :: Nat → 0':s'


Heuristically decided to analyse the following defined symbols:
min', max', -', gcd'

They will be analysed ascendingly in the following order:
min' < gcd'
max' < gcd'
-' < gcd'


Rules:
min'(x, 0') → 0'
min'(0', y) → 0'
min'(s'(x), s'(y)) → s'(min'(x, y))
max'(x, 0') → x
max'(0', y) → y
max'(s'(x), s'(y)) → s'(max'(x, y))
-'(x, 0') → x
-'(s'(x), s'(y)) → -'(x, y)
gcd'(s'(x), s'(y), z) → gcd'(-'(max'(x, y), min'(x, y)), s'(min'(x, y)), z)
gcd'(x, s'(y), s'(z)) → gcd'(x, -'(max'(y, z), min'(y, z)), s'(min'(y, z)))
gcd'(s'(x), y, s'(z)) → gcd'(-'(max'(x, z), min'(x, z)), y, s'(min'(x, z)))
gcd'(x, 0', 0') → x
gcd'(0', y, 0') → y
gcd'(0', 0', z) → z

Types:
min' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
max' :: 0':s' → 0':s' → 0':s'
-' :: 0':s' → 0':s' → 0':s'
gcd' :: 0':s' → 0':s' → 0':s' → 0':s'
_hole_0':s'1 :: 0':s'
_gen_0':s'2 :: Nat → 0':s'

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

The following defined symbols remain to be analysed:
min', max', -', gcd'

They will be analysed ascendingly in the following order:
min' < gcd'
max' < gcd'
-' < gcd'


Proved the following rewrite lemma:
min'(_gen_0':s'2(_n4), _gen_0':s'2(_n4)) → _gen_0':s'2(_n4), rt ∈ Ω(1 + n4)

Induction Base:
min'(_gen_0':s'2(0), _gen_0':s'2(0)) →RΩ(1)
0'

Induction Step:
min'(_gen_0':s'2(+(_$n5, 1)), _gen_0':s'2(+(_$n5, 1))) →RΩ(1)
s'(min'(_gen_0':s'2(_$n5), _gen_0':s'2(_$n5))) →IH
s'(_gen_0':s'2(_$n5))

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


Rules:
min'(x, 0') → 0'
min'(0', y) → 0'
min'(s'(x), s'(y)) → s'(min'(x, y))
max'(x, 0') → x
max'(0', y) → y
max'(s'(x), s'(y)) → s'(max'(x, y))
-'(x, 0') → x
-'(s'(x), s'(y)) → -'(x, y)
gcd'(s'(x), s'(y), z) → gcd'(-'(max'(x, y), min'(x, y)), s'(min'(x, y)), z)
gcd'(x, s'(y), s'(z)) → gcd'(x, -'(max'(y, z), min'(y, z)), s'(min'(y, z)))
gcd'(s'(x), y, s'(z)) → gcd'(-'(max'(x, z), min'(x, z)), y, s'(min'(x, z)))
gcd'(x, 0', 0') → x
gcd'(0', y, 0') → y
gcd'(0', 0', z) → z

Types:
min' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
max' :: 0':s' → 0':s' → 0':s'
-' :: 0':s' → 0':s' → 0':s'
gcd' :: 0':s' → 0':s' → 0':s' → 0':s'
_hole_0':s'1 :: 0':s'
_gen_0':s'2 :: Nat → 0':s'

Lemmas:
min'(_gen_0':s'2(_n4), _gen_0':s'2(_n4)) → _gen_0':s'2(_n4), rt ∈ Ω(1 + n4)

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

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

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


Proved the following rewrite lemma:
max'(_gen_0':s'2(_n876), _gen_0':s'2(_n876)) → _gen_0':s'2(_n876), rt ∈ Ω(1 + n876)

Induction Base:
max'(_gen_0':s'2(0), _gen_0':s'2(0)) →RΩ(1)
_gen_0':s'2(0)

Induction Step:
max'(_gen_0':s'2(+(_$n877, 1)), _gen_0':s'2(+(_$n877, 1))) →RΩ(1)
s'(max'(_gen_0':s'2(_$n877), _gen_0':s'2(_$n877))) →IH
s'(_gen_0':s'2(_$n877))

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


Rules:
min'(x, 0') → 0'
min'(0', y) → 0'
min'(s'(x), s'(y)) → s'(min'(x, y))
max'(x, 0') → x
max'(0', y) → y
max'(s'(x), s'(y)) → s'(max'(x, y))
-'(x, 0') → x
-'(s'(x), s'(y)) → -'(x, y)
gcd'(s'(x), s'(y), z) → gcd'(-'(max'(x, y), min'(x, y)), s'(min'(x, y)), z)
gcd'(x, s'(y), s'(z)) → gcd'(x, -'(max'(y, z), min'(y, z)), s'(min'(y, z)))
gcd'(s'(x), y, s'(z)) → gcd'(-'(max'(x, z), min'(x, z)), y, s'(min'(x, z)))
gcd'(x, 0', 0') → x
gcd'(0', y, 0') → y
gcd'(0', 0', z) → z

Types:
min' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
max' :: 0':s' → 0':s' → 0':s'
-' :: 0':s' → 0':s' → 0':s'
gcd' :: 0':s' → 0':s' → 0':s' → 0':s'
_hole_0':s'1 :: 0':s'
_gen_0':s'2 :: Nat → 0':s'

Lemmas:
min'(_gen_0':s'2(_n4), _gen_0':s'2(_n4)) → _gen_0':s'2(_n4), rt ∈ Ω(1 + n4)
max'(_gen_0':s'2(_n876), _gen_0':s'2(_n876)) → _gen_0':s'2(_n876), rt ∈ Ω(1 + n876)

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

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

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


Proved the following rewrite lemma:
-'(_gen_0':s'2(_n1924), _gen_0':s'2(_n1924)) → _gen_0':s'2(0), rt ∈ Ω(1 + n1924)

Induction Base:
-'(_gen_0':s'2(0), _gen_0':s'2(0)) →RΩ(1)
_gen_0':s'2(0)

Induction Step:
-'(_gen_0':s'2(+(_$n1925, 1)), _gen_0':s'2(+(_$n1925, 1))) →RΩ(1)
-'(_gen_0':s'2(_$n1925), _gen_0':s'2(_$n1925)) →IH
_gen_0':s'2(0)

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


Rules:
min'(x, 0') → 0'
min'(0', y) → 0'
min'(s'(x), s'(y)) → s'(min'(x, y))
max'(x, 0') → x
max'(0', y) → y
max'(s'(x), s'(y)) → s'(max'(x, y))
-'(x, 0') → x
-'(s'(x), s'(y)) → -'(x, y)
gcd'(s'(x), s'(y), z) → gcd'(-'(max'(x, y), min'(x, y)), s'(min'(x, y)), z)
gcd'(x, s'(y), s'(z)) → gcd'(x, -'(max'(y, z), min'(y, z)), s'(min'(y, z)))
gcd'(s'(x), y, s'(z)) → gcd'(-'(max'(x, z), min'(x, z)), y, s'(min'(x, z)))
gcd'(x, 0', 0') → x
gcd'(0', y, 0') → y
gcd'(0', 0', z) → z

Types:
min' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
max' :: 0':s' → 0':s' → 0':s'
-' :: 0':s' → 0':s' → 0':s'
gcd' :: 0':s' → 0':s' → 0':s' → 0':s'
_hole_0':s'1 :: 0':s'
_gen_0':s'2 :: Nat → 0':s'

Lemmas:
min'(_gen_0':s'2(_n4), _gen_0':s'2(_n4)) → _gen_0':s'2(_n4), rt ∈ Ω(1 + n4)
max'(_gen_0':s'2(_n876), _gen_0':s'2(_n876)) → _gen_0':s'2(_n876), rt ∈ Ω(1 + n876)
-'(_gen_0':s'2(_n1924), _gen_0':s'2(_n1924)) → _gen_0':s'2(0), rt ∈ Ω(1 + n1924)

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

The following defined symbols remain to be analysed:
gcd'


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


Rules:
min'(x, 0') → 0'
min'(0', y) → 0'
min'(s'(x), s'(y)) → s'(min'(x, y))
max'(x, 0') → x
max'(0', y) → y
max'(s'(x), s'(y)) → s'(max'(x, y))
-'(x, 0') → x
-'(s'(x), s'(y)) → -'(x, y)
gcd'(s'(x), s'(y), z) → gcd'(-'(max'(x, y), min'(x, y)), s'(min'(x, y)), z)
gcd'(x, s'(y), s'(z)) → gcd'(x, -'(max'(y, z), min'(y, z)), s'(min'(y, z)))
gcd'(s'(x), y, s'(z)) → gcd'(-'(max'(x, z), min'(x, z)), y, s'(min'(x, z)))
gcd'(x, 0', 0') → x
gcd'(0', y, 0') → y
gcd'(0', 0', z) → z

Types:
min' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
max' :: 0':s' → 0':s' → 0':s'
-' :: 0':s' → 0':s' → 0':s'
gcd' :: 0':s' → 0':s' → 0':s' → 0':s'
_hole_0':s'1 :: 0':s'
_gen_0':s'2 :: Nat → 0':s'

Lemmas:
min'(_gen_0':s'2(_n4), _gen_0':s'2(_n4)) → _gen_0':s'2(_n4), rt ∈ Ω(1 + n4)
max'(_gen_0':s'2(_n876), _gen_0':s'2(_n876)) → _gen_0':s'2(_n876), rt ∈ Ω(1 + n876)
-'(_gen_0':s'2(_n1924), _gen_0':s'2(_n1924)) → _gen_0':s'2(0), rt ∈ Ω(1 + n1924)

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

No more defined symbols left to analyse.


The lowerbound Ω(n) was proven with the following lemma:
min'(_gen_0':s'2(_n4), _gen_0':s'2(_n4)) → _gen_0':s'2(_n4), rt ∈ Ω(1 + n4)