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

Strict Trs:
  { a__terms(N) -> cons(recip(a__sqr(mark(N))), terms(s(N)))
  , a__terms(X) -> terms(X)
  , a__sqr(X) -> sqr(X)
  , a__sqr(s(X)) -> s(add(sqr(X), dbl(X)))
  , a__sqr(0()) -> 0()
  , mark(cons(X1, X2)) -> cons(mark(X1), X2)
  , mark(recip(X)) -> recip(mark(X))
  , mark(terms(X)) -> a__terms(mark(X))
  , mark(s(X)) -> s(X)
  , mark(0()) -> 0()
  , mark(add(X1, X2)) -> a__add(mark(X1), mark(X2))
  , mark(sqr(X)) -> a__sqr(mark(X))
  , mark(dbl(X)) -> a__dbl(mark(X))
  , mark(nil()) -> nil()
  , mark(first(X1, X2)) -> a__first(mark(X1), mark(X2))
  , a__dbl(X) -> dbl(X)
  , a__dbl(s(X)) -> s(s(dbl(X)))
  , a__dbl(0()) -> 0()
  , a__add(X1, X2) -> add(X1, X2)
  , a__add(s(X), Y) -> s(add(X, Y))
  , a__add(0(), X) -> mark(X)
  , a__first(X1, X2) -> first(X1, X2)
  , a__first(s(X), cons(Y, Z)) -> cons(mark(Y), first(X, Z))
  , a__first(0(), X) -> nil() }
Obligation:
  innermost runtime complexity
Answer:
  YES(O(1),O(n^2))

The weightgap principle applies (using the following nonconstant
growth matrix-interpretation)

The following argument positions are usable:
  Uargs(a__terms) = {1}, Uargs(cons) = {1}, Uargs(recip) = {1},
  Uargs(a__sqr) = {1}, Uargs(a__dbl) = {1}, Uargs(a__add) = {1, 2},
  Uargs(a__first) = {1, 2}

TcT has computed the following matrix interpretation satisfying
not(EDA) and not(IDA(1)).

      [a__terms](x1) = [1] x1 + [4]         
                                            
      [cons](x1, x2) = [1] x1 + [0]         
                                            
         [recip](x1) = [1] x1 + [0]         
                                            
        [a__sqr](x1) = [1] x1 + [0]         
                                            
          [mark](x1) = [0]                  
                                            
         [terms](x1) = [1] x1 + [0]         
                                            
             [s](x1) = [0]                  
                                            
                 [0] = [0]                  
                                            
       [add](x1, x2) = [0]                  
                                            
           [sqr](x1) = [1] x1 + [0]         
                                            
           [dbl](x1) = [0]                  
                                            
        [a__dbl](x1) = [1] x1 + [0]         
                                            
    [a__add](x1, x2) = [1] x1 + [1] x2 + [0]
                                            
  [a__first](x1, x2) = [1] x1 + [1] x2 + [0]
                                            
               [nil] = [0]                  
                                            
     [first](x1, x2) = [0]                  

The order satisfies the following ordering constraints:

                 [a__terms(N)] =  [1] N + [4]                                
                               >  [0]                                        
                               =  [cons(recip(a__sqr(mark(N))), terms(s(N)))]
                                                                             
                 [a__terms(X)] =  [1] X + [4]                                
                               >  [1] X + [0]                                
                               =  [terms(X)]                                 
                                                                             
                   [a__sqr(X)] =  [1] X + [0]                                
                               >= [1] X + [0]                                
                               =  [sqr(X)]                                   
                                                                             
                [a__sqr(s(X))] =  [0]                                        
                               >= [0]                                        
                               =  [s(add(sqr(X), dbl(X)))]                   
                                                                             
                 [a__sqr(0())] =  [0]                                        
                               >= [0]                                        
                               =  [0()]                                      
                                                                             
          [mark(cons(X1, X2))] =  [0]                                        
                               >= [0]                                        
                               =  [cons(mark(X1), X2)]                       
                                                                             
              [mark(recip(X))] =  [0]                                        
                               >= [0]                                        
                               =  [recip(mark(X))]                           
                                                                             
              [mark(terms(X))] =  [0]                                        
                               ?  [4]                                        
                               =  [a__terms(mark(X))]                        
                                                                             
                  [mark(s(X))] =  [0]                                        
                               >= [0]                                        
                               =  [s(X)]                                     
                                                                             
                   [mark(0())] =  [0]                                        
                               >= [0]                                        
                               =  [0()]                                      
                                                                             
           [mark(add(X1, X2))] =  [0]                                        
                               >= [0]                                        
                               =  [a__add(mark(X1), mark(X2))]               
                                                                             
                [mark(sqr(X))] =  [0]                                        
                               >= [0]                                        
                               =  [a__sqr(mark(X))]                          
                                                                             
                [mark(dbl(X))] =  [0]                                        
                               >= [0]                                        
                               =  [a__dbl(mark(X))]                          
                                                                             
                 [mark(nil())] =  [0]                                        
                               >= [0]                                        
                               =  [nil()]                                    
                                                                             
         [mark(first(X1, X2))] =  [0]                                        
                               >= [0]                                        
                               =  [a__first(mark(X1), mark(X2))]             
                                                                             
                   [a__dbl(X)] =  [1] X + [0]                                
                               >= [0]                                        
                               =  [dbl(X)]                                   
                                                                             
                [a__dbl(s(X))] =  [0]                                        
                               >= [0]                                        
                               =  [s(s(dbl(X)))]                             
                                                                             
                 [a__dbl(0())] =  [0]                                        
                               >= [0]                                        
                               =  [0()]                                      
                                                                             
              [a__add(X1, X2)] =  [1] X1 + [1] X2 + [0]                      
                               >= [0]                                        
                               =  [add(X1, X2)]                              
                                                                             
             [a__add(s(X), Y)] =  [1] Y + [0]                                
                               >= [0]                                        
                               =  [s(add(X, Y))]                             
                                                                             
              [a__add(0(), X)] =  [1] X + [0]                                
                               >= [0]                                        
                               =  [mark(X)]                                  
                                                                             
            [a__first(X1, X2)] =  [1] X1 + [1] X2 + [0]                      
                               >= [0]                                        
                               =  [first(X1, X2)]                            
                                                                             
  [a__first(s(X), cons(Y, Z))] =  [1] Y + [0]                                
                               >= [0]                                        
                               =  [cons(mark(Y), first(X, Z))]               
                                                                             
            [a__first(0(), X)] =  [1] X + [0]                                
                               >= [0]                                        
                               =  [nil()]                                    
                                                                             

Further, it can be verified that all rules not oriented are covered by the weightgap condition.

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

Strict Trs:
  { a__sqr(X) -> sqr(X)
  , a__sqr(s(X)) -> s(add(sqr(X), dbl(X)))
  , a__sqr(0()) -> 0()
  , mark(cons(X1, X2)) -> cons(mark(X1), X2)
  , mark(recip(X)) -> recip(mark(X))
  , mark(terms(X)) -> a__terms(mark(X))
  , mark(s(X)) -> s(X)
  , mark(0()) -> 0()
  , mark(add(X1, X2)) -> a__add(mark(X1), mark(X2))
  , mark(sqr(X)) -> a__sqr(mark(X))
  , mark(dbl(X)) -> a__dbl(mark(X))
  , mark(nil()) -> nil()
  , mark(first(X1, X2)) -> a__first(mark(X1), mark(X2))
  , a__dbl(X) -> dbl(X)
  , a__dbl(s(X)) -> s(s(dbl(X)))
  , a__dbl(0()) -> 0()
  , a__add(X1, X2) -> add(X1, X2)
  , a__add(s(X), Y) -> s(add(X, Y))
  , a__add(0(), X) -> mark(X)
  , a__first(X1, X2) -> first(X1, X2)
  , a__first(s(X), cons(Y, Z)) -> cons(mark(Y), first(X, Z))
  , a__first(0(), X) -> nil() }
Weak Trs:
  { a__terms(N) -> cons(recip(a__sqr(mark(N))), terms(s(N)))
  , a__terms(X) -> terms(X) }
Obligation:
  innermost runtime complexity
Answer:
  YES(O(1),O(n^2))

The weightgap principle applies (using the following nonconstant
growth matrix-interpretation)

The following argument positions are usable:
  Uargs(a__terms) = {1}, Uargs(cons) = {1}, Uargs(recip) = {1},
  Uargs(a__sqr) = {1}, Uargs(a__dbl) = {1}, Uargs(a__add) = {1, 2},
  Uargs(a__first) = {1, 2}

TcT has computed the following matrix interpretation satisfying
not(EDA) and not(IDA(1)).

      [a__terms](x1) = [1] x1 + [4]         
                                            
      [cons](x1, x2) = [1] x1 + [0]         
                                            
         [recip](x1) = [1] x1 + [0]         
                                            
        [a__sqr](x1) = [1] x1 + [1]         
                                            
          [mark](x1) = [0]                  
                                            
         [terms](x1) = [1] x1 + [0]         
                                            
             [s](x1) = [0]                  
                                            
                 [0] = [0]                  
                                            
       [add](x1, x2) = [0]                  
                                            
           [sqr](x1) = [0]                  
                                            
           [dbl](x1) = [1] x1 + [0]         
                                            
        [a__dbl](x1) = [1] x1 + [0]         
                                            
    [a__add](x1, x2) = [1] x1 + [1] x2 + [0]
                                            
  [a__first](x1, x2) = [1] x1 + [1] x2 + [0]
                                            
               [nil] = [0]                  
                                            
     [first](x1, x2) = [0]                  

