clingo
|
Stores a reference to the constraint that implied a literal. More...
#include <constraint.h>
Public Types | |
enum | Type { generic_constraint = 0, ternary_constraint = 1, binary_constraint = 2 } |
Public Member Functions | |
Antecedent () | |
Creates a null Antecedent. More... | |
Antecedent (const Literal &p) | |
Creates an Antecedent from the literal p. More... | |
Antecedent (const Literal &p, const Literal &q) | |
Creates an Antecedent from the literals p and q. More... | |
Antecedent (Constraint *con) | |
Creates an Antecedent from the Constraint con. More... | |
bool | isNull () const |
Returns true if this antecedent does not refer to any constraint. More... | |
Type | type () const |
Returns the antecedent's type. More... | |
bool | learnt () const |
Returns true if the antecedent is a learnt nogood. More... | |
Constraint * | constraint () const |
Extracts the constraint-pointer stored in this object. More... | |
Literal | firstLiteral () const |
Extracts the first literal stored in this object. More... | |
Literal | secondLiteral () const |
Extracts the second literal stored in this object. More... | |
void | reason (Solver &s, Literal p, LitVec &lits) const |
Returns the reason for p. More... | |
template<class S > | |
bool | minimize (S &s, Literal p, CCMinRecursive *rec) const |
bool | operator== (const Constraint *con) const |
Returns true iff the antecedent refers to the constraint con. More... | |
uint64 | asUint () const |
uint64 & | asUint () |
Static Public Member Functions | |
static bool | checkPlatformAssumptions () |
Checks whether the imlementation-assumptions hold on this platform. More... | |
Stores a reference to the constraint that implied a literal.
Stores a reference to the constraint that implied a certain literal or null if the literal has no antecedent (i.e. is a decision literal or a top-level fact).
The class stores all three representations in one 64-bit integer and makes the following platform assumptions:
These assumptions are not guaranteed by the C++ Standard but should nontheless hold on most 32- and 64-bit platforms.
From the 64-bits the first 2-bits encode the type stored:
|
inline |
Creates a null Antecedent.
|
inline |
Creates an Antecedent from the literal p.
Creates an Antecedent from the literals p and q.
|
inline |
Creates an Antecedent from the Constraint con.
|
inline |
|
inline |
|
static |
Checks whether the imlementation-assumptions hold on this platform.
throws PlatformError on error
|
inline |
Extracts the constraint-pointer stored in this object.
|
inline |
Extracts the first literal stored in this object.
|
inline |
Returns true if this antecedent does not refer to any constraint.
|
inline |
Returns true if the antecedent is a learnt nogood.
|
inline |
|
inline |
Returns true iff the antecedent refers to the constraint con.
Returns the reason for p.
|
inline |
Extracts the second literal stored in this object.
|
inline |
Returns the antecedent's type.