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