The order satisfies the following ordering constraints:

                 [a__terms(N)] =  [1] N + [4]                                
                               >  [1]                                        
                               =  [cons(recip(a__sqr(mark(N))), terms(s(N)))]
                                                                             
                 [a__terms(X)] =  [1] X + [4]                                
                               >  [1] X + [0]                                
                               =  [terms(X)]                                 
                                                                             
                   [a__sqr(X)] =  [1] X + [1]                                
                               >  [0]                                        
                               =  [sqr(X)]                                   
                                                                             
                [a__sqr(s(X))] =  [1]                                        
                               >  [0]                                        
                               =  [s(add(sqr(X), dbl(X)))]                   
                                                                             
                 [a__sqr(0())] =  [1]                                        
                               >  [0]                                        
                               =  [0()]                                      
                                                                             
          [mark(cons(X1, X2))] =  [0]                                        
                               >= [0]                                        
                               =  [cons(mark(X1), X2)]                       
                                                                             
              [mark(recip(X))] =  [0]                                        
                               >= [0]                                        
                               =  [recip(mark(X))]                           
                                                                             
              [mark(terms(X))] =  [0]                                        
                               ?  [4]                                        
                               =  [a__terms(mark(X))]                        
                                                                             
                  [mark(s(X))] =  [0]                                        
                               >= [0]                                        
                               =  [s(X)]                                     
                                                                             
                   [mark(0())] =  [0]                                        
                               >= [0]                                        
                               =  [0()]                                      
                                                                             
           [mark(add(X1, X2))] =  [0]                                        
                               >= [0]                                        
                               =  [a__add(mark(X1), mark(X2))]               
                                                                             
                [mark(sqr(X))] =  [0]                                        
                               ?  [1]                                        
                               =  [a__sqr(mark(X))]                          
                                                                             
                [mark(dbl(X))] =  [0]                                        
                               >= [0]                                        
                               =  [a__dbl(mark(X))]                          
                                                                             
                 [mark(nil())] =  [0]                                        
                               >= [0]                                        
                               =  [nil()]                                    
                                                                             
         [mark(first(X1, X2))] =  [0]                                        
                               >= [0]                                        
                               =  [a__first(mark(X1), mark(X2))]             
                                                                             
                   [a__dbl(X)] =  [1] X + [0]                                
                               >= [1] X + [0]                                
                               =  [dbl(X)]                                   
                                                                             
                [a__dbl(s(X))] =  [0]                                        
                               >= [0]                                        
                               =  [s(s(dbl(X)))]                             
                                                                             
                 [a__dbl(0())] =  [0]                                        
                               >= [0]                                        
                               =  [0()]                                      
                                                                             
              [a__add(X1, X2)] =  [1] X1 + [1] X2 + [0]                      
                               >= [0]                                        
                               =  [add(X1, X2)]                              
                                                                             
             [a__add(s(X), Y)] =  [1] Y + [0]                                
                               >= [0]                                        
                               =  [s(add(X, Y))]                             
                                                                             
              [a__add(0(), X)] =  [1] X + [0]                                
                               >= [0]                                        
                               =  [mark(X)]                                  
                                                                             
            [a__first(X1, X2)] =  [1] X1 + [1] X2 + [0]                      
                               >= [0]                                        
                               =  [first(X1, X2)]                            
                                                                             
  [a__first(s(X), cons(Y, Z))] =  [1] Y + [0]                                
                               >= [0]                                        
                               =  [cons(mark(Y), first(X, Z))]               
                                                                             
            [a__first(0(), X)] =  [1] X + [0]                                
                               >= [0]                                        
                               =  [nil()]                                    
                                                                             

Further, it can be verified that all rules not oriented are covered by the weightgap condition.

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

Strict Trs:
  { mark(cons(X1, X2)) -> cons(mark(X1), X2)
  , mark(recip(X)) -> recip(mark(X))
  , mark(terms(X)) -> a__terms(mark(X))
  , mark(s(X)) -> s(X)
  , mark(0()) -> 0()
  , mark(add(X1, X2)) -> a__add(mark(X1), mark(X2))
  , mark(sqr(X)) -> a__sqr(mark(X))
  , mark(dbl(X)) -> a__dbl(mark(X))
  , mark(nil()) -> nil()
  , mark(first(X1, X2)) -> a__first(mark(X1), mark(X2))
  , a__dbl(X) -> dbl(X)
  , a__dbl(s(X)) -> s(s(dbl(X)))
  , a__dbl(0()) -> 0()
  , a__add(X1, X2) -> add(X1, X2)
  , a__add(s(X), Y) -> s(add(X, Y))
  , a__add(0(), X) -> mark(X)
  , a__first(X1, X2) -> first(X1, X2)
  , a__first(s(X), cons(Y, Z)) -> cons(mark(Y), first(X, Z))
  , a__first(0(), X) -> nil() }
Weak Trs:
  { a__terms(N) -> cons(recip(a__sqr(mark(N))), terms(s(N)))
  , a__terms(X) -> terms(X)
  , a__sqr(X) -> sqr(X)
  , a__sqr(s(X)) -> s(add(sqr(X), dbl(X)))
  , a__sqr(0()) -> 0() }
Obligation:
  innermost runtime complexity
Answer:
  YES(O(1),O(n^2))

The weightgap principle applies (using the following nonconstant
growth matrix-interpretation)

The following argument positions are usable:
  Uargs(a__terms) = {1}, Uargs(cons) = {1}, Uargs(recip) = {1},
  Uargs(a__sqr) = {1}, Uargs(a__dbl) = {1}, Uargs(a__add) = {1, 2},
  Uargs(a__first) = {1, 2}

TcT has computed the following matrix interpretation satisfying
not(EDA) and not(IDA(1)).

      [a__terms](x1) = [1] x1 + [4]         
                                            
      [cons](x1, x2) = [1] x1 + [0]         
                                            
         [recip](x1) = [1] x1 + [0]         
                                            
        [a__sqr](x1) = [1] x1 + [1]         
                                            
          [mark](x1) = [0]                  
                                            
         [terms](x1) = [1] x1 + [0]         
                                            
             [s](x1) = [1]                  
                                            
                 [0] = [0]                  
                                            
       [add](x1, x2) = [1] x1 + [1] x2 + [2]
                                            
           [sqr](x1) = [0]                  
                                            
           [dbl](x1) = [1] x1 + [0]         
                                            
        [a__dbl](x1) = [1] x1 + [0]         
                                            
    [a__add](x1, x2) = [1] x1 + [1] x2 + [4]
                                            
  [a__first](x1, x2) = [1] x1 + [1] x2 + [0]
                                            
               [nil] = [0]                  
                                            
     [first](x1, x2) = [1] x2 + [0]         

The order satisfies the following ordering constraints:

                 [a__terms(N)] =  [1] N + [4]                                
                               >  [1]                                        
                               =  [cons(recip(a__sqr(mark(N))), terms(s(N)))]
                                                                             
                 [a__terms(X)] =  [1] X + [4]                                
                               >  [1] X + [0]                                
                               =  [terms(X)]                                 
                                                                             
                   [a__sqr(X)] =  [1] X + [1]                                
                               >  [0]                                        
                               =  [sqr(X)]                                   
                                                                             
                [a__sqr(s(X))] =  [2]                                        
                               >  [1]                                        
                               =  [s(add(sqr(X), dbl(X)))]                   
                                                                             
                 [a__sqr(0())] =  [1]                                        
                               >  [0]                                        
                               =  [0()]                                      
                                                                             
          [mark(cons(X1, X2))] =  [0]                                        
                               >= [0]                                        
                               =  [cons(mark(X1), X2)]                       
                                                                             
              [mark(recip(X))] =  [0]                                        
                               >= [0]                                        
                               =  [recip(mark(X))]                           
                                                                             
              [mark(terms(X))] =  [0]                                        
                               ?  [4]                                        
                               =  [a__terms(mark(X))]                        
                                                                             
                  [mark(s(X))] =  [0]                                        
                               ?  [1]                                        
                               =  [s(X)]                                     
                                                                             
                   [mark(0())] =  [0]                                        
                               >= [0]                                        
                               =  [0()]                                      
                                                                             
           [mark(add(X1, X2))] =  [0]                                        
                               ?  [4]                                        
                               =  [a__add(mark(X1), mark(X2))]               
                                                                             
                [mark(sqr(X))] =  [0]                                        
                               ?  [1]                                        
                               =  [a__sqr(mark(X))]                          
                                                                             
                [mark(dbl(X))] =  [0]                                        
                               >= [0]                                        
                               =  [a__dbl(mark(X))]                          
                                                                             
                 [mark(nil())] =  [0]                                        
                               >= [0]                                        
                               =  [nil()]                                    
                                                                             
         [mark(first(X1, X2))] =  [0]                                        
                               >= [0]                                        
                               =  [a__first(mark(X1), mark(X2))]             
                                                                             
                   [a__dbl(X)] =  [1] X + [0]                                
                               >= [1] X + [0]                                
                               =  [dbl(X)]                                   
                                                                             
                [a__dbl(s(X))] =  [1]                                        
                               >= [1]                                        
                               =  [s(s(dbl(X)))]                             
                                                                             
                 [a__dbl(0())] =  [0]                                        
                               >= [0]                                        
                               =  [0()]                                      
                                                                             
              [a__add(X1, X2)] =  [1] X1 + [1] X2 + [4]                      
                               >  [1] X1 + [1] X2 + [2]                      
                               =  [add(X1, X2)]                              
                                                                             
             [a__add(s(X), Y)] =  [1] Y + [5]                                
                               >  [1]                                        
                               =  [s(add(X, Y))]                             
                                                                             
              [a__add(0(), X)] =  [1] X + [4]                                
                               >  [0]                                        
                               =  [mark(X)]                                  
                                                                             
            [a__first(X1, X2)] =  [1] X1 + [1] X2 + [0]                      
                               >= [1] X2 + [0]                               
                               =  [first(X1, X2)]                            
                                                                             
  [a__first(s(X), cons(Y, Z))] =  [1] Y + [1]                                
                               >  [0]                                        
                               =  [cons(mark(Y), first(X, Z))]               
                                                                             
            [a__first(0(), X)] =  [1] X + [0]                                
                               >= [0]                                        
                               =  [nil()]                                    
                                                                             

