code: protected static BindingSet addOrCheckDefinition(String varName, Variable variable, BindingSet bindingSet) {
          Variable existingVariable = lookup(varName, bindingSet);
          if (existingVariable == null) {
              bindingSet = new BindingSet(new Binding(varName, variable), bindingSet);
          } else {
              if (!existingVariable.sameAs(variable)) {
                  LOG.debug("\tConflicting variable {}: {} != {}", varName, variable, existingVariable);
                  return null;
              }
          }
  
          return bindingSet;
      }
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 varName
  the name of the variable
  @param variable
  the Variable which should be added or checked for consistency
  @param bindingSet
  the existing set of bindings
  @return the updated BindingSet (if the variable is consistent with the
  previous bindings), or null if the new variable is inconsistent
  with the previous bindings