code: protected MatchResult addOrCheckDefinition(Variable variable, BindingSet bindingSet) {
          bindingSet = addOrCheckDefinition(varName, variable, bindingSet);
          return bindingSet != null ? new MatchResult(this, bindingSet) : null;
      }
docs: Add a variable definition to the given BindingSet, or if there is an
  existing definition, make sure it is consistent with the new definition.
  
  @param variable
  the Variable which should be added or checked for consistency
  @param bindingSet
  the existing set of bindings
  @return a MatchResult containing the updated BindingSet (if the variable
  is consistent with the previous bindings), or null if the new
  variable is inconsistent with the previous bindings