Adds a constraint in canonical form to the set of managed constraints. Note
that this detects constraints with exactly the same terms. In this case,
the constraint rhs is updated if the new one is lower or nothing is done
otherwise.
There are some preconditions, and the function will return false if they
are not met. The constraint can be added when the trail is not empty,
however given the current propagated assignment:
- The constraint cannot be conflicting.
- The constraint cannot have propagated at an earlier decision level.
ConflictingConstraint() returns the last PB constraint that caused a
conflict. Calling ClearConflictingConstraint() reset this to nullptr.
TODO(user): This is a hack to get the PB conflict, because the rest of
the solver API assume only clause conflict. Find a cleaner way?
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-08-06 UTC."],[[["The `PbConstraints` class in C++ manages a set of pseudo-Boolean constraints and their propagation within a constraint programming solver."],["It provides methods to add, delete, and access constraints, as well as functionality for propagation and conflict analysis."],["`PbConstraints` uses a trail to track assignments and allows for efficient backtracking during search."],["It includes features for managing constraint activity and statistics related to constraint lookups and updates."]]],["The `PbConstraints` class manages pseudo-Boolean constraints. Key actions include: adding constraints via `AddConstraint` (and `AddLearnedConstraint` for constraints to be deleted) and propagating them with `Propagate`. The class also handles constraint conflict detection through `ConflictingConstraint` and `ClearConflictingConstraint`. It supports activity tracking using functions like `BumpActivity`, `RescaleActivities` and `UpdateActivityIncrement`. Other actions include: retrieving statistics, getting reason of propagation, deleting constraints (`DeleteConstraint`) and resizing.\n"]]