|
void | destroy () |
| Destroys a body node created via create(LogicProgram& prg, uint32 id, const Rule& rule, const Rule::RData& rInfo). More...
|
|
BodyType | type () const |
|
uint32 | size () const |
| Returns the number of atoms in the body. More...
|
|
bool | noScc () const |
|
weight_t | bound () const |
| Returns the bound of this body, or size() if the body is a normal body. More...
|
|
weight_t | sumW () const |
| Returns the sum of the subgoals weights, or size() if the body is not a SUM_BODY. More...
|
|
Literal | goal (uint32 idx) const |
| Returns the idx'th subgoal as a literal. More...
|
|
weight_t | weight (uint32 idx) const |
| Returns the weight of the idx'th subgoal. More...
|
|
bool | isSupported () const |
| Returns true if the body node is supported. More...
|
|
bool | hasHeads () const |
| Returns true if this body defines any head. More...
|
|
head_iterator | heads_begin () const |
|
head_iterator | heads_end () const |
|
void | addHead (PrgHead *h, EdgeType t) |
| Adds a rule edge between this body and the given head. More...
|
|
bool | simplifyHeads (LogicProgram &prg, bool strong) |
| Simplifies the heads of this body and establishes set property. More...
|
|
bool | mergeHeads (LogicProgram &prg, PrgBody &heads, bool strong, bool simplify=true) |
|
void | removeHead (PrgHead *h, EdgeType t) |
|
bool | simplifyBody (LogicProgram &prg, bool strong, uint32 *eqId=0) |
| Simplifies the body, i.e. its predecessors-lists. More...
|
|
bool | simplify (LogicProgram &prg, bool strong, uint32 *eqId=0) |
| Calls simplifyBody() and/or simplifyHeads() if necessary. More...
|
|
bool | eqLits (WeightLitVec &vec, bool &sorted) const |
|
bool | propagateSupported (Var) |
| Notifies the body node about the fact that its positive subgoal v is supported. More...
|
|
bool | propagateAssigned (LogicProgram &prg, Literal p, ValueRep v) |
| Propagates the assignment of subgoal p. More...
|
|
bool | propagateAssigned (LogicProgram &prg, PrgHead *h, EdgeType t) |
| Propagates the assignment of a head. More...
|
|
bool | propagateValue (LogicProgram &prg, bool backprop) |
| Propagates the value of this body. More...
|
|
bool | addConstraints (const LogicProgram &prg, ClauseCreator &c) |
|
void | markDirty () |
|
void | markHeadsDirty () |
|
void | clearHeads () |
|
bool | resetSupported () |
|
void | assignVar (LogicProgram &prg) |
|
bool | assignValue (ValueRep v) |
|
uint32 | scc (const LogicProgram &prg) const |
|
| PrgNode (uint32 id, bool checkScc=true) |
| Creates a new node that corresponds to a literal that is false. More...
|
|
bool | relevant () const |
| Is the node still relevant or removed() resp. eq()? More...
|
|
bool | removed () const |
| Was the node removed? More...
|
|
bool | ignoreScc () const |
| Ignore the node during scc checking? More...
|
|
bool | eq () const |
| Returns true if this node is equivalent to some other node. More...
|
|
bool | seen () const |
|
bool | hasVar () const |
| Returns true if node has an associated variable in a solver. More...
|
|
Var | var () const |
| Returns the variable associated with this node or sentVar if no var is associated with this node. More...
|
|
Literal | literal () const |
| Returns the literal associated with this node or a sentinel literal if no var is associated with this node. More...
|
|
ValueRep | value () const |
| Returns the value currently assigned to this node. More...
|
|
uint32 | id () const |
| Returns the current id of this node. More...
|
|
Literal | trueLit () const |
| Returns the literal that must be true in order to fulfill the truth-value of this node. More...
|
|
void | setLiteral (Literal x) |
|
void | clearLiteral (bool clVal) |
|
void | setValue (ValueRep v) |
|
void | setEq (uint32 eqId) |
|
void | setIgnoreScc (bool b) |
|
void | markRemoved () |
|
void | markSeen (bool b) |
|
void | resetId (uint32 id, bool seen) |
|
bool | assignValueImpl (ValueRep v, bool noWeak) |
|
A (rule) body in a logic program.
bool Clasp::Asp::PrgBody::simplifyHeads |
( |
LogicProgram & |
prg, |
|
|
bool |
strong |
|
) |
| |
Simplifies the heads of this body and establishes set property.
Removes superfluous heads and sets the body to false if for some atom a in the head of this body B, Ta -> FB. In that case, all heads atoms are removed, because a false body can't define any atom. If strong is true, removes head atoms that are not associated with a variable.
- Returns
- setValue(value_false) if setting a head of this body to true would make the body false (i.e. the body is a selfblocker). Otherwise, true.