Further, it can be verified that all rules not oriented are covered by the weightgap condition.

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

Strict Trs:
  { mark(cons(X1, X2)) -> cons(mark(X1), X2)
  , mark(recip(X)) -> recip(mark(X))
  , mark(terms(X)) -> a__terms(mark(X))
  , mark(s(X)) -> s(X)
  , mark(0()) -> 0()
  , mark(add(X1, X2)) -> a__add(mark(X1), mark(X2))
  , mark(sqr(X)) -> a__sqr(mark(X))
  , mark(dbl(X)) -> a__dbl(mark(X))
  , mark(nil()) -> nil()
  , mark(first(X1, X2)) -> a__first(mark(X1), mark(X2))
  , a__dbl(X) -> dbl(X)
  , a__dbl(s(X)) -> s(s(dbl(X)))
  , a__dbl(0()) -> 0()
  , a__first(X1, X2) -> first(X1, X2)
  , a__first(0(), X) -> nil() }
Weak Trs:
  { a__terms(N) -> cons(recip(a__sqr(mark(N))), terms(s(N)))
  , a__terms(X) -> terms(X)
  , a__sqr(X) -> sqr(X)
  , a__sqr(s(X)) -> s(add(sqr(X), dbl(X)))
  , a__sqr(0()) -> 0()
  , a__add(X1, X2) -> add(X1, X2)
  , a__add(s(X), Y) -> s(add(X, Y))
  , a__add(0(), X) -> mark(X)
  , a__first(s(X), cons(Y, Z)) -> cons(mark(Y), first(X, Z)) }
Obligation:
  innermost runtime complexity
Answer:
  YES(O(1),O(n^2))

The weightgap principle applies (using the following nonconstant
growth matrix-interpretation)

The following argument positions are usable:
  Uargs(a__terms) = {1}, Uargs(cons) = {1}, Uargs(recip) = {1},
  Uargs(a__sqr) = {1}, Uargs(a__dbl) = {1}, Uargs(a__add) = {1, 2},
  Uargs(a__first) = {1, 2}

TcT has computed the following matrix interpretation satisfying
not(EDA) and not(IDA(1)).

      [a__terms](x1) = [1] x1 + [1]         
                                            
      [cons](x1, x2) = [1] x1 + [0]         
                                            
         [recip](x1) = [1] x1 + [0]         
                                            
        [a__sqr](x1) = [1] x1 + [0]         
                                            
          [mark](x1) = [1] x1 + [0]         
                                            
         [terms](x1) = [1] x1 + [1]         
                                            
             [s](x1) = [0]                  
                                            
                 [0] = [0]                  
                                            
       [add](x1, x2) = [1] x1 + [1] x2 + [0]
                                            
           [sqr](x1) = [1] x1 + [0]         
                                            
           [dbl](x1) = [1] x1 + [0]         
                                            
        [a__dbl](x1) = [1] x1 + [0]         
                                            
    [a__add](x1, x2) = [1] x1 + [1] x2 + [0]
                                            
  [a__first](x1, x2) = [1] x1 + [1] x2 + [1]
                                            
               [nil] = [0]                  
                                            
     [first](x1, x2) = [1] x1 + [1] x2 + [0]

The order satisfies the following ordering constraints:

                 [a__terms(N)] =  [1] N + [1]                                
                               >  [1] N + [0]                                
                               =  [cons(recip(a__sqr(mark(N))), terms(s(N)))]
                                                                             
                 [a__terms(X)] =  [1] X + [1]                                
                               >= [1] X + [1]                                
                               =  [terms(X)]                                 
                                                                             
                   [a__sqr(X)] =  [1] X + [0]                                
                               >= [1] X + [0]                                
                               =  [sqr(X)]                                   
                                                                             
                [a__sqr(s(X))] =  [0]                                        
                               >= [0]                                        
                               =  [s(add(sqr(X), dbl(X)))]                   
                                                                             
                 [a__sqr(0())] =  [0]                                        
                               >= [0]                                        
                               =  [0()]                                      
                                                                             
          [mark(cons(X1, X2))] =  [1] X1 + [0]                               
                               >= [1] X1 + [0]                               
                               =  [cons(mark(X1), X2)]                       
                                                                             
              [mark(recip(X))] =  [1] X + [0]                                
                               >= [1] X + [0]                                
                               =  [recip(mark(X))]                           
                                                                             
              [mark(terms(X))] =  [1] X + [1]                                
                               >= [1] X + [1]                                
                               =  [a__terms(mark(X))]                        
                                                                             
                  [mark(s(X))] =  [0]                                        
                               >= [0]                                        
                               =  [s(X)]                                     
                                                                             
                   [mark(0())] =  [0]                                        
                               >= [0]                                        
                               =  [0()]                                      
                                                                             
           [mark(add(X1, X2))] =  [1] X1 + [1] X2 + [0]                      
                               >= [1] X1 + [1] X2 + [0]                      
                               =  [a__add(mark(X1), mark(X2))]               
                                                                             
                [mark(sqr(X))] =  [1] X + [0]                                
                               >= [1] X + [0]                                
                               =  [a__sqr(mark(X))]                          
                                                                             
                [mark(dbl(X))] =  [1] X + [0]                                
                               >= [1] X + [0]                                
                               =  [a__dbl(mark(X))]                          
                                                                             
                 [mark(nil())] =  [0]                                        
                               >= [0]                                        
                               =  [nil()]                                    
                                                                             
         [mark(first(X1, X2))] =  [1] X1 + [1] X2 + [0]                      
                               ?  [1] X1 + [1] X2 + [1]                      
                               =  [a__first(mark(X1), mark(X2))]             
                                                                             
                   [a__dbl(X)] =  [1] X + [0]                                
                               >= [1] X + [0]                                
                               =  [dbl(X)]                                   
                                                                             
                [a__dbl(s(X))] =  [0]                                        
                               >= [0]                                        
                               =  [s(s(dbl(X)))]                             
                                                                             
                 [a__dbl(0())] =  [0]                                        
                               >= [0]                                        
                               =  [0()]                                      
                                                                             
              [a__add(X1, X2)] =  [1] X1 + [1] X2 + [0]                      
                               >= [1] X1 + [1] X2 + [0]                      
                               =  [add(X1, X2)]                              
                                                                             
             [a__add(s(X), Y)] =  [1] Y + [0]                                
                               >= [0]                                        
                               =  [s(add(X, Y))]                             
                                                                             
              [a__add(0(), X)] =  [1] X + [0]                                
                               >= [1] X + [0]                                
                               =  [mark(X)]                                  
                                                                             
            [a__first(X1, X2)] =  [1] X1 + [1] X2 + [1]                      
                               >  [1] X1 + [1] X2 + [0]                      
                               =  [first(X1, X2)]                            
                                                                             
  [a__first(s(X), cons(Y, Z))] =  [1] Y + [1]                                
                               >  [1] Y + [0]                                
                               =  [cons(mark(Y), first(X, Z))]               
                                                                             
            [a__first(0(), X)] =  [1] X + [1]                                
                               >  [0]                                        
                               =  [nil()]                                    
                                                                             

Further, it can be verified that all rules not oriented are covered by the weightgap condition.

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

Strict Trs:
  { mark(cons(X1, X2)) -> cons(mark(X1), X2)
  , mark(recip(X)) -> recip(mark(X))
  , mark(terms(X)) -> a__terms(mark(X))
  , mark(s(X)) -> s(X)
  , mark(0()) -> 0()
  , mark(add(X1, X2)) -> a__add(mark(X1), mark(X2))
  , mark(sqr(X)) -> a__sqr(mark(X))
  , mark(dbl(X)) -> a__dbl(mark(X))
  , mark(nil()) -> nil()
  , mark(first(X1, X2)) -> a__first(mark(X1), mark(X2))
  , a__dbl(X) -> dbl(X)
  , a__dbl(s(X)) -> s(s(dbl(X)))
  , a__dbl(0()) -> 0() }
Weak Trs:
  { a__terms(N) -> cons(recip(a__sqr(mark(N))), terms(s(N)))
  , a__terms(X) -> terms(X)
  , a__sqr(X) -> sqr(X)
  , a__sqr(s(X)) -> s(add(sqr(X), dbl(X)))
  , a__sqr(0()) -> 0()
  , a__add(X1, X2) -> add(X1, X2)
  , a__add(s(X), Y) -> s(add(X, Y))
  , a__add(0(), X) -> mark(X)
  , a__first(X1, X2) -> first(X1, X2)
  , a__first(s(X), cons(Y, Z)) -> cons(mark(Y), first(X, Z))
  , a__first(0(), X) -> nil() }
Obligation:
  innermost runtime complexity
Answer:
  YES(O(1),O(n^2))

The weightgap principle applies (using the following nonconstant
growth matrix-interpretation)

The following argument positions are usable:
  Uargs(a__terms) = {1}, Uargs(cons) = {1}, Uargs(recip) = {1},
  Uargs(a__sqr) = {1}, Uargs(a__dbl) = {1}, Uargs(a__add) = {1, 2},
  Uargs(a__first) = {1, 2}

