Inter4ql  5.2
Types.h
1 #ifndef __TYPES_H__
2 #define __TYPES_H__
3 
4 #include <vector>
5 #include <string>
6 #include <unordered_map>
7 #include <memory>
8 #include <map>
9 
10 namespace Inter4ql {
11 
12  class Program;
13  class Fact;
14  class Expression;
15  class Value;
16  class Valuation;
17 
18  typedef std::unordered_multimap<std::string, std::shared_ptr<Valuation> > database;
19  //typedef std::multimap<std::string, std::shared_ptr<Valuation> > database;
20 
23  struct variable_type {
26  enum type {
27  TYPE = 1,
28  VARIABLE = 2,
29  ID = 3,
30  STRING = 4,
31  INTEGER = 5,
32  REAL = 6,
33  DATE = 7,
34  DATE_TIME = 8,
35  LOGIC = 9,
36  INVALID = 10
37  };
38  };
39 
42  struct logic_type {
45  enum type {
46  TRUE = 1,
47  FALSE = 2,
48  UNKNOWN = 3,
49  INCONSISTENT = 4
50  };
51  };
52 
55  struct line_type {
58  enum type {
59  PROGRAM,
60  PRINT,
61  IMPORT,
62  DEBUG,
63  HELP,
64  RULE,
65  QUIT,
66  MODULES,
67  ACTIONS,
68  PROBLEMS,
69  CLEAR,
70  EXECUTE
71  };
72  };
73 
76  struct parser_line {
82  std::string value;
85  bool bool_value;
88  std::vector<std::string> values;
98  };
99 
100  struct module_type {
101  enum type {
102  LOCAL,
103  INTERNAL,
104  EXTERNAL,
105  GROUP,
106  BELIEF,
107  ACTION,
108  PROBLEM,
109  BEL
110  };
111  };
112 
113  struct operation_type {
114  enum type {
115  AND,
116  OR,
117  SUM,
118  IMPLICATION
119  };
120  };
121 
123  enum type {
124  AND,
125  OR,
126  IMPLIES,
127  NOT,
128  QUANTIFIED,
129  TERM,
130  PARALLEL,
131  SEQUENTIAL,
132 
133  };
134  };
135 }
136 
137 #endif /* __TYPES_H__ */
138 
Definition: Types.h:122
type
Enumeration type for four-valued logic.
Definition: Types.h:45
class that implements a fact
Definition: Fact.h:14
Definition: Types.h:100
std::vector< std::string > values
values of a line (used only in some cases)
Definition: Types.h:88
line_type::type type
type of a line
Definition: Types.h:79
Definition: Expression.h:10
Fact * rule
pointer to a Fact in a line (used only in some cases)
Definition: Types.h:91
Definition: Application.cc:37
bool bool_value
bool value of a line (used only in some cases)
Definition: Types.h:85
Program * program
pointer to a Program imported in a line (used only in some cases)
Definition: Types.h:97
type
Enumeration type for command line types.
Definition: Types.h:58
Definition: Types.h:113
Expression * expression
pointer to an Expression in a line (used only in some cases)
Definition: Types.h:94
structure that handles enumeration type for command line types
Definition: Types.h:55
structure that handles enumeration type for four-valued logic.
Definition: Types.h:42
type
Enumeration type for types of values.
Definition: Types.h:26
std::string value
value of a line (used only in some cases)
Definition: Types.h:82
class that handles 4QL programs
Definition: Program.h:13
structure for handling lines from interpreter
Definition: Types.h:76
structure that handles enumeration type for types of values.
Definition: Types.h:23