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