def solvable(deps, names):
    """
    Return True if `names` form a solvable block, i.e. the set of names equals
    to the set of their prerequisites.
    """
    if not names: return False # Missing self-reference.

    dep_names = set()
    for name in names:
        dep_names.update(deps[name])

    return dep_names == set(names)