clingo
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
Classes | Public Types | Public Member Functions | List of all members
Clasp::SharedDependencyGraph Class Reference

(Positive) Body-Atom-Dependency Graph. More...

#include <dependency_graph.h>

Collaboration diagram for Clasp::SharedDependencyGraph:
Collaboration graph

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 ComponentPairNonHcfIter
 

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 AtomNodegetAtom (NodeId atomId) const
 Returns AtomNode of atom with given id. More...
 
NodeId id (const AtomNode &n) const
 
const BodyNodegetBody (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
 
ConfigurationnonHcfConfig () const
 
void accuStats () const
 

Detailed Description

(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.

Note
Initialization is not thread-safe, i.e. must be done only once by one thread.

Member Typedef Documentation

Member Enumeration Documentation

anonymous enum
Enumerator
sentinel_atom 

Constructor & Destructor Documentation

Clasp::SharedDependencyGraph::SharedDependencyGraph ( Configuration nonHcfCfg = 0)

Here is the call graph for this function:

Clasp::SharedDependencyGraph::~SharedDependencyGraph ( )

Member Function Documentation

void Clasp::SharedDependencyGraph::accuStats ( ) const

Here is the call graph for this function:

void Clasp::SharedDependencyGraph::addSccs ( LogicProgram prg,
const AtomList sccAtoms,
const NonHcfSet nonHcfs 
)

Adds SCCs to the graph.

Parameters
prgThe logic program for which the dependency graph is to be created.
sccAtomsAtoms of the logic program that are strongly connected.
nonHcfsSorted list of non-hcf sccs

Here is the call graph for this function:

const AtomNode& Clasp::SharedDependencyGraph::getAtom ( NodeId  atomId) const
inline

Returns AtomNode of atom with given id.

const BodyNode& Clasp::SharedDependencyGraph::getBody ( NodeId  bodyId) const
inline

Returns BodyNode of body with given id.

NodeId Clasp::SharedDependencyGraph::id ( const AtomNode n) const
inline
uint32 Clasp::SharedDependencyGraph::nodes ( ) const
inline

Sum of atoms and bodies.

Here is the call graph for this function:

NonHcfIter Clasp::SharedDependencyGraph::nonHcfBegin ( ) const
inline
Configuration* Clasp::SharedDependencyGraph::nonHcfConfig ( ) const
inline
NonHcfIter Clasp::SharedDependencyGraph::nonHcfEnd ( ) const
inline

Here is the call graph for this function:

uint32 Clasp::SharedDependencyGraph::numAtoms ( ) const
inline

Number of atoms in graph.

uint32 Clasp::SharedDependencyGraph::numBodies ( ) const
inline

Number of bodies in graph.

uint32 Clasp::SharedDependencyGraph::numNonHcfs ( ) const
inline
template<class P >
void Clasp::SharedDependencyGraph::visitBodyLiterals ( const BodyNode n,
const P &  p 
)
inline

Calls the given function object p once for each body-literal.

Here is the call graph for this function:


The documentation for this class was generated from the following files: