def int2boolset(i, x):
    """
    Accepts an integer i, a list of pyeda boolean variables x, and converts
    the integer into the set of boolean values corresponding to its
    representation in binary form. 
    
    For example, if there are four boolean variables, and it is given
    the integer 14, which has the binary representation "1110", then
    it will return the set {x[0], x[1], x[2], ~x[3]}.

    >>> respvarList = [ 'cat_goshawk', 'rat_goshawk', 'cat_tropicBird', 'rat_tropicBird']
    >>> boolvarList = list(map(exprvar, respvarList))
    >>> boolvarList
    [cat_goshawk, rat_goshawk, cat_tropicBird, rat_tropicBird]
    >>> boolset14 = int2boolset(14,boolvarList) # {cat_goshawk, cat_tropicBird, rat_goshawk, ~rat_tropicBird}
    >>> ~boolvarList[3] in boolset14
    True
    >>> boolset15 = int2boolset(15,boolvarList) # {cat_goshawk, cat_tropicBird, rat_goshawk, rat_tropicBird}
    >>> ~boolvarList[3] in boolset15
    False
    """

    boolLen = len(x)
    miniStr = '{:0' + str(boolLen) + 'b}'
    iBinstr = miniStr.format(i)
    boolset = set(xval if int(ival) else ~xval for ival,xval in zip(iBinstr,x))

    return boolset