or-toolsconstraint-programmingoperations-researchcp-sat

AddBoolOr and AddImplication in cp_sat solver


Hi I have difficulty understand the following code, can anyone help to explain? Thanks in advance!

model.AddBoolOr(x, y.Not(), b)
model.AddImplication(b, x)
model.AddImplication(b, y)

Solution

  • It is most likely wrong. It should be x.Not() in the AddBoolOr().

    It encodes b <=> x && y.