Inter4ql  5.2
Public Member Functions | Protected Attributes | List of all members
Inter4ql::ModuleGeneric Class Referenceabstract

Generic class of module (only virtual methods) More...

#include <ModuleGeneric.h>

Inheritance diagram for Inter4ql::ModuleGeneric:
Inter4ql::ModuleAction Inter4ql::ModuleBelief Inter4ql::ModuleExternal Inter4ql::ModuleGroup Inter4ql::ModuleInternal Inter4ql::ModuleLocal Inter4ql::ModuleProblem Inter4ql::Plugin Inter4ql::Bel Inter4ql::Math Inter4ql::ModuleSum

Public Member Functions

 ModuleGeneric ()
 default constructor
 
virtual ~ModuleGeneric ()
 default destructor
 
virtual Relationget_relation (std::string s) const
 getter for a relation More...
 
virtual std::string get_name () const
 getter for a name of module More...
 
virtual std::string print ()
 function that returns string with module information More...
 
virtual std::vector< Relation * > * get_relations () const
 getter for module relations More...
 
virtual module_type::type get_module_type () const
 getter for module type More...
 
virtual void reason ()=0
 performs reasoning More...
 
virtual void reason_with_rules (std::vector< Rule *> *rules)
 performs reasing with additional Rules added More...
 
virtual Result ask_for_result (Fact *term) const =0
 provides valuations matching given Fact More...
 
virtual Result evaluate_expression (Expression *expr) const
 provides valuations matching given Expression More...
 
virtual Result evaluate_expression_bf (Expression *expr) const
 provides bel-free valuations matching given Expression More...
 
virtual std::vector< std::string > get_references (Fact *term)
 provides a list of Module references is term (useful when e.g. term is a shadowed Bel) More...
 
virtual void set_modules (std::vector< ModuleGeneric *> *_modules)
 setter for modules needed in this module More...
 
virtual Constraintsget_constraints () const
 getter for constraints More...
 
virtual std::vector< Domain * > * get_domains () const
 getter for domains More...
 
virtual bool contains_domain (Domain *d) const
 check if module contains domain More...
 
virtual bool contains_relation (Relation *d) const
 check if module contains relation (ignoring module name) More...
 
virtual void set_disable_constraints (bool value) const
 allows for disabling constraints check More...
 
virtual bool check_constraints_local (bool check_rigid, bool check_flexible) const
 evaluates constraints locally, in current module More...
 
virtual database * get_wsm_database ()
 fetches a database of facts from well-supported model (for summing purposes) More...
 
virtual database * get_add_database ()
 fetches a database of facts which were added by actions to this module More...
 
virtual database * get_remove_database ()
 fetches a database of facts which were removed by actions from this module More...
 
virtual void set_add_database (database *db)
 overrides a database of facts which were added by actions to this module More...
 
virtual void set_remove_database (database *db)
 overrides a database of facts which were removed by actions from this module More...
 
virtual bool constraints_violated ()
 checks whether constraints are violated More...
 

Protected Attributes

Inter4ql::database * database_to_add
 
Inter4ql::database * database_to_remove
 

Detailed Description

Generic class of module (only virtual methods)

Member Function Documentation

◆ ask_for_result()

virtual Result Inter4ql::ModuleGeneric::ask_for_result ( Fact term) const
pure virtual

provides valuations matching given Fact

Parameters
termquery to find in database
Returns
possible valuations of term

Implemented in Inter4ql::ModuleProblem, Inter4ql::ModuleLocal, Inter4ql::ModuleAction, Inter4ql::ModuleGroup, Inter4ql::ModuleBelief, Inter4ql::Math, Inter4ql::Plugin, and Inter4ql::Bel.

◆ check_constraints_local()

virtual bool Inter4ql::ModuleGeneric::check_constraints_local ( bool  check_rigid,
bool  check_flexible 
) const
inlinevirtual

evaluates constraints locally, in current module

Parameters
check_rigidwhether rigid constrains should be checked
check_flexiblewhether flexible constraints should be checked
Returns
whether constraints are valid

Reimplemented in Inter4ql::ModuleLocal, and Inter4ql::ModuleBelief.

◆ constraints_violated()

virtual bool Inter4ql::ModuleGeneric::constraints_violated ( )
inlinevirtual

checks whether constraints are violated

Returns
true if constraints are vioilated, false otherwise

Reimplemented in Inter4ql::ModuleLocal, Inter4ql::ModuleBelief, and Inter4ql::Bel.

◆ contains_domain()

bool Inter4ql::ModuleGeneric::contains_domain ( Domain d) const
virtual

check if module contains domain

Returns
whether module contains the domain

◆ contains_relation()

bool Inter4ql::ModuleGeneric::contains_relation ( Relation d) const
virtual

check if module contains relation (ignoring module name)

Returns
whether module contains the relation

◆ evaluate_expression()

Result Inter4ql::ModuleGeneric::evaluate_expression ( Expression expr) const
virtual

provides valuations matching given Expression

Parameters
exprquery to find in database
Returns
possible valuations of expression

