def rem_var(var, subs):
    """Deletes any substitutions of var in subs."""
    newsubs = subs.copy()
    try:
        del newsubs[var.constant()]
    except KeyError:
        pass
    try:
        del newsubs[var.variable()]
    except KeyError:
        pass
    return newsubs