def resolution(table, wvd):
    rest = set(wvd.values())
    match = next(table)
    while match:
        (keep, discard) = merge(match)
        if discard:
            for a in discard:
                table.remove(a)
            for a in keep:
                (yield a)
            for (a, i) in match:
                rest.discard(a)
        match = next(table)
    for a in rest:
        (yield a)
def resolution(table, wvd):
    rest = set(wvd.values())
    match = next(table)
    while match:
        (keep, discard) = merge(match)
        if discard:
            for a in discard:
                table.remove(a)
            for a in keep:
                (yield a)
            for (a, i) in match:
                rest.discard(a)
        match = next(table)
    for a in rest:
        (yield a)