(0) Obligation:
Runtime Complexity TRS:
The TRS R consists of the following rules:
qsort(nil) → nil
qsort(cons(x, xs)) → append(qsort(filterlow(last(cons(x, xs)), cons(x, xs))), cons(last(cons(x, xs)), qsort(filterhigh(last(cons(x, xs)), cons(x, xs)))))
filterlow(n, nil) → nil
filterlow(n, cons(x, xs)) → if1(ge(n, x), n, x, xs)
if1(true, n, x, xs) → filterlow(n, xs)
if1(false, n, x, xs) → cons(x, filterlow(n, xs))
filterhigh(n, nil) → nil
filterhigh(n, cons(x, xs)) → if2(ge(x, n), n, x, xs)
if2(true, n, x, xs) → filterhigh(n, xs)
if2(false, n, x, xs) → cons(x, filterhigh(n, xs))
ge(x, 0) → true
ge(0, s(x)) → false
ge(s(x), s(y)) → ge(x, y)
append(nil, ys) → ys
append(cons(x, xs), ys) → cons(x, append(xs, ys))
last(nil) → 0
last(cons(x, nil)) → x
last(cons(x, cons(y, xs))) → last(cons(y, xs))
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:
qsort(nil) → nil
qsort(cons(x, xs)) → append(qsort(filterlow(last(cons(x, xs)), cons(x, xs))), cons(last(cons(x, xs)), qsort(filterhigh(last(cons(x, xs)), cons(x, xs)))))
filterlow(n, nil) → nil
filterlow(n, cons(x, xs)) → if1(ge(n, x), n, x, xs)
if1(true, n, x, xs) → filterlow(n, xs)
if1(false, n, x, xs) → cons(x, filterlow(n, xs))
filterhigh(n, nil) → nil
filterhigh(n, cons(x, xs)) → if2(ge(x, n), n, x, xs)
if2(true, n, x, xs) → filterhigh(n, xs)
if2(false, n, x, xs) → cons(x, filterhigh(n, xs))
ge(x, 0') → true
ge(0', s(x)) → false
ge(s(x), s(y)) → ge(x, y)
append(nil, ys) → ys
append(cons(x, xs), ys) → cons(x, append(xs, ys))
last(nil) → 0'
last(cons(x, nil)) → x
last(cons(x, cons(y, xs))) → last(cons(y, xs))
S is empty.
Rewrite Strategy: INNERMOST
(3) TypeInferenceProof (BOTH BOUNDS(ID, ID) transformation)
Infered types.
(4) Obligation:
Innermost TRS:
Rules:
qsort(nil) → nil
qsort(cons(x, xs)) → append(qsort(filterlow(last(cons(x, xs)), cons(x, xs))), cons(last(cons(x, xs)), qsort(filterhigh(last(cons(x, xs)), cons(x, xs)))))
filterlow(n, nil) → nil
filterlow(n, cons(x, xs)) → if1(ge(n, x), n, x, xs)
if1(true, n, x, xs) → filterlow(n, xs)
if1(false, n, x, xs) → cons(x, filterlow(n, xs))
filterhigh(n, nil) → nil
filterhigh(n, cons(x, xs)) → if2(ge(x, n), n, x, xs)
if2(true, n, x, xs) → filterhigh(n, xs)
if2(false, n, x, xs) → cons(x, filterhigh(n, xs))
ge(x, 0') → true
ge(0', s(x)) → false
ge(s(x), s(y)) → ge(x, y)
append(nil, ys) → ys
append(cons(x, xs), ys) → cons(x, append(xs, ys))
last(nil) → 0'
last(cons(x, nil)) → x
last(cons(x, cons(y, xs))) → last(cons(y, xs))
Types:
qsort :: nil:cons:ys → nil:cons:ys
nil :: nil:cons:ys
cons :: 0':s → nil:cons:ys → nil:cons:ys
append :: nil:cons:ys → nil:cons:ys → nil:cons:ys
filterlow :: 0':s → nil:cons:ys → nil:cons:ys
last :: nil:cons:ys → 0':s
filterhigh :: 0':s → nil:cons:ys → nil:cons:ys
if1 :: true:false → 0':s → 0':s → nil:cons:ys → nil:cons:ys
ge :: 0':s → 0':s → true:false
true :: true:false
false :: true:false
if2 :: true:false → 0':s → 0':s → nil:cons:ys → nil:cons:ys
0' :: 0':s
s :: 0':s → 0':s
ys :: nil:cons:ys
hole_nil:cons:ys1_0 :: nil:cons:ys
hole_0':s2_0 :: 0':s
hole_true:false3_0 :: true:false
gen_nil:cons:ys4_0 :: Nat → nil:cons:ys
gen_0':s5_0 :: Nat → 0':s
(5) OrderProof (LOWER BOUND(ID) transformation)
Heuristically decided to analyse the following defined symbols:
qsort,
append,
filterlow,
last,
filterhigh,
geThey will be analysed ascendingly in the following order:
append < qsort
filterlow < qsort
last < qsort
filterhigh < qsort
ge < filterlow
ge < filterhigh
(6) Obligation:
Innermost TRS:
Rules:
qsort(
nil) →
nilqsort(
cons(
x,
xs)) →
append(
qsort(
filterlow(
last(
cons(
x,
xs)),
cons(
x,
xs))),
cons(
last(
cons(
x,
xs)),
qsort(
filterhigh(
last(
cons(
x,
xs)),
cons(
x,
xs)))))
filterlow(
n,
nil) →
nilfilterlow(
n,
cons(
x,
xs)) →
if1(
ge(
n,
x),
n,
x,
xs)
if1(
true,
n,
x,
xs) →
filterlow(
n,
xs)
if1(
false,
n,
x,
xs) →
cons(
x,
filterlow(
n,
xs))
filterhigh(
n,
nil) →
nilfilterhigh(
n,
cons(
x,
xs)) →
if2(
ge(
x,
n),
n,
x,
xs)
if2(
true,
n,
x,
xs) →
filterhigh(
n,
xs)
if2(
false,
n,
x,
xs) →
cons(
x,
filterhigh(
n,
xs))
ge(
x,
0') →
truege(
0',
s(
x)) →
falsege(
s(
x),
s(
y)) →
ge(
x,
y)
append(
nil,
ys) →
ysappend(
cons(
x,
xs),
ys) →
cons(
x,
append(
xs,
ys))
last(
nil) →
0'last(
cons(
x,
nil)) →
xlast(
cons(
x,
cons(
y,
xs))) →
last(
cons(
y,
xs))
Types:
qsort :: nil:cons:ys → nil:cons:ys
nil :: nil:cons:ys
cons :: 0':s → nil:cons:ys → nil:cons:ys
append :: nil:cons:ys → nil:cons:ys → nil:cons:ys
filterlow :: 0':s → nil:cons:ys → nil:cons:ys
last :: nil:cons:ys → 0':s
filterhigh :: 0':s → nil:cons:ys → nil:cons:ys
if1 :: true:false → 0':s → 0':s → nil:cons:ys → nil:cons:ys
ge :: 0':s → 0':s → true:false
true :: true:false
false :: true:false
if2 :: true:false → 0':s → 0':s → nil:cons:ys → nil:cons:ys
0' :: 0':s
s :: 0':s → 0':s
ys :: nil:cons:ys
hole_nil:cons:ys1_0 :: nil:cons:ys
hole_0':s2_0 :: 0':s
hole_true:false3_0 :: true:false
gen_nil:cons:ys4_0 :: Nat → nil:cons:ys
gen_0':s5_0 :: Nat → 0':s
Generator Equations:
gen_nil:cons:ys4_0(0) ⇔ nil
gen_nil:cons:ys4_0(+(x, 1)) ⇔ cons(0', gen_nil:cons:ys4_0(x))
gen_0':s5_0(0) ⇔ 0'
gen_0':s5_0(+(x, 1)) ⇔ s(gen_0':s5_0(x))
The following defined symbols remain to be analysed:
append, qsort, filterlow, last, filterhigh, ge
They will be analysed ascendingly in the following order:
append < qsort
filterlow < qsort
last < qsort
filterhigh < qsort
ge < filterlow
ge < filterhigh
(7) NoRewriteLemmaProof (LOWER BOUND(ID) transformation)
Could not prove a rewrite lemma for the defined symbol append.
(8) Obligation:
Innermost TRS:
Rules:
qsort(
nil) →
nilqsort(
cons(
x,
xs)) →
append(
qsort(
filterlow(
last(
cons(
x,
xs)),
cons(
x,
xs))),
cons(
last(
cons(
x,
xs)),
qsort(
filterhigh(
last(
cons(
x,
xs)),
cons(
x,
xs)))))
filterlow(
n,
nil) →
nilfilterlow(
n,
cons(
x,
xs)) →
if1(
ge(
n,
x),
n,
x,
xs)
if1(
true,
n,
x,
xs) →
filterlow(
n,
xs)
if1(
false,
n,
x,
xs) →
cons(
x,
filterlow(
n,
xs))
filterhigh(
n,
nil) →
nilfilterhigh(
n,
cons(
x,
xs)) →
if2(
ge(
x,
n),
n,
x,
xs)
if2(
true,
n,
x,
xs) →
filterhigh(
n,
xs)
if2(
false,
n,
x,
xs) →
cons(
x,
filterhigh(
n,
xs))
ge(
x,
0') →
truege(
0',
s(
x)) →
falsege(
s(
x),
s(
y)) →
ge(
x,
y)
append(
nil,
ys) →
ysappend(
cons(
x,
xs),
ys) →
cons(
x,
append(
xs,
ys))
last(
nil) →
0'last(
cons(
x,
nil)) →
xlast(
cons(
x,
cons(
y,
xs))) →
last(
cons(
y,
xs))
Types:
qsort :: nil:cons:ys → nil:cons:ys
nil :: nil:cons:ys
cons :: 0':s → nil:cons:ys → nil:cons:ys
append :: nil:cons:ys → nil:cons:ys → nil:cons:ys
filterlow :: 0':s → nil:cons:ys → nil:cons:ys
last :: nil:cons:ys → 0':s
filterhigh :: 0':s → nil:cons:ys → nil:cons:ys
if1 :: true:false → 0':s → 0':s → nil:cons:ys → nil:cons:ys
ge :: 0':s → 0':s → true:false
true :: true:false
false :: true:false
if2 :: true:false → 0':s → 0':s → nil:cons:ys → nil:cons:ys
0' :: 0':s
s :: 0':s → 0':s
ys :: nil:cons:ys
hole_nil:cons:ys1_0 :: nil:cons:ys
hole_0':s2_0 :: 0':s
hole_true:false3_0 :: true:false
gen_nil:cons:ys4_0 :: Nat → nil:cons:ys
gen_0':s5_0 :: Nat → 0':s
Generator Equations:
gen_nil:cons:ys4_0(0) ⇔ nil
gen_nil:cons:ys4_0(+(x, 1)) ⇔ cons(0', gen_nil:cons:ys4_0(x))
gen_0':s5_0(0) ⇔ 0'
gen_0':s5_0(+(x, 1)) ⇔ s(gen_0':s5_0(x))
The following defined symbols remain to be analysed:
last, qsort, filterlow, filterhigh, ge
They will be analysed ascendingly in the following order:
filterlow < qsort
last < qsort
filterhigh < qsort
ge < filterlow
ge < filterhigh
(9) RewriteLemmaProof (LOWER BOUND(ID) transformation)
Proved the following rewrite lemma:
last(
gen_nil:cons:ys4_0(
+(
1,
n19_0))) →
gen_0':s5_0(
0), rt ∈ Ω(1 + n19
0)
Induction Base:
last(gen_nil:cons:ys4_0(+(1, 0))) →RΩ(1)
0'
Induction Step:
last(gen_nil:cons:ys4_0(+(1, +(n19_0, 1)))) →RΩ(1)
last(cons(0', gen_nil:cons:ys4_0(n19_0))) →IH
gen_0':s5_0(0)
We have rt ∈ Ω(n1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
(10) Complex Obligation (BEST)
(11) Obligation:
Innermost TRS:
Rules:
qsort(
nil) →
nilqsort(
cons(
x,
xs)) →
append(
qsort(
filterlow(
last(
cons(
x,
xs)),
cons(
x,
xs))),
cons(
last(
cons(
x,
xs)),
qsort(
filterhigh(
last(
cons(
x,
xs)),
cons(
x,
xs)))))
filterlow(
n,
nil) →
nilfilterlow(
n,
cons(
x,
xs)) →
if1(
ge(
n,
x),
n,
x,
xs)
if1(
true,
n,
x,
xs) →
filterlow(
n,
xs)
if1(
false,
n,
x,
xs) →
cons(
x,
filterlow(
n,
xs))
filterhigh(
n,
nil) →
nilfilterhigh(
n,
cons(
x,
xs)) →
if2(
ge(
x,
n),
n,
x,
xs)
if2(
true,
n,
x,
xs) →
filterhigh(
n,
xs)
if2(
false,
n,
x,
xs) →
cons(
x,
filterhigh(
n,
xs))
ge(
x,
0') →
truege(
0',
s(
x)) →
falsege(
s(
x),
s(
y)) →
ge(
x,
y)
append(
nil,
ys) →
ysappend(
cons(
x,
xs),
ys) →
cons(
x,
append(
xs,
ys))
last(
nil) →
0'last(
cons(
x,
nil)) →
xlast(
cons(
x,
cons(
y,
xs))) →
last(
cons(
y,
xs))
Types:
qsort :: nil:cons:ys → nil:cons:ys
nil :: nil:cons:ys
cons :: 0':s → nil:cons:ys → nil:cons:ys
append :: nil:cons:ys → nil:cons:ys → nil:cons:ys
filterlow :: 0':s → nil:cons:ys → nil:cons:ys
last :: nil:cons:ys → 0':s
filterhigh :: 0':s → nil:cons:ys → nil:cons:ys
if1 :: true:false → 0':s → 0':s → nil:cons:ys → nil:cons:ys
ge :: 0':s → 0':s → true:false
true :: true:false
false :: true:false
if2 :: true:false → 0':s → 0':s → nil:cons:ys → nil:cons:ys
0' :: 0':s
s :: 0':s → 0':s
ys :: nil:cons:ys
hole_nil:cons:ys1_0 :: nil:cons:ys
hole_0':s2_0 :: 0':s
hole_true:false3_0 :: true:false
gen_nil:cons:ys4_0 :: Nat → nil:cons:ys
gen_0':s5_0 :: Nat → 0':s
Lemmas:
last(gen_nil:cons:ys4_0(+(1, n19_0))) → gen_0':s5_0(0), rt ∈ Ω(1 + n190)
Generator Equations:
gen_nil:cons:ys4_0(0) ⇔ nil
gen_nil:cons:ys4_0(+(x, 1)) ⇔ cons(0', gen_nil:cons:ys4_0(x))
gen_0':s5_0(0) ⇔ 0'
gen_0':s5_0(+(x, 1)) ⇔ s(gen_0':s5_0(x))
The following defined symbols remain to be analysed:
ge, qsort, filterlow, filterhigh
They will be analysed ascendingly in the following order:
filterlow < qsort
filterhigh < qsort
ge < filterlow
ge < filterhigh
(12) RewriteLemmaProof (LOWER BOUND(ID) transformation)
Proved the following rewrite lemma:
ge(
gen_0':s5_0(
n404_0),
gen_0':s5_0(
n404_0)) →
true, rt ∈ Ω(1 + n404
0)
Induction Base:
ge(gen_0':s5_0(0), gen_0':s5_0(0)) →RΩ(1)
true
Induction Step:
ge(gen_0':s5_0(+(n404_0, 1)), gen_0':s5_0(+(n404_0, 1))) →RΩ(1)
ge(gen_0':s5_0(n404_0), gen_0':s5_0(n404_0)) →IH
true
We have rt ∈ Ω(n1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
(13) Complex Obligation (BEST)
(14) Obligation:
Innermost TRS:
Rules:
qsort(
nil) →
nilqsort(
cons(
x,
xs)) →
append(
qsort(
filterlow(
last(
cons(
x,
xs)),
cons(
x,
xs))),
cons(
last(
cons(
x,
xs)),
qsort(
filterhigh(
last(
cons(
x,
xs)),
cons(
x,
xs)))))
filterlow(
n,
nil) →
nilfilterlow(
n,
cons(
x,
xs)) →
if1(
ge(
n,
x),
n,
x,
xs)
if1(
true,
n,
x,
xs) →
filterlow(
n,
xs)
if1(
false,
n,
x,
xs) →
cons(
x,
filterlow(
n,
xs))
filterhigh(
n,
nil) →
nilfilterhigh(
n,
cons(
x,
xs)) →
if2(
ge(
x,
n),
n,
x,
xs)
if2(
true,
n,
x,
xs) →
filterhigh(
n,
xs)
if2(
false,
n,
x,
xs) →
cons(
x,
filterhigh(
n,
xs))
ge(
x,
0') →
truege(
0',
s(
x)) →
falsege(
s(
x),
s(
y)) →
ge(
x,
y)
append(
nil,
ys) →
ysappend(
cons(
x,
xs),
ys) →
cons(
x,
append(
xs,
ys))
last(
nil) →
0'last(
cons(
x,
nil)) →
xlast(
cons(
x,
cons(
y,
xs))) →
last(
cons(
y,
xs))
Types:
qsort :: nil:cons:ys → nil:cons:ys
nil :: nil:cons:ys
cons :: 0':s → nil:cons:ys → nil:cons:ys
append :: nil:cons:ys → nil:cons:ys → nil:cons:ys
filterlow :: 0':s → nil:cons:ys → nil:cons:ys
last :: nil:cons:ys → 0':s
filterhigh :: 0':s → nil:cons:ys → nil:cons:ys
if1 :: true:false → 0':s → 0':s → nil:cons:ys → nil:cons:ys
ge :: 0':s → 0':s → true:false
true :: true:false
false :: true:false
if2 :: true:false → 0':s → 0':s → nil:cons:ys → nil:cons:ys
0' :: 0':s
s :: 0':s → 0':s
ys :: nil:cons:ys
hole_nil:cons:ys1_0 :: nil:cons:ys
hole_0':s2_0 :: 0':s
hole_true:false3_0 :: true:false
gen_nil:cons:ys4_0 :: Nat → nil:cons:ys
gen_0':s5_0 :: Nat → 0':s
Lemmas:
last(gen_nil:cons:ys4_0(+(1, n19_0))) → gen_0':s5_0(0), rt ∈ Ω(1 + n190)
ge(gen_0':s5_0(n404_0), gen_0':s5_0(n404_0)) → true, rt ∈ Ω(1 + n4040)
Generator Equations:
gen_nil:cons:ys4_0(0) ⇔ nil
gen_nil:cons:ys4_0(+(x, 1)) ⇔ cons(0', gen_nil:cons:ys4_0(x))
gen_0':s5_0(0) ⇔ 0'
gen_0':s5_0(+(x, 1)) ⇔ s(gen_0':s5_0(x))
The following defined symbols remain to be analysed:
filterlow, qsort, filterhigh
They will be analysed ascendingly in the following order:
filterlow < qsort
filterhigh < qsort
(15) RewriteLemmaProof (LOWER BOUND(ID) transformation)
Proved the following rewrite lemma:
filterlow(
gen_0':s5_0(
0),
gen_nil:cons:ys4_0(
n751_0)) →
gen_nil:cons:ys4_0(
0), rt ∈ Ω(1 + n751
0)
Induction Base:
filterlow(gen_0':s5_0(0), gen_nil:cons:ys4_0(0)) →RΩ(1)
nil
Induction Step:
filterlow(gen_0':s5_0(0), gen_nil:cons:ys4_0(+(n751_0, 1))) →RΩ(1)
if1(ge(gen_0':s5_0(0), 0'), gen_0':s5_0(0), 0', gen_nil:cons:ys4_0(n751_0)) →LΩ(1)
if1(true, gen_0':s5_0(0), 0', gen_nil:cons:ys4_0(n751_0)) →RΩ(1)
filterlow(gen_0':s5_0(0), gen_nil:cons:ys4_0(n751_0)) →IH
gen_nil:cons:ys4_0(0)
We have rt ∈ Ω(n1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
(16) Complex Obligation (BEST)
(17) Obligation:
Innermost TRS:
Rules:
qsort(
nil) →
nilqsort(
cons(
x,
xs)) →
append(
qsort(
filterlow(
last(
cons(
x,
xs)),
cons(
x,
xs))),
cons(
last(
cons(
x,
xs)),
qsort(
filterhigh(
last(
cons(
x,
xs)),
cons(
x,
xs)))))
filterlow(
n,
nil) →
nilfilterlow(
n,
cons(
x,
xs)) →
if1(
ge(
n,
x),
n,
x,
xs)
if1(
true,
n,
x,
xs) →
filterlow(
n,
xs)
if1(
false,
n,
x,
xs) →
cons(
x,
filterlow(
n,
xs))
filterhigh(
n,
nil) →
nilfilterhigh(
n,
cons(
x,
xs)) →
if2(
ge(
x,
n),
n,
x,
xs)
if2(
true,
n,
x,
xs) →
filterhigh(
n,
xs)
if2(
false,
n,
x,
xs) →
cons(
x,
filterhigh(
n,
xs))
ge(
x,
0') →
truege(
0',
s(
x)) →
falsege(
s(
x),
s(
y)) →
ge(
x,
y)
append(
nil,
ys) →
ysappend(
cons(
x,
xs),
ys) →
cons(
x,
append(
xs,
ys))
last(
nil) →
0'last(
cons(
x,
nil)) →
xlast(
cons(
x,
cons(
y,
xs))) →
last(
cons(
y,
xs))
Types:
qsort :: nil:cons:ys → nil:cons:ys
nil :: nil:cons:ys
cons :: 0':s → nil:cons:ys → nil:cons:ys
append :: nil:cons:ys → nil:cons:ys → nil:cons:ys
filterlow :: 0':s → nil:cons:ys → nil:cons:ys
last :: nil:cons:ys → 0':s
filterhigh :: 0':s → nil:cons:ys → nil:cons:ys
if1 :: true:false → 0':s → 0':s → nil:cons:ys → nil:cons:ys
ge :: 0':s → 0':s → true:false
true :: true:false
false :: true:false
if2 :: true:false → 0':s → 0':s → nil:cons:ys → nil:cons:ys
0' :: 0':s
s :: 0':s → 0':s
ys :: nil:cons:ys
hole_nil:cons:ys1_0 :: nil:cons:ys
hole_0':s2_0 :: 0':s
hole_true:false3_0 :: true:false
gen_nil:cons:ys4_0 :: Nat → nil:cons:ys
gen_0':s5_0 :: Nat → 0':s
Lemmas:
last(gen_nil:cons:ys4_0(+(1, n19_0))) → gen_0':s5_0(0), rt ∈ Ω(1 + n190)
ge(gen_0':s5_0(n404_0), gen_0':s5_0(n404_0)) → true, rt ∈ Ω(1 + n4040)
filterlow(gen_0':s5_0(0), gen_nil:cons:ys4_0(n751_0)) → gen_nil:cons:ys4_0(0), rt ∈ Ω(1 + n7510)
Generator Equations:
gen_nil:cons:ys4_0(0) ⇔ nil
gen_nil:cons:ys4_0(+(x, 1)) ⇔ cons(0', gen_nil:cons:ys4_0(x))
gen_0':s5_0(0) ⇔ 0'
gen_0':s5_0(+(x, 1)) ⇔ s(gen_0':s5_0(x))
The following defined symbols remain to be analysed:
filterhigh, qsort
They will be analysed ascendingly in the following order:
filterhigh < qsort
(18) RewriteLemmaProof (LOWER BOUND(ID) transformation)
Proved the following rewrite lemma:
filterhigh(
gen_0':s5_0(
0),
gen_nil:cons:ys4_0(
n1422_0)) →
gen_nil:cons:ys4_0(
0), rt ∈ Ω(1 + n1422
0)
Induction Base:
filterhigh(gen_0':s5_0(0), gen_nil:cons:ys4_0(0)) →RΩ(1)
nil
Induction Step:
filterhigh(gen_0':s5_0(0), gen_nil:cons:ys4_0(+(n1422_0, 1))) →RΩ(1)
if2(ge(0', gen_0':s5_0(0)), gen_0':s5_0(0), 0', gen_nil:cons:ys4_0(n1422_0)) →LΩ(1)
if2(true, gen_0':s5_0(0), 0', gen_nil:cons:ys4_0(n1422_0)) →RΩ(1)
filterhigh(gen_0':s5_0(0), gen_nil:cons:ys4_0(n1422_0)) →IH
gen_nil:cons:ys4_0(0)
We have rt ∈ Ω(n1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
(19) Complex Obligation (BEST)
(20) Obligation:
Innermost TRS:
Rules:
qsort(
nil) →
nilqsort(
cons(
x,
xs)) →
append(
qsort(
filterlow(
last(
cons(
x,
xs)),
cons(
x,
xs))),
cons(
last(
cons(
x,
xs)),
qsort(
filterhigh(
last(
cons(
x,
xs)),
cons(
x,
xs)))))
filterlow(
n,
nil) →
nilfilterlow(
n,
cons(
x,
xs)) →
if1(
ge(
n,
x),
n,
x,
xs)
if1(
true,
n,
x,
xs) →
filterlow(
n,
xs)
if1(
false,
n,
x,
xs) →
cons(
x,
filterlow(
n,
xs))
filterhigh(
n,
nil) →
nilfilterhigh(
n,
cons(
x,
xs)) →
if2(
ge(
x,
n),
n,
x,
xs)
if2(
true,
n,
x,
xs) →
filterhigh(
n,
xs)
if2(
false,
n,
x,
xs) →
cons(
x,
filterhigh(
n,
xs))
ge(
x,
0') →
truege(
0',
s(
x)) →
falsege(
s(
x),
s(
y)) →
ge(
x,
y)
append(
nil,
ys) →
ysappend(
cons(
x,
xs),
ys) →
cons(
x,
append(
xs,
ys))
last(
nil) →
0'last(
cons(
x,
nil)) →
xlast(
cons(
x,
cons(
y,
xs))) →
last(
cons(
y,
xs))
Types:
qsort :: nil:cons:ys → nil:cons:ys
nil :: nil:cons:ys
cons :: 0':s → nil:cons:ys → nil:cons:ys
append :: nil:cons:ys → nil:cons:ys → nil:cons:ys
filterlow :: 0':s → nil:cons:ys → nil:cons:ys
last :: nil:cons:ys → 0':s
filterhigh :: 0':s → nil:cons:ys → nil:cons:ys
if1 :: true:false → 0':s → 0':s → nil:cons:ys → nil:cons:ys
ge :: 0':s → 0':s → true:false
true :: true:false
false :: true:false
if2 :: true:false → 0':s → 0':s → nil:cons:ys → nil:cons:ys
0' :: 0':s
s :: 0':s → 0':s
ys :: nil:cons:ys
hole_nil:cons:ys1_0 :: nil:cons:ys
hole_0':s2_0 :: 0':s
hole_true:false3_0 :: true:false
gen_nil:cons:ys4_0 :: Nat → nil:cons:ys
gen_0':s5_0 :: Nat → 0':s
Lemmas:
last(gen_nil:cons:ys4_0(+(1, n19_0))) → gen_0':s5_0(0), rt ∈ Ω(1 + n190)
ge(gen_0':s5_0(n404_0), gen_0':s5_0(n404_0)) → true, rt ∈ Ω(1 + n4040)
filterlow(gen_0':s5_0(0), gen_nil:cons:ys4_0(n751_0)) → gen_nil:cons:ys4_0(0), rt ∈ Ω(1 + n7510)
filterhigh(gen_0':s5_0(0), gen_nil:cons:ys4_0(n1422_0)) → gen_nil:cons:ys4_0(0), rt ∈ Ω(1 + n14220)
Generator Equations:
gen_nil:cons:ys4_0(0) ⇔ nil
gen_nil:cons:ys4_0(+(x, 1)) ⇔ cons(0', gen_nil:cons:ys4_0(x))
gen_0':s5_0(0) ⇔ 0'
gen_0':s5_0(+(x, 1)) ⇔ s(gen_0':s5_0(x))
The following defined symbols remain to be analysed:
qsort
(21) NoRewriteLemmaProof (LOWER BOUND(ID) transformation)
Could not prove a rewrite lemma for the defined symbol qsort.
(22) Obligation:
Innermost TRS:
Rules:
qsort(
nil) →
nilqsort(
cons(
x,
xs)) →
append(
qsort(
filterlow(
last(
cons(
x,
xs)),
cons(
x,
xs))),
cons(
last(
cons(
x,
xs)),
qsort(
filterhigh(
last(
cons(
x,
xs)),
cons(
x,
xs)))))
filterlow(
n,
nil) →
nilfilterlow(
n,
cons(
x,
xs)) →
if1(
ge(
n,
x),
n,
x,
xs)
if1(
true,
n,
x,
xs) →
filterlow(
n,
xs)
if1(
false,
n,
x,
xs) →
cons(
x,
filterlow(
n,
xs))
filterhigh(
n,
nil) →
nilfilterhigh(
n,
cons(
x,
xs)) →
if2(
ge(
x,
n),
n,
x,
xs)
if2(
true,
n,
x,
xs) →
filterhigh(
n,
xs)
if2(
false,
n,
x,
xs) →
cons(
x,
filterhigh(
n,
xs))
ge(
x,
0') →
truege(
0',
s(
x)) →
falsege(
s(
x),
s(
y)) →
ge(
x,
y)
append(
nil,
ys) →
ysappend(
cons(
x,
xs),
ys) →
cons(
x,
append(
xs,
ys))
last(
nil) →
0'last(
cons(
x,
nil)) →
xlast(
cons(
x,
cons(
y,
xs))) →
last(
cons(
y,
xs))
Types:
qsort :: nil:cons:ys → nil:cons:ys
nil :: nil:cons:ys
cons :: 0':s → nil:cons:ys → nil:cons:ys
append :: nil:cons:ys → nil:cons:ys → nil:cons:ys
filterlow :: 0':s → nil:cons:ys → nil:cons:ys
last :: nil:cons:ys → 0':s
filterhigh :: 0':s → nil:cons:ys → nil:cons:ys
if1 :: true:false → 0':s → 0':s → nil:cons:ys → nil:cons:ys
ge :: 0':s → 0':s → true:false
true :: true:false
false :: true:false
if2 :: true:false → 0':s → 0':s → nil:cons:ys → nil:cons:ys
0' :: 0':s
s :: 0':s → 0':s
ys :: nil:cons:ys
hole_nil:cons:ys1_0 :: nil:cons:ys
hole_0':s2_0 :: 0':s
hole_true:false3_0 :: true:false
gen_nil:cons:ys4_0 :: Nat → nil:cons:ys
gen_0':s5_0 :: Nat → 0':s
Lemmas:
last(gen_nil:cons:ys4_0(+(1, n19_0))) → gen_0':s5_0(0), rt ∈ Ω(1 + n190)
ge(gen_0':s5_0(n404_0), gen_0':s5_0(n404_0)) → true, rt ∈ Ω(1 + n4040)
filterlow(gen_0':s5_0(0), gen_nil:cons:ys4_0(n751_0)) → gen_nil:cons:ys4_0(0), rt ∈ Ω(1 + n7510)
filterhigh(gen_0':s5_0(0), gen_nil:cons:ys4_0(n1422_0)) → gen_nil:cons:ys4_0(0), rt ∈ Ω(1 + n14220)
Generator Equations:
gen_nil:cons:ys4_0(0) ⇔ nil
gen_nil:cons:ys4_0(+(x, 1)) ⇔ cons(0', gen_nil:cons:ys4_0(x))
gen_0':s5_0(0) ⇔ 0'
gen_0':s5_0(+(x, 1)) ⇔ s(gen_0':s5_0(x))
No more defined symbols left to analyse.
(23) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
last(gen_nil:cons:ys4_0(+(1, n19_0))) → gen_0':s5_0(0), rt ∈ Ω(1 + n190)
(24) BOUNDS(n^1, INF)
(25) Obligation:
Innermost TRS:
Rules:
qsort(
nil) →
nilqsort(
cons(
x,
xs)) →
append(
qsort(
filterlow(
last(
cons(
x,
xs)),
cons(
x,
xs))),
cons(
last(
cons(
x,
xs)),
qsort(
filterhigh(
last(
cons(
x,
xs)),
cons(
x,
xs)))))
filterlow(
n,
nil) →
nilfilterlow(
n,
cons(
x,
xs)) →
if1(
ge(
n,
x),
n,
x,
xs)
if1(
true,
n,
x,
xs) →
filterlow(
n,
xs)
if1(
false,
n,
x,
xs) →
cons(
x,
filterlow(
n,
xs))
filterhigh(
n,
nil) →
nilfilterhigh(
n,
cons(
x,
xs)) →
if2(
ge(
x,
n),
n,
x,
xs)
if2(
true,
n,
x,
xs) →
filterhigh(
n,
xs)
if2(
false,
n,
x,
xs) →
cons(
x,
filterhigh(
n,
xs))
ge(
x,
0') →
truege(
0',
s(
x)) →
falsege(
s(
x),
s(
y)) →
ge(
x,
y)
append(
nil,
ys) →
ysappend(
cons(
x,
xs),
ys) →
cons(
x,
append(
xs,
ys))
last(
nil) →
0'last(
cons(
x,
nil)) →
xlast(
cons(
x,
cons(
y,
xs))) →
last(
cons(
y,
xs))
Types:
qsort :: nil:cons:ys → nil:cons:ys
nil :: nil:cons:ys
cons :: 0':s → nil:cons:ys → nil:cons:ys
append :: nil:cons:ys → nil:cons:ys → nil:cons:ys
filterlow :: 0':s → nil:cons:ys → nil:cons:ys
last :: nil:cons:ys → 0':s
filterhigh :: 0':s → nil:cons:ys → nil:cons:ys
if1 :: true:false → 0':s → 0':s → nil:cons:ys → nil:cons:ys
ge :: 0':s → 0':s → true:false
true :: true:false
false :: true:false
if2 :: true:false → 0':s → 0':s → nil:cons:ys → nil:cons:ys
0' :: 0':s
s :: 0':s → 0':s
ys :: nil:cons:ys
hole_nil:cons:ys1_0 :: nil:cons:ys
hole_0':s2_0 :: 0':s
hole_true:false3_0 :: true:false
gen_nil:cons:ys4_0 :: Nat → nil:cons:ys
gen_0':s5_0 :: Nat → 0':s
Lemmas:
last(gen_nil:cons:ys4_0(+(1, n19_0))) → gen_0':s5_0(0), rt ∈ Ω(1 + n190)
ge(gen_0':s5_0(n404_0), gen_0':s5_0(n404_0)) → true, rt ∈ Ω(1 + n4040)
filterlow(gen_0':s5_0(0), gen_nil:cons:ys4_0(n751_0)) → gen_nil:cons:ys4_0(0), rt ∈ Ω(1 + n7510)
filterhigh(gen_0':s5_0(0), gen_nil:cons:ys4_0(n1422_0)) → gen_nil:cons:ys4_0(0), rt ∈ Ω(1 + n14220)
Generator Equations:
gen_nil:cons:ys4_0(0) ⇔ nil
gen_nil:cons:ys4_0(+(x, 1)) ⇔ cons(0', gen_nil:cons:ys4_0(x))
gen_0':s5_0(0) ⇔ 0'
gen_0':s5_0(+(x, 1)) ⇔ s(gen_0':s5_0(x))
No more defined symbols left to analyse.
(26) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
last(gen_nil:cons:ys4_0(+(1, n19_0))) → gen_0':s5_0(0), rt ∈ Ω(1 + n190)
(27) BOUNDS(n^1, INF)
(28) Obligation:
Innermost TRS:
Rules:
qsort(
nil) →
nilqsort(
cons(
x,
xs)) →
append(
qsort(
filterlow(
last(
cons(
x,
xs)),
cons(
x,
xs))),
cons(
last(
cons(
x,
xs)),
qsort(
filterhigh(
last(
cons(
x,
xs)),
cons(
x,
xs)))))
filterlow(
n,
nil) →
nilfilterlow(
n,
cons(
x,
xs)) →
if1(
ge(
n,
x),
n,
x,
xs)
if1(
true,
n,
x,
xs) →
filterlow(
n,
xs)
if1(
false,
n,
x,
xs) →
cons(
x,
filterlow(
n,
xs))
filterhigh(
n,
nil) →
nilfilterhigh(
n,
cons(
x,
xs)) →
if2(
ge(
x,
n),
n,
x,
xs)
if2(
true,
n,
x,
xs) →
filterhigh(
n,
xs)
if2(
false,
n,
x,
xs) →
cons(
x,
filterhigh(
n,
xs))
ge(
x,
0') →
truege(
0',
s(
x)) →
falsege(
s(
x),
s(
y)) →
ge(
x,
y)
append(
nil,
ys) →
ysappend(
cons(
x,
xs),
ys) →
cons(
x,
append(
xs,
ys))
last(
nil) →
0'last(
cons(
x,
nil)) →
xlast(
cons(
x,
cons(
y,
xs))) →
last(
cons(
y,
xs))
Types:
qsort :: nil:cons:ys → nil:cons:ys
nil :: nil:cons:ys
cons :: 0':s → nil:cons:ys → nil:cons:ys
append :: nil:cons:ys → nil:cons:ys → nil:cons:ys
filterlow :: 0':s → nil:cons:ys → nil:cons:ys
last :: nil:cons:ys → 0':s
filterhigh :: 0':s → nil:cons:ys → nil:cons:ys
if1 :: true:false → 0':s → 0':s → nil:cons:ys → nil:cons:ys
ge :: 0':s → 0':s → true:false
true :: true:false
false :: true:false
if2 :: true:false → 0':s → 0':s → nil:cons:ys → nil:cons:ys
0' :: 0':s
s :: 0':s → 0':s
ys :: nil:cons:ys
hole_nil:cons:ys1_0 :: nil:cons:ys
hole_0':s2_0 :: 0':s
hole_true:false3_0 :: true:false
gen_nil:cons:ys4_0 :: Nat → nil:cons:ys
gen_0':s5_0 :: Nat → 0':s
Lemmas:
last(gen_nil:cons:ys4_0(+(1, n19_0))) → gen_0':s5_0(0), rt ∈ Ω(1 + n190)
ge(gen_0':s5_0(n404_0), gen_0':s5_0(n404_0)) → true, rt ∈ Ω(1 + n4040)
filterlow(gen_0':s5_0(0), gen_nil:cons:ys4_0(n751_0)) → gen_nil:cons:ys4_0(0), rt ∈ Ω(1 + n7510)
Generator Equations:
gen_nil:cons:ys4_0(0) ⇔ nil
gen_nil:cons:ys4_0(+(x, 1)) ⇔ cons(0', gen_nil:cons:ys4_0(x))
gen_0':s5_0(0) ⇔ 0'
gen_0':s5_0(+(x, 1)) ⇔ s(gen_0':s5_0(x))
No more defined symbols left to analyse.
(29) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
last(gen_nil:cons:ys4_0(+(1, n19_0))) → gen_0':s5_0(0), rt ∈ Ω(1 + n190)
(30) BOUNDS(n^1, INF)
(31) Obligation:
Innermost TRS:
Rules:
qsort(
nil) →
nilqsort(
cons(
x,
xs)) →
append(
qsort(
filterlow(
last(
cons(
x,
xs)),
cons(
x,
xs))),
cons(
last(
cons(
x,
xs)),
qsort(
filterhigh(
last(
cons(
x,
xs)),
cons(
x,
xs)))))
filterlow(
n,
nil) →
nilfilterlow(
n,
cons(
x,
xs)) →
if1(
ge(
n,
x),
n,
x,
xs)
if1(
true,
n,
x,
xs) →
filterlow(
n,
xs)
if1(
false,
n,
x,
xs) →
cons(
x,
filterlow(
n,
xs))
filterhigh(
n,
nil) →
nilfilterhigh(
n,
cons(
x,
xs)) →
if2(
ge(
x,
n),
n,
x,
xs)
if2(
true,
n,
x,
xs) →
filterhigh(
n,
xs)
if2(
false,
n,
x,
xs) →
cons(
x,
filterhigh(
n,
xs))
ge(
x,
0') →
truege(
0',
s(
x)) →
falsege(
s(
x),
s(
y)) →
ge(
x,
y)
append(
nil,
ys) →
ysappend(
cons(
x,
xs),
ys) →
cons(
x,
append(
xs,
ys))
last(
nil) →
0'last(
cons(
x,
nil)) →
xlast(
cons(
x,
cons(
y,
xs))) →
last(
cons(
y,
xs))
Types:
qsort :: nil:cons:ys → nil:cons:ys
nil :: nil:cons:ys
cons :: 0':s → nil:cons:ys → nil:cons:ys
append :: nil:cons:ys → nil:cons:ys → nil:cons:ys
filterlow :: 0':s → nil:cons:ys → nil:cons:ys
last :: nil:cons:ys → 0':s
filterhigh :: 0':s → nil:cons:ys → nil:cons:ys
if1 :: true:false → 0':s → 0':s → nil:cons:ys → nil:cons:ys
ge :: 0':s → 0':s → true:false
true :: true:false
false :: true:false
if2 :: true:false → 0':s → 0':s → nil:cons:ys → nil:cons:ys
0' :: 0':s
s :: 0':s → 0':s
ys :: nil:cons:ys
hole_nil:cons:ys1_0 :: nil:cons:ys
hole_0':s2_0 :: 0':s
hole_true:false3_0 :: true:false
gen_nil:cons:ys4_0 :: Nat → nil:cons:ys
gen_0':s5_0 :: Nat → 0':s
Lemmas:
last(gen_nil:cons:ys4_0(+(1, n19_0))) → gen_0':s5_0(0), rt ∈ Ω(1 + n190)
ge(gen_0':s5_0(n404_0), gen_0':s5_0(n404_0)) → true, rt ∈ Ω(1 + n4040)
Generator Equations:
gen_nil:cons:ys4_0(0) ⇔ nil
gen_nil:cons:ys4_0(+(x, 1)) ⇔ cons(0', gen_nil:cons:ys4_0(x))
gen_0':s5_0(0) ⇔ 0'
gen_0':s5_0(+(x, 1)) ⇔ s(gen_0':s5_0(x))
No more defined symbols left to analyse.
(32) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
last(gen_nil:cons:ys4_0(+(1, n19_0))) → gen_0':s5_0(0), rt ∈ Ω(1 + n190)
(33) BOUNDS(n^1, INF)
(34) Obligation:
Innermost TRS:
Rules:
qsort(
nil) →
nilqsort(
cons(
x,
xs)) →
append(
qsort(
filterlow(
last(
cons(
x,
xs)),
cons(
x,
xs))),
cons(
last(
cons(
x,
xs)),
qsort(
filterhigh(
last(
cons(
x,
xs)),
cons(
x,
xs)))))
filterlow(
n,
nil) →
nilfilterlow(
n,
cons(
x,
xs)) →
if1(
ge(
n,
x),
n,
x,
xs)
if1(
true,
n,
x,
xs) →
filterlow(
n,
xs)
if1(
false,
n,
x,
xs) →
cons(
x,
filterlow(
n,
xs))
filterhigh(
n,
nil) →
nilfilterhigh(
n,
cons(
x,
xs)) →
if2(
ge(
x,
n),
n,
x,
xs)
if2(
true,
n,
x,
xs) →
filterhigh(
n,
xs)
if2(
false,
n,
x,
xs) →
cons(
x,
filterhigh(
n,
xs))
ge(
x,
0') →
truege(
0',
s(
x)) →
falsege(
s(
x),
s(
y)) →
ge(
x,
y)
append(
nil,
ys) →
ysappend(
cons(
x,
xs),
ys) →
cons(
x,
append(
xs,
ys))
last(
nil) →
0'last(
cons(
x,
nil)) →
xlast(
cons(
x,
cons(
y,
xs))) →
last(
cons(
y,
xs))
Types:
qsort :: nil:cons:ys → nil:cons:ys
nil :: nil:cons:ys
cons :: 0':s → nil:cons:ys → nil:cons:ys
append :: nil:cons:ys → nil:cons:ys → nil:cons:ys
filterlow :: 0':s → nil:cons:ys → nil:cons:ys
last :: nil:cons:ys → 0':s
filterhigh :: 0':s → nil:cons:ys → nil:cons:ys
if1 :: true:false → 0':s → 0':s → nil:cons:ys → nil:cons:ys
ge :: 0':s → 0':s → true:false
true :: true:false
false :: true:false
if2 :: true:false → 0':s → 0':s → nil:cons:ys → nil:cons:ys
0' :: 0':s
s :: 0':s → 0':s
ys :: nil:cons:ys
hole_nil:cons:ys1_0 :: nil:cons:ys
hole_0':s2_0 :: 0':s
hole_true:false3_0 :: true:false
gen_nil:cons:ys4_0 :: Nat → nil:cons:ys
gen_0':s5_0 :: Nat → 0':s
Lemmas:
last(gen_nil:cons:ys4_0(+(1, n19_0))) → gen_0':s5_0(0), rt ∈ Ω(1 + n190)
Generator Equations:
gen_nil:cons:ys4_0(0) ⇔ nil
gen_nil:cons:ys4_0(+(x, 1)) ⇔ cons(0', gen_nil:cons:ys4_0(x))
gen_0':s5_0(0) ⇔ 0'
gen_0':s5_0(+(x, 1)) ⇔ s(gen_0':s5_0(x))
No more defined symbols left to analyse.
(35) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
last(gen_nil:cons:ys4_0(+(1, n19_0))) → gen_0':s5_0(0), rt ∈ Ω(1 + n190)
(36) BOUNDS(n^1, INF)