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))
minus(x, 0) → x
minus(s(x), s(y)) → s(minus(x, any(y)))
gcd(s(x), s(y)) → gcd(minus(max(x, y), min(x, y)), s(min(x, y)))
any(s(x)) → s(s(any(x)))
any(x) → x
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))
minus'(x, 0') → x
minus'(s'(x), s'(y)) → s'(minus'(x, any'(y)))
gcd'(s'(x), s'(y)) → gcd'(minus'(max'(x, y), min'(x, y)), s'(min'(x, y)))
any'(s'(x)) → s'(s'(any'(x)))
any'(x) → x
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))
minus'(x, 0') → x
minus'(s'(x), s'(y)) → s'(minus'(x, any'(y)))
gcd'(s'(x), s'(y)) → gcd'(minus'(max'(x, y), min'(x, y)), s'(min'(x, y)))
any'(s'(x)) → s'(s'(any'(x)))
any'(x) → x
Types:
min' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
max' :: 0':s' → 0':s' → 0':s'
minus' :: 0':s' → 0':s' → 0':s'
any' :: 0':s' → 0':s'
gcd' :: 0':s' → 0':s' → gcd'
_hole_0':s'1 :: 0':s'
_hole_gcd'2 :: gcd'
_gen_0':s'3 :: Nat → 0':s'
Heuristically decided to analyse the following defined symbols:
min', max', minus', any', gcd'
They will be analysed ascendingly in the following order:
min' < gcd'
max' < gcd'
any' < minus'
minus' < 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))
minus'(x, 0') → x
minus'(s'(x), s'(y)) → s'(minus'(x, any'(y)))
gcd'(s'(x), s'(y)) → gcd'(minus'(max'(x, y), min'(x, y)), s'(min'(x, y)))
any'(s'(x)) → s'(s'(any'(x)))
any'(x) → x
Types:
min' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
max' :: 0':s' → 0':s' → 0':s'
minus' :: 0':s' → 0':s' → 0':s'
any' :: 0':s' → 0':s'
gcd' :: 0':s' → 0':s' → gcd'
_hole_0':s'1 :: 0':s'
_hole_gcd'2 :: gcd'
_gen_0':s'3 :: Nat → 0':s'
Generator Equations:
_gen_0':s'3(0) ⇔ 0'
_gen_0':s'3(+(x, 1)) ⇔ s'(_gen_0':s'3(x))
The following defined symbols remain to be analysed:
min', max', minus', any', gcd'
They will be analysed ascendingly in the following order:
min' < gcd'
max' < gcd'
any' < minus'
minus' < gcd'
Proved the following rewrite lemma:
min'(_gen_0':s'3(_n5), _gen_0':s'3(_n5)) → _gen_0':s'3(_n5), rt ∈ Ω(1 + n5)
Induction Base:
min'(_gen_0':s'3(0), _gen_0':s'3(0)) →RΩ(1)
0'
Induction Step:
min'(_gen_0':s'3(+(_$n6, 1)), _gen_0':s'3(+(_$n6, 1))) →RΩ(1)
s'(min'(_gen_0':s'3(_$n6), _gen_0':s'3(_$n6))) →IH
s'(_gen_0':s'3(_$n6))
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))
minus'(x, 0') → x
minus'(s'(x), s'(y)) → s'(minus'(x, any'(y)))
gcd'(s'(x), s'(y)) → gcd'(minus'(max'(x, y), min'(x, y)), s'(min'(x, y)))
any'(s'(x)) → s'(s'(any'(x)))
any'(x) → x
Types:
min' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
max' :: 0':s' → 0':s' → 0':s'
minus' :: 0':s' → 0':s' → 0':s'
any' :: 0':s' → 0':s'
gcd' :: 0':s' → 0':s' → gcd'
_hole_0':s'1 :: 0':s'
_hole_gcd'2 :: gcd'
_gen_0':s'3 :: Nat → 0':s'
Lemmas:
min'(_gen_0':s'3(_n5), _gen_0':s'3(_n5)) → _gen_0':s'3(_n5), rt ∈ Ω(1 + n5)
Generator Equations:
_gen_0':s'3(0) ⇔ 0'
_gen_0':s'3(+(x, 1)) ⇔ s'(_gen_0':s'3(x))
The following defined symbols remain to be analysed:
max', minus', any', gcd'
They will be analysed ascendingly in the following order:
max' < gcd'
any' < minus'
minus' < gcd'
Proved the following rewrite lemma:
max'(_gen_0':s'3(_n636), _gen_0':s'3(_n636)) → _gen_0':s'3(_n636), rt ∈ Ω(1 + n636)
Induction Base:
max'(_gen_0':s'3(0), _gen_0':s'3(0)) →RΩ(1)
_gen_0':s'3(0)
Induction Step:
max'(_gen_0':s'3(+(_$n637, 1)), _gen_0':s'3(+(_$n637, 1))) →RΩ(1)
s'(max'(_gen_0':s'3(_$n637), _gen_0':s'3(_$n637))) →IH
s'(_gen_0':s'3(_$n637))
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))
minus'(x, 0') → x
minus'(s'(x), s'(y)) → s'(minus'(x, any'(y)))
gcd'(s'(x), s'(y)) → gcd'(minus'(max'(x, y), min'(x, y)), s'(min'(x, y)))
any'(s'(x)) → s'(s'(any'(x)))
any'(x) → x
Types:
min' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
max' :: 0':s' → 0':s' → 0':s'
minus' :: 0':s' → 0':s' → 0':s'
any' :: 0':s' → 0':s'
gcd' :: 0':s' → 0':s' → gcd'
_hole_0':s'1 :: 0':s'
_hole_gcd'2 :: gcd'
_gen_0':s'3 :: Nat → 0':s'
Lemmas:
min'(_gen_0':s'3(_n5), _gen_0':s'3(_n5)) → _gen_0':s'3(_n5), rt ∈ Ω(1 + n5)
max'(_gen_0':s'3(_n636), _gen_0':s'3(_n636)) → _gen_0':s'3(_n636), rt ∈ Ω(1 + n636)
Generator Equations:
_gen_0':s'3(0) ⇔ 0'
_gen_0':s'3(+(x, 1)) ⇔ s'(_gen_0':s'3(x))
The following defined symbols remain to be analysed:
any', minus', gcd'
They will be analysed ascendingly in the following order:
any' < minus'
minus' < gcd'
Proved the following rewrite lemma:
any'(_gen_0':s'3(+(1, _n1413))) → _*4, rt ∈ Ω(n1413)
Induction Base:
any'(_gen_0':s'3(+(1, 0)))
Induction Step:
any'(_gen_0':s'3(+(1, +(_$n1414, 1)))) →RΩ(1)
s'(s'(any'(_gen_0':s'3(+(1, _$n1414))))) →IH
s'(s'(_*4))
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))
minus'(x, 0') → x
minus'(s'(x), s'(y)) → s'(minus'(x, any'(y)))
gcd'(s'(x), s'(y)) → gcd'(minus'(max'(x, y), min'(x, y)), s'(min'(x, y)))
any'(s'(x)) → s'(s'(any'(x)))
any'(x) → x
Types:
min' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
max' :: 0':s' → 0':s' → 0':s'
minus' :: 0':s' → 0':s' → 0':s'
any' :: 0':s' → 0':s'
gcd' :: 0':s' → 0':s' → gcd'
_hole_0':s'1 :: 0':s'
_hole_gcd'2 :: gcd'
_gen_0':s'3 :: Nat → 0':s'
Lemmas:
min'(_gen_0':s'3(_n5), _gen_0':s'3(_n5)) → _gen_0':s'3(_n5), rt ∈ Ω(1 + n5)
max'(_gen_0':s'3(_n636), _gen_0':s'3(_n636)) → _gen_0':s'3(_n636), rt ∈ Ω(1 + n636)
any'(_gen_0':s'3(+(1, _n1413))) → _*4, rt ∈ Ω(n1413)
Generator Equations:
_gen_0':s'3(0) ⇔ 0'
_gen_0':s'3(+(x, 1)) ⇔ s'(_gen_0':s'3(x))
The following defined symbols remain to be analysed:
minus', gcd'
They will be analysed ascendingly in the following order:
minus' < gcd'
Could not prove a rewrite lemma for the defined symbol minus'.
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))
minus'(x, 0') → x
minus'(s'(x), s'(y)) → s'(minus'(x, any'(y)))
gcd'(s'(x), s'(y)) → gcd'(minus'(max'(x, y), min'(x, y)), s'(min'(x, y)))
any'(s'(x)) → s'(s'(any'(x)))
any'(x) → x
Types:
min' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
max' :: 0':s' → 0':s' → 0':s'
minus' :: 0':s' → 0':s' → 0':s'
any' :: 0':s' → 0':s'
gcd' :: 0':s' → 0':s' → gcd'
_hole_0':s'1 :: 0':s'
_hole_gcd'2 :: gcd'
_gen_0':s'3 :: Nat → 0':s'
Lemmas:
min'(_gen_0':s'3(_n5), _gen_0':s'3(_n5)) → _gen_0':s'3(_n5), rt ∈ Ω(1 + n5)
max'(_gen_0':s'3(_n636), _gen_0':s'3(_n636)) → _gen_0':s'3(_n636), rt ∈ Ω(1 + n636)
any'(_gen_0':s'3(+(1, _n1413))) → _*4, rt ∈ Ω(n1413)
Generator Equations:
_gen_0':s'3(0) ⇔ 0'
_gen_0':s'3(+(x, 1)) ⇔ s'(_gen_0':s'3(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))
minus'(x, 0') → x
minus'(s'(x), s'(y)) → s'(minus'(x, any'(y)))
gcd'(s'(x), s'(y)) → gcd'(minus'(max'(x, y), min'(x, y)), s'(min'(x, y)))
any'(s'(x)) → s'(s'(any'(x)))
any'(x) → x
Types:
min' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
max' :: 0':s' → 0':s' → 0':s'
minus' :: 0':s' → 0':s' → 0':s'
any' :: 0':s' → 0':s'
gcd' :: 0':s' → 0':s' → gcd'
_hole_0':s'1 :: 0':s'
_hole_gcd'2 :: gcd'
_gen_0':s'3 :: Nat → 0':s'
Lemmas:
min'(_gen_0':s'3(_n5), _gen_0':s'3(_n5)) → _gen_0':s'3(_n5), rt ∈ Ω(1 + n5)
max'(_gen_0':s'3(_n636), _gen_0':s'3(_n636)) → _gen_0':s'3(_n636), rt ∈ Ω(1 + n636)
any'(_gen_0':s'3(+(1, _n1413))) → _*4, rt ∈ Ω(n1413)
Generator Equations:
_gen_0':s'3(0) ⇔ 0'
_gen_0':s'3(+(x, 1)) ⇔ s'(_gen_0':s'3(x))
No more defined symbols left to analyse.
The lowerbound Ω(n) was proven with the following lemma:
min'(_gen_0':s'3(_n5), _gen_0':s'3(_n5)) → _gen_0':s'3(_n5), rt ∈ Ω(1 + n5)