Skip to content

Boolean constants not handled in Global constraints #620

@peerjosse

Description

@peerjosse

erroneous solvers: ortools, choco, gurobi
working solvers: minizinc, z3

In the following program:

  • 3 of the 5 tested solvers gave an error
  • 2 of those 3 gave the same error on the same line of canonical_comparison
  • ortools gave an error I can't really place
import cpmpy as cp

m = cp.Model()

a = cp.boolvar()
b = cp.boolvar()
c = cp.boolvar()

m += cp.Xor([(cp.Xor([a, b, c])) <= True, ~((cp.Xor([a, b, c])) <= True)])

# m.solve(solver='ortools')     # not supported: model.get_or_make_boolean_index(boolval(True)) (in get_or_make_boolean_index)
# m.solve(solver='minizinc')    # returns no error
# m.solve(solver='z3')          # returns no error
# m.solve(solver='choco')       # lhs cannot be an integer at this point! (in canonical_comparison)
# m.solve(solver='gurobi')      # lhs cannot be an integer at this point! (in canonical_comparison)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions