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