dlvhex  2.5.0
ModelGeneratorBase< InterpretationT > Class Template Reference

Base class for model generators. More...

#include <include/dlvhex2/ModelGenerator.h>

Inheritance diagram for ModelGeneratorBase< InterpretationT >:
Collaboration diagram for ModelGeneratorBase< InterpretationT >:

Public Types

typedef InterpretationT Interpretation
typedef Interpretation::ConstPtr InterpretationConstPtr
typedef Interpretation::Ptr InterpretationPtr
typedef boost::shared_ptr
< ModelGeneratorBase
< Interpretation > > 
Ptr

Public Member Functions

 BOOST_CONCEPT_ASSERT ((boost::Convertible< InterpretationT, InterpretationBase >))
 ModelGeneratorBase (InterpretationConstPtr input)
 Initialize with factory and input interpretation.
virtual ~ModelGeneratorBase ()
 Destructor.
virtual InterpretationPtr generateNextModel ()=0
 Generate and return next model, return NULL after last model.
virtual const NogoodgetInconsistencyCause ()
 Returns a reason for inconsistency in this instance wrt.
virtual void addNogood (const Nogood *ng)
 Adds a nogood to the model generator.
virtual std::ostream & print (std::ostream &o) const

Protected Attributes

InterpretationConstPtr input
 Input interpretation.

Detailed Description

template<typename InterpretationT>
class ModelGeneratorBase< InterpretationT >

Base class for model generators.

A model generator does the following: * it is constructed by a ModelGeneratorFactory which knows the program (and can precompute information for evaluation, and may also provide this to the model generator) * it is evaluated on a (probably empty) input interpretation * this evaluation can be performed online * evaluation yields a (probably empty) set of output interpretations.

Definition at line 78 of file ModelGenerator.h.


Member Typedef Documentation

template<typename InterpretationT>
typedef InterpretationT ModelGeneratorBase< InterpretationT >::Interpretation

Definition at line 85 of file ModelGenerator.h.

template<typename InterpretationT>
typedef Interpretation::ConstPtr ModelGeneratorBase< InterpretationT >::InterpretationConstPtr

Definition at line 87 of file ModelGenerator.h.

template<typename InterpretationT>
typedef Interpretation::Ptr ModelGeneratorBase< InterpretationT >::InterpretationPtr

Definition at line 88 of file ModelGenerator.h.

template<typename InterpretationT>
typedef boost::shared_ptr<ModelGeneratorBase<Interpretation> > ModelGeneratorBase< InterpretationT >::Ptr

Definition at line 89 of file ModelGenerator.h.


Constructor & Destructor Documentation

template<typename InterpretationT>
ModelGeneratorBase< InterpretationT >::ModelGeneratorBase ( InterpretationConstPtr  input) [inline]

Initialize with factory and input interpretation.

Parameters:
inputInput interpretation.

Definition at line 100 of file ModelGenerator.h.

template<typename InterpretationT>
virtual ModelGeneratorBase< InterpretationT >::~ModelGeneratorBase ( ) [inline, virtual]

Destructor.

Definition at line 103 of file ModelGenerator.h.


Member Function Documentation

template<typename InterpretationT>
virtual void ModelGeneratorBase< InterpretationT >::addNogood ( const Nogood ng) [inline, virtual]

Adds a nogood to the model generator.

This nogood can be, for instance, an inconsistency cause in successor units.

Parameters:
causePointer to the nogood to be added.

Reimplemented in GenuineGuessAndCheckModelGenerator.

Definition at line 119 of file ModelGenerator.h.

template<typename InterpretationT>
ModelGeneratorBase< InterpretationT >::BOOST_CONCEPT_ASSERT ( (boost::Convertible< InterpretationT, InterpretationBase >)  )
template<typename InterpretationT>
virtual InterpretationPtr ModelGeneratorBase< InterpretationT >::generateNextModel ( ) [pure virtual]

Generate and return next model, return NULL after last model.

Returns:
Next model if any and NULL after last model.

Implemented in GenuineGuessAndCheckModelGenerator, GuessAndCheckModelGenerator, GenuinePlainModelGenerator, PlainModelGenerator, WellfoundedModelGenerator, and GenuineWellfoundedModelGenerator.

Referenced by OnlineModelBuilder< EvalGraphT >::createNextModel().

template<typename InterpretationT>
virtual const Nogood* ModelGeneratorBase< InterpretationT >::getInconsistencyCause ( ) [inline, virtual]

Returns a reason for inconsistency in this instance wrt.

the input atoms*

Returns:
Pointer to a nogood instance to contain the reason for the inconsistency, or false if no such reason cound be determined.

Reimplemented in GenuineGuessAndCheckModelGenerator.

Definition at line 112 of file ModelGenerator.h.

Referenced by OnlineModelBuilder< EvalGraphT >::createNextModel().

template<typename InterpretationT>
virtual std::ostream& ModelGeneratorBase< InterpretationT >::print ( std::ostream &  o) const [inline, virtual]

Definition at line 122 of file ModelGenerator.h.


Field Documentation

template<typename InterpretationT>
InterpretationConstPtr ModelGeneratorBase< InterpretationT >::input [protected]

Input interpretation.

Definition at line 94 of file ModelGenerator.h.


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