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

Math module used to implement basic math operations. More...

#include <Bel.h>

Inheritance diagram for Inter4ql::Bel:
Inter4ql::ModuleInternal Inter4ql::ModuleGeneric

Public Member Functions

 Bel (VariableSpace *_v, std::vector< ModuleGeneric *> *_modules)
 constructor for Math module More...
 
void reason ()
 performs reasoning More...
 
Result ask_for_result (Fact *term) const override
 provides valuations matching given Fact More...
 
module_type::type get_module_type () const
 getter for module type More...
 
std::vector< std::string > get_references (Fact *term) override
 provides a list of Module references is term (useful when e.g. term is a shadowed Bel) More...
 
void set_modules (std::vector< ModuleGeneric *> *_modules)
 sets modules set needed for computations More...
 
void set_disable_constraints (bool value) const override
 allows for disabling constraints check More...
 
bool constraints_violated () override
 checks whether constraints are violated More...
 
- Public Member Functions inherited from Inter4ql::ModuleInternal
 ModuleInternal (VariableSpace *_v)
 constructor More...
 
 ~ModuleInternal ()
 destructor
 
Relationget_relation (std::string s) const
 getter for a relation More...
 
std::vector< Relation * > * get_relations () const
 getter for module relations More...
 
virtual void generate_facts ()
 
std::string get_name () const
 getter for a name of module More...
 
std::string print ()
 function that returns string with module information More...
 
VariableSpaceget_variable_space () const
 getter for sql variable space pointer 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 (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 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 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...
 

Additional Inherited Members

- Public Attributes inherited from Inter4ql::ModuleInternal
VariableSpacevariable_space
 getter for reasoning wrapper pointer More...
 
std::vector< Relation * > * relations
 list of relations inside external module
 
std::string name
 name of external module
 
- Protected Attributes inherited from Inter4ql::ModuleGeneric
Inter4ql::database * database_to_add
 
Inter4ql::database * database_to_remove
 

Detailed Description

Math module used to implement basic math operations.

Constructor & Destructor Documentation

◆ Bel()

Inter4ql::Bel::Bel ( VariableSpace _v,
std::vector< ModuleGeneric *> *  _modules 
)
explicit

constructor for Math module

Parameters
_vpointer to VariableSpace class

Member Function Documentation

◆ ask_for_result()

Result Inter4ql::Bel::ask_for_result ( Fact term) const
overridevirtual

provides valuations matching given Fact

Parameters
termquery to find in database
Returns
possible valuations of term

Implements Inter4ql::ModuleGeneric.

◆ constraints_violated()

bool Inter4ql::Bel::constraints_violated ( )
overridevirtual

checks whether constraints are violated

Returns
true if constraints are vioilated, false otherwise

Reimplemented from Inter4ql::ModuleGeneric.

◆ get_module_type()

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

getter for module type

Returns
module type

Reimplemented from Inter4ql::ModuleInternal.

◆ get_references()

std::vector< std::string > Inter4ql::Bel::get_references ( Fact term)
overridevirtual

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

◆ reason()

void Inter4ql::Bel::reason ( )
virtual

performs reasoning

Implements Inter4ql::ModuleGeneric.

◆ set_disable_constraints()

void Inter4ql::Bel::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::Bel::set_modules ( std::vector< ModuleGeneric *> *  _modules)
inlinevirtual

sets modules set needed for computations

Parameters
_modulescurrent modules from interpreter

Reimplemented from Inter4ql::ModuleGeneric.


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