Runtime Complexity TRS:
The TRS R consists of the following rules:
qsort(xs) → qs(half(length(xs)), xs)
qs(n, nil) → nil
qs(n, cons(x, xs)) → append(qs(half(n), filterlow(get(n, cons(x, xs)), cons(x, xs))), cons(get(n, cons(x, xs)), qs(half(n), filterhigh(get(n, 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))
length(nil) → 0
length(cons(x, xs)) → s(length(xs))
half(0) → 0
half(s(0)) → 0
half(s(s(x))) → s(half(x))
get(n, nil) → 0
get(n, cons(x, nil)) → x
get(0, cons(x, cons(y, xs))) → x
get(s(n), cons(x, cons(y, xs))) → get(n, cons(y, xs))
Renamed function symbols to avoid clashes with predefined symbol.
Runtime Complexity TRS:
The TRS R consists of the following rules:
qsort'(xs) → qs'(half'(length'(xs)), xs)
qs'(n, nil') → nil'
qs'(n, cons'(x, xs)) → append'(qs'(half'(n), filterlow'(get'(n, cons'(x, xs)), cons'(x, xs))), cons'(get'(n, cons'(x, xs)), qs'(half'(n), filterhigh'(get'(n, 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'))
length'(nil') → 0'
length'(cons'(x, xs)) → s'(length'(xs))
half'(0') → 0'
half'(s'(0')) → 0'
half'(s'(s'(x))) → s'(half'(x))
get'(n, nil') → 0'
get'(n, cons'(x, nil')) → x
get'(0', cons'(x, cons'(y, xs))) → x
get'(s'(n), cons'(x, cons'(y, xs))) → get'(n, cons'(y, xs))
Infered types.
Rules:
qsort'(xs) → qs'(half'(length'(xs)), xs)
qs'(n, nil') → nil'
qs'(n, cons'(x, xs)) → append'(qs'(half'(n), filterlow'(get'(n, cons'(x, xs)), cons'(x, xs))), cons'(get'(n, cons'(x, xs)), qs'(half'(n), filterhigh'(get'(n, 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'))
length'(nil') → 0'
length'(cons'(x, xs)) → s'(length'(xs))
half'(0') → 0'
half'(s'(0')) → 0'
half'(s'(s'(x))) → s'(half'(x))
get'(n, nil') → 0'
get'(n, cons'(x, nil')) → x
get'(0', cons'(x, cons'(y, xs))) → x
get'(s'(n), cons'(x, cons'(y, xs))) → get'(n, cons'(y, xs))
Types:
qsort' :: nil':cons':ys' → nil':cons':ys'
qs' :: 0':s' → nil':cons':ys' → nil':cons':ys'
half' :: 0':s' → 0':s'
length' :: nil':cons':ys' → 0':s'
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'
get' :: 0':s' → 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':ys'1 :: nil':cons':ys'
_hole_0':s'2 :: 0':s'
_hole_true':false'3 :: true':false'
_gen_nil':cons':ys'4 :: Nat → nil':cons':ys'
_gen_0':s'5 :: Nat → 0':s'
Heuristically decided to analyse the following defined symbols:
qs', half', length', append', filterlow', get', filterhigh', ge'
They will be analysed ascendingly in the following order:
half' < qs'
append' < qs'
filterlow' < qs'
get' < qs'
filterhigh' < qs'
ge' < filterlow'
ge' < filterhigh'
Rules:
qsort'(xs) → qs'(half'(length'(xs)), xs)
qs'(n, nil') → nil'
qs'(n, cons'(x, xs)) → append'(qs'(half'(n), filterlow'(get'(n, cons'(x, xs)), cons'(x, xs))), cons'(get'(n, cons'(x, xs)), qs'(half'(n), filterhigh'(get'(n, 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'))
length'(nil') → 0'
length'(cons'(x, xs)) → s'(length'(xs))
half'(0') → 0'
half'(s'(0')) → 0'
half'(s'(s'(x))) → s'(half'(x))
get'(n, nil') → 0'
get'(n, cons'(x, nil')) → x
get'(0', cons'(x, cons'(y, xs))) → x
get'(s'(n), cons'(x, cons'(y, xs))) → get'(n, cons'(y, xs))
Types:
qsort' :: nil':cons':ys' → nil':cons':ys'
qs' :: 0':s' → nil':cons':ys' → nil':cons':ys'
half' :: 0':s' → 0':s'
length' :: nil':cons':ys' → 0':s'
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'
get' :: 0':s' → 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':ys'1 :: nil':cons':ys'
_hole_0':s'2 :: 0':s'
_hole_true':false'3 :: true':false'
_gen_nil':cons':ys'4 :: Nat → nil':cons':ys'
_gen_0':s'5 :: Nat → 0':s'
Generator Equations:
_gen_nil':cons':ys'4(0) ⇔ nil'
_gen_nil':cons':ys'4(+(x, 1)) ⇔ cons'(0', _gen_nil':cons':ys'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:
half', qs', length', append', filterlow', get', filterhigh', ge'
They will be analysed ascendingly in the following order:
half' < qs'
append' < qs'
filterlow' < qs'
get' < qs'
filterhigh' < qs'
ge' < filterlow'
ge' < filterhigh'
Proved the following rewrite lemma:
half'(_gen_0':s'5(*(2, _n7))) → _gen_0':s'5(_n7), rt ∈ Ω(1 + n7)
Induction Base:
half'(_gen_0':s'5(*(2, 0))) →RΩ(1)
0'
Induction Step:
half'(_gen_0':s'5(*(2, +(_$n8, 1)))) →RΩ(1)
s'(half'(_gen_0':s'5(*(2, _$n8)))) →IH
s'(_gen_0':s'5(_$n8))
We have rt ∈ Ω(n) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
Rules:
qsort'(xs) → qs'(half'(length'(xs)), xs)
qs'(n, nil') → nil'
qs'(n, cons'(x, xs)) → append'(qs'(half'(n), filterlow'(get'(n, cons'(x, xs)), cons'(x, xs))), cons'(get'(n, cons'(x, xs)), qs'(half'(n), filterhigh'(get'(n, 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'))
length'(nil') → 0'
length'(cons'(x, xs)) → s'(length'(xs))
half'(0') → 0'
half'(s'(0')) → 0'
half'(s'(s'(x))) → s'(half'(x))
get'(n, nil') → 0'
get'(n, cons'(x, nil')) → x
get'(0', cons'(x, cons'(y, xs))) → x
get'(s'(n), cons'(x, cons'(y, xs))) → get'(n, cons'(y, xs))
Types:
qsort' :: nil':cons':ys' → nil':cons':ys'
qs' :: 0':s' → nil':cons':ys' → nil':cons':ys'
half' :: 0':s' → 0':s'
length' :: nil':cons':ys' → 0':s'
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'
get' :: 0':s' → 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':ys'1 :: nil':cons':ys'
_hole_0':s'2 :: 0':s'
_hole_true':false'3 :: true':false'
_gen_nil':cons':ys'4 :: Nat → nil':cons':ys'
_gen_0':s'5 :: Nat → 0':s'
Lemmas:
half'(_gen_0':s'5(*(2, _n7))) → _gen_0':s'5(_n7), rt ∈ Ω(1 + n7)
Generator Equations:
_gen_nil':cons':ys'4(0) ⇔ nil'
_gen_nil':cons':ys'4(+(x, 1)) ⇔ cons'(0', _gen_nil':cons':ys'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:
length', qs', append', filterlow', get', filterhigh', ge'
They will be analysed ascendingly in the following order:
append' < qs'
filterlow' < qs'
get' < qs'
filterhigh' < qs'
ge' < filterlow'
ge' < filterhigh'
Proved the following rewrite lemma:
length'(_gen_nil':cons':ys'4(_n1304)) → _gen_0':s'5(_n1304), rt ∈ Ω(1 + n1304)
Induction Base:
length'(_gen_nil':cons':ys'4(0)) →RΩ(1)
0'
Induction Step:
length'(_gen_nil':cons':ys'4(+(_$n1305, 1))) →RΩ(1)
s'(length'(_gen_nil':cons':ys'4(_$n1305))) →IH
s'(_gen_0':s'5(_$n1305))
We have rt ∈ Ω(n) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
Rules:
qsort'(xs) → qs'(half'(length'(xs)), xs)
qs'(n, nil') → nil'
qs'(n, cons'(x, xs)) → append'(qs'(half'(n), filterlow'(get'(n, cons'(x, xs)), cons'(x, xs))), cons'(get'(n, cons'(x, xs)), qs'(half'(n), filterhigh'(get'(n, 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'))
length'(nil') → 0'
length'(cons'(x, xs)) → s'(length'(xs))
half'(0') → 0'
half'(s'(0')) → 0'
half'(s'(s'(x))) → s'(half'(x))
get'(n, nil') → 0'
get'(n, cons'(x, nil')) → x
get'(0', cons'(x, cons'(y, xs))) → x
get'(s'(n), cons'(x, cons'(y, xs))) → get'(n, cons'(y, xs))
Types:
qsort' :: nil':cons':ys' → nil':cons':ys'
qs' :: 0':s' → nil':cons':ys' → nil':cons':ys'
half' :: 0':s' → 0':s'
length' :: nil':cons':ys' → 0':s'
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'
get' :: 0':s' → 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':ys'1 :: nil':cons':ys'
_hole_0':s'2 :: 0':s'
_hole_true':false'3 :: true':false'
_gen_nil':cons':ys'4 :: Nat → nil':cons':ys'
_gen_0':s'5 :: Nat → 0':s'
Lemmas:
half'(_gen_0':s'5(*(2, _n7))) → _gen_0':s'5(_n7), rt ∈ Ω(1 + n7)
length'(_gen_nil':cons':ys'4(_n1304)) → _gen_0':s'5(_n1304), rt ∈ Ω(1 + n1304)
Generator Equations:
_gen_nil':cons':ys'4(0) ⇔ nil'
_gen_nil':cons':ys'4(+(x, 1)) ⇔ cons'(0', _gen_nil':cons':ys'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:
append', qs', filterlow', get', filterhigh', ge'
They will be analysed ascendingly in the following order:
append' < qs'
filterlow' < qs'
get' < qs'
filterhigh' < qs'
ge' < filterlow'
ge' < filterhigh'
Could not prove a rewrite lemma for the defined symbol append'.
Rules:
qsort'(xs) → qs'(half'(length'(xs)), xs)
qs'(n, nil') → nil'
qs'(n, cons'(x, xs)) → append'(qs'(half'(n), filterlow'(get'(n, cons'(x, xs)), cons'(x, xs))), cons'(get'(n, cons'(x, xs)), qs'(half'(n), filterhigh'(get'(n, 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'))
length'(nil') → 0'
length'(cons'(x, xs)) → s'(length'(xs))
half'(0') → 0'
half'(s'(0')) → 0'
half'(s'(s'(x))) → s'(half'(x))
get'(n, nil') → 0'
get'(n, cons'(x, nil')) → x
get'(0', cons'(x, cons'(y, xs))) → x
get'(s'(n), cons'(x, cons'(y, xs))) → get'(n, cons'(y, xs))
Types:
qsort' :: nil':cons':ys' → nil':cons':ys'
qs' :: 0':s' → nil':cons':ys' → nil':cons':ys'
half' :: 0':s' → 0':s'
length' :: nil':cons':ys' → 0':s'
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'
get' :: 0':s' → 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':ys'1 :: nil':cons':ys'
_hole_0':s'2 :: 0':s'
_hole_true':false'3 :: true':false'
_gen_nil':cons':ys'4 :: Nat → nil':cons':ys'
_gen_0':s'5 :: Nat → 0':s'
Lemmas:
half'(_gen_0':s'5(*(2, _n7))) → _gen_0':s'5(_n7), rt ∈ Ω(1 + n7)
length'(_gen_nil':cons':ys'4(_n1304)) → _gen_0':s'5(_n1304), rt ∈ Ω(1 + n1304)
Generator Equations:
_gen_nil':cons':ys'4(0) ⇔ nil'
_gen_nil':cons':ys'4(+(x, 1)) ⇔ cons'(0', _gen_nil':cons':ys'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:
get', qs', filterlow', filterhigh', ge'
They will be analysed ascendingly in the following order:
filterlow' < qs'
get' < qs'
filterhigh' < qs'
ge' < filterlow'
ge' < filterhigh'
Proved the following rewrite lemma:
get'(_gen_0':s'5(_n2270), _gen_nil':cons':ys'4(+(1, _n2270))) → _gen_0':s'5(0), rt ∈ Ω(1 + n2270)
Induction Base:
get'(_gen_0':s'5(0), _gen_nil':cons':ys'4(+(1, 0))) →RΩ(1)
0'
Induction Step:
get'(_gen_0':s'5(+(_$n2271, 1)), _gen_nil':cons':ys'4(+(1, +(_$n2271, 1)))) →RΩ(1)
get'(_gen_0':s'5(_$n2271), cons'(0', _gen_nil':cons':ys'4(_$n2271))) →IH
_gen_0':s'5(0)
We have rt ∈ Ω(n) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
Rules:
qsort'(xs) → qs'(half'(length'(xs)), xs)
qs'(n, nil') → nil'
qs'(n, cons'(x, xs)) → append'(qs'(half'(n), filterlow'(get'(n, cons'(x, xs)), cons'(x, xs))), cons'(get'(n, cons'(x, xs)), qs'(half'(n), filterhigh'(get'(n, 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'))
length'(nil') → 0'
length'(cons'(x, xs)) → s'(length'(xs))
half'(0') → 0'
half'(s'(0')) → 0'
half'(s'(s'(x))) → s'(half'(x))
get'(n, nil') → 0'
get'(n, cons'(x, nil')) → x
get'(0', cons'(x, cons'(y, xs))) → x
get'(s'(n), cons'(x, cons'(y, xs))) → get'(n, cons'(y, xs))
Types:
qsort' :: nil':cons':ys' → nil':cons':ys'
qs' :: 0':s' → nil':cons':ys' → nil':cons':ys'
half' :: 0':s' → 0':s'
length' :: nil':cons':ys' → 0':s'
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'
get' :: 0':s' → 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':ys'1 :: nil':cons':ys'
_hole_0':s'2 :: 0':s'
_hole_true':false'3 :: true':false'
_gen_nil':cons':ys'4 :: Nat → nil':cons':ys'
_gen_0':s'5 :: Nat → 0':s'
Lemmas:
half'(_gen_0':s'5(*(2, _n7))) → _gen_0':s'5(_n7), rt ∈ Ω(1 + n7)
length'(_gen_nil':cons':ys'4(_n1304)) → _gen_0':s'5(_n1304), rt ∈ Ω(1 + n1304)
get'(_gen_0':s'5(_n2270), _gen_nil':cons':ys'4(+(1, _n2270))) → _gen_0':s'5(0), rt ∈ Ω(1 + n2270)
Generator Equations:
_gen_nil':cons':ys'4(0) ⇔ nil'
_gen_nil':cons':ys'4(+(x, 1)) ⇔ cons'(0', _gen_nil':cons':ys'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:
ge', qs', filterlow', filterhigh'
They will be analysed ascendingly in the following order:
filterlow' < qs'
filterhigh' < qs'
ge' < filterlow'
ge' < filterhigh'
Proved the following rewrite lemma:
ge'(_gen_0':s'5(_n4328), _gen_0':s'5(_n4328)) → true', rt ∈ Ω(1 + n4328)
Induction Base:
ge'(_gen_0':s'5(0), _gen_0':s'5(0)) →RΩ(1)
true'
Induction Step:
ge'(_gen_0':s'5(+(_$n4329, 1)), _gen_0':s'5(+(_$n4329, 1))) →RΩ(1)
ge'(_gen_0':s'5(_$n4329), _gen_0':s'5(_$n4329)) →IH
true'
We have rt ∈ Ω(n) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
Rules:
qsort'(xs) → qs'(half'(length'(xs)), xs)
qs'(n, nil') → nil'
qs'(n, cons'(x, xs)) → append'(qs'(half'(n), filterlow'(get'(n, cons'(x, xs)), cons'(x, xs))), cons'(get'(n, cons'(x, xs)), qs'(half'(n), filterhigh'(get'(n, 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'))
length'(nil') → 0'
length'(cons'(x, xs)) → s'(length'(xs))
half'(0') → 0'
half'(s'(0')) → 0'
half'(s'(s'(x))) → s'(half'(x))
get'(n, nil') → 0'
get'(n, cons'(x, nil')) → x
get'(0', cons'(x, cons'(y, xs))) → x
get'(s'(n), cons'(x, cons'(y, xs))) → get'(n, cons'(y, xs))
Types:
qsort' :: nil':cons':ys' → nil':cons':ys'
qs' :: 0':s' → nil':cons':ys' → nil':cons':ys'
half' :: 0':s' → 0':s'
length' :: nil':cons':ys' → 0':s'
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'
get' :: 0':s' → 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':ys'1 :: nil':cons':ys'
_hole_0':s'2 :: 0':s'
_hole_true':false'3 :: true':false'
_gen_nil':cons':ys'4 :: Nat → nil':cons':ys'
_gen_0':s'5 :: Nat → 0':s'
Lemmas:
half'(_gen_0':s'5(*(2, _n7))) → _gen_0':s'5(_n7), rt ∈ Ω(1 + n7)
length'(_gen_nil':cons':ys'4(_n1304)) → _gen_0':s'5(_n1304), rt ∈ Ω(1 + n1304)
get'(_gen_0':s'5(_n2270), _gen_nil':cons':ys'4(+(1, _n2270))) → _gen_0':s'5(0), rt ∈ Ω(1 + n2270)
ge'(_gen_0':s'5(_n4328), _gen_0':s'5(_n4328)) → true', rt ∈ Ω(1 + n4328)
Generator Equations:
_gen_nil':cons':ys'4(0) ⇔ nil'
_gen_nil':cons':ys'4(+(x, 1)) ⇔ cons'(0', _gen_nil':cons':ys'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:
filterlow', qs', filterhigh'
They will be analysed ascendingly in the following order:
filterlow' < qs'
filterhigh' < qs'
Proved the following rewrite lemma:
filterlow'(_gen_0':s'5(0), _gen_nil':cons':ys'4(_n5652)) → _gen_nil':cons':ys'4(0), rt ∈ Ω(1 + n5652)
Induction Base:
filterlow'(_gen_0':s'5(0), _gen_nil':cons':ys'4(0)) →RΩ(1)
nil'
Induction Step:
filterlow'(_gen_0':s'5(0), _gen_nil':cons':ys'4(+(_$n5653, 1))) →RΩ(1)
if1'(ge'(_gen_0':s'5(0), 0'), _gen_0':s'5(0), 0', _gen_nil':cons':ys'4(_$n5653)) →LΩ(1)
if1'(true', _gen_0':s'5(0), 0', _gen_nil':cons':ys'4(_$n5653)) →RΩ(1)
filterlow'(_gen_0':s'5(0), _gen_nil':cons':ys'4(_$n5653)) →IH
_gen_nil':cons':ys'4(0)
We have rt ∈ Ω(n) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
Rules:
qsort'(xs) → qs'(half'(length'(xs)), xs)
qs'(n, nil') → nil'
qs'(n, cons'(x, xs)) → append'(qs'(half'(n), filterlow'(get'(n, cons'(x, xs)), cons'(x, xs))), cons'(get'(n, cons'(x, xs)), qs'(half'(n), filterhigh'(get'(n, 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'))
length'(nil') → 0'
length'(cons'(x, xs)) → s'(length'(xs))
half'(0') → 0'
half'(s'(0')) → 0'
half'(s'(s'(x))) → s'(half'(x))
get'(n, nil') → 0'
get'(n, cons'(x, nil')) → x
get'(0', cons'(x, cons'(y, xs))) → x
get'(s'(n), cons'(x, cons'(y, xs))) → get'(n, cons'(y, xs))
Types:
qsort' :: nil':cons':ys' → nil':cons':ys'
qs' :: 0':s' → nil':cons':ys' → nil':cons':ys'
half' :: 0':s' → 0':s'
length' :: nil':cons':ys' → 0':s'
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'
get' :: 0':s' → 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':ys'1 :: nil':cons':ys'
_hole_0':s'2 :: 0':s'
_hole_true':false'3 :: true':false'
_gen_nil':cons':ys'4 :: Nat → nil':cons':ys'
_gen_0':s'5 :: Nat → 0':s'
Lemmas:
half'(_gen_0':s'5(*(2, _n7))) → _gen_0':s'5(_n7), rt ∈ Ω(1 + n7)
length'(_gen_nil':cons':ys'4(_n1304)) → _gen_0':s'5(_n1304), rt ∈ Ω(1 + n1304)
get'(_gen_0':s'5(_n2270), _gen_nil':cons':ys'4(+(1, _n2270))) → _gen_0':s'5(0), rt ∈ Ω(1 + n2270)
ge'(_gen_0':s'5(_n4328), _gen_0':s'5(_n4328)) → true', rt ∈ Ω(1 + n4328)
filterlow'(_gen_0':s'5(0), _gen_nil':cons':ys'4(_n5652)) → _gen_nil':cons':ys'4(0), rt ∈ Ω(1 + n5652)
Generator Equations:
_gen_nil':cons':ys'4(0) ⇔ nil'
_gen_nil':cons':ys'4(+(x, 1)) ⇔ cons'(0', _gen_nil':cons':ys'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:
filterhigh', qs'
They will be analysed ascendingly in the following order:
filterhigh' < qs'
Proved the following rewrite lemma:
filterhigh'(_gen_0':s'5(0), _gen_nil':cons':ys'4(_n8965)) → _gen_nil':cons':ys'4(0), rt ∈ Ω(1 + n8965)
Induction Base:
filterhigh'(_gen_0':s'5(0), _gen_nil':cons':ys'4(0)) →RΩ(1)
nil'
Induction Step:
filterhigh'(_gen_0':s'5(0), _gen_nil':cons':ys'4(+(_$n8966, 1))) →RΩ(1)
if2'(ge'(0', _gen_0':s'5(0)), _gen_0':s'5(0), 0', _gen_nil':cons':ys'4(_$n8966)) →LΩ(1)
if2'(true', _gen_0':s'5(0), 0', _gen_nil':cons':ys'4(_$n8966)) →RΩ(1)
filterhigh'(_gen_0':s'5(0), _gen_nil':cons':ys'4(_$n8966)) →IH
_gen_nil':cons':ys'4(0)
We have rt ∈ Ω(n) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
Rules:
qsort'(xs) → qs'(half'(length'(xs)), xs)
qs'(n, nil') → nil'
qs'(n, cons'(x, xs)) → append'(qs'(half'(n), filterlow'(get'(n, cons'(x, xs)), cons'(x, xs))), cons'(get'(n, cons'(x, xs)), qs'(half'(n), filterhigh'(get'(n, 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'))
length'(nil') → 0'
length'(cons'(x, xs)) → s'(length'(xs))
half'(0') → 0'
half'(s'(0')) → 0'
half'(s'(s'(x))) → s'(half'(x))
get'(n, nil') → 0'
get'(n, cons'(x, nil')) → x
get'(0', cons'(x, cons'(y, xs))) → x
get'(s'(n), cons'(x, cons'(y, xs))) → get'(n, cons'(y, xs))
Types:
qsort' :: nil':cons':ys' → nil':cons':ys'
qs' :: 0':s' → nil':cons':ys' → nil':cons':ys'
half' :: 0':s' → 0':s'
length' :: nil':cons':ys' → 0':s'
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'
get' :: 0':s' → 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':ys'1 :: nil':cons':ys'
_hole_0':s'2 :: 0':s'
_hole_true':false'3 :: true':false'
_gen_nil':cons':ys'4 :: Nat → nil':cons':ys'
_gen_0':s'5 :: Nat → 0':s'
Lemmas:
half'(_gen_0':s'5(*(2, _n7))) → _gen_0':s'5(_n7), rt ∈ Ω(1 + n7)
length'(_gen_nil':cons':ys'4(_n1304)) → _gen_0':s'5(_n1304), rt ∈ Ω(1 + n1304)
get'(_gen_0':s'5(_n2270), _gen_nil':cons':ys'4(+(1, _n2270))) → _gen_0':s'5(0), rt ∈ Ω(1 + n2270)
ge'(_gen_0':s'5(_n4328), _gen_0':s'5(_n4328)) → true', rt ∈ Ω(1 + n4328)
filterlow'(_gen_0':s'5(0), _gen_nil':cons':ys'4(_n5652)) → _gen_nil':cons':ys'4(0), rt ∈ Ω(1 + n5652)
filterhigh'(_gen_0':s'5(0), _gen_nil':cons':ys'4(_n8965)) → _gen_nil':cons':ys'4(0), rt ∈ Ω(1 + n8965)
Generator Equations:
_gen_nil':cons':ys'4(0) ⇔ nil'
_gen_nil':cons':ys'4(+(x, 1)) ⇔ cons'(0', _gen_nil':cons':ys'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:
qs'
Could not prove a rewrite lemma for the defined symbol qs'.
Rules:
qsort'(xs) → qs'(half'(length'(xs)), xs)
qs'(n, nil') → nil'
qs'(n, cons'(x, xs)) → append'(qs'(half'(n), filterlow'(get'(n, cons'(x, xs)), cons'(x, xs))), cons'(get'(n, cons'(x, xs)), qs'(half'(n), filterhigh'(get'(n, 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'))
length'(nil') → 0'
length'(cons'(x, xs)) → s'(length'(xs))
half'(0') → 0'
half'(s'(0')) → 0'
half'(s'(s'(x))) → s'(half'(x))
get'(n, nil') → 0'
get'(n, cons'(x, nil')) → x
get'(0', cons'(x, cons'(y, xs))) → x
get'(s'(n), cons'(x, cons'(y, xs))) → get'(n, cons'(y, xs))
Types:
qsort' :: nil':cons':ys' → nil':cons':ys'
qs' :: 0':s' → nil':cons':ys' → nil':cons':ys'
half' :: 0':s' → 0':s'
length' :: nil':cons':ys' → 0':s'
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'
get' :: 0':s' → 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':ys'1 :: nil':cons':ys'
_hole_0':s'2 :: 0':s'
_hole_true':false'3 :: true':false'
_gen_nil':cons':ys'4 :: Nat → nil':cons':ys'
_gen_0':s'5 :: Nat → 0':s'
Lemmas:
half'(_gen_0':s'5(*(2, _n7))) → _gen_0':s'5(_n7), rt ∈ Ω(1 + n7)
length'(_gen_nil':cons':ys'4(_n1304)) → _gen_0':s'5(_n1304), rt ∈ Ω(1 + n1304)
get'(_gen_0':s'5(_n2270), _gen_nil':cons':ys'4(+(1, _n2270))) → _gen_0':s'5(0), rt ∈ Ω(1 + n2270)
ge'(_gen_0':s'5(_n4328), _gen_0':s'5(_n4328)) → true', rt ∈ Ω(1 + n4328)
filterlow'(_gen_0':s'5(0), _gen_nil':cons':ys'4(_n5652)) → _gen_nil':cons':ys'4(0), rt ∈ Ω(1 + n5652)
filterhigh'(_gen_0':s'5(0), _gen_nil':cons':ys'4(_n8965)) → _gen_nil':cons':ys'4(0), rt ∈ Ω(1 + n8965)
Generator Equations:
_gen_nil':cons':ys'4(0) ⇔ nil'
_gen_nil':cons':ys'4(+(x, 1)) ⇔ cons'(0', _gen_nil':cons':ys'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:
half'(_gen_0':s'5(*(2, _n7))) → _gen_0':s'5(_n7), rt ∈ Ω(1 + n7)