Runtime Complexity TRS:
The TRS R consists of the following rules:
le(0, y) → true
le(s(x), 0) → false
le(s(x), s(y)) → le(x, y)
quot(x, 0) → quotZeroErro
quot(x, s(y)) → quotIter(x, s(y), 0, 0, 0)
quotIter(x, s(y), z, u, v) → if(le(x, z), x, s(y), z, u, v)
if(true, x, y, z, u, v) → v
if(false, x, y, z, u, v) → if2(le(y, s(u)), x, y, s(z), s(u), v)
if2(false, x, y, z, u, v) → quotIter(x, y, z, u, v)
if2(true, x, y, z, u, v) → quotIter(x, y, z, 0, s(v))
Renamed function symbols to avoid clashes with predefined symbol.
Runtime Complexity TRS:
The TRS R consists of the following rules:
le'(0', y) → true'
le'(s'(x), 0') → false'
le'(s'(x), s'(y)) → le'(x, y)
quot'(x, 0') → quotZeroErro'
quot'(x, s'(y)) → quotIter'(x, s'(y), 0', 0', 0')
quotIter'(x, s'(y), z, u, v) → if'(le'(x, z), x, s'(y), z, u, v)
if'(true', x, y, z, u, v) → v
if'(false', x, y, z, u, v) → if2'(le'(y, s'(u)), x, y, s'(z), s'(u), v)
if2'(false', x, y, z, u, v) → quotIter'(x, y, z, u, v)
if2'(true', x, y, z, u, v) → quotIter'(x, y, z, 0', s'(v))
Infered types.
Rules:
le'(0', y) → true'
le'(s'(x), 0') → false'
le'(s'(x), s'(y)) → le'(x, y)
quot'(x, 0') → quotZeroErro'
quot'(x, s'(y)) → quotIter'(x, s'(y), 0', 0', 0')
quotIter'(x, s'(y), z, u, v) → if'(le'(x, z), x, s'(y), z, u, v)
if'(true', x, y, z, u, v) → v
if'(false', x, y, z, u, v) → if2'(le'(y, s'(u)), x, y, s'(z), s'(u), v)
if2'(false', x, y, z, u, v) → quotIter'(x, y, z, u, v)
if2'(true', x, y, z, u, v) → quotIter'(x, y, z, 0', s'(v))
Types:
le' :: 0':s':quotZeroErro' → 0':s':quotZeroErro' → true':false'
0' :: 0':s':quotZeroErro'
true' :: true':false'
s' :: 0':s':quotZeroErro' → 0':s':quotZeroErro'
false' :: true':false'
quot' :: 0':s':quotZeroErro' → 0':s':quotZeroErro' → 0':s':quotZeroErro'
quotZeroErro' :: 0':s':quotZeroErro'
quotIter' :: 0':s':quotZeroErro' → 0':s':quotZeroErro' → 0':s':quotZeroErro' → 0':s':quotZeroErro' → 0':s':quotZeroErro' → 0':s':quotZeroErro'
if' :: true':false' → 0':s':quotZeroErro' → 0':s':quotZeroErro' → 0':s':quotZeroErro' → 0':s':quotZeroErro' → 0':s':quotZeroErro' → 0':s':quotZeroErro'
if2' :: true':false' → 0':s':quotZeroErro' → 0':s':quotZeroErro' → 0':s':quotZeroErro' → 0':s':quotZeroErro' → 0':s':quotZeroErro' → 0':s':quotZeroErro'
_hole_true':false'1 :: true':false'
_hole_0':s':quotZeroErro'2 :: 0':s':quotZeroErro'
_gen_0':s':quotZeroErro'3 :: Nat → 0':s':quotZeroErro'
Heuristically decided to analyse the following defined symbols:
le', quotIter'
They will be analysed ascendingly in the following order:
le' < quotIter'
Rules:
le'(0', y) → true'
le'(s'(x), 0') → false'
le'(s'(x), s'(y)) → le'(x, y)
quot'(x, 0') → quotZeroErro'
quot'(x, s'(y)) → quotIter'(x, s'(y), 0', 0', 0')
quotIter'(x, s'(y), z, u, v) → if'(le'(x, z), x, s'(y), z, u, v)
if'(true', x, y, z, u, v) → v
if'(false', x, y, z, u, v) → if2'(le'(y, s'(u)), x, y, s'(z), s'(u), v)
if2'(false', x, y, z, u, v) → quotIter'(x, y, z, u, v)
if2'(true', x, y, z, u, v) → quotIter'(x, y, z, 0', s'(v))
Types:
le' :: 0':s':quotZeroErro' → 0':s':quotZeroErro' → true':false'
0' :: 0':s':quotZeroErro'
true' :: true':false'
s' :: 0':s':quotZeroErro' → 0':s':quotZeroErro'
false' :: true':false'
quot' :: 0':s':quotZeroErro' → 0':s':quotZeroErro' → 0':s':quotZeroErro'
quotZeroErro' :: 0':s':quotZeroErro'
quotIter' :: 0':s':quotZeroErro' → 0':s':quotZeroErro' → 0':s':quotZeroErro' → 0':s':quotZeroErro' → 0':s':quotZeroErro' → 0':s':quotZeroErro'
if' :: true':false' → 0':s':quotZeroErro' → 0':s':quotZeroErro' → 0':s':quotZeroErro' → 0':s':quotZeroErro' → 0':s':quotZeroErro' → 0':s':quotZeroErro'
if2' :: true':false' → 0':s':quotZeroErro' → 0':s':quotZeroErro' → 0':s':quotZeroErro' → 0':s':quotZeroErro' → 0':s':quotZeroErro' → 0':s':quotZeroErro'
_hole_true':false'1 :: true':false'
_hole_0':s':quotZeroErro'2 :: 0':s':quotZeroErro'
_gen_0':s':quotZeroErro'3 :: Nat → 0':s':quotZeroErro'
Generator Equations:
_gen_0':s':quotZeroErro'3(0) ⇔ 0'
_gen_0':s':quotZeroErro'3(+(x, 1)) ⇔ s'(_gen_0':s':quotZeroErro'3(x))
The following defined symbols remain to be analysed:
le', quotIter'
They will be analysed ascendingly in the following order:
le' < quotIter'
Proved the following rewrite lemma:
le'(_gen_0':s':quotZeroErro'3(_n5), _gen_0':s':quotZeroErro'3(_n5)) → true', rt ∈ Ω(1 + n5)
Induction Base:
le'(_gen_0':s':quotZeroErro'3(0), _gen_0':s':quotZeroErro'3(0)) →RΩ(1)
true'
Induction Step:
le'(_gen_0':s':quotZeroErro'3(+(_$n6, 1)), _gen_0':s':quotZeroErro'3(+(_$n6, 1))) →RΩ(1)
le'(_gen_0':s':quotZeroErro'3(_$n6), _gen_0':s':quotZeroErro'3(_$n6)) →IH
true'
We have rt ∈ Ω(n) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
Rules:
le'(0', y) → true'
le'(s'(x), 0') → false'
le'(s'(x), s'(y)) → le'(x, y)
quot'(x, 0') → quotZeroErro'
quot'(x, s'(y)) → quotIter'(x, s'(y), 0', 0', 0')
quotIter'(x, s'(y), z, u, v) → if'(le'(x, z), x, s'(y), z, u, v)
if'(true', x, y, z, u, v) → v
if'(false', x, y, z, u, v) → if2'(le'(y, s'(u)), x, y, s'(z), s'(u), v)
if2'(false', x, y, z, u, v) → quotIter'(x, y, z, u, v)
if2'(true', x, y, z, u, v) → quotIter'(x, y, z, 0', s'(v))
Types:
le' :: 0':s':quotZeroErro' → 0':s':quotZeroErro' → true':false'
0' :: 0':s':quotZeroErro'
true' :: true':false'
s' :: 0':s':quotZeroErro' → 0':s':quotZeroErro'
false' :: true':false'
quot' :: 0':s':quotZeroErro' → 0':s':quotZeroErro' → 0':s':quotZeroErro'
quotZeroErro' :: 0':s':quotZeroErro'
quotIter' :: 0':s':quotZeroErro' → 0':s':quotZeroErro' → 0':s':quotZeroErro' → 0':s':quotZeroErro' → 0':s':quotZeroErro' → 0':s':quotZeroErro'
if' :: true':false' → 0':s':quotZeroErro' → 0':s':quotZeroErro' → 0':s':quotZeroErro' → 0':s':quotZeroErro' → 0':s':quotZeroErro' → 0':s':quotZeroErro'
if2' :: true':false' → 0':s':quotZeroErro' → 0':s':quotZeroErro' → 0':s':quotZeroErro' → 0':s':quotZeroErro' → 0':s':quotZeroErro' → 0':s':quotZeroErro'
_hole_true':false'1 :: true':false'
_hole_0':s':quotZeroErro'2 :: 0':s':quotZeroErro'
_gen_0':s':quotZeroErro'3 :: Nat → 0':s':quotZeroErro'
Lemmas:
le'(_gen_0':s':quotZeroErro'3(_n5), _gen_0':s':quotZeroErro'3(_n5)) → true', rt ∈ Ω(1 + n5)
Generator Equations:
_gen_0':s':quotZeroErro'3(0) ⇔ 0'
_gen_0':s':quotZeroErro'3(+(x, 1)) ⇔ s'(_gen_0':s':quotZeroErro'3(x))
The following defined symbols remain to be analysed:
quotIter'
Could not prove a rewrite lemma for the defined symbol quotIter'.
Rules:
le'(0', y) → true'
le'(s'(x), 0') → false'
le'(s'(x), s'(y)) → le'(x, y)
quot'(x, 0') → quotZeroErro'
quot'(x, s'(y)) → quotIter'(x, s'(y), 0', 0', 0')
quotIter'(x, s'(y), z, u, v) → if'(le'(x, z), x, s'(y), z, u, v)
if'(true', x, y, z, u, v) → v
if'(false', x, y, z, u, v) → if2'(le'(y, s'(u)), x, y, s'(z), s'(u), v)
if2'(false', x, y, z, u, v) → quotIter'(x, y, z, u, v)
if2'(true', x, y, z, u, v) → quotIter'(x, y, z, 0', s'(v))
Types:
le' :: 0':s':quotZeroErro' → 0':s':quotZeroErro' → true':false'
0' :: 0':s':quotZeroErro'
true' :: true':false'
s' :: 0':s':quotZeroErro' → 0':s':quotZeroErro'
false' :: true':false'
quot' :: 0':s':quotZeroErro' → 0':s':quotZeroErro' → 0':s':quotZeroErro'
quotZeroErro' :: 0':s':quotZeroErro'
quotIter' :: 0':s':quotZeroErro' → 0':s':quotZeroErro' → 0':s':quotZeroErro' → 0':s':quotZeroErro' → 0':s':quotZeroErro' → 0':s':quotZeroErro'
if' :: true':false' → 0':s':quotZeroErro' → 0':s':quotZeroErro' → 0':s':quotZeroErro' → 0':s':quotZeroErro' → 0':s':quotZeroErro' → 0':s':quotZeroErro'
if2' :: true':false' → 0':s':quotZeroErro' → 0':s':quotZeroErro' → 0':s':quotZeroErro' → 0':s':quotZeroErro' → 0':s':quotZeroErro' → 0':s':quotZeroErro'
_hole_true':false'1 :: true':false'
_hole_0':s':quotZeroErro'2 :: 0':s':quotZeroErro'
_gen_0':s':quotZeroErro'3 :: Nat → 0':s':quotZeroErro'
Lemmas:
le'(_gen_0':s':quotZeroErro'3(_n5), _gen_0':s':quotZeroErro'3(_n5)) → true', rt ∈ Ω(1 + n5)
Generator Equations:
_gen_0':s':quotZeroErro'3(0) ⇔ 0'
_gen_0':s':quotZeroErro'3(+(x, 1)) ⇔ s'(_gen_0':s':quotZeroErro'3(x))
No more defined symbols left to analyse.
The lowerbound Ω(n) was proven with the following lemma:
le'(_gen_0':s':quotZeroErro'3(_n5), _gen_0':s':quotZeroErro'3(_n5)) → true', rt ∈ Ω(1 + n5)