TcT has computed the following matrix interpretation satisfying
not(EDA) and not(IDA(1)).

      [a__terms](x1) = [1] x1 + [3]         
                                            
      [cons](x1, x2) = [1] x1 + [0]         
                                            
         [recip](x1) = [1] x1 + [0]         
                                            
        [a__sqr](x1) = [1] x1 + [0]         
                                            
          [mark](x1) = [1]                  
                                            
         [terms](x1) = [1] x1 + [0]         
                                            
             [s](x1) = [1]                  
                                            
                 [0] = [1]                  
                                            
       [add](x1, x2) = [0]                  
                                            
           [sqr](x1) = [0]                  
                                            
           [dbl](x1) = [1] x1 + [0]         
                                            
        [a__dbl](x1) = [1] x1 + [4]         
                                            
    [a__add](x1, x2) = [1] x1 + [1] x2 + [7]
                                            
  [a__first](x1, x2) = [1] x1 + [1] x2 + [7]
                                            
               [nil] = [0]                  
                                            
     [first](x1, x2) = [1] x2 + [0]         

The order satisfies the following ordering constraints:

                 [a__terms(N)] =  [1] N + [3]                                
                               >  [1]                                        
                               =  [cons(recip(a__sqr(mark(N))), terms(s(N)))]
                                                                             
                 [a__terms(X)] =  [1] X + [3]                                
                               >  [1] X + [0]                                
                               =  [terms(X)]                                 
                                                                             
                   [a__sqr(X)] =  [1] X + [0]                                
                               >= [0]                                        
                               =  [sqr(X)]                                   
                                                                             
                [a__sqr(s(X))] =  [1]                                        
                               >= [1]                                        
                               =  [s(add(sqr(X), dbl(X)))]                   
                                                                             
                 [a__sqr(0())] =  [1]                                        
                               >= [1]                                        
                               =  [0()]                                      
                                                                             
          [mark(cons(X1, X2))] =  [1]                                        
                               >= [1]                                        
                               =  [cons(mark(X1), X2)]                       
                                                                             
              [mark(recip(X))] =  [1]                                        
                               >= [1]                                        
                               =  [recip(mark(X))]                           
                                                                             
              [mark(terms(X))] =  [1]                                        
                               ?  [4]                                        
                               =  [a__terms(mark(X))]                        
                                                                             
                  [mark(s(X))] =  [1]                                        
                               >= [1]                                        
                               =  [s(X)]                                     
                                                                             
                   [mark(0())] =  [1]                                        
                               >= [1]                                        
                               =  [0()]                                      
                                                                             
           [mark(add(X1, X2))] =  [1]                                        
                               ?  [9]                                        
                               =  [a__add(mark(X1), mark(X2))]               
                                                                             
                [mark(sqr(X))] =  [1]                                        
                               >= [1]                                        
                               =  [a__sqr(mark(X))]                          
                                                                             
                [mark(dbl(X))] =  [1]                                        
                               ?  [5]                                        
                               =  [a__dbl(mark(X))]                          
                                                                             
                 [mark(nil())] =  [1]                                        
                               >  [0]                                        
                               =  [nil()]                                    
                                                                             
         [mark(first(X1, X2))] =  [1]                                        
                               ?  [9]                                        
                               =  [a__first(mark(X1), mark(X2))]             
                                                                             
                   [a__dbl(X)] =  [1] X + [4]                                
                               >  [1] X + [0]                                
                               =  [dbl(X)]                                   
                                                                             
                [a__dbl(s(X))] =  [5]                                        
                               >  [1]                                        
                               =  [s(s(dbl(X)))]                             
                                                                             
                 [a__dbl(0())] =  [5]                                        
                               >  [1]                                        
                               =  [0()]                                      
                                                                             
              [a__add(X1, X2)] =  [1] X1 + [1] X2 + [7]                      
                               >  [0]                                        
                               =  [add(X1, X2)]                              
                                                                             
             [a__add(s(X), Y)] =  [1] Y + [8]                                
                               >  [1]                                        
                               =  [s(add(X, Y))]                             
                                                                             
              [a__add(0(), X)] =  [1] X + [8]                                
                               >  [1]                                        
                               =  [mark(X)]                                  
                                                                             
            [a__first(X1, X2)] =  [1] X1 + [1] X2 + [7]                      
                               >  [1] X2 + [0]                               
                               =  [first(X1, X2)]                            
                                                                             
  [a__first(s(X), cons(Y, Z))] =  [1] Y + [8]                                
                               >  [1]                                        
                               =  [cons(mark(Y), first(X, Z))]               
                                                                             
            [a__first(0(), X)] =  [1] X + [8]                                
                               >  [0]                                        
                               =  [nil()]                                    
                                                                             

Further, it can be verified that all rules not oriented are covered by the weightgap condition.

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

Strict Trs:
  { mark(cons(X1, X2)) -> cons(mark(X1), X2)
  , mark(recip(X)) -> recip(mark(X))
  , mark(terms(X)) -> a__terms(mark(X))
  , mark(s(X)) -> s(X)
  , mark(0()) -> 0()
  , mark(add(X1, X2)) -> a__add(mark(X1), mark(X2))
  , mark(sqr(X)) -> a__sqr(mark(X))
  , mark(dbl(X)) -> a__dbl(mark(X))
  , mark(first(X1, X2)) -> a__first(mark(X1), mark(X2)) }
Weak Trs:
  { a__terms(N) -> cons(recip(a__sqr(mark(N))), terms(s(N)))
  , a__terms(X) -> terms(X)
  , a__sqr(X) -> sqr(X)
  , a__sqr(s(X)) -> s(add(sqr(X), dbl(X)))
  , a__sqr(0()) -> 0()
  , mark(nil()) -> nil()
  , a__dbl(X) -> dbl(X)
  , a__dbl(s(X)) -> s(s(dbl(X)))
  , a__dbl(0()) -> 0()
  , a__add(X1, X2) -> add(X1, X2)
  , a__add(s(X), Y) -> s(add(X, Y))
  , a__add(0(), X) -> mark(X)
  , a__first(X1, X2) -> first(X1, X2)
  , a__first(s(X), cons(Y, Z)) -> cons(mark(Y), first(X, Z))
  , a__first(0(), X) -> nil() }
Obligation:
  innermost runtime complexity
Answer:
  YES(O(1),O(n^2))

The weightgap principle applies (using the following nonconstant
growth matrix-interpretation)

The following argument positions are usable:
  Uargs(a__terms) = {1}, Uargs(cons) = {1}, Uargs(recip) = {1},
  Uargs(a__sqr) = {1}, Uargs(a__dbl) = {1}, Uargs(a__add) = {1, 2},
  Uargs(a__first) = {1, 2}

TcT has computed the following matrix interpretation satisfying
not(EDA) and not(IDA(1)).

      [a__terms](x1) = [1] x1 + [7]         
                                            
      [cons](x1, x2) = [1] x1 + [0]         
                                            
         [recip](x1) = [1] x1 + [0]         
                                            
        [a__sqr](x1) = [1] x1 + [0]         
                                            
          [mark](x1) = [1]                  
                                            
         [terms](x1) = [1] x1 + [0]         
                                            
             [s](x1) = [1]                  
                                            
                 [0] = [0]                  
                                            
       [add](x1, x2) = [0]                  
                                            
           [sqr](x1) = [1] x1 + [0]         
                                            
           [dbl](x1) = [0]                  
                                            
        [a__dbl](x1) = [1] x1 + [0]         
                                            
    [a__add](x1, x2) = [1] x1 + [1] x2 + [6]
                                            
  [a__first](x1, x2) = [1] x1 + [1] x2 + [7]
                                            
               [nil] = [0]                  
                                            
     [first](x1, x2) = [1] x2 + [0]         

The order satisfies the following ordering constraints:

                 [a__terms(N)] =  [1] N + [7]                                
                               >  [1]                                        
                               =  [cons(recip(a__sqr(mark(N))), terms(s(N)))]
                                                                             
                 [a__terms(X)] =  [1] X + [7]                                
                               >  [1] X + [0]                                
                               =  [terms(X)]                                 
                                                                             
                   [a__sqr(X)] =  [1] X + [0]                                
                               >= [1] X + [0]                                
                               =  [sqr(X)]                                   
                                                                             
                [a__sqr(s(X))] =  [1]                                        
                               >= [1]                                        
                               =  [s(add(sqr(X), dbl(X)))]                   
                                                                             
                 [a__sqr(0())] =  [0]                                        
                               >= [0]                                        
                               =  [0()]                                      
                                                                             
          [mark(cons(X1, X2))] =  [1]                                        
                               >= [1]                                        
                               =  [cons(mark(X1), X2)]                       
                                                                             
              [mark(recip(X))] =  [1]                                        
                               >= [1]                                        
                               =  [recip(mark(X))]                           
                                                                             
              [mark(terms(X))] =  [1]                                        
                               ?  [8]                                        
                               =  [a__terms(mark(X))]                        
                                                                             
                  [mark(s(X))] =  [1]                                        
                               >= [1]                                        
                               =  [s(X)]                                     
                                                                             
                   [mark(0())] =  [1]                                        
                               >  [0]                                        
                               =  [0()]                                      
                                                                             
           [mark(add(X1, X2))] =  [1]                                        
                               ?  [8]                                        
                               =  [a__add(mark(X1), mark(X2))]               
                                                                             
                [mark(sqr(X))] =  [1]                                        
                               >= [1]                                        
                               =  [a__sqr(mark(X))]                          
                                                                             
                [mark(dbl(X))] =  [1]                                        
                               >= [1]                                        
                               =  [a__dbl(mark(X))]                          
                                                                             
                 [mark(nil())] =  [1]                                        
                               >  [0]                                        
                               =  [nil()]                                    
                                                                             
         [mark(first(X1, X2))] =  [1]                                        
                               ?  [9]                                        
                               =  [a__first(mark(X1), mark(X2))]             
                                                                             
                   [a__dbl(X)] =  [1] X + [0]                                
                               >= [0]                                        
                               =  [dbl(X)]                                   
                                                                             
                [a__dbl(s(X))] =  [1]                                        
                               >= [1]                                        
                               =  [s(s(dbl(X)))]                             
                                                                             
                 [a__dbl(0())] =  [0]                                        
                               >= [0]                                        
                               =  [0()]                                      
                                                                             
              [a__add(X1, X2)] =  [1] X1 + [1] X2 + [6]                      
                               >  [0]                                        
                               =  [add(X1, X2)]                              
                                                                             
             [a__add(s(X), Y)] =  [1] Y + [7]                                
                               >  [1]                                        
                               =  [s(add(X, Y))]                             
                                                                             
              [a__add(0(), X)] =  [1] X + [6]                                
                               >  [1]                                        
                               =  [mark(X)]                                  
                                                                             
            [a__first(X1, X2)] =  [1] X1 + [1] X2 + [7]                      
                               >  [1] X2 + [0]                               
                               =  [first(X1, X2)]                            
                                                                             
  [a__first(s(X), cons(Y, Z))] =  [1] Y + [8]                                
                               >  [1]                                        
                               =  [cons(mark(Y), first(X, Z))]               
                                                                             
            [a__first(0(), X)] =  [1] X + [7]                                
                               >  [0]                                        
                               =  [nil()]                                    
                                                                             

