'Replace all instances of variable v with expression E in self,
where v is free in self.'

def replace(self, variable, expression, replace_bound=False, alpha_convert=True):

    result = PossibleAntecedents()
    for item in self:
        if (item == variable):
            self.append(expression)
        else:
            self.append(item)
    return result
