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

Strict Trs:
  { eq(0(), 0()) -> true()
  , eq(0(), s(m)) -> false()
  , eq(s(n), 0()) -> false()
  , eq(s(n), s(m)) -> eq(n, m)
  , le(0(), m) -> true()
  , le(s(n), 0()) -> false()
  , le(s(n), s(m)) -> le(n, m)
  , min(cons(n, cons(m, x))) -> if_min(le(n, m), cons(n, cons(m, x)))
  , min(cons(0(), nil())) -> 0()
  , min(cons(s(n), nil())) -> s(n)
  , if_min(true(), cons(n, cons(m, x))) -> min(cons(n, x))
  , if_min(false(), cons(n, cons(m, x))) -> min(cons(m, x))
  , replace(n, m, cons(k, x)) ->
    if_replace(eq(n, k), n, m, cons(k, x))
  , replace(n, m, nil()) -> nil()
  , if_replace(true(), n, m, cons(k, x)) -> cons(m, x)
  , if_replace(false(), n, m, cons(k, x)) ->
    cons(k, replace(n, m, x))
  , sort(cons(n, x)) ->
    cons(min(cons(n, x)), sort(replace(min(cons(n, x)), n, x)))
  , sort(nil()) -> nil() }
Obligation:
  innermost runtime complexity
Answer:
  YES(O(1),O(n^3))

We add the following dependency tuples:

