Inter4ql
5.2
|
Implementation of ModuleGeneric for modules with reasoning. More...
#include <ModuleLocal.h>
Public Member Functions | |
ModuleLocal (std::string a_name, Constraints *_constraints, std::vector< Domain *> *_domains, std::vector< Relation *> *_relations, std::vector< Rule *> *_rules, std::vector< Fact *> *_facts) | |
constructor More... | |
~ModuleLocal () | |
destructor More... | |
logic_type::type | ask_for_ground_fact (Fact *instance) const |
Relation * | get_relation (std::string s) const |
getter for a relation More... | |
virtual std::vector< Domain * > * | get_domains () const override |
getter for domains More... | |
std::vector< Relation * > * | get_relations () const |
getter for module relations More... | |
std::vector< Rule * > * | get_rules () const |
std::vector< Fact * > * | get_facts () 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... | |
void | generate_facts () |
void | reason () |
performs reasoning More... | |
void | reason_with_rules (std::vector< Rule *> *rules) |
performs reasing with additional Rules added More... | |
Result | ask_for_result (Fact *term) const |
provides valuations matching given Fact More... | |
variable_type::type | get_domain_type (std::string name) |
method gives type of a domain inside module More... | |
void | add_domain (Domain *d) |
method adds Domain into Domain vector More... | |
void | add_relation (Relation *r) |
method adds Relation into Relation vector More... | |
void | add_fact (Fact *r) |
method adds Fact into Fact vector More... | |
void | add_rule (Rule *r) |
method adds Rule into Rule vector More... | |
Constraints * | get_constraints () const override |
getter for constraints More... | |
virtual database * | get_wsm_database () |
fetches a database of facts from well-supported model (for summing purposes) More... | |
bool | check_constraints_local (bool check_rigid, bool check_flexible) const override |
allows for disabling constraints check 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... | |
![]() | |
ModuleGeneric () | |
default constructor | |
virtual | ~ModuleGeneric () |
default destructor | |
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 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_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... | |
Protected Attributes | |
Inter4ql::database | database_ |
![]() | |
Inter4ql::database * | database_to_add |
Inter4ql::database * | database_to_remove |
Implementation of ModuleGeneric for modules with reasoning.
Inter4ql::ModuleLocal::ModuleLocal | ( | std::string | a_name, |
Constraints * | _constraints, | ||
std::vector< Domain *> * | _domains, | ||
std::vector< Relation *> * | _relations, | ||
std::vector< Rule *> * | _rules, | ||
std::vector< Fact *> * | _facts | ||
) |
constructor
a_name | name of a module |
_constraints | module constraints |
_domains | initial vector of domains |
_relations | initial vector of relations |
_rules | initial vector of rules |
_facts | initial vector of facts |
Inter4ql::ModuleLocal::~ModuleLocal | ( | ) |
destructor
void Inter4ql::ModuleLocal::add_domain | ( | Domain * | d | ) |
void Inter4ql::ModuleLocal::add_fact | ( | Fact * | r | ) |
void Inter4ql::ModuleLocal::add_relation | ( | Relation * | r | ) |
void Inter4ql::ModuleLocal::add_rule | ( | Rule * | r | ) |
provides valuations matching given Fact
term | query to find in database |
Implements Inter4ql::ModuleGeneric.
|
overridevirtual |
allows for disabling constraints check
value | value to be set |
Reimplemented from Inter4ql::ModuleGeneric.
|
overridevirtual |
checks whether constraints are violated
Reimplemented from Inter4ql::ModuleGeneric.
|
inlineoverridevirtual |
variable_type::type Inter4ql::ModuleLocal::get_domain_type | ( | std::string | name | ) |
method gives type of a domain inside module
name | name of a domain |
|
overridevirtual |
|
virtual |
|
virtual |
|
virtual |
getter for a relation
s | name of a relation |
Reimplemented from Inter4ql::ModuleGeneric.
|
virtual |
|
inlinevirtual |
fetches a database of facts from well-supported model (for summing purposes)
Reimplemented from Inter4ql::ModuleGeneric.
Reimplemented in Inter4ql::ModuleSum.
|
virtual |
function that returns string with module information
Reimplemented from Inter4ql::ModuleGeneric.
|
virtual |
performs reasoning
Implements Inter4ql::ModuleGeneric.
|
virtual |
performs reasing with additional Rules added
rules | list of Rules to be added before reasoning |
Reimplemented from Inter4ql::ModuleGeneric.
|
inlineoverridevirtual |
allows for disabling constraints check
value | value to be set |
Reimplemented from Inter4ql::ModuleGeneric.