MAYBE

We are left with following problem, upon which TcT provides the
certificate MAYBE.

Strict Trs:
  { isEmpty(empty()) -> true()
  , isEmpty(node(l, r)) -> false()
  , left(empty()) -> empty()
  , left(node(l, r)) -> l
  , right(empty()) -> empty()
  , right(node(l, r)) -> r
  , inc(0()) -> s(0())
  , inc(s(x)) -> s(inc(x))
  , count(n, x) ->
    if(isEmpty(n),
       isEmpty(left(n)),
       right(n),
       node(left(left(n)), node(right(left(n)), right(n))),
       x,
       inc(x))
  , if(true(), b, n, m, x, y) -> x
  , if(false(), true(), n, m, x, y) -> count(n, y)
  , if(false(), false(), n, m, x, y) -> count(m, x)
  , nrOfNodes(n) -> count(n, 0()) }
Obligation:
  innermost runtime complexity
Answer:
  MAYBE

We add following dependency tuples:

Strict DPs:
  { isEmpty^#(empty()) -> c_1()
  , isEmpty^#(node(l, r)) -> c_2()
  , left^#(empty()) -> c_3()
  , left^#(node(l, r)) -> c_4()
  , right^#(empty()) -> c_5()
  , right^#(node(l, r)) -> c_6()
  , inc^#(0()) -> c_7()
  , inc^#(s(x)) -> c_8(inc^#(x))
  , count^#(n, x) ->
    c_9(if^#(isEmpty(n),
             isEmpty(left(n)),
             right(n),
             node(left(left(n)), node(right(left(n)), right(n))),
             x,
             inc(x)),
        isEmpty^#(n),
        isEmpty^#(left(n)),
        left^#(n),
        right^#(n),
        left^#(left(n)),
        left^#(n),
        right^#(left(n)),
        left^#(n),
        right^#(n),
        inc^#(x))
  , if^#(true(), b, n, m, x, y) -> c_10()
  , if^#(false(), true(), n, m, x, y) -> c_11(count^#(n, y))
  , if^#(false(), false(), n, m, x, y) -> c_12(count^#(m, x))
  , nrOfNodes^#(n) -> c_13(count^#(n, 0())) }

and mark the set of starting terms.

We are left with following problem, upon which TcT provides the
certificate MAYBE.

Strict DPs:
  { isEmpty^#(empty()) -> c_1()
  , isEmpty^#(node(l, r)) -> c_2()
  , left^#(empty()) -> c_3()
  , left^#(node(l, r)) -> c_4()
  , right^#(empty()) -> c_5()
  , right^#(node(l, r)) -> c_6()
  , inc^#(0()) -> c_7()
  , inc^#(s(x)) -> c_8(inc^#(x))
  , count^#(n, x) ->
    c_9(if^#(isEmpty(n),
             isEmpty(left(n)),
             right(n),
             node(left(left(n)), node(right(left(n)), right(n))),
             x,
             inc(x)),
        isEmpty^#(n),
        isEmpty^#(left(n)),
        left^#(n),
        right^#(n),
        left^#(left(n)),
        left^#(n),
        right^#(left(n)),
        left^#(n),
        right^#(n),
        inc^#(x))
  , if^#(true(), b, n, m, x, y) -> c_10()
  , if^#(false(), true(), n, m, x, y) -> c_11(count^#(n, y))
  , if^#(false(), false(), n, m, x, y) -> c_12(count^#(m, x))
  , nrOfNodes^#(n) -> c_13(count^#(n, 0())) }
Weak Trs:
  { isEmpty(empty()) -> true()
  , isEmpty(node(l, r)) -> false()
  , left(empty()) -> empty()
  , left(node(l, r)) -> l
  , right(empty()) -> empty()
  , right(node(l, r)) -> r
  , inc(0()) -> s(0())
  , inc(s(x)) -> s(inc(x))
  , count(n, x) ->
    if(isEmpty(n),
       isEmpty(left(n)),
       right(n),
       node(left(left(n)), node(right(left(n)), right(n))),
       x,
       inc(x))
  , if(true(), b, n, m, x, y) -> x
  , if(false(), true(), n, m, x, y) -> count(n, y)
  , if(false(), false(), n, m, x, y) -> count(m, x)
  , nrOfNodes(n) -> count(n, 0()) }
Obligation:
  innermost runtime complexity
Answer:
  MAYBE

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

  DPs:
    { 1: isEmpty^#(empty()) -> c_1()
    , 2: isEmpty^#(node(l, r)) -> c_2()
    , 3: left^#(empty()) -> c_3()
    , 4: left^#(node(l, r)) -> c_4()
    , 5: right^#(empty()) -> c_5()
    , 6: right^#(node(l, r)) -> c_6()
    , 7: inc^#(0()) -> c_7()
    , 8: inc^#(s(x)) -> c_8(inc^#(x))
    , 9: count^#(n, x) ->
         c_9(if^#(isEmpty(n),
                  isEmpty(left(n)),
                  right(n),
                  node(left(left(n)), node(right(left(n)), right(n))),
                  x,
                  inc(x)),
             isEmpty^#(n),
             isEmpty^#(left(n)),
             left^#(n),
             right^#(n),
             left^#(left(n)),
             left^#(n),
             right^#(left(n)),
             left^#(n),
             right^#(n),
             inc^#(x))
    , 10: if^#(true(), b, n, m, x, y) -> c_10()
    , 11: if^#(false(), true(), n, m, x, y) -> c_11(count^#(n, y))
    , 12: if^#(false(), false(), n, m, x, y) -> c_12(count^#(m, x))
    , 13: nrOfNodes^#(n) -> c_13(count^#(n, 0())) }

We are left with following problem, upon which TcT provides the
certificate MAYBE.

Strict DPs:
  { inc^#(s(x)) -> c_8(inc^#(x))
  , count^#(n, x) ->
    c_9(if^#(isEmpty(n),
             isEmpty(left(n)),
             right(n),
             node(left(left(n)), node(right(left(n)), right(n))),
             x,
             inc(x)),
        isEmpty^#(n),
        isEmpty^#(left(n)),
        left^#(n),
        right^#(n),
        left^#(left(n)),
        left^#(n),
        right^#(left(n)),
        left^#(n),
        right^#(n),
        inc^#(x))
  , if^#(false(), true(), n, m, x, y) -> c_11(count^#(n, y))
  , if^#(false(), false(), n, m, x, y) -> c_12(count^#(m, x))
  , nrOfNodes^#(n) -> c_13(count^#(n, 0())) }
Weak DPs:
  { isEmpty^#(empty()) -> c_1()
  , isEmpty^#(node(l, r)) -> c_2()
  , left^#(empty()) -> c_3()
  , left^#(node(l, r)) -> c_4()
  , right^#(empty()) -> c_5()
  , right^#(node(l, r)) -> c_6()
  , inc^#(0()) -> c_7()
  , if^#(true(), b, n, m, x, y) -> c_10() }
Weak Trs:
  { isEmpty(empty()) -> true()
  , isEmpty(node(l, r)) -> false()
  , left(empty()) -> empty()
  , left(node(l, r)) -> l
  , right(empty()) -> empty()
  , right(node(l, r)) -> r
  , inc(0()) -> s(0())
  , inc(s(x)) -> s(inc(x))
  , count(n, x) ->
    if(isEmpty(n),
       isEmpty(left(n)),
       right(n),
       node(left(left(n)), node(right(left(n)), right(n))),
       x,
       inc(x))
  , if(true(), b, n, m, x, y) -> x
  , if(false(), true(), n, m, x, y) -> count(n, y)
  , if(false(), false(), n, m, x, y) -> count(m, x)
  , nrOfNodes(n) -> count(n, 0()) }
Obligation:
  innermost runtime complexity
Answer:
  MAYBE

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

{ isEmpty^#(empty()) -> c_1()
, isEmpty^#(node(l, r)) -> c_2()
, left^#(empty()) -> c_3()
, left^#(node(l, r)) -> c_4()
, right^#(empty()) -> c_5()
, right^#(node(l, r)) -> c_6()
, inc^#(0()) -> c_7()
, if^#(true(), b, n, m, x, y) -> c_10() }

We are left with following problem, upon which TcT provides the
certificate MAYBE.

Strict DPs:
  { inc^#(s(x)) -> c_8(inc^#(x))
  , count^#(n, x) ->
    c_9(if^#(isEmpty(n),
             isEmpty(left(n)),
             right(n),
             node(left(left(n)), node(right(left(n)), right(n))),
             x,
             inc(x)),
        isEmpty^#(n),
        isEmpty^#(left(n)),
        left^#(n),
        right^#(n),
        left^#(left(n)),
        left^#(n),
        right^#(left(n)),
        left^#(n),
        right^#(n),
        inc^#(x))
  , if^#(false(), true(), n, m, x, y) -> c_11(count^#(n, y))
  , if^#(false(), false(), n, m, x, y) -> c_12(count^#(m, x))
  , nrOfNodes^#(n) -> c_13(count^#(n, 0())) }
Weak Trs:
  { isEmpty(empty()) -> true()
  , isEmpty(node(l, r)) -> false()
  , left(empty()) -> empty()
  , left(node(l, r)) -> l
  , right(empty()) -> empty()
  , right(node(l, r)) -> r
  , inc(0()) -> s(0())
  , inc(s(x)) -> s(inc(x))
  , count(n, x) ->
    if(isEmpty(n),
       isEmpty(left(n)),
       right(n),
       node(left(left(n)), node(right(left(n)), right(n))),
       x,
       inc(x))
  , if(true(), b, n, m, x, y) -> x
  , if(false(), true(), n, m, x, y) -> count(n, y)
  , if(false(), false(), n, m, x, y) -> count(m, x)
  , nrOfNodes(n) -> count(n, 0()) }
Obligation:
  innermost runtime complexity
Answer:
  MAYBE

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

  { count^#(n, x) ->
    c_9(if^#(isEmpty(n),
             isEmpty(left(n)),
             right(n),
             node(left(left(n)), node(right(left(n)), right(n))),
             x,
             inc(x)),
        isEmpty^#(n),
        isEmpty^#(left(n)),
        left^#(n),
        right^#(n),
        left^#(left(n)),
        left^#(n),
        right^#(left(n)),
        left^#(n),
        right^#(n),
        inc^#(x)) }

We are left with following problem, upon which TcT provides the
certificate MAYBE.

Strict DPs:
  { inc^#(s(x)) -> c_1(inc^#(x))
  , count^#(n, x) ->
    c_2(if^#(isEmpty(n),
             isEmpty(left(n)),
             right(n),
             node(left(left(n)), node(right(left(n)), right(n))),
             x,
             inc(x)),
        inc^#(x))
  , if^#(false(), true(), n, m, x, y) -> c_3(count^#(n, y))
  , if^#(false(), false(), n, m, x, y) -> c_4(count^#(m, x))
  , nrOfNodes^#(n) -> c_5(count^#(n, 0())) }
Weak Trs:
  { isEmpty(empty()) -> true()
  , isEmpty(node(l, r)) -> false()
  , left(empty()) -> empty()
  , left(node(l, r)) -> l
  , right(empty()) -> empty()
  , right(node(l, r)) -> r
  , inc(0()) -> s(0())
  , inc(s(x)) -> s(inc(x))
  , count(n, x) ->
    if(isEmpty(n),
       isEmpty(left(n)),
       right(n),
       node(left(left(n)), node(right(left(n)), right(n))),
       x,
       inc(x))
  , if(true(), b, n, m, x, y) -> x
  , if(false(), true(), n, m, x, y) -> count(n, y)
  , if(false(), false(), n, m, x, y) -> count(m, x)
  , nrOfNodes(n) -> count(n, 0()) }
Obligation:
  innermost runtime complexity
Answer:
  MAYBE

We replace rewrite rules by usable rules:

  Weak Usable Rules:
    { isEmpty(empty()) -> true()
    , isEmpty(node(l, r)) -> false()
    , left(empty()) -> empty()
    , left(node(l, r)) -> l
    , right(empty()) -> empty()
    , right(node(l, r)) -> r
    , inc(0()) -> s(0())
    , inc(s(x)) -> s(inc(x)) }

We are left with following problem, upon which TcT provides the
certificate MAYBE.

Strict DPs:
  { inc^#(s(x)) -> c_1(inc^#(x))
  , count^#(n, x) ->
    c_2(if^#(isEmpty(n),
             isEmpty(left(n)),
             right(n),
             node(left(left(n)), node(right(left(n)), right(n))),
             x,
             inc(x)),
        inc^#(x))
  , if^#(false(), true(), n, m, x, y) -> c_3(count^#(n, y))
  , if^#(false(), false(), n, m, x, y) -> c_4(count^#(m, x))
  , nrOfNodes^#(n) -> c_5(count^#(n, 0())) }
Weak Trs:
  { isEmpty(empty()) -> true()
  , isEmpty(node(l, r)) -> false()
  , left(empty()) -> empty()
  , left(node(l, r)) -> l
  , right(empty()) -> empty()
  , right(node(l, r)) -> r
  , inc(0()) -> s(0())
  , inc(s(x)) -> s(inc(x)) }
Obligation:
  innermost runtime complexity
Answer:
  MAYBE

Consider the dependency graph

  1: inc^#(s(x)) -> c_1(inc^#(x))
     -->_1 inc^#(s(x)) -> c_1(inc^#(x)) :1
  
  2: count^#(n, x) ->
     c_2(if^#(isEmpty(n),
              isEmpty(left(n)),
              right(n),
              node(left(left(n)), node(right(left(n)), right(n))),
              x,
              inc(x)),
         inc^#(x))
     -->_1 if^#(false(), false(), n, m, x, y) -> c_4(count^#(m, x)) :4
     -->_1 if^#(false(), true(), n, m, x, y) -> c_3(count^#(n, y)) :3
     -->_2 inc^#(s(x)) -> c_1(inc^#(x)) :1
  
  3: if^#(false(), true(), n, m, x, y) -> c_3(count^#(n, y))
     -->_1 count^#(n, x) ->
           c_2(if^#(isEmpty(n),
                    isEmpty(left(n)),
                    right(n),
                    node(left(left(n)), node(right(left(n)), right(n))),
                    x,
                    inc(x)),
               inc^#(x)) :2
  
  4: if^#(false(), false(), n, m, x, y) -> c_4(count^#(m, x))
     -->_1 count^#(n, x) ->
           c_2(if^#(isEmpty(n),
                    isEmpty(left(n)),
                    right(n),
                    node(left(left(n)), node(right(left(n)), right(n))),
                    x,
                    inc(x)),
               inc^#(x)) :2
  
  5: nrOfNodes^#(n) -> c_5(count^#(n, 0()))
     -->_1 count^#(n, x) ->
           c_2(if^#(isEmpty(n),
                    isEmpty(left(n)),
                    right(n),
                    node(left(left(n)), node(right(left(n)), right(n))),
                    x,
                    inc(x)),
               inc^#(x)) :2
  

Following roots of the dependency graph are removed, as the
considered set of starting terms is closed under reduction with
respect to these rules (modulo compound contexts).

  { nrOfNodes^#(n) -> c_5(count^#(n, 0())) }


We are left with following problem, upon which TcT provides the
certificate MAYBE.

Strict DPs:
  { inc^#(s(x)) -> c_1(inc^#(x))
  , count^#(n, x) ->
    c_2(if^#(isEmpty(n),
             isEmpty(left(n)),
             right(n),
             node(left(left(n)), node(right(left(n)), right(n))),
             x,
             inc(x)),
        inc^#(x))
  , if^#(false(), true(), n, m, x, y) -> c_3(count^#(n, y))
  , if^#(false(), false(), n, m, x, y) -> c_4(count^#(m, x)) }
Weak Trs:
  { isEmpty(empty()) -> true()
  , isEmpty(node(l, r)) -> false()
  , left(empty()) -> empty()
  , left(node(l, r)) -> l
  , right(empty()) -> empty()
  , right(node(l, r)) -> r
  , inc(0()) -> s(0())
  , inc(s(x)) -> s(inc(x)) }
Obligation:
  innermost runtime complexity
Answer:
  MAYBE

The input cannot be shown compatible

Arrrr..