Strict DPs:
  { eq^#(0(), 0()) -> c_1()
  , eq^#(0(), s(m)) -> c_2()
  , eq^#(s(n), 0()) -> c_3()
  , eq^#(s(n), s(m)) -> c_4(eq^#(n, m))
  , le^#(0(), m) -> c_5()
  , le^#(s(n), 0()) -> c_6()
  , le^#(s(n), s(m)) -> c_7(le^#(n, m))
  , min^#(cons(n, cons(m, x))) ->
    c_8(if_min^#(le(n, m), cons(n, cons(m, x))), le^#(n, m))
  , min^#(cons(0(), nil())) -> c_9()
  , min^#(cons(s(n), nil())) -> c_10()
  , if_min^#(true(), cons(n, cons(m, x))) -> c_11(min^#(cons(n, x)))
  , if_min^#(false(), cons(n, cons(m, x))) -> c_12(min^#(cons(m, x)))
  , replace^#(n, m, cons(k, x)) ->
    c_13(if_replace^#(eq(n, k), n, m, cons(k, x)), eq^#(n, k))
  , replace^#(n, m, nil()) -> c_14()
  , if_replace^#(true(), n, m, cons(k, x)) -> c_15()
  , if_replace^#(false(), n, m, cons(k, x)) ->
    c_16(replace^#(n, m, x))
  , sort^#(cons(n, x)) ->
    c_17(min^#(cons(n, x)),
         sort^#(replace(min(cons(n, x)), n, x)),
         replace^#(min(cons(n, x)), n, x),
         min^#(cons(n, x)))
  , sort^#(nil()) -> c_18() }

and mark the set of starting terms.

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

Strict DPs:
  { eq^#(0(), 0()) -> c_1()
  , eq^#(0(), s(m)) -> c_2()
  , eq^#(s(n), 0()) -> c_3()
  , eq^#(s(n), s(m)) -> c_4(eq^#(n, m))
  , le^#(0(), m) -> c_5()
  , le^#(s(n), 0()) -> c_6()
  , le^#(s(n), s(m)) -> c_7(le^#(n, m))
  , min^#(cons(n, cons(m, x))) ->
    c_8(if_min^#(le(n, m), cons(n, cons(m, x))), le^#(n, m))
  , min^#(cons(0(), nil())) -> c_9()
  , min^#(cons(s(n), nil())) -> c_10()
  , if_min^#(true(), cons(n, cons(m, x))) -> c_11(min^#(cons(n, x)))
  , if_min^#(false(), cons(n, cons(m, x))) -> c_12(min^#(cons(m, x)))
  , replace^#(n, m, cons(k, x)) ->
    c_13(if_replace^#(eq(n, k), n, m, cons(k, x)), eq^#(n, k))
  , replace^#(n, m, nil()) -> c_14()
  , if_replace^#(true(), n, m, cons(k, x)) -> c_15()
  , if_replace^#(false(), n, m, cons(k, x)) ->
    c_16(replace^#(n, m, x))
  , sort^#(cons(n, x)) ->
    c_17(min^#(cons(n, x)),
         sort^#(replace(min(cons(n, x)), n, x)),
         replace^#(min(cons(n, x)), n, x),
         min^#(cons(n, x)))
  , sort^#(nil()) -> c_18() }
Weak Trs:
  { eq(0(), 0()) -> true()
  , eq(0(), s(m)) -> false()
  , eq(s(n), 0()) -> false()
  , eq(s(n), s(m)) -> eq(n, m)
  , le(0(), m) -> true()
  , le(s(n), 0()) -> false()
  , le(s(n), s(m)) -> le(n, m)
  , min(cons(n, cons(m, x))) -> if_min(le(n, m), cons(n, cons(m, x)))
  , min(cons(0(), nil())) -> 0()
  , min(cons(s(n), nil())) -> s(n)
  , if_min(true(), cons(n, cons(m, x))) -> min(cons(n, x))
  , if_min(false(), cons(n, cons(m, x))) -> min(cons(m, x))
  , replace(n, m, cons(k, x)) ->
    if_replace(eq(n, k), n, m, cons(k, x))
  , replace(n, m, nil()) -> nil()
  , if_replace(true(), n, m, cons(k, x)) -> cons(m, x)
  , if_replace(false(), n, m, cons(k, x)) ->
    cons(k, replace(n, m, x))
  , sort(cons(n, x)) ->
    cons(min(cons(n, x)), sort(replace(min(cons(n, x)), n, x)))
  , sort(nil()) -> nil() }
Obligation:
  innermost runtime complexity
Answer:
  YES(O(1),O(n^3))

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

  DPs:
    { 1: eq^#(0(), 0()) -> c_1()
    , 2: eq^#(0(), s(m)) -> c_2()
    , 3: eq^#(s(n), 0()) -> c_3()
    , 4: eq^#(s(n), s(m)) -> c_4(eq^#(n, m))
    , 5: le^#(0(), m) -> c_5()
    , 6: le^#(s(n), 0()) -> c_6()
    , 7: le^#(s(n), s(m)) -> c_7(le^#(n, m))
    , 8: min^#(cons(n, cons(m, x))) ->
         c_8(if_min^#(le(n, m), cons(n, cons(m, x))), le^#(n, m))
    , 9: min^#(cons(0(), nil())) -> c_9()
    , 10: min^#(cons(s(n), nil())) -> c_10()
    , 11: if_min^#(true(), cons(n, cons(m, x))) ->
          c_11(min^#(cons(n, x)))
    , 12: if_min^#(false(), cons(n, cons(m, x))) ->
          c_12(min^#(cons(m, x)))
    , 13: replace^#(n, m, cons(k, x)) ->
          c_13(if_replace^#(eq(n, k), n, m, cons(k, x)), eq^#(n, k))
    , 14: replace^#(n, m, nil()) -> c_14()
    , 15: if_replace^#(true(), n, m, cons(k, x)) -> c_15()
    , 16: if_replace^#(false(), n, m, cons(k, x)) ->
          c_16(replace^#(n, m, x))
    , 17: sort^#(cons(n, x)) ->
          c_17(min^#(cons(n, x)),
               sort^#(replace(min(cons(n, x)), n, x)),
               replace^#(min(cons(n, x)), n, x),
               min^#(cons(n, x)))
    , 18: sort^#(nil()) -> c_18() }

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

Strict DPs:
  { eq^#(s(n), s(m)) -> c_4(eq^#(n, m))
  , le^#(s(n), s(m)) -> c_7(le^#(n, m))
  , min^#(cons(n, cons(m, x))) ->
    c_8(if_min^#(le(n, m), cons(n, cons(m, x))), le^#(n, m))
  , if_min^#(true(), cons(n, cons(m, x))) -> c_11(min^#(cons(n, x)))
  , if_min^#(false(), cons(n, cons(m, x))) -> c_12(min^#(cons(m, x)))
  , replace^#(n, m, cons(k, x)) ->
    c_13(if_replace^#(eq(n, k), n, m, cons(k, x)), eq^#(n, k))
  , if_replace^#(false(), n, m, cons(k, x)) ->
    c_16(replace^#(n, m, x))
  , sort^#(cons(n, x)) ->
    c_17(min^#(cons(n, x)),
         sort^#(replace(min(cons(n, x)), n, x)),
         replace^#(min(cons(n, x)), n, x),
         min^#(cons(n, x))) }
Weak DPs:
  { eq^#(0(), 0()) -> c_1()
  , eq^#(0(), s(m)) -> c_2()
  , eq^#(s(n), 0()) -> c_3()
  , le^#(0(), m) -> c_5()
  , le^#(s(n), 0()) -> c_6()
  , min^#(cons(0(), nil())) -> c_9()
  , min^#(cons(s(n), nil())) -> c_10()
  , replace^#(n, m, nil()) -> c_14()
  , if_replace^#(true(), n, m, cons(k, x)) -> c_15()
  , sort^#(nil()) -> c_18() }
Weak Trs:
  { eq(0(), 0()) -> true()
  , eq(0(), s(m)) -> false()
  , eq(s(n), 0()) -> false()
  , eq(s(n), s(m)) -> eq(n, m)
  , le(0(), m) -> true()
  , le(s(n), 0()) -> false()
  , le(s(n), s(m)) -> le(n, m)
  , min(cons(n, cons(m, x))) -> if_min(le(n, m), cons(n, cons(m, x)))
  , min(cons(0(), nil())) -> 0()
  , min(cons(s(n), nil())) -> s(n)
  , if_min(true(), cons(n, cons(m, x))) -> min(cons(n, x))
  , if_min(false(), cons(n, cons(m, x))) -> min(cons(m, x))
  , replace(n, m, cons(k, x)) ->
    if_replace(eq(n, k), n, m, cons(k, x))
  , replace(n, m, nil()) -> nil()
  , if_replace(true(), n, m, cons(k, x)) -> cons(m, x)
  , if_replace(false(), n, m, cons(k, x)) ->
    cons(k, replace(n, m, x))
  , sort(cons(n, x)) ->
    cons(min(cons(n, x)), sort(replace(min(cons(n, x)), n, x)))
  , sort(nil()) -> nil() }
Obligation:
  innermost runtime complexity
Answer:
  YES(O(1),O(n^3))

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

{ eq^#(0(), 0()) -> c_1()
, eq^#(0(), s(m)) -> c_2()
, eq^#(s(n), 0()) -> c_3()
, le^#(0(), m) -> c_5()
, le^#(s(n), 0()) -> c_6()
, min^#(cons(0(), nil())) -> c_9()
, min^#(cons(s(n), nil())) -> c_10()
, replace^#(n, m, nil()) -> c_14()
, if_replace^#(true(), n, m, cons(k, x)) -> c_15()
, sort^#(nil()) -> c_18() }

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

Strict DPs:
  { eq^#(s(n), s(m)) -> c_4(eq^#(n, m))
  , le^#(s(n), s(m)) -> c_7(le^#(n, m))
  , min^#(cons(n, cons(m, x))) ->
    c_8(if_min^#(le(n, m), cons(n, cons(m, x))), le^#(n, m))
  , if_min^#(true(), cons(n, cons(m, x))) -> c_11(min^#(cons(n, x)))
  , if_min^#(false(), cons(n, cons(m, x))) -> c_12(min^#(cons(m, x)))
  , replace^#(n, m, cons(k, x)) ->
    c_13(if_replace^#(eq(n, k), n, m, cons(k, x)), eq^#(n, k))
  , if_replace^#(false(), n, m, cons(k, x)) ->
    c_16(replace^#(n, m, x))
  , sort^#(cons(n, x)) ->
    c_17(min^#(cons(n, x)),
         sort^#(replace(min(cons(n, x)), n, x)),
         replace^#(min(cons(n, x)), n, x),
         min^#(cons(n, x))) }
Weak Trs:
  { eq(0(), 0()) -> true()
  , eq(0(), s(m)) -> false()
  , eq(s(n), 0()) -> false()
  , eq(s(n), s(m)) -> eq(n, m)
  , le(0(), m) -> true()
  , le(s(n), 0()) -> false()
  , le(s(n), s(m)) -> le(n, m)
  , min(cons(n, cons(m, x))) -> if_min(le(n, m), cons(n, cons(m, x)))
  , min(cons(0(), nil())) -> 0()
  , min(cons(s(n), nil())) -> s(n)
  , if_min(true(), cons(n, cons(m, x))) -> min(cons(n, x))
  , if_min(false(), cons(n, cons(m, x))) -> min(cons(m, x))
  , replace(n, m, cons(k, x)) ->
    if_replace(eq(n, k), n, m, cons(k, x))
  , replace(n, m, nil()) -> nil()
  , if_replace(true(), n, m, cons(k, x)) -> cons(m, x)
  , if_replace(false(), n, m, cons(k, x)) ->
    cons(k, replace(n, m, x))
  , sort(cons(n, x)) ->
    cons(min(cons(n, x)), sort(replace(min(cons(n, x)), n, x)))
  , sort(nil()) -> nil() }
Obligation:
  innermost runtime complexity
Answer:
  YES(O(1),O(n^3))

We replace rewrite rules by usable rules:

  Weak Usable Rules:
    { eq(0(), 0()) -> true()
    , eq(0(), s(m)) -> false()
    , eq(s(n), 0()) -> false()
    , eq(s(n), s(m)) -> eq(n, m)
    , le(0(), m) -> true()
    , le(s(n), 0()) -> false()
    , le(s(n), s(m)) -> le(n, m)
    , min(cons(n, cons(m, x))) -> if_min(le(n, m), cons(n, cons(m, x)))
    , min(cons(0(), nil())) -> 0()
    , min(cons(s(n), nil())) -> s(n)
    , if_min(true(), cons(n, cons(m, x))) -> min(cons(n, x))
    , if_min(false(), cons(n, cons(m, x))) -> min(cons(m, x))
    , replace(n, m, cons(k, x)) ->
      if_replace(eq(n, k), n, m, cons(k, x))
    , replace(n, m, nil()) -> nil()
    , if_replace(true(), n, m, cons(k, x)) -> cons(m, x)
    , if_replace(false(), n, m, cons(k, x)) ->
      cons(k, replace(n, m, x)) }

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

Strict DPs:
  { eq^#(s(n), s(m)) -> c_4(eq^#(n, m))
  , le^#(s(n), s(m)) -> c_7(le^#(n, m))
  , min^#(cons(n, cons(m, x))) ->
    c_8(if_min^#(le(n, m), cons(n, cons(m, x))), le^#(n, m))
  , if_min^#(true(), cons(n, cons(m, x))) -> c_11(min^#(cons(n, x)))
  , if_min^#(false(), cons(n, cons(m, x))) -> c_12(min^#(cons(m, x)))
  , replace^#(n, m, cons(k, x)) ->
    c_13(if_replace^#(eq(n, k), n, m, cons(k, x)), eq^#(n, k))
  , if_replace^#(false(), n, m, cons(k, x)) ->
    c_16(replace^#(n, m, x))
  , sort^#(cons(n, x)) ->
    c_17(min^#(cons(n, x)),
         sort^#(replace(min(cons(n, x)), n, x)),
         replace^#(min(cons(n, x)), n, x),
         min^#(cons(n, x))) }
Weak Trs:
  { eq(0(), 0()) -> true()
  , eq(0(), s(m)) -> false()
  , eq(s(n), 0()) -> false()
  , eq(s(n), s(m)) -> eq(n, m)
  , le(0(), m) -> true()
  , le(s(n), 0()) -> false()
  , le(s(n), s(m)) -> le(n, m)
  , min(cons(n, cons(m, x))) -> if_min(le(n, m), cons(n, cons(m, x)))
  , min(cons(0(), nil())) -> 0()
  , min(cons(s(n), nil())) -> s(n)
  , if_min(true(), cons(n, cons(m, x))) -> min(cons(n, x))
  , if_min(false(), cons(n, cons(m, x))) -> min(cons(m, x))
  , replace(n, m, cons(k, x)) ->
    if_replace(eq(n, k), n, m, cons(k, x))
  , replace(n, m, nil()) -> nil()
  , if_replace(true(), n, m, cons(k, x)) -> cons(m, x)
  , if_replace(false(), n, m, cons(k, x)) ->
    cons(k, replace(n, m, x)) }
Obligation:
  innermost runtime complexity
Answer:
  YES(O(1),O(n^3))

We decompose the input problem according to the dependency graph
into the upper component

  { sort^#(cons(n, x)) ->
    c_17(min^#(cons(n, x)),
         sort^#(replace(min(cons(n, x)), n, x)),
         replace^#(min(cons(n, x)), n, x),
         min^#(cons(n, x))) }

and lower component

  { eq^#(s(n), s(m)) -> c_4(eq^#(n, m))
  , le^#(s(n), s(m)) -> c_7(le^#(n, m))
  , min^#(cons(n, cons(m, x))) ->
    c_8(if_min^#(le(n, m), cons(n, cons(m, x))), le^#(n, m))
  , if_min^#(true(), cons(n, cons(m, x))) -> c_11(min^#(cons(n, x)))
  , if_min^#(false(), cons(n, cons(m, x))) -> c_12(min^#(cons(m, x)))
  , replace^#(n, m, cons(k, x)) ->
    c_13(if_replace^#(eq(n, k), n, m, cons(k, x)), eq^#(n, k))
  , if_replace^#(false(), n, m, cons(k, x)) ->
    c_16(replace^#(n, m, x)) }

Further, following extension rules are added to the lower
component.

{ sort^#(cons(n, x)) -> min^#(cons(n, x))
, sort^#(cons(n, x)) -> replace^#(min(cons(n, x)), n, x)
, sort^#(cons(n, x)) -> sort^#(replace(min(cons(n, x)), n, x)) }

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:
    { sort^#(cons(n, x)) ->
      c_17(min^#(cons(n, x)),
           sort^#(replace(min(cons(n, x)), n, x)),
           replace^#(min(cons(n, x)), n, x),
           min^#(cons(n, x))) }
  Weak Trs:
    { eq(0(), 0()) -> true()
    , eq(0(), s(m)) -> false()
    , eq(s(n), 0()) -> false()
    , eq(s(n), s(m)) -> eq(n, m)
    , le(0(), m) -> true()
    , le(s(n), 0()) -> false()
    , le(s(n), s(m)) -> le(n, m)
    , min(cons(n, cons(m, x))) -> if_min(le(n, m), cons(n, cons(m, x)))
    , min(cons(0(), nil())) -> 0()
    , min(cons(s(n), nil())) -> s(n)
    , if_min(true(), cons(n, cons(m, x))) -> min(cons(n, x))
    , if_min(false(), cons(n, cons(m, x))) -> min(cons(m, x))
    , replace(n, m, cons(k, x)) ->
      if_replace(eq(n, k), n, m, cons(k, x))
    , replace(n, m, nil()) -> nil()
    , if_replace(true(), n, m, cons(k, x)) -> cons(m, x)
    , if_replace(false(), n, m, cons(k, x)) ->
      cons(k, replace(n, m, x)) }
  Obligation:
    innermost runtime complexity
  Answer:
    YES(O(1),O(n^1))
  
  We use the processor 'Small Polynomial Path Order (PS,1-bounded)'
  to orient following rules strictly.
  
  DPs:
    { 1: sort^#(cons(n, x)) ->
         c_17(min^#(cons(n, x)),
              sort^#(replace(min(cons(n, x)), n, x)),
              replace^#(min(cons(n, x)), n, x),
              min^#(cons(n, x))) }
  
  Sub-proof:
  ----------
    The input was oriented with the instance of 'Small Polynomial Path
    Order (PS,1-bounded)' as induced by the safe mapping
    
     safe(eq) = {1, 2}, safe(0) = {}, safe(true) = {}, safe(s) = {1},
     safe(false) = {}, safe(le) = {1, 2}, safe(min) = {},
     safe(cons) = {1, 2}, safe(nil) = {}, safe(if_min) = {},
     safe(replace) = {3}, safe(if_replace) = {4}, safe(min^#) = {},
     safe(replace^#) = {}, safe(sort^#) = {}, safe(c_17) = {}
    
    and precedence
    
     min > if_min, replace > if_replace .
    
    Following symbols are considered recursive:
    
     {sort^#}
    
    The recursion depth is 1.
    
    Further, following argument filtering is employed:
    
     pi(eq) = [1, 2], pi(0) = [], pi(true) = [], pi(s) = [],
     pi(false) = [], pi(le) = [1, 2], pi(min) = [], pi(cons) = [2],
     pi(nil) = [], pi(if_min) = [2], pi(replace) = 3,
     pi(if_replace) = 4, pi(min^#) = [1], pi(replace^#) = [],
     pi(sort^#) = [1], pi(c_17) = [1, 2, 3, 4]
    
    Usable defined function symbols are a subset of:
    
     {replace, if_replace, min^#, replace^#, sort^#}
    
    For your convenience, here are the satisfied ordering constraints:
    
                         pi(sort^#(cons(n, x))) =  sort^#(cons(; x);)                             
                                                >  c_17(min^#(cons(; x);),                        
                                                        sort^#(x;),                               
                                                        replace^#(),                              
                                                        min^#(cons(; x););)                       
                                                =  pi(c_17(min^#(cons(n, x)),                     
                                                           sort^#(replace(min(cons(n, x)), n, x)),
                                                           replace^#(min(cons(n, x)), n, x),      
                                                           min^#(cons(n, x))))                    
                                                                                                  
                  pi(replace(n, m, cons(k, x))) =  cons(; x)                                      
                                                >= cons(; x)                                      
                                                =  pi(if_replace(eq(n, k), n, m, cons(k, x)))     
                                                                                                  
                       pi(replace(n, m, nil())) =  nil()                                          
                                                >= nil()                                          
                                                =  pi(nil())                                      
                                                                                                  
       pi(if_replace(true(), n, m, cons(k, x))) =  cons(; x)                                      
                                                >= cons(; x)                                      
                                                =  pi(cons(m, x))                                 
                                                                                                  
      pi(if_replace(false(), n, m, cons(k, x))) =  cons(; x)                                      
                                                >= cons(; x)                                      
                                                =  pi(cons(k, replace(n, m, x)))                  
                                                                                                  
  
  The strictly oriented rules are moved into the weak component.
  
  We are left with following problem, upon which TcT provides the
  certificate YES(O(1),O(1)).
  
  Weak DPs:
    { sort^#(cons(n, x)) ->
      c_17(min^#(cons(n, x)),
           sort^#(replace(min(cons(n, x)), n, x)),
           replace^#(min(cons(n, x)), n, x),
           min^#(cons(n, x))) }
  Weak Trs:
    { eq(0(), 0()) -> true()
    , eq(0(), s(m)) -> false()
    , eq(s(n), 0()) -> false()
    , eq(s(n), s(m)) -> eq(n, m)
    , le(0(), m) -> true()
    , le(s(n), 0()) -> false()
    , le(s(n), s(m)) -> le(n, m)
    , min(cons(n, cons(m, x))) -> if_min(le(n, m), cons(n, cons(m, x)))
    , min(cons(0(), nil())) -> 0()
    , min(cons(s(n), nil())) -> s(n)
    , if_min(true(), cons(n, cons(m, x))) -> min(cons(n, x))
    , if_min(false(), cons(n, cons(m, x))) -> min(cons(m, x))
    , replace(n, m, cons(k, x)) ->
      if_replace(eq(n, k), n, m, cons(k, x))
    , replace(n, m, nil()) -> nil()
    , if_replace(true(), n, m, cons(k, x)) -> cons(m, x)
    , if_replace(false(), n, m, cons(k, x)) ->
      cons(k, replace(n, m, x)) }
  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.
  
  { sort^#(cons(n, x)) ->
    c_17(min^#(cons(n, x)),
         sort^#(replace(min(cons(n, x)), n, x)),
         replace^#(min(cons(n, x)), n, x),
         min^#(cons(n, x))) }
  
  We are left with following problem, upon which TcT provides the
  certificate YES(O(1),O(1)).
  
  Weak Trs:
    { eq(0(), 0()) -> true()
    , eq(0(), s(m)) -> false()
    , eq(s(n), 0()) -> false()
    , eq(s(n), s(m)) -> eq(n, m)
    , le(0(), m) -> true()
    , le(s(n), 0()) -> false()
    , le(s(n), s(m)) -> le(n, m)
    , min(cons(n, cons(m, x))) -> if_min(le(n, m), cons(n, cons(m, x)))
    , min(cons(0(), nil())) -> 0()
    , min(cons(s(n), nil())) -> s(n)
    , if_min(true(), cons(n, cons(m, x))) -> min(cons(n, x))
    , if_min(false(), cons(n, cons(m, x))) -> min(cons(m, x))
    , replace(n, m, cons(k, x)) ->
      if_replace(eq(n, k), n, m, cons(k, x))
    , replace(n, m, nil()) -> nil()
    , if_replace(true(), n, m, cons(k, x)) -> cons(m, x)
    , if_replace(false(), n, m, cons(k, x)) ->
      cons(k, replace(n, m, x)) }
  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^2)).

Strict DPs:
  { eq^#(s(n), s(m)) -> c_4(eq^#(n, m))
  , le^#(s(n), s(m)) -> c_7(le^#(n, m))
  , min^#(cons(n, cons(m, x))) ->
    c_8(if_min^#(le(n, m), cons(n, cons(m, x))), le^#(n, m))
  , if_min^#(true(), cons(n, cons(m, x))) -> c_11(min^#(cons(n, x)))
  , if_min^#(false(), cons(n, cons(m, x))) -> c_12(min^#(cons(m, x)))
  , replace^#(n, m, cons(k, x)) ->
    c_13(if_replace^#(eq(n, k), n, m, cons(k, x)), eq^#(n, k))
  , if_replace^#(false(), n, m, cons(k, x)) ->
    c_16(replace^#(n, m, x)) }
Weak DPs:
  { sort^#(cons(n, x)) -> min^#(cons(n, x))
  , sort^#(cons(n, x)) -> replace^#(min(cons(n, x)), n, x)
  , sort^#(cons(n, x)) -> sort^#(replace(min(cons(n, x)), n, x)) }
Weak Trs:
  { eq(0(), 0()) -> true()
  , eq(0(), s(m)) -> false()
  , eq(s(n), 0()) -> false()
  , eq(s(n), s(m)) -> eq(n, m)
  , le(0(), m) -> true()
  , le(s(n), 0()) -> false()
  , le(s(n), s(m)) -> le(n, m)
  , min(cons(n, cons(m, x))) -> if_min(le(n, m), cons(n, cons(m, x)))
  , min(cons(0(), nil())) -> 0()
  , min(cons(s(n), nil())) -> s(n)
  , if_min(true(), cons(n, cons(m, x))) -> min(cons(n, x))
  , if_min(false(), cons(n, cons(m, x))) -> min(cons(m, x))
  , replace(n, m, cons(k, x)) ->
    if_replace(eq(n, k), n, m, cons(k, x))
  , replace(n, m, nil()) -> nil()
  , if_replace(true(), n, m, cons(k, x)) -> cons(m, x)
  , if_replace(false(), n, m, cons(k, x)) ->
    cons(k, replace(n, m, x)) }
Obligation:
  innermost runtime complexity
Answer:
  YES(O(1),O(n^2))

We use the processor 'matrix interpretation of dimension 2' to
orient following rules strictly.

DPs:
  { 1: eq^#(s(n), s(m)) -> c_4(eq^#(n, m))
  , 7: if_replace^#(false(), n, m, cons(k, x)) ->
       c_16(replace^#(n, m, x))
  , 8: sort^#(cons(n, x)) -> min^#(cons(n, x))
  , 9: sort^#(cons(n, x)) -> replace^#(min(cons(n, x)), n, x)
  , 10: sort^#(cons(n, x)) ->
        sort^#(replace(min(cons(n, x)), n, x)) }
Trs:
  { eq(0(), 0()) -> true()
  , eq(0(), s(m)) -> false()
  , eq(s(n), 0()) -> false()
  , le(s(n), s(m)) -> le(n, m)
  , min(cons(n, cons(m, x))) ->
    if_min(le(n, m), cons(n, cons(m, x))) }

Sub-proof:
----------
  The following argument positions are usable:
    Uargs(c_4) = {1}, Uargs(c_7) = {1}, Uargs(c_8) = {1, 2},
    Uargs(c_11) = {1}, Uargs(c_12) = {1}, Uargs(c_13) = {1, 2},
    Uargs(c_16) = {1}
  
  TcT has computed the following constructor-based matrix
  interpretation satisfying not(EDA) and not(IDA(1)).
  
                      [eq](x1, x2) = [2]                               
                                     [1]                               
                                                                       
                               [0] = [0]                               
                                     [1]                               
                                                                       
                            [true] = [0]                               
                                     [0]                               
                                                                       
                           [s](x1) = [1 0] x1 + [2]                    
                                     [0 1]      [3]                    
                                                                       
                           [false] = [1]                               
                                     [0]                               
                                                                       
                      [le](x1, x2) = [3 1] x2 + [0]                    
                                     [0 0]      [0]                    
                                                                       
                         [min](x1) = [6]                               
                                     [0]                               
                                                                       
                    [cons](x1, x2) = [1 0] x1 + [1 0] x2 + [1]         
                                     [0 0]      [1 0]      [2]         
                                                                       
                             [nil] = [0]                               
                                     [0]                               
                                                                       
                  [if_min](x1, x2) = [4]                               
                                     [0]                               
                                                                       
             [replace](x1, x2, x3) = [1 0] x2 + [1 0] x3 + [0]         
                                     [1 0]      [2 1]      [4]         
                                                                       
      [if_replace](x1, x2, x3, x4) = [0 0] x1 + [1 0] x3 + [1          
                                                            0] x4 + [0]
                                     [0 4]      [1 0]      [0          
                                                            2]      [0]
                                                                       
                    [eq^#](x1, x2) = [1 0] x2 + [0]                    
                                     [0 0]      [1]                    
                                                                       
                         [c_4](x1) = [1 1] x1 + [0]                    
                                     [0 0]      [0]                    
                                                                       
                    [le^#](x1, x2) = [0 0] x2 + [0]                    
                                     [1 0]      [1]                    
                                                                       
                         [c_7](x1) = [1 0] x1 + [0]                    
                                     [0 0]      [0]                    
                                                                       
                       [min^#](x1) = [0]                               
                                     [0]                               
                                                                       
                     [c_8](x1, x2) = [3 1] x1 + [4 0] x2 + [0]         
                                     [0 0]      [0 0]      [0]         
                                                                       
                [if_min^#](x1, x2) = [0 3] x1 + [0]                    
                                     [0 0]      [0]                    
                                                                       
                        [c_11](x1) = [3 1] x1 + [0]                    
                                     [0 0]      [0]                    
                                                                       
                        [c_12](x1) = [1 0] x1 + [0]                    
                                     [0 0]      [0]                    
                                                                       
           [replace^#](x1, x2, x3) = [7 0] x3 + [6]                    
                                     [0 0]      [1]                    
                                                                       
                    [c_13](x1, x2) = [1 0] x1 + [2 1] x2 + [0]         
                                     [0 0]      [0 0]      [0]         
                                                                       
    [if_replace^#](x1, x2, x3, x4) = [0 0] x1 + [5 2] x4 + [3]         
                                     [1 0]      [0 0]      [2]         
                                                                       
                        [c_16](x1) = [1 3] x1 + [1]                    
                                     [0 0]      [0]                    
                                                                       
                      [sort^#](x1) = [7 0] x1 + [6]                    
                                     [0 0]      [6]                    
  
  The order satisfies the following ordering constraints:
  
                               [eq(0(), 0())] =  [2]                                                         
                                                 [1]                                                         
                                              >  [0]                                                         
                                                 [0]                                                         
                                              =  [true()]                                                    
                                                                                                             
                              [eq(0(), s(m))] =  [2]                                                         
                                                 [1]                                                         
                                              >  [1]                                                         
                                                 [0]                                                         
                                              =  [false()]                                                   
                                                                                                             
                              [eq(s(n), 0())] =  [2]                                                         
                                                 [1]                                                         
                                              >  [1]                                                         
                                                 [0]                                                         
                                              =  [false()]                                                   
                                                                                                             
                             [eq(s(n), s(m))] =  [2]                                                         
                                                 [1]                                                         
                                              >= [2]                                                         
                                                 [1]                                                         
                                              =  [eq(n, m)]                                                  
                                                                                                             
                                 [le(0(), m)] =  [3 1] m + [0]                                               
                                                 [0 0]     [0]                                               
                                              >= [0]                                                         
                                                 [0]                                                         
                                              =  [true()]                                                    
                                                                                                             
                              [le(s(n), 0())] =  [1]                                                         
                                                 [0]                                                         
                                              >= [1]                                                         
                                                 [0]                                                         
                                              =  [false()]                                                   
                                                                                                             
                             [le(s(n), s(m))] =  [3 1] m + [9]                                               
                                                 [0 0]     [0]                                               
                                              >  [3 1] m + [0]                                               
                                                 [0 0]     [0]                                               
                                              =  [le(n, m)]                                                  
                                                                                                             
                   [min(cons(n, cons(m, x)))] =  [6]                                                         
                                                 [0]                                                         
                                              >  [4]                                                         
                                                 [0]                                                         
                                              =  [if_min(le(n, m), cons(n, cons(m, x)))]                     
                                                                                                             
                      [min(cons(0(), nil()))] =  [6]                                                         
                                                 [0]                                                         
                                              ?  [0]                                                         
                                                 [1]                                                         
                                              =  [0()]                                                       
                                                                                                             
                     [min(cons(s(n), nil()))] =  [6]                                                         
                                                 [0]                                                         
                                              ?  [1 0] n + [2]                                               
                                                 [0 1]     [3]                                               
                                              =  [s(n)]                                                      
                                                                                                             
        [if_min(true(), cons(n, cons(m, x)))] =  [4]                                                         
                                                 [0]                                                         
                                              ?  [6]                                                         
                                                 [0]                                                         
                                              =  [min(cons(n, x))]                                           
                                                                                                             
       [if_min(false(), cons(n, cons(m, x)))] =  [4]                                                         
                                                 [0]                                                         
                                              ?  [6]                                                         
                                                 [0]                                                         
                                              =  [min(cons(m, x))]                                           
                                                                                                             
                  [replace(n, m, cons(k, x))] =  [1 0] m + [1 0] x + [1 0] k + [1]                           
                                                 [1 0]     [3 0]     [2 0]     [8]                           
                                              >= [1 0] m + [1 0] x + [1 0] k + [1]                           
                                                 [1 0]     [2 0]     [0 0]     [8]                           
                                              =  [if_replace(eq(n, k), n, m, cons(k, x))]                    
                                                                                                             
                       [replace(n, m, nil())] =  [1 0] m + [0]                                               
                                                 [1 0]     [4]                                               
                                              >= [0]                                                         
                                                 [0]                                                         
                                              =  [nil()]                                                     
                                                                                                             
       [if_replace(true(), n, m, cons(k, x))] =  [1 0] m + [1 0] x + [1 0] k + [1]                           
                                                 [1 0]     [2 0]     [0 0]     [4]                           
                                              >= [1 0] m + [1 0] x + [1]                                     
                                                 [0 0]     [1 0]     [2]                                     
                                              =  [cons(m, x)]                                                
                                                                                                             
      [if_replace(false(), n, m, cons(k, x))] =  [1 0] m + [1 0] x + [1 0] k + [1]                           
                                                 [1 0]     [2 0]     [0 0]     [4]                           
                                              >= [1 0] m + [1 0] x + [1 0] k + [1]                           
                                                 [1 0]     [1 0]     [0 0]     [2]                           
                                              =  [cons(k, replace(n, m, x))]                                 
                                                                                                             
                           [eq^#(s(n), s(m))] =  [1 0] m + [2]                                               
                                                 [0 0]     [1]                                               
                                              >  [1 0] m + [1]                                               
                                                 [0 0]     [0]                                               
                                              =  [c_4(eq^#(n, m))]                                           
                                                                                                             
                           [le^#(s(n), s(m))] =  [0 0] m + [0]                                               
                                                 [1 0]     [3]                                               
                                              >= [0]                                                         
                                                 [0]                                                         
                                              =  [c_7(le^#(n, m))]                                           
                                                                                                             
                 [min^#(cons(n, cons(m, x)))] =  [0]                                                         
                                                 [0]                                                         
                                              >= [0]                                                         
                                                 [0]                                                         
                                              =  [c_8(if_min^#(le(n, m), cons(n, cons(m, x))), le^#(n, m))]  
                                                                                                             
      [if_min^#(true(), cons(n, cons(m, x)))] =  [0]                                                         
                                                 [0]                                                         
                                              >= [0]                                                         
                                                 [0]                                                         
                                              =  [c_11(min^#(cons(n, x)))]                                   
                                                                                                             
     [if_min^#(false(), cons(n, cons(m, x)))] =  [0]                                                         
                                                 [0]                                                         
                                              >= [0]                                                         
                                                 [0]                                                         
                                              =  [c_12(min^#(cons(m, x)))]                                   
                                                                                                             
                [replace^#(n, m, cons(k, x))] =  [7 0] x + [7 0] k + [13]                                    
                                                 [0 0]     [0 0]     [1]                                     
                                              >= [7 0] x + [7 0] k + [13]                                    
                                                 [0 0]     [0 0]     [0]                                     
                                              =  [c_13(if_replace^#(eq(n, k), n, m, cons(k, x)), eq^#(n, k))]
                                                                                                             
    [if_replace^#(false(), n, m, cons(k, x))] =  [7 0] x + [5 0] k + [12]                                    
                                                 [0 0]     [0 0]     [3]                                     
                                              >  [7 0] x + [10]                                              
                                                 [0 0]     [0]                                               
                                              =  [c_16(replace^#(n, m, x))]                                  
                                                                                                             
                         [sort^#(cons(n, x))] =  [7 0] n + [7 0] x + [13]                                    
                                                 [0 0]     [0 0]     [6]                                     
                                              >  [0]                                                         
                                                 [0]                                                         
                                              =  [min^#(cons(n, x))]                                         
                                                                                                             
                         [sort^#(cons(n, x))] =  [7 0] n + [7 0] x + [13]                                    
                                                 [0 0]     [0 0]     [6]                                     
                                              >  [7 0] x + [6]                                               
                                                 [0 0]     [1]                                               
                                              =  [replace^#(min(cons(n, x)), n, x)]                          
                                                                                                             
                         [sort^#(cons(n, x))] =  [7 0] n + [7 0] x + [13]                                    
                                                 [0 0]     [0 0]     [6]                                     
                                              >  [7 0] n + [7 0] x + [6]                                     
                                                 [0 0]     [0 0]     [6]                                     
                                              =  [sort^#(replace(min(cons(n, x)), n, x))]                    
                                                                                                             

We return to the main proof. Consider the set of all dependency
pairs

:
  { 1: eq^#(s(n), s(m)) -> c_4(eq^#(n, m))
  , 2: le^#(s(n), s(m)) -> c_7(le^#(n, m))
  , 3: min^#(cons(n, cons(m, x))) ->
       c_8(if_min^#(le(n, m), cons(n, cons(m, x))), le^#(n, m))
  , 4: if_min^#(true(), cons(n, cons(m, x))) ->
       c_11(min^#(cons(n, x)))
  , 5: if_min^#(false(), cons(n, cons(m, x))) ->
       c_12(min^#(cons(m, x)))
  , 6: replace^#(n, m, cons(k, x)) ->
       c_13(if_replace^#(eq(n, k), n, m, cons(k, x)), eq^#(n, k))
  , 7: if_replace^#(false(), n, m, cons(k, x)) ->
       c_16(replace^#(n, m, x))
  , 8: sort^#(cons(n, x)) -> min^#(cons(n, x))
  , 9: sort^#(cons(n, x)) -> replace^#(min(cons(n, x)), n, x)
  , 10: sort^#(cons(n, x)) ->
        sort^#(replace(min(cons(n, x)), n, x)) }

Processor 'matrix interpretation of dimension 2' induces the
complexity certificate YES(?,O(n^1)) on application of dependency
pairs {1,7,8,9,10}. These cover all (indirect) predecessors of
dependency pairs {1,6,7,8,9,10}, 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(n^2)).

Strict DPs:
  { le^#(s(n), s(m)) -> c_7(le^#(n, m))
  , min^#(cons(n, cons(m, x))) ->
    c_8(if_min^#(le(n, m), cons(n, cons(m, x))), le^#(n, m))
  , if_min^#(true(), cons(n, cons(m, x))) -> c_11(min^#(cons(n, x)))
  , if_min^#(false(), cons(n, cons(m, x))) ->
    c_12(min^#(cons(m, x))) }
Weak DPs:
  { eq^#(s(n), s(m)) -> c_4(eq^#(n, m))
  , replace^#(n, m, cons(k, x)) ->
    c_13(if_replace^#(eq(n, k), n, m, cons(k, x)), eq^#(n, k))
  , if_replace^#(false(), n, m, cons(k, x)) ->
    c_16(replace^#(n, m, x))
  , sort^#(cons(n, x)) -> min^#(cons(n, x))
  , sort^#(cons(n, x)) -> replace^#(min(cons(n, x)), n, x)
  , sort^#(cons(n, x)) -> sort^#(replace(min(cons(n, x)), n, x)) }
Weak Trs:
  { eq(0(), 0()) -> true()
  , eq(0(), s(m)) -> false()
  , eq(s(n), 0()) -> false()
  , eq(s(n), s(m)) -> eq(n, m)
  , le(0(), m) -> true()
  , le(s(n), 0()) -> false()
  , le(s(n), s(m)) -> le(n, m)
  , min(cons(n, cons(m, x))) -> if_min(le(n, m), cons(n, cons(m, x)))
  , min(cons(0(), nil())) -> 0()
  , min(cons(s(n), nil())) -> s(n)
  , if_min(true(), cons(n, cons(m, x))) -> min(cons(n, x))
  , if_min(false(), cons(n, cons(m, x))) -> min(cons(m, x))
  , replace(n, m, cons(k, x)) ->
    if_replace(eq(n, k), n, m, cons(k, x))
  , replace(n, m, nil()) -> nil()
  , if_replace(true(), n, m, cons(k, x)) -> cons(m, x)
  , if_replace(false(), n, m, cons(k, x)) ->
    cons(k, replace(n, m, x)) }
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.

{ eq^#(s(n), s(m)) -> c_4(eq^#(n, m))
, replace^#(n, m, cons(k, x)) ->
  c_13(if_replace^#(eq(n, k), n, m, cons(k, x)), eq^#(n, k))
, if_replace^#(false(), n, m, cons(k, x)) ->
  c_16(replace^#(n, m, x))
, sort^#(cons(n, x)) -> replace^#(min(cons(n, x)), n, x) }

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

Strict DPs:
  { le^#(s(n), s(m)) -> c_7(le^#(n, m))
  , min^#(cons(n, cons(m, x))) ->
    c_8(if_min^#(le(n, m), cons(n, cons(m, x))), le^#(n, m))
  , if_min^#(true(), cons(n, cons(m, x))) -> c_11(min^#(cons(n, x)))
  , if_min^#(false(), cons(n, cons(m, x))) ->
    c_12(min^#(cons(m, x))) }
Weak DPs:
  { sort^#(cons(n, x)) -> min^#(cons(n, x))
  , sort^#(cons(n, x)) -> sort^#(replace(min(cons(n, x)), n, x)) }
Weak Trs:
  { eq(0(), 0()) -> true()
  , eq(0(), s(m)) -> false()
  , eq(s(n), 0()) -> false()
  , eq(s(n), s(m)) -> eq(n, m)
  , le(0(), m) -> true()
  , le(s(n), 0()) -> false()
  , le(s(n), s(m)) -> le(n, m)
  , min(cons(n, cons(m, x))) -> if_min(le(n, m), cons(n, cons(m, x)))
  , min(cons(0(), nil())) -> 0()
  , min(cons(s(n), nil())) -> s(n)
  , if_min(true(), cons(n, cons(m, x))) -> min(cons(n, x))
  , if_min(false(), cons(n, cons(m, x))) -> min(cons(m, x))
  , replace(n, m, cons(k, x)) ->
    if_replace(eq(n, k), n, m, cons(k, x))
  , replace(n, m, nil()) -> nil()
  , if_replace(true(), n, m, cons(k, x)) -> cons(m, x)
  , if_replace(false(), n, m, cons(k, x)) ->
    cons(k, replace(n, m, x)) }
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

  { min^#(cons(n, cons(m, x))) ->
    c_8(if_min^#(le(n, m), cons(n, cons(m, x))), le^#(n, m))
  , if_min^#(true(), cons(n, cons(m, x))) -> c_11(min^#(cons(n, x)))
  , if_min^#(false(), cons(n, cons(m, x))) -> c_12(min^#(cons(m, x)))
  , sort^#(cons(n, x)) -> min^#(cons(n, x))
  , sort^#(cons(n, x)) -> sort^#(replace(min(cons(n, x)), n, x)) }

and lower component

  { le^#(s(n), s(m)) -> c_7(le^#(n, m)) }

Further, following extension rules are added to the lower
component.

{ min^#(cons(n, cons(m, x))) -> le^#(n, m)
, min^#(cons(n, cons(m, x))) ->
  if_min^#(le(n, m), cons(n, cons(m, x)))
, if_min^#(true(), cons(n, cons(m, x))) -> min^#(cons(n, x))
, if_min^#(false(), cons(n, cons(m, x))) -> min^#(cons(m, x))
, sort^#(cons(n, x)) -> min^#(cons(n, x))
, sort^#(cons(n, x)) -> sort^#(replace(min(cons(n, x)), n, x)) }

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:
    { min^#(cons(n, cons(m, x))) ->
      c_8(if_min^#(le(n, m), cons(n, cons(m, x))), le^#(n, m))
    , if_min^#(true(), cons(n, cons(m, x))) -> c_11(min^#(cons(n, x)))
    , if_min^#(false(), cons(n, cons(m, x))) ->
      c_12(min^#(cons(m, x))) }
  Weak DPs:
    { sort^#(cons(n, x)) -> min^#(cons(n, x))
    , sort^#(cons(n, x)) -> sort^#(replace(min(cons(n, x)), n, x)) }
  Weak Trs:
    { eq(0(), 0()) -> true()
    , eq(0(), s(m)) -> false()
    , eq(s(n), 0()) -> false()
    , eq(s(n), s(m)) -> eq(n, m)
    , le(0(), m) -> true()
    , le(s(n), 0()) -> false()
    , le(s(n), s(m)) -> le(n, m)
    , min(cons(n, cons(m, x))) -> if_min(le(n, m), cons(n, cons(m, x)))
    , min(cons(0(), nil())) -> 0()
    , min(cons(s(n), nil())) -> s(n)
    , if_min(true(), cons(n, cons(m, x))) -> min(cons(n, x))
    , if_min(false(), cons(n, cons(m, x))) -> min(cons(m, x))
    , replace(n, m, cons(k, x)) ->
      if_replace(eq(n, k), n, m, cons(k, x))
    , replace(n, m, nil()) -> nil()
    , if_replace(true(), n, m, cons(k, x)) -> cons(m, x)
    , if_replace(false(), n, m, cons(k, x)) ->
      cons(k, replace(n, m, x)) }
  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: min^#(cons(n, cons(m, x))) ->
         c_8(if_min^#(le(n, m), cons(n, cons(m, x))), le^#(n, m))
    , 5: sort^#(cons(n, x)) -> sort^#(replace(min(cons(n, x)), n, x)) }
  Trs:
    { le(0(), m) -> true()
    , le(s(n), s(m)) -> le(n, m) }
  
  Sub-proof:
  ----------
    The following argument positions are usable:
      Uargs(c_8) = {1}, Uargs(c_11) = {1}, Uargs(c_12) = {1}
    
    TcT has computed the following constructor-based matrix
    interpretation satisfying not(EDA).
    
                      [eq](x1, x2) = [0]                  
                                                          
                               [0] = [1]                  
                                                          
                            [true] = [0]                  
                                                          
                           [s](x1) = [1] x1 + [1]         
                                                          
                           [false] = [4]                  
                                                          
                      [le](x1, x2) = [1] x1 + [2] x2 + [1]
                                                          
                         [min](x1) = [0]                  
                                                          
                    [cons](x1, x2) = [1] x2 + [3]         
                                                          
                             [nil] = [0]                  
                                                          
                  [if_min](x1, x2) = [0]                  
                                                          
             [replace](x1, x2, x3) = [1] x3 + [0]         
                                                          
      [if_replace](x1, x2, x3, x4) = [1] x4 + [0]         
                                                          
                    [le^#](x1, x2) = [0]                  
                                                          
                       [min^#](x1) = [1] x1 + [4]         
                                                          
                     [c_8](x1, x2) = [1] x1 + [1] x2 + [0]
                                                          
                [if_min^#](x1, x2) = [1] x2 + [1]         
                                                          
                        [c_11](x1) = [1] x1 + [0]         
                                                          
                        [c_12](x1) = [1] x1 + [0]         
                                                          
                      [sort^#](x1) = [1] x1 + [4]         
    
    The order satisfies the following ordering constraints:
    
                                [eq(0(), 0())] =  [0]                                                       
                                               >= [0]                                                       
                                               =  [true()]                                                  
                                                                                                            
                               [eq(0(), s(m))] =  [0]                                                       
                                               ?  [4]                                                       
                                               =  [false()]                                                 
                                                                                                            
                               [eq(s(n), 0())] =  [0]                                                       
                                               ?  [4]                                                       
                                               =  [false()]                                                 
                                                                                                            
                              [eq(s(n), s(m))] =  [0]                                                       
                                               >= [0]                                                       
                                               =  [eq(n, m)]                                                
                                                                                                            
                                  [le(0(), m)] =  [2] m + [2]                                               
                                               >  [0]                                                       
                                               =  [true()]                                                  
                                                                                                            
                               [le(s(n), 0())] =  [1] n + [4]                                               
                                               >= [4]                                                       
                                               =  [false()]                                                 
                                                                                                            
                              [le(s(n), s(m))] =  [2] m + [1] n + [4]                                       
                                               >  [2] m + [1] n + [1]                                       
                                               =  [le(n, m)]                                                
                                                                                                            
                    [min(cons(n, cons(m, x)))] =  [0]                                                       
                                               >= [0]                                                       
                                               =  [if_min(le(n, m), cons(n, cons(m, x)))]                   
                                                                                                            
                       [min(cons(0(), nil()))] =  [0]                                                       
                                               ?  [1]                                                       
                                               =  [0()]                                                     
                                                                                                            
                      [min(cons(s(n), nil()))] =  [0]                                                       
                                               ?  [1] n + [1]                                               
                                               =  [s(n)]                                                    
                                                                                                            
         [if_min(true(), cons(n, cons(m, x)))] =  [0]                                                       
                                               >= [0]                                                       
                                               =  [min(cons(n, x))]                                         
                                                                                                            
        [if_min(false(), cons(n, cons(m, x)))] =  [0]                                                       
                                               >= [0]                                                       
                                               =  [min(cons(m, x))]                                         
                                                                                                            
                   [replace(n, m, cons(k, x))] =  [1] x + [3]                                               
                                               >= [1] x + [3]                                               
                                               =  [if_replace(eq(n, k), n, m, cons(k, x))]                  
                                                                                                            
                        [replace(n, m, nil())] =  [0]                                                       
                                               >= [0]                                                       
                                               =  [nil()]                                                   
                                                                                                            
        [if_replace(true(), n, m, cons(k, x))] =  [1] x + [3]                                               
                                               >= [1] x + [3]                                               
                                               =  [cons(m, x)]                                              
                                                                                                            
       [if_replace(false(), n, m, cons(k, x))] =  [1] x + [3]                                               
                                               >= [1] x + [3]                                               
                                               =  [cons(k, replace(n, m, x))]                               
                                                                                                            
                  [min^#(cons(n, cons(m, x)))] =  [1] x + [10]                                              
                                               >  [1] x + [7]                                               
                                               =  [c_8(if_min^#(le(n, m), cons(n, cons(m, x))), le^#(n, m))]
                                                                                                            
       [if_min^#(true(), cons(n, cons(m, x)))] =  [1] x + [7]                                               
                                               >= [1] x + [7]                                               
                                               =  [c_11(min^#(cons(n, x)))]                                 
                                                                                                            
      [if_min^#(false(), cons(n, cons(m, x)))] =  [1] x + [7]                                               
                                               >= [1] x + [7]                                               
                                               =  [c_12(min^#(cons(m, x)))]                                 
                                                                                                            
                          [sort^#(cons(n, x))] =  [1] x + [7]                                               
                                               >= [1] x + [7]                                               
                                               =  [min^#(cons(n, x))]                                       
                                                                                                            
                          [sort^#(cons(n, x))] =  [1] x + [7]                                               
                                               >  [1] x + [4]                                               
                                               =  [sort^#(replace(min(cons(n, x)), n, x))]                  
                                                                                                            
  
  We return to the main proof. Consider the set of all dependency
  pairs
  
  :
    { 1: min^#(cons(n, cons(m, x))) ->
         c_8(if_min^#(le(n, m), cons(n, cons(m, x))), le^#(n, m))
    , 2: if_min^#(true(), cons(n, cons(m, x))) ->
         c_11(min^#(cons(n, x)))
    , 3: if_min^#(false(), cons(n, cons(m, x))) ->
         c_12(min^#(cons(m, x)))
    , 4: sort^#(cons(n, x)) -> min^#(cons(n, x))
    , 5: sort^#(cons(n, x)) -> sort^#(replace(min(cons(n, x)), n, x)) }
  
  Processor 'matrix interpretation of dimension 1' induces the
  complexity certificate YES(?,O(n^1)) on application of dependency
  pairs {1,5}. These cover all (indirect) predecessors of dependency
  pairs {1,2,3,4,5}, 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:
    { min^#(cons(n, cons(m, x))) ->
      c_8(if_min^#(le(n, m), cons(n, cons(m, x))), le^#(n, m))
    , if_min^#(true(), cons(n, cons(m, x))) -> c_11(min^#(cons(n, x)))
    , if_min^#(false(), cons(n, cons(m, x))) -> c_12(min^#(cons(m, x)))
    , sort^#(cons(n, x)) -> min^#(cons(n, x))
    , sort^#(cons(n, x)) -> sort^#(replace(min(cons(n, x)), n, x)) }
  Weak Trs:
    { eq(0(), 0()) -> true()
    , eq(0(), s(m)) -> false()
    , eq(s(n), 0()) -> false()
    , eq(s(n), s(m)) -> eq(n, m)
    , le(0(), m) -> true()
    , le(s(n), 0()) -> false()
    , le(s(n), s(m)) -> le(n, m)
    , min(cons(n, cons(m, x))) -> if_min(le(n, m), cons(n, cons(m, x)))
    , min(cons(0(), nil())) -> 0()
    , min(cons(s(n), nil())) -> s(n)
    , if_min(true(), cons(n, cons(m, x))) -> min(cons(n, x))
    , if_min(false(), cons(n, cons(m, x))) -> min(cons(m, x))
    , replace(n, m, cons(k, x)) ->
      if_replace(eq(n, k), n, m, cons(k, x))
    , replace(n, m, nil()) -> nil()
    , if_replace(true(), n, m, cons(k, x)) -> cons(m, x)
    , if_replace(false(), n, m, cons(k, x)) ->
      cons(k, replace(n, m, x)) }
  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.
  
  { min^#(cons(n, cons(m, x))) ->
    c_8(if_min^#(le(n, m), cons(n, cons(m, x))), le^#(n, m))
  , if_min^#(true(), cons(n, cons(m, x))) -> c_11(min^#(cons(n, x)))
  , if_min^#(false(), cons(n, cons(m, x))) -> c_12(min^#(cons(m, x)))
  , sort^#(cons(n, x)) -> min^#(cons(n, x))
  , sort^#(cons(n, x)) -> sort^#(replace(min(cons(n, x)), n, x)) }
  
  We are left with following problem, upon which TcT provides the
  certificate YES(O(1),O(1)).
  
  Weak Trs:
    { eq(0(), 0()) -> true()
    , eq(0(), s(m)) -> false()
    , eq(s(n), 0()) -> false()
    , eq(s(n), s(m)) -> eq(n, m)
    , le(0(), m) -> true()
    , le(s(n), 0()) -> false()
    , le(s(n), s(m)) -> le(n, m)
    , min(cons(n, cons(m, x))) -> if_min(le(n, m), cons(n, cons(m, x)))
    , min(cons(0(), nil())) -> 0()
    , min(cons(s(n), nil())) -> s(n)
    , if_min(true(), cons(n, cons(m, x))) -> min(cons(n, x))
    , if_min(false(), cons(n, cons(m, x))) -> min(cons(m, x))
    , replace(n, m, cons(k, x)) ->
      if_replace(eq(n, k), n, m, cons(k, x))
    , replace(n, m, nil()) -> nil()
    , if_replace(true(), n, m, cons(k, x)) -> cons(m, x)
    , if_replace(false(), n, m, cons(k, x)) ->
      cons(k, replace(n, m, x)) }
  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: { le^#(s(n), s(m)) -> c_7(le^#(n, m)) }
Weak DPs:
  { min^#(cons(n, cons(m, x))) -> le^#(n, m)
  , min^#(cons(n, cons(m, x))) ->
    if_min^#(le(n, m), cons(n, cons(m, x)))
  , if_min^#(true(), cons(n, cons(m, x))) -> min^#(cons(n, x))
  , if_min^#(false(), cons(n, cons(m, x))) -> min^#(cons(m, x))
  , sort^#(cons(n, x)) -> min^#(cons(n, x))
  , sort^#(cons(n, x)) -> sort^#(replace(min(cons(n, x)), n, x)) }
Weak Trs:
  { eq(0(), 0()) -> true()
  , eq(0(), s(m)) -> false()
  , eq(s(n), 0()) -> false()
  , eq(s(n), s(m)) -> eq(n, m)
  , le(0(), m) -> true()
  , le(s(n), 0()) -> false()
  , le(s(n), s(m)) -> le(n, m)
  , min(cons(n, cons(m, x))) -> if_min(le(n, m), cons(n, cons(m, x)))
  , min(cons(0(), nil())) -> 0()
  , min(cons(s(n), nil())) -> s(n)
  , if_min(true(), cons(n, cons(m, x))) -> min(cons(n, x))
  , if_min(false(), cons(n, cons(m, x))) -> min(cons(m, x))
  , replace(n, m, cons(k, x)) ->
    if_replace(eq(n, k), n, m, cons(k, x))
  , replace(n, m, nil()) -> nil()
  , if_replace(true(), n, m, cons(k, x)) -> cons(m, x)
  , if_replace(false(), n, m, cons(k, x)) ->
    cons(k, replace(n, m, x)) }
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: le^#(s(n), s(m)) -> c_7(le^#(n, m)) }

Sub-proof:
----------
  The following argument positions are usable:
    Uargs(c_7) = {1}
  
  TcT has computed the following constructor-based matrix
  interpretation satisfying not(EDA).
  
                    [eq](x1, x2) = [0]                  
                                                        
                             [0] = [0]                  
                                                        
                          [true] = [0]                  
                                                        
                         [s](x1) = [1] x1 + [4]         
                                                        
                         [false] = [0]                  
                                                        
                    [le](x1, x2) = [0]                  
                                                        
                       [min](x1) = [0]                  
                                                        
                  [cons](x1, x2) = [1] x1 + [1] x2 + [0]
                                                        
                           [nil] = [0]                  
                                                        
                [if_min](x1, x2) = [0]                  
                                                        
           [replace](x1, x2, x3) = [1] x2 + [1] x3 + [0]
                                                        
    [if_replace](x1, x2, x3, x4) = [1] x3 + [1] x4 + [0]
                                                        
                  [le^#](x1, x2) = [1] x2 + [2]         
                                                        
                       [c_7](x1) = [1] x1 + [0]         
                                                        
                     [min^#](x1) = [2] x1 + [2]         
                                                        
              [if_min^#](x1, x2) = [2] x2 + [2]         
                                                        
                    [sort^#](x1) = [2] x1 + [2]         
  
  The order satisfies the following ordering constraints:
  
                              [eq(0(), 0())] =  [0]                                      
                                             >= [0]                                      
                                             =  [true()]                                 
                                                                                         
                             [eq(0(), s(m))] =  [0]                                      
                                             >= [0]                                      
                                             =  [false()]                                
                                                                                         
                             [eq(s(n), 0())] =  [0]                                      
                                             >= [0]                                      
                                             =  [false()]                                
                                                                                         
                            [eq(s(n), s(m))] =  [0]                                      
                                             >= [0]                                      
                                             =  [eq(n, m)]                               
                                                                                         
                                [le(0(), m)] =  [0]                                      
                                             >= [0]                                      
                                             =  [true()]                                 
                                                                                         
                             [le(s(n), 0())] =  [0]                                      
                                             >= [0]                                      
                                             =  [false()]                                
                                                                                         
                            [le(s(n), s(m))] =  [0]                                      
                                             >= [0]                                      
                                             =  [le(n, m)]                               
                                                                                         
                  [min(cons(n, cons(m, x)))] =  [0]                                      
                                             >= [0]                                      
                                             =  [if_min(le(n, m), cons(n, cons(m, x)))]  
                                                                                         
                     [min(cons(0(), nil()))] =  [0]                                      
                                             >= [0]                                      
                                             =  [0()]                                    
                                                                                         
                    [min(cons(s(n), nil()))] =  [0]                                      
                                             ?  [1] n + [4]                              
                                             =  [s(n)]                                   
                                                                                         
       [if_min(true(), cons(n, cons(m, x)))] =  [0]                                      
                                             >= [0]                                      
                                             =  [min(cons(n, x))]                        
                                                                                         
      [if_min(false(), cons(n, cons(m, x)))] =  [0]                                      
                                             >= [0]                                      
                                             =  [min(cons(m, x))]                        
                                                                                         
                 [replace(n, m, cons(k, x))] =  [1] m + [1] x + [1] k + [0]              
                                             >= [1] m + [1] x + [1] k + [0]              
                                             =  [if_replace(eq(n, k), n, m, cons(k, x))] 
                                                                                         
                      [replace(n, m, nil())] =  [1] m + [0]                              
                                             >= [0]                                      
                                             =  [nil()]                                  
                                                                                         
      [if_replace(true(), n, m, cons(k, x))] =  [1] m + [1] x + [1] k + [0]              
                                             >= [1] m + [1] x + [0]                      
                                             =  [cons(m, x)]                             
                                                                                         
     [if_replace(false(), n, m, cons(k, x))] =  [1] m + [1] x + [1] k + [0]              
                                             >= [1] m + [1] x + [1] k + [0]              
                                             =  [cons(k, replace(n, m, x))]              
                                                                                         
                          [le^#(s(n), s(m))] =  [1] m + [6]                              
                                             >  [1] m + [2]                              
                                             =  [c_7(le^#(n, m))]                        
                                                                                         
                [min^#(cons(n, cons(m, x)))] =  [2] m + [2] n + [2] x + [2]              
                                             >= [1] m + [2]                              
                                             =  [le^#(n, m)]                             
                                                                                         
                [min^#(cons(n, cons(m, x)))] =  [2] m + [2] n + [2] x + [2]              
                                             >= [2] m + [2] n + [2] x + [2]              
                                             =  [if_min^#(le(n, m), cons(n, cons(m, x)))]
                                                                                         
     [if_min^#(true(), cons(n, cons(m, x)))] =  [2] m + [2] n + [2] x + [2]              
                                             >= [2] n + [2] x + [2]                      
                                             =  [min^#(cons(n, x))]                      
                                                                                         
    [if_min^#(false(), cons(n, cons(m, x)))] =  [2] m + [2] n + [2] x + [2]              
                                             >= [2] m + [2] x + [2]                      
                                             =  [min^#(cons(m, x))]                      
                                                                                         
                        [sort^#(cons(n, x))] =  [2] n + [2] x + [2]                      
                                             >= [2] n + [2] x + [2]                      
                                             =  [min^#(cons(n, x))]                      
                                                                                         
                        [sort^#(cons(n, x))] =  [2] n + [2] x + [2]                      
                                             >= [2] n + [2] x + [2]                      
                                             =  [sort^#(replace(min(cons(n, x)), n, x))] 
                                                                                         

The strictly oriented rules are moved into the weak component.

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

Weak DPs:
  { le^#(s(n), s(m)) -> c_7(le^#(n, m))
  , min^#(cons(n, cons(m, x))) -> le^#(n, m)
  , min^#(cons(n, cons(m, x))) ->
    if_min^#(le(n, m), cons(n, cons(m, x)))
  , if_min^#(true(), cons(n, cons(m, x))) -> min^#(cons(n, x))
  , if_min^#(false(), cons(n, cons(m, x))) -> min^#(cons(m, x))
  , sort^#(cons(n, x)) -> min^#(cons(n, x))
  , sort^#(cons(n, x)) -> sort^#(replace(min(cons(n, x)), n, x)) }
Weak Trs:
  { eq(0(), 0()) -> true()
  , eq(0(), s(m)) -> false()
  , eq(s(n), 0()) -> false()
  , eq(s(n), s(m)) -> eq(n, m)
  , le(0(), m) -> true()
  , le(s(n), 0()) -> false()
  , le(s(n), s(m)) -> le(n, m)
  , min(cons(n, cons(m, x))) -> if_min(le(n, m), cons(n, cons(m, x)))
  , min(cons(0(), nil())) -> 0()
  , min(cons(s(n), nil())) -> s(n)
  , if_min(true(), cons(n, cons(m, x))) -> min(cons(n, x))
  , if_min(false(), cons(n, cons(m, x))) -> min(cons(m, x))
  , replace(n, m, cons(k, x)) ->
    if_replace(eq(n, k), n, m, cons(k, x))
  , replace(n, m, nil()) -> nil()
  , if_replace(true(), n, m, cons(k, x)) -> cons(m, x)
  , if_replace(false(), n, m, cons(k, x)) ->
    cons(k, replace(n, m, x)) }
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.

{ le^#(s(n), s(m)) -> c_7(le^#(n, m))
, min^#(cons(n, cons(m, x))) -> le^#(n, m)
, min^#(cons(n, cons(m, x))) ->
  if_min^#(le(n, m), cons(n, cons(m, x)))
, if_min^#(true(), cons(n, cons(m, x))) -> min^#(cons(n, x))
, if_min^#(false(), cons(n, cons(m, x))) -> min^#(cons(m, x))
, sort^#(cons(n, x)) -> min^#(cons(n, x))
, sort^#(cons(n, x)) -> sort^#(replace(min(cons(n, x)), n, x)) }

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

Weak Trs:
  { eq(0(), 0()) -> true()
  , eq(0(), s(m)) -> false()
  , eq(s(n), 0()) -> false()
  , eq(s(n), s(m)) -> eq(n, m)
  , le(0(), m) -> true()
  , le(s(n), 0()) -> false()
  , le(s(n), s(m)) -> le(n, m)
  , min(cons(n, cons(m, x))) -> if_min(le(n, m), cons(n, cons(m, x)))
  , min(cons(0(), nil())) -> 0()
  , min(cons(s(n), nil())) -> s(n)
  , if_min(true(), cons(n, cons(m, x))) -> min(cons(n, x))
  , if_min(false(), cons(n, cons(m, x))) -> min(cons(m, x))
  , replace(n, m, cons(k, x)) ->
    if_replace(eq(n, k), n, m, cons(k, x))
  , replace(n, m, nil()) -> nil()
  , if_replace(true(), n, m, cons(k, x)) -> cons(m, x)
  , if_replace(false(), n, m, cons(k, x)) ->
    cons(k, replace(n, m, x)) }
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^3))