C++ Reference: class VariablesAssignment
Note: This documentation is automatically generated.
Holds the current variable assignment of the solver.
Each variable can be unassigned or be assigned to true or false.
Method |
AssignFromTrueLiteral | Return type: void Arguments: Literal literal Makes the given literal true by assigning its underlying variable to either
true or false depending on the literal sign. This can only be called on an
unassigned variable.
|
GetTrueLiteralForAssignedVariable | Return type: Literal Arguments: BooleanVariable var Returns the literal of the given variable that is assigned to true.
That is, depending on the variable, it can be the positive literal or the
negative one. Only call this on an assigned variable.
|
LiteralIsAssigned | Return type: bool Arguments: Literal literal |
LiteralIsFalse | Return type: bool Arguments: Literal literal Literal getters. Note that both can be false, in which case the
corresponding variable is not assigned.
|
LiteralIsTrue | Return type: bool Arguments: Literal literal |
NumberOfVariables | Return type: int |
Resize | Return type: void Arguments: int num_variables |
UnassignLiteral | Return type: void Arguments: Literal literal Unassign the variable corresponding to the given literal.
This can only be called on an assigned variable.
|
VariableIsAssigned | Return type: bool Arguments: BooleanVariable var Returns true iff the given variable is assigned.
|
VariablesAssignment | |
VariablesAssignment | Return type: explicit Arguments: int num_variables |
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-08-06 UTC.
[null,null,["Last updated 2024-08-06 UTC."],[[["The `VariablesAssignment` class in C++ manages the assignment of variables within a solver, where each variable can be unassigned, true, or false."],["It provides methods to assign and unassign variables, check their assignment status, and retrieve the literal assigned to true for a given variable."],["The class allows resizing the number of variables and offers functionalities to determine if a literal or variable is assigned or has a specific truth value."],["Developers can access the literal corresponding to a variable's true assignment using `GetTrueLiteralForAssignedVariable`, ensuring the variable is assigned before calling this method."]]],["The `VariablesAssignment` class manages variable assignments in a solver, where each variable can be unassigned, true, or false. Key actions include assigning a literal to true via `AssignFromTrueLiteral`, retrieving the true literal of an assigned variable with `GetTrueLiteralForAssignedVariable`, and unassigning a literal using `UnassignLiteral`. Methods also allow checking if a literal/variable is assigned (`LiteralIsAssigned`, `VariableIsAssigned`) or if a literal is true/false (`LiteralIsTrue`, `LiteralIsFalse`). Other functions include resizing the assignment space (`Resize`) and getting the number of variables (`NumberOfVariables`).\n"]]