Further, it can be verified that all rules not oriented are covered by the weightgap condition.

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

Strict Trs:
  { mark(cons(X1, X2)) -> cons(mark(X1), X2)
  , mark(recip(X)) -> recip(mark(X))
  , mark(terms(X)) -> a__terms(mark(X))
  , mark(s(X)) -> s(X)
  , mark(add(X1, X2)) -> a__add(mark(X1), mark(X2))
  , mark(sqr(X)) -> a__sqr(mark(X))
  , mark(dbl(X)) -> a__dbl(mark(X))
  , mark(first(X1, X2)) -> a__first(mark(X1), mark(X2)) }
Weak Trs:
  { a__terms(N) -> cons(recip(a__sqr(mark(N))), terms(s(N)))
  , a__terms(X) -> terms(X)
  , a__sqr(X) -> sqr(X)
  , a__sqr(s(X)) -> s(add(sqr(X), dbl(X)))
  , a__sqr(0()) -> 0()
  , mark(0()) -> 0()
  , mark(nil()) -> nil()
  , a__dbl(X) -> dbl(X)
  , a__dbl(s(X)) -> s(s(dbl(X)))
  , a__dbl(0()) -> 0()
  , a__add(X1, X2) -> add(X1, X2)
  , a__add(s(X), Y) -> s(add(X, Y))
  , a__add(0(), X) -> mark(X)
  , a__first(X1, X2) -> first(X1, X2)
  , a__first(s(X), cons(Y, Z)) -> cons(mark(Y), first(X, Z))
  , a__first(0(), X) -> nil() }
Obligation:
  innermost runtime complexity
Answer:
  YES(O(1),O(n^2))

The weightgap principle applies (using the following nonconstant
growth matrix-interpretation)

The following argument positions are usable:
  Uargs(a__terms) = {1}, Uargs(cons) = {1}, Uargs(recip) = {1},
  Uargs(a__sqr) = {1}, Uargs(a__dbl) = {1}, Uargs(a__add) = {1, 2},
  Uargs(a__first) = {1, 2}

TcT has computed the following matrix interpretation satisfying
not(EDA) and not(IDA(1)).

      [a__terms](x1) = [1] x1 + [7]         
                                            
      [cons](x1, x2) = [1] x1 + [0]         
                                            
         [recip](x1) = [1] x1 + [0]         
                                            
        [a__sqr](x1) = [1] x1 + [4]         
                                            
          [mark](x1) = [1] x1 + [1]         
                                            
         [terms](x1) = [1] x1 + [0]         
                                            
             [s](x1) = [3]                  
                                            
                 [0] = [7]                  
                                            
       [add](x1, x2) = [1] x1 + [1] x2 + [0]
                                            
           [sqr](x1) = [1] x1 + [0]         
                                            
           [dbl](x1) = [1] x1 + [0]         
                                            
        [a__dbl](x1) = [1] x1 + [4]         
                                            
    [a__add](x1, x2) = [1] x1 + [1] x2 + [6]
                                            
  [a__first](x1, x2) = [1] x1 + [1] x2 + [6]
                                            
               [nil] = [0]                  
                                            
     [first](x1, x2) = [1] x1 + [1] x2 + [0]

The order satisfies the following ordering constraints:

                 [a__terms(N)] =  [1] N + [7]                                
                               >  [1] N + [5]                                
                               =  [cons(recip(a__sqr(mark(N))), terms(s(N)))]
                                                                             
                 [a__terms(X)] =  [1] X + [7]                                
                               >  [1] X + [0]                                
                               =  [terms(X)]                                 
                                                                             
                   [a__sqr(X)] =  [1] X + [4]                                
                               >  [1] X + [0]                                
                               =  [sqr(X)]                                   
                                                                             
                [a__sqr(s(X))] =  [7]                                        
                               >  [3]                                        
                               =  [s(add(sqr(X), dbl(X)))]                   
                                                                             
                 [a__sqr(0())] =  [11]                                       
                               >  [7]                                        
                               =  [0()]                                      
                                                                             
          [mark(cons(X1, X2))] =  [1] X1 + [1]                               
                               >= [1] X1 + [1]                               
                               =  [cons(mark(X1), X2)]                       
                                                                             
              [mark(recip(X))] =  [1] X + [1]                                
                               >= [1] X + [1]                                
                               =  [recip(mark(X))]                           
                                                                             
              [mark(terms(X))] =  [1] X + [1]                                
                               ?  [1] X + [8]                                
                               =  [a__terms(mark(X))]                        
                                                                             
                  [mark(s(X))] =  [4]                                        
                               >  [3]                                        
                               =  [s(X)]                                     
                                                                             
                   [mark(0())] =  [8]                                        
                               >  [7]                                        
                               =  [0()]                                      
                                                                             
           [mark(add(X1, X2))] =  [1] X1 + [1] X2 + [1]                      
                               ?  [1] X1 + [1] X2 + [8]                      
                               =  [a__add(mark(X1), mark(X2))]               
                                                                             
                [mark(sqr(X))] =  [1] X + [1]                                
                               ?  [1] X + [5]                                
                               =  [a__sqr(mark(X))]                          
                                                                             
                [mark(dbl(X))] =  [1] X + [1]                                
                               ?  [1] X + [5]                                
                               =  [a__dbl(mark(X))]                          
                                                                             
                 [mark(nil())] =  [1]                                        
                               >  [0]                                        
                               =  [nil()]                                    
                                                                             
         [mark(first(X1, X2))] =  [1] X1 + [1] X2 + [1]                      
                               ?  [1] X1 + [1] X2 + [8]                      
                               =  [a__first(mark(X1), mark(X2))]             
                                                                             
                   [a__dbl(X)] =  [1] X + [4]                                
                               >  [1] X + [0]                                
                               =  [dbl(X)]                                   
                                                                             
                [a__dbl(s(X))] =  [7]                                        
                               >  [3]                                        
                               =  [s(s(dbl(X)))]                             
                                                                             
                 [a__dbl(0())] =  [11]                                       
                               >  [7]                                        
                               =  [0()]                                      
                                                                             
              [a__add(X1, X2)] =  [1] X1 + [1] X2 + [6]                      
                               >  [1] X1 + [1] X2 + [0]                      
                               =  [add(X1, X2)]                              
                                                                             
             [a__add(s(X), Y)] =  [1] Y + [9]                                
                               >  [3]                                        
                               =  [s(add(X, Y))]                             
                                                                             
              [a__add(0(), X)] =  [1] X + [13]                               
                               >  [1] X + [1]                                
                               =  [mark(X)]                                  
                                                                             
            [a__first(X1, X2)] =  [1] X1 + [1] X2 + [6]                      
                               >  [1] X1 + [1] X2 + [0]                      
                               =  [first(X1, X2)]                            
                                                                             
  [a__first(s(X), cons(Y, Z))] =  [1] Y + [9]                                
                               >  [1] Y + [1]                                
                               =  [cons(mark(Y), first(X, Z))]               
                                                                             
            [a__first(0(), X)] =  [1] X + [13]                               
                               >  [0]                                        
                               =  [nil()]                                    
                                                                             

Further, it can be verified that all rules not oriented are covered by the weightgap condition.

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

Strict Trs:
  { mark(cons(X1, X2)) -> cons(mark(X1), X2)
  , mark(recip(X)) -> recip(mark(X))
  , mark(terms(X)) -> a__terms(mark(X))
  , mark(add(X1, X2)) -> a__add(mark(X1), mark(X2))
  , mark(sqr(X)) -> a__sqr(mark(X))
  , mark(dbl(X)) -> a__dbl(mark(X))
  , mark(first(X1, X2)) -> a__first(mark(X1), mark(X2)) }
Weak Trs:
  { a__terms(N) -> cons(recip(a__sqr(mark(N))), terms(s(N)))
  , a__terms(X) -> terms(X)
  , a__sqr(X) -> sqr(X)
  , a__sqr(s(X)) -> s(add(sqr(X), dbl(X)))
  , a__sqr(0()) -> 0()
  , mark(s(X)) -> s(X)
  , mark(0()) -> 0()
  , mark(nil()) -> nil()
  , a__dbl(X) -> dbl(X)
  , a__dbl(s(X)) -> s(s(dbl(X)))
  , a__dbl(0()) -> 0()
  , a__add(X1, X2) -> add(X1, X2)
  , a__add(s(X), Y) -> s(add(X, Y))
  , a__add(0(), X) -> mark(X)
  , a__first(X1, X2) -> first(X1, X2)
  , a__first(s(X), cons(Y, Z)) -> cons(mark(Y), first(X, Z))
  , a__first(0(), X) -> nil() }
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.

Trs:
  { mark(terms(X)) -> a__terms(mark(X))
  , mark(add(X1, X2)) -> a__add(mark(X1), mark(X2))
  , mark(first(X1, X2)) -> a__first(mark(X1), mark(X2)) }

