Runtime Complexity TRS:
The TRS R consists of the following rules:
not(true) → false
not(false) → true
odd(0) → false
odd(s(x)) → not(odd(x))
+(x, 0) → x
+(x, s(y)) → s(+(x, y))
+(s(x), y) → s(+(x, y))
Renamed function symbols to avoid clashes with predefined symbol.
Runtime Complexity TRS:
The TRS R consists of the following rules:
not'(true') → false'
not'(false') → true'
odd'(0') → false'
odd'(s'(x)) → not'(odd'(x))
+'(x, 0') → x
+'(x, s'(y)) → s'(+'(x, y))
+'(s'(x), y) → s'(+'(x, y))
Infered types.
Rules:
not'(true') → false'
not'(false') → true'
odd'(0') → false'
odd'(s'(x)) → not'(odd'(x))
+'(x, 0') → x
+'(x, s'(y)) → s'(+'(x, y))
+'(s'(x), y) → s'(+'(x, y))
Types:
not' :: true':false' → true':false'
true' :: true':false'
false' :: true':false'
odd' :: 0':s' → true':false'
0' :: 0':s'
s' :: 0':s' → 0':s'
+' :: 0':s' → 0':s' → 0':s'
_hole_true':false'1 :: true':false'
_hole_0':s'2 :: 0':s'
_gen_0':s'3 :: Nat → 0':s'
Heuristically decided to analyse the following defined symbols:
odd', +'
Rules:
not'(true') → false'
not'(false') → true'
odd'(0') → false'
odd'(s'(x)) → not'(odd'(x))
+'(x, 0') → x
+'(x, s'(y)) → s'(+'(x, y))
+'(s'(x), y) → s'(+'(x, y))
Types:
not' :: true':false' → true':false'
true' :: true':false'
false' :: true':false'
odd' :: 0':s' → true':false'
0' :: 0':s'
s' :: 0':s' → 0':s'
+' :: 0':s' → 0':s' → 0':s'
_hole_true':false'1 :: true':false'
_hole_0':s'2 :: 0':s'
_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:
odd', +'
Proved the following rewrite lemma:
odd'(_gen_0':s'3(_n5)) → _*4, rt ∈ Ω(n5)
Induction Base:
odd'(_gen_0':s'3(0))
Induction Step:
odd'(_gen_0':s'3(+(_$n6, 1))) →RΩ(1)
not'(odd'(_gen_0':s'3(_$n6))) →IH
not'(_*4)
We have rt ∈ Ω(n) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
Rules:
not'(true') → false'
not'(false') → true'
odd'(0') → false'
odd'(s'(x)) → not'(odd'(x))
+'(x, 0') → x
+'(x, s'(y)) → s'(+'(x, y))
+'(s'(x), y) → s'(+'(x, y))
Types:
not' :: true':false' → true':false'
true' :: true':false'
false' :: true':false'
odd' :: 0':s' → true':false'
0' :: 0':s'
s' :: 0':s' → 0':s'
+' :: 0':s' → 0':s' → 0':s'
_hole_true':false'1 :: true':false'
_hole_0':s'2 :: 0':s'
_gen_0':s'3 :: Nat → 0':s'
Lemmas:
odd'(_gen_0':s'3(_n5)) → _*4, rt ∈ Ω(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:
+'
Proved the following rewrite lemma:
+'(_gen_0':s'3(a), _gen_0':s'3(_n227)) → _gen_0':s'3(+(_n227, a)), rt ∈ Ω(1 + n227)
Induction Base:
+'(_gen_0':s'3(a), _gen_0':s'3(0)) →RΩ(1)
_gen_0':s'3(a)
Induction Step:
+'(_gen_0':s'3(_a414), _gen_0':s'3(+(_$n228, 1))) →RΩ(1)
s'(+'(_gen_0':s'3(_a414), _gen_0':s'3(_$n228))) →IH
s'(_gen_0':s'3(+(_$n228, _a414)))
We have rt ∈ Ω(n) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
Rules:
not'(true') → false'
not'(false') → true'
odd'(0') → false'
odd'(s'(x)) → not'(odd'(x))
+'(x, 0') → x
+'(x, s'(y)) → s'(+'(x, y))
+'(s'(x), y) → s'(+'(x, y))
Types:
not' :: true':false' → true':false'
true' :: true':false'
false' :: true':false'
odd' :: 0':s' → true':false'
0' :: 0':s'
s' :: 0':s' → 0':s'
+' :: 0':s' → 0':s' → 0':s'
_hole_true':false'1 :: true':false'
_hole_0':s'2 :: 0':s'
_gen_0':s'3 :: Nat → 0':s'
Lemmas:
odd'(_gen_0':s'3(_n5)) → _*4, rt ∈ Ω(n5)
+'(_gen_0':s'3(a), _gen_0':s'3(_n227)) → _gen_0':s'3(+(_n227, a)), rt ∈ Ω(1 + n227)
Generator Equations:
_gen_0':s'3(0) ⇔ 0'
_gen_0':s'3(+(x, 1)) ⇔ s'(_gen_0':s'3(x))
No more defined symbols left to analyse.
The lowerbound Ω(n) was proven with the following lemma:
odd'(_gen_0':s'3(_n5)) → _*4, rt ∈ Ω(n5)