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))
Renamed function symbols to avoid clashes with predefined symbol.
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))
Infered types.
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':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:
qsort', append', 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'
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':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:
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'
Could not prove a rewrite lemma for the defined symbol append'.
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':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:
last', qsort', filterlow', filterhigh', ge'
They will be analysed ascendingly in the following order:
filterlow' < qsort'
last' < qsort'
filterhigh' < qsort'
ge' < filterlow'
ge' < filterhigh'
Proved the following rewrite lemma:
last'(_gen_nil':cons':ys'4(+(1, _n29))) → _gen_0':s'5(0), rt ∈ Ω(1 + n29)
Induction Base:
last'(_gen_nil':cons':ys'4(+(1, 0))) →RΩ(1)
0'
Induction Step:
last'(_gen_nil':cons':ys'4(+(1, +(_$n30, 1)))) →RΩ(1)
last'(cons'(0', _gen_nil':cons':ys'4(_$n30))) →IH
_gen_0':s'5(0)
We have rt ∈ Ω(n) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
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':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:
last'(_gen_nil':cons':ys'4(+(1, _n29))) → _gen_0':s'5(0), rt ∈ Ω(1 + n29)
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', qsort', filterlow', filterhigh'
They will be analysed ascendingly in the following order:
filterlow' < qsort'
filterhigh' < qsort'
ge' < filterlow'
ge' < filterhigh'
Proved the following rewrite lemma:
ge'(_gen_0':s'5(_n941), _gen_0':s'5(_n941)) → true', rt ∈ Ω(1 + n941)
Induction Base:
ge'(_gen_0':s'5(0), _gen_0':s'5(0)) →RΩ(1)
true'
Induction Step:
ge'(_gen_0':s'5(+(_$n942, 1)), _gen_0':s'5(+(_$n942, 1))) →RΩ(1)
ge'(_gen_0':s'5(_$n942), _gen_0':s'5(_$n942)) →IH
true'
We have rt ∈ Ω(n) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
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':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:
last'(_gen_nil':cons':ys'4(+(1, _n29))) → _gen_0':s'5(0), rt ∈ Ω(1 + n29)
ge'(_gen_0':s'5(_n941), _gen_0':s'5(_n941)) → true', rt ∈ Ω(1 + n941)
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', qsort', filterhigh'
They will be analysed ascendingly in the following order:
filterlow' < qsort'
filterhigh' < qsort'
Proved the following rewrite lemma:
filterlow'(_gen_0':s'5(0), _gen_nil':cons':ys'4(_n1881)) → _gen_nil':cons':ys'4(0), rt ∈ Ω(1 + n1881)
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(+(_$n1882, 1))) →RΩ(1)
if1'(ge'(_gen_0':s'5(0), 0'), _gen_0':s'5(0), 0', _gen_nil':cons':ys'4(_$n1882)) →LΩ(1)
if1'(true', _gen_0':s'5(0), 0', _gen_nil':cons':ys'4(_$n1882)) →RΩ(1)
filterlow'(_gen_0':s'5(0), _gen_nil':cons':ys'4(_$n1882)) →IH
_gen_nil':cons':ys'4(0)
We have rt ∈ Ω(n) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
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':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:
last'(_gen_nil':cons':ys'4(+(1, _n29))) → _gen_0':s'5(0), rt ∈ Ω(1 + n29)
ge'(_gen_0':s'5(_n941), _gen_0':s'5(_n941)) → true', rt ∈ Ω(1 + n941)
filterlow'(_gen_0':s'5(0), _gen_nil':cons':ys'4(_n1881)) → _gen_nil':cons':ys'4(0), rt ∈ Ω(1 + n1881)
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', qsort'
They will be analysed ascendingly in the following order:
filterhigh' < qsort'
Proved the following rewrite lemma:
filterhigh'(_gen_0':s'5(0), _gen_nil':cons':ys'4(_n4270)) → _gen_nil':cons':ys'4(0), rt ∈ Ω(1 + n4270)
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(+(_$n4271, 1))) →RΩ(1)
if2'(ge'(0', _gen_0':s'5(0)), _gen_0':s'5(0), 0', _gen_nil':cons':ys'4(_$n4271)) →LΩ(1)
if2'(true', _gen_0':s'5(0), 0', _gen_nil':cons':ys'4(_$n4271)) →RΩ(1)
filterhigh'(_gen_0':s'5(0), _gen_nil':cons':ys'4(_$n4271)) →IH
_gen_nil':cons':ys'4(0)
We have rt ∈ Ω(n) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
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':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:
last'(_gen_nil':cons':ys'4(+(1, _n29))) → _gen_0':s'5(0), rt ∈ Ω(1 + n29)
ge'(_gen_0':s'5(_n941), _gen_0':s'5(_n941)) → true', rt ∈ Ω(1 + n941)
filterlow'(_gen_0':s'5(0), _gen_nil':cons':ys'4(_n1881)) → _gen_nil':cons':ys'4(0), rt ∈ Ω(1 + n1881)
filterhigh'(_gen_0':s'5(0), _gen_nil':cons':ys'4(_n4270)) → _gen_nil':cons':ys'4(0), rt ∈ Ω(1 + n4270)
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:
qsort'
Could not prove a rewrite lemma for the defined symbol qsort'.
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':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:
last'(_gen_nil':cons':ys'4(+(1, _n29))) → _gen_0':s'5(0), rt ∈ Ω(1 + n29)
ge'(_gen_0':s'5(_n941), _gen_0':s'5(_n941)) → true', rt ∈ Ω(1 + n941)
filterlow'(_gen_0':s'5(0), _gen_nil':cons':ys'4(_n1881)) → _gen_nil':cons':ys'4(0), rt ∈ Ω(1 + n1881)
filterhigh'(_gen_0':s'5(0), _gen_nil':cons':ys'4(_n4270)) → _gen_nil':cons':ys'4(0), rt ∈ Ω(1 + n4270)
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:
last'(_gen_nil':cons':ys'4(+(1, _n29))) → _gen_0':s'5(0), rt ∈ Ω(1 + n29)