Inter4ql  5.2
Fact.h
1 #ifndef __RELATIONINSTANCE_H__
2 #define __RELATIONINSTANCE_H__
3 
4 #include <vector>
5 #include "Value.h"
6 #include "Expression.h"
7 
8 namespace Inter4ql {
9 
10  class Value;
14  class Fact {
15  public:
24  explicit Fact(std::string _module, std::string a_relation, std::vector<Value *> *a_params, bool _t = true, bool _f = false);
25 
34  explicit Fact(std::string _module, std::string a_relation, Expression *a_params, bool _t = true, bool _f = false);
35 
40  explicit Fact(Fact* f);
44  ~Fact();
50  std::string print(bool type = true) const;
55  void set_value(logic_type::type _v);
65  std::vector<Value *> *get_params() const;
70  Expression *get_bel_params() const;
75  std::string get_module() const;
80  void set_module(std::string _m);
85  std::string get_relation() const;
90  void set_set(std::vector<Value *> *_v);
95  std::vector<Value *> *get_set();
100  std::string get_set_string();
105  bool is_set_query();
110  bool operator==(Fact &r);
111 
116  std::vector<std::string> get_variable_names() const;
121  void valuate_fact(std::map<std::string, Value*> binding);
126  void should_delete_bel_params(bool value);
131  void set_bel_free_query(bool value);
136  bool is_bel_free_query();
137  private:
138  std::string print_params(bool type = true) const;
139 
140  std::string module;
141  std::string relation;
142  std::vector<Value *> *params;
143  Expression *bel_params;
144  bool bel_free_query;
145  bool delete_bel_params;
146  std::vector<Value *> *set;
148  };
149 
150  bool operator<(const Fact &a, const Fact &b);
151 }
152 
153 #endif /* __RELATIONINSTANCE_H__ */
154 
std::string get_relation() const
getter for fact relation name
Definition: Fact.cc:179
bool is_bel_free_query()
setter for info whether BEL params should be deleted on destruction
Definition: Fact.cc:296
type
Enumeration type for four-valued logic.
Definition: Types.h:45
class that implements a fact
Definition: Fact.h:14
std::vector< std::string > get_variable_names() const
getter for names of variables
Definition: Fact.cc:265
void set_module(std::string _m)
setter for fact module name
Definition: Fact.cc:175
Definition: Expression.h:10
std::string print(bool type=true) const
returns string with domain information
Definition: Fact.cc:115
bool is_set_query()
ask for being a subset query
Definition: Fact.cc:232
bool operator==(Fact &r)
overloaded operator used to comparing facts
Definition: Fact.cc:72
Fact(std::string _module, std::string a_relation, std::vector< Value *> *a_params, bool _t=true, bool _f=false)
constructor that sets fact data
Definition: Fact.cc:12
void should_delete_bel_params(bool value)
setter for info whether BEL params should be deleted on destruction
Definition: Fact.cc:286
Definition: Application.cc:37
std::string get_module() const
getter for fact module name
Definition: Fact.cc:171
void set_bel_free_query(bool value)
setter for info whether BEL params should be deleted on destruction
Definition: Fact.cc:291
Inter4ql::logic_type::type get_value() const
getter for fact logical value
Definition: Fact.cc:159
void set_set(std::vector< Value *> *_v)
setter for set of types (&#39;in {...}&#39; statement)
Definition: Fact.cc:183
void valuate_fact(std::map< std::string, Value *> binding)
exchanges variables into values
Definition: Fact.cc:281
std::vector< Value * > * get_set()
getter for set of types (&#39;in {...}&#39; statement)
Definition: Fact.cc:187
std::vector< Value * > * get_params() const
getter for fact parameters
Definition: Fact.cc:167
void set_value(logic_type::type _v)
setter for fact logical value
Definition: Fact.cc:155
std::string get_set_string()
Definition: Fact.cc:191
Expression * get_bel_params() const
getter for BEL body
Definition: Fact.cc:163
~Fact()
destructor
Definition: Fact.cc:52