KILLEDRuntime Complexity (innermost) proof of /tmp/tmpKHi7od/inssort_better.xml
The Runtime Complexity (innermost) of the given CpxRelTRS could be proven to be BOUNDS(n^1, INF).0 CpxRelTRS↳1 DecreasingLoopProof (⇔, 890 ms)↳2 BOUNDS(n^1, INF)↳3 RenamingProof (⇔, 0 ms)↳4 CpxRelTRS↳5 TypeInferenceProof (BOTH BOUNDS(ID, ID), 0 ms)↳6 typed CpxTrs↳7 OrderProof (LOWER BOUND(ID), 0 ms)↳8 typed CpxTrs↳9 RewriteLemmaProof (LOWER BOUND(ID), 342 ms)↳10 BEST↳11 typed CpxTrs↳12 typed CpxTrs(0) Obligation:
Runtime Complexity Relative TRS:
The TRS R consists of the following rules:
isort(Cons(x, xs), r) → isort(xs, insert(x, r))
insert(x', Cons(x, xs)) → insert[Ite][False][Ite](<(x', x), x', Cons(x, xs))
isort(Nil, r) → r
insert(x, Nil) → Cons(x, Nil)
inssort(xs) → isort(xs, Nil)
The (relative) TRS S consists of the following rules:
<(S(x), S(y)) → <(x, y)
<(0, S(y)) → True
<(x, 0) → False
insert[Ite][False][Ite](False, x', Cons(x, xs)) → Cons(x, insert(x', xs))
insert[Ite][False][Ite](True, x, r) → Cons(x, r)
Rewrite Strategy: INNERMOST(1) DecreasingLoopProof (EQUIVALENT transformation)
The following loop(s) give(s) rise to the lower bound Ω(n1):
The rewrite sequence
isort(Cons(x, xs), r) →+ isort(xs, insert(x, r))
gives rise to a decreasing loop by considering the right hand sides subterm at position [].
The pumping substitution is [xs / Cons(x, xs)].
The result substitution is [r / insert(x, r)].(2) BOUNDS(n^1, INF)
(3) RenamingProof (EQUIVALENT transformation)
Renamed function symbols to avoid clashes with predefined symbol.(4) Obligation:
Runtime Complexity Relative TRS:
The TRS R consists of the following rules:
isort(Cons(x, xs), r) → isort(xs, insert(x, r))
insert(x', Cons(x, xs)) → insert[Ite][False][Ite](<(x', x), x', Cons(x, xs))
isort(Nil, r) → r
insert(x, Nil) → Cons(x, Nil)
inssort(xs) → isort(xs, Nil)
The (relative) TRS S consists of the following rules:
<(S(x), S(y)) → <(x, y)
<(0', S(y)) → True
<(x, 0') → False
insert[Ite][False][Ite](False, x', Cons(x, xs)) → Cons(x, insert(x', xs))
insert[Ite][False][Ite](True, x, r) → Cons(x, r)
Rewrite Strategy: INNERMOST(5) TypeInferenceProof (BOTH BOUNDS(ID, ID) transformation)
Infered types.(6) Obligation:
Innermost TRS:
Rules:
isort(Cons(x, xs), r) → isort(xs, insert(x, r))
insert(x', Cons(x, xs)) → insert[Ite][False][Ite](<(x', x), x', Cons(x, xs))
isort(Nil, r) → r
insert(x, Nil) → Cons(x, Nil)
inssort(xs) → isort(xs, Nil)
<(S(x), S(y)) → <(x, y)
<(0', S(y)) → True
<(x, 0') → False
insert[Ite][False][Ite](False, x', Cons(x, xs)) → Cons(x, insert(x', xs))
insert[Ite][False][Ite](True, x, r) → Cons(x, r)
Types:
isort :: Cons:Nil → Cons:Nil → Cons:Nil
Cons :: S:0' → Cons:Nil → Cons:Nil
insert :: S:0' → Cons:Nil → Cons:Nil
insert[Ite][False][Ite] :: True:False → S:0' → Cons:Nil → Cons:Nil
< :: S:0' → S:0' → True:False
Nil :: Cons:Nil
inssort :: Cons:Nil → Cons:Nil
S :: S:0' → S:0'
0' :: S:0'
True :: True:False
False :: True:False
hole_Cons:Nil1_0 :: Cons:Nil
hole_S:0'2_0 :: S:0'
hole_True:False3_0 :: True:False
gen_Cons:Nil4_0 :: Nat → Cons:Nil
gen_S:0'5_0 :: Nat → S:0'(7) OrderProof (LOWER BOUND(ID) transformation)
Heuristically decided to analyse the following defined symbols:
isort, insert, <They will be analysed ascendingly in the following order:
insert < isort
< < insert(8) Obligation:
Innermost TRS:
Rules:
isort(Cons(x, xs), r) → isort(xs, insert(x, r))
insert(x', Cons(x, xs)) → insert[Ite][False][Ite](<(x', x), x', Cons(x, xs))
isort(Nil, r) → r
insert(x, Nil) → Cons(x, Nil)
inssort(xs) → isort(xs, Nil)
<(S(x), S(y)) → <(x, y)
<(0', S(y)) → True
<(x, 0') → False
insert[Ite][False][Ite](False, x', Cons(x, xs)) → Cons(x, insert(x', xs))
insert[Ite][False][Ite](True, x, r) → Cons(x, r)
Types:
isort :: Cons:Nil → Cons:Nil → Cons:Nil
Cons :: S:0' → Cons:Nil → Cons:Nil
insert :: S:0' → Cons:Nil → Cons:Nil
insert[Ite][False][Ite] :: True:False → S:0' → Cons:Nil → Cons:Nil
< :: S:0' → S:0' → True:False
Nil :: Cons:Nil
inssort :: Cons:Nil → Cons:Nil
S :: S:0' → S:0'
0' :: S:0'
True :: True:False
False :: True:False
hole_Cons:Nil1_0 :: Cons:Nil
hole_S:0'2_0 :: S:0'
hole_True:False3_0 :: True:False
gen_Cons:Nil4_0 :: Nat → Cons:Nil
gen_S:0'5_0 :: Nat → S:0'Generator Equations:
gen_Cons:Nil4_0(0) ⇔ Nil
gen_Cons:Nil4_0(+(x, 1)) ⇔ Cons(0', gen_Cons:Nil4_0(x))
gen_S:0'5_0(0) ⇔ 0'
gen_S:0'5_0(+(x, 1)) ⇔ S(gen_S:0'5_0(x))The following defined symbols remain to be analysed:
<, isort, insertThey will be analysed ascendingly in the following order:
insert < isort
< < insert(9) RewriteLemmaProof (LOWER BOUND(ID) transformation)
Proved the following rewrite lemma:
<(gen_S:0'5_0(n7_0), gen_S:0'5_0(+(1, n7_0))) → True, rt ∈ Ω(0)Induction Base:
<(gen_S:0'5_0(0), gen_S:0'5_0(+(1, 0))) →RΩ(0)
TrueInduction Step:
<(gen_S:0'5_0(+(n7_0, 1)), gen_S:0'5_0(+(1, +(n7_0, 1)))) →RΩ(0)
<(gen_S:0'5_0(n7_0), gen_S:0'5_0(+(1, n7_0))) →IH
TrueWe have rt ∈ Ω(1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n0).
(10) Complex Obligation (BEST)
(11) Obligation:
Innermost TRS:
Rules:
isort(Cons(x, xs), r) → isort(xs, insert(x, r))
insert(x', Cons(x, xs)) → insert[Ite][False][Ite](<(x', x), x', Cons(x, xs))
isort(Nil, r) → r
insert(x, Nil) → Cons(x, Nil)
inssort(xs) → isort(xs, Nil)
<(S(x), S(y)) → <(x, y)
<(0', S(y)) → True
<(x, 0') → False
insert[Ite][False][Ite](False, x', Cons(x, xs)) → Cons(x, insert(x', xs))
insert[Ite][False][Ite](True, x, r) → Cons(x, r)
Types:
isort :: Cons:Nil → Cons:Nil → Cons:Nil
Cons :: S:0' → Cons:Nil → Cons:Nil
insert :: S:0' → Cons:Nil → Cons:Nil
insert[Ite][False][Ite] :: True:False → S:0' → Cons:Nil → Cons:Nil
< :: S:0' → S:0' → True:False
Nil :: Cons:Nil
inssort :: Cons:Nil → Cons:Nil
S :: S:0' → S:0'
0' :: S:0'
True :: True:False
False :: True:False
hole_Cons:Nil1_0 :: Cons:Nil
hole_S:0'2_0 :: S:0'
hole_True:False3_0 :: True:False
gen_Cons:Nil4_0 :: Nat → Cons:Nil
gen_S:0'5_0 :: Nat → S:0'Lemmas:
<(gen_S:0'5_0(n7_0), gen_S:0'5_0(+(1, n7_0))) → True, rt ∈ Ω(0)Generator Equations:
gen_Cons:Nil4_0(0) ⇔ Nil
gen_Cons:Nil4_0(+(x, 1)) ⇔ Cons(0', gen_Cons:Nil4_0(x))
gen_S:0'5_0(0) ⇔ 0'
gen_S:0'5_0(+(x, 1)) ⇔ S(gen_S:0'5_0(x))The following defined symbols remain to be analysed:
insert, isortThey will be analysed ascendingly in the following order:
insert < isort(12) Obligation:
Innermost TRS:
Rules:
isort(Cons(x, xs), r) → isort(xs, insert(x, r))
insert(x', Cons(x, xs)) → insert[Ite][False][Ite](<(x', x), x', Cons(x, xs))
isort(Nil, r) → r
insert(x, Nil) → Cons(x, Nil)
inssort(xs) → isort(xs, Nil)
<(S(x), S(y)) → <(x, y)
<(0', S(y)) → True
<(x, 0') → False
insert[Ite][False][Ite](False, x', Cons(x, xs)) → Cons(x, insert(x', xs))
insert[Ite][False][Ite](True, x, r) → Cons(x, r)
Types:
isort :: Cons:Nil → Cons:Nil → Cons:Nil
Cons :: S:0' → Cons:Nil → Cons:Nil
insert :: S:0' → Cons:Nil → Cons:Nil
insert[Ite][False][Ite] :: True:False → S:0' → Cons:Nil → Cons:Nil
< :: S:0' → S:0' → True:False
Nil :: Cons:Nil
inssort :: Cons:Nil → Cons:Nil
S :: S:0' → S:0'
0' :: S:0'
True :: True:False
False :: True:False
hole_Cons:Nil1_0 :: Cons:Nil
hole_S:0'2_0 :: S:0'
hole_True:False3_0 :: True:False
gen_Cons:Nil4_0 :: Nat → Cons:Nil
gen_S:0'5_0 :: Nat → S:0'Lemmas:
<(gen_S:0'5_0(n7_0), gen_S:0'5_0(+(1, n7_0))) → True, rt ∈ Ω(0)Generator Equations:
gen_Cons:Nil4_0(0) ⇔ Nil
gen_Cons:Nil4_0(+(x, 1)) ⇔ Cons(0', gen_Cons:Nil4_0(x))
gen_S:0'5_0(0) ⇔ 0'
gen_S:0'5_0(+(x, 1)) ⇔ S(gen_S:0'5_0(x))No more defined symbols left to analyse.