An atom in a logic program. More...
#include <logic_program_types.h>
Public Types | |
typedef LitVec::const_iterator | dep_iterator |
enum | Dependency { dep_pos = 0, dep_neg = 1, dep_all = 2 } |
Public Member Functions | |
Literal | eqGoal (bool sign) const |
If eq(), stores the literal that is eq to this atom. | |
bool | inDisj () const |
Returns true if atom belongs to a disjunctive head. | |
PrgAtom (uint32 id, bool checkScc=true) | |
uint32 | scc () const |
Strongly connected component of this node. | |
forward dependencies (bodies containing this atom) | |
dep_iterator | deps_begin () const |
dep_iterator | deps_end () const |
bool | hasDep (Dependency d) const |
void | addDep (Var bodyId, bool pos) |
void | removeDep (Var bodyId, bool pos) |
void | clearDeps (Dependency d) |
implementation functions | |
Low-level implementation functions. Use with care and only if you know what you are doing! | |
void | setEqGoal (Literal x) |
bool | propagateValue (LogicProgram &prg, bool backprop) |
bool | addConstraints (const LogicProgram &prg, ClauseCreator &c) |
void | setScc (uint32 scc) |
void | setState (State s) |
Private Attributes | |
LitVec | deps_ |
An atom in a logic program.
An atom stores the list of bodies depending on it. Furthermore, once strongly-connected components are identified, atoms store their SCC-number. All trivial SCCs are represented with the special SCC-number PrgNode::noScc.
Definition at line 456 of file logic_program_types.h.
typedef LitVec::const_iterator Clasp::Asp::PrgAtom::dep_iterator |
Definition at line 459 of file logic_program_types.h.
Definition at line 458 of file logic_program_types.h.
Clasp::Asp::PrgAtom::PrgAtom | ( | uint32 | id, |
bool | checkScc = true |
||
) | [explicit] |
Definition at line 638 of file logic_program_types.cpp.
bool Clasp::Asp::PrgAtom::addConstraints | ( | const LogicProgram & | prg, |
ClauseCreator & | c | ||
) |
Definition at line 733 of file logic_program_types.cpp.
void Clasp::Asp::PrgAtom::addDep | ( | Var | bodyId, |
bool | pos | ||
) |
Definition at line 658 of file logic_program_types.cpp.
void Clasp::Asp::PrgAtom::clearDeps | ( | Dependency | d | ) |
Definition at line 671 of file logic_program_types.cpp.
dep_iterator Clasp::Asp::PrgAtom::deps_begin | ( | ) | const [inline] |
Definition at line 472 of file logic_program_types.h.
dep_iterator Clasp::Asp::PrgAtom::deps_end | ( | ) | const [inline] |
Definition at line 473 of file logic_program_types.h.
Literal Clasp::Asp::PrgAtom::eqGoal | ( | bool | sign | ) | const |
If eq(), stores the literal that is eq to this atom.
Definition at line 648 of file logic_program_types.cpp.
bool Clasp::Asp::PrgAtom::hasDep | ( | Dependency | d | ) | const |
Definition at line 685 of file logic_program_types.cpp.
bool Clasp::Asp::PrgAtom::inDisj | ( | ) | const |
Returns true if atom belongs to a disjunctive head.
Definition at line 693 of file logic_program_types.cpp.
bool Clasp::Asp::PrgAtom::propagateValue | ( | LogicProgram & | prg, |
bool | backprop | ||
) |
Definition at line 703 of file logic_program_types.cpp.
void Clasp::Asp::PrgAtom::removeDep | ( | Var | bodyId, |
bool | pos | ||
) |
Definition at line 665 of file logic_program_types.cpp.
uint32 Clasp::Asp::PrgAtom::scc | ( | ) | const [inline] |
Strongly connected component of this node.
Definition at line 462 of file logic_program_types.h.
void Clasp::Asp::PrgAtom::setEqGoal | ( | Literal | x | ) |
Definition at line 643 of file logic_program_types.cpp.
void Clasp::Asp::PrgAtom::setScc | ( | uint32 | scc | ) | [inline] |
Definition at line 489 of file logic_program_types.h.
void Clasp::Asp::PrgAtom::setState | ( | State | s | ) | [inline] |
Definition at line 490 of file logic_program_types.h.
LitVec Clasp::Asp::PrgAtom::deps_ [private] |
Definition at line 493 of file logic_program_types.h.