The induced complexity on above rules (modulo remaining rules) is
YES(?,O(n^2)) . These rules are moved into the corresponding weak
component(s).

Sub-proof:
----------
  The following argument positions are usable:
    Uargs(a__terms) = {1}, Uargs(cons) = {1}, Uargs(recip) = {1},
    Uargs(a__sqr) = {1}, Uargs(a__dbl) = {1}, Uargs(a__add) = {1, 2},
    Uargs(a__first) = {1, 2}
  
  TcT has computed the following constructor-based matrix
  interpretation satisfying not(EDA).
  
        [a__terms](x1) = [1 7] x1 + [1]           
                         [0 1]      [2]           
                                                  
        [cons](x1, x2) = [1 0] x1 + [0]           
                         [0 1]      [0]           
                                                  
           [recip](x1) = [1 0] x1 + [0]           
                         [0 1]      [0]           
                                                  
          [a__sqr](x1) = [1 0] x1 + [0]           
                         [0 1]      [0]           
                                                  
            [mark](x1) = [1 7] x1 + [1]           
                         [0 1]      [0]           
                                                  
           [terms](x1) = [1 7] x1 + [0]           
                         [0 1]      [2]           
                                                  
               [s](x1) = [0]                      
                         [0]                      
                                                  
                   [0] = [0]                      
                         [0]                      
                                                  
         [add](x1, x2) = [1 5] x1 + [1 7] x2 + [0]
                         [0 1]      [0 1]      [1]
                                                  
             [sqr](x1) = [1 0] x1 + [0]           
                         [0 1]      [0]           
                                                  
             [dbl](x1) = [1 0] x1 + [0]           
                         [0 1]      [0]           
                                                  
          [a__dbl](x1) = [1 0] x1 + [0]           
                         [0 1]      [0]           
                                                  
      [a__add](x1, x2) = [1 5] x1 + [1 7] x2 + [1]
                         [0 1]      [0 1]      [1]
                                                  
    [a__first](x1, x2) = [1 2] x1 + [1 7] x2 + [5]
                         [0 1]      [0 1]      [1]
                                                  
                 [nil] = [0]                      
                         [0]                      
                                                  
       [first](x1, x2) = [1 2] x1 + [1 7] x2 + [0]
                         [0 1]      [0 1]      [1]
  
  The order satisfies the following ordering constraints:
  
                   [a__terms(N)] =  [1 7] N + [1]                              
                                    [0 1]     [2]                              
                                 >= [1 7] N + [1]                              
                                    [0 1]     [0]                              
                                 =  [cons(recip(a__sqr(mark(N))), terms(s(N)))]
                                                                               
                   [a__terms(X)] =  [1 7] X + [1]                              
                                    [0 1]     [2]                              
                                 >  [1 7] X + [0]                              
                                    [0 1]     [2]                              
                                 =  [terms(X)]                                 
                                                                               
                     [a__sqr(X)] =  [1 0] X + [0]                              
                                    [0 1]     [0]                              
                                 >= [1 0] X + [0]                              
                                    [0 1]     [0]                              
                                 =  [sqr(X)]                                   
                                                                               
                  [a__sqr(s(X))] =  [0]                                        
                                    [0]                                        
                                 >= [0]                                        
                                    [0]                                        
                                 =  [s(add(sqr(X), dbl(X)))]                   
                                                                               
                   [a__sqr(0())] =  [0]                                        
                                    [0]                                        
                                 >= [0]                                        
                                    [0]                                        
                                 =  [0()]                                      
                                                                               
            [mark(cons(X1, X2))] =  [1 7] X1 + [1]                             
                                    [0 1]      [0]                             
                                 >= [1 7] X1 + [1]                             
                                    [0 1]      [0]                             
                                 =  [cons(mark(X1), X2)]                       
                                                                               
                [mark(recip(X))] =  [1 7] X + [1]                              
                                    [0 1]     [0]                              
                                 >= [1 7] X + [1]                              
                                    [0 1]     [0]                              
                                 =  [recip(mark(X))]                           
                                                                               
                [mark(terms(X))] =  [1 14] X + [15]                            
                                    [0  1]     [2]                             
                                 >  [1 14] X + [2]                             
                                    [0  1]     [2]                             
                                 =  [a__terms(mark(X))]                        
                                                                               
                    [mark(s(X))] =  [1]                                        
                                    [0]                                        
                                 >  [0]                                        
                                    [0]                                        
                                 =  [s(X)]                                     
                                                                               
                     [mark(0())] =  [1]                                        
                                    [0]                                        
                                 >  [0]                                        
                                    [0]                                        
                                 =  [0()]                                      
                                                                               
             [mark(add(X1, X2))] =  [1 12] X1 + [1 14] X2 + [8]                
                                    [0  1]      [0  1]      [1]                
                                 >  [1 12] X1 + [1 14] X2 + [3]                
                                    [0  1]      [0  1]      [1]                
                                 =  [a__add(mark(X1), mark(X2))]               
                                                                               
                  [mark(sqr(X))] =  [1 7] X + [1]                              
                                    [0 1]     [0]                              
                                 >= [1 7] X + [1]                              
                                    [0 1]     [0]                              
                                 =  [a__sqr(mark(X))]                          
                                                                               
                  [mark(dbl(X))] =  [1 7] X + [1]                              
                                    [0 1]     [0]                              
                                 >= [1 7] X + [1]                              
                                    [0 1]     [0]                              
                                 =  [a__dbl(mark(X))]                          
                                                                               
                   [mark(nil())] =  [1]                                        
                                    [0]                                        
                                 >  [0]                                        
                                    [0]                                        
                                 =  [nil()]                                    
                                                                               
           [mark(first(X1, X2))] =  [1 9] X1 + [1 14] X2 + [8]                 
                                    [0 1]      [0  1]      [1]                 
                                 >  [1 9] X1 + [1 14] X2 + [7]                 
                                    [0 1]      [0  1]      [1]                 
                                 =  [a__first(mark(X1), mark(X2))]             
                                                                               
                     [a__dbl(X)] =  [1 0] X + [0]                              
                                    [0 1]     [0]                              
                                 >= [1 0] X + [0]                              
                                    [0 1]     [0]                              
                                 =  [dbl(X)]                                   
                                                                               
                  [a__dbl(s(X))] =  [0]                                        
                                    [0]                                        
                                 >= [0]                                        
                                    [0]                                        
                                 =  [s(s(dbl(X)))]                             
                                                                               
                   [a__dbl(0())] =  [0]                                        
                                    [0]                                        
                                 >= [0]                                        
                                    [0]                                        
                                 =  [0()]                                      
                                                                               
                [a__add(X1, X2)] =  [1 5] X1 + [1 7] X2 + [1]                  
                                    [0 1]      [0 1]      [1]                  
                                 >  [1 5] X1 + [1 7] X2 + [0]                  
                                    [0 1]      [0 1]      [1]                  
                                 =  [add(X1, X2)]                              
                                                                               
               [a__add(s(X), Y)] =  [1 7] Y + [1]                              
                                    [0 1]     [1]                              
                                 >  [0]                                        
                                    [0]                                        
                                 =  [s(add(X, Y))]                             
                                                                               
                [a__add(0(), X)] =  [1 7] X + [1]                              
                                    [0 1]     [1]                              
                                 >= [1 7] X + [1]                              
                                    [0 1]     [0]                              
                                 =  [mark(X)]                                  
                                                                               
              [a__first(X1, X2)] =  [1 2] X1 + [1 7] X2 + [5]                  
                                    [0 1]      [0 1]      [1]                  
                                 >  [1 2] X1 + [1 7] X2 + [0]                  
                                    [0 1]      [0 1]      [1]                  
                                 =  [first(X1, X2)]                            
                                                                               
    [a__first(s(X), cons(Y, Z))] =  [1 7] Y + [5]                              
                                    [0 1]     [1]                              
                                 >  [1 7] Y + [1]                              
                                    [0 1]     [0]                              
                                 =  [cons(mark(Y), first(X, Z))]               
                                                                               
              [a__first(0(), X)] =  [1 7] X + [5]                              
                                    [0 1]     [1]                              
                                 >  [0]                                        
                                    [0]                                        
                                 =  [nil()]                                    
                                                                               

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 Trs:
  { mark(cons(X1, X2)) -> cons(mark(X1), X2)
  , mark(recip(X)) -> recip(mark(X))
  , mark(sqr(X)) -> a__sqr(mark(X))
  , mark(dbl(X)) -> a__dbl(mark(X)) }
Weak Trs:
  { a__terms(N) -> cons(recip(a__sqr(mark(N))), terms(s(N)))
  , a__terms(X) -> terms(X)
  , a__sqr(X) -> sqr(X)
  , a__sqr(s(X)) -> s(add(sqr(X), dbl(X)))
  , a__sqr(0()) -> 0()
  , mark(terms(X)) -> a__terms(mark(X))
  , mark(s(X)) -> s(X)
  , mark(0()) -> 0()
  , mark(add(X1, X2)) -> a__add(mark(X1), mark(X2))
  , mark(nil()) -> nil()
  , mark(first(X1, X2)) -> a__first(mark(X1), mark(X2))
  , a__dbl(X) -> dbl(X)
  , a__dbl(s(X)) -> s(s(dbl(X)))
  , a__dbl(0()) -> 0()
  , a__add(X1, X2) -> add(X1, X2)
  , a__add(s(X), Y) -> s(add(X, Y))
  , a__add(0(), X) -> mark(X)
  , a__first(X1, X2) -> first(X1, X2)
  , a__first(s(X), cons(Y, Z)) -> cons(mark(Y), first(X, Z))
  , a__first(0(), X) -> nil() }
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.

Trs:
  { mark(cons(X1, X2)) -> cons(mark(X1), X2)
  , mark(recip(X)) -> recip(mark(X)) }

