We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).

Strict Trs:
  { flattensort(@t) -> insertionsort(flatten(@t))
  , insertionsort#1(nil()) -> nil()
  , insertionsort#1(::(@x, @xs)) -> insert(@x, insertionsort(@xs))
  , append(@l1, @l2) -> append#1(@l1, @l2)
  , insert(@x, @l) -> insert#1(@l, @x)
  , insert#2(#true(), @x, @y, @ys) -> ::(@y, insert(@x, @ys))
  , insert#2(#false(), @x, @y, @ys) -> ::(@x, ::(@y, @ys))
  , append#1(nil(), @l2) -> @l2
  , append#1(::(@x, @xs), @l2) -> ::(@x, append(@xs, @l2))
  , flatten#1(leaf()) -> nil()
  , flatten#1(node(@l, @t1, @t2)) ->
    append(@l, append(flatten(@t1), flatten(@t2)))
  , insert#1(nil(), @x) -> ::(@x, nil())
  , insert#1(::(@y, @ys), @x) -> insert#2(#less(@y, @x), @x, @y, @ys)
  , #less(@x, @y) -> #cklt(#compare(@x, @y))
  , flatten(@t) -> flatten#1(@t)
  , insertionsort(@l) -> insertionsort#1(@l) }
Weak Trs:
  { #cklt(#EQ()) -> #false()
  , #cklt(#LT()) -> #true()
  , #cklt(#GT()) -> #false()
  , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
  , #compare(#pos(@x), #0()) -> #GT()
  , #compare(#pos(@x), #neg(@y)) -> #GT()
  , #compare(#0(), #pos(@y)) -> #LT()
  , #compare(#0(), #0()) -> #EQ()
  , #compare(#0(), #neg(@y)) -> #GT()
  , #compare(#0(), #s(@y)) -> #LT()
  , #compare(#neg(@x), #pos(@y)) -> #LT()
  , #compare(#neg(@x), #0()) -> #LT()
  , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
  , #compare(#s(@x), #0()) -> #GT()
  , #compare(#s(@x), #s(@y)) -> #compare(@x, @y) }
Obligation:
  innermost runtime complexity
Answer:
  YES(O(1),O(n^2))

We add the following dependency tuples:

Strict DPs:
  { flattensort^#(@t) ->
    c_1(insertionsort^#(flatten(@t)), flatten^#(@t))
  , insertionsort^#(@l) -> c_16(insertionsort#1^#(@l))
  , flatten^#(@t) -> c_15(flatten#1^#(@t))
  , insertionsort#1^#(nil()) -> c_2()
  , insertionsort#1^#(::(@x, @xs)) ->
    c_3(insert^#(@x, insertionsort(@xs)), insertionsort^#(@xs))
  , insert^#(@x, @l) -> c_5(insert#1^#(@l, @x))
  , append^#(@l1, @l2) -> c_4(append#1^#(@l1, @l2))
  , append#1^#(nil(), @l2) -> c_8()
  , append#1^#(::(@x, @xs), @l2) -> c_9(append^#(@xs, @l2))
  , insert#1^#(nil(), @x) -> c_12()
  , insert#1^#(::(@y, @ys), @x) ->
    c_13(insert#2^#(#less(@y, @x), @x, @y, @ys), #less^#(@y, @x))
  , insert#2^#(#true(), @x, @y, @ys) -> c_6(insert^#(@x, @ys))
  , insert#2^#(#false(), @x, @y, @ys) -> c_7()
  , flatten#1^#(leaf()) -> c_10()
  , flatten#1^#(node(@l, @t1, @t2)) ->
    c_11(append^#(@l, append(flatten(@t1), flatten(@t2))),
         append^#(flatten(@t1), flatten(@t2)),
         flatten^#(@t1),
         flatten^#(@t2))
  , #less^#(@x, @y) ->
    c_14(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y)) }
Weak DPs:
  { #cklt^#(#EQ()) -> c_17()
  , #cklt^#(#LT()) -> c_18()
  , #cklt^#(#GT()) -> c_19()
  , #compare^#(#pos(@x), #pos(@y)) -> c_20(#compare^#(@x, @y))
  , #compare^#(#pos(@x), #0()) -> c_21()
  , #compare^#(#pos(@x), #neg(@y)) -> c_22()
  , #compare^#(#0(), #pos(@y)) -> c_23()
  , #compare^#(#0(), #0()) -> c_24()
  , #compare^#(#0(), #neg(@y)) -> c_25()
  , #compare^#(#0(), #s(@y)) -> c_26()
  , #compare^#(#neg(@x), #pos(@y)) -> c_27()
  , #compare^#(#neg(@x), #0()) -> c_28()
  , #compare^#(#neg(@x), #neg(@y)) -> c_29(#compare^#(@y, @x))
  , #compare^#(#s(@x), #0()) -> c_30()
  , #compare^#(#s(@x), #s(@y)) -> c_31(#compare^#(@x, @y)) }

and mark the set of starting terms.

We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).

Strict DPs:
  { flattensort^#(@t) ->
    c_1(insertionsort^#(flatten(@t)), flatten^#(@t))
  , insertionsort^#(@l) -> c_16(insertionsort#1^#(@l))
  , flatten^#(@t) -> c_15(flatten#1^#(@t))
  , insertionsort#1^#(nil()) -> c_2()
  , insertionsort#1^#(::(@x, @xs)) ->
    c_3(insert^#(@x, insertionsort(@xs)), insertionsort^#(@xs))
  , insert^#(@x, @l) -> c_5(insert#1^#(@l, @x))
  , append^#(@l1, @l2) -> c_4(append#1^#(@l1, @l2))
  , append#1^#(nil(), @l2) -> c_8()
  , append#1^#(::(@x, @xs), @l2) -> c_9(append^#(@xs, @l2))
  , insert#1^#(nil(), @x) -> c_12()
  , insert#1^#(::(@y, @ys), @x) ->
    c_13(insert#2^#(#less(@y, @x), @x, @y, @ys), #less^#(@y, @x))
  , insert#2^#(#true(), @x, @y, @ys) -> c_6(insert^#(@x, @ys))
  , insert#2^#(#false(), @x, @y, @ys) -> c_7()
  , flatten#1^#(leaf()) -> c_10()
  , flatten#1^#(node(@l, @t1, @t2)) ->
    c_11(append^#(@l, append(flatten(@t1), flatten(@t2))),
         append^#(flatten(@t1), flatten(@t2)),
         flatten^#(@t1),
         flatten^#(@t2))
  , #less^#(@x, @y) ->
    c_14(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y)) }
Weak DPs:
  { #cklt^#(#EQ()) -> c_17()
  , #cklt^#(#LT()) -> c_18()
  , #cklt^#(#GT()) -> c_19()
  , #compare^#(#pos(@x), #pos(@y)) -> c_20(#compare^#(@x, @y))
  , #compare^#(#pos(@x), #0()) -> c_21()
  , #compare^#(#pos(@x), #neg(@y)) -> c_22()
  , #compare^#(#0(), #pos(@y)) -> c_23()
  , #compare^#(#0(), #0()) -> c_24()
  , #compare^#(#0(), #neg(@y)) -> c_25()
  , #compare^#(#0(), #s(@y)) -> c_26()
  , #compare^#(#neg(@x), #pos(@y)) -> c_27()
  , #compare^#(#neg(@x), #0()) -> c_28()
  , #compare^#(#neg(@x), #neg(@y)) -> c_29(#compare^#(@y, @x))
  , #compare^#(#s(@x), #0()) -> c_30()
  , #compare^#(#s(@x), #s(@y)) -> c_31(#compare^#(@x, @y)) }
Weak Trs:
  { flattensort(@t) -> insertionsort(flatten(@t))
  , insertionsort#1(nil()) -> nil()
  , insertionsort#1(::(@x, @xs)) -> insert(@x, insertionsort(@xs))
  , append(@l1, @l2) -> append#1(@l1, @l2)
  , #cklt(#EQ()) -> #false()
  , #cklt(#LT()) -> #true()
  , #cklt(#GT()) -> #false()
  , insert(@x, @l) -> insert#1(@l, @x)
  , insert#2(#true(), @x, @y, @ys) -> ::(@y, insert(@x, @ys))
  , insert#2(#false(), @x, @y, @ys) -> ::(@x, ::(@y, @ys))
  , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
  , #compare(#pos(@x), #0()) -> #GT()
  , #compare(#pos(@x), #neg(@y)) -> #GT()
  , #compare(#0(), #pos(@y)) -> #LT()
  , #compare(#0(), #0()) -> #EQ()
  , #compare(#0(), #neg(@y)) -> #GT()
  , #compare(#0(), #s(@y)) -> #LT()
  , #compare(#neg(@x), #pos(@y)) -> #LT()
  , #compare(#neg(@x), #0()) -> #LT()
  , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
  , #compare(#s(@x), #0()) -> #GT()
  , #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
  , append#1(nil(), @l2) -> @l2
  , append#1(::(@x, @xs), @l2) -> ::(@x, append(@xs, @l2))
  , flatten#1(leaf()) -> nil()
  , flatten#1(node(@l, @t1, @t2)) ->
    append(@l, append(flatten(@t1), flatten(@t2)))
  , insert#1(nil(), @x) -> ::(@x, nil())
  , insert#1(::(@y, @ys), @x) -> insert#2(#less(@y, @x), @x, @y, @ys)
  , #less(@x, @y) -> #cklt(#compare(@x, @y))
  , flatten(@t) -> flatten#1(@t)
  , insertionsort(@l) -> insertionsort#1(@l) }
Obligation:
  innermost runtime complexity
Answer:
  YES(O(1),O(n^2))

We estimate the number of application of {4,8,10,13,14,16} by
applications of Pre({4,8,10,13,14,16}) = {2,3,6,7,11}. Here rules
are labeled as follows:

  DPs:
    { 1: flattensort^#(@t) ->
         c_1(insertionsort^#(flatten(@t)), flatten^#(@t))
    , 2: insertionsort^#(@l) -> c_16(insertionsort#1^#(@l))
    , 3: flatten^#(@t) -> c_15(flatten#1^#(@t))
    , 4: insertionsort#1^#(nil()) -> c_2()
    , 5: insertionsort#1^#(::(@x, @xs)) ->
         c_3(insert^#(@x, insertionsort(@xs)), insertionsort^#(@xs))
    , 6: insert^#(@x, @l) -> c_5(insert#1^#(@l, @x))
    , 7: append^#(@l1, @l2) -> c_4(append#1^#(@l1, @l2))
    , 8: append#1^#(nil(), @l2) -> c_8()
    , 9: append#1^#(::(@x, @xs), @l2) -> c_9(append^#(@xs, @l2))
    , 10: insert#1^#(nil(), @x) -> c_12()
    , 11: insert#1^#(::(@y, @ys), @x) ->
          c_13(insert#2^#(#less(@y, @x), @x, @y, @ys), #less^#(@y, @x))
    , 12: insert#2^#(#true(), @x, @y, @ys) -> c_6(insert^#(@x, @ys))
    , 13: insert#2^#(#false(), @x, @y, @ys) -> c_7()
    , 14: flatten#1^#(leaf()) -> c_10()
    , 15: flatten#1^#(node(@l, @t1, @t2)) ->
          c_11(append^#(@l, append(flatten(@t1), flatten(@t2))),
               append^#(flatten(@t1), flatten(@t2)),
               flatten^#(@t1),
               flatten^#(@t2))
    , 16: #less^#(@x, @y) ->
          c_14(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y))
    , 17: #cklt^#(#EQ()) -> c_17()
    , 18: #cklt^#(#LT()) -> c_18()
    , 19: #cklt^#(#GT()) -> c_19()
    , 20: #compare^#(#pos(@x), #pos(@y)) -> c_20(#compare^#(@x, @y))
    , 21: #compare^#(#pos(@x), #0()) -> c_21()
    , 22: #compare^#(#pos(@x), #neg(@y)) -> c_22()
    , 23: #compare^#(#0(), #pos(@y)) -> c_23()
    , 24: #compare^#(#0(), #0()) -> c_24()
    , 25: #compare^#(#0(), #neg(@y)) -> c_25()
    , 26: #compare^#(#0(), #s(@y)) -> c_26()
    , 27: #compare^#(#neg(@x), #pos(@y)) -> c_27()
    , 28: #compare^#(#neg(@x), #0()) -> c_28()
    , 29: #compare^#(#neg(@x), #neg(@y)) -> c_29(#compare^#(@y, @x))
    , 30: #compare^#(#s(@x), #0()) -> c_30()
    , 31: #compare^#(#s(@x), #s(@y)) -> c_31(#compare^#(@x, @y)) }

We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).

Strict DPs:
  { flattensort^#(@t) ->
    c_1(insertionsort^#(flatten(@t)), flatten^#(@t))
  , insertionsort^#(@l) -> c_16(insertionsort#1^#(@l))
  , flatten^#(@t) -> c_15(flatten#1^#(@t))
  , insertionsort#1^#(::(@x, @xs)) ->
    c_3(insert^#(@x, insertionsort(@xs)), insertionsort^#(@xs))
  , insert^#(@x, @l) -> c_5(insert#1^#(@l, @x))
  , append^#(@l1, @l2) -> c_4(append#1^#(@l1, @l2))
  , append#1^#(::(@x, @xs), @l2) -> c_9(append^#(@xs, @l2))
  , insert#1^#(::(@y, @ys), @x) ->
    c_13(insert#2^#(#less(@y, @x), @x, @y, @ys), #less^#(@y, @x))
  , insert#2^#(#true(), @x, @y, @ys) -> c_6(insert^#(@x, @ys))
  , flatten#1^#(node(@l, @t1, @t2)) ->
    c_11(append^#(@l, append(flatten(@t1), flatten(@t2))),
         append^#(flatten(@t1), flatten(@t2)),
         flatten^#(@t1),
         flatten^#(@t2)) }
Weak DPs:
  { insertionsort#1^#(nil()) -> c_2()
  , append#1^#(nil(), @l2) -> c_8()
  , insert#1^#(nil(), @x) -> c_12()
  , insert#2^#(#false(), @x, @y, @ys) -> c_7()
  , flatten#1^#(leaf()) -> c_10()
  , #less^#(@x, @y) ->
    c_14(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y))
  , #cklt^#(#EQ()) -> c_17()
  , #cklt^#(#LT()) -> c_18()
  , #cklt^#(#GT()) -> c_19()
  , #compare^#(#pos(@x), #pos(@y)) -> c_20(#compare^#(@x, @y))
  , #compare^#(#pos(@x), #0()) -> c_21()
  , #compare^#(#pos(@x), #neg(@y)) -> c_22()
  , #compare^#(#0(), #pos(@y)) -> c_23()
  , #compare^#(#0(), #0()) -> c_24()
  , #compare^#(#0(), #neg(@y)) -> c_25()
  , #compare^#(#0(), #s(@y)) -> c_26()
  , #compare^#(#neg(@x), #pos(@y)) -> c_27()
  , #compare^#(#neg(@x), #0()) -> c_28()
  , #compare^#(#neg(@x), #neg(@y)) -> c_29(#compare^#(@y, @x))
  , #compare^#(#s(@x), #0()) -> c_30()
  , #compare^#(#s(@x), #s(@y)) -> c_31(#compare^#(@x, @y)) }
Weak Trs:
  { flattensort(@t) -> insertionsort(flatten(@t))
  , insertionsort#1(nil()) -> nil()
  , insertionsort#1(::(@x, @xs)) -> insert(@x, insertionsort(@xs))
  , append(@l1, @l2) -> append#1(@l1, @l2)
  , #cklt(#EQ()) -> #false()
  , #cklt(#LT()) -> #true()
  , #cklt(#GT()) -> #false()
  , insert(@x, @l) -> insert#1(@l, @x)
  , insert#2(#true(), @x, @y, @ys) -> ::(@y, insert(@x, @ys))
  , insert#2(#false(), @x, @y, @ys) -> ::(@x, ::(@y, @ys))
  , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
  , #compare(#pos(@x), #0()) -> #GT()
  , #compare(#pos(@x), #neg(@y)) -> #GT()
  , #compare(#0(), #pos(@y)) -> #LT()
  , #compare(#0(), #0()) -> #EQ()
  , #compare(#0(), #neg(@y)) -> #GT()
  , #compare(#0(), #s(@y)) -> #LT()
  , #compare(#neg(@x), #pos(@y)) -> #LT()
  , #compare(#neg(@x), #0()) -> #LT()
  , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
  , #compare(#s(@x), #0()) -> #GT()
  , #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
  , append#1(nil(), @l2) -> @l2
  , append#1(::(@x, @xs), @l2) -> ::(@x, append(@xs, @l2))
  , flatten#1(leaf()) -> nil()
  , flatten#1(node(@l, @t1, @t2)) ->
    append(@l, append(flatten(@t1), flatten(@t2)))
  , insert#1(nil(), @x) -> ::(@x, nil())
  , insert#1(::(@y, @ys), @x) -> insert#2(#less(@y, @x), @x, @y, @ys)
  , #less(@x, @y) -> #cklt(#compare(@x, @y))
  , flatten(@t) -> flatten#1(@t)
  , insertionsort(@l) -> insertionsort#1(@l) }
Obligation:
  innermost runtime complexity
Answer:
  YES(O(1),O(n^2))

The following weak DPs constitute a sub-graph of the DG that is
closed under successors. The DPs are removed.

{ insertionsort#1^#(nil()) -> c_2()
, append#1^#(nil(), @l2) -> c_8()
, insert#1^#(nil(), @x) -> c_12()
, insert#2^#(#false(), @x, @y, @ys) -> c_7()
, flatten#1^#(leaf()) -> c_10()
, #less^#(@x, @y) ->
  c_14(#cklt^#(#compare(@x, @y)), #compare^#(@x, @y))
, #cklt^#(#EQ()) -> c_17()
, #cklt^#(#LT()) -> c_18()
, #cklt^#(#GT()) -> c_19()
, #compare^#(#pos(@x), #pos(@y)) -> c_20(#compare^#(@x, @y))
, #compare^#(#pos(@x), #0()) -> c_21()
, #compare^#(#pos(@x), #neg(@y)) -> c_22()
, #compare^#(#0(), #pos(@y)) -> c_23()
, #compare^#(#0(), #0()) -> c_24()
, #compare^#(#0(), #neg(@y)) -> c_25()
, #compare^#(#0(), #s(@y)) -> c_26()
, #compare^#(#neg(@x), #pos(@y)) -> c_27()
, #compare^#(#neg(@x), #0()) -> c_28()
, #compare^#(#neg(@x), #neg(@y)) -> c_29(#compare^#(@y, @x))
, #compare^#(#s(@x), #0()) -> c_30()
, #compare^#(#s(@x), #s(@y)) -> c_31(#compare^#(@x, @y)) }

We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).

Strict DPs:
  { flattensort^#(@t) ->
    c_1(insertionsort^#(flatten(@t)), flatten^#(@t))
  , insertionsort^#(@l) -> c_16(insertionsort#1^#(@l))
  , flatten^#(@t) -> c_15(flatten#1^#(@t))
  , insertionsort#1^#(::(@x, @xs)) ->
    c_3(insert^#(@x, insertionsort(@xs)), insertionsort^#(@xs))
  , insert^#(@x, @l) -> c_5(insert#1^#(@l, @x))
  , append^#(@l1, @l2) -> c_4(append#1^#(@l1, @l2))
  , append#1^#(::(@x, @xs), @l2) -> c_9(append^#(@xs, @l2))
  , insert#1^#(::(@y, @ys), @x) ->
    c_13(insert#2^#(#less(@y, @x), @x, @y, @ys), #less^#(@y, @x))
  , insert#2^#(#true(), @x, @y, @ys) -> c_6(insert^#(@x, @ys))
  , flatten#1^#(node(@l, @t1, @t2)) ->
    c_11(append^#(@l, append(flatten(@t1), flatten(@t2))),
         append^#(flatten(@t1), flatten(@t2)),
         flatten^#(@t1),
         flatten^#(@t2)) }
Weak Trs:
  { flattensort(@t) -> insertionsort(flatten(@t))
  , insertionsort#1(nil()) -> nil()
  , insertionsort#1(::(@x, @xs)) -> insert(@x, insertionsort(@xs))
  , append(@l1, @l2) -> append#1(@l1, @l2)
  , #cklt(#EQ()) -> #false()
  , #cklt(#LT()) -> #true()
  , #cklt(#GT()) -> #false()
  , insert(@x, @l) -> insert#1(@l, @x)
  , insert#2(#true(), @x, @y, @ys) -> ::(@y, insert(@x, @ys))
  , insert#2(#false(), @x, @y, @ys) -> ::(@x, ::(@y, @ys))
  , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
  , #compare(#pos(@x), #0()) -> #GT()
  , #compare(#pos(@x), #neg(@y)) -> #GT()
  , #compare(#0(), #pos(@y)) -> #LT()
  , #compare(#0(), #0()) -> #EQ()
  , #compare(#0(), #neg(@y)) -> #GT()
  , #compare(#0(), #s(@y)) -> #LT()
  , #compare(#neg(@x), #pos(@y)) -> #LT()
  , #compare(#neg(@x), #0()) -> #LT()
  , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
  , #compare(#s(@x), #0()) -> #GT()
  , #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
  , append#1(nil(), @l2) -> @l2
  , append#1(::(@x, @xs), @l2) -> ::(@x, append(@xs, @l2))
  , flatten#1(leaf()) -> nil()
  , flatten#1(node(@l, @t1, @t2)) ->
    append(@l, append(flatten(@t1), flatten(@t2)))
  , insert#1(nil(), @x) -> ::(@x, nil())
  , insert#1(::(@y, @ys), @x) -> insert#2(#less(@y, @x), @x, @y, @ys)
  , #less(@x, @y) -> #cklt(#compare(@x, @y))
  , flatten(@t) -> flatten#1(@t)
  , insertionsort(@l) -> insertionsort#1(@l) }
Obligation:
  innermost runtime complexity
Answer:
  YES(O(1),O(n^2))

Due to missing edges in the dependency-graph, the right-hand sides
of following rules could be simplified:

  { insert#1^#(::(@y, @ys), @x) ->
    c_13(insert#2^#(#less(@y, @x), @x, @y, @ys), #less^#(@y, @x)) }

We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).

Strict DPs:
  { flattensort^#(@t) ->
    c_1(insertionsort^#(flatten(@t)), flatten^#(@t))
  , insertionsort^#(@l) -> c_2(insertionsort#1^#(@l))
  , flatten^#(@t) -> c_3(flatten#1^#(@t))
  , insertionsort#1^#(::(@x, @xs)) ->
    c_4(insert^#(@x, insertionsort(@xs)), insertionsort^#(@xs))
  , insert^#(@x, @l) -> c_5(insert#1^#(@l, @x))
  , append^#(@l1, @l2) -> c_6(append#1^#(@l1, @l2))
  , append#1^#(::(@x, @xs), @l2) -> c_7(append^#(@xs, @l2))
  , insert#1^#(::(@y, @ys), @x) ->
    c_8(insert#2^#(#less(@y, @x), @x, @y, @ys))
  , insert#2^#(#true(), @x, @y, @ys) -> c_9(insert^#(@x, @ys))
  , flatten#1^#(node(@l, @t1, @t2)) ->
    c_10(append^#(@l, append(flatten(@t1), flatten(@t2))),
         append^#(flatten(@t1), flatten(@t2)),
         flatten^#(@t1),
         flatten^#(@t2)) }
Weak Trs:
  { flattensort(@t) -> insertionsort(flatten(@t))
  , insertionsort#1(nil()) -> nil()
  , insertionsort#1(::(@x, @xs)) -> insert(@x, insertionsort(@xs))
  , append(@l1, @l2) -> append#1(@l1, @l2)
  , #cklt(#EQ()) -> #false()
  , #cklt(#LT()) -> #true()
  , #cklt(#GT()) -> #false()
  , insert(@x, @l) -> insert#1(@l, @x)
  , insert#2(#true(), @x, @y, @ys) -> ::(@y, insert(@x, @ys))
  , insert#2(#false(), @x, @y, @ys) -> ::(@x, ::(@y, @ys))
  , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
  , #compare(#pos(@x), #0()) -> #GT()
  , #compare(#pos(@x), #neg(@y)) -> #GT()
  , #compare(#0(), #pos(@y)) -> #LT()
  , #compare(#0(), #0()) -> #EQ()
  , #compare(#0(), #neg(@y)) -> #GT()
  , #compare(#0(), #s(@y)) -> #LT()
  , #compare(#neg(@x), #pos(@y)) -> #LT()
  , #compare(#neg(@x), #0()) -> #LT()
  , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
  , #compare(#s(@x), #0()) -> #GT()
  , #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
  , append#1(nil(), @l2) -> @l2
  , append#1(::(@x, @xs), @l2) -> ::(@x, append(@xs, @l2))
  , flatten#1(leaf()) -> nil()
  , flatten#1(node(@l, @t1, @t2)) ->
    append(@l, append(flatten(@t1), flatten(@t2)))
  , insert#1(nil(), @x) -> ::(@x, nil())
  , insert#1(::(@y, @ys), @x) -> insert#2(#less(@y, @x), @x, @y, @ys)
  , #less(@x, @y) -> #cklt(#compare(@x, @y))
  , flatten(@t) -> flatten#1(@t)
  , insertionsort(@l) -> insertionsort#1(@l) }
Obligation:
  innermost runtime complexity
Answer:
  YES(O(1),O(n^2))

We replace rewrite rules by usable rules:

  Weak Usable Rules:
    { insertionsort#1(nil()) -> nil()
    , insertionsort#1(::(@x, @xs)) -> insert(@x, insertionsort(@xs))
    , append(@l1, @l2) -> append#1(@l1, @l2)
    , #cklt(#EQ()) -> #false()
    , #cklt(#LT()) -> #true()
    , #cklt(#GT()) -> #false()
    , insert(@x, @l) -> insert#1(@l, @x)
    , insert#2(#true(), @x, @y, @ys) -> ::(@y, insert(@x, @ys))
    , insert#2(#false(), @x, @y, @ys) -> ::(@x, ::(@y, @ys))
    , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
    , #compare(#pos(@x), #0()) -> #GT()
    , #compare(#pos(@x), #neg(@y)) -> #GT()
    , #compare(#0(), #pos(@y)) -> #LT()
    , #compare(#0(), #0()) -> #EQ()
    , #compare(#0(), #neg(@y)) -> #GT()
    , #compare(#0(), #s(@y)) -> #LT()
    , #compare(#neg(@x), #pos(@y)) -> #LT()
    , #compare(#neg(@x), #0()) -> #LT()
    , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
    , #compare(#s(@x), #0()) -> #GT()
    , #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
    , append#1(nil(), @l2) -> @l2
    , append#1(::(@x, @xs), @l2) -> ::(@x, append(@xs, @l2))
    , flatten#1(leaf()) -> nil()
    , flatten#1(node(@l, @t1, @t2)) ->
      append(@l, append(flatten(@t1), flatten(@t2)))
    , insert#1(nil(), @x) -> ::(@x, nil())
    , insert#1(::(@y, @ys), @x) -> insert#2(#less(@y, @x), @x, @y, @ys)
    , #less(@x, @y) -> #cklt(#compare(@x, @y))
    , flatten(@t) -> flatten#1(@t)
    , insertionsort(@l) -> insertionsort#1(@l) }

We are left with following problem, upon which TcT provides the
certificate YES(O(1),O(n^2)).

Strict DPs:
  { flattensort^#(@t) ->
    c_1(insertionsort^#(flatten(@t)), flatten^#(@t))
  , insertionsort^#(@l) -> c_2(insertionsort#1^#(@l))
  , flatten^#(@t) -> c_3(flatten#1^#(@t))
  , insertionsort#1^#(::(@x, @xs)) ->
    c_4(insert^#(@x, insertionsort(@xs)), insertionsort^#(@xs))
  , insert^#(@x, @l) -> c_5(insert#1^#(@l, @x))
  , append^#(@l1, @l2) -> c_6(append#1^#(@l1, @l2))
  , append#1^#(::(@x, @xs), @l2) -> c_7(append^#(@xs, @l2))
  , insert#1^#(::(@y, @ys), @x) ->
    c_8(insert#2^#(#less(@y, @x), @x, @y, @ys))
  , insert#2^#(#true(), @x, @y, @ys) -> c_9(insert^#(@x, @ys))
  , flatten#1^#(node(@l, @t1, @t2)) ->
    c_10(append^#(@l, append(flatten(@t1), flatten(@t2))),
         append^#(flatten(@t1), flatten(@t2)),
         flatten^#(@t1),
         flatten^#(@t2)) }
Weak Trs:
  { insertionsort#1(nil()) -> nil()
  , insertionsort#1(::(@x, @xs)) -> insert(@x, insertionsort(@xs))
  , append(@l1, @l2) -> append#1(@l1, @l2)
  , #cklt(#EQ()) -> #false()
  , #cklt(#LT()) -> #true()
  , #cklt(#GT()) -> #false()
  , insert(@x, @l) -> insert#1(@l, @x)
  , insert#2(#true(), @x, @y, @ys) -> ::(@y, insert(@x, @ys))
  , insert#2(#false(), @x, @y, @ys) -> ::(@x, ::(@y, @ys))
  , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
  , #compare(#pos(@x), #0()) -> #GT()
  , #compare(#pos(@x), #neg(@y)) -> #GT()
  , #compare(#0(), #pos(@y)) -> #LT()
  , #compare(#0(), #0()) -> #EQ()
  , #compare(#0(), #neg(@y)) -> #GT()
  , #compare(#0(), #s(@y)) -> #LT()
  , #compare(#neg(@x), #pos(@y)) -> #LT()
  , #compare(#neg(@x), #0()) -> #LT()
  , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
  , #compare(#s(@x), #0()) -> #GT()
  , #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
  , append#1(nil(), @l2) -> @l2
  , append#1(::(@x, @xs), @l2) -> ::(@x, append(@xs, @l2))
  , flatten#1(leaf()) -> nil()
  , flatten#1(node(@l, @t1, @t2)) ->
    append(@l, append(flatten(@t1), flatten(@t2)))
  , insert#1(nil(), @x) -> ::(@x, nil())
  , insert#1(::(@y, @ys), @x) -> insert#2(#less(@y, @x), @x, @y, @ys)
  , #less(@x, @y) -> #cklt(#compare(@x, @y))
  , flatten(@t) -> flatten#1(@t)
  , insertionsort(@l) -> insertionsort#1(@l) }
Obligation:
  innermost runtime complexity
Answer:
  YES(O(1),O(n^2))

We analyse the complexity of following sub-problems (R) and (S).
Problem (S) is obtained from the input problem by shifting strict
rules from (R) into the weak component:

Problem (R):
------------
  Strict DPs:
    { flattensort^#(@t) ->
      c_1(insertionsort^#(flatten(@t)), flatten^#(@t))
    , flatten^#(@t) -> c_3(flatten#1^#(@t))
    , append^#(@l1, @l2) -> c_6(append#1^#(@l1, @l2))
    , append#1^#(::(@x, @xs), @l2) -> c_7(append^#(@xs, @l2))
    , flatten#1^#(node(@l, @t1, @t2)) ->
      c_10(append^#(@l, append(flatten(@t1), flatten(@t2))),
           append^#(flatten(@t1), flatten(@t2)),
           flatten^#(@t1),
           flatten^#(@t2)) }
  Weak DPs:
    { insertionsort^#(@l) -> c_2(insertionsort#1^#(@l))
    , insertionsort#1^#(::(@x, @xs)) ->
      c_4(insert^#(@x, insertionsort(@xs)), insertionsort^#(@xs))
    , insert^#(@x, @l) -> c_5(insert#1^#(@l, @x))
    , insert#1^#(::(@y, @ys), @x) ->
      c_8(insert#2^#(#less(@y, @x), @x, @y, @ys))
    , insert#2^#(#true(), @x, @y, @ys) -> c_9(insert^#(@x, @ys)) }
  Weak Trs:
    { insertionsort#1(nil()) -> nil()
    , insertionsort#1(::(@x, @xs)) -> insert(@x, insertionsort(@xs))
    , append(@l1, @l2) -> append#1(@l1, @l2)
    , #cklt(#EQ()) -> #false()
    , #cklt(#LT()) -> #true()
    , #cklt(#GT()) -> #false()
    , insert(@x, @l) -> insert#1(@l, @x)
    , insert#2(#true(), @x, @y, @ys) -> ::(@y, insert(@x, @ys))
    , insert#2(#false(), @x, @y, @ys) -> ::(@x, ::(@y, @ys))
    , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
    , #compare(#pos(@x), #0()) -> #GT()
    , #compare(#pos(@x), #neg(@y)) -> #GT()
    , #compare(#0(), #pos(@y)) -> #LT()
    , #compare(#0(), #0()) -> #EQ()
    , #compare(#0(), #neg(@y)) -> #GT()
    , #compare(#0(), #s(@y)) -> #LT()
    , #compare(#neg(@x), #pos(@y)) -> #LT()
    , #compare(#neg(@x), #0()) -> #LT()
    , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
    , #compare(#s(@x), #0()) -> #GT()
    , #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
    , append#1(nil(), @l2) -> @l2
    , append#1(::(@x, @xs), @l2) -> ::(@x, append(@xs, @l2))
    , flatten#1(leaf()) -> nil()
    , flatten#1(node(@l, @t1, @t2)) ->
      append(@l, append(flatten(@t1), flatten(@t2)))
    , insert#1(nil(), @x) -> ::(@x, nil())
    , insert#1(::(@y, @ys), @x) -> insert#2(#less(@y, @x), @x, @y, @ys)
    , #less(@x, @y) -> #cklt(#compare(@x, @y))
    , flatten(@t) -> flatten#1(@t)
    , insertionsort(@l) -> insertionsort#1(@l) }
  StartTerms: basic terms
  Strategy: innermost

Problem (S):
------------
  Strict DPs:
    { insertionsort^#(@l) -> c_2(insertionsort#1^#(@l))
    , insertionsort#1^#(::(@x, @xs)) ->
      c_4(insert^#(@x, insertionsort(@xs)), insertionsort^#(@xs))
    , insert^#(@x, @l) -> c_5(insert#1^#(@l, @x))
    , insert#1^#(::(@y, @ys), @x) ->
      c_8(insert#2^#(#less(@y, @x), @x, @y, @ys))
    , insert#2^#(#true(), @x, @y, @ys) -> c_9(insert^#(@x, @ys)) }
  Weak DPs:
    { flattensort^#(@t) ->
      c_1(insertionsort^#(flatten(@t)), flatten^#(@t))
    , flatten^#(@t) -> c_3(flatten#1^#(@t))
    , append^#(@l1, @l2) -> c_6(append#1^#(@l1, @l2))
    , append#1^#(::(@x, @xs), @l2) -> c_7(append^#(@xs, @l2))
    , flatten#1^#(node(@l, @t1, @t2)) ->
      c_10(append^#(@l, append(flatten(@t1), flatten(@t2))),
           append^#(flatten(@t1), flatten(@t2)),
           flatten^#(@t1),
           flatten^#(@t2)) }
  Weak Trs:
    { insertionsort#1(nil()) -> nil()
    , insertionsort#1(::(@x, @xs)) -> insert(@x, insertionsort(@xs))
    , append(@l1, @l2) -> append#1(@l1, @l2)
    , #cklt(#EQ()) -> #false()
    , #cklt(#LT()) -> #true()
    , #cklt(#GT()) -> #false()
    , insert(@x, @l) -> insert#1(@l, @x)
    , insert#2(#true(), @x, @y, @ys) -> ::(@y, insert(@x, @ys))
    , insert#2(#false(), @x, @y, @ys) -> ::(@x, ::(@y, @ys))
    , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
    , #compare(#pos(@x), #0()) -> #GT()
    , #compare(#pos(@x), #neg(@y)) -> #GT()
    , #compare(#0(), #pos(@y)) -> #LT()
    , #compare(#0(), #0()) -> #EQ()
    , #compare(#0(), #neg(@y)) -> #GT()
    , #compare(#0(), #s(@y)) -> #LT()
    , #compare(#neg(@x), #pos(@y)) -> #LT()
    , #compare(#neg(@x), #0()) -> #LT()
    , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
    , #compare(#s(@x), #0()) -> #GT()
    , #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
    , append#1(nil(), @l2) -> @l2
    , append#1(::(@x, @xs), @l2) -> ::(@x, append(@xs, @l2))
    , flatten#1(leaf()) -> nil()
    , flatten#1(node(@l, @t1, @t2)) ->
      append(@l, append(flatten(@t1), flatten(@t2)))
    , insert#1(nil(), @x) -> ::(@x, nil())
    , insert#1(::(@y, @ys), @x) -> insert#2(#less(@y, @x), @x, @y, @ys)
    , #less(@x, @y) -> #cklt(#compare(@x, @y))
    , flatten(@t) -> flatten#1(@t)
    , insertionsort(@l) -> insertionsort#1(@l) }
  StartTerms: basic terms
  Strategy: innermost

Overall, the transformation results in the following sub-problem(s):

Generated new problems:
-----------------------
R) Strict DPs:
     { flattensort^#(@t) ->
       c_1(insertionsort^#(flatten(@t)), flatten^#(@t))
     , flatten^#(@t) -> c_3(flatten#1^#(@t))
     , append^#(@l1, @l2) -> c_6(append#1^#(@l1, @l2))
     , append#1^#(::(@x, @xs), @l2) -> c_7(append^#(@xs, @l2))
     , flatten#1^#(node(@l, @t1, @t2)) ->
       c_10(append^#(@l, append(flatten(@t1), flatten(@t2))),
            append^#(flatten(@t1), flatten(@t2)),
            flatten^#(@t1),
            flatten^#(@t2)) }
   Weak DPs:
     { insertionsort^#(@l) -> c_2(insertionsort#1^#(@l))
     , insertionsort#1^#(::(@x, @xs)) ->
       c_4(insert^#(@x, insertionsort(@xs)), insertionsort^#(@xs))
     , insert^#(@x, @l) -> c_5(insert#1^#(@l, @x))
     , insert#1^#(::(@y, @ys), @x) ->
       c_8(insert#2^#(#less(@y, @x), @x, @y, @ys))
     , insert#2^#(#true(), @x, @y, @ys) -> c_9(insert^#(@x, @ys)) }
   Weak Trs:
     { insertionsort#1(nil()) -> nil()
     , insertionsort#1(::(@x, @xs)) -> insert(@x, insertionsort(@xs))
     , append(@l1, @l2) -> append#1(@l1, @l2)
     , #cklt(#EQ()) -> #false()
     , #cklt(#LT()) -> #true()
     , #cklt(#GT()) -> #false()
     , insert(@x, @l) -> insert#1(@l, @x)
     , insert#2(#true(), @x, @y, @ys) -> ::(@y, insert(@x, @ys))
     , insert#2(#false(), @x, @y, @ys) -> ::(@x, ::(@y, @ys))
     , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
     , #compare(#pos(@x), #0()) -> #GT()
     , #compare(#pos(@x), #neg(@y)) -> #GT()
     , #compare(#0(), #pos(@y)) -> #LT()
     , #compare(#0(), #0()) -> #EQ()
     , #compare(#0(), #neg(@y)) -> #GT()
     , #compare(#0(), #s(@y)) -> #LT()
     , #compare(#neg(@x), #pos(@y)) -> #LT()
     , #compare(#neg(@x), #0()) -> #LT()
     , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
     , #compare(#s(@x), #0()) -> #GT()
     , #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
     , append#1(nil(), @l2) -> @l2
     , append#1(::(@x, @xs), @l2) -> ::(@x, append(@xs, @l2))
     , flatten#1(leaf()) -> nil()
     , flatten#1(node(@l, @t1, @t2)) ->
       append(@l, append(flatten(@t1), flatten(@t2)))
     , insert#1(nil(), @x) -> ::(@x, nil())
     , insert#1(::(@y, @ys), @x) -> insert#2(#less(@y, @x), @x, @y, @ys)
     , #less(@x, @y) -> #cklt(#compare(@x, @y))
     , flatten(@t) -> flatten#1(@t)
     , insertionsort(@l) -> insertionsort#1(@l) }
   StartTerms: basic terms
   Strategy: innermost
   
   This problem was proven YES(O(1),O(n^2)).

S) Strict DPs:
     { insertionsort^#(@l) -> c_2(insertionsort#1^#(@l))
     , insertionsort#1^#(::(@x, @xs)) ->
       c_4(insert^#(@x, insertionsort(@xs)), insertionsort^#(@xs))
     , insert^#(@x, @l) -> c_5(insert#1^#(@l, @x))
     , insert#1^#(::(@y, @ys), @x) ->
       c_8(insert#2^#(#less(@y, @x), @x, @y, @ys))
     , insert#2^#(#true(), @x, @y, @ys) -> c_9(insert^#(@x, @ys)) }
   Weak DPs:
     { flattensort^#(@t) ->
       c_1(insertionsort^#(flatten(@t)), flatten^#(@t))
     , flatten^#(@t) -> c_3(flatten#1^#(@t))
     , append^#(@l1, @l2) -> c_6(append#1^#(@l1, @l2))
     , append#1^#(::(@x, @xs), @l2) -> c_7(append^#(@xs, @l2))
     , flatten#1^#(node(@l, @t1, @t2)) ->
       c_10(append^#(@l, append(flatten(@t1), flatten(@t2))),
            append^#(flatten(@t1), flatten(@t2)),
            flatten^#(@t1),
            flatten^#(@t2)) }
   Weak Trs:
     { insertionsort#1(nil()) -> nil()
     , insertionsort#1(::(@x, @xs)) -> insert(@x, insertionsort(@xs))
     , append(@l1, @l2) -> append#1(@l1, @l2)
     , #cklt(#EQ()) -> #false()
     , #cklt(#LT()) -> #true()
     , #cklt(#GT()) -> #false()
     , insert(@x, @l) -> insert#1(@l, @x)
     , insert#2(#true(), @x, @y, @ys) -> ::(@y, insert(@x, @ys))
     , insert#2(#false(), @x, @y, @ys) -> ::(@x, ::(@y, @ys))
     , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
     , #compare(#pos(@x), #0()) -> #GT()
     , #compare(#pos(@x), #neg(@y)) -> #GT()
     , #compare(#0(), #pos(@y)) -> #LT()
     , #compare(#0(), #0()) -> #EQ()
     , #compare(#0(), #neg(@y)) -> #GT()
     , #compare(#0(), #s(@y)) -> #LT()
     , #compare(#neg(@x), #pos(@y)) -> #LT()
     , #compare(#neg(@x), #0()) -> #LT()
     , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
     , #compare(#s(@x), #0()) -> #GT()
     , #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
     , append#1(nil(), @l2) -> @l2
     , append#1(::(@x, @xs), @l2) -> ::(@x, append(@xs, @l2))
     , flatten#1(leaf()) -> nil()
     , flatten#1(node(@l, @t1, @t2)) ->
       append(@l, append(flatten(@t1), flatten(@t2)))
     , insert#1(nil(), @x) -> ::(@x, nil())
     , insert#1(::(@y, @ys), @x) -> insert#2(#less(@y, @x), @x, @y, @ys)
     , #less(@x, @y) -> #cklt(#compare(@x, @y))
     , flatten(@t) -> flatten#1(@t)
     , insertionsort(@l) -> insertionsort#1(@l) }
   StartTerms: basic terms
   Strategy: innermost
   
   This problem was proven YES(O(1),O(n^2)).


Proofs for generated problems:
------------------------------
R) We are left with following problem, upon which TcT provides the
   certificate YES(O(1),O(n^2)).
   
   Strict DPs:
     { flattensort^#(@t) ->
       c_1(insertionsort^#(flatten(@t)), flatten^#(@t))
     , flatten^#(@t) -> c_3(flatten#1^#(@t))
     , append^#(@l1, @l2) -> c_6(append#1^#(@l1, @l2))
     , append#1^#(::(@x, @xs), @l2) -> c_7(append^#(@xs, @l2))
     , flatten#1^#(node(@l, @t1, @t2)) ->
       c_10(append^#(@l, append(flatten(@t1), flatten(@t2))),
            append^#(flatten(@t1), flatten(@t2)),
            flatten^#(@t1),
            flatten^#(@t2)) }
   Weak DPs:
     { insertionsort^#(@l) -> c_2(insertionsort#1^#(@l))
     , insertionsort#1^#(::(@x, @xs)) ->
       c_4(insert^#(@x, insertionsort(@xs)), insertionsort^#(@xs))
     , insert^#(@x, @l) -> c_5(insert#1^#(@l, @x))
     , insert#1^#(::(@y, @ys), @x) ->
       c_8(insert#2^#(#less(@y, @x), @x, @y, @ys))
     , insert#2^#(#true(), @x, @y, @ys) -> c_9(insert^#(@x, @ys)) }
   Weak Trs:
     { insertionsort#1(nil()) -> nil()
     , insertionsort#1(::(@x, @xs)) -> insert(@x, insertionsort(@xs))
     , append(@l1, @l2) -> append#1(@l1, @l2)
     , #cklt(#EQ()) -> #false()
     , #cklt(#LT()) -> #true()
     , #cklt(#GT()) -> #false()
     , insert(@x, @l) -> insert#1(@l, @x)
     , insert#2(#true(), @x, @y, @ys) -> ::(@y, insert(@x, @ys))
     , insert#2(#false(), @x, @y, @ys) -> ::(@x, ::(@y, @ys))
     , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
     , #compare(#pos(@x), #0()) -> #GT()
     , #compare(#pos(@x), #neg(@y)) -> #GT()
     , #compare(#0(), #pos(@y)) -> #LT()
     , #compare(#0(), #0()) -> #EQ()
     , #compare(#0(), #neg(@y)) -> #GT()
     , #compare(#0(), #s(@y)) -> #LT()
     , #compare(#neg(@x), #pos(@y)) -> #LT()
     , #compare(#neg(@x), #0()) -> #LT()
     , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
     , #compare(#s(@x), #0()) -> #GT()
     , #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
     , append#1(nil(), @l2) -> @l2
     , append#1(::(@x, @xs), @l2) -> ::(@x, append(@xs, @l2))
     , flatten#1(leaf()) -> nil()
     , flatten#1(node(@l, @t1, @t2)) ->
       append(@l, append(flatten(@t1), flatten(@t2)))
     , insert#1(nil(), @x) -> ::(@x, nil())
     , insert#1(::(@y, @ys), @x) -> insert#2(#less(@y, @x), @x, @y, @ys)
     , #less(@x, @y) -> #cklt(#compare(@x, @y))
     , flatten(@t) -> flatten#1(@t)
     , insertionsort(@l) -> insertionsort#1(@l) }
   Obligation:
     innermost runtime complexity
   Answer:
     YES(O(1),O(n^2))
   
   The following weak DPs constitute a sub-graph of the DG that is
   closed under successors. The DPs are removed.
   
   { insertionsort^#(@l) -> c_2(insertionsort#1^#(@l))
   , insertionsort#1^#(::(@x, @xs)) ->
     c_4(insert^#(@x, insertionsort(@xs)), insertionsort^#(@xs))
   , insert^#(@x, @l) -> c_5(insert#1^#(@l, @x))
   , insert#1^#(::(@y, @ys), @x) ->
     c_8(insert#2^#(#less(@y, @x), @x, @y, @ys))
   , insert#2^#(#true(), @x, @y, @ys) -> c_9(insert^#(@x, @ys)) }
   
   We are left with following problem, upon which TcT provides the
   certificate YES(O(1),O(n^2)).
   
   Strict DPs:
     { flattensort^#(@t) ->
       c_1(insertionsort^#(flatten(@t)), flatten^#(@t))
     , flatten^#(@t) -> c_3(flatten#1^#(@t))
     , append^#(@l1, @l2) -> c_6(append#1^#(@l1, @l2))
     , append#1^#(::(@x, @xs), @l2) -> c_7(append^#(@xs, @l2))
     , flatten#1^#(node(@l, @t1, @t2)) ->
       c_10(append^#(@l, append(flatten(@t1), flatten(@t2))),
            append^#(flatten(@t1), flatten(@t2)),
            flatten^#(@t1),
            flatten^#(@t2)) }
   Weak Trs:
     { insertionsort#1(nil()) -> nil()
     , insertionsort#1(::(@x, @xs)) -> insert(@x, insertionsort(@xs))
     , append(@l1, @l2) -> append#1(@l1, @l2)
     , #cklt(#EQ()) -> #false()
     , #cklt(#LT()) -> #true()
     , #cklt(#GT()) -> #false()
     , insert(@x, @l) -> insert#1(@l, @x)
     , insert#2(#true(), @x, @y, @ys) -> ::(@y, insert(@x, @ys))
     , insert#2(#false(), @x, @y, @ys) -> ::(@x, ::(@y, @ys))
     , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
     , #compare(#pos(@x), #0()) -> #GT()
     , #compare(#pos(@x), #neg(@y)) -> #GT()
     , #compare(#0(), #pos(@y)) -> #LT()
     , #compare(#0(), #0()) -> #EQ()
     , #compare(#0(), #neg(@y)) -> #GT()
     , #compare(#0(), #s(@y)) -> #LT()
     , #compare(#neg(@x), #pos(@y)) -> #LT()
     , #compare(#neg(@x), #0()) -> #LT()
     , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
     , #compare(#s(@x), #0()) -> #GT()
     , #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
     , append#1(nil(), @l2) -> @l2
     , append#1(::(@x, @xs), @l2) -> ::(@x, append(@xs, @l2))
     , flatten#1(leaf()) -> nil()
     , flatten#1(node(@l, @t1, @t2)) ->
       append(@l, append(flatten(@t1), flatten(@t2)))
     , insert#1(nil(), @x) -> ::(@x, nil())
     , insert#1(::(@y, @ys), @x) -> insert#2(#less(@y, @x), @x, @y, @ys)
     , #less(@x, @y) -> #cklt(#compare(@x, @y))
     , flatten(@t) -> flatten#1(@t)
     , insertionsort(@l) -> insertionsort#1(@l) }
   Obligation:
     innermost runtime complexity
   Answer:
     YES(O(1),O(n^2))
   
   Due to missing edges in the dependency-graph, the right-hand sides
   of following rules could be simplified:
   
     { flattensort^#(@t) ->
       c_1(insertionsort^#(flatten(@t)), flatten^#(@t)) }
   
   We are left with following problem, upon which TcT provides the
   certificate YES(O(1),O(n^2)).
   
   Strict DPs:
     { flattensort^#(@t) -> c_1(flatten^#(@t))
     , flatten^#(@t) -> c_2(flatten#1^#(@t))
     , append^#(@l1, @l2) -> c_3(append#1^#(@l1, @l2))
     , append#1^#(::(@x, @xs), @l2) -> c_4(append^#(@xs, @l2))
     , flatten#1^#(node(@l, @t1, @t2)) ->
       c_5(append^#(@l, append(flatten(@t1), flatten(@t2))),
           append^#(flatten(@t1), flatten(@t2)),
           flatten^#(@t1),
           flatten^#(@t2)) }
   Weak Trs:
     { insertionsort#1(nil()) -> nil()
     , insertionsort#1(::(@x, @xs)) -> insert(@x, insertionsort(@xs))
     , append(@l1, @l2) -> append#1(@l1, @l2)
     , #cklt(#EQ()) -> #false()
     , #cklt(#LT()) -> #true()
     , #cklt(#GT()) -> #false()
     , insert(@x, @l) -> insert#1(@l, @x)
     , insert#2(#true(), @x, @y, @ys) -> ::(@y, insert(@x, @ys))
     , insert#2(#false(), @x, @y, @ys) -> ::(@x, ::(@y, @ys))
     , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
     , #compare(#pos(@x), #0()) -> #GT()
     , #compare(#pos(@x), #neg(@y)) -> #GT()
     , #compare(#0(), #pos(@y)) -> #LT()
     , #compare(#0(), #0()) -> #EQ()
     , #compare(#0(), #neg(@y)) -> #GT()
     , #compare(#0(), #s(@y)) -> #LT()
     , #compare(#neg(@x), #pos(@y)) -> #LT()
     , #compare(#neg(@x), #0()) -> #LT()
     , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
     , #compare(#s(@x), #0()) -> #GT()
     , #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
     , append#1(nil(), @l2) -> @l2
     , append#1(::(@x, @xs), @l2) -> ::(@x, append(@xs, @l2))
     , flatten#1(leaf()) -> nil()
     , flatten#1(node(@l, @t1, @t2)) ->
       append(@l, append(flatten(@t1), flatten(@t2)))
     , insert#1(nil(), @x) -> ::(@x, nil())
     , insert#1(::(@y, @ys), @x) -> insert#2(#less(@y, @x), @x, @y, @ys)
     , #less(@x, @y) -> #cklt(#compare(@x, @y))
     , flatten(@t) -> flatten#1(@t)
     , insertionsort(@l) -> insertionsort#1(@l) }
   Obligation:
     innermost runtime complexity
   Answer:
     YES(O(1),O(n^2))
   
   We replace rewrite rules by usable rules:
   
     Weak Usable Rules:
       { append(@l1, @l2) -> append#1(@l1, @l2)
       , append#1(nil(), @l2) -> @l2
       , append#1(::(@x, @xs), @l2) -> ::(@x, append(@xs, @l2))
       , flatten#1(leaf()) -> nil()
       , flatten#1(node(@l, @t1, @t2)) ->
         append(@l, append(flatten(@t1), flatten(@t2)))
       , flatten(@t) -> flatten#1(@t) }
   
   We are left with following problem, upon which TcT provides the
   certificate YES(O(1),O(n^2)).
   
   Strict DPs:
     { flattensort^#(@t) -> c_1(flatten^#(@t))
     , flatten^#(@t) -> c_2(flatten#1^#(@t))
     , append^#(@l1, @l2) -> c_3(append#1^#(@l1, @l2))
     , append#1^#(::(@x, @xs), @l2) -> c_4(append^#(@xs, @l2))
     , flatten#1^#(node(@l, @t1, @t2)) ->
       c_5(append^#(@l, append(flatten(@t1), flatten(@t2))),
           append^#(flatten(@t1), flatten(@t2)),
           flatten^#(@t1),
           flatten^#(@t2)) }
   Weak Trs:
     { append(@l1, @l2) -> append#1(@l1, @l2)
     , append#1(nil(), @l2) -> @l2
     , append#1(::(@x, @xs), @l2) -> ::(@x, append(@xs, @l2))
     , flatten#1(leaf()) -> nil()
     , flatten#1(node(@l, @t1, @t2)) ->
       append(@l, append(flatten(@t1), flatten(@t2)))
     , flatten(@t) -> flatten#1(@t) }
   Obligation:
     innermost runtime complexity
   Answer:
     YES(O(1),O(n^2))
   
   We decompose the input problem according to the dependency graph
   into the upper component
   
     { flattensort^#(@t) -> c_1(flatten^#(@t))
     , flatten^#(@t) -> c_2(flatten#1^#(@t))
     , flatten#1^#(node(@l, @t1, @t2)) ->
       c_5(append^#(@l, append(flatten(@t1), flatten(@t2))),
           append^#(flatten(@t1), flatten(@t2)),
           flatten^#(@t1),
           flatten^#(@t2)) }
   
   and lower component
   
     { append^#(@l1, @l2) -> c_3(append#1^#(@l1, @l2))
     , append#1^#(::(@x, @xs), @l2) -> c_4(append^#(@xs, @l2)) }
   
   Further, following extension rules are added to the lower
   component.
   
   { flattensort^#(@t) -> flatten^#(@t)
   , flatten^#(@t) -> flatten#1^#(@t)
   , flatten#1^#(node(@l, @t1, @t2)) -> flatten^#(@t1)
   , flatten#1^#(node(@l, @t1, @t2)) -> flatten^#(@t2)
   , flatten#1^#(node(@l, @t1, @t2)) ->
     append^#(@l, append(flatten(@t1), flatten(@t2)))
   , flatten#1^#(node(@l, @t1, @t2)) ->
     append^#(flatten(@t1), flatten(@t2)) }
   
   TcT solves the upper component with certificate YES(O(1),O(n^1)).
   
   Sub-proof:
   ----------
     We are left with following problem, upon which TcT provides the
     certificate YES(O(1),O(n^1)).
     
     Strict DPs:
       { flattensort^#(@t) -> c_1(flatten^#(@t))
       , flatten^#(@t) -> c_2(flatten#1^#(@t))
       , flatten#1^#(node(@l, @t1, @t2)) ->
         c_5(append^#(@l, append(flatten(@t1), flatten(@t2))),
             append^#(flatten(@t1), flatten(@t2)),
             flatten^#(@t1),
             flatten^#(@t2)) }
     Weak Trs:
       { append(@l1, @l2) -> append#1(@l1, @l2)
       , append#1(nil(), @l2) -> @l2
       , append#1(::(@x, @xs), @l2) -> ::(@x, append(@xs, @l2))
       , flatten#1(leaf()) -> nil()
       , flatten#1(node(@l, @t1, @t2)) ->
         append(@l, append(flatten(@t1), flatten(@t2)))
       , flatten(@t) -> flatten#1(@t) }
     Obligation:
       innermost runtime complexity
     Answer:
       YES(O(1),O(n^1))
     
     We use the processor 'matrix interpretation of dimension 1' to
     orient following rules strictly.
     
     DPs:
       { 1: flattensort^#(@t) -> c_1(flatten^#(@t))
       , 3: flatten#1^#(node(@l, @t1, @t2)) ->
            c_5(append^#(@l, append(flatten(@t1), flatten(@t2))),
                append^#(flatten(@t1), flatten(@t2)),
                flatten^#(@t1),
                flatten^#(@t2)) }
     
     Sub-proof:
     ----------
       The following argument positions are usable:
         Uargs(c_1) = {1}, Uargs(c_2) = {1}, Uargs(c_5) = {1, 2, 3, 4}
       
       TcT has computed the following constructor-based matrix
       interpretation satisfying not(EDA).
       
                        [leaf] = [0]                                    
                                                                        
              [append](x1, x2) = [1] x2 + [0]                           
                                                                        
            [node](x1, x2, x3) = [1] x1 + [1] x2 + [1] x3 + [2]         
                                                                        
                         [nil] = [0]                                    
                                                                        
            [append#1](x1, x2) = [1] x2 + [0]                           
                                                                        
               [flatten#1](x1) = [0]                                    
                                                                        
                  [::](x1, x2) = [0]                                    
                                                                        
                 [flatten](x1) = [0]                                    
                                                                        
           [flattensort^#](x1) = [7] x1 + [7]                           
                                                                        
               [flatten^#](x1) = [4] x1 + [1]                           
                                                                        
            [append^#](x1, x2) = [1] x2 + [0]                           
                                                                        
             [flatten#1^#](x1) = [4] x1 + [1]                           
                                                                        
                     [c_1](x1) = [1] x1 + [4]                           
                                                                        
                     [c_2](x1) = [1] x1 + [0]                           
                                                                        
         [c_5](x1, x2, x3, x4) = [1] x1 + [2] x2 + [1] x3 + [1] x4 + [5]
       
       The order satisfies the following ordering constraints:
       
                        [append(@l1, @l2)] =  [1] @l2 + [0]                                         
                                           >= [1] @l2 + [0]                                         
                                           =  [append#1(@l1, @l2)]                                  
                                                                                                    
                    [append#1(nil(), @l2)] =  [1] @l2 + [0]                                         
                                           >= [1] @l2 + [0]                                         
                                           =  [@l2]                                                 
                                                                                                    
              [append#1(::(@x, @xs), @l2)] =  [1] @l2 + [0]                                         
                                           >= [0]                                                   
                                           =  [::(@x, append(@xs, @l2))]                            
                                                                                                    
                       [flatten#1(leaf())] =  [0]                                                   
                                           >= [0]                                                   
                                           =  [nil()]                                               
                                                                                                    
           [flatten#1(node(@l, @t1, @t2))] =  [0]                                                   
                                           >= [0]                                                   
                                           =  [append(@l, append(flatten(@t1), flatten(@t2)))]      
                                                                                                    
                             [flatten(@t)] =  [0]                                                   
                                           >= [0]                                                   
                                           =  [flatten#1(@t)]                                       
                                                                                                    
                       [flattensort^#(@t)] =  [7] @t + [7]                                          
                                           >  [4] @t + [5]                                          
                                           =  [c_1(flatten^#(@t))]                                  
                                                                                                    
                           [flatten^#(@t)] =  [4] @t + [1]                                          
                                           >= [4] @t + [1]                                          
                                           =  [c_2(flatten#1^#(@t))]                                
                                                                                                    
         [flatten#1^#(node(@l, @t1, @t2))] =  [4] @l + [4] @t1 + [4] @t2 + [9]                      
                                           >  [4] @t1 + [4] @t2 + [7]                               
                                           =  [c_5(append^#(@l, append(flatten(@t1), flatten(@t2))),
                                                   append^#(flatten(@t1), flatten(@t2)),            
                                                   flatten^#(@t1),                                  
                                                   flatten^#(@t2))]                                 
                                                                                                    
     
     We return to the main proof. Consider the set of all dependency
     pairs
     
     :
       { 1: flattensort^#(@t) -> c_1(flatten^#(@t))
       , 2: flatten^#(@t) -> c_2(flatten#1^#(@t))
       , 3: flatten#1^#(node(@l, @t1, @t2)) ->
            c_5(append^#(@l, append(flatten(@t1), flatten(@t2))),
                append^#(flatten(@t1), flatten(@t2)),
                flatten^#(@t1),
                flatten^#(@t2)) }
     
     Processor 'matrix interpretation of dimension 1' induces the
     complexity certificate YES(?,O(n^1)) on application of dependency
     pairs {1,3}. These cover all (indirect) predecessors of dependency
     pairs {1,2,3}, their number of application is equally bounded. The
     dependency pairs are shifted into the weak component.
     
     We are left with following problem, upon which TcT provides the
     certificate YES(O(1),O(1)).
     
     Weak DPs:
       { flattensort^#(@t) -> c_1(flatten^#(@t))
       , flatten^#(@t) -> c_2(flatten#1^#(@t))
       , flatten#1^#(node(@l, @t1, @t2)) ->
         c_5(append^#(@l, append(flatten(@t1), flatten(@t2))),
             append^#(flatten(@t1), flatten(@t2)),
             flatten^#(@t1),
             flatten^#(@t2)) }
     Weak Trs:
       { append(@l1, @l2) -> append#1(@l1, @l2)
       , append#1(nil(), @l2) -> @l2
       , append#1(::(@x, @xs), @l2) -> ::(@x, append(@xs, @l2))
       , flatten#1(leaf()) -> nil()
       , flatten#1(node(@l, @t1, @t2)) ->
         append(@l, append(flatten(@t1), flatten(@t2)))
       , flatten(@t) -> flatten#1(@t) }
     Obligation:
       innermost runtime complexity
     Answer:
       YES(O(1),O(1))
     
     The following weak DPs constitute a sub-graph of the DG that is
     closed under successors. The DPs are removed.
     
     { flattensort^#(@t) -> c_1(flatten^#(@t))
     , flatten^#(@t) -> c_2(flatten#1^#(@t))
     , flatten#1^#(node(@l, @t1, @t2)) ->
       c_5(append^#(@l, append(flatten(@t1), flatten(@t2))),
           append^#(flatten(@t1), flatten(@t2)),
           flatten^#(@t1),
           flatten^#(@t2)) }
     
     We are left with following problem, upon which TcT provides the
     certificate YES(O(1),O(1)).
     
     Weak Trs:
       { append(@l1, @l2) -> append#1(@l1, @l2)
       , append#1(nil(), @l2) -> @l2
       , append#1(::(@x, @xs), @l2) -> ::(@x, append(@xs, @l2))
       , flatten#1(leaf()) -> nil()
       , flatten#1(node(@l, @t1, @t2)) ->
         append(@l, append(flatten(@t1), flatten(@t2)))
       , flatten(@t) -> flatten#1(@t) }
     Obligation:
       innermost runtime complexity
     Answer:
       YES(O(1),O(1))
     
     No rule is usable, rules are removed from the input problem.
     
     We are left with following problem, upon which TcT provides the
     certificate YES(O(1),O(1)).
     
     Rules: Empty
     Obligation:
       innermost runtime complexity
     Answer:
       YES(O(1),O(1))
     
     Empty rules are trivially bounded
   
   We return to the main proof.
   
   We are left with following problem, upon which TcT provides the
   certificate YES(O(1),O(n^1)).
   
   Strict DPs:
     { append^#(@l1, @l2) -> c_3(append#1^#(@l1, @l2))
     , append#1^#(::(@x, @xs), @l2) -> c_4(append^#(@xs, @l2)) }
   Weak DPs:
     { flattensort^#(@t) -> flatten^#(@t)
     , flatten^#(@t) -> flatten#1^#(@t)
     , flatten#1^#(node(@l, @t1, @t2)) -> flatten^#(@t1)
     , flatten#1^#(node(@l, @t1, @t2)) -> flatten^#(@t2)
     , flatten#1^#(node(@l, @t1, @t2)) ->
       append^#(@l, append(flatten(@t1), flatten(@t2)))
     , flatten#1^#(node(@l, @t1, @t2)) ->
       append^#(flatten(@t1), flatten(@t2)) }
   Weak Trs:
     { append(@l1, @l2) -> append#1(@l1, @l2)
     , append#1(nil(), @l2) -> @l2
     , append#1(::(@x, @xs), @l2) -> ::(@x, append(@xs, @l2))
     , flatten#1(leaf()) -> nil()
     , flatten#1(node(@l, @t1, @t2)) ->
       append(@l, append(flatten(@t1), flatten(@t2)))
     , flatten(@t) -> flatten#1(@t) }
   Obligation:
     innermost runtime complexity
   Answer:
     YES(O(1),O(n^1))
   
   We use the processor 'matrix interpretation of dimension 1' to
   orient following rules strictly.
   
   DPs:
     { 1: append^#(@l1, @l2) -> c_3(append#1^#(@l1, @l2))
     , 3: flattensort^#(@t) -> flatten^#(@t)
     , 7: flatten#1^#(node(@l, @t1, @t2)) ->
          append^#(@l, append(flatten(@t1), flatten(@t2)))
     , 8: flatten#1^#(node(@l, @t1, @t2)) ->
          append^#(flatten(@t1), flatten(@t2)) }
   Trs: { flatten#1(leaf()) -> nil() }
   
   Sub-proof:
   ----------
     The following argument positions are usable:
       Uargs(c_3) = {1}, Uargs(c_4) = {1}
     
     TcT has computed the following constructor-based matrix
     interpretation satisfying not(EDA).
     
                     [leaf] = [1]                           
                                                            
           [append](x1, x2) = [1] x1 + [1] x2 + [0]         
                                                            
         [node](x1, x2, x3) = [1] x1 + [1] x2 + [1] x3 + [0]
                                                            
                      [nil] = [0]                           
                                                            
         [append#1](x1, x2) = [1] x1 + [1] x2 + [0]         
                                                            
            [flatten#1](x1) = [4] x1 + [0]                  
                                                            
               [::](x1, x2) = [1] x2 + [1]                  
                                                            
              [flatten](x1) = [4] x1 + [0]                  
                                                            
        [flattensort^#](x1) = [7] x1 + [7]                  
                                                            
            [flatten^#](x1) = [4] x1 + [4]                  
                                                            
         [append^#](x1, x2) = [1] x1 + [2]                  
                                                            
       [append#1^#](x1, x2) = [1] x1 + [1]                  
                                                            
          [flatten#1^#](x1) = [4] x1 + [4]                  
                                                            
                  [c_3](x1) = [1] x1 + [0]                  
                                                            
                  [c_4](x1) = [1] x1 + [0]                  
     
     The order satisfies the following ordering constraints:
     
                      [append(@l1, @l2)] =  [1] @l1 + [1] @l2 + [0]                           
                                         >= [1] @l1 + [1] @l2 + [0]                           
                                         =  [append#1(@l1, @l2)]                              
                                                                                              
                  [append#1(nil(), @l2)] =  [1] @l2 + [0]                                     
                                         >= [1] @l2 + [0]                                     
                                         =  [@l2]                                             
                                                                                              
            [append#1(::(@x, @xs), @l2)] =  [1] @l2 + [1] @xs + [1]                           
                                         >= [1] @l2 + [1] @xs + [1]                           
                                         =  [::(@x, append(@xs, @l2))]                        
                                                                                              
                     [flatten#1(leaf())] =  [4]                                               
                                         >  [0]                                               
                                         =  [nil()]                                           
                                                                                              
         [flatten#1(node(@l, @t1, @t2))] =  [4] @l + [4] @t1 + [4] @t2 + [0]                  
                                         >= [1] @l + [4] @t1 + [4] @t2 + [0]                  
                                         =  [append(@l, append(flatten(@t1), flatten(@t2)))]  
                                                                                              
                           [flatten(@t)] =  [4] @t + [0]                                      
                                         >= [4] @t + [0]                                      
                                         =  [flatten#1(@t)]                                   
                                                                                              
                     [flattensort^#(@t)] =  [7] @t + [7]                                      
                                         >  [4] @t + [4]                                      
                                         =  [flatten^#(@t)]                                   
                                                                                              
                         [flatten^#(@t)] =  [4] @t + [4]                                      
                                         >= [4] @t + [4]                                      
                                         =  [flatten#1^#(@t)]                                 
                                                                                              
                    [append^#(@l1, @l2)] =  [1] @l1 + [2]                                     
                                         >  [1] @l1 + [1]                                     
                                         =  [c_3(append#1^#(@l1, @l2))]                       
                                                                                              
          [append#1^#(::(@x, @xs), @l2)] =  [1] @xs + [2]                                     
                                         >= [1] @xs + [2]                                     
                                         =  [c_4(append^#(@xs, @l2))]                         
                                                                                              
       [flatten#1^#(node(@l, @t1, @t2))] =  [4] @l + [4] @t1 + [4] @t2 + [4]                  
                                         >= [4] @t1 + [4]                                     
                                         =  [flatten^#(@t1)]                                  
                                                                                              
       [flatten#1^#(node(@l, @t1, @t2))] =  [4] @l + [4] @t1 + [4] @t2 + [4]                  
                                         >= [4] @t2 + [4]                                     
                                         =  [flatten^#(@t2)]                                  
                                                                                              
       [flatten#1^#(node(@l, @t1, @t2))] =  [4] @l + [4] @t1 + [4] @t2 + [4]                  
                                         >  [1] @l + [2]                                      
                                         =  [append^#(@l, append(flatten(@t1), flatten(@t2)))]
                                                                                              
       [flatten#1^#(node(@l, @t1, @t2))] =  [4] @l + [4] @t1 + [4] @t2 + [4]                  
                                         >  [4] @t1 + [2]                                     
                                         =  [append^#(flatten(@t1), flatten(@t2))]            
                                                                                              
   
   We return to the main proof. Consider the set of all dependency
   pairs
   
   :
     { 1: append^#(@l1, @l2) -> c_3(append#1^#(@l1, @l2))
     , 2: append#1^#(::(@x, @xs), @l2) -> c_4(append^#(@xs, @l2))
     , 3: flattensort^#(@t) -> flatten^#(@t)
     , 4: flatten^#(@t) -> flatten#1^#(@t)
     , 5: flatten#1^#(node(@l, @t1, @t2)) -> flatten^#(@t1)
     , 6: flatten#1^#(node(@l, @t1, @t2)) -> flatten^#(@t2)
     , 7: flatten#1^#(node(@l, @t1, @t2)) ->
          append^#(@l, append(flatten(@t1), flatten(@t2)))
     , 8: flatten#1^#(node(@l, @t1, @t2)) ->
          append^#(flatten(@t1), flatten(@t2)) }
   
   Processor 'matrix interpretation of dimension 1' induces the
   complexity certificate YES(?,O(n^1)) on application of dependency
   pairs {1,3,7,8}. These cover all (indirect) predecessors of
   dependency pairs {1,2,3,7,8}, their number of application is
   equally bounded. The dependency pairs are shifted into the weak
   component.
   
   We are left with following problem, upon which TcT provides the
   certificate YES(O(1),O(1)).
   
   Weak DPs:
     { flattensort^#(@t) -> flatten^#(@t)
     , flatten^#(@t) -> flatten#1^#(@t)
     , append^#(@l1, @l2) -> c_3(append#1^#(@l1, @l2))
     , append#1^#(::(@x, @xs), @l2) -> c_4(append^#(@xs, @l2))
     , flatten#1^#(node(@l, @t1, @t2)) -> flatten^#(@t1)
     , flatten#1^#(node(@l, @t1, @t2)) -> flatten^#(@t2)
     , flatten#1^#(node(@l, @t1, @t2)) ->
       append^#(@l, append(flatten(@t1), flatten(@t2)))
     , flatten#1^#(node(@l, @t1, @t2)) ->
       append^#(flatten(@t1), flatten(@t2)) }
   Weak Trs:
     { append(@l1, @l2) -> append#1(@l1, @l2)
     , append#1(nil(), @l2) -> @l2
     , append#1(::(@x, @xs), @l2) -> ::(@x, append(@xs, @l2))
     , flatten#1(leaf()) -> nil()
     , flatten#1(node(@l, @t1, @t2)) ->
       append(@l, append(flatten(@t1), flatten(@t2)))
     , flatten(@t) -> flatten#1(@t) }
   Obligation:
     innermost runtime complexity
   Answer:
     YES(O(1),O(1))
   
   The following weak DPs constitute a sub-graph of the DG that is
   closed under successors. The DPs are removed.
   
   { flattensort^#(@t) -> flatten^#(@t)
   , flatten^#(@t) -> flatten#1^#(@t)
   , append^#(@l1, @l2) -> c_3(append#1^#(@l1, @l2))
   , append#1^#(::(@x, @xs), @l2) -> c_4(append^#(@xs, @l2))
   , flatten#1^#(node(@l, @t1, @t2)) -> flatten^#(@t1)
   , flatten#1^#(node(@l, @t1, @t2)) -> flatten^#(@t2)
   , flatten#1^#(node(@l, @t1, @t2)) ->
     append^#(@l, append(flatten(@t1), flatten(@t2)))
   , flatten#1^#(node(@l, @t1, @t2)) ->
     append^#(flatten(@t1), flatten(@t2)) }
   
   We are left with following problem, upon which TcT provides the
   certificate YES(O(1),O(1)).
   
   Weak Trs:
     { append(@l1, @l2) -> append#1(@l1, @l2)
     , append#1(nil(), @l2) -> @l2
     , append#1(::(@x, @xs), @l2) -> ::(@x, append(@xs, @l2))
     , flatten#1(leaf()) -> nil()
     , flatten#1(node(@l, @t1, @t2)) ->
       append(@l, append(flatten(@t1), flatten(@t2)))
     , flatten(@t) -> flatten#1(@t) }
   Obligation:
     innermost runtime complexity
   Answer:
     YES(O(1),O(1))
   
   No rule is usable, rules are removed from the input problem.
   
   We are left with following problem, upon which TcT provides the
   certificate YES(O(1),O(1)).
   
   Rules: Empty
   Obligation:
     innermost runtime complexity
   Answer:
     YES(O(1),O(1))
   
   Empty rules are trivially bounded

S) We are left with following problem, upon which TcT provides the
   certificate YES(O(1),O(n^2)).
   
   Strict DPs:
     { insertionsort^#(@l) -> c_2(insertionsort#1^#(@l))
     , insertionsort#1^#(::(@x, @xs)) ->
       c_4(insert^#(@x, insertionsort(@xs)), insertionsort^#(@xs))
     , insert^#(@x, @l) -> c_5(insert#1^#(@l, @x))
     , insert#1^#(::(@y, @ys), @x) ->
       c_8(insert#2^#(#less(@y, @x), @x, @y, @ys))
     , insert#2^#(#true(), @x, @y, @ys) -> c_9(insert^#(@x, @ys)) }
   Weak DPs:
     { flattensort^#(@t) ->
       c_1(insertionsort^#(flatten(@t)), flatten^#(@t))
     , flatten^#(@t) -> c_3(flatten#1^#(@t))
     , append^#(@l1, @l2) -> c_6(append#1^#(@l1, @l2))
     , append#1^#(::(@x, @xs), @l2) -> c_7(append^#(@xs, @l2))
     , flatten#1^#(node(@l, @t1, @t2)) ->
       c_10(append^#(@l, append(flatten(@t1), flatten(@t2))),
            append^#(flatten(@t1), flatten(@t2)),
            flatten^#(@t1),
            flatten^#(@t2)) }
   Weak Trs:
     { insertionsort#1(nil()) -> nil()
     , insertionsort#1(::(@x, @xs)) -> insert(@x, insertionsort(@xs))
     , append(@l1, @l2) -> append#1(@l1, @l2)
     , #cklt(#EQ()) -> #false()
     , #cklt(#LT()) -> #true()
     , #cklt(#GT()) -> #false()
     , insert(@x, @l) -> insert#1(@l, @x)
     , insert#2(#true(), @x, @y, @ys) -> ::(@y, insert(@x, @ys))
     , insert#2(#false(), @x, @y, @ys) -> ::(@x, ::(@y, @ys))
     , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
     , #compare(#pos(@x), #0()) -> #GT()
     , #compare(#pos(@x), #neg(@y)) -> #GT()
     , #compare(#0(), #pos(@y)) -> #LT()
     , #compare(#0(), #0()) -> #EQ()
     , #compare(#0(), #neg(@y)) -> #GT()
     , #compare(#0(), #s(@y)) -> #LT()
     , #compare(#neg(@x), #pos(@y)) -> #LT()
     , #compare(#neg(@x), #0()) -> #LT()
     , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
     , #compare(#s(@x), #0()) -> #GT()
     , #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
     , append#1(nil(), @l2) -> @l2
     , append#1(::(@x, @xs), @l2) -> ::(@x, append(@xs, @l2))
     , flatten#1(leaf()) -> nil()
     , flatten#1(node(@l, @t1, @t2)) ->
       append(@l, append(flatten(@t1), flatten(@t2)))
     , insert#1(nil(), @x) -> ::(@x, nil())
     , insert#1(::(@y, @ys), @x) -> insert#2(#less(@y, @x), @x, @y, @ys)
     , #less(@x, @y) -> #cklt(#compare(@x, @y))
     , flatten(@t) -> flatten#1(@t)
     , insertionsort(@l) -> insertionsort#1(@l) }
   Obligation:
     innermost runtime complexity
   Answer:
     YES(O(1),O(n^2))
   
   The following weak DPs constitute a sub-graph of the DG that is
   closed under successors. The DPs are removed.
   
   { flatten^#(@t) -> c_3(flatten#1^#(@t))
   , append^#(@l1, @l2) -> c_6(append#1^#(@l1, @l2))
   , append#1^#(::(@x, @xs), @l2) -> c_7(append^#(@xs, @l2))
   , flatten#1^#(node(@l, @t1, @t2)) ->
     c_10(append^#(@l, append(flatten(@t1), flatten(@t2))),
          append^#(flatten(@t1), flatten(@t2)),
          flatten^#(@t1),
          flatten^#(@t2)) }
   
   We are left with following problem, upon which TcT provides the
   certificate YES(O(1),O(n^2)).
   
   Strict DPs:
     { insertionsort^#(@l) -> c_2(insertionsort#1^#(@l))
     , insertionsort#1^#(::(@x, @xs)) ->
       c_4(insert^#(@x, insertionsort(@xs)), insertionsort^#(@xs))
     , insert^#(@x, @l) -> c_5(insert#1^#(@l, @x))
     , insert#1^#(::(@y, @ys), @x) ->
       c_8(insert#2^#(#less(@y, @x), @x, @y, @ys))
     , insert#2^#(#true(), @x, @y, @ys) -> c_9(insert^#(@x, @ys)) }
   Weak DPs:
     { flattensort^#(@t) ->
       c_1(insertionsort^#(flatten(@t)), flatten^#(@t)) }
   Weak Trs:
     { insertionsort#1(nil()) -> nil()
     , insertionsort#1(::(@x, @xs)) -> insert(@x, insertionsort(@xs))
     , append(@l1, @l2) -> append#1(@l1, @l2)
     , #cklt(#EQ()) -> #false()
     , #cklt(#LT()) -> #true()
     , #cklt(#GT()) -> #false()
     , insert(@x, @l) -> insert#1(@l, @x)
     , insert#2(#true(), @x, @y, @ys) -> ::(@y, insert(@x, @ys))
     , insert#2(#false(), @x, @y, @ys) -> ::(@x, ::(@y, @ys))
     , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
     , #compare(#pos(@x), #0()) -> #GT()
     , #compare(#pos(@x), #neg(@y)) -> #GT()
     , #compare(#0(), #pos(@y)) -> #LT()
     , #compare(#0(), #0()) -> #EQ()
     , #compare(#0(), #neg(@y)) -> #GT()
     , #compare(#0(), #s(@y)) -> #LT()
     , #compare(#neg(@x), #pos(@y)) -> #LT()
     , #compare(#neg(@x), #0()) -> #LT()
     , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
     , #compare(#s(@x), #0()) -> #GT()
     , #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
     , append#1(nil(), @l2) -> @l2
     , append#1(::(@x, @xs), @l2) -> ::(@x, append(@xs, @l2))
     , flatten#1(leaf()) -> nil()
     , flatten#1(node(@l, @t1, @t2)) ->
       append(@l, append(flatten(@t1), flatten(@t2)))
     , insert#1(nil(), @x) -> ::(@x, nil())
     , insert#1(::(@y, @ys), @x) -> insert#2(#less(@y, @x), @x, @y, @ys)
     , #less(@x, @y) -> #cklt(#compare(@x, @y))
     , flatten(@t) -> flatten#1(@t)
     , insertionsort(@l) -> insertionsort#1(@l) }
   Obligation:
     innermost runtime complexity
   Answer:
     YES(O(1),O(n^2))
   
   Due to missing edges in the dependency-graph, the right-hand sides
   of following rules could be simplified:
   
     { flattensort^#(@t) ->
       c_1(insertionsort^#(flatten(@t)), flatten^#(@t)) }
   
   We are left with following problem, upon which TcT provides the
   certificate YES(O(1),O(n^2)).
   
   Strict DPs:
     { insertionsort^#(@l) -> c_1(insertionsort#1^#(@l))
     , insertionsort#1^#(::(@x, @xs)) ->
       c_2(insert^#(@x, insertionsort(@xs)), insertionsort^#(@xs))
     , insert^#(@x, @l) -> c_3(insert#1^#(@l, @x))
     , insert#1^#(::(@y, @ys), @x) ->
       c_4(insert#2^#(#less(@y, @x), @x, @y, @ys))
     , insert#2^#(#true(), @x, @y, @ys) -> c_5(insert^#(@x, @ys)) }
   Weak DPs:
     { flattensort^#(@t) -> c_6(insertionsort^#(flatten(@t))) }
   Weak Trs:
     { insertionsort#1(nil()) -> nil()
     , insertionsort#1(::(@x, @xs)) -> insert(@x, insertionsort(@xs))
     , append(@l1, @l2) -> append#1(@l1, @l2)
     , #cklt(#EQ()) -> #false()
     , #cklt(#LT()) -> #true()
     , #cklt(#GT()) -> #false()
     , insert(@x, @l) -> insert#1(@l, @x)
     , insert#2(#true(), @x, @y, @ys) -> ::(@y, insert(@x, @ys))
     , insert#2(#false(), @x, @y, @ys) -> ::(@x, ::(@y, @ys))
     , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
     , #compare(#pos(@x), #0()) -> #GT()
     , #compare(#pos(@x), #neg(@y)) -> #GT()
     , #compare(#0(), #pos(@y)) -> #LT()
     , #compare(#0(), #0()) -> #EQ()
     , #compare(#0(), #neg(@y)) -> #GT()
     , #compare(#0(), #s(@y)) -> #LT()
     , #compare(#neg(@x), #pos(@y)) -> #LT()
     , #compare(#neg(@x), #0()) -> #LT()
     , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
     , #compare(#s(@x), #0()) -> #GT()
     , #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
     , append#1(nil(), @l2) -> @l2
     , append#1(::(@x, @xs), @l2) -> ::(@x, append(@xs, @l2))
     , flatten#1(leaf()) -> nil()
     , flatten#1(node(@l, @t1, @t2)) ->
       append(@l, append(flatten(@t1), flatten(@t2)))
     , insert#1(nil(), @x) -> ::(@x, nil())
     , insert#1(::(@y, @ys), @x) -> insert#2(#less(@y, @x), @x, @y, @ys)
     , #less(@x, @y) -> #cklt(#compare(@x, @y))
     , flatten(@t) -> flatten#1(@t)
     , insertionsort(@l) -> insertionsort#1(@l) }
   Obligation:
     innermost runtime complexity
   Answer:
     YES(O(1),O(n^2))
   
   We decompose the input problem according to the dependency graph
   into the upper component
   
     { flattensort^#(@t) -> c_6(insertionsort^#(flatten(@t)))
     , insertionsort^#(@l) -> c_1(insertionsort#1^#(@l))
     , insertionsort#1^#(::(@x, @xs)) ->
       c_2(insert^#(@x, insertionsort(@xs)), insertionsort^#(@xs)) }
   
   and lower component
   
     { insert^#(@x, @l) -> c_3(insert#1^#(@l, @x))
     , insert#1^#(::(@y, @ys), @x) ->
       c_4(insert#2^#(#less(@y, @x), @x, @y, @ys))
     , insert#2^#(#true(), @x, @y, @ys) -> c_5(insert^#(@x, @ys)) }
   
   Further, following extension rules are added to the lower
   component.
   
   { flattensort^#(@t) -> insertionsort^#(flatten(@t))
   , insertionsort^#(@l) -> insertionsort#1^#(@l)
   , insertionsort#1^#(::(@x, @xs)) -> insertionsort^#(@xs)
   , insertionsort#1^#(::(@x, @xs)) ->
     insert^#(@x, insertionsort(@xs)) }
   
   TcT solves the upper component with certificate YES(O(1),O(n^1)).
   
   Sub-proof:
   ----------
     We are left with following problem, upon which TcT provides the
     certificate YES(O(1),O(n^1)).
     
     Strict DPs:
       { insertionsort^#(@l) -> c_1(insertionsort#1^#(@l))
       , insertionsort#1^#(::(@x, @xs)) ->
         c_2(insert^#(@x, insertionsort(@xs)), insertionsort^#(@xs)) }
     Weak DPs:
       { flattensort^#(@t) -> c_6(insertionsort^#(flatten(@t))) }
     Weak Trs:
       { insertionsort#1(nil()) -> nil()
       , insertionsort#1(::(@x, @xs)) -> insert(@x, insertionsort(@xs))
       , append(@l1, @l2) -> append#1(@l1, @l2)
       , #cklt(#EQ()) -> #false()
       , #cklt(#LT()) -> #true()
       , #cklt(#GT()) -> #false()
       , insert(@x, @l) -> insert#1(@l, @x)
       , insert#2(#true(), @x, @y, @ys) -> ::(@y, insert(@x, @ys))
       , insert#2(#false(), @x, @y, @ys) -> ::(@x, ::(@y, @ys))
       , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
       , #compare(#pos(@x), #0()) -> #GT()
       , #compare(#pos(@x), #neg(@y)) -> #GT()
       , #compare(#0(), #pos(@y)) -> #LT()
       , #compare(#0(), #0()) -> #EQ()
       , #compare(#0(), #neg(@y)) -> #GT()
       , #compare(#0(), #s(@y)) -> #LT()
       , #compare(#neg(@x), #pos(@y)) -> #LT()
       , #compare(#neg(@x), #0()) -> #LT()
       , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
       , #compare(#s(@x), #0()) -> #GT()
       , #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
       , append#1(nil(), @l2) -> @l2
       , append#1(::(@x, @xs), @l2) -> ::(@x, append(@xs, @l2))
       , flatten#1(leaf()) -> nil()
       , flatten#1(node(@l, @t1, @t2)) ->
         append(@l, append(flatten(@t1), flatten(@t2)))
       , insert#1(nil(), @x) -> ::(@x, nil())
       , insert#1(::(@y, @ys), @x) -> insert#2(#less(@y, @x), @x, @y, @ys)
       , #less(@x, @y) -> #cklt(#compare(@x, @y))
       , flatten(@t) -> flatten#1(@t)
       , insertionsort(@l) -> insertionsort#1(@l) }
     Obligation:
       innermost runtime complexity
     Answer:
       YES(O(1),O(n^1))
     
     We use the processor 'matrix interpretation of dimension 1' to
     orient following rules strictly.
     
     DPs:
       { 2: insertionsort#1^#(::(@x, @xs)) ->
            c_2(insert^#(@x, insertionsort(@xs)), insertionsort^#(@xs))
       , 3: flattensort^#(@t) -> c_6(insertionsort^#(flatten(@t))) }
     Trs:
       { flatten#1(node(@l, @t1, @t2)) ->
         append(@l, append(flatten(@t1), flatten(@t2)))
       , insertionsort(@l) -> insertionsort#1(@l) }
     
     Sub-proof:
     ----------
       The following argument positions are usable:
         Uargs(c_1) = {1}, Uargs(c_2) = {1, 2}, Uargs(c_6) = {1}
       
       TcT has computed the following constructor-based matrix
       interpretation satisfying not(EDA).
       
              [insertionsort#1](x1) = [0]                           
                                                                    
                            [#true] = [0]                           
                                                                    
                             [leaf] = [0]                           
                                                                    
                   [append](x1, x2) = [1] x1 + [1] x2 + [0]         
                                                                    
                        [#cklt](x1) = [0]                           
                                                                    
                   [insert](x1, x2) = [0]                           
                                                                    
                         [#pos](x1) = [1] x1 + [0]                  
                                                                    
                 [node](x1, x2, x3) = [1] x1 + [1] x2 + [1] x3 + [4]
                                                                    
                              [#EQ] = [0]                           
                                                                    
         [insert#2](x1, x2, x3, x4) = [1] x3 + [0]                  
                                                                    
                 [#compare](x1, x2) = [0]                           
                                                                    
                              [nil] = [0]                           
                                                                    
                 [append#1](x1, x2) = [1] x1 + [1] x2 + [0]         
                                                                    
                           [#false] = [0]                           
                                                                    
                    [flatten#1](x1) = [1] x1 + [0]                  
                                                                    
                       [::](x1, x2) = [1] x2 + [1]                  
                                                                    
                              [#LT] = [0]                           
                                                                    
                 [insert#1](x1, x2) = [6] x2 + [0]                  
                                                                    
                               [#0] = [0]                           
                                                                    
                         [#neg](x1) = [1] x1 + [0]                  
                                                                    
                    [#less](x1, x2) = [0]                           
                                                                    
                      [flatten](x1) = [1] x1 + [0]                  
                                                                    
                           [#s](x1) = [1] x1 + [0]                  
                                                                    
                              [#GT] = [0]                           
                                                                    
                [insertionsort](x1) = [1]                           
                                                                    
                [flattensort^#](x1) = [7] x1 + [7]                  
                                                                    
              [insertionsort^#](x1) = [5] x1 + [0]                  
                                                                    
            [insertionsort#1^#](x1) = [5] x1 + [0]                  
                                                                    
                 [insert^#](x1, x2) = [0]                           
                                                                    
                          [c_1](x1) = [1] x1 + [0]                  
                                                                    
                      [c_2](x1, x2) = [5] x1 + [1] x2 + [0]         
                                                                    
                          [c_6](x1) = [1] x1 + [4]                  
       
       The order satisfies the following ordering constraints:
       
                  [insertionsort#1(nil())] =  [0]                                                          
                                           >= [0]                                                          
                                           =  [nil()]                                                      
                                                                                                           
            [insertionsort#1(::(@x, @xs))] =  [0]                                                          
                                           >= [0]                                                          
                                           =  [insert(@x, insertionsort(@xs))]                             
                                                                                                           
                        [append(@l1, @l2)] =  [1] @l1 + [1] @l2 + [0]                                      
                                           >= [1] @l1 + [1] @l2 + [0]                                      
                                           =  [append#1(@l1, @l2)]                                         
                                                                                                           
                            [#cklt(#EQ())] =  [0]                                                          
                                           >= [0]                                                          
                                           =  [#false()]                                                   
                                                                                                           
                            [#cklt(#LT())] =  [0]                                                          
                                           >= [0]                                                          
                                           =  [#true()]                                                    
                                                                                                           
                            [#cklt(#GT())] =  [0]                                                          
                                           >= [0]                                                          
                                           =  [#false()]                                                   
                                                                                                           
                          [insert(@x, @l)] =  [0]                                                          
                                           ?  [6] @x + [0]                                                 
                                           =  [insert#1(@l, @x)]                                           
                                                                                                           
          [insert#2(#true(), @x, @y, @ys)] =  [1] @y + [0]                                                 
                                           ?  [1]                                                          
                                           =  [::(@y, insert(@x, @ys))]                                    
                                                                                                           
         [insert#2(#false(), @x, @y, @ys)] =  [1] @y + [0]                                                 
                                           ?  [1] @ys + [2]                                                
                                           =  [::(@x, ::(@y, @ys))]                                        
                                                                                                           
            [#compare(#pos(@x), #pos(@y))] =  [0]                                                          
                                           >= [0]                                                          
                                           =  [#compare(@x, @y)]                                           
                                                                                                           
                [#compare(#pos(@x), #0())] =  [0]                                                          
                                           >= [0]                                                          
                                           =  [#GT()]                                                      
                                                                                                           
            [#compare(#pos(@x), #neg(@y))] =  [0]                                                          
                                           >= [0]                                                          
                                           =  [#GT()]                                                      
                                                                                                           
                [#compare(#0(), #pos(@y))] =  [0]                                                          
                                           >= [0]                                                          
                                           =  [#LT()]                                                      
                                                                                                           
                    [#compare(#0(), #0())] =  [0]                                                          
                                           >= [0]                                                          
                                           =  [#EQ()]                                                      
                                                                                                           
                [#compare(#0(), #neg(@y))] =  [0]                                                          
                                           >= [0]                                                          
                                           =  [#GT()]                                                      
                                                                                                           
                  [#compare(#0(), #s(@y))] =  [0]                                                          
                                           >= [0]                                                          
                                           =  [#LT()]                                                      
                                                                                                           
            [#compare(#neg(@x), #pos(@y))] =  [0]                                                          
                                           >= [0]                                                          
                                           =  [#LT()]                                                      
                                                                                                           
                [#compare(#neg(@x), #0())] =  [0]                                                          
                                           >= [0]                                                          
                                           =  [#LT()]                                                      
                                                                                                           
            [#compare(#neg(@x), #neg(@y))] =  [0]                                                          
                                           >= [0]                                                          
                                           =  [#compare(@y, @x)]                                           
                                                                                                           
                  [#compare(#s(@x), #0())] =  [0]                                                          
                                           >= [0]                                                          
                                           =  [#GT()]                                                      
                                                                                                           
                [#compare(#s(@x), #s(@y))] =  [0]                                                          
                                           >= [0]                                                          
                                           =  [#compare(@x, @y)]                                           
                                                                                                           
                    [append#1(nil(), @l2)] =  [1] @l2 + [0]                                                
                                           >= [1] @l2 + [0]                                                
                                           =  [@l2]                                                        
                                                                                                           
              [append#1(::(@x, @xs), @l2)] =  [1] @l2 + [1] @xs + [1]                                      
                                           >= [1] @l2 + [1] @xs + [1]                                      
                                           =  [::(@x, append(@xs, @l2))]                                   
                                                                                                           
                       [flatten#1(leaf())] =  [0]                                                          
                                           >= [0]                                                          
                                           =  [nil()]                                                      
                                                                                                           
           [flatten#1(node(@l, @t1, @t2))] =  [1] @l + [1] @t1 + [1] @t2 + [4]                             
                                           >  [1] @l + [1] @t1 + [1] @t2 + [0]                             
                                           =  [append(@l, append(flatten(@t1), flatten(@t2)))]             
                                                                                                           
                     [insert#1(nil(), @x)] =  [6] @x + [0]                                                 
                                           ?  [1]                                                          
                                           =  [::(@x, nil())]                                              
                                                                                                           
               [insert#1(::(@y, @ys), @x)] =  [6] @x + [0]                                                 
                                           ?  [1] @y + [0]                                                 
                                           =  [insert#2(#less(@y, @x), @x, @y, @ys)]                       
                                                                                                           
                           [#less(@x, @y)] =  [0]                                                          
                                           >= [0]                                                          
                                           =  [#cklt(#compare(@x, @y))]                                    
                                                                                                           
                             [flatten(@t)] =  [1] @t + [0]                                                 
                                           >= [1] @t + [0]                                                 
                                           =  [flatten#1(@t)]                                              
                                                                                                           
                       [insertionsort(@l)] =  [1]                                                          
                                           >  [0]                                                          
                                           =  [insertionsort#1(@l)]                                        
                                                                                                           
                       [flattensort^#(@t)] =  [7] @t + [7]                                                 
                                           >  [5] @t + [4]                                                 
                                           =  [c_6(insertionsort^#(flatten(@t)))]                          
                                                                                                           
                     [insertionsort^#(@l)] =  [5] @l + [0]                                                 
                                           >= [5] @l + [0]                                                 
                                           =  [c_1(insertionsort#1^#(@l))]                                 
                                                                                                           
          [insertionsort#1^#(::(@x, @xs))] =  [5] @xs + [5]                                                
                                           >  [5] @xs + [0]                                                
                                           =  [c_2(insert^#(@x, insertionsort(@xs)), insertionsort^#(@xs))]
                                                                                                           
     
     We return to the main proof. Consider the set of all dependency
     pairs
     
     :
       { 1: insertionsort^#(@l) -> c_1(insertionsort#1^#(@l))
       , 2: insertionsort#1^#(::(@x, @xs)) ->
            c_2(insert^#(@x, insertionsort(@xs)), insertionsort^#(@xs))
       , 3: flattensort^#(@t) -> c_6(insertionsort^#(flatten(@t))) }
     
     Processor 'matrix interpretation of dimension 1' induces the
     complexity certificate YES(?,O(n^1)) on application of dependency
     pairs {2,3}. These cover all (indirect) predecessors of dependency
     pairs {1,2,3}, their number of application is equally bounded. The
     dependency pairs are shifted into the weak component.
     
     We are left with following problem, upon which TcT provides the
     certificate YES(O(1),O(1)).
     
     Weak DPs:
       { flattensort^#(@t) -> c_6(insertionsort^#(flatten(@t)))
       , insertionsort^#(@l) -> c_1(insertionsort#1^#(@l))
       , insertionsort#1^#(::(@x, @xs)) ->
         c_2(insert^#(@x, insertionsort(@xs)), insertionsort^#(@xs)) }
     Weak Trs:
       { insertionsort#1(nil()) -> nil()
       , insertionsort#1(::(@x, @xs)) -> insert(@x, insertionsort(@xs))
       , append(@l1, @l2) -> append#1(@l1, @l2)
       , #cklt(#EQ()) -> #false()
       , #cklt(#LT()) -> #true()
       , #cklt(#GT()) -> #false()
       , insert(@x, @l) -> insert#1(@l, @x)
       , insert#2(#true(), @x, @y, @ys) -> ::(@y, insert(@x, @ys))
       , insert#2(#false(), @x, @y, @ys) -> ::(@x, ::(@y, @ys))
       , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
       , #compare(#pos(@x), #0()) -> #GT()
       , #compare(#pos(@x), #neg(@y)) -> #GT()
       , #compare(#0(), #pos(@y)) -> #LT()
       , #compare(#0(), #0()) -> #EQ()
       , #compare(#0(), #neg(@y)) -> #GT()
       , #compare(#0(), #s(@y)) -> #LT()
       , #compare(#neg(@x), #pos(@y)) -> #LT()
       , #compare(#neg(@x), #0()) -> #LT()
       , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
       , #compare(#s(@x), #0()) -> #GT()
       , #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
       , append#1(nil(), @l2) -> @l2
       , append#1(::(@x, @xs), @l2) -> ::(@x, append(@xs, @l2))
       , flatten#1(leaf()) -> nil()
       , flatten#1(node(@l, @t1, @t2)) ->
         append(@l, append(flatten(@t1), flatten(@t2)))
       , insert#1(nil(), @x) -> ::(@x, nil())
       , insert#1(::(@y, @ys), @x) -> insert#2(#less(@y, @x), @x, @y, @ys)
       , #less(@x, @y) -> #cklt(#compare(@x, @y))
       , flatten(@t) -> flatten#1(@t)
       , insertionsort(@l) -> insertionsort#1(@l) }
     Obligation:
       innermost runtime complexity
     Answer:
       YES(O(1),O(1))
     
     The following weak DPs constitute a sub-graph of the DG that is
     closed under successors. The DPs are removed.
     
     { flattensort^#(@t) -> c_6(insertionsort^#(flatten(@t)))
     , insertionsort^#(@l) -> c_1(insertionsort#1^#(@l))
     , insertionsort#1^#(::(@x, @xs)) ->
       c_2(insert^#(@x, insertionsort(@xs)), insertionsort^#(@xs)) }
     
     We are left with following problem, upon which TcT provides the
     certificate YES(O(1),O(1)).
     
     Weak Trs:
       { insertionsort#1(nil()) -> nil()
       , insertionsort#1(::(@x, @xs)) -> insert(@x, insertionsort(@xs))
       , append(@l1, @l2) -> append#1(@l1, @l2)
       , #cklt(#EQ()) -> #false()
       , #cklt(#LT()) -> #true()
       , #cklt(#GT()) -> #false()
       , insert(@x, @l) -> insert#1(@l, @x)
       , insert#2(#true(), @x, @y, @ys) -> ::(@y, insert(@x, @ys))
       , insert#2(#false(), @x, @y, @ys) -> ::(@x, ::(@y, @ys))
       , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
       , #compare(#pos(@x), #0()) -> #GT()
       , #compare(#pos(@x), #neg(@y)) -> #GT()
       , #compare(#0(), #pos(@y)) -> #LT()
       , #compare(#0(), #0()) -> #EQ()
       , #compare(#0(), #neg(@y)) -> #GT()
       , #compare(#0(), #s(@y)) -> #LT()
       , #compare(#neg(@x), #pos(@y)) -> #LT()
       , #compare(#neg(@x), #0()) -> #LT()
       , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
       , #compare(#s(@x), #0()) -> #GT()
       , #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
       , append#1(nil(), @l2) -> @l2
       , append#1(::(@x, @xs), @l2) -> ::(@x, append(@xs, @l2))
       , flatten#1(leaf()) -> nil()
       , flatten#1(node(@l, @t1, @t2)) ->
         append(@l, append(flatten(@t1), flatten(@t2)))
       , insert#1(nil(), @x) -> ::(@x, nil())
       , insert#1(::(@y, @ys), @x) -> insert#2(#less(@y, @x), @x, @y, @ys)
       , #less(@x, @y) -> #cklt(#compare(@x, @y))
       , flatten(@t) -> flatten#1(@t)
       , insertionsort(@l) -> insertionsort#1(@l) }
     Obligation:
       innermost runtime complexity
     Answer:
       YES(O(1),O(1))
     
     No rule is usable, rules are removed from the input problem.
     
     We are left with following problem, upon which TcT provides the
     certificate YES(O(1),O(1)).
     
     Rules: Empty
     Obligation:
       innermost runtime complexity
     Answer:
       YES(O(1),O(1))
     
     Empty rules are trivially bounded
   
   We return to the main proof.
   
   We are left with following problem, upon which TcT provides the
   certificate YES(O(1),O(n^1)).
   
   Strict DPs:
     { insert^#(@x, @l) -> c_3(insert#1^#(@l, @x))
     , insert#1^#(::(@y, @ys), @x) ->
       c_4(insert#2^#(#less(@y, @x), @x, @y, @ys))
     , insert#2^#(#true(), @x, @y, @ys) -> c_5(insert^#(@x, @ys)) }
   Weak DPs:
     { flattensort^#(@t) -> insertionsort^#(flatten(@t))
     , insertionsort^#(@l) -> insertionsort#1^#(@l)
     , insertionsort#1^#(::(@x, @xs)) -> insertionsort^#(@xs)
     , insertionsort#1^#(::(@x, @xs)) ->
       insert^#(@x, insertionsort(@xs)) }
   Weak Trs:
     { insertionsort#1(nil()) -> nil()
     , insertionsort#1(::(@x, @xs)) -> insert(@x, insertionsort(@xs))
     , append(@l1, @l2) -> append#1(@l1, @l2)
     , #cklt(#EQ()) -> #false()
     , #cklt(#LT()) -> #true()
     , #cklt(#GT()) -> #false()
     , insert(@x, @l) -> insert#1(@l, @x)
     , insert#2(#true(), @x, @y, @ys) -> ::(@y, insert(@x, @ys))
     , insert#2(#false(), @x, @y, @ys) -> ::(@x, ::(@y, @ys))
     , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
     , #compare(#pos(@x), #0()) -> #GT()
     , #compare(#pos(@x), #neg(@y)) -> #GT()
     , #compare(#0(), #pos(@y)) -> #LT()
     , #compare(#0(), #0()) -> #EQ()
     , #compare(#0(), #neg(@y)) -> #GT()
     , #compare(#0(), #s(@y)) -> #LT()
     , #compare(#neg(@x), #pos(@y)) -> #LT()
     , #compare(#neg(@x), #0()) -> #LT()
     , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
     , #compare(#s(@x), #0()) -> #GT()
     , #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
     , append#1(nil(), @l2) -> @l2
     , append#1(::(@x, @xs), @l2) -> ::(@x, append(@xs, @l2))
     , flatten#1(leaf()) -> nil()
     , flatten#1(node(@l, @t1, @t2)) ->
       append(@l, append(flatten(@t1), flatten(@t2)))
     , insert#1(nil(), @x) -> ::(@x, nil())
     , insert#1(::(@y, @ys), @x) -> insert#2(#less(@y, @x), @x, @y, @ys)
     , #less(@x, @y) -> #cklt(#compare(@x, @y))
     , flatten(@t) -> flatten#1(@t)
     , insertionsort(@l) -> insertionsort#1(@l) }
   Obligation:
     innermost runtime complexity
   Answer:
     YES(O(1),O(n^1))
   
   We use the processor 'matrix interpretation of dimension 1' to
   orient following rules strictly.
   
   DPs:
     { 1: insert^#(@x, @l) -> c_3(insert#1^#(@l, @x))
     , 4: flattensort^#(@t) -> insertionsort^#(flatten(@t))
     , 6: insertionsort#1^#(::(@x, @xs)) -> insertionsort^#(@xs)
     , 7: insertionsort#1^#(::(@x, @xs)) ->
          insert^#(@x, insertionsort(@xs)) }
   Trs:
     { #cklt(#EQ()) -> #false()
     , #cklt(#GT()) -> #false()
     , #compare(#pos(@x), #0()) -> #GT()
     , #compare(#pos(@x), #neg(@y)) -> #GT()
     , #compare(#0(), #pos(@y)) -> #LT()
     , #compare(#0(), #0()) -> #EQ()
     , #compare(#0(), #neg(@y)) -> #GT()
     , #compare(#0(), #s(@y)) -> #LT()
     , #compare(#neg(@x), #pos(@y)) -> #LT()
     , #compare(#neg(@x), #0()) -> #LT()
     , #compare(#s(@x), #0()) -> #GT()
     , append#1(nil(), @l2) -> @l2 }
   
   Sub-proof:
   ----------
     The following argument positions are usable:
       Uargs(c_3) = {1}, Uargs(c_4) = {1}, Uargs(c_5) = {1}
     
     TcT has computed the following constructor-based matrix
     interpretation satisfying not(EDA).
     
              [insertionsort#1](x1) = [1] x1 + [0]                  
                                                                    
                            [#true] = [1]                           
                                                                    
                             [leaf] = [5]                           
                                                                    
                   [append](x1, x2) = [1] x1 + [1] x2 + [0]         
                                                                    
                        [#cklt](x1) = [2] x1 + [1]                  
                                                                    
                   [insert](x1, x2) = [1] x1 + [1] x2 + [1]         
                                                                    
                         [#pos](x1) = [1] x1 + [0]                  
                                                                    
                 [node](x1, x2, x3) = [1] x1 + [1] x2 + [1] x3 + [0]
                                                                    
                              [#EQ] = [0]                           
                                                                    
         [insert#2](x1, x2, x3, x4) = [1] x2 + [1] x3 + [1] x4 + [2]
                                                                    
                 [#compare](x1, x2) = [1]                           
                                                                    
                              [nil] = [5]                           
                                                                    
                 [append#1](x1, x2) = [1] x1 + [1] x2 + [0]         
                                                                    
                           [#false] = [0]                           
                                                                    
                    [flatten#1](x1) = [1] x1 + [0]                  
                                                                    
                       [::](x1, x2) = [1] x1 + [1] x2 + [1]         
                                                                    
                              [#LT] = [0]                           
                                                                    
                 [insert#1](x1, x2) = [1] x1 + [1] x2 + [1]         
                                                                    
                               [#0] = [0]                           
                                                                    
                         [#neg](x1) = [1] x1 + [0]                  
                                                                    
                    [#less](x1, x2) = [3]                           
                                                                    
                      [flatten](x1) = [1] x1 + [0]                  
                                                                    
                           [#s](x1) = [1] x1 + [0]                  
                                                                    
                              [#GT] = [0]                           
                                                                    
                [insertionsort](x1) = [1] x1 + [0]                  
                                                                    
                [flattensort^#](x1) = [7] x1 + [7]                  
                                                                    
              [insertionsort^#](x1) = [7] x1 + [6]                  
                                                                    
            [insertionsort#1^#](x1) = [7] x1 + [6]                  
                                                                    
                 [insert^#](x1, x2) = [4] x1 + [7] x2 + [3]         
                                                                    
               [insert#1^#](x1, x2) = [7] x1 + [4] x2 + [2]         
                                                                    
       [insert#2^#](x1, x2, x3, x4) = [3] x1 + [4] x2 + [7] x4 + [0]
                                                                    
                          [c_3](x1) = [1] x1 + [0]                  
                                                                    
                          [c_4](x1) = [1] x1 + [0]                  
                                                                    
                          [c_5](x1) = [1] x1 + [0]                  
     
     The order satisfies the following ordering constraints:
     
                 [insertionsort#1(nil())] =  [5]                                             
                                          >= [5]                                             
                                          =  [nil()]                                         
                                                                                             
           [insertionsort#1(::(@x, @xs))] =  [1] @x + [1] @xs + [1]                          
                                          >= [1] @x + [1] @xs + [1]                          
                                          =  [insert(@x, insertionsort(@xs))]                
                                                                                             
                       [append(@l1, @l2)] =  [1] @l1 + [1] @l2 + [0]                         
                                          >= [1] @l1 + [1] @l2 + [0]                         
                                          =  [append#1(@l1, @l2)]                            
                                                                                             
                           [#cklt(#EQ())] =  [1]                                             
                                          >  [0]                                             
                                          =  [#false()]                                      
                                                                                             
                           [#cklt(#LT())] =  [1]                                             
                                          >= [1]                                             
                                          =  [#true()]                                       
                                                                                             
                           [#cklt(#GT())] =  [1]                                             
                                          >  [0]                                             
                                          =  [#false()]                                      
                                                                                             
                         [insert(@x, @l)] =  [1] @x + [1] @l + [1]                           
                                          >= [1] @x + [1] @l + [1]                           
                                          =  [insert#1(@l, @x)]                              
                                                                                             
         [insert#2(#true(), @x, @y, @ys)] =  [1] @x + [1] @y + [1] @ys + [2]                 
                                          >= [1] @x + [1] @y + [1] @ys + [2]                 
                                          =  [::(@y, insert(@x, @ys))]                       
                                                                                             
        [insert#2(#false(), @x, @y, @ys)] =  [1] @x + [1] @y + [1] @ys + [2]                 
                                          >= [1] @x + [1] @y + [1] @ys + [2]                 
                                          =  [::(@x, ::(@y, @ys))]                           
                                                                                             
           [#compare(#pos(@x), #pos(@y))] =  [1]                                             
                                          >= [1]                                             
                                          =  [#compare(@x, @y)]                              
                                                                                             
               [#compare(#pos(@x), #0())] =  [1]                                             
                                          >  [0]                                             
                                          =  [#GT()]                                         
                                                                                             
           [#compare(#pos(@x), #neg(@y))] =  [1]                                             
                                          >  [0]                                             
                                          =  [#GT()]                                         
                                                                                             
               [#compare(#0(), #pos(@y))] =  [1]                                             
                                          >  [0]                                             
                                          =  [#LT()]                                         
                                                                                             
                   [#compare(#0(), #0())] =  [1]                                             
                                          >  [0]                                             
                                          =  [#EQ()]                                         
                                                                                             
               [#compare(#0(), #neg(@y))] =  [1]                                             
                                          >  [0]                                             
                                          =  [#GT()]                                         
                                                                                             
                 [#compare(#0(), #s(@y))] =  [1]                                             
                                          >  [0]                                             
                                          =  [#LT()]                                         
                                                                                             
           [#compare(#neg(@x), #pos(@y))] =  [1]                                             
                                          >  [0]                                             
                                          =  [#LT()]                                         
                                                                                             
               [#compare(#neg(@x), #0())] =  [1]                                             
                                          >  [0]                                             
                                          =  [#LT()]                                         
                                                                                             
           [#compare(#neg(@x), #neg(@y))] =  [1]                                             
                                          >= [1]                                             
                                          =  [#compare(@y, @x)]                              
                                                                                             
                 [#compare(#s(@x), #0())] =  [1]                                             
                                          >  [0]                                             
                                          =  [#GT()]                                         
                                                                                             
               [#compare(#s(@x), #s(@y))] =  [1]                                             
                                          >= [1]                                             
                                          =  [#compare(@x, @y)]                              
                                                                                             
                   [append#1(nil(), @l2)] =  [1] @l2 + [5]                                   
                                          >  [1] @l2 + [0]                                   
                                          =  [@l2]                                           
                                                                                             
             [append#1(::(@x, @xs), @l2)] =  [1] @x + [1] @l2 + [1] @xs + [1]                
                                          >= [1] @x + [1] @l2 + [1] @xs + [1]                
                                          =  [::(@x, append(@xs, @l2))]                      
                                                                                             
                      [flatten#1(leaf())] =  [5]                                             
                                          >= [5]                                             
                                          =  [nil()]                                         
                                                                                             
          [flatten#1(node(@l, @t1, @t2))] =  [1] @l + [1] @t1 + [1] @t2 + [0]                
                                          >= [1] @l + [1] @t1 + [1] @t2 + [0]                
                                          =  [append(@l, append(flatten(@t1), flatten(@t2)))]
                                                                                             
                    [insert#1(nil(), @x)] =  [1] @x + [6]                                    
                                          >= [1] @x + [6]                                    
                                          =  [::(@x, nil())]                                 
                                                                                             
              [insert#1(::(@y, @ys), @x)] =  [1] @x + [1] @y + [1] @ys + [2]                 
                                          >= [1] @x + [1] @y + [1] @ys + [2]                 
                                          =  [insert#2(#less(@y, @x), @x, @y, @ys)]          
                                                                                             
                          [#less(@x, @y)] =  [3]                                             
                                          >= [3]                                             
                                          =  [#cklt(#compare(@x, @y))]                       
                                                                                             
                            [flatten(@t)] =  [1] @t + [0]                                    
                                          >= [1] @t + [0]                                    
                                          =  [flatten#1(@t)]                                 
                                                                                             
                      [insertionsort(@l)] =  [1] @l + [0]                                    
                                          >= [1] @l + [0]                                    
                                          =  [insertionsort#1(@l)]                           
                                                                                             
                      [flattensort^#(@t)] =  [7] @t + [7]                                    
                                          >  [7] @t + [6]                                    
                                          =  [insertionsort^#(flatten(@t))]                  
                                                                                             
                    [insertionsort^#(@l)] =  [7] @l + [6]                                    
                                          >= [7] @l + [6]                                    
                                          =  [insertionsort#1^#(@l)]                         
                                                                                             
         [insertionsort#1^#(::(@x, @xs))] =  [7] @x + [7] @xs + [13]                         
                                          >  [7] @xs + [6]                                   
                                          =  [insertionsort^#(@xs)]                          
                                                                                             
         [insertionsort#1^#(::(@x, @xs))] =  [7] @x + [7] @xs + [13]                         
                                          >  [4] @x + [7] @xs + [3]                          
                                          =  [insert^#(@x, insertionsort(@xs))]              
                                                                                             
                       [insert^#(@x, @l)] =  [4] @x + [7] @l + [3]                           
                                          >  [4] @x + [7] @l + [2]                           
                                          =  [c_3(insert#1^#(@l, @x))]                       
                                                                                             
            [insert#1^#(::(@y, @ys), @x)] =  [4] @x + [7] @y + [7] @ys + [9]                 
                                          >= [4] @x + [7] @ys + [9]                          
                                          =  [c_4(insert#2^#(#less(@y, @x), @x, @y, @ys))]   
                                                                                             
       [insert#2^#(#true(), @x, @y, @ys)] =  [4] @x + [7] @ys + [3]                          
                                          >= [4] @x + [7] @ys + [3]                          
                                          =  [c_5(insert^#(@x, @ys))]                        
                                                                                             
   
   We return to the main proof. Consider the set of all dependency
   pairs
   
   :
     { 1: insert^#(@x, @l) -> c_3(insert#1^#(@l, @x))
     , 2: insert#1^#(::(@y, @ys), @x) ->
          c_4(insert#2^#(#less(@y, @x), @x, @y, @ys))
     , 3: insert#2^#(#true(), @x, @y, @ys) -> c_5(insert^#(@x, @ys))
     , 4: flattensort^#(@t) -> insertionsort^#(flatten(@t))
     , 5: insertionsort^#(@l) -> insertionsort#1^#(@l)
     , 6: insertionsort#1^#(::(@x, @xs)) -> insertionsort^#(@xs)
     , 7: insertionsort#1^#(::(@x, @xs)) ->
          insert^#(@x, insertionsort(@xs)) }
   
   Processor 'matrix interpretation of dimension 1' induces the
   complexity certificate YES(?,O(n^1)) on application of dependency
   pairs {1,4,6,7}. These cover all (indirect) predecessors of
   dependency pairs {1,2,3,4,5,6,7}, their number of application is
   equally bounded. The dependency pairs are shifted into the weak
   component.
   
   We are left with following problem, upon which TcT provides the
   certificate YES(O(1),O(1)).
   
   Weak DPs:
     { flattensort^#(@t) -> insertionsort^#(flatten(@t))
     , insertionsort^#(@l) -> insertionsort#1^#(@l)
     , insertionsort#1^#(::(@x, @xs)) -> insertionsort^#(@xs)
     , insertionsort#1^#(::(@x, @xs)) ->
       insert^#(@x, insertionsort(@xs))
     , insert^#(@x, @l) -> c_3(insert#1^#(@l, @x))
     , insert#1^#(::(@y, @ys), @x) ->
       c_4(insert#2^#(#less(@y, @x), @x, @y, @ys))
     , insert#2^#(#true(), @x, @y, @ys) -> c_5(insert^#(@x, @ys)) }
   Weak Trs:
     { insertionsort#1(nil()) -> nil()
     , insertionsort#1(::(@x, @xs)) -> insert(@x, insertionsort(@xs))
     , append(@l1, @l2) -> append#1(@l1, @l2)
     , #cklt(#EQ()) -> #false()
     , #cklt(#LT()) -> #true()
     , #cklt(#GT()) -> #false()
     , insert(@x, @l) -> insert#1(@l, @x)
     , insert#2(#true(), @x, @y, @ys) -> ::(@y, insert(@x, @ys))
     , insert#2(#false(), @x, @y, @ys) -> ::(@x, ::(@y, @ys))
     , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
     , #compare(#pos(@x), #0()) -> #GT()
     , #compare(#pos(@x), #neg(@y)) -> #GT()
     , #compare(#0(), #pos(@y)) -> #LT()
     , #compare(#0(), #0()) -> #EQ()
     , #compare(#0(), #neg(@y)) -> #GT()
     , #compare(#0(), #s(@y)) -> #LT()
     , #compare(#neg(@x), #pos(@y)) -> #LT()
     , #compare(#neg(@x), #0()) -> #LT()
     , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
     , #compare(#s(@x), #0()) -> #GT()
     , #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
     , append#1(nil(), @l2) -> @l2
     , append#1(::(@x, @xs), @l2) -> ::(@x, append(@xs, @l2))
     , flatten#1(leaf()) -> nil()
     , flatten#1(node(@l, @t1, @t2)) ->
       append(@l, append(flatten(@t1), flatten(@t2)))
     , insert#1(nil(), @x) -> ::(@x, nil())
     , insert#1(::(@y, @ys), @x) -> insert#2(#less(@y, @x), @x, @y, @ys)
     , #less(@x, @y) -> #cklt(#compare(@x, @y))
     , flatten(@t) -> flatten#1(@t)
     , insertionsort(@l) -> insertionsort#1(@l) }
   Obligation:
     innermost runtime complexity
   Answer:
     YES(O(1),O(1))
   
   The following weak DPs constitute a sub-graph of the DG that is
   closed under successors. The DPs are removed.
   
   { flattensort^#(@t) -> insertionsort^#(flatten(@t))
   , insertionsort^#(@l) -> insertionsort#1^#(@l)
   , insertionsort#1^#(::(@x, @xs)) -> insertionsort^#(@xs)
   , insertionsort#1^#(::(@x, @xs)) ->
     insert^#(@x, insertionsort(@xs))
   , insert^#(@x, @l) -> c_3(insert#1^#(@l, @x))
   , insert#1^#(::(@y, @ys), @x) ->
     c_4(insert#2^#(#less(@y, @x), @x, @y, @ys))
   , insert#2^#(#true(), @x, @y, @ys) -> c_5(insert^#(@x, @ys)) }
   
   We are left with following problem, upon which TcT provides the
   certificate YES(O(1),O(1)).
   
   Weak Trs:
     { insertionsort#1(nil()) -> nil()
     , insertionsort#1(::(@x, @xs)) -> insert(@x, insertionsort(@xs))
     , append(@l1, @l2) -> append#1(@l1, @l2)
     , #cklt(#EQ()) -> #false()
     , #cklt(#LT()) -> #true()
     , #cklt(#GT()) -> #false()
     , insert(@x, @l) -> insert#1(@l, @x)
     , insert#2(#true(), @x, @y, @ys) -> ::(@y, insert(@x, @ys))
     , insert#2(#false(), @x, @y, @ys) -> ::(@x, ::(@y, @ys))
     , #compare(#pos(@x), #pos(@y)) -> #compare(@x, @y)
     , #compare(#pos(@x), #0()) -> #GT()
     , #compare(#pos(@x), #neg(@y)) -> #GT()
     , #compare(#0(), #pos(@y)) -> #LT()
     , #compare(#0(), #0()) -> #EQ()
     , #compare(#0(), #neg(@y)) -> #GT()
     , #compare(#0(), #s(@y)) -> #LT()
     , #compare(#neg(@x), #pos(@y)) -> #LT()
     , #compare(#neg(@x), #0()) -> #LT()
     , #compare(#neg(@x), #neg(@y)) -> #compare(@y, @x)
     , #compare(#s(@x), #0()) -> #GT()
     , #compare(#s(@x), #s(@y)) -> #compare(@x, @y)
     , append#1(nil(), @l2) -> @l2
     , append#1(::(@x, @xs), @l2) -> ::(@x, append(@xs, @l2))
     , flatten#1(leaf()) -> nil()
     , flatten#1(node(@l, @t1, @t2)) ->
       append(@l, append(flatten(@t1), flatten(@t2)))
     , insert#1(nil(), @x) -> ::(@x, nil())
     , insert#1(::(@y, @ys), @x) -> insert#2(#less(@y, @x), @x, @y, @ys)
     , #less(@x, @y) -> #cklt(#compare(@x, @y))
     , flatten(@t) -> flatten#1(@t)
     , insertionsort(@l) -> insertionsort#1(@l) }
   Obligation:
     innermost runtime complexity
   Answer:
     YES(O(1),O(1))
   
   No rule is usable, rules are removed from the input problem.
   
   We are left with following problem, upon which TcT provides the
   certificate YES(O(1),O(1)).
   
   Rules: Empty
   Obligation:
     innermost runtime complexity
   Answer:
     YES(O(1),O(1))
   
   Empty rules are trivially bounded


Hurray, we answered YES(O(1),O(n^2))