@classmethod
def equal_to_constraint(cls, variables, value):
    """Clauses encoding a "equal to" constraint
     
        E.g. X1 + X2 + X3 + X4 = 1
     
        (X1 v X2 v X3 v X4)
        (~X1 v ~X2)
        (~X1 v ~X3)
        (~X1 v ~X4)
        (~X2 v ~X3)
        (~X2 v ~X4)
        (~X3 v ~X4)
     
        Parameters
        ----------
        variables : list of variables
           variables in the constraint
        value: int
           target values
     
        Returns
        -------
            a list of clauses
        """
    for c in cls.less_or_equal_constraint(variables, value):
        yield c
    for c in cls.greater_or_equal_constraint(variables, value):
        yield c
