We consider the following Problem:

  Strict Trs:
    {  a(f(), a(f(), x)) -> a(x, g())
     , a(x, g()) -> a(f(), a(g(), a(f(), x)))}
  StartTerms: basic terms
  Strategy: innermost

Certificate: YES(?,O(n^1))

Proof:
  We consider the following Problem:
  
    Strict Trs:
      {  a(f(), a(f(), x)) -> a(x, g())
       , a(x, g()) -> a(f(), a(g(), a(f(), x)))}
    StartTerms: basic terms
    Strategy: innermost
  
  Certificate: YES(?,O(n^1))
  
  Proof:
    The weightgap principle applies, where following rules are oriented strictly:
    
    TRS Component: {a(f(), a(f(), x)) -> a(x, g())}
    
    Interpretation of nonconstant growth:
    -------------------------------------
      The following argument positions are usable:
        Uargs(a) = {2}
      We have the following EDA-non-satisfying and IDA(1)-non-satisfying matrix interpretation:
      Interpretation Functions:
       a(x1, x2) = [1 0] x1 + [1 0] x2 + [2]
                   [0 0]      [0 1]      [1]
       f() = [0]
             [0]
       g() = [0]
             [0]
    
    The strictly oriented rules are moved into the weak component.
    
    We consider the following Problem:
    
      Strict Trs: {a(x, g()) -> a(f(), a(g(), a(f(), x)))}
      Weak Trs: {a(f(), a(f(), x)) -> a(x, g())}
      StartTerms: basic terms
      Strategy: innermost
    
    Certificate: YES(?,O(n^1))
    
    Proof:
      We consider the following Problem:
      
        Strict Trs: {a(x, g()) -> a(f(), a(g(), a(f(), x)))}
        Weak Trs: {a(f(), a(f(), x)) -> a(x, g())}
        StartTerms: basic terms
        Strategy: innermost
      
      Certificate: YES(?,O(n^1))
      
      Proof:
        The problem is match-bounded by 1.
        The enriched problem is compatible with the following automaton:
        {  a_0(2, 2) -> 1
         , a_1(3, 4) -> 1
         , a_1(5, 6) -> 4
         , a_1(5, 8) -> 2
         , a_1(7, 2) -> 6
         , a_1(7, 7) -> 8
         , f_0() -> 2
         , f_1() -> 3
         , f_1() -> 7
         , g_0() -> 2
         , g_1() -> 5}

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