Runtime Complexity TRS:
The TRS R consists of the following rules:
plus(0, Y) → Y
plus(s(X), Y) → s(plus(X, Y))
min(X, 0) → X
min(s(X), s(Y)) → min(X, Y)
min(min(X, Y), Z) → min(X, plus(Y, Z))
quot(0, s(Y)) → 0
quot(s(X), s(Y)) → s(quot(min(X, Y), s(Y)))
Renamed function symbols to avoid clashes with predefined symbol.
Runtime Complexity TRS:
The TRS R consists of the following rules:
plus'(0', Y) → Y
plus'(s'(X), Y) → s'(plus'(X, Y))
min'(X, 0') → X
min'(s'(X), s'(Y)) → min'(X, Y)
min'(min'(X, Y), Z') → min'(X, plus'(Y, Z'))
quot'(0', s'(Y)) → 0'
quot'(s'(X), s'(Y)) → s'(quot'(min'(X, Y), s'(Y)))
Infered types.
Rules:
plus'(0', Y) → Y
plus'(s'(X), Y) → s'(plus'(X, Y))
min'(X, 0') → X
min'(s'(X), s'(Y)) → min'(X, Y)
min'(min'(X, Y), Z') → min'(X, plus'(Y, Z'))
quot'(0', s'(Y)) → 0'
quot'(s'(X), s'(Y)) → s'(quot'(min'(X, Y), s'(Y)))
Types:
plus' :: 0':s':Z' → 0':s':Z' → 0':s':Z'
0' :: 0':s':Z'
s' :: 0':s':Z' → 0':s':Z'
min' :: 0':s':Z' → 0':s':Z' → 0':s':Z'
Z' :: 0':s':Z'
quot' :: 0':s':Z' → 0':s':Z' → 0':s':Z'
_hole_0':s':Z'1 :: 0':s':Z'
_gen_0':s':Z'2 :: Nat → 0':s':Z'
Heuristically decided to analyse the following defined symbols:
plus', min', quot'
They will be analysed ascendingly in the following order:
plus' < min'
min' < quot'
Rules:
plus'(0', Y) → Y
plus'(s'(X), Y) → s'(plus'(X, Y))
min'(X, 0') → X
min'(s'(X), s'(Y)) → min'(X, Y)
min'(min'(X, Y), Z') → min'(X, plus'(Y, Z'))
quot'(0', s'(Y)) → 0'
quot'(s'(X), s'(Y)) → s'(quot'(min'(X, Y), s'(Y)))
Types:
plus' :: 0':s':Z' → 0':s':Z' → 0':s':Z'
0' :: 0':s':Z'
s' :: 0':s':Z' → 0':s':Z'
min' :: 0':s':Z' → 0':s':Z' → 0':s':Z'
Z' :: 0':s':Z'
quot' :: 0':s':Z' → 0':s':Z' → 0':s':Z'
_hole_0':s':Z'1 :: 0':s':Z'
_gen_0':s':Z'2 :: Nat → 0':s':Z'
Generator Equations:
_gen_0':s':Z'2(0) ⇔ 0'
_gen_0':s':Z'2(+(x, 1)) ⇔ s'(_gen_0':s':Z'2(x))
The following defined symbols remain to be analysed:
plus', min', quot'
They will be analysed ascendingly in the following order:
plus' < min'
min' < quot'
Proved the following rewrite lemma:
plus'(_gen_0':s':Z'2(_n4), _gen_0':s':Z'2(b)) → _gen_0':s':Z'2(+(_n4, b)), rt ∈ Ω(1 + n4)
Induction Base:
plus'(_gen_0':s':Z'2(0), _gen_0':s':Z'2(b)) →RΩ(1)
_gen_0':s':Z'2(b)
Induction Step:
plus'(_gen_0':s':Z'2(+(_$n5, 1)), _gen_0':s':Z'2(_b137)) →RΩ(1)
s'(plus'(_gen_0':s':Z'2(_$n5), _gen_0':s':Z'2(_b137))) →IH
s'(_gen_0':s':Z'2(+(_$n5, _b137)))
We have rt ∈ Ω(n) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
Rules:
plus'(0', Y) → Y
plus'(s'(X), Y) → s'(plus'(X, Y))
min'(X, 0') → X
min'(s'(X), s'(Y)) → min'(X, Y)
min'(min'(X, Y), Z') → min'(X, plus'(Y, Z'))
quot'(0', s'(Y)) → 0'
quot'(s'(X), s'(Y)) → s'(quot'(min'(X, Y), s'(Y)))
Types:
plus' :: 0':s':Z' → 0':s':Z' → 0':s':Z'
0' :: 0':s':Z'
s' :: 0':s':Z' → 0':s':Z'
min' :: 0':s':Z' → 0':s':Z' → 0':s':Z'
Z' :: 0':s':Z'
quot' :: 0':s':Z' → 0':s':Z' → 0':s':Z'
_hole_0':s':Z'1 :: 0':s':Z'
_gen_0':s':Z'2 :: Nat → 0':s':Z'
Lemmas:
plus'(_gen_0':s':Z'2(_n4), _gen_0':s':Z'2(b)) → _gen_0':s':Z'2(+(_n4, b)), rt ∈ Ω(1 + n4)
Generator Equations:
_gen_0':s':Z'2(0) ⇔ 0'
_gen_0':s':Z'2(+(x, 1)) ⇔ s'(_gen_0':s':Z'2(x))
The following defined symbols remain to be analysed:
min', quot'
They will be analysed ascendingly in the following order:
min' < quot'
Proved the following rewrite lemma:
min'(_gen_0':s':Z'2(_n546), _gen_0':s':Z'2(_n546)) → _gen_0':s':Z'2(0), rt ∈ Ω(1 + n546)
Induction Base:
min'(_gen_0':s':Z'2(0), _gen_0':s':Z'2(0)) →RΩ(1)
_gen_0':s':Z'2(0)
Induction Step:
min'(_gen_0':s':Z'2(+(_$n547, 1)), _gen_0':s':Z'2(+(_$n547, 1))) →RΩ(1)
min'(_gen_0':s':Z'2(_$n547), _gen_0':s':Z'2(_$n547)) →IH
_gen_0':s':Z'2(0)
We have rt ∈ Ω(n) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
Rules:
plus'(0', Y) → Y
plus'(s'(X), Y) → s'(plus'(X, Y))
min'(X, 0') → X
min'(s'(X), s'(Y)) → min'(X, Y)
min'(min'(X, Y), Z') → min'(X, plus'(Y, Z'))
quot'(0', s'(Y)) → 0'
quot'(s'(X), s'(Y)) → s'(quot'(min'(X, Y), s'(Y)))
Types:
plus' :: 0':s':Z' → 0':s':Z' → 0':s':Z'
0' :: 0':s':Z'
s' :: 0':s':Z' → 0':s':Z'
min' :: 0':s':Z' → 0':s':Z' → 0':s':Z'
Z' :: 0':s':Z'
quot' :: 0':s':Z' → 0':s':Z' → 0':s':Z'
_hole_0':s':Z'1 :: 0':s':Z'
_gen_0':s':Z'2 :: Nat → 0':s':Z'
Lemmas:
plus'(_gen_0':s':Z'2(_n4), _gen_0':s':Z'2(b)) → _gen_0':s':Z'2(+(_n4, b)), rt ∈ Ω(1 + n4)
min'(_gen_0':s':Z'2(_n546), _gen_0':s':Z'2(_n546)) → _gen_0':s':Z'2(0), rt ∈ Ω(1 + n546)
Generator Equations:
_gen_0':s':Z'2(0) ⇔ 0'
_gen_0':s':Z'2(+(x, 1)) ⇔ s'(_gen_0':s':Z'2(x))
The following defined symbols remain to be analysed:
quot'
Could not prove a rewrite lemma for the defined symbol quot'.
Rules:
plus'(0', Y) → Y
plus'(s'(X), Y) → s'(plus'(X, Y))
min'(X, 0') → X
min'(s'(X), s'(Y)) → min'(X, Y)
min'(min'(X, Y), Z') → min'(X, plus'(Y, Z'))
quot'(0', s'(Y)) → 0'
quot'(s'(X), s'(Y)) → s'(quot'(min'(X, Y), s'(Y)))
Types:
plus' :: 0':s':Z' → 0':s':Z' → 0':s':Z'
0' :: 0':s':Z'
s' :: 0':s':Z' → 0':s':Z'
min' :: 0':s':Z' → 0':s':Z' → 0':s':Z'
Z' :: 0':s':Z'
quot' :: 0':s':Z' → 0':s':Z' → 0':s':Z'
_hole_0':s':Z'1 :: 0':s':Z'
_gen_0':s':Z'2 :: Nat → 0':s':Z'
Lemmas:
plus'(_gen_0':s':Z'2(_n4), _gen_0':s':Z'2(b)) → _gen_0':s':Z'2(+(_n4, b)), rt ∈ Ω(1 + n4)
min'(_gen_0':s':Z'2(_n546), _gen_0':s':Z'2(_n546)) → _gen_0':s':Z'2(0), rt ∈ Ω(1 + n546)
Generator Equations:
_gen_0':s':Z'2(0) ⇔ 0'
_gen_0':s':Z'2(+(x, 1)) ⇔ s'(_gen_0':s':Z'2(x))
No more defined symbols left to analyse.
The lowerbound Ω(n) was proven with the following lemma:
plus'(_gen_0':s':Z'2(_n4), _gen_0':s':Z'2(b)) → _gen_0':s':Z'2(+(_n4, b)), rt ∈ Ω(1 + n4)