Runtime Complexity TRS:
The TRS R consists of the following rules:
eq(0, 0) → true
eq(0, s(m)) → false
eq(s(n), 0) → false
eq(s(n), s(m)) → eq(n, m)
le(0, m) → true
le(s(n), 0) → false
le(s(n), s(m)) → le(n, m)
min(cons(x, nil)) → x
min(cons(n, cons(m, x))) → if_min(le(n, m), cons(n, cons(m, x)))
if_min(true, cons(n, cons(m, x))) → min(cons(n, x))
if_min(false, cons(n, cons(m, x))) → min(cons(m, x))
replace(n, m, nil) → nil
replace(n, m, cons(k, x)) → if_replace(eq(n, k), n, m, cons(k, x))
if_replace(true, n, m, cons(k, x)) → cons(m, x)
if_replace(false, n, m, cons(k, x)) → cons(k, replace(n, m, x))
empty(nil) → true
empty(cons(n, x)) → false
head(cons(n, x)) → n
tail(nil) → nil
tail(cons(n, x)) → x
sort(x) → sortIter(x, nil)
sortIter(x, y) → if(empty(x), x, y, append(y, cons(min(x), nil)))
if(true, x, y, z) → y
if(false, x, y, z) → sortIter(replace(min(x), head(x), tail(x)), z)
Renamed function symbols to avoid clashes with predefined symbol.
Runtime Complexity TRS:
The TRS R consists of the following rules:
eq'(0', 0') → true'
eq'(0', s'(m)) → false'
eq'(s'(n), 0') → false'
eq'(s'(n), s'(m)) → eq'(n, m)
le'(0', m) → true'
le'(s'(n), 0') → false'
le'(s'(n), s'(m)) → le'(n, m)
min'(cons'(x, nil')) → x
min'(cons'(n, cons'(m, x))) → if_min'(le'(n, m), cons'(n, cons'(m, x)))
if_min'(true', cons'(n, cons'(m, x))) → min'(cons'(n, x))
if_min'(false', cons'(n, cons'(m, x))) → min'(cons'(m, x))
replace'(n, m, nil') → nil'
replace'(n, m, cons'(k, x)) → if_replace'(eq'(n, k), n, m, cons'(k, x))
if_replace'(true', n, m, cons'(k, x)) → cons'(m, x)
if_replace'(false', n, m, cons'(k, x)) → cons'(k, replace'(n, m, x))
empty'(nil') → true'
empty'(cons'(n, x)) → false'
head'(cons'(n, x)) → n
tail'(nil') → nil'
tail'(cons'(n, x)) → x
sort'(x) → sortIter'(x, nil')
sortIter'(x, y) → if'(empty'(x), x, y, append'(y, cons'(min'(x), nil')))
if'(true', x, y, z) → y
if'(false', x, y, z) → sortIter'(replace'(min'(x), head'(x), tail'(x)), z)
Sliced the following arguments:
append'/0
Runtime Complexity TRS:
The TRS R consists of the following rules:
eq'(0', 0') → true'
eq'(0', s'(m)) → false'
eq'(s'(n), 0') → false'
eq'(s'(n), s'(m)) → eq'(n, m)
le'(0', m) → true'
le'(s'(n), 0') → false'
le'(s'(n), s'(m)) → le'(n, m)
min'(cons'(x, nil')) → x
min'(cons'(n, cons'(m, x))) → if_min'(le'(n, m), cons'(n, cons'(m, x)))
if_min'(true', cons'(n, cons'(m, x))) → min'(cons'(n, x))
if_min'(false', cons'(n, cons'(m, x))) → min'(cons'(m, x))
replace'(n, m, nil') → nil'
replace'(n, m, cons'(k, x)) → if_replace'(eq'(n, k), n, m, cons'(k, x))
if_replace'(true', n, m, cons'(k, x)) → cons'(m, x)
if_replace'(false', n, m, cons'(k, x)) → cons'(k, replace'(n, m, x))
empty'(nil') → true'
empty'(cons'(n, x)) → false'
head'(cons'(n, x)) → n
tail'(nil') → nil'
tail'(cons'(n, x)) → x
sort'(x) → sortIter'(x, nil')
sortIter'(x, y) → if'(empty'(x), x, y, append'(cons'(min'(x), nil')))
if'(true', x, y, z) → y
if'(false', x, y, z) → sortIter'(replace'(min'(x), head'(x), tail'(x)), z)
Infered types.
Rules:
eq'(0', 0') → true'
eq'(0', s'(m)) → false'
eq'(s'(n), 0') → false'
eq'(s'(n), s'(m)) → eq'(n, m)
le'(0', m) → true'
le'(s'(n), 0') → false'
le'(s'(n), s'(m)) → le'(n, m)
min'(cons'(x, nil')) → x
min'(cons'(n, cons'(m, x))) → if_min'(le'(n, m), cons'(n, cons'(m, x)))
if_min'(true', cons'(n, cons'(m, x))) → min'(cons'(n, x))
if_min'(false', cons'(n, cons'(m, x))) → min'(cons'(m, x))
replace'(n, m, nil') → nil'
replace'(n, m, cons'(k, x)) → if_replace'(eq'(n, k), n, m, cons'(k, x))
if_replace'(true', n, m, cons'(k, x)) → cons'(m, x)
if_replace'(false', n, m, cons'(k, x)) → cons'(k, replace'(n, m, x))
empty'(nil') → true'
empty'(cons'(n, x)) → false'
head'(cons'(n, x)) → n
tail'(nil') → nil'
tail'(cons'(n, x)) → x
sort'(x) → sortIter'(x, nil')
sortIter'(x, y) → if'(empty'(x), x, y, append'(cons'(min'(x), nil')))
if'(true', x, y, z) → y
if'(false', x, y, z) → sortIter'(replace'(min'(x), head'(x), tail'(x)), z)
Types:
eq' :: 0':s' → 0':s' → true':false'
0' :: 0':s'
true' :: true':false'
s' :: 0':s' → 0':s'
false' :: true':false'
le' :: 0':s' → 0':s' → true':false'
min' :: nil':cons':append' → 0':s'
cons' :: 0':s' → nil':cons':append' → nil':cons':append'
nil' :: nil':cons':append'
if_min' :: true':false' → nil':cons':append' → 0':s'
replace' :: 0':s' → 0':s' → nil':cons':append' → nil':cons':append'
if_replace' :: true':false' → 0':s' → 0':s' → nil':cons':append' → nil':cons':append'
empty' :: nil':cons':append' → true':false'
head' :: nil':cons':append' → 0':s'
tail' :: nil':cons':append' → nil':cons':append'
sort' :: nil':cons':append' → nil':cons':append'
sortIter' :: nil':cons':append' → nil':cons':append' → nil':cons':append'
if' :: true':false' → nil':cons':append' → nil':cons':append' → nil':cons':append' → nil':cons':append'
append' :: nil':cons':append' → nil':cons':append'
_hole_true':false'1 :: true':false'
_hole_0':s'2 :: 0':s'
_hole_nil':cons':append'3 :: nil':cons':append'
_gen_0':s'4 :: Nat → 0':s'
_gen_nil':cons':append'5 :: Nat → nil':cons':append'
Heuristically decided to analyse the following defined symbols:
eq', le', min', replace', sortIter'
They will be analysed ascendingly in the following order:
eq' < replace'
le' < min'
min' < sortIter'
replace' < sortIter'
Rules:
eq'(0', 0') → true'
eq'(0', s'(m)) → false'
eq'(s'(n), 0') → false'
eq'(s'(n), s'(m)) → eq'(n, m)
le'(0', m) → true'
le'(s'(n), 0') → false'
le'(s'(n), s'(m)) → le'(n, m)
min'(cons'(x, nil')) → x
min'(cons'(n, cons'(m, x))) → if_min'(le'(n, m), cons'(n, cons'(m, x)))
if_min'(true', cons'(n, cons'(m, x))) → min'(cons'(n, x))
if_min'(false', cons'(n, cons'(m, x))) → min'(cons'(m, x))
replace'(n, m, nil') → nil'
replace'(n, m, cons'(k, x)) → if_replace'(eq'(n, k), n, m, cons'(k, x))
if_replace'(true', n, m, cons'(k, x)) → cons'(m, x)
if_replace'(false', n, m, cons'(k, x)) → cons'(k, replace'(n, m, x))
empty'(nil') → true'
empty'(cons'(n, x)) → false'
head'(cons'(n, x)) → n
tail'(nil') → nil'
tail'(cons'(n, x)) → x
sort'(x) → sortIter'(x, nil')
sortIter'(x, y) → if'(empty'(x), x, y, append'(cons'(min'(x), nil')))
if'(true', x, y, z) → y
if'(false', x, y, z) → sortIter'(replace'(min'(x), head'(x), tail'(x)), z)
Types:
eq' :: 0':s' → 0':s' → true':false'
0' :: 0':s'
true' :: true':false'
s' :: 0':s' → 0':s'
false' :: true':false'
le' :: 0':s' → 0':s' → true':false'
min' :: nil':cons':append' → 0':s'
cons' :: 0':s' → nil':cons':append' → nil':cons':append'
nil' :: nil':cons':append'
if_min' :: true':false' → nil':cons':append' → 0':s'
replace' :: 0':s' → 0':s' → nil':cons':append' → nil':cons':append'
if_replace' :: true':false' → 0':s' → 0':s' → nil':cons':append' → nil':cons':append'
empty' :: nil':cons':append' → true':false'
head' :: nil':cons':append' → 0':s'
tail' :: nil':cons':append' → nil':cons':append'
sort' :: nil':cons':append' → nil':cons':append'
sortIter' :: nil':cons':append' → nil':cons':append' → nil':cons':append'
if' :: true':false' → nil':cons':append' → nil':cons':append' → nil':cons':append' → nil':cons':append'
append' :: nil':cons':append' → nil':cons':append'
_hole_true':false'1 :: true':false'
_hole_0':s'2 :: 0':s'
_hole_nil':cons':append'3 :: nil':cons':append'
_gen_0':s'4 :: Nat → 0':s'
_gen_nil':cons':append'5 :: Nat → nil':cons':append'
Generator Equations:
_gen_0':s'4(0) ⇔ 0'
_gen_0':s'4(+(x, 1)) ⇔ s'(_gen_0':s'4(x))
_gen_nil':cons':append'5(0) ⇔ nil'
_gen_nil':cons':append'5(+(x, 1)) ⇔ cons'(0', _gen_nil':cons':append'5(x))
The following defined symbols remain to be analysed:
eq', le', min', replace', sortIter'
They will be analysed ascendingly in the following order:
eq' < replace'
le' < min'
min' < sortIter'
replace' < sortIter'
Proved the following rewrite lemma:
eq'(_gen_0':s'4(_n7), _gen_0':s'4(_n7)) → true', rt ∈ Ω(1 + n7)
Induction Base:
eq'(_gen_0':s'4(0), _gen_0':s'4(0)) →RΩ(1)
true'
Induction Step:
eq'(_gen_0':s'4(+(_$n8, 1)), _gen_0':s'4(+(_$n8, 1))) →RΩ(1)
eq'(_gen_0':s'4(_$n8), _gen_0':s'4(_$n8)) →IH
true'
We have rt ∈ Ω(n) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
Rules:
eq'(0', 0') → true'
eq'(0', s'(m)) → false'
eq'(s'(n), 0') → false'
eq'(s'(n), s'(m)) → eq'(n, m)
le'(0', m) → true'
le'(s'(n), 0') → false'
le'(s'(n), s'(m)) → le'(n, m)
min'(cons'(x, nil')) → x
min'(cons'(n, cons'(m, x))) → if_min'(le'(n, m), cons'(n, cons'(m, x)))
if_min'(true', cons'(n, cons'(m, x))) → min'(cons'(n, x))
if_min'(false', cons'(n, cons'(m, x))) → min'(cons'(m, x))
replace'(n, m, nil') → nil'
replace'(n, m, cons'(k, x)) → if_replace'(eq'(n, k), n, m, cons'(k, x))
if_replace'(true', n, m, cons'(k, x)) → cons'(m, x)
if_replace'(false', n, m, cons'(k, x)) → cons'(k, replace'(n, m, x))
empty'(nil') → true'
empty'(cons'(n, x)) → false'
head'(cons'(n, x)) → n
tail'(nil') → nil'
tail'(cons'(n, x)) → x
sort'(x) → sortIter'(x, nil')
sortIter'(x, y) → if'(empty'(x), x, y, append'(cons'(min'(x), nil')))
if'(true', x, y, z) → y
if'(false', x, y, z) → sortIter'(replace'(min'(x), head'(x), tail'(x)), z)
Types:
eq' :: 0':s' → 0':s' → true':false'
0' :: 0':s'
true' :: true':false'
s' :: 0':s' → 0':s'
false' :: true':false'
le' :: 0':s' → 0':s' → true':false'
min' :: nil':cons':append' → 0':s'
cons' :: 0':s' → nil':cons':append' → nil':cons':append'
nil' :: nil':cons':append'
if_min' :: true':false' → nil':cons':append' → 0':s'
replace' :: 0':s' → 0':s' → nil':cons':append' → nil':cons':append'
if_replace' :: true':false' → 0':s' → 0':s' → nil':cons':append' → nil':cons':append'
empty' :: nil':cons':append' → true':false'
head' :: nil':cons':append' → 0':s'
tail' :: nil':cons':append' → nil':cons':append'
sort' :: nil':cons':append' → nil':cons':append'
sortIter' :: nil':cons':append' → nil':cons':append' → nil':cons':append'
if' :: true':false' → nil':cons':append' → nil':cons':append' → nil':cons':append' → nil':cons':append'
append' :: nil':cons':append' → nil':cons':append'
_hole_true':false'1 :: true':false'
_hole_0':s'2 :: 0':s'
_hole_nil':cons':append'3 :: nil':cons':append'
_gen_0':s'4 :: Nat → 0':s'
_gen_nil':cons':append'5 :: Nat → nil':cons':append'
Lemmas:
eq'(_gen_0':s'4(_n7), _gen_0':s'4(_n7)) → true', rt ∈ Ω(1 + n7)
Generator Equations:
_gen_0':s'4(0) ⇔ 0'
_gen_0':s'4(+(x, 1)) ⇔ s'(_gen_0':s'4(x))
_gen_nil':cons':append'5(0) ⇔ nil'
_gen_nil':cons':append'5(+(x, 1)) ⇔ cons'(0', _gen_nil':cons':append'5(x))
The following defined symbols remain to be analysed:
le', min', replace', sortIter'
They will be analysed ascendingly in the following order:
le' < min'
min' < sortIter'
replace' < sortIter'
Proved the following rewrite lemma:
le'(_gen_0':s'4(_n1392), _gen_0':s'4(_n1392)) → true', rt ∈ Ω(1 + n1392)
Induction Base:
le'(_gen_0':s'4(0), _gen_0':s'4(0)) →RΩ(1)
true'
Induction Step:
le'(_gen_0':s'4(+(_$n1393, 1)), _gen_0':s'4(+(_$n1393, 1))) →RΩ(1)
le'(_gen_0':s'4(_$n1393), _gen_0':s'4(_$n1393)) →IH
true'
We have rt ∈ Ω(n) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
Rules:
eq'(0', 0') → true'
eq'(0', s'(m)) → false'
eq'(s'(n), 0') → false'
eq'(s'(n), s'(m)) → eq'(n, m)
le'(0', m) → true'
le'(s'(n), 0') → false'
le'(s'(n), s'(m)) → le'(n, m)
min'(cons'(x, nil')) → x
min'(cons'(n, cons'(m, x))) → if_min'(le'(n, m), cons'(n, cons'(m, x)))
if_min'(true', cons'(n, cons'(m, x))) → min'(cons'(n, x))
if_min'(false', cons'(n, cons'(m, x))) → min'(cons'(m, x))
replace'(n, m, nil') → nil'
replace'(n, m, cons'(k, x)) → if_replace'(eq'(n, k), n, m, cons'(k, x))
if_replace'(true', n, m, cons'(k, x)) → cons'(m, x)
if_replace'(false', n, m, cons'(k, x)) → cons'(k, replace'(n, m, x))
empty'(nil') → true'
empty'(cons'(n, x)) → false'
head'(cons'(n, x)) → n
tail'(nil') → nil'
tail'(cons'(n, x)) → x
sort'(x) → sortIter'(x, nil')
sortIter'(x, y) → if'(empty'(x), x, y, append'(cons'(min'(x), nil')))
if'(true', x, y, z) → y
if'(false', x, y, z) → sortIter'(replace'(min'(x), head'(x), tail'(x)), z)
Types:
eq' :: 0':s' → 0':s' → true':false'
0' :: 0':s'
true' :: true':false'
s' :: 0':s' → 0':s'
false' :: true':false'
le' :: 0':s' → 0':s' → true':false'
min' :: nil':cons':append' → 0':s'
cons' :: 0':s' → nil':cons':append' → nil':cons':append'
nil' :: nil':cons':append'
if_min' :: true':false' → nil':cons':append' → 0':s'
replace' :: 0':s' → 0':s' → nil':cons':append' → nil':cons':append'
if_replace' :: true':false' → 0':s' → 0':s' → nil':cons':append' → nil':cons':append'
empty' :: nil':cons':append' → true':false'
head' :: nil':cons':append' → 0':s'
tail' :: nil':cons':append' → nil':cons':append'
sort' :: nil':cons':append' → nil':cons':append'
sortIter' :: nil':cons':append' → nil':cons':append' → nil':cons':append'
if' :: true':false' → nil':cons':append' → nil':cons':append' → nil':cons':append' → nil':cons':append'
append' :: nil':cons':append' → nil':cons':append'
_hole_true':false'1 :: true':false'
_hole_0':s'2 :: 0':s'
_hole_nil':cons':append'3 :: nil':cons':append'
_gen_0':s'4 :: Nat → 0':s'
_gen_nil':cons':append'5 :: Nat → nil':cons':append'
Lemmas:
eq'(_gen_0':s'4(_n7), _gen_0':s'4(_n7)) → true', rt ∈ Ω(1 + n7)
le'(_gen_0':s'4(_n1392), _gen_0':s'4(_n1392)) → true', rt ∈ Ω(1 + n1392)
Generator Equations:
_gen_0':s'4(0) ⇔ 0'
_gen_0':s'4(+(x, 1)) ⇔ s'(_gen_0':s'4(x))
_gen_nil':cons':append'5(0) ⇔ nil'
_gen_nil':cons':append'5(+(x, 1)) ⇔ cons'(0', _gen_nil':cons':append'5(x))
The following defined symbols remain to be analysed:
min', replace', sortIter'
They will be analysed ascendingly in the following order:
min' < sortIter'
replace' < sortIter'
Proved the following rewrite lemma:
min'(_gen_nil':cons':append'5(+(1, _n2695))) → _gen_0':s'4(0), rt ∈ Ω(1 + n2695)
Induction Base:
min'(_gen_nil':cons':append'5(+(1, 0))) →RΩ(1)
0'
Induction Step:
min'(_gen_nil':cons':append'5(+(1, +(_$n2696, 1)))) →RΩ(1)
if_min'(le'(0', 0'), cons'(0', cons'(0', _gen_nil':cons':append'5(_$n2696)))) →LΩ(1)
if_min'(true', cons'(0', cons'(0', _gen_nil':cons':append'5(_$n2696)))) →RΩ(1)
min'(cons'(0', _gen_nil':cons':append'5(_$n2696))) →IH
_gen_0':s'4(0)
We have rt ∈ Ω(n) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
Rules:
eq'(0', 0') → true'
eq'(0', s'(m)) → false'
eq'(s'(n), 0') → false'
eq'(s'(n), s'(m)) → eq'(n, m)
le'(0', m) → true'
le'(s'(n), 0') → false'
le'(s'(n), s'(m)) → le'(n, m)
min'(cons'(x, nil')) → x
min'(cons'(n, cons'(m, x))) → if_min'(le'(n, m), cons'(n, cons'(m, x)))
if_min'(true', cons'(n, cons'(m, x))) → min'(cons'(n, x))
if_min'(false', cons'(n, cons'(m, x))) → min'(cons'(m, x))
replace'(n, m, nil') → nil'
replace'(n, m, cons'(k, x)) → if_replace'(eq'(n, k), n, m, cons'(k, x))
if_replace'(true', n, m, cons'(k, x)) → cons'(m, x)
if_replace'(false', n, m, cons'(k, x)) → cons'(k, replace'(n, m, x))
empty'(nil') → true'
empty'(cons'(n, x)) → false'
head'(cons'(n, x)) → n
tail'(nil') → nil'
tail'(cons'(n, x)) → x
sort'(x) → sortIter'(x, nil')
sortIter'(x, y) → if'(empty'(x), x, y, append'(cons'(min'(x), nil')))
if'(true', x, y, z) → y
if'(false', x, y, z) → sortIter'(replace'(min'(x), head'(x), tail'(x)), z)
Types:
eq' :: 0':s' → 0':s' → true':false'
0' :: 0':s'
true' :: true':false'
s' :: 0':s' → 0':s'
false' :: true':false'
le' :: 0':s' → 0':s' → true':false'
min' :: nil':cons':append' → 0':s'
cons' :: 0':s' → nil':cons':append' → nil':cons':append'
nil' :: nil':cons':append'
if_min' :: true':false' → nil':cons':append' → 0':s'
replace' :: 0':s' → 0':s' → nil':cons':append' → nil':cons':append'
if_replace' :: true':false' → 0':s' → 0':s' → nil':cons':append' → nil':cons':append'
empty' :: nil':cons':append' → true':false'
head' :: nil':cons':append' → 0':s'
tail' :: nil':cons':append' → nil':cons':append'
sort' :: nil':cons':append' → nil':cons':append'
sortIter' :: nil':cons':append' → nil':cons':append' → nil':cons':append'
if' :: true':false' → nil':cons':append' → nil':cons':append' → nil':cons':append' → nil':cons':append'
append' :: nil':cons':append' → nil':cons':append'
_hole_true':false'1 :: true':false'
_hole_0':s'2 :: 0':s'
_hole_nil':cons':append'3 :: nil':cons':append'
_gen_0':s'4 :: Nat → 0':s'
_gen_nil':cons':append'5 :: Nat → nil':cons':append'
Lemmas:
eq'(_gen_0':s'4(_n7), _gen_0':s'4(_n7)) → true', rt ∈ Ω(1 + n7)
le'(_gen_0':s'4(_n1392), _gen_0':s'4(_n1392)) → true', rt ∈ Ω(1 + n1392)
min'(_gen_nil':cons':append'5(+(1, _n2695))) → _gen_0':s'4(0), rt ∈ Ω(1 + n2695)
Generator Equations:
_gen_0':s'4(0) ⇔ 0'
_gen_0':s'4(+(x, 1)) ⇔ s'(_gen_0':s'4(x))
_gen_nil':cons':append'5(0) ⇔ nil'
_gen_nil':cons':append'5(+(x, 1)) ⇔ cons'(0', _gen_nil':cons':append'5(x))
The following defined symbols remain to be analysed:
replace', sortIter'
They will be analysed ascendingly in the following order:
replace' < sortIter'
Could not prove a rewrite lemma for the defined symbol replace'.
Rules:
eq'(0', 0') → true'
eq'(0', s'(m)) → false'
eq'(s'(n), 0') → false'
eq'(s'(n), s'(m)) → eq'(n, m)
le'(0', m) → true'
le'(s'(n), 0') → false'
le'(s'(n), s'(m)) → le'(n, m)
min'(cons'(x, nil')) → x
min'(cons'(n, cons'(m, x))) → if_min'(le'(n, m), cons'(n, cons'(m, x)))
if_min'(true', cons'(n, cons'(m, x))) → min'(cons'(n, x))
if_min'(false', cons'(n, cons'(m, x))) → min'(cons'(m, x))
replace'(n, m, nil') → nil'
replace'(n, m, cons'(k, x)) → if_replace'(eq'(n, k), n, m, cons'(k, x))
if_replace'(true', n, m, cons'(k, x)) → cons'(m, x)
if_replace'(false', n, m, cons'(k, x)) → cons'(k, replace'(n, m, x))
empty'(nil') → true'
empty'(cons'(n, x)) → false'
head'(cons'(n, x)) → n
tail'(nil') → nil'
tail'(cons'(n, x)) → x
sort'(x) → sortIter'(x, nil')
sortIter'(x, y) → if'(empty'(x), x, y, append'(cons'(min'(x), nil')))
if'(true', x, y, z) → y
if'(false', x, y, z) → sortIter'(replace'(min'(x), head'(x), tail'(x)), z)
Types:
eq' :: 0':s' → 0':s' → true':false'
0' :: 0':s'
true' :: true':false'
s' :: 0':s' → 0':s'
false' :: true':false'
le' :: 0':s' → 0':s' → true':false'
min' :: nil':cons':append' → 0':s'
cons' :: 0':s' → nil':cons':append' → nil':cons':append'
nil' :: nil':cons':append'
if_min' :: true':false' → nil':cons':append' → 0':s'
replace' :: 0':s' → 0':s' → nil':cons':append' → nil':cons':append'
if_replace' :: true':false' → 0':s' → 0':s' → nil':cons':append' → nil':cons':append'
empty' :: nil':cons':append' → true':false'
head' :: nil':cons':append' → 0':s'
tail' :: nil':cons':append' → nil':cons':append'
sort' :: nil':cons':append' → nil':cons':append'
sortIter' :: nil':cons':append' → nil':cons':append' → nil':cons':append'
if' :: true':false' → nil':cons':append' → nil':cons':append' → nil':cons':append' → nil':cons':append'
append' :: nil':cons':append' → nil':cons':append'
_hole_true':false'1 :: true':false'
_hole_0':s'2 :: 0':s'
_hole_nil':cons':append'3 :: nil':cons':append'
_gen_0':s'4 :: Nat → 0':s'
_gen_nil':cons':append'5 :: Nat → nil':cons':append'
Lemmas:
eq'(_gen_0':s'4(_n7), _gen_0':s'4(_n7)) → true', rt ∈ Ω(1 + n7)
le'(_gen_0':s'4(_n1392), _gen_0':s'4(_n1392)) → true', rt ∈ Ω(1 + n1392)
min'(_gen_nil':cons':append'5(+(1, _n2695))) → _gen_0':s'4(0), rt ∈ Ω(1 + n2695)
Generator Equations:
_gen_0':s'4(0) ⇔ 0'
_gen_0':s'4(+(x, 1)) ⇔ s'(_gen_0':s'4(x))
_gen_nil':cons':append'5(0) ⇔ nil'
_gen_nil':cons':append'5(+(x, 1)) ⇔ cons'(0', _gen_nil':cons':append'5(x))
The following defined symbols remain to be analysed:
sortIter'
Could not prove a rewrite lemma for the defined symbol sortIter'.
The following conjecture could not be proven:
sortIter'(_gen_nil':cons':append'5(_n5971), _gen_nil':cons':append'5(b)) →? append'(_gen_nil':cons':append'5(1))
Rules:
eq'(0', 0') → true'
eq'(0', s'(m)) → false'
eq'(s'(n), 0') → false'
eq'(s'(n), s'(m)) → eq'(n, m)
le'(0', m) → true'
le'(s'(n), 0') → false'
le'(s'(n), s'(m)) → le'(n, m)
min'(cons'(x, nil')) → x
min'(cons'(n, cons'(m, x))) → if_min'(le'(n, m), cons'(n, cons'(m, x)))
if_min'(true', cons'(n, cons'(m, x))) → min'(cons'(n, x))
if_min'(false', cons'(n, cons'(m, x))) → min'(cons'(m, x))
replace'(n, m, nil') → nil'
replace'(n, m, cons'(k, x)) → if_replace'(eq'(n, k), n, m, cons'(k, x))
if_replace'(true', n, m, cons'(k, x)) → cons'(m, x)
if_replace'(false', n, m, cons'(k, x)) → cons'(k, replace'(n, m, x))
empty'(nil') → true'
empty'(cons'(n, x)) → false'
head'(cons'(n, x)) → n
tail'(nil') → nil'
tail'(cons'(n, x)) → x
sort'(x) → sortIter'(x, nil')
sortIter'(x, y) → if'(empty'(x), x, y, append'(cons'(min'(x), nil')))
if'(true', x, y, z) → y
if'(false', x, y, z) → sortIter'(replace'(min'(x), head'(x), tail'(x)), z)
Types:
eq' :: 0':s' → 0':s' → true':false'
0' :: 0':s'
true' :: true':false'
s' :: 0':s' → 0':s'
false' :: true':false'
le' :: 0':s' → 0':s' → true':false'
min' :: nil':cons':append' → 0':s'
cons' :: 0':s' → nil':cons':append' → nil':cons':append'
nil' :: nil':cons':append'
if_min' :: true':false' → nil':cons':append' → 0':s'
replace' :: 0':s' → 0':s' → nil':cons':append' → nil':cons':append'
if_replace' :: true':false' → 0':s' → 0':s' → nil':cons':append' → nil':cons':append'
empty' :: nil':cons':append' → true':false'
head' :: nil':cons':append' → 0':s'
tail' :: nil':cons':append' → nil':cons':append'
sort' :: nil':cons':append' → nil':cons':append'
sortIter' :: nil':cons':append' → nil':cons':append' → nil':cons':append'
if' :: true':false' → nil':cons':append' → nil':cons':append' → nil':cons':append' → nil':cons':append'
append' :: nil':cons':append' → nil':cons':append'
_hole_true':false'1 :: true':false'
_hole_0':s'2 :: 0':s'
_hole_nil':cons':append'3 :: nil':cons':append'
_gen_0':s'4 :: Nat → 0':s'
_gen_nil':cons':append'5 :: Nat → nil':cons':append'
Lemmas:
eq'(_gen_0':s'4(_n7), _gen_0':s'4(_n7)) → true', rt ∈ Ω(1 + n7)
le'(_gen_0':s'4(_n1392), _gen_0':s'4(_n1392)) → true', rt ∈ Ω(1 + n1392)
min'(_gen_nil':cons':append'5(+(1, _n2695))) → _gen_0':s'4(0), rt ∈ Ω(1 + n2695)
Generator Equations:
_gen_0':s'4(0) ⇔ 0'
_gen_0':s'4(+(x, 1)) ⇔ s'(_gen_0':s'4(x))
_gen_nil':cons':append'5(0) ⇔ nil'
_gen_nil':cons':append'5(+(x, 1)) ⇔ cons'(0', _gen_nil':cons':append'5(x))
No more defined symbols left to analyse.
The lowerbound Ω(n) was proven with the following lemma:
eq'(_gen_0':s'4(_n7), _gen_0':s'4(_n7)) → true', rt ∈ Ω(1 + n7)