Runtime Complexity TRS:
The TRS R consists of the following rules:
pred(s(x)) → x
minus(x, 0) → x
minus(x, s(y)) → pred(minus(x, y))
quot(0, s(y)) → 0
quot(s(x), s(y)) → s(quot(minus(x, y), s(y)))
Renamed function symbols to avoid clashes with predefined symbol.
Runtime Complexity TRS:
The TRS R consists of the following rules:
pred'(s'(x)) → x
minus'(x, 0') → x
minus'(x, s'(y)) → pred'(minus'(x, y))
quot'(0', s'(y)) → 0'
quot'(s'(x), s'(y)) → s'(quot'(minus'(x, y), s'(y)))
Infered types.
Rules:
pred'(s'(x)) → x
minus'(x, 0') → x
minus'(x, s'(y)) → pred'(minus'(x, y))
quot'(0', s'(y)) → 0'
quot'(s'(x), s'(y)) → s'(quot'(minus'(x, y), s'(y)))
Types:
pred' :: s':0' → s':0'
s' :: s':0' → s':0'
minus' :: s':0' → s':0' → s':0'
0' :: s':0'
quot' :: s':0' → s':0' → s':0'
_hole_s':0'1 :: s':0'
_gen_s':0'2 :: Nat → s':0'
Heuristically decided to analyse the following defined symbols:
minus', quot'
They will be analysed ascendingly in the following order:
minus' < quot'
Rules:
pred'(s'(x)) → x
minus'(x, 0') → x
minus'(x, s'(y)) → pred'(minus'(x, y))
quot'(0', s'(y)) → 0'
quot'(s'(x), s'(y)) → s'(quot'(minus'(x, y), s'(y)))
Types:
pred' :: s':0' → s':0'
s' :: s':0' → s':0'
minus' :: s':0' → s':0' → s':0'
0' :: s':0'
quot' :: s':0' → s':0' → s':0'
_hole_s':0'1 :: s':0'
_gen_s':0'2 :: Nat → s':0'
Generator Equations:
_gen_s':0'2(0) ⇔ 0'
_gen_s':0'2(+(x, 1)) ⇔ s'(_gen_s':0'2(x))
The following defined symbols remain to be analysed:
minus', quot'
They will be analysed ascendingly in the following order:
minus' < quot'
Proved the following rewrite lemma:
minus'(_gen_s':0'2(a), _gen_s':0'2(+(1, _n4))) → _*3, rt ∈ Ω(n4)
Induction Base:
minus'(_gen_s':0'2(a), _gen_s':0'2(+(1, 0)))
Induction Step:
minus'(_gen_s':0'2(_a611), _gen_s':0'2(+(1, +(_$n5, 1)))) →RΩ(1)
pred'(minus'(_gen_s':0'2(_a611), _gen_s':0'2(+(1, _$n5)))) →IH
pred'(_*3)
We have rt ∈ Ω(n) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
Rules:
pred'(s'(x)) → x
minus'(x, 0') → x
minus'(x, s'(y)) → pred'(minus'(x, y))
quot'(0', s'(y)) → 0'
quot'(s'(x), s'(y)) → s'(quot'(minus'(x, y), s'(y)))
Types:
pred' :: s':0' → s':0'
s' :: s':0' → s':0'
minus' :: s':0' → s':0' → s':0'
0' :: s':0'
quot' :: s':0' → s':0' → s':0'
_hole_s':0'1 :: s':0'
_gen_s':0'2 :: Nat → s':0'
Lemmas:
minus'(_gen_s':0'2(a), _gen_s':0'2(+(1, _n4))) → _*3, rt ∈ Ω(n4)
Generator Equations:
_gen_s':0'2(0) ⇔ 0'
_gen_s':0'2(+(x, 1)) ⇔ s'(_gen_s':0'2(x))
The following defined symbols remain to be analysed:
quot'
Proved the following rewrite lemma:
quot'(_gen_s':0'2(_n831), _gen_s':0'2(1)) → _gen_s':0'2(_n831), rt ∈ Ω(1 + n831)
Induction Base:
quot'(_gen_s':0'2(0), _gen_s':0'2(1)) →RΩ(1)
0'
Induction Step:
quot'(_gen_s':0'2(+(_$n832, 1)), _gen_s':0'2(1)) →RΩ(1)
s'(quot'(minus'(_gen_s':0'2(_$n832), _gen_s':0'2(0)), s'(_gen_s':0'2(0)))) →RΩ(1)
s'(quot'(_gen_s':0'2(_$n832), s'(_gen_s':0'2(0)))) →IH
s'(_gen_s':0'2(_$n832))
We have rt ∈ Ω(n) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
Rules:
pred'(s'(x)) → x
minus'(x, 0') → x
minus'(x, s'(y)) → pred'(minus'(x, y))
quot'(0', s'(y)) → 0'
quot'(s'(x), s'(y)) → s'(quot'(minus'(x, y), s'(y)))
Types:
pred' :: s':0' → s':0'
s' :: s':0' → s':0'
minus' :: s':0' → s':0' → s':0'
0' :: s':0'
quot' :: s':0' → s':0' → s':0'
_hole_s':0'1 :: s':0'
_gen_s':0'2 :: Nat → s':0'
Lemmas:
minus'(_gen_s':0'2(a), _gen_s':0'2(+(1, _n4))) → _*3, rt ∈ Ω(n4)
quot'(_gen_s':0'2(_n831), _gen_s':0'2(1)) → _gen_s':0'2(_n831), rt ∈ Ω(1 + n831)
Generator Equations:
_gen_s':0'2(0) ⇔ 0'
_gen_s':0'2(+(x, 1)) ⇔ s'(_gen_s':0'2(x))
No more defined symbols left to analyse.
The lowerbound Ω(n) was proven with the following lemma:
minus'(_gen_s':0'2(a), _gen_s':0'2(+(1, _n4))) → _*3, rt ∈ Ω(n4)