Inter4ql  5.2
Bel.h
1 #ifndef BEL_H
2 #define BEL_H
3 
4 #include "../ModuleInternal.h"
5 
6 namespace Inter4ql {
7 
8  class VariableSpace;
9 
12  class Bel : public ModuleInternal {
13  public:
18  explicit Bel(VariableSpace *_v, std::vector<ModuleGeneric *> *_modules);
19  ~Bel();
20  void reason();
21  Result ask_for_result(Fact * term) const override;
22  module_type::type get_module_type() const;
23  std::vector<std::string> get_references(Fact * term) override;
24 
29  void set_modules(std::vector<ModuleGeneric *> *_modules) {
30  this->modules = _modules;
31  }
36  void set_disable_constraints(bool value) const override { disable_constraints = value; };
41  bool constraints_violated() override;
42  private:
43  std::vector<ModuleGeneric *> *modules;
44 
45  mutable bool disable_constraints;
46  };
47 }
48 
49 #endif /* BEL_H */
50 
module_type::type get_module_type() const
getter for module type
Definition: Bel.cc:31
VariableSpace class for handling all values in interpreter environment.
Definition: VariableSpace.h:13
class that implements a fact
Definition: Fact.h:14
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) ...
Definition: Bel.cc:127
Definition: Result.h:16
Definition: Application.cc:37
bool constraints_violated() override
checks whether constraints are violated
Definition: Bel.cc:141
void set_modules(std::vector< ModuleGeneric *> *_modules)
sets modules set needed for computations
Definition: Bel.h:29
Result ask_for_result(Fact *term) const override
provides valuations matching given Fact
Definition: Bel.cc:90
void reason()
performs reasoning
Definition: Bel.cc:26
class that handles hardcoded relations in modules (f.e. math functions)
Definition: ModuleInternal.h:20
void set_disable_constraints(bool value) const override
allows for disabling constraints check
Definition: Bel.h:36
Math module used to implement basic math operations.
Definition: Bel.h:12
Bel(VariableSpace *_v, std::vector< ModuleGeneric *> *_modules)
constructor for Math module
Definition: Bel.cc:17