Runtime Complexity TRS:
The TRS R consists of the following rules:
minus(x, 0) → x
minus(s(x), s(y)) → minus(x, y)
double(0) → 0
double(s(x)) → s(s(double(x)))
plus(0, y) → y
plus(s(x), y) → s(plus(x, y))
plus(s(x), y) → plus(x, s(y))
plus(s(x), y) → s(plus(minus(x, y), double(y)))
plus(s(plus(x, y)), z) → s(plus(plus(x, y), z))
Renamed function symbols to avoid clashes with predefined symbol.
Runtime Complexity TRS:
The TRS R consists of the following rules:
minus'(x, 0') → x
minus'(s'(x), s'(y)) → minus'(x, y)
double'(0') → 0'
double'(s'(x)) → s'(s'(double'(x)))
plus'(0', y) → y
plus'(s'(x), y) → s'(plus'(x, y))
plus'(s'(x), y) → plus'(x, s'(y))
plus'(s'(x), y) → s'(plus'(minus'(x, y), double'(y)))
plus'(s'(plus'(x, y)), z) → s'(plus'(plus'(x, y), z))
Infered types.
Rules:
minus'(x, 0') → x
minus'(s'(x), s'(y)) → minus'(x, y)
double'(0') → 0'
double'(s'(x)) → s'(s'(double'(x)))
plus'(0', y) → y
plus'(s'(x), y) → s'(plus'(x, y))
plus'(s'(x), y) → plus'(x, s'(y))
plus'(s'(x), y) → s'(plus'(minus'(x, y), double'(y)))
plus'(s'(plus'(x, y)), z) → s'(plus'(plus'(x, y), z))
Types:
minus' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
double' :: 0':s' → 0':s'
plus' :: 0':s' → 0':s' → 0':s'
_hole_0':s'1 :: 0':s'
_gen_0':s'2 :: Nat → 0':s'
Heuristically decided to analyse the following defined symbols:
minus', double', plus'
They will be analysed ascendingly in the following order:
minus' < plus'
double' < plus'
Rules:
minus'(x, 0') → x
minus'(s'(x), s'(y)) → minus'(x, y)
double'(0') → 0'
double'(s'(x)) → s'(s'(double'(x)))
plus'(0', y) → y
plus'(s'(x), y) → s'(plus'(x, y))
plus'(s'(x), y) → plus'(x, s'(y))
plus'(s'(x), y) → s'(plus'(minus'(x, y), double'(y)))
plus'(s'(plus'(x, y)), z) → s'(plus'(plus'(x, y), z))
Types:
minus' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
double' :: 0':s' → 0':s'
plus' :: 0':s' → 0':s' → 0':s'
_hole_0':s'1 :: 0':s'
_gen_0':s'2 :: Nat → 0':s'
Generator Equations:
_gen_0':s'2(0) ⇔ 0'
_gen_0':s'2(+(x, 1)) ⇔ s'(_gen_0':s'2(x))
The following defined symbols remain to be analysed:
minus', double', plus'
They will be analysed ascendingly in the following order:
minus' < plus'
double' < plus'
Proved the following rewrite lemma:
minus'(_gen_0':s'2(_n4), _gen_0':s'2(_n4)) → _gen_0':s'2(0), rt ∈ Ω(1 + n4)
Induction Base:
minus'(_gen_0':s'2(0), _gen_0':s'2(0)) →RΩ(1)
_gen_0':s'2(0)
Induction Step:
minus'(_gen_0':s'2(+(_$n5, 1)), _gen_0':s'2(+(_$n5, 1))) →RΩ(1)
minus'(_gen_0':s'2(_$n5), _gen_0':s'2(_$n5)) →IH
_gen_0':s'2(0)
We have rt ∈ Ω(n) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
Rules:
minus'(x, 0') → x
minus'(s'(x), s'(y)) → minus'(x, y)
double'(0') → 0'
double'(s'(x)) → s'(s'(double'(x)))
plus'(0', y) → y
plus'(s'(x), y) → s'(plus'(x, y))
plus'(s'(x), y) → plus'(x, s'(y))
plus'(s'(x), y) → s'(plus'(minus'(x, y), double'(y)))
plus'(s'(plus'(x, y)), z) → s'(plus'(plus'(x, y), z))
Types:
minus' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
double' :: 0':s' → 0':s'
plus' :: 0':s' → 0':s' → 0':s'
_hole_0':s'1 :: 0':s'
_gen_0':s'2 :: Nat → 0':s'
Lemmas:
minus'(_gen_0':s'2(_n4), _gen_0':s'2(_n4)) → _gen_0':s'2(0), rt ∈ Ω(1 + n4)
Generator Equations:
_gen_0':s'2(0) ⇔ 0'
_gen_0':s'2(+(x, 1)) ⇔ s'(_gen_0':s'2(x))
The following defined symbols remain to be analysed:
double', plus'
They will be analysed ascendingly in the following order:
double' < plus'
Proved the following rewrite lemma:
double'(_gen_0':s'2(_n581)) → _gen_0':s'2(*(2, _n581)), rt ∈ Ω(1 + n581)
Induction Base:
double'(_gen_0':s'2(0)) →RΩ(1)
0'
Induction Step:
double'(_gen_0':s'2(+(_$n582, 1))) →RΩ(1)
s'(s'(double'(_gen_0':s'2(_$n582)))) →IH
s'(s'(_gen_0':s'2(*(2, _$n582))))
We have rt ∈ Ω(n) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
Rules:
minus'(x, 0') → x
minus'(s'(x), s'(y)) → minus'(x, y)
double'(0') → 0'
double'(s'(x)) → s'(s'(double'(x)))
plus'(0', y) → y
plus'(s'(x), y) → s'(plus'(x, y))
plus'(s'(x), y) → plus'(x, s'(y))
plus'(s'(x), y) → s'(plus'(minus'(x, y), double'(y)))
plus'(s'(plus'(x, y)), z) → s'(plus'(plus'(x, y), z))
Types:
minus' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
double' :: 0':s' → 0':s'
plus' :: 0':s' → 0':s' → 0':s'
_hole_0':s'1 :: 0':s'
_gen_0':s'2 :: Nat → 0':s'
Lemmas:
minus'(_gen_0':s'2(_n4), _gen_0':s'2(_n4)) → _gen_0':s'2(0), rt ∈ Ω(1 + n4)
double'(_gen_0':s'2(_n581)) → _gen_0':s'2(*(2, _n581)), rt ∈ Ω(1 + n581)
Generator Equations:
_gen_0':s'2(0) ⇔ 0'
_gen_0':s'2(+(x, 1)) ⇔ s'(_gen_0':s'2(x))
The following defined symbols remain to be analysed:
plus'
Proved the following rewrite lemma:
plus'(_gen_0':s'2(_n1023), _gen_0':s'2(b)) → _gen_0':s'2(+(_n1023, b)), rt ∈ Ω(1 + n1023)
Induction Base:
plus'(_gen_0':s'2(0), _gen_0':s'2(b)) →RΩ(1)
_gen_0':s'2(b)
Induction Step:
plus'(_gen_0':s'2(+(_$n1024, 1)), _gen_0':s'2(_b1364)) →RΩ(1)
s'(plus'(_gen_0':s'2(_$n1024), _gen_0':s'2(_b1364))) →IH
s'(_gen_0':s'2(+(_$n1024, _b1364)))
We have rt ∈ Ω(n) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
Rules:
minus'(x, 0') → x
minus'(s'(x), s'(y)) → minus'(x, y)
double'(0') → 0'
double'(s'(x)) → s'(s'(double'(x)))
plus'(0', y) → y
plus'(s'(x), y) → s'(plus'(x, y))
plus'(s'(x), y) → plus'(x, s'(y))
plus'(s'(x), y) → s'(plus'(minus'(x, y), double'(y)))
plus'(s'(plus'(x, y)), z) → s'(plus'(plus'(x, y), z))
Types:
minus' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
double' :: 0':s' → 0':s'
plus' :: 0':s' → 0':s' → 0':s'
_hole_0':s'1 :: 0':s'
_gen_0':s'2 :: Nat → 0':s'
Lemmas:
minus'(_gen_0':s'2(_n4), _gen_0':s'2(_n4)) → _gen_0':s'2(0), rt ∈ Ω(1 + n4)
double'(_gen_0':s'2(_n581)) → _gen_0':s'2(*(2, _n581)), rt ∈ Ω(1 + n581)
plus'(_gen_0':s'2(_n1023), _gen_0':s'2(b)) → _gen_0':s'2(+(_n1023, b)), rt ∈ Ω(1 + n1023)
Generator Equations:
_gen_0':s'2(0) ⇔ 0'
_gen_0':s'2(+(x, 1)) ⇔ s'(_gen_0':s'2(x))
No more defined symbols left to analyse.
The lowerbound Ω(n) was proven with the following lemma:
minus'(_gen_0':s'2(_n4), _gen_0':s'2(_n4)) → _gen_0':s'2(0), rt ∈ Ω(1 + n4)