'A binding is consistent with the dict if its variable is not already bound, OR if its
variable is already bound to its argument.
:param variable: ``Variable`` The variable to bind
:param binding: ``Expression`` The atomic to which \'variable\' should be bound
:raise BindingException: If the variable cannot be bound in this dictionary'

def __setitem__(self, variable, binding):

    assert isinstance(variable, Variable)
    assert isinstance(binding, Expression)
    try:
        existing = self[variable]
    except KeyError:
        existing = None
    if ((not existing) or (binding == existing)):
        self.d[variable] = binding
    elif isinstance(binding, IndividualVariableExpression):
        try:
            existing = self[binding.variable]
        except KeyError:
            existing = None
        binding2 = VariableExpression(variable)
        if ((not existing) or (binding2 == existing)):
            self.d[binding.variable] = binding2
        else:
            raise BindingException((u'Variable    %s    already    bound    to    another    value' % variable))
    else:
        raise BindingException((u'Variable    %s    already    bound    to    another    value' % variable))
