Runtime Complexity TRS:
The TRS R consists of the following rules:
-(x, 0) → x
-(0, s(y)) → 0
-(s(x), s(y)) → -(x, y)
f(0) → 0
f(s(x)) → -(s(x), g(f(x)))
g(0) → s(0)
g(s(x)) → -(s(x), f(g(x)))
Renamed function symbols to avoid clashes with predefined symbol.
Runtime Complexity TRS:
The TRS R consists of the following rules:
-'(x, 0') → x
-'(0', s'(y)) → 0'
-'(s'(x), s'(y)) → -'(x, y)
f'(0') → 0'
f'(s'(x)) → -'(s'(x), g'(f'(x)))
g'(0') → s'(0')
g'(s'(x)) → -'(s'(x), f'(g'(x)))
Infered types.
Rules:
-'(x, 0') → x
-'(0', s'(y)) → 0'
-'(s'(x), s'(y)) → -'(x, y)
f'(0') → 0'
f'(s'(x)) → -'(s'(x), g'(f'(x)))
g'(0') → s'(0')
g'(s'(x)) → -'(s'(x), f'(g'(x)))
Types:
-' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
f' :: 0':s' → 0':s'
g' :: 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:
-', f', g'
They will be analysed ascendingly in the following order:
-' < f'
-' < g'
f' = g'
Rules:
-'(x, 0') → x
-'(0', s'(y)) → 0'
-'(s'(x), s'(y)) → -'(x, y)
f'(0') → 0'
f'(s'(x)) → -'(s'(x), g'(f'(x)))
g'(0') → s'(0')
g'(s'(x)) → -'(s'(x), f'(g'(x)))
Types:
-' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
f' :: 0':s' → 0':s'
g' :: 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:
-', f', g'
They will be analysed ascendingly in the following order:
-' < f'
-' < g'
f' = g'
Proved the following rewrite lemma:
-'(_gen_0':s'2(_n4), _gen_0':s'2(_n4)) → _gen_0':s'2(0), rt ∈ Ω(1 + n4)
Induction Base:
-'(_gen_0':s'2(0), _gen_0':s'2(0)) →RΩ(1)
_gen_0':s'2(0)
Induction Step:
-'(_gen_0':s'2(+(_$n5, 1)), _gen_0':s'2(+(_$n5, 1))) →RΩ(1)
-'(_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:
-'(x, 0') → x
-'(0', s'(y)) → 0'
-'(s'(x), s'(y)) → -'(x, y)
f'(0') → 0'
f'(s'(x)) → -'(s'(x), g'(f'(x)))
g'(0') → s'(0')
g'(s'(x)) → -'(s'(x), f'(g'(x)))
Types:
-' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
f' :: 0':s' → 0':s'
g' :: 0':s' → 0':s'
_hole_0':s'1 :: 0':s'
_gen_0':s'2 :: Nat → 0':s'
Lemmas:
-'(_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:
g', f'
They will be analysed ascendingly in the following order:
f' = g'
Proved the following rewrite lemma:
g'(_gen_0':s'2(+(1, _n472))) → _*3, rt ∈ Ω(n472)
Induction Base:
g'(_gen_0':s'2(+(1, 0)))
Induction Step:
g'(_gen_0':s'2(+(1, +(_$n473, 1)))) →RΩ(1)
-'(s'(_gen_0':s'2(+(1, _$n473))), f'(g'(_gen_0':s'2(+(1, _$n473))))) →IH
-'(s'(_gen_0':s'2(+(1, _$n473))), f'(_*3))
We have rt ∈ Ω(n) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
Rules:
-'(x, 0') → x
-'(0', s'(y)) → 0'
-'(s'(x), s'(y)) → -'(x, y)
f'(0') → 0'
f'(s'(x)) → -'(s'(x), g'(f'(x)))
g'(0') → s'(0')
g'(s'(x)) → -'(s'(x), f'(g'(x)))
Types:
-' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
f' :: 0':s' → 0':s'
g' :: 0':s' → 0':s'
_hole_0':s'1 :: 0':s'
_gen_0':s'2 :: Nat → 0':s'
Lemmas:
-'(_gen_0':s'2(_n4), _gen_0':s'2(_n4)) → _gen_0':s'2(0), rt ∈ Ω(1 + n4)
g'(_gen_0':s'2(+(1, _n472))) → _*3, rt ∈ Ω(n472)
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:
f'
They will be analysed ascendingly in the following order:
f' = g'
Proved the following rewrite lemma:
f'(_gen_0':s'2(+(1, _n6540))) → _*3, rt ∈ Ω(n6540)
Induction Base:
f'(_gen_0':s'2(+(1, 0)))
Induction Step:
f'(_gen_0':s'2(+(1, +(_$n6541, 1)))) →RΩ(1)
-'(s'(_gen_0':s'2(+(1, _$n6541))), g'(f'(_gen_0':s'2(+(1, _$n6541))))) →IH
-'(s'(_gen_0':s'2(+(1, _$n6541))), g'(_*3))
We have rt ∈ Ω(n) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
Rules:
-'(x, 0') → x
-'(0', s'(y)) → 0'
-'(s'(x), s'(y)) → -'(x, y)
f'(0') → 0'
f'(s'(x)) → -'(s'(x), g'(f'(x)))
g'(0') → s'(0')
g'(s'(x)) → -'(s'(x), f'(g'(x)))
Types:
-' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
f' :: 0':s' → 0':s'
g' :: 0':s' → 0':s'
_hole_0':s'1 :: 0':s'
_gen_0':s'2 :: Nat → 0':s'
Lemmas:
-'(_gen_0':s'2(_n4), _gen_0':s'2(_n4)) → _gen_0':s'2(0), rt ∈ Ω(1 + n4)
g'(_gen_0':s'2(+(1, _n472))) → _*3, rt ∈ Ω(n472)
f'(_gen_0':s'2(+(1, _n6540))) → _*3, rt ∈ Ω(n6540)
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:
g'
They will be analysed ascendingly in the following order:
f' = g'
Proved the following rewrite lemma:
g'(_gen_0':s'2(+(1, _n93066))) → _*3, rt ∈ Ω(n93066)
Induction Base:
g'(_gen_0':s'2(+(1, 0)))
Induction Step:
g'(_gen_0':s'2(+(1, +(_$n93067, 1)))) →RΩ(1)
-'(s'(_gen_0':s'2(+(1, _$n93067))), f'(g'(_gen_0':s'2(+(1, _$n93067))))) →IH
-'(s'(_gen_0':s'2(+(1, _$n93067))), f'(_*3))
We have rt ∈ Ω(n) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
Rules:
-'(x, 0') → x
-'(0', s'(y)) → 0'
-'(s'(x), s'(y)) → -'(x, y)
f'(0') → 0'
f'(s'(x)) → -'(s'(x), g'(f'(x)))
g'(0') → s'(0')
g'(s'(x)) → -'(s'(x), f'(g'(x)))
Types:
-' :: 0':s' → 0':s' → 0':s'
0' :: 0':s'
s' :: 0':s' → 0':s'
f' :: 0':s' → 0':s'
g' :: 0':s' → 0':s'
_hole_0':s'1 :: 0':s'
_gen_0':s'2 :: Nat → 0':s'
Lemmas:
-'(_gen_0':s'2(_n4), _gen_0':s'2(_n4)) → _gen_0':s'2(0), rt ∈ Ω(1 + n4)
g'(_gen_0':s'2(+(1, _n93066))) → _*3, rt ∈ Ω(n93066)
f'(_gen_0':s'2(+(1, _n6540))) → _*3, rt ∈ Ω(n6540)
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:
-'(_gen_0':s'2(_n4), _gen_0':s'2(_n4)) → _gen_0':s'2(0), rt ∈ Ω(1 + n4)