Runtime Complexity TRS:
The TRS R consists of the following rules:
plus(0, x) → x
plus(s(x), y) → s(plus(x, y))
times(0, y) → 0
times(s(x), y) → plus(y, times(x, y))
p(s(x)) → x
p(0) → 0
minus(x, 0) → x
minus(0, x) → 0
minus(x, s(y)) → p(minus(x, y))
isZero(0) → true
isZero(s(x)) → false
facIter(x, y) → if(isZero(x), minus(x, s(0)), y, times(y, x))
if(true, x, y, z) → y
if(false, x, y, z) → facIter(x, z)
factorial(x) → facIter(x, s(0))
Renamed function symbols to avoid clashes with predefined symbol.
Runtime Complexity TRS:
The TRS R consists of the following rules:
plus'(0', x) → x
plus'(s'(x), y) → s'(plus'(x, y))
times'(0', y) → 0'
times'(s'(x), y) → plus'(y, times'(x, y))
p'(s'(x)) → x
p'(0') → 0'
minus'(x, 0') → x
minus'(0', x) → 0'
minus'(x, s'(y)) → p'(minus'(x, y))
isZero'(0') → true'
isZero'(s'(x)) → false'
facIter'(x, y) → if'(isZero'(x), minus'(x, s'(0')), y, times'(y, x))
if'(true', x, y, z) → y
if'(false', x, y, z) → facIter'(x, z)
factorial'(x) → facIter'(x, s'(0'))
Infered types.
Rules:
plus'(0', x) → x
plus'(s'(x), y) → s'(plus'(x, y))
times'(0', y) → 0'
times'(s'(x), y) → plus'(y, times'(x, y))
p'(s'(x)) → x
p'(0') → 0'
minus'(x, 0') → x
minus'(0', x) → 0'
minus'(x, s'(y)) → p'(minus'(x, y))
isZero'(0') → true'
isZero'(s'(x)) → false'
facIter'(x, y) → if'(isZero'(x), minus'(x, s'(0')), y, times'(y, x))
if'(true', x, y, z) → y
if'(false', x, y, z) → facIter'(x, z)
factorial'(x) → facIter'(x, s'(0'))
Types:
plus' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
times' :: 0':s' → 0':s' → 0':s'
p' :: 0':s' → 0':s'
minus' :: 0':s' → 0':s' → 0':s'
isZero' :: 0':s' → true':false'
true' :: true':false'
false' :: true':false'
facIter' :: 0':s' → 0':s' → 0':s'
if' :: true':false' → 0':s' → 0':s' → 0':s' → 0':s'
factorial' :: 0':s' → 0':s'
_hole_0':s'1 :: 0':s'
_hole_true':false'2 :: true':false'
_gen_0':s'3 :: Nat → 0':s'
Heuristically decided to analyse the following defined symbols:
plus', times', minus', facIter'
They will be analysed ascendingly in the following order:
plus' < times'
times' < facIter'
minus' < facIter'
Rules:
plus'(0', x) → x
plus'(s'(x), y) → s'(plus'(x, y))
times'(0', y) → 0'
times'(s'(x), y) → plus'(y, times'(x, y))
p'(s'(x)) → x
p'(0') → 0'
minus'(x, 0') → x
minus'(0', x) → 0'
minus'(x, s'(y)) → p'(minus'(x, y))
isZero'(0') → true'
isZero'(s'(x)) → false'
facIter'(x, y) → if'(isZero'(x), minus'(x, s'(0')), y, times'(y, x))
if'(true', x, y, z) → y
if'(false', x, y, z) → facIter'(x, z)
factorial'(x) → facIter'(x, s'(0'))
Types:
plus' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
times' :: 0':s' → 0':s' → 0':s'
p' :: 0':s' → 0':s'
minus' :: 0':s' → 0':s' → 0':s'
isZero' :: 0':s' → true':false'
true' :: true':false'
false' :: true':false'
facIter' :: 0':s' → 0':s' → 0':s'
if' :: true':false' → 0':s' → 0':s' → 0':s' → 0':s'
factorial' :: 0':s' → 0':s'
_hole_0':s'1 :: 0':s'
_hole_true':false'2 :: true':false'
_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:
plus', times', minus', facIter'
They will be analysed ascendingly in the following order:
plus' < times'
times' < facIter'
minus' < facIter'
Proved the following rewrite lemma:
plus'(_gen_0':s'3(_n5), _gen_0':s'3(b)) → _gen_0':s'3(+(_n5, b)), rt ∈ Ω(1 + n5)
Induction Base:
plus'(_gen_0':s'3(0), _gen_0':s'3(b)) →RΩ(1)
_gen_0':s'3(b)
Induction Step:
plus'(_gen_0':s'3(+(_$n6, 1)), _gen_0':s'3(_b138)) →RΩ(1)
s'(plus'(_gen_0':s'3(_$n6), _gen_0':s'3(_b138))) →IH
s'(_gen_0':s'3(+(_$n6, _b138)))
We have rt ∈ Ω(n) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
Rules:
plus'(0', x) → x
plus'(s'(x), y) → s'(plus'(x, y))
times'(0', y) → 0'
times'(s'(x), y) → plus'(y, times'(x, y))
p'(s'(x)) → x
p'(0') → 0'
minus'(x, 0') → x
minus'(0', x) → 0'
minus'(x, s'(y)) → p'(minus'(x, y))
isZero'(0') → true'
isZero'(s'(x)) → false'
facIter'(x, y) → if'(isZero'(x), minus'(x, s'(0')), y, times'(y, x))
if'(true', x, y, z) → y
if'(false', x, y, z) → facIter'(x, z)
factorial'(x) → facIter'(x, s'(0'))
Types:
plus' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
times' :: 0':s' → 0':s' → 0':s'
p' :: 0':s' → 0':s'
minus' :: 0':s' → 0':s' → 0':s'
isZero' :: 0':s' → true':false'
true' :: true':false'
false' :: true':false'
facIter' :: 0':s' → 0':s' → 0':s'
if' :: true':false' → 0':s' → 0':s' → 0':s' → 0':s'
factorial' :: 0':s' → 0':s'
_hole_0':s'1 :: 0':s'
_hole_true':false'2 :: true':false'
_gen_0':s'3 :: Nat → 0':s'
Lemmas:
plus'(_gen_0':s'3(_n5), _gen_0':s'3(b)) → _gen_0':s'3(+(_n5, b)), 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:
times', minus', facIter'
They will be analysed ascendingly in the following order:
times' < facIter'
minus' < facIter'
Proved the following rewrite lemma:
times'(_gen_0':s'3(_n903), _gen_0':s'3(b)) → _gen_0':s'3(*(_n903, b)), rt ∈ Ω(1 + b1163·n903 + n903)
Induction Base:
times'(_gen_0':s'3(0), _gen_0':s'3(b)) →RΩ(1)
0'
Induction Step:
times'(_gen_0':s'3(+(_$n904, 1)), _gen_0':s'3(_b1163)) →RΩ(1)
plus'(_gen_0':s'3(_b1163), times'(_gen_0':s'3(_$n904), _gen_0':s'3(_b1163))) →IH
plus'(_gen_0':s'3(_b1163), _gen_0':s'3(*(_$n904, _b1163))) →LΩ(1 + b1163)
_gen_0':s'3(+(_b1163, *(_$n904, _b1163)))
We have rt ∈ Ω(n2) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n2).
Rules:
plus'(0', x) → x
plus'(s'(x), y) → s'(plus'(x, y))
times'(0', y) → 0'
times'(s'(x), y) → plus'(y, times'(x, y))
p'(s'(x)) → x
p'(0') → 0'
minus'(x, 0') → x
minus'(0', x) → 0'
minus'(x, s'(y)) → p'(minus'(x, y))
isZero'(0') → true'
isZero'(s'(x)) → false'
facIter'(x, y) → if'(isZero'(x), minus'(x, s'(0')), y, times'(y, x))
if'(true', x, y, z) → y
if'(false', x, y, z) → facIter'(x, z)
factorial'(x) → facIter'(x, s'(0'))
Types:
plus' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
times' :: 0':s' → 0':s' → 0':s'
p' :: 0':s' → 0':s'
minus' :: 0':s' → 0':s' → 0':s'
isZero' :: 0':s' → true':false'
true' :: true':false'
false' :: true':false'
facIter' :: 0':s' → 0':s' → 0':s'
if' :: true':false' → 0':s' → 0':s' → 0':s' → 0':s'
factorial' :: 0':s' → 0':s'
_hole_0':s'1 :: 0':s'
_hole_true':false'2 :: true':false'
_gen_0':s'3 :: Nat → 0':s'
Lemmas:
plus'(_gen_0':s'3(_n5), _gen_0':s'3(b)) → _gen_0':s'3(+(_n5, b)), rt ∈ Ω(1 + n5)
times'(_gen_0':s'3(_n903), _gen_0':s'3(b)) → _gen_0':s'3(*(_n903, b)), rt ∈ Ω(1 + b1163·n903 + n903)
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', facIter'
They will be analysed ascendingly in the following order:
minus' < facIter'
Proved the following rewrite lemma:
minus'(_gen_0':s'3(a), _gen_0':s'3(+(1, _n2252))) → _*4, rt ∈ Ω(n2252)
Induction Base:
minus'(_gen_0':s'3(a), _gen_0':s'3(+(1, 0)))
Induction Step:
minus'(_gen_0':s'3(_a3747), _gen_0':s'3(+(1, +(_$n2253, 1)))) →RΩ(1)
p'(minus'(_gen_0':s'3(_a3747), _gen_0':s'3(+(1, _$n2253)))) →IH
p'(_*4)
We have rt ∈ Ω(n) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
Rules:
plus'(0', x) → x
plus'(s'(x), y) → s'(plus'(x, y))
times'(0', y) → 0'
times'(s'(x), y) → plus'(y, times'(x, y))
p'(s'(x)) → x
p'(0') → 0'
minus'(x, 0') → x
minus'(0', x) → 0'
minus'(x, s'(y)) → p'(minus'(x, y))
isZero'(0') → true'
isZero'(s'(x)) → false'
facIter'(x, y) → if'(isZero'(x), minus'(x, s'(0')), y, times'(y, x))
if'(true', x, y, z) → y
if'(false', x, y, z) → facIter'(x, z)
factorial'(x) → facIter'(x, s'(0'))
Types:
plus' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
times' :: 0':s' → 0':s' → 0':s'
p' :: 0':s' → 0':s'
minus' :: 0':s' → 0':s' → 0':s'
isZero' :: 0':s' → true':false'
true' :: true':false'
false' :: true':false'
facIter' :: 0':s' → 0':s' → 0':s'
if' :: true':false' → 0':s' → 0':s' → 0':s' → 0':s'
factorial' :: 0':s' → 0':s'
_hole_0':s'1 :: 0':s'
_hole_true':false'2 :: true':false'
_gen_0':s'3 :: Nat → 0':s'
Lemmas:
plus'(_gen_0':s'3(_n5), _gen_0':s'3(b)) → _gen_0':s'3(+(_n5, b)), rt ∈ Ω(1 + n5)
times'(_gen_0':s'3(_n903), _gen_0':s'3(b)) → _gen_0':s'3(*(_n903, b)), rt ∈ Ω(1 + b1163·n903 + n903)
minus'(_gen_0':s'3(a), _gen_0':s'3(+(1, _n2252))) → _*4, rt ∈ Ω(n2252)
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:
facIter'