def gen_apsubset(AP, intrep):
    """Generate set of atomic propositions corresponding to integer

    >>> gen_apsubset(AP=("p", "q"), intrep=2)
    set(['q'])
    """
    return set([AP[i] for i in range(len(AP)) if ((intrep >> i) & 1) != 0])