Reimplemented in Inter4ql::ModuleGroup, and Inter4ql::ModuleBelief.

◆ evaluate_expression_bf()

Result Inter4ql::ModuleGeneric::evaluate_expression_bf ( Expression expr) const
virtual

provides bel-free valuations matching given Expression

Parameters
exprquery to find in database
Returns
possible valuations of expression

Reimplemented in Inter4ql::ModuleBelief.

◆ get_add_database()

virtual database* Inter4ql::ModuleGeneric::get_add_database ( )
inlinevirtual

fetches a database of facts which were added by actions to this module

Returns
database of added facts

◆ get_constraints()

virtual Constraints* Inter4ql::ModuleGeneric::get_constraints ( ) const
inlinevirtual

getter for constraints

Returns
list of constraints

Reimplemented in Inter4ql::ModuleLocal, and Inter4ql::ModuleBelief.

◆ get_domains()

virtual std::vector<Domain*>* Inter4ql::ModuleGeneric::get_domains ( ) const
inlinevirtual

getter for domains

Returns
list of domains

Reimplemented in Inter4ql::ModuleLocal, Inter4ql::ModuleBelief, and Inter4ql::ModuleGroup.

◆ get_module_type()

virtual module_type::type Inter4ql::ModuleGeneric::get_module_type ( ) const
inlinevirtual

◆ get_name()

virtual std::string Inter4ql::ModuleGeneric::get_name ( ) const
inlinevirtual

◆ get_references()

std::vector< std::string > Inter4ql::ModuleGeneric::get_references ( Fact term)
virtual

provides a list of Module references is term (useful when e.g. term is a shadowed Bel)

Parameters
termFact to be checked
Returns
list of referenced Modules

Reimplemented in Inter4ql::Bel.

◆ get_relation()

virtual Relation* Inter4ql::ModuleGeneric::get_relation ( std::string  s) const
inlinevirtual

getter for a relation

Parameters
sname of a relation
Returns
relation with name s inside module

Reimplemented in Inter4ql::ModuleLocal, Inter4ql::ModuleBelief, Inter4ql::ModuleGroup, Inter4ql::ModuleExternal, and Inter4ql::ModuleInternal.

◆ get_relations()

virtual std::vector<Relation*>* Inter4ql::ModuleGeneric::get_relations ( ) const
inlinevirtual

getter for module relations

Returns
module relations

Reimplemented in Inter4ql::ModuleLocal, Inter4ql::ModuleGroup, Inter4ql::ModuleExternal, and Inter4ql::ModuleInternal.

◆ get_remove_database()

virtual database* Inter4ql::ModuleGeneric::get_remove_database ( )
inlinevirtual

fetches a database of facts which were removed by actions from this module

Returns
database of removed facts

◆ get_wsm_database()

virtual database* Inter4ql::ModuleGeneric::get_wsm_database ( )
inlinevirtual

fetches a database of facts from well-supported model (for summing purposes)

Returns
database of wsm facts

Reimplemented in Inter4ql::ModuleLocal, and Inter4ql::ModuleSum.

◆ print()

virtual std::string Inter4ql::ModuleGeneric::print ( )
inlinevirtual

function that returns string with module information

Returns
module information packed in a std::string

Reimplemented in Inter4ql::ModuleProblem, Inter4ql::ModuleLocal, Inter4ql::ModuleGroup, Inter4ql::ModuleBelief, Inter4ql::ModuleAction, Inter4ql::ModuleExternal, and Inter4ql::ModuleInternal.

◆ reason()

virtual void Inter4ql::ModuleGeneric::reason ( )
pure virtual

◆ reason_with_rules()

virtual void Inter4ql::ModuleGeneric::reason_with_rules ( std::vector< Rule *> *  rules)
inlinevirtual

performs reasing with additional Rules added

Parameters
ruleslist of Rules to be added before reasoning

Reimplemented in Inter4ql::ModuleLocal.

◆ set_add_database()

virtual void Inter4ql::ModuleGeneric::set_add_database ( database *  db)
inlinevirtual

overrides a database of facts which were added by actions to this module

Parameters
dbdatabase to be set

◆ set_disable_constraints()

virtual void Inter4ql::ModuleGeneric::set_disable_constraints ( bool  value) const
inlinevirtual

allows for disabling constraints check

Parameters
valuevalue to be set

Reimplemented in Inter4ql::ModuleLocal, Inter4ql::ModuleBelief, and Inter4ql::Bel.

◆ set_modules()

virtual void Inter4ql::ModuleGeneric::set_modules ( std::vector< ModuleGeneric *> *  _modules)
inlinevirtual

setter for modules needed in this module

Parameters
_moduleslist of modules

Reimplemented in Inter4ql::ModuleAction, Inter4ql::ModuleBelief, and Inter4ql::Bel.

◆ set_remove_database()

virtual void Inter4ql::ModuleGeneric::set_remove_database ( database *  db)
inlinevirtual

overrides a database of facts which were removed by actions from this module

Parameters
dbdatabase to be set

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