clingo
|
A literal is a variable or its negation. More...
#include <literal.h>
Public Member Functions | |
Literal () | |
The default constructor creates the positive literal of the special sentinel var. More... | |
Literal (Var var, bool sign) | |
Creates a literal of the variable var with sign s. More... | |
uint32 | index () const |
Returns the unique index of this literal. More... | |
uint32 & | asUint () |
uint32 | asUint () const |
Var | var () const |
Returns the variable of the literal. More... | |
bool | sign () const |
Returns the sign of the literal. More... | |
void | swap (Literal &other) |
void | watch () |
Sets the watched-flag of this literal. More... | |
void | clearWatch () |
Clears the watched-flag of this literal. More... | |
bool | watched () const |
Returns true if the watched-flag of this literal is set. More... | |
Literal | operator~ () const |
Returns the complimentary literal of this literal. More... | |
bool | operator== (const Literal &rhs) const |
Equality-Comparison for literals. More... | |
Static Public Member Functions | |
static Literal | fromIndex (uint32 idx) |
Creates a literal from an index. More... | |
static Literal | fromRep (uint32 rep) |
Creates a literal from an unsigned integer. More... | |
A literal is a variable or its negation.
A literal is determined by two things: a sign and a variable index.
|
inline |
The default constructor creates the positive literal of the special sentinel var.
|
inline |
Creates a literal of the variable var with sign s.
var | The literal's variable. |
s | true if new literal should be negative. |
|
inline |
|
inline |
|
inline |
Clears the watched-flag of this literal.
|
inlinestatic |
Creates a literal from an index.
|
inlinestatic |
Creates a literal from an unsigned integer.
|
inline |
Returns the unique index of this literal.
|
inline |
Equality-Comparison for literals.
Two Literals p and q are equal, iff
|
inline |
|
inline |
Returns the sign of the literal.
|
inline |
|
inline |
Returns the variable of the literal.
|
inline |
Sets the watched-flag of this literal.
|
inline |
Returns true if the watched-flag of this literal is set.