clingo
|
(Positive) Body-Atom-Dependency Graph. More...
#include <dependency_graph.h>
Classes | |
struct | AtomNode |
An atom node. More... | |
struct | BodyNode |
A body node. More... | |
struct | Node |
Base type for nodes. More... | |
class | NonHcfComponent |
Type for storing a non head-cycle-free component of a disjunctive program. More... | |
Public Types | |
enum | { sentinel_atom = 0u } |
typedef uint32 | NodeId |
typedef Asp::PrgNode | PrgNode |
typedef Asp::PrgBody | PrgBody |
typedef Asp::PrgAtom | PrgAtom |
typedef Asp::PrgDisj | PrgDisj |
typedef Asp::LogicProgram | LogicProgram |
typedef Asp::NonHcfSet | NonHcfSet |
typedef Asp::AtomList | AtomList |
typedef std::pair< uint32, NonHcfComponent * > | ComponentPair |
typedef const ComponentPair * | NonHcfIter |
Public Member Functions | |
SharedDependencyGraph (Configuration *nonHcfCfg=0) | |
~SharedDependencyGraph () | |
void | addSccs (LogicProgram &prg, const AtomList &sccAtoms, const NonHcfSet &nonHcfs) |
Adds SCCs to the graph. More... | |
uint32 | numAtoms () const |
Number of atoms in graph. More... | |
uint32 | numBodies () const |
Number of bodies in graph. More... | |
uint32 | nodes () const |
Sum of atoms and bodies. More... | |
const AtomNode & | getAtom (NodeId atomId) const |
Returns AtomNode of atom with given id. More... | |
NodeId | id (const AtomNode &n) const |
const BodyNode & | getBody (NodeId bodyId) const |
Returns BodyNode of body with given id. More... | |
template<class P > | |
void | visitBodyLiterals (const BodyNode &n, const P &p) |
Calls the given function object p once for each body-literal. More... | |
NonHcfIter | nonHcfBegin () const |
NonHcfIter | nonHcfEnd () const |
uint32 | numNonHcfs () const |
Configuration * | nonHcfConfig () const |
void | accuStats () const |
(Positive) Body-Atom-Dependency Graph.
Represents the PBADG of a logic program. Once initialized, the PBDAG is static and read-only and thus can be shared between multiple solvers.
typedef std::pair<uint32, NonHcfComponent*> Clasp::SharedDependencyGraph::ComponentPair |
typedef uint32 Clasp::SharedDependencyGraph::NodeId |
typedef const ComponentPair* Clasp::SharedDependencyGraph::NonHcfIter |
Clasp::SharedDependencyGraph::SharedDependencyGraph | ( | Configuration * | nonHcfCfg = 0 | ) |
Clasp::SharedDependencyGraph::~SharedDependencyGraph | ( | ) |
void Clasp::SharedDependencyGraph::accuStats | ( | ) | const |
void Clasp::SharedDependencyGraph::addSccs | ( | LogicProgram & | prg, |
const AtomList & | sccAtoms, | ||
const NonHcfSet & | nonHcfs | ||
) |
Adds SCCs to the graph.
prg | The logic program for which the dependency graph is to be created. |
sccAtoms | Atoms of the logic program that are strongly connected. |
nonHcfs | Sorted list of non-hcf sccs |
Returns AtomNode of atom with given id.
Returns BodyNode of body with given id.
|
inline |
Sum of atoms and bodies.
|
inline |
|
inline |
|
inline |
|
inline |
Number of atoms in graph.
|
inline |
Number of bodies in graph.
|
inline |
|
inline |
Calls the given function object p once for each body-literal.