The induced complexity on above rules (modulo remaining rules) is
YES(?,O(n^2)) . These rules are moved into the corresponding weak
component(s).

Sub-proof:
----------
  The following argument positions are usable:
    Uargs(a__terms) = {1}, Uargs(cons) = {1}, Uargs(recip) = {1},
    Uargs(a__sqr) = {1}, Uargs(a__dbl) = {1}, Uargs(a__add) = {1, 2},
    Uargs(a__first) = {1, 2}
  
  TcT has computed the following constructor-based matrix
  interpretation satisfying not(EDA).
  
        [a__terms](x1) = [1 3] x1 + [6]           
                         [0 1]      [7]           
                                                  
        [cons](x1, x2) = [1 2] x1 + [2]           
                         [0 1]      [5]           
                                                  
           [recip](x1) = [1 0] x1 + [0]           
                         [0 1]      [2]           
                                                  
          [a__sqr](x1) = [1 0] x1 + [0]           
                         [0 1]      [0]           
                                                  
            [mark](x1) = [1 1] x1 + [0]           
                         [0 1]      [0]           
                                                  
           [terms](x1) = [1 3] x1 + [4]           
                         [0 1]      [7]           
                                                  
               [s](x1) = [0]                      
                         [0]                      
                                                  
                   [0] = [0]                      
                         [0]                      
                                                  
         [add](x1, x2) = [1 0] x1 + [1 1] x2 + [0]
                         [0 1]      [0 1]      [0]
                                                  
             [sqr](x1) = [1 0] x1 + [0]           
                         [0 1]      [0]           
                                                  
             [dbl](x1) = [1 0] x1 + [0]           
                         [0 1]      [0]           
                                                  
          [a__dbl](x1) = [1 0] x1 + [0]           
                         [0 1]      [0]           
                                                  
      [a__add](x1, x2) = [1 0] x1 + [1 1] x2 + [0]
                         [0 1]      [0 1]      [0]
                                                  
    [a__first](x1, x2) = [1 0] x1 + [1 1] x2 + [0]
                         [0 1]      [0 1]      [0]
                                                  
                 [nil] = [0]                      
                         [0]                      
                                                  
       [first](x1, x2) = [1 0] x1 + [1 1] x2 + [0]
                         [0 1]      [0 1]      [0]
  
  The order satisfies the following ordering constraints:
  
                   [a__terms(N)] =  [1 3] N + [6]                              
                                    [0 1]     [7]                              
                                 >= [1 3] N + [6]                              
                                    [0 1]     [7]                              
                                 =  [cons(recip(a__sqr(mark(N))), terms(s(N)))]
                                                                               
                   [a__terms(X)] =  [1 3] X + [6]                              
                                    [0 1]     [7]                              
                                 >  [1 3] X + [4]                              
                                    [0 1]     [7]                              
                                 =  [terms(X)]                                 
                                                                               
                     [a__sqr(X)] =  [1 0] X + [0]                              
                                    [0 1]     [0]                              
                                 >= [1 0] X + [0]                              
                                    [0 1]     [0]                              
                                 =  [sqr(X)]                                   
                                                                               
                  [a__sqr(s(X))] =  [0]                                        
                                    [0]                                        
                                 >= [0]                                        
                                    [0]                                        
                                 =  [s(add(sqr(X), dbl(X)))]                   
                                                                               
                   [a__sqr(0())] =  [0]                                        
                                    [0]                                        
                                 >= [0]                                        
                                    [0]                                        
                                 =  [0()]                                      
                                                                               
            [mark(cons(X1, X2))] =  [1 3] X1 + [7]                             
                                    [0 1]      [5]                             
                                 >  [1 3] X1 + [2]                             
                                    [0 1]      [5]                             
                                 =  [cons(mark(X1), X2)]                       
                                                                               
                [mark(recip(X))] =  [1 1] X + [2]                              
                                    [0 1]     [2]                              
                                 >  [1 1] X + [0]                              
                                    [0 1]     [2]                              
                                 =  [recip(mark(X))]                           
                                                                               
                [mark(terms(X))] =  [1 4] X + [11]                             
                                    [0 1]     [7]                              
                                 >  [1 4] X + [6]                              
                                    [0 1]     [7]                              
                                 =  [a__terms(mark(X))]                        
                                                                               
                    [mark(s(X))] =  [0]                                        
                                    [0]                                        
                                 >= [0]                                        
                                    [0]                                        
                                 =  [s(X)]                                     
                                                                               
                     [mark(0())] =  [0]                                        
                                    [0]                                        
                                 >= [0]                                        
                                    [0]                                        
                                 =  [0()]                                      
                                                                               
             [mark(add(X1, X2))] =  [1 1] X1 + [1 2] X2 + [0]                  
                                    [0 1]      [0 1]      [0]                  
                                 >= [1 1] X1 + [1 2] X2 + [0]                  
                                    [0 1]      [0 1]      [0]                  
                                 =  [a__add(mark(X1), mark(X2))]               
                                                                               
                  [mark(sqr(X))] =  [1 1] X + [0]                              
                                    [0 1]     [0]                              
                                 >= [1 1] X + [0]                              
                                    [0 1]     [0]                              
                                 =  [a__sqr(mark(X))]                          
                                                                               
                  [mark(dbl(X))] =  [1 1] X + [0]                              
                                    [0 1]     [0]                              
                                 >= [1 1] X + [0]                              
                                    [0 1]     [0]                              
                                 =  [a__dbl(mark(X))]                          
                                                                               
                   [mark(nil())] =  [0]                                        
                                    [0]                                        
                                 >= [0]                                        
                                    [0]                                        
                                 =  [nil()]                                    
                                                                               
           [mark(first(X1, X2))] =  [1 1] X1 + [1 2] X2 + [0]                  
                                    [0 1]      [0 1]      [0]                  
                                 >= [1 1] X1 + [1 2] X2 + [0]                  
                                    [0 1]      [0 1]      [0]                  
                                 =  [a__first(mark(X1), mark(X2))]             
                                                                               
                     [a__dbl(X)] =  [1 0] X + [0]                              
                                    [0 1]     [0]                              
                                 >= [1 0] X + [0]                              
                                    [0 1]     [0]                              
                                 =  [dbl(X)]                                   
                                                                               
                  [a__dbl(s(X))] =  [0]                                        
                                    [0]                                        
                                 >= [0]                                        
                                    [0]                                        
                                 =  [s(s(dbl(X)))]                             
                                                                               
                   [a__dbl(0())] =  [0]                                        
                                    [0]                                        
                                 >= [0]                                        
                                    [0]                                        
                                 =  [0()]                                      
                                                                               
                [a__add(X1, X2)] =  [1 0] X1 + [1 1] X2 + [0]                  
                                    [0 1]      [0 1]      [0]                  
                                 >= [1 0] X1 + [1 1] X2 + [0]                  
                                    [0 1]      [0 1]      [0]                  
                                 =  [add(X1, X2)]                              
                                                                               
               [a__add(s(X), Y)] =  [1 1] Y + [0]                              
                                    [0 1]     [0]                              
                                 >= [0]                                        
                                    [0]                                        
                                 =  [s(add(X, Y))]                             
                                                                               
                [a__add(0(), X)] =  [1 1] X + [0]                              
                                    [0 1]     [0]                              
                                 >= [1 1] X + [0]                              
                                    [0 1]     [0]                              
                                 =  [mark(X)]                                  
                                                                               
              [a__first(X1, X2)] =  [1 0] X1 + [1 1] X2 + [0]                  
                                    [0 1]      [0 1]      [0]                  
                                 >= [1 0] X1 + [1 1] X2 + [0]                  
                                    [0 1]      [0 1]      [0]                  
                                 =  [first(X1, X2)]                            
                                                                               
    [a__first(s(X), cons(Y, Z))] =  [1 3] Y + [7]                              
                                    [0 1]     [5]                              
                                 >  [1 3] Y + [2]                              
                                    [0 1]     [5]                              
                                 =  [cons(mark(Y), first(X, Z))]               
                                                                               
              [a__first(0(), X)] =  [1 1] X + [0]                              
                                    [0 1]     [0]                              
                                 >= [0]                                        
                                    [0]                                        
                                 =  [nil()]                                    
                                                                               

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 Trs:
  { mark(sqr(X)) -> a__sqr(mark(X))
  , mark(dbl(X)) -> a__dbl(mark(X)) }
Weak Trs:
  { a__terms(N) -> cons(recip(a__sqr(mark(N))), terms(s(N)))
  , a__terms(X) -> terms(X)
  , a__sqr(X) -> sqr(X)
  , a__sqr(s(X)) -> s(add(sqr(X), dbl(X)))
  , a__sqr(0()) -> 0()
  , mark(cons(X1, X2)) -> cons(mark(X1), X2)
  , mark(recip(X)) -> recip(mark(X))
  , mark(terms(X)) -> a__terms(mark(X))
  , mark(s(X)) -> s(X)
  , mark(0()) -> 0()
  , mark(add(X1, X2)) -> a__add(mark(X1), mark(X2))
  , mark(nil()) -> nil()
  , mark(first(X1, X2)) -> a__first(mark(X1), mark(X2))
  , a__dbl(X) -> dbl(X)
  , a__dbl(s(X)) -> s(s(dbl(X)))
  , a__dbl(0()) -> 0()
  , a__add(X1, X2) -> add(X1, X2)
  , a__add(s(X), Y) -> s(add(X, Y))
  , a__add(0(), X) -> mark(X)
  , a__first(X1, X2) -> first(X1, X2)
  , a__first(s(X), cons(Y, Z)) -> cons(mark(Y), first(X, Z))
  , a__first(0(), X) -> nil() }
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.

Trs:
  { mark(sqr(X)) -> a__sqr(mark(X))
  , mark(dbl(X)) -> a__dbl(mark(X)) }

