original_docstring: 
          Apply the rewrite rule on a term if it is possible.
  
          Args:
              term: The term to apply the rule on.
              rewrite_rules: A list of rewrite rules to use to reduce the
                  conditions of the rule.
  
          Returns:
              A new term with where the rewrite rule has been applied.
          
docstring: Apply the rewrite rule on a term if it is possible.
docstring_tokens: Apply the rewrite rule on a term if it is possible .
code: def apply(self, term, rewrite_rules=[]):
          """
          Apply the rewrite rule on a term if it is possible.
  
          Args:
              term: The term to apply the rule on.
              rewrite_rules: A list of rewrite rules to use to reduce the
                  conditions of the rule.
  
          Returns:
              A new term with where the rewrite rule has been applied.
          """
          # Recursive application of the rule on the arguments of the term
          # -> left-right innermost strategy.
          args = []
          for arg in term.args:
              args.append(self.apply(arg))
  
          new_term = Term(term.head, tuple(args))
  
          matching, binding = new_term.match(self.lhs)
          if matching:
              if self.conditions:
                  for condition in self.conditions:
                      if condition[0].apply_binding(binding)\
                                     .reduce(rewrite_rules) !=\
                         condition[1].apply_binding(binding)\
                                     .reduce(rewrite_rules):
                          return new_term
              return Term(self.rhs.head, self.rhs.args).apply_binding(binding)
          else:
              return new_term
code_tokens: def apply ( self , term , rewrite_rules = [ ] ) : args = [ ] for arg in term . args : args . append ( self . apply ( arg ) ) new_term = Term ( term . head , tuple ( args ) ) matching , binding = new_term . match ( self . lhs ) if matching : if self . conditions : for condition in self . conditions : if condition [ 0 ] . apply_binding ( binding ) . reduce ( rewrite_rules ) != condition [ 1 ] . apply_binding ( binding ) . reduce ( rewrite_rules ) : return new_term return Term ( self . rhs . head , self . rhs . args ) . apply_binding ( binding ) else : return new_term
short_docstring: Apply the rewrite rule on a term if it is possible.
short_docstring_tokens: Apply the rewrite rule on a term if it is possible .
comment: """
          Apply the rewrite rule on a term if it is possible.
  
          Args:
              term: The term to apply the rule on.
              rewrite_rules: A list of rewrite rules to use to reduce the
                  conditions of the rule.
  
          Returns:
              A new term with where the rewrite rule has been applied.
          """$SEP$# Recursive application of the rule on the arguments of the term$SEP$# -> left-right innermost strategy.