(0) Obligation:
Runtime Complexity Relative TRS:
The TRS R consists of the following rules:
mergesort(Cons(x', Cons(x, xs))) → splitmerge(Cons(x', Cons(x, xs)), Nil, Nil)
mergesort(Cons(x, Nil)) → Cons(x, Nil)
merge(Cons(x', xs'), Cons(x, xs)) → merge[Ite](<=(x', x), Cons(x', xs'), Cons(x, xs))
merge(Cons(x, xs), Nil) → Cons(x, xs)
splitmerge(Cons(x, xs), xs1, xs2) → splitmerge(xs, Cons(x, xs2), xs1)
splitmerge(Nil, xs1, xs2) → merge(mergesort(xs1), mergesort(xs2))
mergesort(Nil) → Nil
merge(Nil, xs2) → xs2
notEmpty(Cons(x, xs)) → True
notEmpty(Nil) → False
goal(xs) → mergesort(xs)
The (relative) TRS S consists of the following rules:
<=(S(x), S(y)) → <=(x, y)
<=(0, y) → True
<=(S(x), 0) → False
merge[Ite](False, xs1, Cons(x, xs)) → Cons(x, merge(xs1, xs))
merge[Ite](True, Cons(x, xs), xs2) → Cons(x, merge(xs, xs2))
Rewrite Strategy: INNERMOST
(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:
mergesort(Cons(x', Cons(x, xs))) → splitmerge(Cons(x', Cons(x, xs)), Nil, Nil)
mergesort(Cons(x, Nil)) → Cons(x, Nil)
merge(Cons(x', xs'), Cons(x, xs)) → merge[Ite](<=(x', x), Cons(x', xs'), Cons(x, xs))
merge(Cons(x, xs), Nil) → Cons(x, xs)
splitmerge(Cons(x, xs), xs1, xs2) → splitmerge(xs, Cons(x, xs2), xs1)
splitmerge(Nil, xs1, xs2) → merge(mergesort(xs1), mergesort(xs2))
mergesort(Nil) → Nil
merge(Nil, xs2) → xs2
notEmpty(Cons(x, xs)) → True
notEmpty(Nil) → False
goal(xs) → mergesort(xs)
The (relative) TRS S consists of the following rules:
<=(S(x), S(y)) → <=(x, y)
<=(0', y) → True
<=(S(x), 0') → False
merge[Ite](False, xs1, Cons(x, xs)) → Cons(x, merge(xs1, xs))
merge[Ite](True, Cons(x, xs), xs2) → Cons(x, merge(xs, xs2))
Rewrite Strategy: INNERMOST
(3) TypeInferenceProof (BOTH BOUNDS(ID, ID) transformation)
Infered types.
(4) Obligation:
Innermost TRS:
Rules:
mergesort(Cons(x', Cons(x, xs))) → splitmerge(Cons(x', Cons(x, xs)), Nil, Nil)
mergesort(Cons(x, Nil)) → Cons(x, Nil)
merge(Cons(x', xs'), Cons(x, xs)) → merge[Ite](<=(x', x), Cons(x', xs'), Cons(x, xs))
merge(Cons(x, xs), Nil) → Cons(x, xs)
splitmerge(Cons(x, xs), xs1, xs2) → splitmerge(xs, Cons(x, xs2), xs1)
splitmerge(Nil, xs1, xs2) → merge(mergesort(xs1), mergesort(xs2))
mergesort(Nil) → Nil
merge(Nil, xs2) → xs2
notEmpty(Cons(x, xs)) → True
notEmpty(Nil) → False
goal(xs) → mergesort(xs)
<=(S(x), S(y)) → <=(x, y)
<=(0', y) → True
<=(S(x), 0') → False
merge[Ite](False, xs1, Cons(x, xs)) → Cons(x, merge(xs1, xs))
merge[Ite](True, Cons(x, xs), xs2) → Cons(x, merge(xs, xs2))
Types:
mergesort :: Cons:Nil → Cons:Nil
Cons :: S:0' → Cons:Nil → Cons:Nil
splitmerge :: Cons:Nil → Cons:Nil → Cons:Nil → Cons:Nil
Nil :: Cons:Nil
merge :: Cons:Nil → Cons:Nil → Cons:Nil
merge[Ite] :: True:False → Cons:Nil → Cons:Nil → Cons:Nil
<= :: S:0' → S:0' → True:False
notEmpty :: Cons:Nil → True:False
True :: True:False
False :: True:False
goal :: Cons:Nil → Cons:Nil
S :: S:0' → S:0'
0' :: S:0'
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'
(5) OrderProof (LOWER BOUND(ID) transformation)
Heuristically decided to analyse the following defined symbols:
mergesort,
splitmerge,
merge,
<=They will be analysed ascendingly in the following order:
mergesort = splitmerge
merge < splitmerge
<= < merge
(6) Obligation:
Innermost TRS:
Rules:
mergesort(
Cons(
x',
Cons(
x,
xs))) →
splitmerge(
Cons(
x',
Cons(
x,
xs)),
Nil,
Nil)
mergesort(
Cons(
x,
Nil)) →
Cons(
x,
Nil)
merge(
Cons(
x',
xs'),
Cons(
x,
xs)) →
merge[Ite](
<=(
x',
x),
Cons(
x',
xs'),
Cons(
x,
xs))
merge(
Cons(
x,
xs),
Nil) →
Cons(
x,
xs)
splitmerge(
Cons(
x,
xs),
xs1,
xs2) →
splitmerge(
xs,
Cons(
x,
xs2),
xs1)
splitmerge(
Nil,
xs1,
xs2) →
merge(
mergesort(
xs1),
mergesort(
xs2))
mergesort(
Nil) →
Nilmerge(
Nil,
xs2) →
xs2notEmpty(
Cons(
x,
xs)) →
TruenotEmpty(
Nil) →
Falsegoal(
xs) →
mergesort(
xs)
<=(
S(
x),
S(
y)) →
<=(
x,
y)
<=(
0',
y) →
True<=(
S(
x),
0') →
Falsemerge[Ite](
False,
xs1,
Cons(
x,
xs)) →
Cons(
x,
merge(
xs1,
xs))
merge[Ite](
True,
Cons(
x,
xs),
xs2) →
Cons(
x,
merge(
xs,
xs2))
Types:
mergesort :: Cons:Nil → Cons:Nil
Cons :: S:0' → Cons:Nil → Cons:Nil
splitmerge :: Cons:Nil → Cons:Nil → Cons:Nil → Cons:Nil
Nil :: Cons:Nil
merge :: Cons:Nil → Cons:Nil → Cons:Nil
merge[Ite] :: True:False → Cons:Nil → Cons:Nil → Cons:Nil
<= :: S:0' → S:0' → True:False
notEmpty :: Cons:Nil → True:False
True :: True:False
False :: True:False
goal :: Cons:Nil → Cons:Nil
S :: S:0' → S:0'
0' :: S:0'
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:
<=, mergesort, splitmerge, merge
They will be analysed ascendingly in the following order:
mergesort = splitmerge
merge < splitmerge
<= < merge
(7) RewriteLemmaProof (LOWER BOUND(ID) transformation)
Proved the following rewrite lemma:
<=(
gen_S:0'5_0(
n7_0),
gen_S:0'5_0(
n7_0)) →
True, rt ∈ Ω(0)
Induction Base:
<=(gen_S:0'5_0(0), gen_S:0'5_0(0)) →RΩ(0)
True
Induction Step:
<=(gen_S:0'5_0(+(n7_0, 1)), gen_S:0'5_0(+(n7_0, 1))) →RΩ(0)
<=(gen_S:0'5_0(n7_0), gen_S:0'5_0(n7_0)) →IH
True
We have rt ∈ Ω(1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n0).
(8) Complex Obligation (BEST)
(9) Obligation:
Innermost TRS:
Rules:
mergesort(
Cons(
x',
Cons(
x,
xs))) →
splitmerge(
Cons(
x',
Cons(
x,
xs)),
Nil,
Nil)
mergesort(
Cons(
x,
Nil)) →
Cons(
x,
Nil)
merge(
Cons(
x',
xs'),
Cons(
x,
xs)) →
merge[Ite](
<=(
x',
x),
Cons(
x',
xs'),
Cons(
x,
xs))
merge(
Cons(
x,
xs),
Nil) →
Cons(
x,
xs)
splitmerge(
Cons(
x,
xs),
xs1,
xs2) →
splitmerge(
xs,
Cons(
x,
xs2),
xs1)
splitmerge(
Nil,
xs1,
xs2) →
merge(
mergesort(
xs1),
mergesort(
xs2))
mergesort(
Nil) →
Nilmerge(
Nil,
xs2) →
xs2notEmpty(
Cons(
x,
xs)) →
TruenotEmpty(
Nil) →
Falsegoal(
xs) →
mergesort(
xs)
<=(
S(
x),
S(
y)) →
<=(
x,
y)
<=(
0',
y) →
True<=(
S(
x),
0') →
Falsemerge[Ite](
False,
xs1,
Cons(
x,
xs)) →
Cons(
x,
merge(
xs1,
xs))
merge[Ite](
True,
Cons(
x,
xs),
xs2) →
Cons(
x,
merge(
xs,
xs2))
Types:
mergesort :: Cons:Nil → Cons:Nil
Cons :: S:0' → Cons:Nil → Cons:Nil
splitmerge :: Cons:Nil → Cons:Nil → Cons:Nil → Cons:Nil
Nil :: Cons:Nil
merge :: Cons:Nil → Cons:Nil → Cons:Nil
merge[Ite] :: True:False → Cons:Nil → Cons:Nil → Cons:Nil
<= :: S:0' → S:0' → True:False
notEmpty :: Cons:Nil → True:False
True :: True:False
False :: True:False
goal :: Cons:Nil → Cons:Nil
S :: S:0' → S:0'
0' :: S:0'
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(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:
merge, mergesort, splitmerge
They will be analysed ascendingly in the following order:
mergesort = splitmerge
merge < splitmerge
(10) RewriteLemmaProof (LOWER BOUND(ID) transformation)
Proved the following rewrite lemma:
merge(
gen_Cons:Nil4_0(
n282_0),
gen_Cons:Nil4_0(
1)) →
gen_Cons:Nil4_0(
+(
1,
n282_0)), rt ∈ Ω(1 + n282
0)
Induction Base:
merge(gen_Cons:Nil4_0(0), gen_Cons:Nil4_0(1)) →RΩ(1)
gen_Cons:Nil4_0(1)
Induction Step:
merge(gen_Cons:Nil4_0(+(n282_0, 1)), gen_Cons:Nil4_0(1)) →RΩ(1)
merge[Ite](<=(0', 0'), Cons(0', gen_Cons:Nil4_0(n282_0)), Cons(0', gen_Cons:Nil4_0(0))) →LΩ(0)
merge[Ite](True, Cons(0', gen_Cons:Nil4_0(n282_0)), Cons(0', gen_Cons:Nil4_0(0))) →RΩ(0)
Cons(0', merge(gen_Cons:Nil4_0(n282_0), Cons(0', gen_Cons:Nil4_0(0)))) →IH
Cons(0', gen_Cons:Nil4_0(+(1, c283_0)))
We have rt ∈ Ω(n1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
(11) Complex Obligation (BEST)
(12) Obligation:
Innermost TRS:
Rules:
mergesort(
Cons(
x',
Cons(
x,
xs))) →
splitmerge(
Cons(
x',
Cons(
x,
xs)),
Nil,
Nil)
mergesort(
Cons(
x,
Nil)) →
Cons(
x,
Nil)
merge(
Cons(
x',
xs'),
Cons(
x,
xs)) →
merge[Ite](
<=(
x',
x),
Cons(
x',
xs'),
Cons(
x,
xs))
merge(
Cons(
x,
xs),
Nil) →
Cons(
x,
xs)
splitmerge(
Cons(
x,
xs),
xs1,
xs2) →
splitmerge(
xs,
Cons(
x,
xs2),
xs1)
splitmerge(
Nil,
xs1,
xs2) →
merge(
mergesort(
xs1),
mergesort(
xs2))
mergesort(
Nil) →
Nilmerge(
Nil,
xs2) →
xs2notEmpty(
Cons(
x,
xs)) →
TruenotEmpty(
Nil) →
Falsegoal(
xs) →
mergesort(
xs)
<=(
S(
x),
S(
y)) →
<=(
x,
y)
<=(
0',
y) →
True<=(
S(
x),
0') →
Falsemerge[Ite](
False,
xs1,
Cons(
x,
xs)) →
Cons(
x,
merge(
xs1,
xs))
merge[Ite](
True,
Cons(
x,
xs),
xs2) →
Cons(
x,
merge(
xs,
xs2))
Types:
mergesort :: Cons:Nil → Cons:Nil
Cons :: S:0' → Cons:Nil → Cons:Nil
splitmerge :: Cons:Nil → Cons:Nil → Cons:Nil → Cons:Nil
Nil :: Cons:Nil
merge :: Cons:Nil → Cons:Nil → Cons:Nil
merge[Ite] :: True:False → Cons:Nil → Cons:Nil → Cons:Nil
<= :: S:0' → S:0' → True:False
notEmpty :: Cons:Nil → True:False
True :: True:False
False :: True:False
goal :: Cons:Nil → Cons:Nil
S :: S:0' → S:0'
0' :: S:0'
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(n7_0)) → True, rt ∈ Ω(0)
merge(gen_Cons:Nil4_0(n282_0), gen_Cons:Nil4_0(1)) → gen_Cons:Nil4_0(+(1, n282_0)), rt ∈ Ω(1 + n2820)
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:
splitmerge, mergesort
They will be analysed ascendingly in the following order:
mergesort = splitmerge
(13) NoRewriteLemmaProof (LOWER BOUND(ID) transformation)
Could not prove a rewrite lemma for the defined symbol splitmerge.
(14) Obligation:
Innermost TRS:
Rules:
mergesort(
Cons(
x',
Cons(
x,
xs))) →
splitmerge(
Cons(
x',
Cons(
x,
xs)),
Nil,
Nil)
mergesort(
Cons(
x,
Nil)) →
Cons(
x,
Nil)
merge(
Cons(
x',
xs'),
Cons(
x,
xs)) →
merge[Ite](
<=(
x',
x),
Cons(
x',
xs'),
Cons(
x,
xs))
merge(
Cons(
x,
xs),
Nil) →
Cons(
x,
xs)
splitmerge(
Cons(
x,
xs),
xs1,
xs2) →
splitmerge(
xs,
Cons(
x,
xs2),
xs1)
splitmerge(
Nil,
xs1,
xs2) →
merge(
mergesort(
xs1),
mergesort(
xs2))
mergesort(
Nil) →
Nilmerge(
Nil,
xs2) →
xs2notEmpty(
Cons(
x,
xs)) →
TruenotEmpty(
Nil) →
Falsegoal(
xs) →
mergesort(
xs)
<=(
S(
x),
S(
y)) →
<=(
x,
y)
<=(
0',
y) →
True<=(
S(
x),
0') →
Falsemerge[Ite](
False,
xs1,
Cons(
x,
xs)) →
Cons(
x,
merge(
xs1,
xs))
merge[Ite](
True,
Cons(
x,
xs),
xs2) →
Cons(
x,
merge(
xs,
xs2))
Types:
mergesort :: Cons:Nil → Cons:Nil
Cons :: S:0' → Cons:Nil → Cons:Nil
splitmerge :: Cons:Nil → Cons:Nil → Cons:Nil → Cons:Nil
Nil :: Cons:Nil
merge :: Cons:Nil → Cons:Nil → Cons:Nil
merge[Ite] :: True:False → Cons:Nil → Cons:Nil → Cons:Nil
<= :: S:0' → S:0' → True:False
notEmpty :: Cons:Nil → True:False
True :: True:False
False :: True:False
goal :: Cons:Nil → Cons:Nil
S :: S:0' → S:0'
0' :: S:0'
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(n7_0)) → True, rt ∈ Ω(0)
merge(gen_Cons:Nil4_0(n282_0), gen_Cons:Nil4_0(1)) → gen_Cons:Nil4_0(+(1, n282_0)), rt ∈ Ω(1 + n2820)
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:
mergesort
They will be analysed ascendingly in the following order:
mergesort = splitmerge
(15) NoRewriteLemmaProof (LOWER BOUND(ID) transformation)
Could not prove a rewrite lemma for the defined symbol mergesort.
(16) Obligation:
Innermost TRS:
Rules:
mergesort(
Cons(
x',
Cons(
x,
xs))) →
splitmerge(
Cons(
x',
Cons(
x,
xs)),
Nil,
Nil)
mergesort(
Cons(
x,
Nil)) →
Cons(
x,
Nil)
merge(
Cons(
x',
xs'),
Cons(
x,
xs)) →
merge[Ite](
<=(
x',
x),
Cons(
x',
xs'),
Cons(
x,
xs))
merge(
Cons(
x,
xs),
Nil) →
Cons(
x,
xs)
splitmerge(
Cons(
x,
xs),
xs1,
xs2) →
splitmerge(
xs,
Cons(
x,
xs2),
xs1)
splitmerge(
Nil,
xs1,
xs2) →
merge(
mergesort(
xs1),
mergesort(
xs2))
mergesort(
Nil) →
Nilmerge(
Nil,
xs2) →
xs2notEmpty(
Cons(
x,
xs)) →
TruenotEmpty(
Nil) →
Falsegoal(
xs) →
mergesort(
xs)
<=(
S(
x),
S(
y)) →
<=(
x,
y)
<=(
0',
y) →
True<=(
S(
x),
0') →
Falsemerge[Ite](
False,
xs1,
Cons(
x,
xs)) →
Cons(
x,
merge(
xs1,
xs))
merge[Ite](
True,
Cons(
x,
xs),
xs2) →
Cons(
x,
merge(
xs,
xs2))
Types:
mergesort :: Cons:Nil → Cons:Nil
Cons :: S:0' → Cons:Nil → Cons:Nil
splitmerge :: Cons:Nil → Cons:Nil → Cons:Nil → Cons:Nil
Nil :: Cons:Nil
merge :: Cons:Nil → Cons:Nil → Cons:Nil
merge[Ite] :: True:False → Cons:Nil → Cons:Nil → Cons:Nil
<= :: S:0' → S:0' → True:False
notEmpty :: Cons:Nil → True:False
True :: True:False
False :: True:False
goal :: Cons:Nil → Cons:Nil
S :: S:0' → S:0'
0' :: S:0'
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(n7_0)) → True, rt ∈ Ω(0)
merge(gen_Cons:Nil4_0(n282_0), gen_Cons:Nil4_0(1)) → gen_Cons:Nil4_0(+(1, n282_0)), rt ∈ Ω(1 + n2820)
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.
(17) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
merge(gen_Cons:Nil4_0(n282_0), gen_Cons:Nil4_0(1)) → gen_Cons:Nil4_0(+(1, n282_0)), rt ∈ Ω(1 + n2820)
(18) BOUNDS(n^1, INF)
(19) Obligation:
Innermost TRS:
Rules:
mergesort(
Cons(
x',
Cons(
x,
xs))) →
splitmerge(
Cons(
x',
Cons(
x,
xs)),
Nil,
Nil)
mergesort(
Cons(
x,
Nil)) →
Cons(
x,
Nil)
merge(
Cons(
x',
xs'),
Cons(
x,
xs)) →
merge[Ite](
<=(
x',
x),
Cons(
x',
xs'),
Cons(
x,
xs))
merge(
Cons(
x,
xs),
Nil) →
Cons(
x,
xs)
splitmerge(
Cons(
x,
xs),
xs1,
xs2) →
splitmerge(
xs,
Cons(
x,
xs2),
xs1)
splitmerge(
Nil,
xs1,
xs2) →
merge(
mergesort(
xs1),
mergesort(
xs2))
mergesort(
Nil) →
Nilmerge(
Nil,
xs2) →
xs2notEmpty(
Cons(
x,
xs)) →
TruenotEmpty(
Nil) →
Falsegoal(
xs) →
mergesort(
xs)
<=(
S(
x),
S(
y)) →
<=(
x,
y)
<=(
0',
y) →
True<=(
S(
x),
0') →
Falsemerge[Ite](
False,
xs1,
Cons(
x,
xs)) →
Cons(
x,
merge(
xs1,
xs))
merge[Ite](
True,
Cons(
x,
xs),
xs2) →
Cons(
x,
merge(
xs,
xs2))
Types:
mergesort :: Cons:Nil → Cons:Nil
Cons :: S:0' → Cons:Nil → Cons:Nil
splitmerge :: Cons:Nil → Cons:Nil → Cons:Nil → Cons:Nil
Nil :: Cons:Nil
merge :: Cons:Nil → Cons:Nil → Cons:Nil
merge[Ite] :: True:False → Cons:Nil → Cons:Nil → Cons:Nil
<= :: S:0' → S:0' → True:False
notEmpty :: Cons:Nil → True:False
True :: True:False
False :: True:False
goal :: Cons:Nil → Cons:Nil
S :: S:0' → S:0'
0' :: S:0'
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(n7_0)) → True, rt ∈ Ω(0)
merge(gen_Cons:Nil4_0(n282_0), gen_Cons:Nil4_0(1)) → gen_Cons:Nil4_0(+(1, n282_0)), rt ∈ Ω(1 + n2820)
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.
(20) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
merge(gen_Cons:Nil4_0(n282_0), gen_Cons:Nil4_0(1)) → gen_Cons:Nil4_0(+(1, n282_0)), rt ∈ Ω(1 + n2820)
(21) BOUNDS(n^1, INF)
(22) Obligation:
Innermost TRS:
Rules:
mergesort(
Cons(
x',
Cons(
x,
xs))) →
splitmerge(
Cons(
x',
Cons(
x,
xs)),
Nil,
Nil)
mergesort(
Cons(
x,
Nil)) →
Cons(
x,
Nil)
merge(
Cons(
x',
xs'),
Cons(
x,
xs)) →
merge[Ite](
<=(
x',
x),
Cons(
x',
xs'),
Cons(
x,
xs))
merge(
Cons(
x,
xs),
Nil) →
Cons(
x,
xs)
splitmerge(
Cons(
x,
xs),
xs1,
xs2) →
splitmerge(
xs,
Cons(
x,
xs2),
xs1)
splitmerge(
Nil,
xs1,
xs2) →
merge(
mergesort(
xs1),
mergesort(
xs2))
mergesort(
Nil) →
Nilmerge(
Nil,
xs2) →
xs2notEmpty(
Cons(
x,
xs)) →
TruenotEmpty(
Nil) →
Falsegoal(
xs) →
mergesort(
xs)
<=(
S(
x),
S(
y)) →
<=(
x,
y)
<=(
0',
y) →
True<=(
S(
x),
0') →
Falsemerge[Ite](
False,
xs1,
Cons(
x,
xs)) →
Cons(
x,
merge(
xs1,
xs))
merge[Ite](
True,
Cons(
x,
xs),
xs2) →
Cons(
x,
merge(
xs,
xs2))
Types:
mergesort :: Cons:Nil → Cons:Nil
Cons :: S:0' → Cons:Nil → Cons:Nil
splitmerge :: Cons:Nil → Cons:Nil → Cons:Nil → Cons:Nil
Nil :: Cons:Nil
merge :: Cons:Nil → Cons:Nil → Cons:Nil
merge[Ite] :: True:False → Cons:Nil → Cons:Nil → Cons:Nil
<= :: S:0' → S:0' → True:False
notEmpty :: Cons:Nil → True:False
True :: True:False
False :: True:False
goal :: Cons:Nil → Cons:Nil
S :: S:0' → S:0'
0' :: S:0'
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(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.
(23) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(1) was proven with the following lemma:
<=(gen_S:0'5_0(n7_0), gen_S:0'5_0(n7_0)) → True, rt ∈ Ω(0)
(24) BOUNDS(1, INF)