Runtime Complexity TRS:
The TRS R consists of the following rules:
minus(x, y) → cond(equal(min(x, y), y), x, y)
cond(true, x, y) → s(minus(x, s(y)))
min(0, v) → 0
min(u, 0) → 0
min(s(u), s(v)) → s(min(u, v))
equal(0, 0) → true
equal(s(x), 0) → false
equal(0, s(y)) → false
equal(s(x), s(y)) → equal(x, y)
Renamed function symbols to avoid clashes with predefined symbol.
Runtime Complexity TRS:
The TRS R consists of the following rules:
minus'(x, y) → cond'(equal'(min'(x, y), y), x, y)
cond'(true', x, y) → s'(minus'(x, s'(y)))
min'(0', v) → 0'
min'(u, 0') → 0'
min'(s'(u), s'(v)) → s'(min'(u, v))
equal'(0', 0') → true'
equal'(s'(x), 0') → false'
equal'(0', s'(y)) → false'
equal'(s'(x), s'(y)) → equal'(x, y)
Infered types.
Rules:
minus'(x, y) → cond'(equal'(min'(x, y), y), x, y)
cond'(true', x, y) → s'(minus'(x, s'(y)))
min'(0', v) → 0'
min'(u, 0') → 0'
min'(s'(u), s'(v)) → s'(min'(u, v))
equal'(0', 0') → true'
equal'(s'(x), 0') → false'
equal'(0', s'(y)) → false'
equal'(s'(x), s'(y)) → equal'(x, y)
Types:
minus' :: s':0' → s':0' → s':0'
cond' :: true':false' → s':0' → s':0' → s':0'
equal' :: s':0' → s':0' → true':false'
min' :: s':0' → s':0' → s':0'
true' :: true':false'
s' :: s':0' → s':0'
0' :: s':0'
false' :: true':false'
_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', equal', min'
They will be analysed ascendingly in the following order:
equal' < minus'
min' < minus'
Rules:
minus'(x, y) → cond'(equal'(min'(x, y), y), x, y)
cond'(true', x, y) → s'(minus'(x, s'(y)))
min'(0', v) → 0'
min'(u, 0') → 0'
min'(s'(u), s'(v)) → s'(min'(u, v))
equal'(0', 0') → true'
equal'(s'(x), 0') → false'
equal'(0', s'(y)) → false'
equal'(s'(x), s'(y)) → equal'(x, y)
Types:
minus' :: s':0' → s':0' → s':0'
cond' :: true':false' → s':0' → s':0' → s':0'
equal' :: s':0' → s':0' → true':false'
min' :: s':0' → s':0' → s':0'
true' :: true':false'
s' :: s':0' → s':0'
0' :: s':0'
false' :: true':false'
_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:
equal', minus', min'
They will be analysed ascendingly in the following order:
equal' < minus'
min' < minus'
Proved the following rewrite lemma:
equal'(_gen_s':0'3(_n5), _gen_s':0'3(_n5)) → true', rt ∈ Ω(1 + n5)
Induction Base:
equal'(_gen_s':0'3(0), _gen_s':0'3(0)) →RΩ(1)
true'
Induction Step:
equal'(_gen_s':0'3(+(_$n6, 1)), _gen_s':0'3(+(_$n6, 1))) →RΩ(1)
equal'(_gen_s':0'3(_$n6), _gen_s':0'3(_$n6)) →IH
true'
We have rt ∈ Ω(n) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
Rules:
minus'(x, y) → cond'(equal'(min'(x, y), y), x, y)
cond'(true', x, y) → s'(minus'(x, s'(y)))
min'(0', v) → 0'
min'(u, 0') → 0'
min'(s'(u), s'(v)) → s'(min'(u, v))
equal'(0', 0') → true'
equal'(s'(x), 0') → false'
equal'(0', s'(y)) → false'
equal'(s'(x), s'(y)) → equal'(x, y)
Types:
minus' :: s':0' → s':0' → s':0'
cond' :: true':false' → s':0' → s':0' → s':0'
equal' :: s':0' → s':0' → true':false'
min' :: s':0' → s':0' → s':0'
true' :: true':false'
s' :: s':0' → s':0'
0' :: s':0'
false' :: true':false'
_hole_s':0'1 :: s':0'
_hole_true':false'2 :: true':false'
_gen_s':0'3 :: Nat → s':0'
Lemmas:
equal'(_gen_s':0'3(_n5), _gen_s':0'3(_n5)) → true', 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:
min', minus'
They will be analysed ascendingly in the following order:
min' < minus'
Proved the following rewrite lemma:
min'(_gen_s':0'3(_n561), _gen_s':0'3(_n561)) → _gen_s':0'3(_n561), rt ∈ Ω(1 + n561)
Induction Base:
min'(_gen_s':0'3(0), _gen_s':0'3(0)) →RΩ(1)
0'
Induction Step:
min'(_gen_s':0'3(+(_$n562, 1)), _gen_s':0'3(+(_$n562, 1))) →RΩ(1)
s'(min'(_gen_s':0'3(_$n562), _gen_s':0'3(_$n562))) →IH
s'(_gen_s':0'3(_$n562))
We have rt ∈ Ω(n) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
Rules:
minus'(x, y) → cond'(equal'(min'(x, y), y), x, y)
cond'(true', x, y) → s'(minus'(x, s'(y)))
min'(0', v) → 0'
min'(u, 0') → 0'
min'(s'(u), s'(v)) → s'(min'(u, v))
equal'(0', 0') → true'
equal'(s'(x), 0') → false'
equal'(0', s'(y)) → false'
equal'(s'(x), s'(y)) → equal'(x, y)
Types:
minus' :: s':0' → s':0' → s':0'
cond' :: true':false' → s':0' → s':0' → s':0'
equal' :: s':0' → s':0' → true':false'
min' :: s':0' → s':0' → s':0'
true' :: true':false'
s' :: s':0' → s':0'
0' :: s':0'
false' :: true':false'
_hole_s':0'1 :: s':0'
_hole_true':false'2 :: true':false'
_gen_s':0'3 :: Nat → s':0'
Lemmas:
equal'(_gen_s':0'3(_n5), _gen_s':0'3(_n5)) → true', rt ∈ Ω(1 + n5)
min'(_gen_s':0'3(_n561), _gen_s':0'3(_n561)) → _gen_s':0'3(_n561), rt ∈ Ω(1 + n561)
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'
Could not prove a rewrite lemma for the defined symbol minus'.
Rules:
minus'(x, y) → cond'(equal'(min'(x, y), y), x, y)
cond'(true', x, y) → s'(minus'(x, s'(y)))
min'(0', v) → 0'
min'(u, 0') → 0'
min'(s'(u), s'(v)) → s'(min'(u, v))
equal'(0', 0') → true'
equal'(s'(x), 0') → false'
equal'(0', s'(y)) → false'
equal'(s'(x), s'(y)) → equal'(x, y)
Types:
minus' :: s':0' → s':0' → s':0'
cond' :: true':false' → s':0' → s':0' → s':0'
equal' :: s':0' → s':0' → true':false'
min' :: s':0' → s':0' → s':0'
true' :: true':false'
s' :: s':0' → s':0'
0' :: s':0'
false' :: true':false'
_hole_s':0'1 :: s':0'
_hole_true':false'2 :: true':false'
_gen_s':0'3 :: Nat → s':0'
Lemmas:
equal'(_gen_s':0'3(_n5), _gen_s':0'3(_n5)) → true', rt ∈ Ω(1 + n5)
min'(_gen_s':0'3(_n561), _gen_s':0'3(_n561)) → _gen_s':0'3(_n561), rt ∈ Ω(1 + n561)
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:
equal'(_gen_s':0'3(_n5), _gen_s':0'3(_n5)) → true', rt ∈ Ω(1 + n5)