Classes | Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes
Clasp::Asp::Preprocessor Class Reference

Preprocesses (i.e. simplifies) a logic program. More...

#include <asp_preprocessor.h>

List of all members.

Classes

struct  BodyExtra

Public Types

enum  EqType { no_eq, full_eq }
 Possible eq-preprocessing types. More...

Public Member Functions

bool eq () const
Var getRootAtom (Literal p) const
bool preprocess (LogicProgram &prg, EqType t, uint32 maxIters, bool dfs=true)
 Starts preprocessing of the logic program.
 Preprocessor ()
const LogicProgramprogram () const
LogicProgramprogram ()
void setRootAtom (Literal p, uint32 atomId)

Private Types

typedef PodVector< BodyExtra >
::type 
BodyData
typedef PrgHead *const * HeadIter
typedef std::pair< HeadIter,
HeadIter
HeadRange

Private Member Functions

PrgBodyaddBodyVar (uint32 bodyId)
bool addHeadsToUpper (PrgBody *body)
bool addHeadToUpper (PrgHead *head, PrgEdge headEdge, PrgEdge support)
bool classifyProgram (const VarVec &supportedBodies)
bool hasRootLiteral (PrgBody *b) const
bool mergeEqBodies (PrgBody *b, Var rootId, bool equalLits)
uint32 nextBodyId (VarVec::size_type &idx)
Preprocessoroperator= (const Preprocessor &)
bool preprocessEq (uint32 maxIters)
 Preprocessor (const Preprocessor &)
bool preprocessSimple ()
bool propagateAtomValue (PrgAtom *, ValueRep val)
bool propagateAtomVar (Var atomId, PrgAtom *, PrgEdge source)
ValueRep simplifyBody (PrgBody *b, bool reclassify, VarVec &supported)
ValueRep simplifyClassifiedProgram (const HeadRange &atoms, bool more, VarVec &supported)
ValueRep simplifyHead (PrgHead *h, bool reclassify)

Private Attributes

BodyData bodyInfo_
bool dfs_
VarVec follow_
VarVec litToNode_
uint32 maxPass_
uint32 pass_
LogicProgramprg_
EqType type_

Detailed Description

Preprocesses (i.e. simplifies) a logic program.

Preprocesses (i.e. simplifies) a logic program and associates variables with the nodes of the simplified logic program.

Definition at line 41 of file asp_preprocessor.h.


Member Typedef Documentation

Definition at line 113 of file asp_preprocessor.h.

typedef PrgHead* const* Clasp::Asp::Preprocessor::HeadIter [private]

Definition at line 83 of file asp_preprocessor.h.

Definition at line 84 of file asp_preprocessor.h.


Member Enumeration Documentation

Possible eq-preprocessing types.

Enumerator:
no_eq 

no eq-preprocessing, associate a new var with each supported atom and body

full_eq 

check for all kinds of equivalences between atoms and bodies

Definition at line 45 of file asp_preprocessor.h.


Constructor & Destructor Documentation

Definition at line 43 of file asp_preprocessor.h.


Member Function Documentation

PrgBody * Clasp::Asp::Preprocessor::addBodyVar ( uint32  bodyId) [private]

Definition at line 180 of file asp_preprocessor.cpp.

Definition at line 233 of file asp_preprocessor.cpp.

bool Clasp::Asp::Preprocessor::addHeadToUpper ( PrgHead head,
PrgEdge  headEdge,
PrgEdge  support 
) [private]

Definition at line 46 of file asp_preprocessor.cpp.

bool Clasp::Asp::Preprocessor::classifyProgram ( const VarVec supportedBodies) [private]

Definition at line 104 of file asp_preprocessor.cpp.

bool Clasp::Asp::Preprocessor::eq ( ) const [inline]

Definition at line 71 of file asp_preprocessor.h.

Definition at line 72 of file asp_preprocessor.h.

bool Clasp::Asp::Preprocessor::hasRootLiteral ( PrgBody b) const [private]

Definition at line 378 of file asp_preprocessor.cpp.

bool Clasp::Asp::Preprocessor::mergeEqBodies ( PrgBody b,
Var  rootId,
bool  equalLits 
) [private]

Definition at line 366 of file asp_preprocessor.cpp.

uint32 Clasp::Asp::Preprocessor::nextBodyId ( VarVec::size_type &  idx) [inline, private]

Definition at line 103 of file asp_preprocessor.h.

Preprocessor& Clasp::Asp::Preprocessor::operator= ( const Preprocessor ) [private]
bool Clasp::Asp::Preprocessor::preprocess ( LogicProgram prg,
EqType  t,
uint32  maxIters,
bool  dfs = true 
) [inline]

Starts preprocessing of the logic program.

Computes the maximum consequences of prg and associates a variable with each supported atom and body.

Parameters:
prgThe logic program to preprocess.
tType of eq-preprocessing.
maxItersIf t == full_eq, maximal number of iterations during eq preprocessing.
dfsIf t == full_eq, classify in df-order (true) or bf-order (false).

Definition at line 62 of file asp_preprocessor.h.

bool Clasp::Asp::Preprocessor::preprocessEq ( uint32  maxIters) [private]

Definition at line 75 of file asp_preprocessor.cpp.

Definition at line 30 of file asp_preprocessor.cpp.

Definition at line 50 of file asp_preprocessor.h.

Definition at line 51 of file asp_preprocessor.h.

bool Clasp::Asp::Preprocessor::propagateAtomValue ( PrgAtom atom,
ValueRep  val 
) [private]

Definition at line 361 of file asp_preprocessor.cpp.

bool Clasp::Asp::Preprocessor::propagateAtomVar ( Var  atomId,
PrgAtom a,
PrgEdge  source 
) [private]

Definition at line 280 of file asp_preprocessor.cpp.

void Clasp::Asp::Preprocessor::setRootAtom ( Literal  p,
uint32  atomId 
) [inline]

Definition at line 73 of file asp_preprocessor.h.

ValueRep Clasp::Asp::Preprocessor::simplifyBody ( PrgBody b,
bool  reclassify,
VarVec supported 
) [private]

Definition at line 389 of file asp_preprocessor.cpp.

ValueRep Clasp::Asp::Preprocessor::simplifyClassifiedProgram ( const HeadRange atoms,
bool  more,
VarVec supported 
) [private]

Definition at line 134 of file asp_preprocessor.cpp.

ValueRep Clasp::Asp::Preprocessor::simplifyHead ( PrgHead h,
bool  reclassify 
) [private]

Definition at line 449 of file asp_preprocessor.cpp.


Member Data Documentation

Definition at line 116 of file asp_preprocessor.h.

Definition at line 121 of file asp_preprocessor.h.

Definition at line 115 of file asp_preprocessor.h.

Definition at line 117 of file asp_preprocessor.h.

Definition at line 119 of file asp_preprocessor.h.

Definition at line 118 of file asp_preprocessor.h.

Definition at line 114 of file asp_preprocessor.h.

Definition at line 120 of file asp_preprocessor.h.


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


clasp
Author(s): Benjamin Kaufmann
autogenerated on Thu Aug 27 2015 12:41:41