| 1 | /* This file is part of the FaCT++ DL reasoner |
| 2 | Copyright (C) 2010-2015 Dmitry Tsarkov and The University of Manchester |
| 3 | Copyright (C) 2015-2017 Dmitry Tsarkov |
| 4 | |
| 5 | This library is free software; you can redistribute it and/or |
| 6 | modify it under the terms of the GNU Lesser General Public |
| 7 | License as published by the Free Software Foundation; either |
| 8 | version 2.1 of the License, or (at your option) any later version. |
| 9 | |
| 10 | This library is distributed in the hope that it will be useful, |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 | Lesser General Public License for more details. |
| 14 | |
| 15 | You should have received a copy of the GNU Lesser General Public |
| 16 | License along with this library; if not, write to the Free Software |
| 17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 18 | */ |
| 19 | |
| 20 | #ifndef TEXPRESSIONMANAGER_H |
| 21 | #define TEXPRESSIONMANAGER_Hcxx . . $ `Kernel/tExpressionManager.h:21:9`! |
| 22 | |
| 23 | #include "tDLExpression.h"cxx . . $ `<file>/Kernel/tDLExpression.h`/ |
| 24 | #include "tNameSet.h"cxx . . $ `<file>/Kernel/tNameSet.h`/ |
| 25 | #include "tNAryQueue.h"cxx . . $ `<file>/Kernel/tNAryQueue.h`/ |
| 26 | #include "tDataTypeManager.h"cxx . . $ `<file>/Kernel/tDataTypeManager.h`/ |
| 27 | #include "tHeadTailCache.h"cxx . . $ `<file>/Kernel/tHeadTailCache.h`/ |
| 28 | |
| 29 | /// manager to work with all DL expressions in the kernel |
| 30 | class TExpressionManagercxx . . $ TExpressionManager# |
| 31 | { |
| 32 | protected: // types |
| 33 | /// cache for the one-of expressions |
| 34 | class TOneOfCachecxx . . $ TExpressionManager#TOneOfCache#: public THeadTailCachecxx . . $ THeadTailCache#<TDLConceptExpressioncxx . . $ TDLConceptExpression#, const TDLIndividualExpressioncxx . . $ TDLIndividualExpression#> |
| 35 | { |
| 36 | protected: // members |
| 37 | /// host expression manager |
| 38 | TExpressionManagercxx . . $ TExpressionManager#* pManagercxx . . $ TExpressionManager#TOneOfCache#pManager.; |
| 39 | |
| 40 | protected: // methods |
| 41 | /// the way to create an object by a given tail |
| 42 | TDLConceptExpressioncxx . . $ TDLConceptExpression#* buildcxx . . $ TExpressionManager#TOneOfCache#build(c7c486251d40ba0d). ( const TDLIndividualExpressioncxx . . $ TDLIndividualExpression#* tail ) override; |
| 43 | |
| 44 | public: // interface |
| 45 | /// empty c'tor |
| 46 | explicit TOneOfCachecxx . . $ TExpressionManager#TOneOfCache#TOneOfCache(6b33e5d527773b78). ( TExpressionManagercxx . . $ TExpressionManager#* p ) : THeadTailCachecxx . . $ THeadTailCache#THeadTailCache(49f6e7a06ebc5aa8).<TDLConceptExpressioncxx . . $ TDLConceptExpression#, const TDLIndividualExpressioncxx . . $ TDLIndividualExpression#>(), pManagercxx . . $ TExpressionManager#TOneOfCache#pManager.(p) {} |
| 47 | |
| 48 | /// clear the cache |
| 49 | void clearcxx . . $ TExpressionManager#TOneOfCache#clear(49f6e7a06ebc5aa8). ( void ) { Mapcxx . . $ THeadTailCache#Map..clearcxx . . $ std/map#clear(49f6e7a06ebc5aa8).(); } |
| 50 | }; // TOneOfCache |
| 51 | /// Cache for the inverse roles |
| 52 | class TInverseRoleCachecxx . . $ TExpressionManager#TInverseRoleCache# : public THeadTailCachecxx . . $ THeadTailCache#<TDLObjectRoleExpressioncxx . . $ TDLObjectRoleExpression#, const TDLObjectRoleExpressioncxx . . $ TDLObjectRoleExpression#> |
| 53 | { |
| 54 | protected: // members |
| 55 | /// host expression manager |
| 56 | TExpressionManagercxx . . $ TExpressionManager#* pManagercxx . . $ TExpressionManager#TInverseRoleCache#pManager.; |
| 57 | |
| 58 | protected: // methods |
| 59 | /// the way to create an object by a given tail |
| 60 | TDLObjectRoleExpressioncxx . . $ TDLObjectRoleExpression#* buildcxx . . $ TExpressionManager#TInverseRoleCache#build(c6736427cdccb407). ( const TDLObjectRoleExpressioncxx . . $ TDLObjectRoleExpression#* tail ) override; |
| 61 | |
| 62 | public: // interface |
| 63 | /// empty c'tor |
| 64 | explicit TInverseRoleCachecxx . . $ TExpressionManager#TInverseRoleCache#TInverseRoleCache(6b33e5d527773b78). ( TExpressionManagercxx . . $ TExpressionManager#* p ) : THeadTailCachecxx . . $ THeadTailCache#THeadTailCache(49f6e7a06ebc5aa8).<TDLObjectRoleExpressioncxx . . $ TDLObjectRoleExpression#, const TDLObjectRoleExpressioncxx . . $ TDLObjectRoleExpression#>(), pManagercxx . . $ TExpressionManager#TInverseRoleCache#pManager.(p) {} |
| 65 | |
| 66 | /// clear the cache |
| 67 | void clearcxx . . $ TExpressionManager#TInverseRoleCache#clear(49f6e7a06ebc5aa8). ( void ) { Mapcxx . . $ THeadTailCache#Map..clearcxx . . $ std/map#clear(49f6e7a06ebc5aa8).(); } |
| 68 | }; // TInverseRoleCache |
| 69 | |
| 70 | protected: // members |
| 71 | /// nameset for concepts |
| 72 | TNameSetcxx . . $ TNameSet#<TDLConceptNamecxx . . $ TDLConceptName#> NS_Ccxx . . $ TExpressionManager#NS_C.; |
| 73 | /// nameset for individuals |
| 74 | TNameSetcxx . . $ TNameSet#<TDLIndividualNamecxx . . $ TDLIndividualName#> NS_Icxx . . $ TExpressionManager#NS_I.; |
| 75 | /// nameset for object roles |
| 76 | TNameSetcxx . . $ TNameSet#<TDLObjectRoleNamecxx . . $ TDLObjectRoleName#> NS_ORcxx . . $ TExpressionManager#NS_OR.; |
| 77 | /// nameset for data roles |
| 78 | TNameSetcxx . . $ TNameSet#<TDLDataRoleNamecxx . . $ TDLDataRoleName#> NS_DRcxx . . $ TExpressionManager#NS_DR.; |
| 79 | /// nameset for data types |
| 80 | TDataTypeManagercxx . . $ TDataTypeManager# NS_DTcxx . . $ TExpressionManager#NS_DT.; |
| 81 | |
| 82 | /// n-ary queue for arguments |
| 83 | TNAryQueuecxx . . $ TNAryQueue#<const TDLExpressioncxx . . $ TDLExpression#> ArgQueuecxx . . $ TExpressionManager#ArgQueue.; |
| 84 | |
| 85 | /// TOP concept |
| 86 | TDLConceptTopcxx . . $ TDLConceptTop#* CTopcxx . . $ TExpressionManager#CTop.; |
| 87 | /// BOTTOM concept |
| 88 | TDLConceptBottomcxx . . $ TDLConceptBottom#* CBottomcxx . . $ TExpressionManager#CBottom.; |
| 89 | /// TOP data element |
| 90 | TDLDataTopcxx . . $ TDLDataTop#* DTopcxx . . $ TExpressionManager#DTop.; |
| 91 | /// BOTTOM data element |
| 92 | TDLDataBottomcxx . . $ TDLDataBottom#* DBottomcxx . . $ TExpressionManager#DBottom.; |
| 93 | /// TOP object role |
| 94 | TDLObjectRoleExpressioncxx . . $ TDLObjectRoleExpression#* ORTopcxx . . $ TExpressionManager#ORTop.; |
| 95 | /// BOTTOM object role |
| 96 | TDLObjectRoleExpressioncxx . . $ TDLObjectRoleExpression#* ORBottomcxx . . $ TExpressionManager#ORBottom.; |
| 97 | /// TOP data role |
| 98 | TDLDataRoleExpressioncxx . . $ TDLDataRoleExpression#* DRTopcxx . . $ TExpressionManager#DRTop.; |
| 99 | /// BOTTOM data role |
| 100 | TDLDataRoleExpressioncxx . . $ TDLDataRoleExpression#* DRBottomcxx . . $ TExpressionManager#DRBottom.; |
| 101 | |
| 102 | /// record all the references |
| 103 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<TDLExpressioncxx . . $ TDLExpression#*> RefRecordercxx . . $ TExpressionManager#RefRecorder.; |
| 104 | |
| 105 | /// cache for the role inverses |
| 106 | TInverseRoleCachecxx . . $ TExpressionManager#TInverseRoleCache# InverseRoleCachecxx . . $ TExpressionManager#InverseRoleCache.; |
| 107 | /// cache for the one-of singletons |
| 108 | TOneOfCachecxx . . $ TExpressionManager#TOneOfCache# OneOfCachecxx . . $ TExpressionManager#OneOfCache.; |
| 109 | |
| 110 | protected: // methods |
| 111 | /// record the reference; @return the argument |
| 112 | template <typename T> |
| 113 | T* recordcxx . . $ TExpressionManager#record(98ea26de6545f0ca). ( T* arg ) { RefRecordercxx . . $ TExpressionManager#RefRecorder..push_backcxx . . $ std/vector#push_back(fe7a8a4d1eddb70).(arg); return arg; } |
| 114 | |
| 115 | public: // interface |
| 116 | /// empty c'tor |
| 117 | TExpressionManagercxx . . $ TExpressionManager#TExpressionManager(49f6e7a06ebc5aa8). ( void ); |
| 118 | /// d'tor |
| 119 | ~cxx . . $ TExpressionManager#`~TExpressionManager`(49f6e7a06ebc5aa8).TExpressionManagercxx . . $ TExpressionManager#(); |
| 120 | |
| 121 | /// clear the ontology |
| 122 | void clearcxx . . $ TExpressionManager#clear(49f6e7a06ebc5aa8). ( void ); |
| 123 | /// clear the TNamedEntry cache for all elements of all name-sets |
| 124 | void clearNameCachecxx . . $ TExpressionManager#clearNameCache(49f6e7a06ebc5aa8). ( void ); |
| 125 | |
| 126 | // top/bottom roles |
| 127 | |
| 128 | /// set Top/Bot properties |
| 129 | void setTopBottomRolescxx . . $ TExpressionManager#setTopBottomRoles(292f14abfe735e66). ( const char* topORoleName, const char* botORoleName, const char* topDRoleName, const char* botDRoleName ) |
| 130 | { |
| 131 | delete ORTopcxx . . $ TExpressionManager#ORTop.; |
| 132 | ORTopcxx . . $ TExpressionManager#ORTop. = new TDLObjectRoleNamecxx . . $ TDLObjectRoleName#TDLObjectRoleName(9c546c94e5fcce4e).(topORoleNamecxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).); |
| 133 | delete ORBottomcxx . . $ TExpressionManager#ORBottom.; |
| 134 | ORBottomcxx . . $ TExpressionManager#ORBottom. = new TDLObjectRoleNamecxx . . $ TDLObjectRoleName#TDLObjectRoleName(9c546c94e5fcce4e).(botORoleNamecxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).); |
| 135 | delete DRTopcxx . . $ TExpressionManager#DRTop.; |
| 136 | DRTopcxx . . $ TExpressionManager#DRTop. = new TDLDataRoleNamecxx . . $ TDLDataRoleName#TDLDataRoleName(9c546c94e5fcce4e).(topDRoleNamecxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).); |
| 137 | delete DRBottomcxx . . $ TExpressionManager#DRBottom.; |
| 138 | DRBottomcxx . . $ TExpressionManager#DRBottom. = new TDLDataRoleNamecxx . . $ TDLDataRoleName#TDLDataRoleName(9c546c94e5fcce4e).(botDRoleNamecxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).); |
| 139 | } |
| 140 | /// @return true iff R is a top object role |
| 141 | bool isUniversalRolecxx . . $ TExpressionManager#isUniversalRole(929c67d897f059b6). ( const TDLObjectRoleExpressioncxx . . $ TDLObjectRoleExpression#* R ) const { return R == ORTopcxx . . $ TExpressionManager#ORTop.; } |
| 142 | /// @return true iff R is a top data role |
| 143 | bool isUniversalRolecxx . . $ TExpressionManager#isUniversalRole(fd03026e302f4366). ( const TDLDataRoleExpressioncxx . . $ TDLDataRoleExpression#* R ) const { return R == DRTopcxx . . $ TExpressionManager#DRTop.; } |
| 144 | /// @return true iff R is a bottom object role |
| 145 | bool isEmptyRolecxx . . $ TExpressionManager#isEmptyRole(929c67d897f059b6). ( const TDLObjectRoleExpressioncxx . . $ TDLObjectRoleExpression#* R ) const { return R == ORBottomcxx . . $ TExpressionManager#ORBottom.; } |
| 146 | /// @return true iff R is a bottom data role |
| 147 | bool isEmptyRolecxx . . $ TExpressionManager#isEmptyRole(fd03026e302f4366). ( const TDLDataRoleExpressioncxx . . $ TDLDataRoleExpression#* R ) const { return R == DRBottomcxx . . $ TExpressionManager#DRBottom.; } |
| 148 | |
| 149 | // entries count |
| 150 | |
| 151 | /// get number of registered concepts |
| 152 | size_tcxx . . $ size_t# nConceptscxx . . $ TExpressionManager#nConcepts(fe4d2d262d4164a8). ( void ) const { return NS_Ccxx . . $ TExpressionManager#NS_C..sizecxx . . $ TNameSet#size(fe4d2d262d4164a8).(); } |
| 153 | /// get number of registered individuals |
| 154 | size_tcxx . . $ size_t# nIndividualscxx . . $ TExpressionManager#nIndividuals(fe4d2d262d4164a8). ( void ) const { return NS_Icxx . . $ TExpressionManager#NS_I..sizecxx . . $ TNameSet#size(fe4d2d262d4164a8).(); } |
| 155 | /// get number of registered object roles |
| 156 | size_tcxx . . $ size_t# nORolescxx . . $ TExpressionManager#nORoles(fe4d2d262d4164a8). ( void ) const { return NS_ORcxx . . $ TExpressionManager#NS_OR..sizecxx . . $ TNameSet#size(fe4d2d262d4164a8).(); } |
| 157 | /// get number of registered data roles |
| 158 | size_tcxx . . $ size_t# nDRolescxx . . $ TExpressionManager#nDRoles(fe4d2d262d4164a8). ( void ) const { return NS_DRcxx . . $ TExpressionManager#NS_DR..sizecxx . . $ TNameSet#size(fe4d2d262d4164a8).(); } |
| 159 | |
| 160 | // argument lists |
| 161 | |
| 162 | /// opens new argument list |
| 163 | void newArgListcxx . . $ TExpressionManager#newArgList(49f6e7a06ebc5aa8). ( void ) { ArgQueuecxx . . $ TExpressionManager#ArgQueue..openArgListcxx . . $ TNAryQueue#openArgList(49f6e7a06ebc5aa8).(); } |
| 164 | /// add argument ARG to the current argument list |
| 165 | void addArgcxx . . $ TExpressionManager#addArg(ca1ea7df707d7472). ( const TDLExpressioncxx . . $ TDLExpression#* arg ) { ArgQueuecxx . . $ TExpressionManager#ArgQueue..addArgcxx . . $ TNAryQueue#addArg(ebd0a1552f8ce24f).(arg); } |
| 166 | /// get the latest argument list |
| 167 | const stdcxx . . $ std/::vectorcxx . . $ std/vector#<const TDLExpressioncxx . . $ TDLExpression#*>& getArgListcxx . . $ TExpressionManager#getArgList(ea12e55bef799de0). ( void ) { return ArgQueuecxx . . $ TExpressionManager#ArgQueue..getLastArgListcxx . . $ TNAryQueue#getLastArgList(37c7e4be0c3236c5).(); } |
| 168 | |
| 169 | // create expressions methods |
| 170 | |
| 171 | // concepts |
| 172 | |
| 173 | /// get TOP concept |
| 174 | TDLConceptTopcxx . . $ TDLConceptTop#* Topcxx . . $ TExpressionManager#Top(aac0c49b6bdfac38). ( void ) const { return CTopcxx . . $ TExpressionManager#CTop.; } |
| 175 | /// get BOTTOM concept |
| 176 | TDLConceptBottomcxx . . $ TDLConceptBottom#* Bottomcxx . . $ TExpressionManager#Bottom(2a1e789bc1a0a42f). ( void ) const { return CBottomcxx . . $ TExpressionManager#CBottom.; } |
| 177 | /// get named concept |
| 178 | TDLConceptNamecxx . . $ TDLConceptName#* Conceptcxx . . $ TExpressionManager#Concept(f43767f328f84e3). ( const stdcxx . . $ std/::stringcxx . . $ std/string#& name ) { return NS_Ccxx . . $ TExpressionManager#NS_C..insertcxx . . $ TNameSet#insert(e53703f8e2b82653).(name); } |
| 179 | /// get negation of a concept C |
| 180 | TDLConceptExpressioncxx . . $ TDLConceptExpression#* Notcxx . . $ TExpressionManager#Not(a5147c10d6f77be7). ( const TDLConceptExpressioncxx . . $ TDLConceptExpression#* C ) { return recordcxx . . $ TExpressionManager#record(98ea26de6545f0ca).(new TDLConceptNotcxx . . $ TDLConceptNot#TDLConceptNot(796585798ce1461a).(C)); } |
| 181 | /// get an n-ary conjunction expression; take the arguments from the last argument list |
| 182 | TDLConceptExpressioncxx . . $ TDLConceptExpression#* Andcxx . . $ TExpressionManager#And(bdfb1e6da6a1dacd). ( void ) { return recordcxx . . $ TExpressionManager#record(98ea26de6545f0ca).(new TDLConceptAndcxx . . $ TDLConceptAnd#TDLConceptAnd(d9b6f75bcac4e62b).(getArgListcxx . . $ TExpressionManager#getArgList(ea12e55bef799de0).())); } |
| 183 | /// @return C and D |
| 184 | TDLConceptExpressioncxx . . $ TDLConceptExpression#* Andcxx . . $ TExpressionManager#And(d906876d1fd42231). ( const TDLConceptExpressioncxx . . $ TDLConceptExpression#* C, const TDLConceptExpressioncxx . . $ TDLConceptExpression#* D ) |
| 185 | { newArgListcxx . . $ TExpressionManager#newArgList(49f6e7a06ebc5aa8).(); addArgcxx . . $ TExpressionManager#addArg(ca1ea7df707d7472).(C); addArgcxx . . $ TExpressionManager#addArg(ca1ea7df707d7472).(D); return Andcxx . . $ TExpressionManager#And(bdfb1e6da6a1dacd).(); } |
| 186 | /// get an n-ary disjunction expression; take the arguments from the last argument list |
| 187 | TDLConceptExpressioncxx . . $ TDLConceptExpression#* Orcxx . . $ TExpressionManager#Or(bdfb1e6da6a1dacd). ( void ) { return recordcxx . . $ TExpressionManager#record(98ea26de6545f0ca).(new TDLConceptOrcxx . . $ TDLConceptOr#TDLConceptOr(d9b6f75bcac4e62b).(getArgListcxx . . $ TExpressionManager#getArgList(ea12e55bef799de0).())); } |
| 188 | /// @return C or D |
| 189 | TDLConceptExpressioncxx . . $ TDLConceptExpression#* Orcxx . . $ TExpressionManager#Or(d906876d1fd42231). ( const TDLConceptExpressioncxx . . $ TDLConceptExpression#* C, const TDLConceptExpressioncxx . . $ TDLConceptExpression#* D ) |
| 190 | { newArgListcxx . . $ TExpressionManager#newArgList(49f6e7a06ebc5aa8).(); addArgcxx . . $ TExpressionManager#addArg(ca1ea7df707d7472).(C); addArgcxx . . $ TExpressionManager#addArg(ca1ea7df707d7472).(D); return Orcxx . . $ TExpressionManager#Or(bdfb1e6da6a1dacd).(); } |
| 191 | /// get an n-ary one-of expression; take the arguments from the last argument list |
| 192 | TDLConceptExpressioncxx . . $ TDLConceptExpression#* OneOfcxx . . $ TExpressionManager#OneOf(bdfb1e6da6a1dacd). ( void ) |
| 193 | { |
| 194 | auto& v = getArgListcxx . . $ TExpressionManager#getArgList(ea12e55bef799de0).(); |
| 195 | if ( v.sizecxx . . $ std/vector#size(fe4d2d262d4164a8).() == 1 ) |
| 196 | return OneOfCachecxx . . $ TExpressionManager#OneOfCache..getcxx . . $ THeadTailCache#get(9aa174cd179d8daa).(static_cast<const TDLIndividualExpressioncxx . . $ TDLIndividualExpression#*>(v.frontcxx . . $ std/vector#front(41f1d0357789174c).())); |
| 197 | return recordcxx . . $ TExpressionManager#record(98ea26de6545f0ca).(new TDLConceptOneOfcxx . . $ TDLConceptOneOf#TDLConceptOneOf(d9b6f75bcac4e62b).(v)); |
| 198 | } |
| 199 | /// @return concept {I} for the individual I |
| 200 | TDLConceptExpressioncxx . . $ TDLConceptExpression#* OneOfcxx . . $ TExpressionManager#OneOf(c7c486251d40ba0d). ( const TDLIndividualExpressioncxx . . $ TDLIndividualExpression#* I ) { return OneOfCachecxx . . $ TExpressionManager#OneOfCache..getcxx . . $ THeadTailCache#get(9aa174cd179d8daa).(I); } |
| 201 | |
| 202 | /// get self-reference restriction of an object role R |
| 203 | TDLConceptExpressioncxx . . $ TDLConceptExpression#* SelfReferencecxx . . $ TExpressionManager#SelfReference(9065bafcb0572b22). ( const TDLObjectRoleExpressioncxx . . $ TDLObjectRoleExpression#* R ) { return recordcxx . . $ TExpressionManager#record(98ea26de6545f0ca).(new TDLConceptObjectSelfcxx . . $ TDLConceptObjectSelf#TDLConceptObjectSelf(4301d0bef5e81149).(R)); } |
| 204 | /// get value restriction wrt an object role R and an individual I |
| 205 | TDLConceptExpressioncxx . . $ TDLConceptExpression#* Valuecxx . . $ TExpressionManager#Value(69f3b6d87cafa765). ( const TDLObjectRoleExpressioncxx . . $ TDLObjectRoleExpression#* R, const TDLIndividualExpressioncxx . . $ TDLIndividualExpression#* I ) |
| 206 | { return recordcxx . . $ TExpressionManager#record(98ea26de6545f0ca).(new TDLConceptObjectValuecxx . . $ TDLConceptObjectValue#TDLConceptObjectValue(7b22ab9253f3883e).(R,I)); } |
| 207 | /// get existential restriction wrt an object role R and a concept C |
| 208 | TDLConceptExpressioncxx . . $ TDLConceptExpression#* Existscxx . . $ TExpressionManager#Exists(1977ffbf49b50255). ( const TDLObjectRoleExpressioncxx . . $ TDLObjectRoleExpression#* R, const TDLConceptExpressioncxx . . $ TDLConceptExpression#* C ) |
| 209 | { return recordcxx . . $ TExpressionManager#record(98ea26de6545f0ca).(new TDLConceptObjectExistscxx . . $ TDLConceptObjectExists#TDLConceptObjectExists(609642eea48c4756).(R,C)); } |
| 210 | /// get universal restriction wrt an object role R and a concept C |
| 211 | TDLConceptExpressioncxx . . $ TDLConceptExpression#* Forallcxx . . $ TExpressionManager#Forall(1977ffbf49b50255). ( const TDLObjectRoleExpressioncxx . . $ TDLObjectRoleExpression#* R, const TDLConceptExpressioncxx . . $ TDLConceptExpression#* C ) |
| 212 | { return recordcxx . . $ TExpressionManager#record(98ea26de6545f0ca).(new TDLConceptObjectForallcxx . . $ TDLConceptObjectForall#TDLConceptObjectForall(609642eea48c4756).(R,C)); } |
| 213 | /// get min cardinality restriction wrt number N, an object role R and a concept C |
| 214 | TDLConceptExpressioncxx . . $ TDLConceptExpression#* MinCardinalitycxx . . $ TExpressionManager#MinCardinality(7ff11ffeb6ece181). ( unsigned int n, const TDLObjectRoleExpressioncxx . . $ TDLObjectRoleExpression#* R, const TDLConceptExpressioncxx . . $ TDLConceptExpression#* C ) |
| 215 | { return recordcxx . . $ TExpressionManager#record(98ea26de6545f0ca).(new TDLConceptObjectMinCardinalitycxx . . $ TDLConceptObjectMinCardinality#TDLConceptObjectMinCardinality(410226ad16905f73).(n,R,C)); } |
| 216 | /// get max cardinality restriction wrt number N, an object role R and a concept C |
| 217 | TDLConceptExpressioncxx . . $ TDLConceptExpression#* MaxCardinalitycxx . . $ TExpressionManager#MaxCardinality(7ff11ffeb6ece181). ( unsigned int n, const TDLObjectRoleExpressioncxx . . $ TDLObjectRoleExpression#* R, const TDLConceptExpressioncxx . . $ TDLConceptExpression#* C ) |
| 218 | { return recordcxx . . $ TExpressionManager#record(98ea26de6545f0ca).(new TDLConceptObjectMaxCardinalitycxx . . $ TDLConceptObjectMaxCardinality#TDLConceptObjectMaxCardinality(410226ad16905f73).(n,R,C)); } |
| 219 | /// get exact cardinality restriction wrt number N, an object role R and a concept C |
| 220 | TDLConceptExpressioncxx . . $ TDLConceptExpression#* Cardinalitycxx . . $ TExpressionManager#Cardinality(7ff11ffeb6ece181). ( unsigned int n, const TDLObjectRoleExpressioncxx . . $ TDLObjectRoleExpression#* R, const TDLConceptExpressioncxx . . $ TDLConceptExpression#* C ) |
| 221 | { return recordcxx . . $ TExpressionManager#record(98ea26de6545f0ca).(new TDLConceptObjectExactCardinalitycxx . . $ TDLConceptObjectExactCardinality#TDLConceptObjectExactCardinality(410226ad16905f73).(n,R,C)); } |
| 222 | |
| 223 | /// get value restriction wrt a data role R and a data value V |
| 224 | TDLConceptExpressioncxx . . $ TDLConceptExpression#* Valuecxx . . $ TExpressionManager#Value(62218c83419ce0c7). ( const TDLDataRoleExpressioncxx . . $ TDLDataRoleExpression#* R, const TDLDataValuecxx . . $ TDLDataValue#* V ) |
| 225 | { return recordcxx . . $ TExpressionManager#record(98ea26de6545f0ca).(new TDLConceptDataValuecxx . . $ TDLConceptDataValue#TDLConceptDataValue(23daa62466659a4c).(R,V)); } |
| 226 | /// get existential restriction wrt a data role R and a data expression E |
| 227 | TDLConceptExpressioncxx . . $ TDLConceptExpression#* Existscxx . . $ TExpressionManager#Exists(2a4ec6bc45376abb). ( const TDLDataRoleExpressioncxx . . $ TDLDataRoleExpression#* R, const TDLDataExpressioncxx . . $ TDLDataExpression#* E ) |
| 228 | { return recordcxx . . $ TExpressionManager#record(98ea26de6545f0ca).(new TDLConceptDataExistscxx . . $ TDLConceptDataExists#TDLConceptDataExists(8674b0a595b76b2d).(R,E)); } |
| 229 | /// get universal restriction wrt a data role R and a data expression E |
| 230 | TDLConceptExpressioncxx . . $ TDLConceptExpression#* Forallcxx . . $ TExpressionManager#Forall(2a4ec6bc45376abb). ( const TDLDataRoleExpressioncxx . . $ TDLDataRoleExpression#* R, const TDLDataExpressioncxx . . $ TDLDataExpression#* E ) |
| 231 | { return recordcxx . . $ TExpressionManager#record(98ea26de6545f0ca).(new TDLConceptDataForallcxx . . $ TDLConceptDataForall#TDLConceptDataForall(8674b0a595b76b2d).(R,E)); } |
| 232 | /// get min cardinality restriction wrt number N, a data role R and a data expression E |
| 233 | TDLConceptExpressioncxx . . $ TDLConceptExpression#* MinCardinalitycxx . . $ TExpressionManager#MinCardinality(970f1e34a516ac29). ( unsigned int n, const TDLDataRoleExpressioncxx . . $ TDLDataRoleExpression#* R, const TDLDataExpressioncxx . . $ TDLDataExpression#* E ) |
| 234 | { return recordcxx . . $ TExpressionManager#record(98ea26de6545f0ca).(new TDLConceptDataMinCardinalitycxx . . $ TDLConceptDataMinCardinality#TDLConceptDataMinCardinality(6791e7da299534ee).(n,R,E)); } |
| 235 | /// get max cardinality restriction wrt number N, a data role R and a data expression E |
| 236 | TDLConceptExpressioncxx . . $ TDLConceptExpression#* MaxCardinalitycxx . . $ TExpressionManager#MaxCardinality(970f1e34a516ac29). ( unsigned int n, const TDLDataRoleExpressioncxx . . $ TDLDataRoleExpression#* R, const TDLDataExpressioncxx . . $ TDLDataExpression#* E ) |
| 237 | { return recordcxx . . $ TExpressionManager#record(98ea26de6545f0ca).(new TDLConceptDataMaxCardinalitycxx . . $ TDLConceptDataMaxCardinality#TDLConceptDataMaxCardinality(6791e7da299534ee).(n,R,E)); } |
| 238 | /// get exact cardinality restriction wrt number N, a data role R and a data expression E |
| 239 | TDLConceptExpressioncxx . . $ TDLConceptExpression#* Cardinalitycxx . . $ TExpressionManager#Cardinality(970f1e34a516ac29). ( unsigned int n, const TDLDataRoleExpressioncxx . . $ TDLDataRoleExpression#* R, const TDLDataExpressioncxx . . $ TDLDataExpression#* E ) |
| 240 | { return recordcxx . . $ TExpressionManager#record(98ea26de6545f0ca).(new TDLConceptDataExactCardinalitycxx . . $ TDLConceptDataExactCardinality#TDLConceptDataExactCardinality(6791e7da299534ee).(n,R,E)); } |
| 241 | |
| 242 | // individuals |
| 243 | |
| 244 | /// get named individual |
| 245 | TDLIndividualNamecxx . . $ TDLIndividualName#* Individualcxx . . $ TExpressionManager#Individual(fa65f56176e0b266). ( const stdcxx . . $ std/::stringcxx . . $ std/string#& name ) { return NS_Icxx . . $ TExpressionManager#NS_I..insertcxx . . $ TNameSet#insert(e53703f8e2b82653).(name); } |
| 246 | |
| 247 | // object roles |
| 248 | |
| 249 | /// get TOP object role |
| 250 | TDLObjectRoleExpressioncxx . . $ TDLObjectRoleExpression#* ObjectRoleTopcxx . . $ TExpressionManager#ObjectRoleTop(447ac0a82727e308). ( void ) const { return ORTopcxx . . $ TExpressionManager#ORTop.; } |
| 251 | /// get BOTTOM object role |
| 252 | TDLObjectRoleExpressioncxx . . $ TDLObjectRoleExpression#* ObjectRoleBottomcxx . . $ TExpressionManager#ObjectRoleBottom(447ac0a82727e308). ( void ) const { return ORBottomcxx . . $ TExpressionManager#ORBottom.; } |
| 253 | /// get named object role |
| 254 | TDLObjectRoleNamecxx . . $ TDLObjectRoleName#* ObjectRolecxx . . $ TExpressionManager#ObjectRole(9eb6018165b5acba). ( const stdcxx . . $ std/::stringcxx . . $ std/string#& name ) { return NS_ORcxx . . $ TExpressionManager#NS_OR..insertcxx . . $ TNameSet#insert(e53703f8e2b82653).(name); } |
| 255 | /// get an inverse of a given object role expression R |
| 256 | TDLObjectRoleExpressioncxx . . $ TDLObjectRoleExpression#* Inversecxx . . $ TExpressionManager#Inverse(c6736427cdccb407). ( const TDLObjectRoleExpressioncxx . . $ TDLObjectRoleExpression#* R ) { return InverseRoleCachecxx . . $ TExpressionManager#InverseRoleCache..getcxx . . $ THeadTailCache#get(9aa174cd179d8daa).(R); } |
| 257 | /// get a role chain corresponding to R1 o ... o Rn; take the arguments from the last argument list |
| 258 | TDLObjectRoleComplexExpressioncxx . . $ TDLObjectRoleComplexExpression#* Composecxx . . $ TExpressionManager#Compose(5f62c3934368bfed). ( void ) { return recordcxx . . $ TExpressionManager#record(98ea26de6545f0ca).(new TDLObjectRoleChaincxx . . $ TDLObjectRoleChain#TDLObjectRoleChain(d9b6f75bcac4e62b).(getArgListcxx . . $ TExpressionManager#getArgList(ea12e55bef799de0).())); } |
| 259 | /// get a expression corresponding to R projected from C |
| 260 | TDLObjectRoleComplexExpressioncxx . . $ TDLObjectRoleComplexExpression#* ProjectFromcxx . . $ TExpressionManager#ProjectFrom(afe880527d531d5c). ( const TDLObjectRoleExpressioncxx . . $ TDLObjectRoleExpression#* R, const TDLConceptExpressioncxx . . $ TDLConceptExpression#* C ) |
| 261 | { return recordcxx . . $ TExpressionManager#record(98ea26de6545f0ca).(new TDLObjectRoleProjectionFromcxx . . $ TDLObjectRoleProjectionFrom#TDLObjectRoleProjectionFrom(609642eea48c4756).(R,C)); } |
| 262 | /// get a expression corresponding to R projected into C |
| 263 | TDLObjectRoleComplexExpressioncxx . . $ TDLObjectRoleComplexExpression#* ProjectIntocxx . . $ TExpressionManager#ProjectInto(afe880527d531d5c). ( const TDLObjectRoleExpressioncxx . . $ TDLObjectRoleExpression#* R, const TDLConceptExpressioncxx . . $ TDLConceptExpression#* C ) |
| 264 | { return recordcxx . . $ TExpressionManager#record(98ea26de6545f0ca).(new TDLObjectRoleProjectionIntocxx . . $ TDLObjectRoleProjectionInto#TDLObjectRoleProjectionInto(609642eea48c4756).(R,C)); } |
| 265 | |
| 266 | // data roles |
| 267 | |
| 268 | /// get TOP data role |
| 269 | TDLDataRoleExpressioncxx . . $ TDLDataRoleExpression#* DataRoleTopcxx . . $ TExpressionManager#DataRoleTop(d4873ea8157b134c). ( void ) const { return DRTopcxx . . $ TExpressionManager#DRTop.; } |
| 270 | /// get BOTTOM data role |
| 271 | TDLDataRoleExpressioncxx . . $ TDLDataRoleExpression#* DataRoleBottomcxx . . $ TExpressionManager#DataRoleBottom(d4873ea8157b134c). ( void ) const { return DRBottomcxx . . $ TExpressionManager#DRBottom.; } |
| 272 | /// get named data role |
| 273 | TDLDataRoleNamecxx . . $ TDLDataRoleName#* DataRolecxx . . $ TExpressionManager#DataRole(850aa2aceb89231f). ( const stdcxx . . $ std/::stringcxx . . $ std/string#& name ) { return NS_DRcxx . . $ TExpressionManager#NS_DR..insertcxx . . $ TNameSet#insert(e53703f8e2b82653).(name); } |
| 274 | |
| 275 | // data expressions |
| 276 | |
| 277 | /// get TOP data element |
| 278 | TDLDataExpressioncxx . . $ TDLDataExpression#* DataTopcxx . . $ TExpressionManager#DataTop(9f9fdff2273d849c). ( void ) const { return DTopcxx . . $ TExpressionManager#DTop.; } |
| 279 | /// get BOTTOM data element |
| 280 | TDLDataExpressioncxx . . $ TDLDataExpression#* DataBottomcxx . . $ TExpressionManager#DataBottom(9f9fdff2273d849c). ( void ) const { return DBottomcxx . . $ TExpressionManager#DBottom.; } |
| 281 | |
| 282 | /// get named data type |
| 283 | TDLDataTypeNamecxx . . $ TDLDataTypeName#* DataTypecxx . . $ TExpressionManager#DataType(54de49735a4d92bb). ( const stdcxx . . $ std/::stringcxx . . $ std/string#& name ) { return NS_DTcxx . . $ TExpressionManager#NS_DT..insertcxx . . $ TNameSet#insert(e53703f8e2b82653).(name); } |
| 284 | /// get basic string data type |
| 285 | TDLDataTypeNamecxx . . $ TDLDataTypeName#* getStrDataTypecxx . . $ TExpressionManager#getStrDataType(af9ac3d67b9a694f). ( void ) { return DataTypecxx . . $ TExpressionManager#DataType(54de49735a4d92bb).(TDataTypeManagercxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).::getStrTypeNamecxx . . $ TDataTypeManager#getStrTypeName(33a1f659e94feb42).()); } |
| 286 | /// get basic integer data type |
| 287 | TDLDataTypeNamecxx . . $ TDLDataTypeName#* getIntDataTypecxx . . $ TExpressionManager#getIntDataType(af9ac3d67b9a694f). ( void ) { return DataTypecxx . . $ TExpressionManager#DataType(54de49735a4d92bb).(TDataTypeManagercxx . . $ TDataTypeManager#::getIntTypeNamecxx . . $ TDataTypeManager#getIntTypeName(33a1f659e94feb42).()); } |
| 288 | /// get basic floating point data type |
| 289 | TDLDataTypeNamecxx . . $ TDLDataTypeName#* getRealDataTypecxx . . $ TExpressionManager#getRealDataType(af9ac3d67b9a694f). ( void ) { return DataTypecxx . . $ TExpressionManager#DataType(54de49735a4d92bb).(TDataTypeManagercxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).::getRealTypeNamecxx . . $ TDataTypeManager#getRealTypeName(33a1f659e94feb42).()); } |
| 290 | /// get basic boolean data type |
| 291 | TDLDataTypeNamecxx . . $ TDLDataTypeName#* getBoolDataTypecxx . . $ TExpressionManager#getBoolDataType(af9ac3d67b9a694f). ( void ) { return DataTypecxx . . $ TExpressionManager#DataType(54de49735a4d92bb).(TDataTypeManagercxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).::getBoolTypeNamecxx . . $ TDataTypeManager#getBoolTypeName(33a1f659e94feb42).()); } |
| 292 | /// get basic date-time data type |
| 293 | TDLDataTypeNamecxx . . $ TDLDataTypeName#* getTimeDataTypecxx . . $ TExpressionManager#getTimeDataType(af9ac3d67b9a694f). ( void ) { return DataTypecxx . . $ TExpressionManager#DataType(54de49735a4d92bb).(TDataTypeManagercxx . . $ TDataTypeManager#::getTimeTypeNamecxx . . $ TDataTypeManager#getTimeTypeName(33a1f659e94feb42).()); } |
| 294 | |
| 295 | /// get basic boolean data type |
| 296 | TDLDataTypeRestrictioncxx . . $ TDLDataTypeRestriction#* RestrictedTypecxx . . $ TExpressionManager#RestrictedType(835ba682b65d9bd9). ( TDLDataTypeExpressioncxx . . $ TDLDataTypeExpression#* type, const TDLFacetExpressioncxx . . $ TDLFacetExpression#* facet ) |
| 297 | { |
| 298 | TDLDataTypeRestrictioncxx . . $ TDLDataTypeRestriction#* ret = dynamic_cast<TDLDataTypeRestrictioncxx . . $ TDLDataTypeRestriction#*>(type); |
| 299 | if ( ret == nullptr ) |
| 300 | { // get a type and build an appropriate restriction of it |
| 301 | TDLDataTypeNamecxx . . $ TDLDataTypeName#* hostType = dynamic_cast<TDLDataTypeNamecxx . . $ TDLDataTypeName#*>(type); |
| 302 | fpp_assertcxx . . $ EFPPAssertion# ( hostType != nullptr ); |
| 303 | ret = recordcxx . . $ TExpressionManager#record(98ea26de6545f0ca).(new TDLDataTypeRestrictioncxx . . $ TDLDataTypeRestriction#TDLDataTypeRestriction(e69984f24f142880).(hostType)); |
| 304 | } |
| 305 | ret->addcxx . . $ TDLNAryExpression#add(ca1ea7df707d7472).(facet); |
| 306 | return ret; |
| 307 | } |
| 308 | |
| 309 | /// get data value with given VALUE and TYPE; |
| 310 | // FIXME!! now change the type to the basic type of the given one |
| 311 | // That is, value of a type positiveInteger will be of a type Integer |
| 312 | const TDLDataValuecxx . . $ TDLDataValue#* DataValuecxx . . $ TExpressionManager#DataValue(20efe8b18616abe3). ( const stdcxx . . $ std/::stringcxx . . $ std/string#& value, TDLDataTypeExpressioncxx . . $ TDLDataTypeExpression#* type ) { return getBasicDataTypecxx . . $ getBasicDataType(4f1c4d72facb3d6b).(type)->getValuecxx . . $ TDLDataType#getValue(64fba7c86b418ddf).(value); } |
| 313 | /// get negation of a data expression E |
| 314 | TDLDataExpressioncxx . . $ TDLDataExpression#* DataNotcxx . . $ TExpressionManager#DataNot(83abbe967e1a7d33). ( const TDLDataExpressioncxx . . $ TDLDataExpression#* E ) { return recordcxx . . $ TExpressionManager#record(98ea26de6545f0ca).(new TDLDataNotcxx . . $ TDLDataNot#TDLDataNot(af0efaeb7ee513e5).(E)); } |
| 315 | /// get an n-ary data conjunction expression; take the arguments from the last argument list |
| 316 | TDLDataExpressioncxx . . $ TDLDataExpression#* DataAndcxx . . $ TExpressionManager#DataAnd(b4330069d252c810). ( void ) { return recordcxx . . $ TExpressionManager#record(98ea26de6545f0ca).(new TDLDataAndcxx . . $ TDLDataAnd#TDLDataAnd(d9b6f75bcac4e62b).(getArgListcxx . . $ TExpressionManager#getArgList(ea12e55bef799de0).())); } |
| 317 | /// get an n-ary data disjunction expression; take the arguments from the last argument list |
| 318 | TDLDataExpressioncxx . . $ TDLDataExpression#* DataOrcxx . . $ TExpressionManager#DataOr(b4330069d252c810). ( void ) { return recordcxx . . $ TExpressionManager#record(98ea26de6545f0ca).(new TDLDataOrcxx . . $ TDLDataOr#TDLDataOr(d9b6f75bcac4e62b).(getArgListcxx . . $ TExpressionManager#getArgList(ea12e55bef799de0).())); } |
| 319 | /// get an n-ary data one-of expression; take the arguments from the last argument list |
| 320 | TDLDataExpressioncxx . . $ TDLDataExpression#* DataOneOfcxx . . $ TExpressionManager#DataOneOf(b4330069d252c810). ( void ) { return recordcxx . . $ TExpressionManager#record(98ea26de6545f0ca).(new TDLDataOneOfcxx . . $ TDLDataOneOf#TDLDataOneOf(d9b6f75bcac4e62b).(getArgListcxx . . $ TExpressionManager#getArgList(ea12e55bef799de0).())); } |
| 321 | |
| 322 | /// get minInclusive facet with a given VALUE |
| 323 | const TDLFacetExpressioncxx . . $ TDLFacetExpression#* FacetMinInclusivecxx . . $ TExpressionManager#FacetMinInclusive(fb0bf252cd5e7c9e). ( const TDLDataValuecxx . . $ TDLDataValue#* V ) { return recordcxx . . $ TExpressionManager#record(98ea26de6545f0ca).(new TDLFacetMinInclusivecxx . . $ TDLFacetMinInclusive#TDLFacetMinInclusive(961156e2a7e7c16b).(V)); } |
| 324 | /// get minExclusive facet with a given VALUE |
| 325 | const TDLFacetExpressioncxx . . $ TDLFacetExpression#* FacetMinExclusivecxx . . $ TExpressionManager#FacetMinExclusive(fb0bf252cd5e7c9e). ( const TDLDataValuecxx . . $ TDLDataValue#* V ) { return recordcxx . . $ TExpressionManager#record(98ea26de6545f0ca).(new TDLFacetMinExclusivecxx . . $ TDLFacetMinExclusive#TDLFacetMinExclusive(961156e2a7e7c16b).(V)); } |
| 326 | /// get maxInclusive facet with a given VALUE |
| 327 | const TDLFacetExpressioncxx . . $ TDLFacetExpression#* FacetMaxInclusivecxx . . $ TExpressionManager#FacetMaxInclusive(fb0bf252cd5e7c9e). ( const TDLDataValuecxx . . $ TDLDataValue#* V ) { return recordcxx . . $ TExpressionManager#record(98ea26de6545f0ca).(new TDLFacetMaxInclusivecxx . . $ TDLFacetMaxInclusive#TDLFacetMaxInclusive(961156e2a7e7c16b).(V)); } |
| 328 | /// get maxExclusive facet with a given VALUE |
| 329 | const TDLFacetExpressioncxx . . $ TDLFacetExpression#* FacetMaxExclusivecxx . . $ TExpressionManager#FacetMaxExclusive(fb0bf252cd5e7c9e). ( const TDLDataValuecxx . . $ TDLDataValue#* V ) { return recordcxx . . $ TExpressionManager#record(98ea26de6545f0ca).(new TDLFacetMaxExclusivecxx . . $ TDLFacetMaxExclusive#TDLFacetMaxExclusive(961156e2a7e7c16b).(V)); } |
| 330 | |
| 331 | }; // TExpressionManager |
| 332 | |
| 333 | inline TDLObjectRoleExpressioncxx . . $ TDLObjectRoleExpression#* |
| 334 | TExpressionManagercxx . . $ TExpressionManager#::TInverseRoleCachecxx . . $ TExpressionManager#TInverseRoleCache#::buildcxx . . $ TExpressionManager#TInverseRoleCache#build(c6736427cdccb407). ( const TDLObjectRoleExpressioncxx . . $ TDLObjectRoleExpression#* tail ) |
| 335 | { |
| 336 | return pManagercxx . . $ TExpressionManager#TInverseRoleCache#pManager.->recordcxx . . $ TExpressionManager#record(98ea26de6545f0ca).(new TDLObjectRoleInversecxx . . $ TDLObjectRoleInverse#TDLObjectRoleInverse(4301d0bef5e81149).(tail)); |
| 337 | } |
| 338 | |
| 339 | inline TDLConceptExpressioncxx . . $ TDLConceptExpression#* |
| 340 | TExpressionManagercxx . . $ TExpressionManager#::TOneOfCachecxx . . $ TExpressionManager#TOneOfCache#::buildcxx . . $ TExpressionManager#TOneOfCache#build(c7c486251d40ba0d). ( const TDLIndividualExpressioncxx . . $ TDLIndividualExpression#* tail ) |
| 341 | { |
| 342 | pManagercxx . . $ TExpressionManager#TOneOfCache#pManager.->newArgListcxx . . $ TExpressionManager#newArgList(49f6e7a06ebc5aa8).(); |
| 343 | pManagercxx . . $ TExpressionManager#TOneOfCache#pManager.->addArgcxx . . $ TExpressionManager#addArg(ca1ea7df707d7472).(tail); |
| 344 | return pManagercxx . . $ TExpressionManager#TOneOfCache#pManager.->recordcxx . . $ TExpressionManager#record(98ea26de6545f0ca).(new TDLConceptOneOfcxx . . $ TDLConceptOneOf#TDLConceptOneOf(d9b6f75bcac4e62b).(pManagercxx . . $ TExpressionManager#TOneOfCache#pManager.->getArgListcxx . . $ TExpressionManager#getArgList(ea12e55bef799de0).())); |
| 345 | } |
| 346 | |
| 347 | |
| 348 | #endif |