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

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

#include <ModuleBelief.h>

Inheritance diagram for Inter4ql::ModuleBelief:
Inter4ql::ModuleGeneric

Public Member Functions

 ModuleBelief (std::string _name, Constraints *_constraints, std::vector< std::string > *_members)
 constructor More...
 
 ~ModuleBelief ()
 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< 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_bf (Expression *expr) const override
 provides bel-free valuations matching given Expression More...
 
Result evaluate_expression (Expression *expr) const override
 provides valuations matching given Expression More...
 
void set_modules (std::vector< ModuleGeneric *> *_modules) override
 setter for modules needed in this module More...
 
Constraintsget_constraints () const override
 getter for constraints More...
 
void set_disable_constraints (bool value) const override
 allows for disabling constraints check More...
 
bool check_constraints_local (bool check_rigid, bool check_flexible) const override
 evaluates constraints locally, in current module More...
 
std::vector< ModuleGeneric * > * get_member_modules ()
 gets a list of member module objects More...
 
bool constraints_violated () override
 checks whether constraints are violated More...
 
- Public Member Functions inherited from Inter4ql::ModuleGeneric
 ModuleGeneric ()
 default constructor
 
virtual ~ModuleGeneric ()
 default destructor
 
virtual std::vector< Relation * > * get_relations () const
 getter for module relations More...
 
virtual void reason_with_rules (std::vector< Rule *> *rules)
 performs reasing with additional Rules added 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 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 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...
 

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

◆ ModuleBelief()

Inter4ql::ModuleBelief::ModuleBelief ( std::string  _name,
Constraints _constraints,
std::vector< std::string > *  _members 
)

constructor

Parameters
_namename of a module
_constraintsinitial list of constraints
_memberslist of members

◆ ~ModuleBelief()

Inter4ql::ModuleBelief::~ModuleBelief ( )

destructor

Member Function Documentation

◆ ask_for_result()

Result Inter4ql::ModuleBelief::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.

◆ check_constraints_local()

bool Inter4ql::ModuleBelief::check_constraints_local ( bool  check_rigid,
bool  check_flexible 
) const
overridevirtual

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 from Inter4ql::ModuleGeneric.

◆ constraints_violated()

bool Inter4ql::ModuleBelief::constraints_violated ( )
overridevirtual

checks whether constraints are violated

Returns
true if constraints are vioilated, false otherwise

Reimplemented from Inter4ql::ModuleGeneric.

◆ evaluate_expression()

Result Inter4ql::ModuleBelief::evaluate_expression ( Expression expr) const
overridevirtual

provides valuations matching given Expression

Parameters
exprquery to find in database
Returns
possible valuations of expression

Reimplemented from Inter4ql::ModuleGeneric.

◆ evaluate_expression_bf()

Result Inter4ql::ModuleBelief::evaluate_expression_bf ( Expression expr) const
overridevirtual

provides bel-free valuations matching given Expression

Parameters
exprquery to find in database
Returns
possible valuations of expression

Reimplemented from Inter4ql::ModuleGeneric.

◆ get_constraints()

Constraints* Inter4ql::ModuleBelief::get_constraints ( ) const
inlineoverridevirtual

getter for constraints

Returns
list of constraints

Reimplemented from Inter4ql::ModuleGeneric.

◆ get_domains()

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

getter for domains

Returns
list of domains

Reimplemented from Inter4ql::ModuleGeneric.

◆ get_member_modules()

std::vector< ModuleGeneric * > * Inter4ql::ModuleBelief::get_member_modules ( )

gets a list of member module objects

Returns
list of modules

◆ get_module_type()

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

getter for module type

Returns
module type

Reimplemented from Inter4ql::ModuleGeneric.

◆ get_name()

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

getter for a name of module

Returns
module name

Reimplemented from Inter4ql::ModuleGeneric.

◆ get_relation()

Relation * Inter4ql::ModuleBelief::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.

◆ print()

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

function that returns string with module information

Returns
module information packed in a std::string

Reimplemented from Inter4ql::ModuleGeneric.

◆ reason()

void Inter4ql::ModuleBelief::reason ( )
virtual

performs reasoning

Implements Inter4ql::ModuleGeneric.

◆ set_disable_constraints()

void Inter4ql::ModuleBelief::set_disable_constraints ( bool  value) const
inlineoverridevirtual

allows for disabling constraints check

Parameters
valuevalue to be set

Reimplemented from Inter4ql::ModuleGeneric.

◆ set_modules()

void Inter4ql::ModuleBelief::set_modules ( std::vector< ModuleGeneric *> *  _modules)
overridevirtual

setter for modules needed in this module

Parameters
_moduleslist of modules

Reimplemented from Inter4ql::ModuleGeneric.


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