'Return the expression to which \'variable\' is bound'

def __getitem__(self, variable):

    assert isinstance(variable, Variable)
    intermediate = self.d[variable]
    while intermediate:
        try:
            intermediate = self.d[intermediate]
        except KeyError:
            return intermediate
