pysat: rhs of sum must be constaint
from .solver_interface import SolverInterface, SolverStatus, ExitStatus
from ..expressions.core import Expression, Comparison, Operator
from ..expressions.variables import _BoolVarImpl, NegBoolView, boolvar
-from ..expressions.utils import is_any_list
+from ..expressions.utils import is_any_list, is_int
from ..transformations.get_variables import get_variables
from ..transformations.to_cnf import to_cnf
@@ -248,6 +248,8 @@ class CPM_pysat(SolverInterface):
isinstance(v, _BoolVarImpl) for v in cpm_expr.args[0].args):
lits = self.solver_vars(cpm_expr.args[0].args)
bound = cpm_expr.args[1]
+ if not is_int(bound):
+ raise NotImplementedError(f"PySAT sum: rhs `{bound}` type {type(bound)} not supported")
clauses = []
if cpm_expr.name == "<":
