Runtime Complexity TRS:
The TRS R consists of the following rules:
le(0, y) → true
le(s(x), 0) → false
le(s(x), s(y)) → le(x, y)
eq(0, 0) → true
eq(0, s(y)) → false
eq(s(x), 0) → false
eq(s(x), s(y)) → eq(x, y)
if1(true, x, y, xs) → min(x, xs)
if1(false, x, y, xs) → min(y, xs)
if2(true, x, y, xs) → xs
if2(false, x, y, xs) → cons(y, del(x, xs))
minsort(nil) → nil
minsort(cons(x, y)) → cons(min(x, y), minsort(del(min(x, y), cons(x, y))))
min(x, nil) → x
min(x, cons(y, z)) → if1(le(x, y), x, y, z)
del(x, nil) → nil
del(x, cons(y, z)) → if2(eq(x, y), x, y, z)
Renamed function symbols to avoid clashes with predefined symbol.
Runtime Complexity TRS:
The TRS R consists of the following rules:
le'(0', y) → true'
le'(s'(x), 0') → false'
le'(s'(x), s'(y)) → le'(x, y)
eq'(0', 0') → true'
eq'(0', s'(y)) → false'
eq'(s'(x), 0') → false'
eq'(s'(x), s'(y)) → eq'(x, y)
if1'(true', x, y, xs) → min'(x, xs)
if1'(false', x, y, xs) → min'(y, xs)
if2'(true', x, y, xs) → xs
if2'(false', x, y, xs) → cons'(y, del'(x, xs))
minsort'(nil') → nil'
minsort'(cons'(x, y)) → cons'(min'(x, y), minsort'(del'(min'(x, y), cons'(x, y))))
min'(x, nil') → x
min'(x, cons'(y, z)) → if1'(le'(x, y), x, y, z)
del'(x, nil') → nil'
del'(x, cons'(y, z)) → if2'(eq'(x, y), x, y, z)
Infered types.
Rules:
le'(0', y) → true'
le'(s'(x), 0') → false'
le'(s'(x), s'(y)) → le'(x, y)
eq'(0', 0') → true'
eq'(0', s'(y)) → false'
eq'(s'(x), 0') → false'
eq'(s'(x), s'(y)) → eq'(x, y)
if1'(true', x, y, xs) → min'(x, xs)
if1'(false', x, y, xs) → min'(y, xs)
if2'(true', x, y, xs) → xs
if2'(false', x, y, xs) → cons'(y, del'(x, xs))
minsort'(nil') → nil'
minsort'(cons'(x, y)) → cons'(min'(x, y), minsort'(del'(min'(x, y), cons'(x, y))))
min'(x, nil') → x
min'(x, cons'(y, z)) → if1'(le'(x, y), x, y, z)
del'(x, nil') → nil'
del'(x, cons'(y, z)) → if2'(eq'(x, y), x, y, z)
Types:
le' :: 0':s' → 0':s' → true':false'
0' :: 0':s'
true' :: true':false'
s' :: 0':s' → 0':s'
false' :: true':false'
eq' :: 0':s' → 0':s' → true':false'
if1' :: true':false' → 0':s' → 0':s' → cons':nil' → 0':s'
min' :: 0':s' → cons':nil' → 0':s'
if2' :: true':false' → 0':s' → 0':s' → cons':nil' → cons':nil'
cons' :: 0':s' → cons':nil' → cons':nil'
del' :: 0':s' → cons':nil' → cons':nil'
minsort' :: cons':nil' → cons':nil'
nil' :: cons':nil'
_hole_true':false'1 :: true':false'
_hole_0':s'2 :: 0':s'
_hole_cons':nil'3 :: cons':nil'
_gen_0':s'4 :: Nat → 0':s'
_gen_cons':nil'5 :: Nat → cons':nil'
Heuristically decided to analyse the following defined symbols:
le', eq', min', del', minsort'
They will be analysed ascendingly in the following order:
le' < min'
eq' < del'
min' < minsort'
del' < minsort'
Rules:
le'(0', y) → true'
le'(s'(x), 0') → false'
le'(s'(x), s'(y)) → le'(x, y)
eq'(0', 0') → true'
eq'(0', s'(y)) → false'
eq'(s'(x), 0') → false'
eq'(s'(x), s'(y)) → eq'(x, y)
if1'(true', x, y, xs) → min'(x, xs)
if1'(false', x, y, xs) → min'(y, xs)
if2'(true', x, y, xs) → xs
if2'(false', x, y, xs) → cons'(y, del'(x, xs))
minsort'(nil') → nil'
minsort'(cons'(x, y)) → cons'(min'(x, y), minsort'(del'(min'(x, y), cons'(x, y))))
min'(x, nil') → x
min'(x, cons'(y, z)) → if1'(le'(x, y), x, y, z)
del'(x, nil') → nil'
del'(x, cons'(y, z)) → if2'(eq'(x, y), x, y, z)
Types:
le' :: 0':s' → 0':s' → true':false'
0' :: 0':s'
true' :: true':false'
s' :: 0':s' → 0':s'
false' :: true':false'
eq' :: 0':s' → 0':s' → true':false'
if1' :: true':false' → 0':s' → 0':s' → cons':nil' → 0':s'
min' :: 0':s' → cons':nil' → 0':s'
if2' :: true':false' → 0':s' → 0':s' → cons':nil' → cons':nil'
cons' :: 0':s' → cons':nil' → cons':nil'
del' :: 0':s' → cons':nil' → cons':nil'
minsort' :: cons':nil' → cons':nil'
nil' :: cons':nil'
_hole_true':false'1 :: true':false'
_hole_0':s'2 :: 0':s'
_hole_cons':nil'3 :: cons':nil'
_gen_0':s'4 :: Nat → 0':s'
_gen_cons':nil'5 :: Nat → cons':nil'
Generator Equations:
_gen_0':s'4(0) ⇔ 0'
_gen_0':s'4(+(x, 1)) ⇔ s'(_gen_0':s'4(x))
_gen_cons':nil'5(0) ⇔ nil'
_gen_cons':nil'5(+(x, 1)) ⇔ cons'(0', _gen_cons':nil'5(x))
The following defined symbols remain to be analysed:
le', eq', min', del', minsort'
They will be analysed ascendingly in the following order:
le' < min'
eq' < del'
min' < minsort'
del' < minsort'
Proved the following rewrite lemma:
le'(_gen_0':s'4(_n7), _gen_0':s'4(_n7)) → true', rt ∈ Ω(1 + n7)
Induction Base:
le'(_gen_0':s'4(0), _gen_0':s'4(0)) →RΩ(1)
true'
Induction Step:
le'(_gen_0':s'4(+(_$n8, 1)), _gen_0':s'4(+(_$n8, 1))) →RΩ(1)
le'(_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:
le'(0', y) → true'
le'(s'(x), 0') → false'
le'(s'(x), s'(y)) → le'(x, y)
eq'(0', 0') → true'
eq'(0', s'(y)) → false'
eq'(s'(x), 0') → false'
eq'(s'(x), s'(y)) → eq'(x, y)
if1'(true', x, y, xs) → min'(x, xs)
if1'(false', x, y, xs) → min'(y, xs)
if2'(true', x, y, xs) → xs
if2'(false', x, y, xs) → cons'(y, del'(x, xs))
minsort'(nil') → nil'
minsort'(cons'(x, y)) → cons'(min'(x, y), minsort'(del'(min'(x, y), cons'(x, y))))
min'(x, nil') → x
min'(x, cons'(y, z)) → if1'(le'(x, y), x, y, z)
del'(x, nil') → nil'
del'(x, cons'(y, z)) → if2'(eq'(x, y), x, y, z)
Types:
le' :: 0':s' → 0':s' → true':false'
0' :: 0':s'
true' :: true':false'
s' :: 0':s' → 0':s'
false' :: true':false'
eq' :: 0':s' → 0':s' → true':false'
if1' :: true':false' → 0':s' → 0':s' → cons':nil' → 0':s'
min' :: 0':s' → cons':nil' → 0':s'
if2' :: true':false' → 0':s' → 0':s' → cons':nil' → cons':nil'
cons' :: 0':s' → cons':nil' → cons':nil'
del' :: 0':s' → cons':nil' → cons':nil'
minsort' :: cons':nil' → cons':nil'
nil' :: cons':nil'
_hole_true':false'1 :: true':false'
_hole_0':s'2 :: 0':s'
_hole_cons':nil'3 :: cons':nil'
_gen_0':s'4 :: Nat → 0':s'
_gen_cons':nil'5 :: Nat → cons':nil'
Lemmas:
le'(_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_cons':nil'5(0) ⇔ nil'
_gen_cons':nil'5(+(x, 1)) ⇔ cons'(0', _gen_cons':nil'5(x))
The following defined symbols remain to be analysed:
eq', min', del', minsort'
They will be analysed ascendingly in the following order:
eq' < del'
min' < minsort'
del' < minsort'
Proved the following rewrite lemma:
eq'(_gen_0':s'4(_n878), _gen_0':s'4(_n878)) → true', rt ∈ Ω(1 + n878)
Induction Base:
eq'(_gen_0':s'4(0), _gen_0':s'4(0)) →RΩ(1)
true'
Induction Step:
eq'(_gen_0':s'4(+(_$n879, 1)), _gen_0':s'4(+(_$n879, 1))) →RΩ(1)
eq'(_gen_0':s'4(_$n879), _gen_0':s'4(_$n879)) →IH
true'
We have rt ∈ Ω(n) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
Rules:
le'(0', y) → true'
le'(s'(x), 0') → false'
le'(s'(x), s'(y)) → le'(x, y)
eq'(0', 0') → true'
eq'(0', s'(y)) → false'
eq'(s'(x), 0') → false'
eq'(s'(x), s'(y)) → eq'(x, y)
if1'(true', x, y, xs) → min'(x, xs)
if1'(false', x, y, xs) → min'(y, xs)
if2'(true', x, y, xs) → xs
if2'(false', x, y, xs) → cons'(y, del'(x, xs))
minsort'(nil') → nil'
minsort'(cons'(x, y)) → cons'(min'(x, y), minsort'(del'(min'(x, y), cons'(x, y))))
min'(x, nil') → x
min'(x, cons'(y, z)) → if1'(le'(x, y), x, y, z)
del'(x, nil') → nil'
del'(x, cons'(y, z)) → if2'(eq'(x, y), x, y, z)
Types:
le' :: 0':s' → 0':s' → true':false'
0' :: 0':s'
true' :: true':false'
s' :: 0':s' → 0':s'
false' :: true':false'
eq' :: 0':s' → 0':s' → true':false'
if1' :: true':false' → 0':s' → 0':s' → cons':nil' → 0':s'
min' :: 0':s' → cons':nil' → 0':s'
if2' :: true':false' → 0':s' → 0':s' → cons':nil' → cons':nil'
cons' :: 0':s' → cons':nil' → cons':nil'
del' :: 0':s' → cons':nil' → cons':nil'
minsort' :: cons':nil' → cons':nil'
nil' :: cons':nil'
_hole_true':false'1 :: true':false'
_hole_0':s'2 :: 0':s'
_hole_cons':nil'3 :: cons':nil'
_gen_0':s'4 :: Nat → 0':s'
_gen_cons':nil'5 :: Nat → cons':nil'
Lemmas:
le'(_gen_0':s'4(_n7), _gen_0':s'4(_n7)) → true', rt ∈ Ω(1 + n7)
eq'(_gen_0':s'4(_n878), _gen_0':s'4(_n878)) → true', rt ∈ Ω(1 + n878)
Generator Equations:
_gen_0':s'4(0) ⇔ 0'
_gen_0':s'4(+(x, 1)) ⇔ s'(_gen_0':s'4(x))
_gen_cons':nil'5(0) ⇔ nil'
_gen_cons':nil'5(+(x, 1)) ⇔ cons'(0', _gen_cons':nil'5(x))
The following defined symbols remain to be analysed:
min', del', minsort'
They will be analysed ascendingly in the following order:
min' < minsort'
del' < minsort'
Proved the following rewrite lemma:
min'(_gen_0':s'4(0), _gen_cons':nil'5(_n1885)) → _gen_0':s'4(0), rt ∈ Ω(1 + n1885)
Induction Base:
min'(_gen_0':s'4(0), _gen_cons':nil'5(0)) →RΩ(1)
_gen_0':s'4(0)
Induction Step:
min'(_gen_0':s'4(0), _gen_cons':nil'5(+(_$n1886, 1))) →RΩ(1)
if1'(le'(_gen_0':s'4(0), 0'), _gen_0':s'4(0), 0', _gen_cons':nil'5(_$n1886)) →LΩ(1)
if1'(true', _gen_0':s'4(0), 0', _gen_cons':nil'5(_$n1886)) →RΩ(1)
min'(_gen_0':s'4(0), _gen_cons':nil'5(_$n1886)) →IH
_gen_0':s'4(0)
We have rt ∈ Ω(n) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
Rules:
le'(0', y) → true'
le'(s'(x), 0') → false'
le'(s'(x), s'(y)) → le'(x, y)
eq'(0', 0') → true'
eq'(0', s'(y)) → false'
eq'(s'(x), 0') → false'
eq'(s'(x), s'(y)) → eq'(x, y)
if1'(true', x, y, xs) → min'(x, xs)
if1'(false', x, y, xs) → min'(y, xs)
if2'(true', x, y, xs) → xs
if2'(false', x, y, xs) → cons'(y, del'(x, xs))
minsort'(nil') → nil'
minsort'(cons'(x, y)) → cons'(min'(x, y), minsort'(del'(min'(x, y), cons'(x, y))))
min'(x, nil') → x
min'(x, cons'(y, z)) → if1'(le'(x, y), x, y, z)
del'(x, nil') → nil'
del'(x, cons'(y, z)) → if2'(eq'(x, y), x, y, z)
Types:
le' :: 0':s' → 0':s' → true':false'
0' :: 0':s'
true' :: true':false'
s' :: 0':s' → 0':s'
false' :: true':false'
eq' :: 0':s' → 0':s' → true':false'
if1' :: true':false' → 0':s' → 0':s' → cons':nil' → 0':s'
min' :: 0':s' → cons':nil' → 0':s'
if2' :: true':false' → 0':s' → 0':s' → cons':nil' → cons':nil'
cons' :: 0':s' → cons':nil' → cons':nil'
del' :: 0':s' → cons':nil' → cons':nil'
minsort' :: cons':nil' → cons':nil'
nil' :: cons':nil'
_hole_true':false'1 :: true':false'
_hole_0':s'2 :: 0':s'
_hole_cons':nil'3 :: cons':nil'
_gen_0':s'4 :: Nat → 0':s'
_gen_cons':nil'5 :: Nat → cons':nil'
Lemmas:
le'(_gen_0':s'4(_n7), _gen_0':s'4(_n7)) → true', rt ∈ Ω(1 + n7)
eq'(_gen_0':s'4(_n878), _gen_0':s'4(_n878)) → true', rt ∈ Ω(1 + n878)
min'(_gen_0':s'4(0), _gen_cons':nil'5(_n1885)) → _gen_0':s'4(0), rt ∈ Ω(1 + n1885)
Generator Equations:
_gen_0':s'4(0) ⇔ 0'
_gen_0':s'4(+(x, 1)) ⇔ s'(_gen_0':s'4(x))
_gen_cons':nil'5(0) ⇔ nil'
_gen_cons':nil'5(+(x, 1)) ⇔ cons'(0', _gen_cons':nil'5(x))
The following defined symbols remain to be analysed:
del', minsort'
They will be analysed ascendingly in the following order:
del' < minsort'
Could not prove a rewrite lemma for the defined symbol del'.
Rules:
le'(0', y) → true'
le'(s'(x), 0') → false'
le'(s'(x), s'(y)) → le'(x, y)
eq'(0', 0') → true'
eq'(0', s'(y)) → false'
eq'(s'(x), 0') → false'
eq'(s'(x), s'(y)) → eq'(x, y)
if1'(true', x, y, xs) → min'(x, xs)
if1'(false', x, y, xs) → min'(y, xs)
if2'(true', x, y, xs) → xs
if2'(false', x, y, xs) → cons'(y, del'(x, xs))
minsort'(nil') → nil'
minsort'(cons'(x, y)) → cons'(min'(x, y), minsort'(del'(min'(x, y), cons'(x, y))))
min'(x, nil') → x
min'(x, cons'(y, z)) → if1'(le'(x, y), x, y, z)
del'(x, nil') → nil'
del'(x, cons'(y, z)) → if2'(eq'(x, y), x, y, z)
Types:
le' :: 0':s' → 0':s' → true':false'
0' :: 0':s'
true' :: true':false'
s' :: 0':s' → 0':s'
false' :: true':false'
eq' :: 0':s' → 0':s' → true':false'
if1' :: true':false' → 0':s' → 0':s' → cons':nil' → 0':s'
min' :: 0':s' → cons':nil' → 0':s'
if2' :: true':false' → 0':s' → 0':s' → cons':nil' → cons':nil'
cons' :: 0':s' → cons':nil' → cons':nil'
del' :: 0':s' → cons':nil' → cons':nil'
minsort' :: cons':nil' → cons':nil'
nil' :: cons':nil'
_hole_true':false'1 :: true':false'
_hole_0':s'2 :: 0':s'
_hole_cons':nil'3 :: cons':nil'
_gen_0':s'4 :: Nat → 0':s'
_gen_cons':nil'5 :: Nat → cons':nil'
Lemmas:
le'(_gen_0':s'4(_n7), _gen_0':s'4(_n7)) → true', rt ∈ Ω(1 + n7)
eq'(_gen_0':s'4(_n878), _gen_0':s'4(_n878)) → true', rt ∈ Ω(1 + n878)
min'(_gen_0':s'4(0), _gen_cons':nil'5(_n1885)) → _gen_0':s'4(0), rt ∈ Ω(1 + n1885)
Generator Equations:
_gen_0':s'4(0) ⇔ 0'
_gen_0':s'4(+(x, 1)) ⇔ s'(_gen_0':s'4(x))
_gen_cons':nil'5(0) ⇔ nil'
_gen_cons':nil'5(+(x, 1)) ⇔ cons'(0', _gen_cons':nil'5(x))
The following defined symbols remain to be analysed:
minsort'
Proved the following rewrite lemma:
minsort'(_gen_cons':nil'5(_n4388)) → _gen_cons':nil'5(_n4388), rt ∈ Ω(1 + n4388 + n43882)
Induction Base:
minsort'(_gen_cons':nil'5(0)) →RΩ(1)
nil'
Induction Step:
minsort'(_gen_cons':nil'5(+(_$n4389, 1))) →RΩ(1)
cons'(min'(0', _gen_cons':nil'5(_$n4389)), minsort'(del'(min'(0', _gen_cons':nil'5(_$n4389)), cons'(0', _gen_cons':nil'5(_$n4389))))) →LΩ(1 + $n4389)
cons'(_gen_0':s'4(0), minsort'(del'(min'(0', _gen_cons':nil'5(_$n4389)), cons'(0', _gen_cons':nil'5(_$n4389))))) →LΩ(1 + $n4389)
cons'(_gen_0':s'4(0), minsort'(del'(_gen_0':s'4(0), cons'(0', _gen_cons':nil'5(_$n4389))))) →RΩ(1)
cons'(_gen_0':s'4(0), minsort'(if2'(eq'(_gen_0':s'4(0), 0'), _gen_0':s'4(0), 0', _gen_cons':nil'5(_$n4389)))) →LΩ(1)
cons'(_gen_0':s'4(0), minsort'(if2'(true', _gen_0':s'4(0), 0', _gen_cons':nil'5(_$n4389)))) →RΩ(1)
cons'(_gen_0':s'4(0), minsort'(_gen_cons':nil'5(_$n4389))) →IH
cons'(_gen_0':s'4(0), _gen_cons':nil'5(_$n4389))
We have rt ∈ Ω(n2) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n2).
Rules:
le'(0', y) → true'
le'(s'(x), 0') → false'
le'(s'(x), s'(y)) → le'(x, y)
eq'(0', 0') → true'
eq'(0', s'(y)) → false'
eq'(s'(x), 0') → false'
eq'(s'(x), s'(y)) → eq'(x, y)
if1'(true', x, y, xs) → min'(x, xs)
if1'(false', x, y, xs) → min'(y, xs)
if2'(true', x, y, xs) → xs
if2'(false', x, y, xs) → cons'(y, del'(x, xs))
minsort'(nil') → nil'
minsort'(cons'(x, y)) → cons'(min'(x, y), minsort'(del'(min'(x, y), cons'(x, y))))
min'(x, nil') → x
min'(x, cons'(y, z)) → if1'(le'(x, y), x, y, z)
del'(x, nil') → nil'
del'(x, cons'(y, z)) → if2'(eq'(x, y), x, y, z)
Types:
le' :: 0':s' → 0':s' → true':false'
0' :: 0':s'
true' :: true':false'
s' :: 0':s' → 0':s'
false' :: true':false'
eq' :: 0':s' → 0':s' → true':false'
if1' :: true':false' → 0':s' → 0':s' → cons':nil' → 0':s'
min' :: 0':s' → cons':nil' → 0':s'
if2' :: true':false' → 0':s' → 0':s' → cons':nil' → cons':nil'
cons' :: 0':s' → cons':nil' → cons':nil'
del' :: 0':s' → cons':nil' → cons':nil'
minsort' :: cons':nil' → cons':nil'
nil' :: cons':nil'
_hole_true':false'1 :: true':false'
_hole_0':s'2 :: 0':s'
_hole_cons':nil'3 :: cons':nil'
_gen_0':s'4 :: Nat → 0':s'
_gen_cons':nil'5 :: Nat → cons':nil'
Lemmas:
le'(_gen_0':s'4(_n7), _gen_0':s'4(_n7)) → true', rt ∈ Ω(1 + n7)
eq'(_gen_0':s'4(_n878), _gen_0':s'4(_n878)) → true', rt ∈ Ω(1 + n878)
min'(_gen_0':s'4(0), _gen_cons':nil'5(_n1885)) → _gen_0':s'4(0), rt ∈ Ω(1 + n1885)
minsort'(_gen_cons':nil'5(_n4388)) → _gen_cons':nil'5(_n4388), rt ∈ Ω(1 + n4388 + n43882)
Generator Equations:
_gen_0':s'4(0) ⇔ 0'
_gen_0':s'4(+(x, 1)) ⇔ s'(_gen_0':s'4(x))
_gen_cons':nil'5(0) ⇔ nil'
_gen_cons':nil'5(+(x, 1)) ⇔ cons'(0', _gen_cons':nil'5(x))
No more defined symbols left to analyse.
The lowerbound Ω(n2) was proven with the following lemma:
minsort'(_gen_cons':nil'5(_n4388)) → _gen_cons':nil'5(_n4388), rt ∈ Ω(1 + n4388 + n43882)