Public Member Functions |
| uint32 & | asUint () |
| uint32 | asUint () const |
| void | clearWatch () |
| | Clears the watched-flag of this literal.
|
| uint32 | index () const |
| | Returns the unique index of this literal.
|
| | Literal () |
| | The default constructor creates the positive literal of the special sentinel var.
|
| | Literal (Var var, bool sign) |
| | Creates a literal of the variable var with sign s.
|
| bool | operator== (const Literal &rhs) const |
| | Equality-Comparison for literals.
|
| Literal | operator~ () const |
| | Returns the complimentary literal of this literal.
|
| bool | sign () const |
| | Returns the sign of the literal.
|
| void | swap (Literal &other) |
| Var | var () const |
| | Returns the variable of the literal.
|
| void | watch () |
| | Sets the watched-flag of this literal.
|
| bool | watched () const |
| | Returns true if the watched-flag of this literal is set.
|
Static Public Member Functions |
| static Literal | fromIndex (uint32 idx) |
| | Creates a literal from an index.
|
| static Literal | fromRep (uint32 rep) |
| | Creates a literal from an unsigned integer.
|
Private Member Functions |
| | Literal (uint32 rep) |
Private Attributes |
| uint32 | rep_ |
A literal is a variable or its negation.
A literal is determined by two things: a sign and a variable index.
- Implementation:
- A literal's state is stored in a single 32-bit integer as follows:
- 30-bits : var-index
- 1-bit : sign, 1 if negative, 0 if positive
- 1-bit : watch-flag
Definition at line 80 of file literal.h.