Inter4ql  5.2
Public Member Functions | List of all members
Inter4ql::ModuleGroup Class Reference

Implementation of ModuleGeneric for modules with reasoning. More...

#include <ModuleGroup.h>

Inheritance diagram for Inter4ql::ModuleGroup:
Inter4ql::ModuleGeneric

Public Member Functions

 ModuleGroup (std::string a_name, std::vector< Domain *> *_domains, std::vector< Relation *> *_relations, std::vector< std::string > *_members)
 constructor More...
 
 ~ModuleGroup ()
 destructor More...
 
Relationget_relation (std::string s) const
 getter for a relation More...
 
virtual std::vector< Domain * > * get_domains () const
 getter for domains More...
 
std::vector< Relation * > * get_relations () const
 getter for module relations More...
 
std::vector< std::string > * get_members () const
 
std::string get_name () const
 getter for a name of module More...
 
std::string print ()
 function that returns string with module information More...
 
module_type::type get_module_type () const
 getter for module type More...
 
variable_type::type get_domain_type (std::string name)
 
void add_domain (Domain *d)
 
void add_relation (Relation *r)
 
void reason ()
 performs reasoning More...
 
Result ask_for_result (Fact *term) const
 provides valuations matching given Fact More...
 
Result evaluate_expression (Expression *expr) const
 provides valuations matching given Expression More...
 
void add_whens (BooleanExpression *t, BooleanExpression *f, BooleanExpression *i)
 prepare formulas for merging group data More...
 
- Public Member Functions inherited from Inter4ql::ModuleGeneric
 ModuleGeneric ()
 default constructor
 
virtual ~ModuleGeneric ()
 default destructor
 
virtual void reason_with_rules (std::vector< Rule *> *rules)
 performs reasing with additional Rules added 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 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...
 

Additional Inherited Members

- Protected Attributes inherited from Inter4ql::ModuleGeneric
Inter4ql::database * database_to_add
 
Inter4ql::database * database_to_remove
 

Detailed Description

Implementation of ModuleGeneric for modules with reasoning.

Constructor & Destructor Documentation

◆ ModuleGroup()

Inter4ql::ModuleGroup::ModuleGroup ( std::string  a_name,
std::vector< Domain *> *  _domains,
std::vector< Relation *> *  _relations,
std::vector< std::string > *  _members 
)

constructor

Parameters
a_namename of a module
_domainsinitial vector of domains
_relationsinitial vector of relations
_rulesinitial vector of rules
_factsinitial vector of facts

◆ ~ModuleGroup()

Inter4ql::ModuleGroup::~ModuleGroup ( )

destructor

Member Function Documentation

◆ add_whens()

void Inter4ql::ModuleGroup::add_whens ( BooleanExpression t,
BooleanExpression f,
BooleanExpression i 
)

prepare formulas for merging group data

Parameters
tboolan expression for when value is true
fboolan expression for when value is false
tboolan expression for when value is inconsistent

◆ ask_for_result()

Result Inter4ql::ModuleGroup::ask_for_result ( Fact term) const
virtual

provides valuations matching given Fact

Parameters
termquery to find in database
Returns
possible valuations of term

Implements Inter4ql::ModuleGeneric.

◆ evaluate_expression()

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

provides valuations matching given Expression

Parameters
exprquery to find in database
Returns
possible valuations of expression

Reimplemented from Inter4ql::ModuleGeneric.

◆ get_domains()

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

getter for domains

Returns
list of domains

Reimplemented from Inter4ql::ModuleGeneric.

◆ get_module_type()

module_type::type Inter4ql::ModuleGroup::get_module_type ( ) const
virtual

getter for module type

Returns
module type

Reimplemented from Inter4ql::ModuleGeneric.

◆ get_name()

std::string Inter4ql::ModuleGroup::get_name ( ) const
virtual

getter for a name of module

Returns
module name

Reimplemented from Inter4ql::ModuleGeneric.

◆ get_relation()

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

getter for a relation

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

Reimplemented from Inter4ql::ModuleGeneric.

◆ get_relations()

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

getter for module relations

Returns
module relations

Reimplemented from Inter4ql::ModuleGeneric.

◆ print()

std::string Inter4ql::ModuleGroup::print ( )
virtual

function that returns string with module information

Returns
module information packed in a std::string

Reimplemented from Inter4ql::ModuleGeneric.

◆ reason()

void Inter4ql::ModuleGroup::reason ( )
virtual

performs reasoning

Implements Inter4ql::ModuleGeneric.


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