'Return a formula with all terms in other removed from self.
If other contains term instances not in formula, this
function does not raise an exception.'

def __sub__(self, other):

    other = Formula(other)
    terms = copy.copy(self.terms)
    for term in other.terms:
        for i in range(len(terms)):
            if (terms[i].termname == term.termname):
                terms.pop(i)
                break
    f = Formula(terms)
    f.namespace = self.namespace
    return f
