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), 0) → s(x)
gcd(0, s(x)) → s(x)
gcd(s(x), s(y)) → gcd(-(max(x, y), min(x, y)), s(min(x, y)))
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), 0') → s'(x)
gcd'(0', s'(x)) → s'(x)
gcd'(s'(x), s'(y)) → gcd'(-'(max'(x, y), min'(x, y)), s'(min'(x, y)))
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), 0') → s'(x)
gcd'(0', s'(x)) → s'(x)
gcd'(s'(x), s'(y)) → gcd'(-'(max'(x, y), min'(x, y)), s'(min'(x, y)))
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'
_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), 0') → s'(x)
gcd'(0', s'(x)) → s'(x)
gcd'(s'(x), s'(y)) → gcd'(-'(max'(x, y), min'(x, y)), s'(min'(x, y)))
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'
_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), 0') → s'(x)
gcd'(0', s'(x)) → s'(x)
gcd'(s'(x), s'(y)) → gcd'(-'(max'(x, y), min'(x, y)), s'(min'(x, y)))
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'
_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(_n642), _gen_0':s'2(_n642)) → _gen_0':s'2(_n642), rt ∈ Ω(1 + n642)
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(+(_$n643, 1)), _gen_0':s'2(+(_$n643, 1))) →RΩ(1)
s'(max'(_gen_0':s'2(_$n643), _gen_0':s'2(_$n643))) →IH
s'(_gen_0':s'2(_$n643))
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), 0') → s'(x)
gcd'(0', s'(x)) → s'(x)
gcd'(s'(x), s'(y)) → gcd'(-'(max'(x, y), min'(x, y)), s'(min'(x, y)))
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'
_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(_n642), _gen_0':s'2(_n642)) → _gen_0':s'2(_n642), rt ∈ Ω(1 + n642)
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(_n1428), _gen_0':s'2(_n1428)) → _gen_0':s'2(0), rt ∈ Ω(1 + n1428)
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(+(_$n1429, 1)), _gen_0':s'2(+(_$n1429, 1))) →RΩ(1)
-'(_gen_0':s'2(_$n1429), _gen_0':s'2(_$n1429)) →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), 0') → s'(x)
gcd'(0', s'(x)) → s'(x)
gcd'(s'(x), s'(y)) → gcd'(-'(max'(x, y), min'(x, y)), s'(min'(x, y)))
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'
_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(_n642), _gen_0':s'2(_n642)) → _gen_0':s'2(_n642), rt ∈ Ω(1 + n642)
-'(_gen_0':s'2(_n1428), _gen_0':s'2(_n1428)) → _gen_0':s'2(0), rt ∈ Ω(1 + n1428)
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), 0') → s'(x)
gcd'(0', s'(x)) → s'(x)
gcd'(s'(x), s'(y)) → gcd'(-'(max'(x, y), min'(x, y)), s'(min'(x, y)))
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'
_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(_n642), _gen_0':s'2(_n642)) → _gen_0':s'2(_n642), rt ∈ Ω(1 + n642)
-'(_gen_0':s'2(_n1428), _gen_0':s'2(_n1428)) → _gen_0':s'2(0), rt ∈ Ω(1 + n1428)
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)