Debian Codegraph @

Source/Reasoner/Ontology/CConceptOperator.h

raw
1 /*
2 * Copyright (C) 2013-2015, 2019 by the Konclude Developer Team.
3 *
4 * This file is part of the reasoning system Konclude.
5 * For details and support, see <http://konclude.com/>.
6 *
7 * Konclude is free software: you can redistribute it and/or modify
8 * it under the terms of version 3 of the GNU Lesser General Public
9 * License (LGPLv3) as published by the Free Software Foundation.
10 *
11 * Konclude is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU (Lesser) General Public License for more details.
15 *
16 * You should have received a copy of the GNU (Lesser) General Public
17 * License along with Konclude. If not, see <http://www.gnu.org/licenses/>.
18 *
19 */
20
21 #ifndef KONCLUDE_REASONER_ONTOLOGY_CCONCEPTOPERATOR_H
22 #define KONCLUDE_REASONER_ONTOLOGY_CCONCEPTOPERATOR_H
23
24 // Libraries includes
25 #include <QMutex>
26
27 // Namespace includes
28 #include "OntologySettings.h"
29
30
31 // Other includes
32
33
34 // Logger includes
35 #include "Logger/CLogger.h"
36
37
38 namespace Konclude {
39
40 using namespace Utilities;
41
42 namespace Reasoner {
43
44 namespace Ontology {
45
46 /*!
47 *
48 * \class CConceptOperator
49 * \author Andreas Steigmiller
50 * \version 0.1
51 * \brief TODO
52 *
53 */
54 class CConceptOperator {
55 // public methods
56 public:
57
58 cint64 getOperatorCode();
59 cint64 getOperatorFlag();
60
61
62 static CConceptOperator* getConceptOperator(cint64 opCode);
63
64 static void generateConceptOperators();
65
66
67 const static cint64 CCF_NONE = Q_UINT64_C(0x0000000000000001);
68 const static cint64 CCF_ATOM = Q_UINT64_C(0x0000000000000001);
69 const static cint64 CCF_TOP = Q_UINT64_C(0x0000000000000002);
70 const static cint64 CCF_BOTTOM = Q_UINT64_C(0x0000000000000004);
71 const static cint64 CCF_NOT = Q_UINT64_C(0x0000000000000008);
72 const static cint64 CCF_AND = Q_UINT64_C(0x0000000000000010);
73 const static cint64 CCF_OR = Q_UINT64_C(0x0000000000000020);
74 const static cint64 CCF_ATMOST = Q_UINT64_C(0x0000000000000040);
75 const static cint64 CCF_ATLEAST = Q_UINT64_C(0x0000000000000080);
76 const static cint64 CCF_ALL = Q_UINT64_C(0x0000000000000100);
77 const static cint64 CCF_SOME = Q_UINT64_C(0x0000000000000200);
78 const static cint64 CCF_EQ = Q_UINT64_C(0x0000000000000400);
79 const static cint64 CCF_SUB = Q_UINT64_C(0x0000000000000800);
80 const static cint64 CCF_NOMINAL = Q_UINT64_C(0x0000000000001000);
81 const static cint64 CCF_SELF = Q_UINT64_C(0x0000000000002000);
82 const static cint64 CCF_AQCHOOCE = Q_UINT64_C(0x0000000000004000);
83 const static cint64 CCF_AQALL = Q_UINT64_C(0x0000000000008000);
84 const static cint64 CCF_AQSOME = Q_UINT64_C(0x0000000000010000);
85 const static cint64 CCF_AQAND = Q_UINT64_C(0x0000000000020000);
86 const static cint64 CCF_VALUE = Q_UINT64_C(0x0000000000040000);
87 const static cint64 CCF_NOMVAR = Q_UINT64_C(0x0000000000080000);
88 const static cint64 CCF_NOMTEMPLREF = Q_UINT64_C(0x0000000000100000);
89 const static cint64 CCF_IMPL = Q_UINT64_C(0x0000000000200000);
90 const static cint64 CCF_IMPLTRIG = Q_UINT64_C(0x0000000000400000);
91 const static cint64 CCF_IMPLALL = Q_UINT64_C(0x0000000000800000);
92 const static cint64 CCF_IMPLAQALL = Q_UINT64_C(0x0000000001000000);
93 const static cint64 CCF_IMPLAQAND = Q_UINT64_C(0x0000000002000000);
94 const static cint64 CCF_BRANCHIMPL = Q_UINT64_C(0x0000000004000000);
95 const static cint64 CCF_BRANCHTRIG = Q_UINT64_C(0x0000000008000000);
96 const static cint64 CCF_BRANCHALL = Q_UINT64_C(0x0000000010000000);
97 const static cint64 CCF_BRANCHAQALL = Q_UINT64_C(0x0000000020000000);
98 const static cint64 CCF_BRANCHAQAND = Q_UINT64_C(0x0000000040000000);
99 const static cint64 CCF_EQCAND = Q_UINT64_C(0x0000000080000000);
100 const static cint64 CCF_PBINDTRIG = Q_UINT64_C(0x0000000100000000);
101 const static cint64 CCF_PBINDIMPL = Q_UINT64_C(0x0000000200000000);
102 const static cint64 CCF_PBINDGROUND = Q_UINT64_C(0x0000000400000000);
103 const static cint64 CCF_PBINDALL = Q_UINT64_C(0x0000000800000000);
104 const static cint64 CCF_PBINDAND = Q_UINT64_C(0x0000001000000000);
105 const static cint64 CCF_PBINDAQAND = Q_UINT64_C(0x0000002000000000);
106 const static cint64 CCF_PBINDAQALL = Q_UINT64_C(0x0000004000000000);
107 const static cint64 CCF_PBINDVARIABLE = Q_UINT64_C(0x0000008000000000);
108 const static cint64 CCF_PBINDCYCLE = Q_UINT64_C(0x0000010000000000);
109 const static cint64 CCF_VARBINDTRIG = Q_UINT64_C(0x0000020000000000);
110 const static cint64 CCF_VARBINDJOIN = Q_UINT64_C(0x0000040000000000);
111 const static cint64 CCF_VARBINDGROUND = Q_UINT64_C(0x0000080000000000);
112 const static cint64 CCF_VARBINDALL = Q_UINT64_C(0x0000100000000000);
113 const static cint64 CCF_VARBINDAND = Q_UINT64_C(0x0000200000000000);
114 const static cint64 CCF_VARBINDAQAND = Q_UINT64_C(0x0000400000000000);
115 const static cint64 CCF_VARBINDAQALL = Q_UINT64_C(0x0000800000000000);
116 const static cint64 CCF_VARBINDVARIABLE = Q_UINT64_C(0x0001000000000000);
117 const static cint64 CCF_VARBINDIMPL = Q_UINT64_C(0x0002000000000000);
118 const static cint64 CCF_VARPBACKTRIG = Q_UINT64_C(0x0004000000000000);
119 const static cint64 CCF_VARPBACKALL = Q_UINT64_C(0x0008000000000000);
120 const static cint64 CCF_VARPBACKAQAND = Q_UINT64_C(0x0010000000000000);
121 const static cint64 CCF_VARPBACKAQALL = Q_UINT64_C(0x0020000000000000);
122 const static cint64 CCF_BACKACTIVTRIG = Q_UINT64_C(0x0040000000000000);
123 const static cint64 CCF_BACKACTIVIMPL = Q_UINT64_C(0x0080000000000000);
124
125 const static cint64 CCF_DATATYPE = Q_UINT64_C(0x0100000000000000);
126 const static cint64 CCF_DATALITERAL = Q_UINT64_C(0x0200000000000000);
127 const static cint64 CCF_DATARESTRICTION = Q_UINT64_C(0x0400000000000000);
128
129 const static cint64 CCF_MARKER = Q_UINT64_C(0x0800000000000000);
130
131 //const static cint64 CCF_NOMINALIMPLI = Q_UINT64_C(0x1000000000000000);
132 //const static cint64 CCF_DATATYPEIMPLI = Q_UINT64_C(0x2000000000000000);
133 //const static cint64 CCF_DATALITERALIMPLI = Q_UINT64_C(0x4000000000000000);
134 //const static cint64 CCF_DATARESTRICTIONIMPLI= Q_UINT64_C(0x8000000000000000);
135 const static cint64 CCF_SPECIAL = Q_UINT64_C(0x8000000000000000);
136
137
138
139 bool hasPartialOperatorCodeFlag(cint64 operatorCodeFlag);
140 bool hasAllOperatorCodeFlags(cint64 operatorCodeFlags);
141
142
143
144 const static cint64 CCFS_AND_TYPE = CCF_AND | CCF_PBINDAND | CCF_VARBINDAND | CCF_TOP;
145 const static cint64 CCFS_TRIG_TYPE = CCF_IMPLTRIG | CCF_BRANCHTRIG | CCF_PBINDTRIG | CCF_VARBINDTRIG | CCF_VARPBACKTRIG;
146 const static cint64 CCFS_ALL_TYPE = CCF_VARPBACKALL | CCF_VARBINDALL | CCF_PBINDALL | CCF_BRANCHALL | CCF_IMPLALL | CCF_ALL;
147
148 const static cint64 CCFS_AQAND_TYPE = CCF_AQAND | CCF_IMPLAQAND | CCF_BRANCHAQAND | CCF_PBINDAQAND | CCF_VARBINDAQAND | CCF_VARPBACKAQAND;
149 const static cint64 CCFS_AQALL_TYPE = CCF_AQALL | CCF_IMPLAQALL | CCF_BRANCHAQALL | CCF_PBINDAQALL | CCF_VARBINDAQALL | CCF_VARPBACKAQALL;
150
151 const static cint64 CCFS_AQ_TYPE = CCFS_AQAND_TYPE | CCFS_AQALL_TYPE;
152 const static cint64 CCFS_ALL_AQALL_TYPE = CCFS_ALL_TYPE | CCFS_AQALL_TYPE;
153 const static cint64 CCFS_TRIG_AND_AQAND_TYPE = CCFS_AND_TYPE | CCFS_TRIG_TYPE | CCFS_AQAND_TYPE;
154 const static cint64 CCFS_AND_AQAND_TYPE = CCFS_AND_TYPE | CCFS_AQAND_TYPE;
155 const static cint64 CCFS_AQAND_AQALL_TYPE = CCFS_AQAND_TYPE | CCFS_AQALL_TYPE;
156
157
158 const static cint64 CCFS_SOME_TYPE = CCF_SOME | CCF_AQSOME;
159
160 const static cint64 CCFS_IMPL_TYPE = CCF_VARBINDIMPL | CCF_PBINDIMPL | CCF_BRANCHIMPL | CCF_IMPL | CCF_BACKACTIVIMPL;
161 //const static cint64 CCFS_EXT_IMPL_TYPE = CCFS_IMPL_TYPE | CCF_NOMINALIMPLI | CCF_DATATYPEIMPLI | CCF_DATALITERALIMPLI | CCF_DATARESTRICTIONIMPLI;
162
163 const static cint64 CCFS_PROPAGATION_BIND_TYPE = CCF_PBINDTRIG | CCF_PBINDIMPL | CCF_PBINDGROUND | CCF_PBINDALL | CCF_PBINDAND | CCF_PBINDAQAND | CCF_PBINDAQALL | CCF_PBINDVARIABLE | CCF_PBINDCYCLE;
164 const static cint64 CCFS_VARIABLE_BIND_TYPE = CCF_VARBINDTRIG | CCF_VARBINDJOIN | CCF_VARBINDGROUND | CCF_VARBINDALL | CCF_VARBINDAND | CCF_VARBINDAQAND | CCF_VARBINDAQALL | CCF_VARBINDVARIABLE | CCF_VARBINDIMPL;
165 const static cint64 CCFS_BACK_PROPAGATION_TYPE = CCF_VARPBACKTRIG | CCF_VARPBACKALL | CCF_VARPBACKAQAND | CCF_VARPBACKAQALL | CCF_BACKACTIVTRIG | CCF_BACKACTIVIMPL;
166
167 const static cint64 CCFS_PROPAGATION_TYPE = CCFS_PROPAGATION_BIND_TYPE | CCFS_VARIABLE_BIND_TYPE | CCFS_BACK_PROPAGATION_TYPE;
168
169
170 const static cint64 CCFS_PROPAGATION_ALL_TYPE = CCF_PBINDALL | CCF_VARBINDALL | CCF_VARPBACKALL | CCF_PBINDAQALL | CCF_VARBINDAQALL | CCF_VARPBACKAQALL;
171
172 const static cint64 CCFS_PROPAGATION_AND_TYPE = CCF_PBINDTRIG | CCF_VARBINDTRIG | CCF_VARPBACKTRIG | CCF_PBINDAND | CCF_VARBINDAND | CCF_PBINDAQAND | CCF_VARBINDAQAND | CCF_BACKACTIVTRIG;
173
174 const static cint64 CCFS_POSSIBLE_ROLE_CREATION_TYPE = CCF_SOME | CCF_AQSOME | CCF_ALL | CCF_ATLEAST | CCF_ATMOST;
175
176 const static cint64 CCFS_ABSORPTION_RELEVANT_TYPE = CCFS_TRIG_TYPE | CCFS_IMPL_TYPE | CCF_IMPLAQALL | CCF_BRANCHAQALL | CCF_PBINDAQALL | CCF_VARBINDAQALL | CCF_VARPBACKAQALL | CCF_IMPLAQAND | CCF_BRANCHAQAND | CCF_PBINDAQAND | CCF_VARBINDAQAND | CCF_VARPBACKAQAND;
177
178 const static cint64 CCFS_DATATYPE_RELATED_TYPE = CCF_DATATYPE | CCF_DATALITERAL | CCF_DATARESTRICTION;
179
180
181 // protected methods
182 protected:
183 //! Constructor
184 CConceptOperator(cint64 opCode);
185
186 // protected variables
187 protected:
188 cint64 mOperatorCode;
189
190 cint64 mTypeFlag;
191
192
193 static CConceptOperator** mConceptOperatorVector;
194 static QMutex* mCreateLockMutex;
195
196 // private methods
197 private:
198
199 // private variables
200 private:
201
202 };
203
204 }; // end namespace Ontology
205
206 }; // end namespace Reasoner
207
208 }; // end namespace Konclude
209
210 #endif // KONCLUDE_REASONER_ONTOLOGY_CCONCEPTOPERATOR_H