def generate_uncovered_set(q, uncovered_intervals):
    """
    Returns set {k | 0 <=k < q, [k, (k+1)] is uncovered}
    from uncoverd_intervals which is a list of componenents.

    EXAMPLES::

        sage: from cutgeneratingfunctionology.igp import *
        sage: uncovered_intervals = [set([0,2]), set([3,4])]
        sage: generate_uncovered_set(5, uncovered_intervals)
        {0, 2, 3, 4}
    """
    uncovered_set = set([])
    for component in uncovered_intervals:
        uncovered_set.update(component)
    return uncovered_set
