(0) Obligation:
Runtime Complexity Relative TRS:
The TRS R consists of the following rules:
#less(@x, @y) → #cklt(#compare(@x, @y))
append(@l1, @l2) → append#1(@l1, @l2)
append#1(::(@x, @xs), @l2) → ::(@x, append(@xs, @l2))
append#1(nil, @l2) → @l2
flatten(@t) → flatten#1(@t)
flatten#1(leaf) → nil
flatten#1(node(@l, @t1, @t2)) → append(@l, append(flatten(@t1), flatten(@t2)))
flattensort(@t) → insertionsort(flatten(@t))
insert(@x, @l) → insert#1(@l, @x)
insert#1(::(@y, @ys), @x) → insert#2(#less(@y, @x), @x, @y, @ys)
insert#1(nil, @x) → ::(@x, nil)
insert#2(#false, @x, @y, @ys) → ::(@x, ::(@y, @ys))
insert#2(#true, @x, @y, @ys) → ::(@y, insert(@x, @ys))
insertionsort(@l) → insertionsort#1(@l)
insertionsort#1(::(@x, @xs)) → insert(@x, insertionsort(@xs))
insertionsort#1(nil) → nil
The (relative) TRS S consists of the following rules:
#cklt(#EQ) → #false
#cklt(#GT) → #false
#cklt(#LT) → #true
#compare(#0, #0) → #EQ
#compare(#0, #neg(@y)) → #GT
#compare(#0, #pos(@y)) → #LT
#compare(#0, #s(@y)) → #LT
#compare(#neg(@x), #0) → #LT
#compare(#neg(@x), #neg(@y)) → #compare(@y, @x)
#compare(#neg(@x), #pos(@y)) → #LT
#compare(#pos(@x), #0) → #GT
#compare(#pos(@x), #neg(@y)) → #GT
#compare(#pos(@x), #pos(@y)) → #compare(@x, @y)
#compare(#s(@x), #0) → #GT
#compare(#s(@x), #s(@y)) → #compare(@x, @y)
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:
#less(@x, @y) → #cklt(#compare(@x, @y))
append(@l1, @l2) → append#1(@l1, @l2)
append#1(::(@x, @xs), @l2) → ::(@x, append(@xs, @l2))
append#1(nil, @l2) → @l2
flatten(@t) → flatten#1(@t)
flatten#1(leaf) → nil
flatten#1(node(@l, @t1, @t2)) → append(@l, append(flatten(@t1), flatten(@t2)))
flattensort(@t) → insertionsort(flatten(@t))
insert(@x, @l) → insert#1(@l, @x)
insert#1(::(@y, @ys), @x) → insert#2(#less(@y, @x), @x, @y, @ys)
insert#1(nil, @x) → ::(@x, nil)
insert#2(#false, @x, @y, @ys) → ::(@x, ::(@y, @ys))
insert#2(#true, @x, @y, @ys) → ::(@y, insert(@x, @ys))
insertionsort(@l) → insertionsort#1(@l)
insertionsort#1(::(@x, @xs)) → insert(@x, insertionsort(@xs))
insertionsort#1(nil) → nil
The (relative) TRS S consists of the following rules:
#cklt(#EQ) → #false
#cklt(#GT) → #false
#cklt(#LT) → #true
#compare(#0, #0) → #EQ
#compare(#0, #neg(@y)) → #GT
#compare(#0, #pos(@y)) → #LT
#compare(#0, #s(@y)) → #LT
#compare(#neg(@x), #0) → #LT
#compare(#neg(@x), #neg(@y)) → #compare(@y, @x)
#compare(#neg(@x), #pos(@y)) → #LT
#compare(#pos(@x), #0) → #GT
#compare(#pos(@x), #neg(@y)) → #GT
#compare(#pos(@x), #pos(@y)) → #compare(@x, @y)
#compare(#s(@x), #0) → #GT
#compare(#s(@x), #s(@y)) → #compare(@x, @y)
Rewrite Strategy: INNERMOST
(3) TypeInferenceProof (BOTH BOUNDS(ID, ID) transformation)
Infered types.
(4) Obligation:
Innermost TRS:
Rules:
#less(@x, @y) → #cklt(#compare(@x, @y))
append(@l1, @l2) → append#1(@l1, @l2)
append#1(::(@x, @xs), @l2) → ::(@x, append(@xs, @l2))
append#1(nil, @l2) → @l2
flatten(@t) → flatten#1(@t)
flatten#1(leaf) → nil
flatten#1(node(@l, @t1, @t2)) → append(@l, append(flatten(@t1), flatten(@t2)))
flattensort(@t) → insertionsort(flatten(@t))
insert(@x, @l) → insert#1(@l, @x)
insert#1(::(@y, @ys), @x) → insert#2(#less(@y, @x), @x, @y, @ys)
insert#1(nil, @x) → ::(@x, nil)
insert#2(#false, @x, @y, @ys) → ::(@x, ::(@y, @ys))
insert#2(#true, @x, @y, @ys) → ::(@y, insert(@x, @ys))
insertionsort(@l) → insertionsort#1(@l)
insertionsort#1(::(@x, @xs)) → insert(@x, insertionsort(@xs))
insertionsort#1(nil) → nil
#cklt(#EQ) → #false
#cklt(#GT) → #false
#cklt(#LT) → #true
#compare(#0, #0) → #EQ
#compare(#0, #neg(@y)) → #GT
#compare(#0, #pos(@y)) → #LT
#compare(#0, #s(@y)) → #LT
#compare(#neg(@x), #0) → #LT
#compare(#neg(@x), #neg(@y)) → #compare(@y, @x)
#compare(#neg(@x), #pos(@y)) → #LT
#compare(#pos(@x), #0) → #GT
#compare(#pos(@x), #neg(@y)) → #GT
#compare(#pos(@x), #pos(@y)) → #compare(@x, @y)
#compare(#s(@x), #0) → #GT
#compare(#s(@x), #s(@y)) → #compare(@x, @y)
Types:
#less :: #0:#neg:#pos:#s → #0:#neg:#pos:#s → #false:#true
#cklt :: #EQ:#GT:#LT → #false:#true
#compare :: #0:#neg:#pos:#s → #0:#neg:#pos:#s → #EQ:#GT:#LT
append :: :::nil → :::nil → :::nil
append#1 :: :::nil → :::nil → :::nil
:: :: #0:#neg:#pos:#s → :::nil → :::nil
nil :: :::nil
flatten :: leaf:node → :::nil
flatten#1 :: leaf:node → :::nil
leaf :: leaf:node
node :: :::nil → leaf:node → leaf:node → leaf:node
flattensort :: leaf:node → :::nil
insertionsort :: :::nil → :::nil
insert :: #0:#neg:#pos:#s → :::nil → :::nil
insert#1 :: :::nil → #0:#neg:#pos:#s → :::nil
insert#2 :: #false:#true → #0:#neg:#pos:#s → #0:#neg:#pos:#s → :::nil → :::nil
#false :: #false:#true
#true :: #false:#true
insertionsort#1 :: :::nil → :::nil
#EQ :: #EQ:#GT:#LT
#GT :: #EQ:#GT:#LT
#LT :: #EQ:#GT:#LT
#0 :: #0:#neg:#pos:#s
#neg :: #0:#neg:#pos:#s → #0:#neg:#pos:#s
#pos :: #0:#neg:#pos:#s → #0:#neg:#pos:#s
#s :: #0:#neg:#pos:#s → #0:#neg:#pos:#s
hole_#false:#true1_3 :: #false:#true
hole_#0:#neg:#pos:#s2_3 :: #0:#neg:#pos:#s
hole_#EQ:#GT:#LT3_3 :: #EQ:#GT:#LT
hole_:::nil4_3 :: :::nil
hole_leaf:node5_3 :: leaf:node
gen_#0:#neg:#pos:#s6_3 :: Nat → #0:#neg:#pos:#s
gen_:::nil7_3 :: Nat → :::nil
gen_leaf:node8_3 :: Nat → leaf:node
(5) OrderProof (LOWER BOUND(ID) transformation)
Heuristically decided to analyse the following defined symbols:
#compare,
append,
append#1,
flatten,
flatten#1,
insertionsort,
insert,
insert#1,
insertionsort#1They will be analysed ascendingly in the following order:
append = append#1
append < flatten#1
flatten = flatten#1
insertionsort = insertionsort#1
insert = insert#1
insert < insertionsort#1
(6) Obligation:
Innermost TRS:
Rules:
#less(
@x,
@y) →
#cklt(
#compare(
@x,
@y))
append(
@l1,
@l2) →
append#1(
@l1,
@l2)
append#1(
::(
@x,
@xs),
@l2) →
::(
@x,
append(
@xs,
@l2))
append#1(
nil,
@l2) →
@l2flatten(
@t) →
flatten#1(
@t)
flatten#1(
leaf) →
nilflatten#1(
node(
@l,
@t1,
@t2)) →
append(
@l,
append(
flatten(
@t1),
flatten(
@t2)))
flattensort(
@t) →
insertionsort(
flatten(
@t))
insert(
@x,
@l) →
insert#1(
@l,
@x)
insert#1(
::(
@y,
@ys),
@x) →
insert#2(
#less(
@y,
@x),
@x,
@y,
@ys)
insert#1(
nil,
@x) →
::(
@x,
nil)
insert#2(
#false,
@x,
@y,
@ys) →
::(
@x,
::(
@y,
@ys))
insert#2(
#true,
@x,
@y,
@ys) →
::(
@y,
insert(
@x,
@ys))
insertionsort(
@l) →
insertionsort#1(
@l)
insertionsort#1(
::(
@x,
@xs)) →
insert(
@x,
insertionsort(
@xs))
insertionsort#1(
nil) →
nil#cklt(
#EQ) →
#false#cklt(
#GT) →
#false#cklt(
#LT) →
#true#compare(
#0,
#0) →
#EQ#compare(
#0,
#neg(
@y)) →
#GT#compare(
#0,
#pos(
@y)) →
#LT#compare(
#0,
#s(
@y)) →
#LT#compare(
#neg(
@x),
#0) →
#LT#compare(
#neg(
@x),
#neg(
@y)) →
#compare(
@y,
@x)
#compare(
#neg(
@x),
#pos(
@y)) →
#LT#compare(
#pos(
@x),
#0) →
#GT#compare(
#pos(
@x),
#neg(
@y)) →
#GT#compare(
#pos(
@x),
#pos(
@y)) →
#compare(
@x,
@y)
#compare(
#s(
@x),
#0) →
#GT#compare(
#s(
@x),
#s(
@y)) →
#compare(
@x,
@y)
Types:
#less :: #0:#neg:#pos:#s → #0:#neg:#pos:#s → #false:#true
#cklt :: #EQ:#GT:#LT → #false:#true
#compare :: #0:#neg:#pos:#s → #0:#neg:#pos:#s → #EQ:#GT:#LT
append :: :::nil → :::nil → :::nil
append#1 :: :::nil → :::nil → :::nil
:: :: #0:#neg:#pos:#s → :::nil → :::nil
nil :: :::nil
flatten :: leaf:node → :::nil
flatten#1 :: leaf:node → :::nil
leaf :: leaf:node
node :: :::nil → leaf:node → leaf:node → leaf:node
flattensort :: leaf:node → :::nil
insertionsort :: :::nil → :::nil
insert :: #0:#neg:#pos:#s → :::nil → :::nil
insert#1 :: :::nil → #0:#neg:#pos:#s → :::nil
insert#2 :: #false:#true → #0:#neg:#pos:#s → #0:#neg:#pos:#s → :::nil → :::nil
#false :: #false:#true
#true :: #false:#true
insertionsort#1 :: :::nil → :::nil
#EQ :: #EQ:#GT:#LT
#GT :: #EQ:#GT:#LT
#LT :: #EQ:#GT:#LT
#0 :: #0:#neg:#pos:#s
#neg :: #0:#neg:#pos:#s → #0:#neg:#pos:#s
#pos :: #0:#neg:#pos:#s → #0:#neg:#pos:#s
#s :: #0:#neg:#pos:#s → #0:#neg:#pos:#s
hole_#false:#true1_3 :: #false:#true
hole_#0:#neg:#pos:#s2_3 :: #0:#neg:#pos:#s
hole_#EQ:#GT:#LT3_3 :: #EQ:#GT:#LT
hole_:::nil4_3 :: :::nil
hole_leaf:node5_3 :: leaf:node
gen_#0:#neg:#pos:#s6_3 :: Nat → #0:#neg:#pos:#s
gen_:::nil7_3 :: Nat → :::nil
gen_leaf:node8_3 :: Nat → leaf:node
Generator Equations:
gen_#0:#neg:#pos:#s6_3(0) ⇔ #0
gen_#0:#neg:#pos:#s6_3(+(x, 1)) ⇔ #neg(gen_#0:#neg:#pos:#s6_3(x))
gen_:::nil7_3(0) ⇔ nil
gen_:::nil7_3(+(x, 1)) ⇔ ::(#0, gen_:::nil7_3(x))
gen_leaf:node8_3(0) ⇔ leaf
gen_leaf:node8_3(+(x, 1)) ⇔ node(nil, leaf, gen_leaf:node8_3(x))
The following defined symbols remain to be analysed:
#compare, append, append#1, flatten, flatten#1, insertionsort, insert, insert#1, insertionsort#1
They will be analysed ascendingly in the following order:
append = append#1
append < flatten#1
flatten = flatten#1
insertionsort = insertionsort#1
insert = insert#1
insert < insertionsort#1
(7) RewriteLemmaProof (LOWER BOUND(ID) transformation)
Proved the following rewrite lemma:
#compare(
gen_#0:#neg:#pos:#s6_3(
n10_3),
gen_#0:#neg:#pos:#s6_3(
n10_3)) →
#EQ, rt ∈ Ω(0)
Induction Base:
#compare(gen_#0:#neg:#pos:#s6_3(0), gen_#0:#neg:#pos:#s6_3(0)) →RΩ(0)
#EQ
Induction Step:
#compare(gen_#0:#neg:#pos:#s6_3(+(n10_3, 1)), gen_#0:#neg:#pos:#s6_3(+(n10_3, 1))) →RΩ(0)
#compare(gen_#0:#neg:#pos:#s6_3(n10_3), gen_#0:#neg:#pos:#s6_3(n10_3)) →IH
#EQ
We have rt ∈ Ω(1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n0).
(8) Complex Obligation (BEST)
(9) Obligation:
Innermost TRS:
Rules:
#less(
@x,
@y) →
#cklt(
#compare(
@x,
@y))
append(
@l1,
@l2) →
append#1(
@l1,
@l2)
append#1(
::(
@x,
@xs),
@l2) →
::(
@x,
append(
@xs,
@l2))
append#1(
nil,
@l2) →
@l2flatten(
@t) →
flatten#1(
@t)
flatten#1(
leaf) →
nilflatten#1(
node(
@l,
@t1,
@t2)) →
append(
@l,
append(
flatten(
@t1),
flatten(
@t2)))
flattensort(
@t) →
insertionsort(
flatten(
@t))
insert(
@x,
@l) →
insert#1(
@l,
@x)
insert#1(
::(
@y,
@ys),
@x) →
insert#2(
#less(
@y,
@x),
@x,
@y,
@ys)
insert#1(
nil,
@x) →
::(
@x,
nil)
insert#2(
#false,
@x,
@y,
@ys) →
::(
@x,
::(
@y,
@ys))
insert#2(
#true,
@x,
@y,
@ys) →
::(
@y,
insert(
@x,
@ys))
insertionsort(
@l) →
insertionsort#1(
@l)
insertionsort#1(
::(
@x,
@xs)) →
insert(
@x,
insertionsort(
@xs))
insertionsort#1(
nil) →
nil#cklt(
#EQ) →
#false#cklt(
#GT) →
#false#cklt(
#LT) →
#true#compare(
#0,
#0) →
#EQ#compare(
#0,
#neg(
@y)) →
#GT#compare(
#0,
#pos(
@y)) →
#LT#compare(
#0,
#s(
@y)) →
#LT#compare(
#neg(
@x),
#0) →
#LT#compare(
#neg(
@x),
#neg(
@y)) →
#compare(
@y,
@x)
#compare(
#neg(
@x),
#pos(
@y)) →
#LT#compare(
#pos(
@x),
#0) →
#GT#compare(
#pos(
@x),
#neg(
@y)) →
#GT#compare(
#pos(
@x),
#pos(
@y)) →
#compare(
@x,
@y)
#compare(
#s(
@x),
#0) →
#GT#compare(
#s(
@x),
#s(
@y)) →
#compare(
@x,
@y)
Types:
#less :: #0:#neg:#pos:#s → #0:#neg:#pos:#s → #false:#true
#cklt :: #EQ:#GT:#LT → #false:#true
#compare :: #0:#neg:#pos:#s → #0:#neg:#pos:#s → #EQ:#GT:#LT
append :: :::nil → :::nil → :::nil
append#1 :: :::nil → :::nil → :::nil
:: :: #0:#neg:#pos:#s → :::nil → :::nil
nil :: :::nil
flatten :: leaf:node → :::nil
flatten#1 :: leaf:node → :::nil
leaf :: leaf:node
node :: :::nil → leaf:node → leaf:node → leaf:node
flattensort :: leaf:node → :::nil
insertionsort :: :::nil → :::nil
insert :: #0:#neg:#pos:#s → :::nil → :::nil
insert#1 :: :::nil → #0:#neg:#pos:#s → :::nil
insert#2 :: #false:#true → #0:#neg:#pos:#s → #0:#neg:#pos:#s → :::nil → :::nil
#false :: #false:#true
#true :: #false:#true
insertionsort#1 :: :::nil → :::nil
#EQ :: #EQ:#GT:#LT
#GT :: #EQ:#GT:#LT
#LT :: #EQ:#GT:#LT
#0 :: #0:#neg:#pos:#s
#neg :: #0:#neg:#pos:#s → #0:#neg:#pos:#s
#pos :: #0:#neg:#pos:#s → #0:#neg:#pos:#s
#s :: #0:#neg:#pos:#s → #0:#neg:#pos:#s
hole_#false:#true1_3 :: #false:#true
hole_#0:#neg:#pos:#s2_3 :: #0:#neg:#pos:#s
hole_#EQ:#GT:#LT3_3 :: #EQ:#GT:#LT
hole_:::nil4_3 :: :::nil
hole_leaf:node5_3 :: leaf:node
gen_#0:#neg:#pos:#s6_3 :: Nat → #0:#neg:#pos:#s
gen_:::nil7_3 :: Nat → :::nil
gen_leaf:node8_3 :: Nat → leaf:node
Lemmas:
#compare(gen_#0:#neg:#pos:#s6_3(n10_3), gen_#0:#neg:#pos:#s6_3(n10_3)) → #EQ, rt ∈ Ω(0)
Generator Equations:
gen_#0:#neg:#pos:#s6_3(0) ⇔ #0
gen_#0:#neg:#pos:#s6_3(+(x, 1)) ⇔ #neg(gen_#0:#neg:#pos:#s6_3(x))
gen_:::nil7_3(0) ⇔ nil
gen_:::nil7_3(+(x, 1)) ⇔ ::(#0, gen_:::nil7_3(x))
gen_leaf:node8_3(0) ⇔ leaf
gen_leaf:node8_3(+(x, 1)) ⇔ node(nil, leaf, gen_leaf:node8_3(x))
The following defined symbols remain to be analysed:
insert#1, append, append#1, flatten, flatten#1, insertionsort, insert, insertionsort#1
They will be analysed ascendingly in the following order:
append = append#1
append < flatten#1
flatten = flatten#1
insertionsort = insertionsort#1
insert = insert#1
insert < insertionsort#1
(10) NoRewriteLemmaProof (LOWER BOUND(ID) transformation)
Could not prove a rewrite lemma for the defined symbol insert#1.
(11) Obligation:
Innermost TRS:
Rules:
#less(
@x,
@y) →
#cklt(
#compare(
@x,
@y))
append(
@l1,
@l2) →
append#1(
@l1,
@l2)
append#1(
::(
@x,
@xs),
@l2) →
::(
@x,
append(
@xs,
@l2))
append#1(
nil,
@l2) →
@l2flatten(
@t) →
flatten#1(
@t)
flatten#1(
leaf) →
nilflatten#1(
node(
@l,
@t1,
@t2)) →
append(
@l,
append(
flatten(
@t1),
flatten(
@t2)))
flattensort(
@t) →
insertionsort(
flatten(
@t))
insert(
@x,
@l) →
insert#1(
@l,
@x)
insert#1(
::(
@y,
@ys),
@x) →
insert#2(
#less(
@y,
@x),
@x,
@y,
@ys)
insert#1(
nil,
@x) →
::(
@x,
nil)
insert#2(
#false,
@x,
@y,
@ys) →
::(
@x,
::(
@y,
@ys))
insert#2(
#true,
@x,
@y,
@ys) →
::(
@y,
insert(
@x,
@ys))
insertionsort(
@l) →
insertionsort#1(
@l)
insertionsort#1(
::(
@x,
@xs)) →
insert(
@x,
insertionsort(
@xs))
insertionsort#1(
nil) →
nil#cklt(
#EQ) →
#false#cklt(
#GT) →
#false#cklt(
#LT) →
#true#compare(
#0,
#0) →
#EQ#compare(
#0,
#neg(
@y)) →
#GT#compare(
#0,
#pos(
@y)) →
#LT#compare(
#0,
#s(
@y)) →
#LT#compare(
#neg(
@x),
#0) →
#LT#compare(
#neg(
@x),
#neg(
@y)) →
#compare(
@y,
@x)
#compare(
#neg(
@x),
#pos(
@y)) →
#LT#compare(
#pos(
@x),
#0) →
#GT#compare(
#pos(
@x),
#neg(
@y)) →
#GT#compare(
#pos(
@x),
#pos(
@y)) →
#compare(
@x,
@y)
#compare(
#s(
@x),
#0) →
#GT#compare(
#s(
@x),
#s(
@y)) →
#compare(
@x,
@y)
Types:
#less :: #0:#neg:#pos:#s → #0:#neg:#pos:#s → #false:#true
#cklt :: #EQ:#GT:#LT → #false:#true
#compare :: #0:#neg:#pos:#s → #0:#neg:#pos:#s → #EQ:#GT:#LT
append :: :::nil → :::nil → :::nil
append#1 :: :::nil → :::nil → :::nil
:: :: #0:#neg:#pos:#s → :::nil → :::nil
nil :: :::nil
flatten :: leaf:node → :::nil
flatten#1 :: leaf:node → :::nil
leaf :: leaf:node
node :: :::nil → leaf:node → leaf:node → leaf:node
flattensort :: leaf:node → :::nil
insertionsort :: :::nil → :::nil
insert :: #0:#neg:#pos:#s → :::nil → :::nil
insert#1 :: :::nil → #0:#neg:#pos:#s → :::nil
insert#2 :: #false:#true → #0:#neg:#pos:#s → #0:#neg:#pos:#s → :::nil → :::nil
#false :: #false:#true
#true :: #false:#true
insertionsort#1 :: :::nil → :::nil
#EQ :: #EQ:#GT:#LT
#GT :: #EQ:#GT:#LT
#LT :: #EQ:#GT:#LT
#0 :: #0:#neg:#pos:#s
#neg :: #0:#neg:#pos:#s → #0:#neg:#pos:#s
#pos :: #0:#neg:#pos:#s → #0:#neg:#pos:#s
#s :: #0:#neg:#pos:#s → #0:#neg:#pos:#s
hole_#false:#true1_3 :: #false:#true
hole_#0:#neg:#pos:#s2_3 :: #0:#neg:#pos:#s
hole_#EQ:#GT:#LT3_3 :: #EQ:#GT:#LT
hole_:::nil4_3 :: :::nil
hole_leaf:node5_3 :: leaf:node
gen_#0:#neg:#pos:#s6_3 :: Nat → #0:#neg:#pos:#s
gen_:::nil7_3 :: Nat → :::nil
gen_leaf:node8_3 :: Nat → leaf:node
Lemmas:
#compare(gen_#0:#neg:#pos:#s6_3(n10_3), gen_#0:#neg:#pos:#s6_3(n10_3)) → #EQ, rt ∈ Ω(0)
Generator Equations:
gen_#0:#neg:#pos:#s6_3(0) ⇔ #0
gen_#0:#neg:#pos:#s6_3(+(x, 1)) ⇔ #neg(gen_#0:#neg:#pos:#s6_3(x))
gen_:::nil7_3(0) ⇔ nil
gen_:::nil7_3(+(x, 1)) ⇔ ::(#0, gen_:::nil7_3(x))
gen_leaf:node8_3(0) ⇔ leaf
gen_leaf:node8_3(+(x, 1)) ⇔ node(nil, leaf, gen_leaf:node8_3(x))
The following defined symbols remain to be analysed:
insert, append, append#1, flatten, flatten#1, insertionsort, insertionsort#1
They will be analysed ascendingly in the following order:
append = append#1
append < flatten#1
flatten = flatten#1
insertionsort = insertionsort#1
insert = insert#1
insert < insertionsort#1
(12) NoRewriteLemmaProof (LOWER BOUND(ID) transformation)
Could not prove a rewrite lemma for the defined symbol insert.
(13) Obligation:
Innermost TRS:
Rules:
#less(
@x,
@y) →
#cklt(
#compare(
@x,
@y))
append(
@l1,
@l2) →
append#1(
@l1,
@l2)
append#1(
::(
@x,
@xs),
@l2) →
::(
@x,
append(
@xs,
@l2))
append#1(
nil,
@l2) →
@l2flatten(
@t) →
flatten#1(
@t)
flatten#1(
leaf) →
nilflatten#1(
node(
@l,
@t1,
@t2)) →
append(
@l,
append(
flatten(
@t1),
flatten(
@t2)))
flattensort(
@t) →
insertionsort(
flatten(
@t))
insert(
@x,
@l) →
insert#1(
@l,
@x)
insert#1(
::(
@y,
@ys),
@x) →
insert#2(
#less(
@y,
@x),
@x,
@y,
@ys)
insert#1(
nil,
@x) →
::(
@x,
nil)
insert#2(
#false,
@x,
@y,
@ys) →
::(
@x,
::(
@y,
@ys))
insert#2(
#true,
@x,
@y,
@ys) →
::(
@y,
insert(
@x,
@ys))
insertionsort(
@l) →
insertionsort#1(
@l)
insertionsort#1(
::(
@x,
@xs)) →
insert(
@x,
insertionsort(
@xs))
insertionsort#1(
nil) →
nil#cklt(
#EQ) →
#false#cklt(
#GT) →
#false#cklt(
#LT) →
#true#compare(
#0,
#0) →
#EQ#compare(
#0,
#neg(
@y)) →
#GT#compare(
#0,
#pos(
@y)) →
#LT#compare(
#0,
#s(
@y)) →
#LT#compare(
#neg(
@x),
#0) →
#LT#compare(
#neg(
@x),
#neg(
@y)) →
#compare(
@y,
@x)
#compare(
#neg(
@x),
#pos(
@y)) →
#LT#compare(
#pos(
@x),
#0) →
#GT#compare(
#pos(
@x),
#neg(
@y)) →
#GT#compare(
#pos(
@x),
#pos(
@y)) →
#compare(
@x,
@y)
#compare(
#s(
@x),
#0) →
#GT#compare(
#s(
@x),
#s(
@y)) →
#compare(
@x,
@y)
Types:
#less :: #0:#neg:#pos:#s → #0:#neg:#pos:#s → #false:#true
#cklt :: #EQ:#GT:#LT → #false:#true
#compare :: #0:#neg:#pos:#s → #0:#neg:#pos:#s → #EQ:#GT:#LT
append :: :::nil → :::nil → :::nil
append#1 :: :::nil → :::nil → :::nil
:: :: #0:#neg:#pos:#s → :::nil → :::nil
nil :: :::nil
flatten :: leaf:node → :::nil
flatten#1 :: leaf:node → :::nil
leaf :: leaf:node
node :: :::nil → leaf:node → leaf:node → leaf:node
flattensort :: leaf:node → :::nil
insertionsort :: :::nil → :::nil
insert :: #0:#neg:#pos:#s → :::nil → :::nil
insert#1 :: :::nil → #0:#neg:#pos:#s → :::nil
insert#2 :: #false:#true → #0:#neg:#pos:#s → #0:#neg:#pos:#s → :::nil → :::nil
#false :: #false:#true
#true :: #false:#true
insertionsort#1 :: :::nil → :::nil
#EQ :: #EQ:#GT:#LT
#GT :: #EQ:#GT:#LT
#LT :: #EQ:#GT:#LT
#0 :: #0:#neg:#pos:#s
#neg :: #0:#neg:#pos:#s → #0:#neg:#pos:#s
#pos :: #0:#neg:#pos:#s → #0:#neg:#pos:#s
#s :: #0:#neg:#pos:#s → #0:#neg:#pos:#s
hole_#false:#true1_3 :: #false:#true
hole_#0:#neg:#pos:#s2_3 :: #0:#neg:#pos:#s
hole_#EQ:#GT:#LT3_3 :: #EQ:#GT:#LT
hole_:::nil4_3 :: :::nil
hole_leaf:node5_3 :: leaf:node
gen_#0:#neg:#pos:#s6_3 :: Nat → #0:#neg:#pos:#s
gen_:::nil7_3 :: Nat → :::nil
gen_leaf:node8_3 :: Nat → leaf:node
Lemmas:
#compare(gen_#0:#neg:#pos:#s6_3(n10_3), gen_#0:#neg:#pos:#s6_3(n10_3)) → #EQ, rt ∈ Ω(0)
Generator Equations:
gen_#0:#neg:#pos:#s6_3(0) ⇔ #0
gen_#0:#neg:#pos:#s6_3(+(x, 1)) ⇔ #neg(gen_#0:#neg:#pos:#s6_3(x))
gen_:::nil7_3(0) ⇔ nil
gen_:::nil7_3(+(x, 1)) ⇔ ::(#0, gen_:::nil7_3(x))
gen_leaf:node8_3(0) ⇔ leaf
gen_leaf:node8_3(+(x, 1)) ⇔ node(nil, leaf, gen_leaf:node8_3(x))
The following defined symbols remain to be analysed:
insertionsort#1, append, append#1, flatten, flatten#1, insertionsort
They will be analysed ascendingly in the following order:
append = append#1
append < flatten#1
flatten = flatten#1
insertionsort = insertionsort#1
(14) NoRewriteLemmaProof (LOWER BOUND(ID) transformation)
Could not prove a rewrite lemma for the defined symbol insertionsort#1.
(15) Obligation:
Innermost TRS:
Rules:
#less(
@x,
@y) →
#cklt(
#compare(
@x,
@y))
append(
@l1,
@l2) →
append#1(
@l1,
@l2)
append#1(
::(
@x,
@xs),
@l2) →
::(
@x,
append(
@xs,
@l2))
append#1(
nil,
@l2) →
@l2flatten(
@t) →
flatten#1(
@t)
flatten#1(
leaf) →
nilflatten#1(
node(
@l,
@t1,
@t2)) →
append(
@l,
append(
flatten(
@t1),
flatten(
@t2)))
flattensort(
@t) →
insertionsort(
flatten(
@t))
insert(
@x,
@l) →
insert#1(
@l,
@x)
insert#1(
::(
@y,
@ys),
@x) →
insert#2(
#less(
@y,
@x),
@x,
@y,
@ys)
insert#1(
nil,
@x) →
::(
@x,
nil)
insert#2(
#false,
@x,
@y,
@ys) →
::(
@x,
::(
@y,
@ys))
insert#2(
#true,
@x,
@y,
@ys) →
::(
@y,
insert(
@x,
@ys))
insertionsort(
@l) →
insertionsort#1(
@l)
insertionsort#1(
::(
@x,
@xs)) →
insert(
@x,
insertionsort(
@xs))
insertionsort#1(
nil) →
nil#cklt(
#EQ) →
#false#cklt(
#GT) →
#false#cklt(
#LT) →
#true#compare(
#0,
#0) →
#EQ#compare(
#0,
#neg(
@y)) →
#GT#compare(
#0,
#pos(
@y)) →
#LT#compare(
#0,
#s(
@y)) →
#LT#compare(
#neg(
@x),
#0) →
#LT#compare(
#neg(
@x),
#neg(
@y)) →
#compare(
@y,
@x)
#compare(
#neg(
@x),
#pos(
@y)) →
#LT#compare(
#pos(
@x),
#0) →
#GT#compare(
#pos(
@x),
#neg(
@y)) →
#GT#compare(
#pos(
@x),
#pos(
@y)) →
#compare(
@x,
@y)
#compare(
#s(
@x),
#0) →
#GT#compare(
#s(
@x),
#s(
@y)) →
#compare(
@x,
@y)
Types:
#less :: #0:#neg:#pos:#s → #0:#neg:#pos:#s → #false:#true
#cklt :: #EQ:#GT:#LT → #false:#true
#compare :: #0:#neg:#pos:#s → #0:#neg:#pos:#s → #EQ:#GT:#LT
append :: :::nil → :::nil → :::nil
append#1 :: :::nil → :::nil → :::nil
:: :: #0:#neg:#pos:#s → :::nil → :::nil
nil :: :::nil
flatten :: leaf:node → :::nil
flatten#1 :: leaf:node → :::nil
leaf :: leaf:node
node :: :::nil → leaf:node → leaf:node → leaf:node
flattensort :: leaf:node → :::nil
insertionsort :: :::nil → :::nil
insert :: #0:#neg:#pos:#s → :::nil → :::nil
insert#1 :: :::nil → #0:#neg:#pos:#s → :::nil
insert#2 :: #false:#true → #0:#neg:#pos:#s → #0:#neg:#pos:#s → :::nil → :::nil
#false :: #false:#true
#true :: #false:#true
insertionsort#1 :: :::nil → :::nil
#EQ :: #EQ:#GT:#LT
#GT :: #EQ:#GT:#LT
#LT :: #EQ:#GT:#LT
#0 :: #0:#neg:#pos:#s
#neg :: #0:#neg:#pos:#s → #0:#neg:#pos:#s
#pos :: #0:#neg:#pos:#s → #0:#neg:#pos:#s
#s :: #0:#neg:#pos:#s → #0:#neg:#pos:#s
hole_#false:#true1_3 :: #false:#true
hole_#0:#neg:#pos:#s2_3 :: #0:#neg:#pos:#s
hole_#EQ:#GT:#LT3_3 :: #EQ:#GT:#LT
hole_:::nil4_3 :: :::nil
hole_leaf:node5_3 :: leaf:node
gen_#0:#neg:#pos:#s6_3 :: Nat → #0:#neg:#pos:#s
gen_:::nil7_3 :: Nat → :::nil
gen_leaf:node8_3 :: Nat → leaf:node
Lemmas:
#compare(gen_#0:#neg:#pos:#s6_3(n10_3), gen_#0:#neg:#pos:#s6_3(n10_3)) → #EQ, rt ∈ Ω(0)
Generator Equations:
gen_#0:#neg:#pos:#s6_3(0) ⇔ #0
gen_#0:#neg:#pos:#s6_3(+(x, 1)) ⇔ #neg(gen_#0:#neg:#pos:#s6_3(x))
gen_:::nil7_3(0) ⇔ nil
gen_:::nil7_3(+(x, 1)) ⇔ ::(#0, gen_:::nil7_3(x))
gen_leaf:node8_3(0) ⇔ leaf
gen_leaf:node8_3(+(x, 1)) ⇔ node(nil, leaf, gen_leaf:node8_3(x))
The following defined symbols remain to be analysed:
insertionsort, append, append#1, flatten, flatten#1
They will be analysed ascendingly in the following order:
append = append#1
append < flatten#1
flatten = flatten#1
insertionsort = insertionsort#1
(16) NoRewriteLemmaProof (LOWER BOUND(ID) transformation)
Could not prove a rewrite lemma for the defined symbol insertionsort.
(17) Obligation:
Innermost TRS:
Rules:
#less(
@x,
@y) →
#cklt(
#compare(
@x,
@y))
append(
@l1,
@l2) →
append#1(
@l1,
@l2)
append#1(
::(
@x,
@xs),
@l2) →
::(
@x,
append(
@xs,
@l2))
append#1(
nil,
@l2) →
@l2flatten(
@t) →
flatten#1(
@t)
flatten#1(
leaf) →
nilflatten#1(
node(
@l,
@t1,
@t2)) →
append(
@l,
append(
flatten(
@t1),
flatten(
@t2)))
flattensort(
@t) →
insertionsort(
flatten(
@t))
insert(
@x,
@l) →
insert#1(
@l,
@x)
insert#1(
::(
@y,
@ys),
@x) →
insert#2(
#less(
@y,
@x),
@x,
@y,
@ys)
insert#1(
nil,
@x) →
::(
@x,
nil)
insert#2(
#false,
@x,
@y,
@ys) →
::(
@x,
::(
@y,
@ys))
insert#2(
#true,
@x,
@y,
@ys) →
::(
@y,
insert(
@x,
@ys))
insertionsort(
@l) →
insertionsort#1(
@l)
insertionsort#1(
::(
@x,
@xs)) →
insert(
@x,
insertionsort(
@xs))
insertionsort#1(
nil) →
nil#cklt(
#EQ) →
#false#cklt(
#GT) →
#false#cklt(
#LT) →
#true#compare(
#0,
#0) →
#EQ#compare(
#0,
#neg(
@y)) →
#GT#compare(
#0,
#pos(
@y)) →
#LT#compare(
#0,
#s(
@y)) →
#LT#compare(
#neg(
@x),
#0) →
#LT#compare(
#neg(
@x),
#neg(
@y)) →
#compare(
@y,
@x)
#compare(
#neg(
@x),
#pos(
@y)) →
#LT#compare(
#pos(
@x),
#0) →
#GT#compare(
#pos(
@x),
#neg(
@y)) →
#GT#compare(
#pos(
@x),
#pos(
@y)) →
#compare(
@x,
@y)
#compare(
#s(
@x),
#0) →
#GT#compare(
#s(
@x),
#s(
@y)) →
#compare(
@x,
@y)
Types:
#less :: #0:#neg:#pos:#s → #0:#neg:#pos:#s → #false:#true
#cklt :: #EQ:#GT:#LT → #false:#true
#compare :: #0:#neg:#pos:#s → #0:#neg:#pos:#s → #EQ:#GT:#LT
append :: :::nil → :::nil → :::nil
append#1 :: :::nil → :::nil → :::nil
:: :: #0:#neg:#pos:#s → :::nil → :::nil
nil :: :::nil
flatten :: leaf:node → :::nil
flatten#1 :: leaf:node → :::nil
leaf :: leaf:node
node :: :::nil → leaf:node → leaf:node → leaf:node
flattensort :: leaf:node → :::nil
insertionsort :: :::nil → :::nil
insert :: #0:#neg:#pos:#s → :::nil → :::nil
insert#1 :: :::nil → #0:#neg:#pos:#s → :::nil
insert#2 :: #false:#true → #0:#neg:#pos:#s → #0:#neg:#pos:#s → :::nil → :::nil
#false :: #false:#true
#true :: #false:#true
insertionsort#1 :: :::nil → :::nil
#EQ :: #EQ:#GT:#LT
#GT :: #EQ:#GT:#LT
#LT :: #EQ:#GT:#LT
#0 :: #0:#neg:#pos:#s
#neg :: #0:#neg:#pos:#s → #0:#neg:#pos:#s
#pos :: #0:#neg:#pos:#s → #0:#neg:#pos:#s
#s :: #0:#neg:#pos:#s → #0:#neg:#pos:#s
hole_#false:#true1_3 :: #false:#true
hole_#0:#neg:#pos:#s2_3 :: #0:#neg:#pos:#s
hole_#EQ:#GT:#LT3_3 :: #EQ:#GT:#LT
hole_:::nil4_3 :: :::nil
hole_leaf:node5_3 :: leaf:node
gen_#0:#neg:#pos:#s6_3 :: Nat → #0:#neg:#pos:#s
gen_:::nil7_3 :: Nat → :::nil
gen_leaf:node8_3 :: Nat → leaf:node
Lemmas:
#compare(gen_#0:#neg:#pos:#s6_3(n10_3), gen_#0:#neg:#pos:#s6_3(n10_3)) → #EQ, rt ∈ Ω(0)
Generator Equations:
gen_#0:#neg:#pos:#s6_3(0) ⇔ #0
gen_#0:#neg:#pos:#s6_3(+(x, 1)) ⇔ #neg(gen_#0:#neg:#pos:#s6_3(x))
gen_:::nil7_3(0) ⇔ nil
gen_:::nil7_3(+(x, 1)) ⇔ ::(#0, gen_:::nil7_3(x))
gen_leaf:node8_3(0) ⇔ leaf
gen_leaf:node8_3(+(x, 1)) ⇔ node(nil, leaf, gen_leaf:node8_3(x))
The following defined symbols remain to be analysed:
append#1, append, flatten, flatten#1
They will be analysed ascendingly in the following order:
append = append#1
append < flatten#1
flatten = flatten#1
(18) RewriteLemmaProof (LOWER BOUND(ID) transformation)
Proved the following rewrite lemma:
append#1(
gen_:::nil7_3(
n325854_3),
gen_:::nil7_3(
b)) →
gen_:::nil7_3(
+(
n325854_3,
b)), rt ∈ Ω(1 + n325854
3)
Induction Base:
append#1(gen_:::nil7_3(0), gen_:::nil7_3(b)) →RΩ(1)
gen_:::nil7_3(b)
Induction Step:
append#1(gen_:::nil7_3(+(n325854_3, 1)), gen_:::nil7_3(b)) →RΩ(1)
::(#0, append(gen_:::nil7_3(n325854_3), gen_:::nil7_3(b))) →RΩ(1)
::(#0, append#1(gen_:::nil7_3(n325854_3), gen_:::nil7_3(b))) →IH
::(#0, gen_:::nil7_3(+(b, c325855_3)))
We have rt ∈ Ω(n1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
(19) Complex Obligation (BEST)
(20) Obligation:
Innermost TRS:
Rules:
#less(
@x,
@y) →
#cklt(
#compare(
@x,
@y))
append(
@l1,
@l2) →
append#1(
@l1,
@l2)
append#1(
::(
@x,
@xs),
@l2) →
::(
@x,
append(
@xs,
@l2))
append#1(
nil,
@l2) →
@l2flatten(
@t) →
flatten#1(
@t)
flatten#1(
leaf) →
nilflatten#1(
node(
@l,
@t1,
@t2)) →
append(
@l,
append(
flatten(
@t1),
flatten(
@t2)))
flattensort(
@t) →
insertionsort(
flatten(
@t))
insert(
@x,
@l) →
insert#1(
@l,
@x)
insert#1(
::(
@y,
@ys),
@x) →
insert#2(
#less(
@y,
@x),
@x,
@y,
@ys)
insert#1(
nil,
@x) →
::(
@x,
nil)
insert#2(
#false,
@x,
@y,
@ys) →
::(
@x,
::(
@y,
@ys))
insert#2(
#true,
@x,
@y,
@ys) →
::(
@y,
insert(
@x,
@ys))
insertionsort(
@l) →
insertionsort#1(
@l)
insertionsort#1(
::(
@x,
@xs)) →
insert(
@x,
insertionsort(
@xs))
insertionsort#1(
nil) →
nil#cklt(
#EQ) →
#false#cklt(
#GT) →
#false#cklt(
#LT) →
#true#compare(
#0,
#0) →
#EQ#compare(
#0,
#neg(
@y)) →
#GT#compare(
#0,
#pos(
@y)) →
#LT#compare(
#0,
#s(
@y)) →
#LT#compare(
#neg(
@x),
#0) →
#LT#compare(
#neg(
@x),
#neg(
@y)) →
#compare(
@y,
@x)
#compare(
#neg(
@x),
#pos(
@y)) →
#LT#compare(
#pos(
@x),
#0) →
#GT#compare(
#pos(
@x),
#neg(
@y)) →
#GT#compare(
#pos(
@x),
#pos(
@y)) →
#compare(
@x,
@y)
#compare(
#s(
@x),
#0) →
#GT#compare(
#s(
@x),
#s(
@y)) →
#compare(
@x,
@y)
Types:
#less :: #0:#neg:#pos:#s → #0:#neg:#pos:#s → #false:#true
#cklt :: #EQ:#GT:#LT → #false:#true
#compare :: #0:#neg:#pos:#s → #0:#neg:#pos:#s → #EQ:#GT:#LT
append :: :::nil → :::nil → :::nil
append#1 :: :::nil → :::nil → :::nil
:: :: #0:#neg:#pos:#s → :::nil → :::nil
nil :: :::nil
flatten :: leaf:node → :::nil
flatten#1 :: leaf:node → :::nil
leaf :: leaf:node
node :: :::nil → leaf:node → leaf:node → leaf:node
flattensort :: leaf:node → :::nil
insertionsort :: :::nil → :::nil
insert :: #0:#neg:#pos:#s → :::nil → :::nil
insert#1 :: :::nil → #0:#neg:#pos:#s → :::nil
insert#2 :: #false:#true → #0:#neg:#pos:#s → #0:#neg:#pos:#s → :::nil → :::nil
#false :: #false:#true
#true :: #false:#true
insertionsort#1 :: :::nil → :::nil
#EQ :: #EQ:#GT:#LT
#GT :: #EQ:#GT:#LT
#LT :: #EQ:#GT:#LT
#0 :: #0:#neg:#pos:#s
#neg :: #0:#neg:#pos:#s → #0:#neg:#pos:#s
#pos :: #0:#neg:#pos:#s → #0:#neg:#pos:#s
#s :: #0:#neg:#pos:#s → #0:#neg:#pos:#s
hole_#false:#true1_3 :: #false:#true
hole_#0:#neg:#pos:#s2_3 :: #0:#neg:#pos:#s
hole_#EQ:#GT:#LT3_3 :: #EQ:#GT:#LT
hole_:::nil4_3 :: :::nil
hole_leaf:node5_3 :: leaf:node
gen_#0:#neg:#pos:#s6_3 :: Nat → #0:#neg:#pos:#s
gen_:::nil7_3 :: Nat → :::nil
gen_leaf:node8_3 :: Nat → leaf:node
Lemmas:
#compare(gen_#0:#neg:#pos:#s6_3(n10_3), gen_#0:#neg:#pos:#s6_3(n10_3)) → #EQ, rt ∈ Ω(0)
append#1(gen_:::nil7_3(n325854_3), gen_:::nil7_3(b)) → gen_:::nil7_3(+(n325854_3, b)), rt ∈ Ω(1 + n3258543)
Generator Equations:
gen_#0:#neg:#pos:#s6_3(0) ⇔ #0
gen_#0:#neg:#pos:#s6_3(+(x, 1)) ⇔ #neg(gen_#0:#neg:#pos:#s6_3(x))
gen_:::nil7_3(0) ⇔ nil
gen_:::nil7_3(+(x, 1)) ⇔ ::(#0, gen_:::nil7_3(x))
gen_leaf:node8_3(0) ⇔ leaf
gen_leaf:node8_3(+(x, 1)) ⇔ node(nil, leaf, gen_leaf:node8_3(x))
The following defined symbols remain to be analysed:
append, flatten, flatten#1
They will be analysed ascendingly in the following order:
append = append#1
append < flatten#1
flatten = flatten#1
(21) NoRewriteLemmaProof (LOWER BOUND(ID) transformation)
Could not prove a rewrite lemma for the defined symbol append.
(22) Obligation:
Innermost TRS:
Rules:
#less(
@x,
@y) →
#cklt(
#compare(
@x,
@y))
append(
@l1,
@l2) →
append#1(
@l1,
@l2)
append#1(
::(
@x,
@xs),
@l2) →
::(
@x,
append(
@xs,
@l2))
append#1(
nil,
@l2) →
@l2flatten(
@t) →
flatten#1(
@t)
flatten#1(
leaf) →
nilflatten#1(
node(
@l,
@t1,
@t2)) →
append(
@l,
append(
flatten(
@t1),
flatten(
@t2)))
flattensort(
@t) →
insertionsort(
flatten(
@t))
insert(
@x,
@l) →
insert#1(
@l,
@x)
insert#1(
::(
@y,
@ys),
@x) →
insert#2(
#less(
@y,
@x),
@x,
@y,
@ys)
insert#1(
nil,
@x) →
::(
@x,
nil)
insert#2(
#false,
@x,
@y,
@ys) →
::(
@x,
::(
@y,
@ys))
insert#2(
#true,
@x,
@y,
@ys) →
::(
@y,
insert(
@x,
@ys))
insertionsort(
@l) →
insertionsort#1(
@l)
insertionsort#1(
::(
@x,
@xs)) →
insert(
@x,
insertionsort(
@xs))
insertionsort#1(
nil) →
nil#cklt(
#EQ) →
#false#cklt(
#GT) →
#false#cklt(
#LT) →
#true#compare(
#0,
#0) →
#EQ#compare(
#0,
#neg(
@y)) →
#GT#compare(
#0,
#pos(
@y)) →
#LT#compare(
#0,
#s(
@y)) →
#LT#compare(
#neg(
@x),
#0) →
#LT#compare(
#neg(
@x),
#neg(
@y)) →
#compare(
@y,
@x)
#compare(
#neg(
@x),
#pos(
@y)) →
#LT#compare(
#pos(
@x),
#0) →
#GT#compare(
#pos(
@x),
#neg(
@y)) →
#GT#compare(
#pos(
@x),
#pos(
@y)) →
#compare(
@x,
@y)
#compare(
#s(
@x),
#0) →
#GT#compare(
#s(
@x),
#s(
@y)) →
#compare(
@x,
@y)
Types:
#less :: #0:#neg:#pos:#s → #0:#neg:#pos:#s → #false:#true
#cklt :: #EQ:#GT:#LT → #false:#true
#compare :: #0:#neg:#pos:#s → #0:#neg:#pos:#s → #EQ:#GT:#LT
append :: :::nil → :::nil → :::nil
append#1 :: :::nil → :::nil → :::nil
:: :: #0:#neg:#pos:#s → :::nil → :::nil
nil :: :::nil
flatten :: leaf:node → :::nil
flatten#1 :: leaf:node → :::nil
leaf :: leaf:node
node :: :::nil → leaf:node → leaf:node → leaf:node
flattensort :: leaf:node → :::nil
insertionsort :: :::nil → :::nil
insert :: #0:#neg:#pos:#s → :::nil → :::nil
insert#1 :: :::nil → #0:#neg:#pos:#s → :::nil
insert#2 :: #false:#true → #0:#neg:#pos:#s → #0:#neg:#pos:#s → :::nil → :::nil
#false :: #false:#true
#true :: #false:#true
insertionsort#1 :: :::nil → :::nil
#EQ :: #EQ:#GT:#LT
#GT :: #EQ:#GT:#LT
#LT :: #EQ:#GT:#LT
#0 :: #0:#neg:#pos:#s
#neg :: #0:#neg:#pos:#s → #0:#neg:#pos:#s
#pos :: #0:#neg:#pos:#s → #0:#neg:#pos:#s
#s :: #0:#neg:#pos:#s → #0:#neg:#pos:#s
hole_#false:#true1_3 :: #false:#true
hole_#0:#neg:#pos:#s2_3 :: #0:#neg:#pos:#s
hole_#EQ:#GT:#LT3_3 :: #EQ:#GT:#LT
hole_:::nil4_3 :: :::nil
hole_leaf:node5_3 :: leaf:node
gen_#0:#neg:#pos:#s6_3 :: Nat → #0:#neg:#pos:#s
gen_:::nil7_3 :: Nat → :::nil
gen_leaf:node8_3 :: Nat → leaf:node
Lemmas:
#compare(gen_#0:#neg:#pos:#s6_3(n10_3), gen_#0:#neg:#pos:#s6_3(n10_3)) → #EQ, rt ∈ Ω(0)
append#1(gen_:::nil7_3(n325854_3), gen_:::nil7_3(b)) → gen_:::nil7_3(+(n325854_3, b)), rt ∈ Ω(1 + n3258543)
Generator Equations:
gen_#0:#neg:#pos:#s6_3(0) ⇔ #0
gen_#0:#neg:#pos:#s6_3(+(x, 1)) ⇔ #neg(gen_#0:#neg:#pos:#s6_3(x))
gen_:::nil7_3(0) ⇔ nil
gen_:::nil7_3(+(x, 1)) ⇔ ::(#0, gen_:::nil7_3(x))
gen_leaf:node8_3(0) ⇔ leaf
gen_leaf:node8_3(+(x, 1)) ⇔ node(nil, leaf, gen_leaf:node8_3(x))
The following defined symbols remain to be analysed:
flatten#1, flatten
They will be analysed ascendingly in the following order:
flatten = flatten#1
(23) RewriteLemmaProof (LOWER BOUND(ID) transformation)
Proved the following rewrite lemma:
flatten#1(
gen_leaf:node8_3(
n327215_3)) →
gen_:::nil7_3(
0), rt ∈ Ω(1 + n327215
3)
Induction Base:
flatten#1(gen_leaf:node8_3(0)) →RΩ(1)
nil
Induction Step:
flatten#1(gen_leaf:node8_3(+(n327215_3, 1))) →RΩ(1)
append(nil, append(flatten(leaf), flatten(gen_leaf:node8_3(n327215_3)))) →RΩ(1)
append(nil, append(flatten#1(leaf), flatten(gen_leaf:node8_3(n327215_3)))) →RΩ(1)
append(nil, append(nil, flatten(gen_leaf:node8_3(n327215_3)))) →RΩ(1)
append(nil, append(nil, flatten#1(gen_leaf:node8_3(n327215_3)))) →IH
append(nil, append(nil, gen_:::nil7_3(0))) →RΩ(1)
append(nil, append#1(nil, gen_:::nil7_3(0))) →LΩ(1)
append(nil, gen_:::nil7_3(+(0, 0))) →RΩ(1)
append#1(nil, gen_:::nil7_3(0)) →LΩ(1)
gen_:::nil7_3(+(0, 0))
We have rt ∈ Ω(n1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
(24) Complex Obligation (BEST)
(25) Obligation:
Innermost TRS:
Rules:
#less(
@x,
@y) →
#cklt(
#compare(
@x,
@y))
append(
@l1,
@l2) →
append#1(
@l1,
@l2)
append#1(
::(
@x,
@xs),
@l2) →
::(
@x,
append(
@xs,
@l2))
append#1(
nil,
@l2) →
@l2flatten(
@t) →
flatten#1(
@t)
flatten#1(
leaf) →
nilflatten#1(
node(
@l,
@t1,
@t2)) →
append(
@l,
append(
flatten(
@t1),
flatten(
@t2)))
flattensort(
@t) →
insertionsort(
flatten(
@t))
insert(
@x,
@l) →
insert#1(
@l,
@x)
insert#1(
::(
@y,
@ys),
@x) →
insert#2(
#less(
@y,
@x),
@x,
@y,
@ys)
insert#1(
nil,
@x) →
::(
@x,
nil)
insert#2(
#false,
@x,
@y,
@ys) →
::(
@x,
::(
@y,
@ys))
insert#2(
#true,
@x,
@y,
@ys) →
::(
@y,
insert(
@x,
@ys))
insertionsort(
@l) →
insertionsort#1(
@l)
insertionsort#1(
::(
@x,
@xs)) →
insert(
@x,
insertionsort(
@xs))
insertionsort#1(
nil) →
nil#cklt(
#EQ) →
#false#cklt(
#GT) →
#false#cklt(
#LT) →
#true#compare(
#0,
#0) →
#EQ#compare(
#0,
#neg(
@y)) →
#GT#compare(
#0,
#pos(
@y)) →
#LT#compare(
#0,
#s(
@y)) →
#LT#compare(
#neg(
@x),
#0) →
#LT#compare(
#neg(
@x),
#neg(
@y)) →
#compare(
@y,
@x)
#compare(
#neg(
@x),
#pos(
@y)) →
#LT#compare(
#pos(
@x),
#0) →
#GT#compare(
#pos(
@x),
#neg(
@y)) →
#GT#compare(
#pos(
@x),
#pos(
@y)) →
#compare(
@x,
@y)
#compare(
#s(
@x),
#0) →
#GT#compare(
#s(
@x),
#s(
@y)) →
#compare(
@x,
@y)
Types:
#less :: #0:#neg:#pos:#s → #0:#neg:#pos:#s → #false:#true
#cklt :: #EQ:#GT:#LT → #false:#true
#compare :: #0:#neg:#pos:#s → #0:#neg:#pos:#s → #EQ:#GT:#LT
append :: :::nil → :::nil → :::nil
append#1 :: :::nil → :::nil → :::nil
:: :: #0:#neg:#pos:#s → :::nil → :::nil
nil :: :::nil
flatten :: leaf:node → :::nil
flatten#1 :: leaf:node → :::nil
leaf :: leaf:node
node :: :::nil → leaf:node → leaf:node → leaf:node
flattensort :: leaf:node → :::nil
insertionsort :: :::nil → :::nil
insert :: #0:#neg:#pos:#s → :::nil → :::nil
insert#1 :: :::nil → #0:#neg:#pos:#s → :::nil
insert#2 :: #false:#true → #0:#neg:#pos:#s → #0:#neg:#pos:#s → :::nil → :::nil
#false :: #false:#true
#true :: #false:#true
insertionsort#1 :: :::nil → :::nil
#EQ :: #EQ:#GT:#LT
#GT :: #EQ:#GT:#LT
#LT :: #EQ:#GT:#LT
#0 :: #0:#neg:#pos:#s
#neg :: #0:#neg:#pos:#s → #0:#neg:#pos:#s
#pos :: #0:#neg:#pos:#s → #0:#neg:#pos:#s
#s :: #0:#neg:#pos:#s → #0:#neg:#pos:#s
hole_#false:#true1_3 :: #false:#true
hole_#0:#neg:#pos:#s2_3 :: #0:#neg:#pos:#s
hole_#EQ:#GT:#LT3_3 :: #EQ:#GT:#LT
hole_:::nil4_3 :: :::nil
hole_leaf:node5_3 :: leaf:node
gen_#0:#neg:#pos:#s6_3 :: Nat → #0:#neg:#pos:#s
gen_:::nil7_3 :: Nat → :::nil
gen_leaf:node8_3 :: Nat → leaf:node
Lemmas:
#compare(gen_#0:#neg:#pos:#s6_3(n10_3), gen_#0:#neg:#pos:#s6_3(n10_3)) → #EQ, rt ∈ Ω(0)
append#1(gen_:::nil7_3(n325854_3), gen_:::nil7_3(b)) → gen_:::nil7_3(+(n325854_3, b)), rt ∈ Ω(1 + n3258543)
flatten#1(gen_leaf:node8_3(n327215_3)) → gen_:::nil7_3(0), rt ∈ Ω(1 + n3272153)
Generator Equations:
gen_#0:#neg:#pos:#s6_3(0) ⇔ #0
gen_#0:#neg:#pos:#s6_3(+(x, 1)) ⇔ #neg(gen_#0:#neg:#pos:#s6_3(x))
gen_:::nil7_3(0) ⇔ nil
gen_:::nil7_3(+(x, 1)) ⇔ ::(#0, gen_:::nil7_3(x))
gen_leaf:node8_3(0) ⇔ leaf
gen_leaf:node8_3(+(x, 1)) ⇔ node(nil, leaf, gen_leaf:node8_3(x))
The following defined symbols remain to be analysed:
flatten
They will be analysed ascendingly in the following order:
flatten = flatten#1
(26) NoRewriteLemmaProof (LOWER BOUND(ID) transformation)
Could not prove a rewrite lemma for the defined symbol flatten.
(27) Obligation:
Innermost TRS:
Rules:
#less(
@x,
@y) →
#cklt(
#compare(
@x,
@y))
append(
@l1,
@l2) →
append#1(
@l1,
@l2)
append#1(
::(
@x,
@xs),
@l2) →
::(
@x,
append(
@xs,
@l2))
append#1(
nil,
@l2) →
@l2flatten(
@t) →
flatten#1(
@t)
flatten#1(
leaf) →
nilflatten#1(
node(
@l,
@t1,
@t2)) →
append(
@l,
append(
flatten(
@t1),
flatten(
@t2)))
flattensort(
@t) →
insertionsort(
flatten(
@t))
insert(
@x,
@l) →
insert#1(
@l,
@x)
insert#1(
::(
@y,
@ys),
@x) →
insert#2(
#less(
@y,
@x),
@x,
@y,
@ys)
insert#1(
nil,
@x) →
::(
@x,
nil)
insert#2(
#false,
@x,
@y,
@ys) →
::(
@x,
::(
@y,
@ys))
insert#2(
#true,
@x,
@y,
@ys) →
::(
@y,
insert(
@x,
@ys))
insertionsort(
@l) →
insertionsort#1(
@l)
insertionsort#1(
::(
@x,
@xs)) →
insert(
@x,
insertionsort(
@xs))
insertionsort#1(
nil) →
nil#cklt(
#EQ) →
#false#cklt(
#GT) →
#false#cklt(
#LT) →
#true#compare(
#0,
#0) →
#EQ#compare(
#0,
#neg(
@y)) →
#GT#compare(
#0,
#pos(
@y)) →
#LT#compare(
#0,
#s(
@y)) →
#LT#compare(
#neg(
@x),
#0) →
#LT#compare(
#neg(
@x),
#neg(
@y)) →
#compare(
@y,
@x)
#compare(
#neg(
@x),
#pos(
@y)) →
#LT#compare(
#pos(
@x),
#0) →
#GT#compare(
#pos(
@x),
#neg(
@y)) →
#GT#compare(
#pos(
@x),
#pos(
@y)) →
#compare(
@x,
@y)
#compare(
#s(
@x),
#0) →
#GT#compare(
#s(
@x),
#s(
@y)) →
#compare(
@x,
@y)
Types:
#less :: #0:#neg:#pos:#s → #0:#neg:#pos:#s → #false:#true
#cklt :: #EQ:#GT:#LT → #false:#true
#compare :: #0:#neg:#pos:#s → #0:#neg:#pos:#s → #EQ:#GT:#LT
append :: :::nil → :::nil → :::nil
append#1 :: :::nil → :::nil → :::nil
:: :: #0:#neg:#pos:#s → :::nil → :::nil
nil :: :::nil
flatten :: leaf:node → :::nil
flatten#1 :: leaf:node → :::nil
leaf :: leaf:node
node :: :::nil → leaf:node → leaf:node → leaf:node
flattensort :: leaf:node → :::nil
insertionsort :: :::nil → :::nil
insert :: #0:#neg:#pos:#s → :::nil → :::nil
insert#1 :: :::nil → #0:#neg:#pos:#s → :::nil
insert#2 :: #false:#true → #0:#neg:#pos:#s → #0:#neg:#pos:#s → :::nil → :::nil
#false :: #false:#true
#true :: #false:#true
insertionsort#1 :: :::nil → :::nil
#EQ :: #EQ:#GT:#LT
#GT :: #EQ:#GT:#LT
#LT :: #EQ:#GT:#LT
#0 :: #0:#neg:#pos:#s
#neg :: #0:#neg:#pos:#s → #0:#neg:#pos:#s
#pos :: #0:#neg:#pos:#s → #0:#neg:#pos:#s
#s :: #0:#neg:#pos:#s → #0:#neg:#pos:#s
hole_#false:#true1_3 :: #false:#true
hole_#0:#neg:#pos:#s2_3 :: #0:#neg:#pos:#s
hole_#EQ:#GT:#LT3_3 :: #EQ:#GT:#LT
hole_:::nil4_3 :: :::nil
hole_leaf:node5_3 :: leaf:node
gen_#0:#neg:#pos:#s6_3 :: Nat → #0:#neg:#pos:#s
gen_:::nil7_3 :: Nat → :::nil
gen_leaf:node8_3 :: Nat → leaf:node
Lemmas:
#compare(gen_#0:#neg:#pos:#s6_3(n10_3), gen_#0:#neg:#pos:#s6_3(n10_3)) → #EQ, rt ∈ Ω(0)
append#1(gen_:::nil7_3(n325854_3), gen_:::nil7_3(b)) → gen_:::nil7_3(+(n325854_3, b)), rt ∈ Ω(1 + n3258543)
flatten#1(gen_leaf:node8_3(n327215_3)) → gen_:::nil7_3(0), rt ∈ Ω(1 + n3272153)
Generator Equations:
gen_#0:#neg:#pos:#s6_3(0) ⇔ #0
gen_#0:#neg:#pos:#s6_3(+(x, 1)) ⇔ #neg(gen_#0:#neg:#pos:#s6_3(x))
gen_:::nil7_3(0) ⇔ nil
gen_:::nil7_3(+(x, 1)) ⇔ ::(#0, gen_:::nil7_3(x))
gen_leaf:node8_3(0) ⇔ leaf
gen_leaf:node8_3(+(x, 1)) ⇔ node(nil, leaf, gen_leaf:node8_3(x))
No more defined symbols left to analyse.
(28) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
append#1(gen_:::nil7_3(n325854_3), gen_:::nil7_3(b)) → gen_:::nil7_3(+(n325854_3, b)), rt ∈ Ω(1 + n3258543)
(29) BOUNDS(n^1, INF)
(30) Obligation:
Innermost TRS:
Rules:
#less(
@x,
@y) →
#cklt(
#compare(
@x,
@y))
append(
@l1,
@l2) →
append#1(
@l1,
@l2)
append#1(
::(
@x,
@xs),
@l2) →
::(
@x,
append(
@xs,
@l2))
append#1(
nil,
@l2) →
@l2flatten(
@t) →
flatten#1(
@t)
flatten#1(
leaf) →
nilflatten#1(
node(
@l,
@t1,
@t2)) →
append(
@l,
append(
flatten(
@t1),
flatten(
@t2)))
flattensort(
@t) →
insertionsort(
flatten(
@t))
insert(
@x,
@l) →
insert#1(
@l,
@x)
insert#1(
::(
@y,
@ys),
@x) →
insert#2(
#less(
@y,
@x),
@x,
@y,
@ys)
insert#1(
nil,
@x) →
::(
@x,
nil)
insert#2(
#false,
@x,
@y,
@ys) →
::(
@x,
::(
@y,
@ys))
insert#2(
#true,
@x,
@y,
@ys) →
::(
@y,
insert(
@x,
@ys))
insertionsort(
@l) →
insertionsort#1(
@l)
insertionsort#1(
::(
@x,
@xs)) →
insert(
@x,
insertionsort(
@xs))
insertionsort#1(
nil) →
nil#cklt(
#EQ) →
#false#cklt(
#GT) →
#false#cklt(
#LT) →
#true#compare(
#0,
#0) →
#EQ#compare(
#0,
#neg(
@y)) →
#GT#compare(
#0,
#pos(
@y)) →
#LT#compare(
#0,
#s(
@y)) →
#LT#compare(
#neg(
@x),
#0) →
#LT#compare(
#neg(
@x),
#neg(
@y)) →
#compare(
@y,
@x)
#compare(
#neg(
@x),
#pos(
@y)) →
#LT#compare(
#pos(
@x),
#0) →
#GT#compare(
#pos(
@x),
#neg(
@y)) →
#GT#compare(
#pos(
@x),
#pos(
@y)) →
#compare(
@x,
@y)
#compare(
#s(
@x),
#0) →
#GT#compare(
#s(
@x),
#s(
@y)) →
#compare(
@x,
@y)
Types:
#less :: #0:#neg:#pos:#s → #0:#neg:#pos:#s → #false:#true
#cklt :: #EQ:#GT:#LT → #false:#true
#compare :: #0:#neg:#pos:#s → #0:#neg:#pos:#s → #EQ:#GT:#LT
append :: :::nil → :::nil → :::nil
append#1 :: :::nil → :::nil → :::nil
:: :: #0:#neg:#pos:#s → :::nil → :::nil
nil :: :::nil
flatten :: leaf:node → :::nil
flatten#1 :: leaf:node → :::nil
leaf :: leaf:node
node :: :::nil → leaf:node → leaf:node → leaf:node
flattensort :: leaf:node → :::nil
insertionsort :: :::nil → :::nil
insert :: #0:#neg:#pos:#s → :::nil → :::nil
insert#1 :: :::nil → #0:#neg:#pos:#s → :::nil
insert#2 :: #false:#true → #0:#neg:#pos:#s → #0:#neg:#pos:#s → :::nil → :::nil
#false :: #false:#true
#true :: #false:#true
insertionsort#1 :: :::nil → :::nil
#EQ :: #EQ:#GT:#LT
#GT :: #EQ:#GT:#LT
#LT :: #EQ:#GT:#LT
#0 :: #0:#neg:#pos:#s
#neg :: #0:#neg:#pos:#s → #0:#neg:#pos:#s
#pos :: #0:#neg:#pos:#s → #0:#neg:#pos:#s
#s :: #0:#neg:#pos:#s → #0:#neg:#pos:#s
hole_#false:#true1_3 :: #false:#true
hole_#0:#neg:#pos:#s2_3 :: #0:#neg:#pos:#s
hole_#EQ:#GT:#LT3_3 :: #EQ:#GT:#LT
hole_:::nil4_3 :: :::nil
hole_leaf:node5_3 :: leaf:node
gen_#0:#neg:#pos:#s6_3 :: Nat → #0:#neg:#pos:#s
gen_:::nil7_3 :: Nat → :::nil
gen_leaf:node8_3 :: Nat → leaf:node
Lemmas:
#compare(gen_#0:#neg:#pos:#s6_3(n10_3), gen_#0:#neg:#pos:#s6_3(n10_3)) → #EQ, rt ∈ Ω(0)
append#1(gen_:::nil7_3(n325854_3), gen_:::nil7_3(b)) → gen_:::nil7_3(+(n325854_3, b)), rt ∈ Ω(1 + n3258543)
flatten#1(gen_leaf:node8_3(n327215_3)) → gen_:::nil7_3(0), rt ∈ Ω(1 + n3272153)
Generator Equations:
gen_#0:#neg:#pos:#s6_3(0) ⇔ #0
gen_#0:#neg:#pos:#s6_3(+(x, 1)) ⇔ #neg(gen_#0:#neg:#pos:#s6_3(x))
gen_:::nil7_3(0) ⇔ nil
gen_:::nil7_3(+(x, 1)) ⇔ ::(#0, gen_:::nil7_3(x))
gen_leaf:node8_3(0) ⇔ leaf
gen_leaf:node8_3(+(x, 1)) ⇔ node(nil, leaf, gen_leaf:node8_3(x))
No more defined symbols left to analyse.
(31) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
append#1(gen_:::nil7_3(n325854_3), gen_:::nil7_3(b)) → gen_:::nil7_3(+(n325854_3, b)), rt ∈ Ω(1 + n3258543)
(32) BOUNDS(n^1, INF)
(33) Obligation:
Innermost TRS:
Rules:
#less(
@x,
@y) →
#cklt(
#compare(
@x,
@y))
append(
@l1,
@l2) →
append#1(
@l1,
@l2)
append#1(
::(
@x,
@xs),
@l2) →
::(
@x,
append(
@xs,
@l2))
append#1(
nil,
@l2) →
@l2flatten(
@t) →
flatten#1(
@t)
flatten#1(
leaf) →
nilflatten#1(
node(
@l,
@t1,
@t2)) →
append(
@l,
append(
flatten(
@t1),
flatten(
@t2)))
flattensort(
@t) →
insertionsort(
flatten(
@t))
insert(
@x,
@l) →
insert#1(
@l,
@x)
insert#1(
::(
@y,
@ys),
@x) →
insert#2(
#less(
@y,
@x),
@x,
@y,
@ys)
insert#1(
nil,
@x) →
::(
@x,
nil)
insert#2(
#false,
@x,
@y,
@ys) →
::(
@x,
::(
@y,
@ys))
insert#2(
#true,
@x,
@y,
@ys) →
::(
@y,
insert(
@x,
@ys))
insertionsort(
@l) →
insertionsort#1(
@l)
insertionsort#1(
::(
@x,
@xs)) →
insert(
@x,
insertionsort(
@xs))
insertionsort#1(
nil) →
nil#cklt(
#EQ) →
#false#cklt(
#GT) →
#false#cklt(
#LT) →
#true#compare(
#0,
#0) →
#EQ#compare(
#0,
#neg(
@y)) →
#GT#compare(
#0,
#pos(
@y)) →
#LT#compare(
#0,
#s(
@y)) →
#LT#compare(
#neg(
@x),
#0) →
#LT#compare(
#neg(
@x),
#neg(
@y)) →
#compare(
@y,
@x)
#compare(
#neg(
@x),
#pos(
@y)) →
#LT#compare(
#pos(
@x),
#0) →
#GT#compare(
#pos(
@x),
#neg(
@y)) →
#GT#compare(
#pos(
@x),
#pos(
@y)) →
#compare(
@x,
@y)
#compare(
#s(
@x),
#0) →
#GT#compare(
#s(
@x),
#s(
@y)) →
#compare(
@x,
@y)
Types:
#less :: #0:#neg:#pos:#s → #0:#neg:#pos:#s → #false:#true
#cklt :: #EQ:#GT:#LT → #false:#true
#compare :: #0:#neg:#pos:#s → #0:#neg:#pos:#s → #EQ:#GT:#LT
append :: :::nil → :::nil → :::nil
append#1 :: :::nil → :::nil → :::nil
:: :: #0:#neg:#pos:#s → :::nil → :::nil
nil :: :::nil
flatten :: leaf:node → :::nil
flatten#1 :: leaf:node → :::nil
leaf :: leaf:node
node :: :::nil → leaf:node → leaf:node → leaf:node
flattensort :: leaf:node → :::nil
insertionsort :: :::nil → :::nil
insert :: #0:#neg:#pos:#s → :::nil → :::nil
insert#1 :: :::nil → #0:#neg:#pos:#s → :::nil
insert#2 :: #false:#true → #0:#neg:#pos:#s → #0:#neg:#pos:#s → :::nil → :::nil
#false :: #false:#true
#true :: #false:#true
insertionsort#1 :: :::nil → :::nil
#EQ :: #EQ:#GT:#LT
#GT :: #EQ:#GT:#LT
#LT :: #EQ:#GT:#LT
#0 :: #0:#neg:#pos:#s
#neg :: #0:#neg:#pos:#s → #0:#neg:#pos:#s
#pos :: #0:#neg:#pos:#s → #0:#neg:#pos:#s
#s :: #0:#neg:#pos:#s → #0:#neg:#pos:#s
hole_#false:#true1_3 :: #false:#true
hole_#0:#neg:#pos:#s2_3 :: #0:#neg:#pos:#s
hole_#EQ:#GT:#LT3_3 :: #EQ:#GT:#LT
hole_:::nil4_3 :: :::nil
hole_leaf:node5_3 :: leaf:node
gen_#0:#neg:#pos:#s6_3 :: Nat → #0:#neg:#pos:#s
gen_:::nil7_3 :: Nat → :::nil
gen_leaf:node8_3 :: Nat → leaf:node
Lemmas:
#compare(gen_#0:#neg:#pos:#s6_3(n10_3), gen_#0:#neg:#pos:#s6_3(n10_3)) → #EQ, rt ∈ Ω(0)
append#1(gen_:::nil7_3(n325854_3), gen_:::nil7_3(b)) → gen_:::nil7_3(+(n325854_3, b)), rt ∈ Ω(1 + n3258543)
Generator Equations:
gen_#0:#neg:#pos:#s6_3(0) ⇔ #0
gen_#0:#neg:#pos:#s6_3(+(x, 1)) ⇔ #neg(gen_#0:#neg:#pos:#s6_3(x))
gen_:::nil7_3(0) ⇔ nil
gen_:::nil7_3(+(x, 1)) ⇔ ::(#0, gen_:::nil7_3(x))
gen_leaf:node8_3(0) ⇔ leaf
gen_leaf:node8_3(+(x, 1)) ⇔ node(nil, leaf, gen_leaf:node8_3(x))
No more defined symbols left to analyse.
(34) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
append#1(gen_:::nil7_3(n325854_3), gen_:::nil7_3(b)) → gen_:::nil7_3(+(n325854_3, b)), rt ∈ Ω(1 + n3258543)
(35) BOUNDS(n^1, INF)
(36) Obligation:
Innermost TRS:
Rules:
#less(
@x,
@y) →
#cklt(
#compare(
@x,
@y))
append(
@l1,
@l2) →
append#1(
@l1,
@l2)
append#1(
::(
@x,
@xs),
@l2) →
::(
@x,
append(
@xs,
@l2))
append#1(
nil,
@l2) →
@l2flatten(
@t) →
flatten#1(
@t)
flatten#1(
leaf) →
nilflatten#1(
node(
@l,
@t1,
@t2)) →
append(
@l,
append(
flatten(
@t1),
flatten(
@t2)))
flattensort(
@t) →
insertionsort(
flatten(
@t))
insert(
@x,
@l) →
insert#1(
@l,
@x)
insert#1(
::(
@y,
@ys),
@x) →
insert#2(
#less(
@y,
@x),
@x,
@y,
@ys)
insert#1(
nil,
@x) →
::(
@x,
nil)
insert#2(
#false,
@x,
@y,
@ys) →
::(
@x,
::(
@y,
@ys))
insert#2(
#true,
@x,
@y,
@ys) →
::(
@y,
insert(
@x,
@ys))
insertionsort(
@l) →
insertionsort#1(
@l)
insertionsort#1(
::(
@x,
@xs)) →
insert(
@x,
insertionsort(
@xs))
insertionsort#1(
nil) →
nil#cklt(
#EQ) →
#false#cklt(
#GT) →
#false#cklt(
#LT) →
#true#compare(
#0,
#0) →
#EQ#compare(
#0,
#neg(
@y)) →
#GT#compare(
#0,
#pos(
@y)) →
#LT#compare(
#0,
#s(
@y)) →
#LT#compare(
#neg(
@x),
#0) →
#LT#compare(
#neg(
@x),
#neg(
@y)) →
#compare(
@y,
@x)
#compare(
#neg(
@x),
#pos(
@y)) →
#LT#compare(
#pos(
@x),
#0) →
#GT#compare(
#pos(
@x),
#neg(
@y)) →
#GT#compare(
#pos(
@x),
#pos(
@y)) →
#compare(
@x,
@y)
#compare(
#s(
@x),
#0) →
#GT#compare(
#s(
@x),
#s(
@y)) →
#compare(
@x,
@y)
Types:
#less :: #0:#neg:#pos:#s → #0:#neg:#pos:#s → #false:#true
#cklt :: #EQ:#GT:#LT → #false:#true
#compare :: #0:#neg:#pos:#s → #0:#neg:#pos:#s → #EQ:#GT:#LT
append :: :::nil → :::nil → :::nil
append#1 :: :::nil → :::nil → :::nil
:: :: #0:#neg:#pos:#s → :::nil → :::nil
nil :: :::nil
flatten :: leaf:node → :::nil
flatten#1 :: leaf:node → :::nil
leaf :: leaf:node
node :: :::nil → leaf:node → leaf:node → leaf:node
flattensort :: leaf:node → :::nil
insertionsort :: :::nil → :::nil
insert :: #0:#neg:#pos:#s → :::nil → :::nil
insert#1 :: :::nil → #0:#neg:#pos:#s → :::nil
insert#2 :: #false:#true → #0:#neg:#pos:#s → #0:#neg:#pos:#s → :::nil → :::nil
#false :: #false:#true
#true :: #false:#true
insertionsort#1 :: :::nil → :::nil
#EQ :: #EQ:#GT:#LT
#GT :: #EQ:#GT:#LT
#LT :: #EQ:#GT:#LT
#0 :: #0:#neg:#pos:#s
#neg :: #0:#neg:#pos:#s → #0:#neg:#pos:#s
#pos :: #0:#neg:#pos:#s → #0:#neg:#pos:#s
#s :: #0:#neg:#pos:#s → #0:#neg:#pos:#s
hole_#false:#true1_3 :: #false:#true
hole_#0:#neg:#pos:#s2_3 :: #0:#neg:#pos:#s
hole_#EQ:#GT:#LT3_3 :: #EQ:#GT:#LT
hole_:::nil4_3 :: :::nil
hole_leaf:node5_3 :: leaf:node
gen_#0:#neg:#pos:#s6_3 :: Nat → #0:#neg:#pos:#s
gen_:::nil7_3 :: Nat → :::nil
gen_leaf:node8_3 :: Nat → leaf:node
Lemmas:
#compare(gen_#0:#neg:#pos:#s6_3(n10_3), gen_#0:#neg:#pos:#s6_3(n10_3)) → #EQ, rt ∈ Ω(0)
Generator Equations:
gen_#0:#neg:#pos:#s6_3(0) ⇔ #0
gen_#0:#neg:#pos:#s6_3(+(x, 1)) ⇔ #neg(gen_#0:#neg:#pos:#s6_3(x))
gen_:::nil7_3(0) ⇔ nil
gen_:::nil7_3(+(x, 1)) ⇔ ::(#0, gen_:::nil7_3(x))
gen_leaf:node8_3(0) ⇔ leaf
gen_leaf:node8_3(+(x, 1)) ⇔ node(nil, leaf, gen_leaf:node8_3(x))
No more defined symbols left to analyse.
(37) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(1) was proven with the following lemma:
#compare(gen_#0:#neg:#pos:#s6_3(n10_3), gen_#0:#neg:#pos:#s6_3(n10_3)) → #EQ, rt ∈ Ω(0)
(38) BOUNDS(1, INF)