A rule of a logic program. More...
#include <logic_program_types.h>
Public Member Functions | |
| Rule & | addHead (Var v) |
| Adds v as a head of this rule. | |
| Rule & | addToBody (Var v, bool pos, weight_t w=1) |
| Adds v to the positive/negative body of the rule. | |
| bool | bodyHasBound () const |
| bool | bodyHasWeights () const |
| bool | bodyIsSet () const |
| weight_t | bound () const |
| Returns the lower bound of the rule. | |
| void | clear () |
| Resets the rule. | |
| Rule (RuleType t=ENDRULE) | |
| Rule & | setBound (weight_t bound) |
| Sets the lower bound of the rule. | |
| Rule & | setType (RuleType t) |
| Sets the type of the rule. | |
| void | swap (Rule &o) |
| Swaps *this with o. | |
| RuleType | type () const |
| Returns the rule's type. | |
Public Attributes | |
| WeightLitVec | body |
| VarVec | heads |
Private Member Functions | |
| Rule & | operator= (const Rule &) |
| Rule (const Rule &) | |
Private Attributes | |
| weight_t | bound_ |
| RuleType | type_ |
A rule of a logic program.
Objects of this class represent one rule of a logic program.
Definition at line 135 of file logic_program_types.h.
| Clasp::Asp::Rule::Rule | ( | RuleType | t = ENDRULE | ) | [inline, explicit] |
Definition at line 137 of file logic_program_types.h.
| Clasp::Asp::Rule::Rule | ( | const Rule & | ) | [private] |
| Rule & Clasp::Asp::Rule::addHead | ( | Var | v | ) |
Adds v as a head of this rule.
Definition at line 49 of file logic_program_types.cpp.
| Rule & Clasp::Asp::Rule::addToBody | ( | Var | v, |
| bool | pos, | ||
| weight_t | w = 1 |
||
| ) |
Adds v to the positive/negative body of the rule.
Definition at line 57 of file logic_program_types.cpp.
| bool Clasp::Asp::Rule::bodyHasBound | ( | ) | const [inline] |
Definition at line 176 of file logic_program_types.h.
| bool Clasp::Asp::Rule::bodyHasWeights | ( | ) | const [inline] |
Definition at line 175 of file logic_program_types.h.
| bool Clasp::Asp::Rule::bodyIsSet | ( | ) | const [inline] |
Definition at line 177 of file logic_program_types.h.
| weight_t Clasp::Asp::Rule::bound | ( | ) | const [inline] |
Returns the lower bound of the rule.
Definition at line 173 of file logic_program_types.h.
| void Clasp::Asp::Rule::clear | ( | ) |
Resets the rule.
Definition at line 41 of file logic_program_types.cpp.
| Rule& Clasp::Asp::Rule::setBound | ( | weight_t | bound | ) | [inline] |
Sets the lower bound of the rule.
Definition at line 167 of file logic_program_types.h.
| Rule& Clasp::Asp::Rule::setType | ( | RuleType | t | ) | [inline] |
Sets the type of the rule.
Definition at line 155 of file logic_program_types.h.
| void Clasp::Asp::Rule::swap | ( | Rule & | o | ) | [inline] |
Swaps *this with o.
Definition at line 144 of file logic_program_types.h.
| RuleType Clasp::Asp::Rule::type | ( | ) | const [inline] |
Returns the rule's type.
Definition at line 161 of file logic_program_types.h.
Body literals of this rule.
Definition at line 184 of file logic_program_types.h.
weight_t Clasp::Asp::Rule::bound_ [private] |
Definition at line 188 of file logic_program_types.h.
List of rule heads.
Definition at line 183 of file logic_program_types.h.
RuleType Clasp::Asp::Rule::type_ [private] |
Definition at line 189 of file logic_program_types.h.