The induced complexity on above rules (modulo remaining rules) is
YES(?,O(n^2)) . These rules are moved into the corresponding weak
component(s).

Sub-proof:
----------
  The following argument positions are usable:
    Uargs(a__terms) = {1}, Uargs(cons) = {1}, Uargs(recip) = {1},
    Uargs(a__sqr) = {1}, Uargs(a__dbl) = {1}, Uargs(a__add) = {1, 2},
    Uargs(a__first) = {1, 2}
  
  TcT has computed the following constructor-based matrix
  interpretation satisfying not(EDA).
  
        [a__terms](x1) = [1 7] x1 + [7]           
                         [0 1]      [4]           
                                                  
        [cons](x1, x2) = [1 0] x1 + [0]           
                         [0 1]      [0]           
                                                  
           [recip](x1) = [1 4] x1 + [0]           
                         [0 1]      [2]           
                                                  
          [a__sqr](x1) = [1 0] x1 + [1]           
                         [0 1]      [1]           
                                                  
            [mark](x1) = [1 2] x1 + [1]           
                         [0 1]      [0]           
                                                  
           [terms](x1) = [1 7] x1 + [4]           
                         [0 1]      [4]           
                                                  
               [s](x1) = [0]                      
                         [0]                      
                                                  
                   [0] = [0]                      
                         [0]                      
                                                  
         [add](x1, x2) = [1 3] x1 + [1 5] x2 + [4]
                         [0 1]      [0 1]      [1]
                                                  
             [sqr](x1) = [1 0] x1 + [1]           
                         [0 1]      [1]           
                                                  
             [dbl](x1) = [1 0] x1 + [0]           
                         [0 1]      [1]           
                                                  
          [a__dbl](x1) = [1 0] x1 + [0]           
                         [0 1]      [1]           
                                                  
      [a__add](x1, x2) = [1 3] x1 + [1 5] x2 + [4]
                         [0 1]      [0 1]      [1]
                                                  
    [a__first](x1, x2) = [1 6] x1 + [1 7] x2 + [4]
                         [0 1]      [0 1]      [1]
                                                  
                 [nil] = [0]                      
                         [0]                      
                                                  
       [first](x1, x2) = [1 6] x1 + [1 7] x2 + [4]
                         [0 1]      [0 1]      [1]
  
  The order satisfies the following ordering constraints:
  
                   [a__terms(N)] =  [1 7] N + [7]                              
                                    [0 1]     [4]                              
                                 >  [1 6] N + [6]                              
                                    [0 1]     [3]                              
                                 =  [cons(recip(a__sqr(mark(N))), terms(s(N)))]
                                                                               
                   [a__terms(X)] =  [1 7] X + [7]                              
                                    [0 1]     [4]                              
                                 >  [1 7] X + [4]                              
                                    [0 1]     [4]                              
                                 =  [terms(X)]                                 
                                                                               
                     [a__sqr(X)] =  [1 0] X + [1]                              
                                    [0 1]     [1]                              
                                 >= [1 0] X + [1]                              
                                    [0 1]     [1]                              
                                 =  [sqr(X)]                                   
                                                                               
                  [a__sqr(s(X))] =  [1]                                        
                                    [1]                                        
                                 >  [0]                                        
                                    [0]                                        
                                 =  [s(add(sqr(X), dbl(X)))]                   
                                                                               
                   [a__sqr(0())] =  [1]                                        
                                    [1]                                        
                                 >  [0]                                        
                                    [0]                                        
                                 =  [0()]                                      
                                                                               
            [mark(cons(X1, X2))] =  [1 2] X1 + [1]                             
                                    [0 1]      [0]                             
                                 >= [1 2] X1 + [1]                             
                                    [0 1]      [0]                             
                                 =  [cons(mark(X1), X2)]                       
                                                                               
                [mark(recip(X))] =  [1 6] X + [5]                              
                                    [0 1]     [2]                              
                                 >  [1 6] X + [1]                              
                                    [0 1]     [2]                              
                                 =  [recip(mark(X))]                           
                                                                               
                [mark(terms(X))] =  [1 9] X + [13]                             
                                    [0 1]     [4]                              
                                 >  [1 9] X + [8]                              
                                    [0 1]     [4]                              
                                 =  [a__terms(mark(X))]                        
                                                                               
                    [mark(s(X))] =  [1]                                        
                                    [0]                                        
                                 >  [0]                                        
                                    [0]                                        
                                 =  [s(X)]                                     
                                                                               
                     [mark(0())] =  [1]                                        
                                    [0]                                        
                                 >  [0]                                        
                                    [0]                                        
                                 =  [0()]                                      
                                                                               
             [mark(add(X1, X2))] =  [1 5] X1 + [1 7] X2 + [7]                  
                                    [0 1]      [0 1]      [1]                  
                                 >  [1 5] X1 + [1 7] X2 + [6]                  
                                    [0 1]      [0 1]      [1]                  
                                 =  [a__add(mark(X1), mark(X2))]               
                                                                               
                  [mark(sqr(X))] =  [1 2] X + [4]                              
                                    [0 1]     [1]                              
                                 >  [1 2] X + [2]                              
                                    [0 1]     [1]                              
                                 =  [a__sqr(mark(X))]                          
                                                                               
                  [mark(dbl(X))] =  [1 2] X + [3]                              
                                    [0 1]     [1]                              
                                 >  [1 2] X + [1]                              
                                    [0 1]     [1]                              
                                 =  [a__dbl(mark(X))]                          
                                                                               
                   [mark(nil())] =  [1]                                        
                                    [0]                                        
                                 >  [0]                                        
                                    [0]                                        
                                 =  [nil()]                                    
                                                                               
           [mark(first(X1, X2))] =  [1 8] X1 + [1 9] X2 + [7]                  
                                    [0 1]      [0 1]      [1]                  
                                 >  [1 8] X1 + [1 9] X2 + [6]                  
                                    [0 1]      [0 1]      [1]                  
                                 =  [a__first(mark(X1), mark(X2))]             
                                                                               
                     [a__dbl(X)] =  [1 0] X + [0]                              
                                    [0 1]     [1]                              
                                 >= [1 0] X + [0]                              
                                    [0 1]     [1]                              
                                 =  [dbl(X)]                                   
                                                                               
                  [a__dbl(s(X))] =  [0]                                        
                                    [1]                                        
                                 >= [0]                                        
                                    [0]                                        
                                 =  [s(s(dbl(X)))]                             
                                                                               
                   [a__dbl(0())] =  [0]                                        
                                    [1]                                        
                                 >= [0]                                        
                                    [0]                                        
                                 =  [0()]                                      
                                                                               
                [a__add(X1, X2)] =  [1 3] X1 + [1 5] X2 + [4]                  
                                    [0 1]      [0 1]      [1]                  
                                 >= [1 3] X1 + [1 5] X2 + [4]                  
                                    [0 1]      [0 1]      [1]                  
                                 =  [add(X1, X2)]                              
                                                                               
               [a__add(s(X), Y)] =  [1 5] Y + [4]                              
                                    [0 1]     [1]                              
                                 >  [0]                                        
                                    [0]                                        
                                 =  [s(add(X, Y))]                             
                                                                               
                [a__add(0(), X)] =  [1 5] X + [4]                              
                                    [0 1]     [1]                              
                                 >  [1 2] X + [1]                              
                                    [0 1]     [0]                              
                                 =  [mark(X)]                                  
                                                                               
              [a__first(X1, X2)] =  [1 6] X1 + [1 7] X2 + [4]                  
                                    [0 1]      [0 1]      [1]                  
                                 >= [1 6] X1 + [1 7] X2 + [4]                  
                                    [0 1]      [0 1]      [1]                  
                                 =  [first(X1, X2)]                            
                                                                               
    [a__first(s(X), cons(Y, Z))] =  [1 7] Y + [4]                              
                                    [0 1]     [1]                              
                                 >  [1 2] Y + [1]                              
                                    [0 1]     [0]                              
                                 =  [cons(mark(Y), first(X, Z))]               
                                                                               
              [a__first(0(), X)] =  [1 7] X + [4]                              
                                    [0 1]     [1]                              
                                 >  [0]                                        
                                    [0]                                        
                                 =  [nil()]                                    
                                                                               

We return to the main proof.

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

Weak Trs:
  { a__terms(N) -> cons(recip(a__sqr(mark(N))), terms(s(N)))
  , a__terms(X) -> terms(X)
  , a__sqr(X) -> sqr(X)
  , a__sqr(s(X)) -> s(add(sqr(X), dbl(X)))
  , a__sqr(0()) -> 0()
  , mark(cons(X1, X2)) -> cons(mark(X1), X2)
  , mark(recip(X)) -> recip(mark(X))
  , mark(terms(X)) -> a__terms(mark(X))
  , mark(s(X)) -> s(X)
  , mark(0()) -> 0()
  , mark(add(X1, X2)) -> a__add(mark(X1), mark(X2))
  , mark(sqr(X)) -> a__sqr(mark(X))
  , mark(dbl(X)) -> a__dbl(mark(X))
  , mark(nil()) -> nil()
  , mark(first(X1, X2)) -> a__first(mark(X1), mark(X2))
  , a__dbl(X) -> dbl(X)
  , a__dbl(s(X)) -> s(s(dbl(X)))
  , a__dbl(0()) -> 0()
  , a__add(X1, X2) -> add(X1, X2)
  , a__add(s(X), Y) -> s(add(X, Y))
  , a__add(0(), X) -> mark(X)
  , a__first(X1, X2) -> first(X1, X2)
  , a__first(s(X), cons(Y, Z)) -> cons(mark(Y), first(X, Z))
  , a__first(0(), X) -> nil() }
Obligation:
  innermost runtime complexity
Answer:
  YES(O(1),O(1))

Empty rules are trivially bounded

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