(0) Obligation:
Runtime Complexity TRS:
The TRS R consists of the following rules:
from(X) → cons(X, from(s(X)))
length(nil) → 0
length(cons(X, Y)) → s(length1(Y))
length1(X) → length(X)
Rewrite Strategy: FULL
(1) RenamingProof (EQUIVALENT transformation)
Renamed function symbols to avoid clashes with predefined symbol.
(2) Obligation:
Runtime Complexity Relative TRS:
The TRS R consists of the following rules:
from(X) → cons(X, from(s(X)))
length(nil) → 0'
length(cons(X, Y)) → s(length1(Y))
length1(X) → length(X)
S is empty.
Rewrite Strategy: FULL
(3) TypeInferenceProof (BOTH BOUNDS(ID, ID) transformation)
Infered types.
(4) Obligation:
TRS:
Rules:
from(X) → cons(X, from(s(X)))
length(nil) → 0'
length(cons(X, Y)) → s(length1(Y))
length1(X) → length(X)
Types:
from :: s:0' → cons:nil
cons :: s:0' → cons:nil → cons:nil
s :: s:0' → s:0'
length :: cons:nil → s:0'
nil :: cons:nil
0' :: s:0'
length1 :: cons:nil → s:0'
hole_cons:nil1_0 :: cons:nil
hole_s:0'2_0 :: s:0'
gen_cons:nil3_0 :: Nat → cons:nil
gen_s:0'4_0 :: Nat → s:0'
(5) OrderProof (LOWER BOUND(ID) transformation)
Heuristically decided to analyse the following defined symbols:
from,
length,
length1They will be analysed ascendingly in the following order:
length = length1
(6) Obligation:
TRS:
Rules:
from(
X) →
cons(
X,
from(
s(
X)))
length(
nil) →
0'length(
cons(
X,
Y)) →
s(
length1(
Y))
length1(
X) →
length(
X)
Types:
from :: s:0' → cons:nil
cons :: s:0' → cons:nil → cons:nil
s :: s:0' → s:0'
length :: cons:nil → s:0'
nil :: cons:nil
0' :: s:0'
length1 :: cons:nil → s:0'
hole_cons:nil1_0 :: cons:nil
hole_s:0'2_0 :: s:0'
gen_cons:nil3_0 :: Nat → cons:nil
gen_s:0'4_0 :: Nat → s:0'
Generator Equations:
gen_cons:nil3_0(0) ⇔ nil
gen_cons:nil3_0(+(x, 1)) ⇔ cons(0', gen_cons:nil3_0(x))
gen_s:0'4_0(0) ⇔ 0'
gen_s:0'4_0(+(x, 1)) ⇔ s(gen_s:0'4_0(x))
The following defined symbols remain to be analysed:
from, length, length1
They will be analysed ascendingly in the following order:
length = length1
(7) NoRewriteLemmaProof (LOWER BOUND(ID) transformation)
Could not prove a rewrite lemma for the defined symbol from.
(8) Obligation:
TRS:
Rules:
from(
X) →
cons(
X,
from(
s(
X)))
length(
nil) →
0'length(
cons(
X,
Y)) →
s(
length1(
Y))
length1(
X) →
length(
X)
Types:
from :: s:0' → cons:nil
cons :: s:0' → cons:nil → cons:nil
s :: s:0' → s:0'
length :: cons:nil → s:0'
nil :: cons:nil
0' :: s:0'
length1 :: cons:nil → s:0'
hole_cons:nil1_0 :: cons:nil
hole_s:0'2_0 :: s:0'
gen_cons:nil3_0 :: Nat → cons:nil
gen_s:0'4_0 :: Nat → s:0'
Generator Equations:
gen_cons:nil3_0(0) ⇔ nil
gen_cons:nil3_0(+(x, 1)) ⇔ cons(0', gen_cons:nil3_0(x))
gen_s:0'4_0(0) ⇔ 0'
gen_s:0'4_0(+(x, 1)) ⇔ s(gen_s:0'4_0(x))
The following defined symbols remain to be analysed:
length1, length
They will be analysed ascendingly in the following order:
length = length1
(9) RewriteLemmaProof (LOWER BOUND(ID) transformation)
Proved the following rewrite lemma:
length1(
gen_cons:nil3_0(
n57_0)) →
gen_s:0'4_0(
n57_0), rt ∈ Ω(1 + n57
0)
Induction Base:
length1(gen_cons:nil3_0(0)) →RΩ(1)
length(gen_cons:nil3_0(0)) →RΩ(1)
0'
Induction Step:
length1(gen_cons:nil3_0(+(n57_0, 1))) →RΩ(1)
length(gen_cons:nil3_0(+(n57_0, 1))) →RΩ(1)
s(length1(gen_cons:nil3_0(n57_0))) →IH
s(gen_s:0'4_0(c58_0))
We have rt ∈ Ω(n1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
(10) Complex Obligation (BEST)
(11) Obligation:
TRS:
Rules:
from(
X) →
cons(
X,
from(
s(
X)))
length(
nil) →
0'length(
cons(
X,
Y)) →
s(
length1(
Y))
length1(
X) →
length(
X)
Types:
from :: s:0' → cons:nil
cons :: s:0' → cons:nil → cons:nil
s :: s:0' → s:0'
length :: cons:nil → s:0'
nil :: cons:nil
0' :: s:0'
length1 :: cons:nil → s:0'
hole_cons:nil1_0 :: cons:nil
hole_s:0'2_0 :: s:0'
gen_cons:nil3_0 :: Nat → cons:nil
gen_s:0'4_0 :: Nat → s:0'
Lemmas:
length1(gen_cons:nil3_0(n57_0)) → gen_s:0'4_0(n57_0), rt ∈ Ω(1 + n570)
Generator Equations:
gen_cons:nil3_0(0) ⇔ nil
gen_cons:nil3_0(+(x, 1)) ⇔ cons(0', gen_cons:nil3_0(x))
gen_s:0'4_0(0) ⇔ 0'
gen_s:0'4_0(+(x, 1)) ⇔ s(gen_s:0'4_0(x))
The following defined symbols remain to be analysed:
length
They will be analysed ascendingly in the following order:
length = length1
(12) NoRewriteLemmaProof (LOWER BOUND(ID) transformation)
Could not prove a rewrite lemma for the defined symbol length.
(13) Obligation:
TRS:
Rules:
from(
X) →
cons(
X,
from(
s(
X)))
length(
nil) →
0'length(
cons(
X,
Y)) →
s(
length1(
Y))
length1(
X) →
length(
X)
Types:
from :: s:0' → cons:nil
cons :: s:0' → cons:nil → cons:nil
s :: s:0' → s:0'
length :: cons:nil → s:0'
nil :: cons:nil
0' :: s:0'
length1 :: cons:nil → s:0'
hole_cons:nil1_0 :: cons:nil
hole_s:0'2_0 :: s:0'
gen_cons:nil3_0 :: Nat → cons:nil
gen_s:0'4_0 :: Nat → s:0'
Lemmas:
length1(gen_cons:nil3_0(n57_0)) → gen_s:0'4_0(n57_0), rt ∈ Ω(1 + n570)
Generator Equations:
gen_cons:nil3_0(0) ⇔ nil
gen_cons:nil3_0(+(x, 1)) ⇔ cons(0', gen_cons:nil3_0(x))
gen_s:0'4_0(0) ⇔ 0'
gen_s:0'4_0(+(x, 1)) ⇔ s(gen_s:0'4_0(x))
No more defined symbols left to analyse.
(14) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
length1(gen_cons:nil3_0(n57_0)) → gen_s:0'4_0(n57_0), rt ∈ Ω(1 + n570)
(15) BOUNDS(n^1, INF)
(16) Obligation:
TRS:
Rules:
from(
X) →
cons(
X,
from(
s(
X)))
length(
nil) →
0'length(
cons(
X,
Y)) →
s(
length1(
Y))
length1(
X) →
length(
X)
Types:
from :: s:0' → cons:nil
cons :: s:0' → cons:nil → cons:nil
s :: s:0' → s:0'
length :: cons:nil → s:0'
nil :: cons:nil
0' :: s:0'
length1 :: cons:nil → s:0'
hole_cons:nil1_0 :: cons:nil
hole_s:0'2_0 :: s:0'
gen_cons:nil3_0 :: Nat → cons:nil
gen_s:0'4_0 :: Nat → s:0'
Lemmas:
length1(gen_cons:nil3_0(n57_0)) → gen_s:0'4_0(n57_0), rt ∈ Ω(1 + n570)
Generator Equations:
gen_cons:nil3_0(0) ⇔ nil
gen_cons:nil3_0(+(x, 1)) ⇔ cons(0', gen_cons:nil3_0(x))
gen_s:0'4_0(0) ⇔ 0'
gen_s:0'4_0(+(x, 1)) ⇔ s(gen_s:0'4_0(x))
No more defined symbols left to analyse.
(17) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
length1(gen_cons:nil3_0(n57_0)) → gen_s:0'4_0(n57_0), rt ∈ Ω(1 + n570)
(18) BOUNDS(n^1, INF)