C++ Reference: class Trail
Note: This documentation is automatically generated.
The solver trail stores the assignment made by the solver in order. This class is responsible for maintaining the assignment of each variable and the information of each assignment.Method | |
---|---|
Assignment | Return type: |
AssignmentType | Return type: Arguments: Returns the "type" of an assignment (see AssignmentType). Note that this function never returns kSameReasonAs or kCachedReason, it instead returns the initial type that caused this assignment. As such, it is different from Info(var).type and the latter should not be used outside this class. |
ChangeReason | Return type: Arguments: Explicitly overwrite the reason so that the given propagator will be asked for it. This is currently only used by the BinaryImplicationGraph. |
CurrentDecisionLevel | Return type: |
DebugString | Return type: Print the current literals on the trail. |
Dequeue | Return type: |
Enqueue | Return type: Arguments: Enqueues the assignment that make the given literal true on the trail. This should only be called on unassigned variables. |
EnqueueSearchDecision | Return type: Arguments: Specific Enqueue() version for the search decision. |
EnqueueWithSameReasonAs | Return type: Arguments: Some constraints propagate a lot of literals at once. In these cases, it is more efficient to have all the propagated literals except the first one referring to the reason of the first of them. |
EnqueueWithStoredReason | Return type: Arguments: Enqueues the given literal using the current content of GetEmptyVectorToStoreReason() as the reason. This API is a bit more leanient and does not require the literal to be unassigned. If it is already assigned to false, then MutableConflict() will be set appropriately and this will return false otherwise this will enqueue the literal and returns true. |
EnqueueWithUnitReason | Return type: Arguments: Specific Enqueue() version for a fixed variable. |
FailingClause | Return type: Returns the last conflict. |
FailingSatClause | Return type: |
GetEmptyVectorToStoreReason | Return type: Arguments: This can be used to get a location at which the reason for the literal at trail_index on the trail can be stored. This clears the vector before returning it. |
GetEmptyVectorToStoreReason | Return type: Shortcut for GetEmptyVectorToStoreReason(Index()). |
Index | Return type: |
Info | Return type: Arguments: |
IteratorAt | Return type: Arguments: This accessor can return trail_.end(). operator[] cannot. This allows normal std:vector operations, such as assign(begin, end). |
MutableConflict | Return type: Generic interface to set the current failing clause. Returns the address of a vector where a client can store the current conflict. This vector will be returned by the FailingClause() call. |
NumberOfEnqueues | Return type: |
NumVariables | Return type: Getters. |
Reason | Return type: Arguments: Returns the reason why this variable was assigned. Note that this shouldn't be called on a variable at level zero, because we don't cleanup the reason data for these variables but the underlying clauses may have been deleted. |
ReferenceVarWithSameReason | Return type: Arguments: If a variable was propagated with EnqueueWithSameReasonAs(), returns its reference variable. Otherwise return the given variable. |
RegisterPropagator | Return type: Arguments: Registers a propagator. This assigns a unique id to this propagator and calls SetPropagatorId() on it. |
Resize | Return type: Arguments: |
SetDecisionLevel | Return type: Arguments: Changes the decision level used by the next Enqueue(). |
SetFailingSatClause | Return type: Arguments: Specific SatClause interface so we can update the conflict clause activity. Note that MutableConflict() automatically sets this to nullptr, so we can know whether or not the last conflict was caused by a clause. |
Trail | |
Untrail | Return type: Arguments: Reverts the trail and underlying assignment to the given target trail index. Note that we do not touch the assignment info. |