Debian Codegraph @

Kernel/RoleMaster.cpp

raw symbols SCIP
1 /* This file is part of the FaCT++ DL reasoner
2 Copyright (C) 2003-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 #include "RoleMaster.h"cxx . . $ `<file>/Kernel/RoleMaster.h`/
21 #include "eFPPInconsistentKB.h"cxx . . $ `<file>/Kernel/eFPPInconsistentKB.h`/
22 #include "TaxonomyCreator.h"cxx . . $ `<file>/Kernel/TaxonomyCreator.h`/
23
24 RoleMastercxx . . $ RoleMaster# :: RoleMastercxx . . $ RoleMaster#RoleMaster(40febb425d961447). ( bool dataRoles, const stdcxx . . $ std/::stringcxx . . $ std/string#& TopRoleName, const stdcxx . . $ std/::stringcxx . . $ std/string#& BotRoleName )
25 : emptyRolecxx . . $ RoleMaster#emptyRole.(BotRoleName ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "" ? "emptyRole"cxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5). : BotRoleNamecxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).)
26 , universalRolecxx . . $ RoleMaster#universalRole.(TopRoleName ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "" ? "universalRole"cxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5). : TopRoleNamecxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).)
27 , roleNScxx . . $ RoleMaster#roleNS.()
28 , DataRolescxx . . $ RoleMaster#DataRoles.(dataRoles)
29 {
30 // no zero-named roles allowed
31 Rolescxx . . $ RoleMaster#Roles..push_backcxx . . $ std/vector#push_back(fe7a8a4d1eddb70).(nullptr);
32 Rolescxx . . $ RoleMaster#Roles..push_backcxx . . $ std/vector#push_back(fe7a8a4d1eddb70).(nullptr);
33 // setup empty role
34 emptyRolecxx . . $ RoleMaster#emptyRole..setIdcxx . . $ TNamedEntry#setId(d4f767463ce0a6b3).(0);
35 emptyRolecxx . . $ RoleMaster#emptyRole..setInversecxx . . $ TRole#setInverse(3d6e099a537f0595).(&emptyRolecxx . . $ RoleMaster#emptyRole.);
36 emptyRolecxx . . $ RoleMaster#emptyRole..setDataRolecxx . . $ TRole#setDataRole(b45ddcbc8423892c).(dataRoles);
37 emptyRolecxx . . $ RoleMaster#emptyRole..setBPDomaincxx . . $ TRole#setBPDomain(d4f767463ce0a6b3).(bpBOTTOMcxx . . $ bpBOTTOM.);
38 emptyRolecxx . . $ RoleMaster#emptyRole..setBottomcxx . . $ TNamedEntry#setBottom(49f6e7a06ebc5aa8).();
39 // setup universal role
40 universalRolecxx . . $ RoleMaster#universalRole..setIdcxx . . $ TNamedEntry#setId(d4f767463ce0a6b3).(0);
41 universalRolecxx . . $ RoleMaster#universalRole..setInversecxx . . $ TRole#setInverse(3d6e099a537f0595).(&universalRolecxx . . $ RoleMaster#universalRole.);
42 universalRolecxx . . $ RoleMaster#universalRole..setDataRolecxx . . $ TRole#setDataRole(b45ddcbc8423892c).(dataRoles);
43 universalRolecxx . . $ RoleMaster#universalRole..setBPDomaincxx . . $ TRole#setBPDomain(d4f767463ce0a6b3).(bpTOPcxx . . $ bpTOP.);
44 universalRolecxx . . $ RoleMaster#universalRole..setTopcxx . . $ TNamedEntry#setTop(49f6e7a06ebc5aa8).();
45 // FIXME!! now it is not transitive => simple
46 const_cast<RoleAutomatoncxx . . $ RoleAutomaton#&>(universalRolecxx . . $ RoleMaster#universalRole..getAutomatoncxx . . $ TRole#getAutomaton(63b0d77ccf579a4).()).setCompletedcxx . . $ RoleAutomaton#setCompleted(49f6e7a06ebc5aa8).();
47 }
48
49 /// register TRole and it's inverse in RoleBox
50 void
51 RoleMastercxx . . $ RoleMaster# :: registerRolecxx . . $ RoleMaster#registerRole(3d6e099a537f0595). ( TRolecxx . . $ TRole#* r )
52 {
53 fpp_assertcxx . . $ `Kernel/fpp_assert.h:46:10`! ( r != nullptr && r->Inverse == nullptr ); // sanity check
54 fpp_assertcxx . . $ `Kernel/fpp_assert.h:46:10`! ( r->getId() == 0 ); // only call it for the new roles
55
56 if ( DataRolescxx . . $ RoleMaster#DataRoles. )
57 r->setDataRolecxx . . $ TRole#setDataRole(49f6e7a06ebc5aa8).();
58
59 Rolescxx . . $ RoleMaster#Roles..push_backcxx . . $ std/vector#push_back(77d9f17553126ecb). (r);
60 r->setIdcxx . . $ TNamedEntry#setId(d4f767463ce0a6b3). (newRoleIdcxx . . $ RoleMaster#newRoleId.);
61
62 // create new role which would be inverse of R
63 stdcxx . . $ std/::stringcxx . . $ std/string# inamecxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d). ("-");
64 iname +=cxx . . $ std/__cxx11/basic_string#`operator+=`(978ca1133b5f6e74). r->getNamecxx . . $ TNamedEntry#getName(a9f41ea0e82d88cf).();
65 TRolecxx . . $ TRole#* ri = new TRolecxx . . $ TRole#TRole(9c546c94e5fcce4e).(iname);
66
67 // set up inverse
68 r->setInversecxx . . $ TRole#setInverse(3d6e099a537f0595).(ri);
69 ri->setInversecxx . . $ TRole#setInverse(3d6e099a537f0595).(r);
70
71 Rolescxx . . $ RoleMaster#Roles..push_backcxx . . $ std/vector#push_back(77d9f17553126ecb). (ri);
72 ri->setIdcxx . . $ TNamedEntry#setId(d4f767463ce0a6b3). (-newRoleIdcxx . . $ RoleMaster#newRoleId.);
73 ++newRoleIdcxx . . $ RoleMaster#newRoleId.;
74 }
75
76 TRolecxx . . $ TRole#*
77 RoleMastercxx . . $ RoleMaster# :: ensureRoleNamecxx . . $ RoleMaster#ensureRoleName(af2b5fd8269c241b). ( const stdcxx . . $ std/::stringcxx . . $ std/string#& name )
78 {
79 // check for the Top/Bottom names
80 if ( name ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). emptyRolecxx . . $ RoleMaster#emptyRole..getNamecxx . . $ TNamedEntry#getName(a9f41ea0e82d88cf).() )
81 return &emptyRolecxx . . $ RoleMaster#emptyRole.;
82 if ( name ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). universalRolecxx . . $ RoleMaster#universalRole..getNamecxx . . $ TNamedEntry#getName(a9f41ea0e82d88cf).() )
83 return &universalRolecxx . . $ RoleMaster#universalRole.;
84
85 // new name from NS
86 TRolecxx . . $ TRole#* p = roleNScxx . . $ RoleMaster#roleNS..insertcxx . . $ TNameSet#insert(e53703f8e2b82653).(name);
87 // check what happens
88 if ( p == nullptr ) // role registration attempt failed
89 throw EFPPCantRegNamecxx . . $ EFPPCantRegName#EFPPCantRegName(c3ca1c130ce09c52). ( name, DataRolescxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d). ? "data role" : "role" );
90
91 if ( isRegisteredRolecxx . . $ RoleMaster#isRegisteredRole(d8a4b25e330b0b26).(p) ) // registered role
92 return p;
93 if ( p->getIdcxx . . $ TNamedEntry#getId(455f465bc33b4cdf).() != 0 || // not registered but has non-null ID
94 !useUndefinedNamescxx . . $ RoleMaster#useUndefinedNames. ) // new names are disallowed
95 throw EFPPCantRegNamecxx . . $ EFPPCantRegName#EFPPCantRegName(c3ca1c130ce09c52). ( name, DataRolescxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d). ? "data role" : "role" );
96
97 registerRolecxx . . $ RoleMaster#registerRole(3d6e099a537f0595).(p);
98 return p;
99 }
100
101 // inverse the role composition
102 DLTreecxx . . $ DLTree#* inverseCompositioncxx . . $ inverseComposition(ec41a33c52a5614b). ( const DLTreecxx . . $ DLTree#* tree )
103 {
104 if ( tree->Elementcxx . . $ TsTTree#Element(ea465e50d690edfe).() ==cxx . . $ TLexeme#`operator==`(b418e6031985303a). RCOMPOSITIONcxx . . $ RCOMPOSITION. )
105 return new DLTreecxx . . $ DLTree# ( TLexemecxx . . $ TLexeme#(RCOMPOSITIONcxx . . $ RCOMPOSITION.),
106 inverseCompositioncxx . . $ inverseComposition(ec41a33c52a5614b).(tree->Rightcxx . . $ TsTTree#Right(f4b2f47551fb31d7).()),
107 inverseCompositioncxx . . $ inverseComposition(ec41a33c52a5614b).(tree->Leftcxx . . $ TsTTree#Left(f4b2f47551fb31d7).()) );
108 else
109 return createEntrycxx . . $ createEntry(21bce954c2c882e2). ( RNAMEcxx . . $ RNAME., resolveRolecxx . . $ resolveRole(c256d257f6e22050).(tree)->inversecxx . . $ TRole#inverse(6cda9dc08d29302e).() );
110 }
111
112 void
113 RoleMastercxx . . $ RoleMaster# :: addRoleParentcxx . . $ RoleMaster#addRoleParent(3b1ea77690ef9b91). ( DLTreecxx . . $ DLTree#* tree, TRolecxx . . $ TRole#* parent ) const
114 {
115 if ( !tree ) // nothing to do
116 return;
117 if ( tree->Elementcxx . . $ TsTTree#Element(19b2b6f17af048b).() ==cxx . . $ TLexeme#`operator==`(b418e6031985303a). RCOMPOSITIONcxx . . $ RCOMPOSITION. )
118 {
119 parent->addCompositioncxx . . $ TRole#addComposition(f4bd9ed7cc6f2913).(tree);
120 DLTreecxx . . $ DLTree#* inv = inverseCompositioncxx . . $ inverseComposition(ec41a33c52a5614b).(tree);
121 parent->inversecxx . . $ TRole#inverse(6cda9dc08d29302e).()->addCompositioncxx . . $ TRole#addComposition(f4bd9ed7cc6f2913).(inv);
122 deleteTreecxx . . $ deleteTree(c5beffd064a5e5b2).(inv);
123 }
124 else if ( tree->Elementcxx . . $ TsTTree#Element(19b2b6f17af048b).() ==cxx . . $ TLexeme#`operator==`(b418e6031985303a). PROJINTOcxx . . $ PROJINTO. )
125 {
126 // here -R->C became -PARENT->
127 // encode this as PROJFROM(R-,PROJINTO(PARENT-,C)),
128 // added to the range of R
129 TRolecxx . . $ TRole#* R = resolveRolecxx . . $ resolveRole(c256d257f6e22050).(tree->Leftcxx . . $ TsTTree#Left(f4b2f47551fb31d7).());
130 // can't do anything ATM for the data roles
131 if ( R->isDataRolecxx . . $ TRole#isDataRole(50ce9a9e25b4a850).() )
132 throw EFaCTPlusPluscxx . . $ EFaCTPlusPlus#("Projection into not implemented for the data role");
133 DLTreecxx . . $ DLTree#* C = clonecxx . . $ clone(ec41a33c52a5614b).(tree->Rightcxx . . $ TsTTree#Right(f4b2f47551fb31d7).());
134 DLTreecxx . . $ DLTree#* InvP = createEntrycxx . . $ createEntry(21bce954c2c882e2). ( RNAMEcxx . . $ RNAME., parent->inversecxx . . $ TRole#inverse(6cda9dc08d29302e).() );
135 DLTreecxx . . $ DLTree#* InvR = createEntrycxx . . $ createEntry(21bce954c2c882e2). ( RNAMEcxx . . $ RNAME., R->inversecxx . . $ TRole#inverse(6cda9dc08d29302e).() );
136 // C = PROJINTO(PARENT-,C)
137 C = new DLTreecxx . . $ DLTree# ( TLexemecxx . . $ TLexeme#(PROJINTOcxx . . $ PROJINTO.), InvP, C );
138 // C = PROJFROM(R-,PROJINTO(PARENT-,C))
139 C = new DLTreecxx . . $ DLTree# ( TLexemecxx . . $ TLexeme#(PROJFROMcxx . . $ PROJFROM.), InvR, C );
140 R->setRangecxx . . $ TRole#setRange(edf821a2fc5509f9).(C);
141 }
142 else if ( tree->Elementcxx . . $ TsTTree#Element(19b2b6f17af048b).() ==cxx . . $ TLexeme#`operator==`(b418e6031985303a). PROJFROMcxx . . $ PROJFROM. )
143 {
144 // here C-R-> became -PARENT->
145 // encode this as PROJFROM(R,PROJINTO(PARENT,C)),
146 // added to the domain of R
147 TRolecxx . . $ TRole#* R = resolveRolecxx . . $ resolveRole(c256d257f6e22050).(tree->Leftcxx . . $ TsTTree#Left(f4b2f47551fb31d7).());
148 DLTreecxx . . $ DLTree#* C = clonecxx . . $ clone(ec41a33c52a5614b).(tree->Rightcxx . . $ TsTTree#Right(f4b2f47551fb31d7).());
149 DLTreecxx . . $ DLTree#* P = createEntrycxx . . $ createEntry(21bce954c2c882e2). ( RNAMEcxx . . $ RNAME., parent );
150 // C = PROJINTO(PARENT,C)
151 C = new DLTreecxx . . $ DLTree# ( TLexemecxx . . $ TLexeme#(PROJINTOcxx . . $ PROJINTO.), P, C );
152 // C = PROJFROM(R,PROJINTO(PARENT,C))
153 C = new DLTreecxx . . $ DLTree# ( TLexemecxx . . $ TLexeme#(PROJFROMcxx . . $ PROJFROM.), clonecxx . . $ clone(ec41a33c52a5614b).(tree->Leftcxx . . $ TsTTree#Left(f4b2f47551fb31d7).()), C );
154 R->setDomaincxx . . $ TRole#setDomain(edf821a2fc5509f9).(C);
155 }
156 else
157 addRoleParentcxx . . $ RoleMaster#addRoleParent(46569ce1194069bb). ( resolveRolecxx . . $ resolveRole(c256d257f6e22050).(tree), parent );
158 deleteTreecxx . . $ deleteTree(c5beffd064a5e5b2).(tree);
159 }
160
161 /// add parent for the input role
162 void
163 RoleMastercxx . . $ RoleMaster# :: addRoleParentPropercxx . . $ RoleMaster#addRoleParentProper(46569ce1194069bb). ( TRolecxx . . $ TRole#* role, TRolecxx . . $ TRole#* parent ) const
164 {
165 fpp_assertcxx . . $ `Kernel/fpp_assert.h:46:10`! ( !role->isSynonym() && !parent->isSynonym() );
166
167 if ( role == parent ) // nothing to do
168 return;
169
170 if ( role->isDataRolecxx . . $ TRole#isDataRole(50ce9a9e25b4a850).() != parent->isDataRolecxx . . $ TRole#isDataRole(50ce9a9e25b4a850).() )
171 throw EFaCTPlusPluscxx . . $ EFaCTPlusPlus#("Mixed object and data roles in role subsumption axiom");
172
173 // check the inconsistency case *UROLE* [= *EROLE*
174 if ( unlikelycxx . . $ `Kernel/globaldef.h:29:10`!(role->isTop() && parent->isBottom()) )
175 throw EFPPInconsistentKBcxx . . $ EFPPInconsistentKB#EFPPInconsistentKB(49f6e7a06ebc5aa8).();
176
177 // *UROLE* [= R means R (and R-) are synonym of *UROLE*
178 if ( unlikelycxx . . $ `Kernel/globaldef.h:29:10`!(role->isTop()) )
179 {
180 parent->setSynonymcxx . . $ ClassifiableEntry#setSynonym(866fbb357e35bef0).(role);
181 parent->inversecxx . . $ TRole#inverse(6cda9dc08d29302e).()->setSynonymcxx . . $ ClassifiableEntry#setSynonym(866fbb357e35bef0).(role);
182 return;
183 }
184
185 // R [= *EROLE* means R (and R-) are synonyms of *EROLE*
186 if ( unlikelycxx . . $ `Kernel/globaldef.h:29:10`!(parent->isBottom()) )
187 {
188 role->setSynonymcxx . . $ ClassifiableEntry#setSynonym(866fbb357e35bef0).(parent);
189 role->inversecxx . . $ TRole#inverse(6cda9dc08d29302e).()->setSynonymcxx . . $ ClassifiableEntry#setSynonym(866fbb357e35bef0).(parent);
190 return;
191 }
192
193 role->addParentcxx . . $ ClassifiableEntry#addParent(866fbb357e35bef0).(parent);
194 role->inversecxx . . $ TRole#inverse(6cda9dc08d29302e).()->addParentcxx . . $ ClassifiableEntry#addParent(866fbb357e35bef0).(parent->inversecxx . . $ TRole#inverse(6cda9dc08d29302e).());
195 }
196
197 void RoleMastercxx . . $ RoleMaster# :: initAncDesccxx . . $ RoleMaster#initAncDesc(49f6e7a06ebc5aa8). ( void )
198 {
199 iteratorcxx . . $ RoleMaster#iterator# pcxx . . $ __gnu_cxx/__normal_iterator#__normal_iterator(49f6e7a06ebc5aa8)., p_begin = begincxx . . $ RoleMaster#begin(f6b8bc1058fc1c99).(), p_end = endcxx . . $ RoleMaster#end(f6b8bc1058fc1c99).();
200 size_t nRoles = Rolescxx . . $ RoleMaster#Roles..sizecxx . . $ std/vector#size(fe4d2d262d4164a8).();
201
202 // stage 0.1: eliminate told cycles
203 for ( p =cxx . . $ __gnu_cxx/__normal_iterator#`operator=`(13fabb7b1515efd5). p_begin; p !=cxx . . $ __gnu_cxx/`operator!=`(ef3c5749062e825c). p_end; ++cxx . . $ __gnu_cxx/__normal_iterator#operator++(93f2e9c3bc4efc49).p )
204 (*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(c076846f881f3e7e).p)->eliminateToldCyclescxx . . $ TRole#eliminateToldCycles(6cda9dc08d29302e).(); // not VERY efficient: quadratic vs (possible) linear
205
206 // setting up all synonyms
207 for ( p =cxx . . $ __gnu_cxx/__normal_iterator#`operator=`(13fabb7b1515efd5). p_begin; p !=cxx . . $ __gnu_cxx/`operator!=`(ef3c5749062e825c). p_end; ++cxx . . $ __gnu_cxx/__normal_iterator#operator++(93f2e9c3bc4efc49).p )
208 if ( (*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(c076846f881f3e7e).p)->isSynonymcxx . . $ ClassifiableEntry#isSynonym(50ce9a9e25b4a850).() )
209 {
210 (*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(c076846f881f3e7e).p)->canonicaliseSynonymcxx . . $ ClassifiableEntry#canonicaliseSynonym(49f6e7a06ebc5aa8).();
211 (*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(c076846f881f3e7e).p)->addFeaturesToSynonymcxx . . $ TRole#addFeaturesToSynonym(49f6e7a06ebc5aa8).();
212 }
213
214 // change all parents that are synonyms to their primers
215 for ( p =cxx . . $ __gnu_cxx/__normal_iterator#`operator=`(13fabb7b1515efd5). p_begin; p !=cxx . . $ __gnu_cxx/`operator!=`(ef3c5749062e825c). p_end; ++cxx . . $ __gnu_cxx/__normal_iterator#operator++(93f2e9c3bc4efc49).p )
216 if ( !(*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(c076846f881f3e7e).p)->isSynonymcxx . . $ ClassifiableEntry#isSynonym(50ce9a9e25b4a850).() )
217 (*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(c076846f881f3e7e).p)->removeSynonymsFromParentscxx . . $ ClassifiableEntry#removeSynonymsFromParents(49f6e7a06ebc5aa8).();
218
219 // here TOP-role has no children yet, so it's safe to complete the automaton
220 universalRolecxx . . $ RoleMaster#universalRole..completeAutomatoncxx . . $ TRole#completeAutomaton(2c44cd906ae4e829).(nRoles);
221
222 // make all roles w/o told subsumers have Role TOP instead
223 for ( p =cxx . . $ __gnu_cxx/__normal_iterator#`operator=`(13fabb7b1515efd5). p_begin; p <cxx . . $ __gnu_cxx/`operator<`(ef3c5749062e825c). p_end; ++cxx . . $ __gnu_cxx/__normal_iterator#operator++(93f2e9c3bc4efc49).p )
224 if ( !(*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(c076846f881f3e7e).p)->isSynonymcxx . . $ ClassifiableEntry#isSynonym(50ce9a9e25b4a850).() && !(*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(c076846f881f3e7e).p)->hasToldSubsumerscxx . . $ ClassifiableEntry#hasToldSubsumers(50ce9a9e25b4a850).() )
225 (*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(c076846f881f3e7e).p)->addParentcxx . . $ ClassifiableEntry#addParent(866fbb357e35bef0).(&universalRolecxx . . $ RoleMaster#universalRole.);
226
227 // stage 2: perform classification
228
229 // create roles taxonomy
230 pTaxcxx . . $ RoleMaster#pTax. = new Taxonomycxx . . $ Taxonomy#Taxonomy(d190bd46de14e314). ( &universalRolecxx . . $ RoleMaster#universalRole., &emptyRolecxx . . $ RoleMaster#emptyRole. );
231 TaxonomyCreatorcxx . . $ TaxonomyCreator# TaxCreatorcxx . . $ TaxonomyCreator#TaxonomyCreator(ce426daa62d7e7fd).(pTaxcxx . . $ RoleMaster#pTax.);
232 TaxCreator.setCompletelyDefinedcxx . . $ TaxonomyCreator#setCompletelyDefined(b45ddcbc8423892c).(true);
233
234 for ( p =cxx . . $ __gnu_cxx/__normal_iterator#`operator=`(13fabb7b1515efd5). p_begin; p !=cxx . . $ __gnu_cxx/`operator!=`(ef3c5749062e825c). p_end; ++cxx . . $ __gnu_cxx/__normal_iterator#operator++(93f2e9c3bc4efc49).p )
235 if ( !(*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(c076846f881f3e7e).p)->isClassifiedcxx . . $ ClassifiableEntry#isClassified(50ce9a9e25b4a850).() )
236 TaxCreator.classifyEntrycxx . . $ TaxonomyCreator#classifyEntry(866fbb357e35bef0).(*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(c076846f881f3e7e).p);
237
238 // stage 3: fills ancestor/descendants using taxonomy
239 for ( p =cxx . . $ __gnu_cxx/__normal_iterator#`operator=`(13fabb7b1515efd5). p_begin; p !=cxx . . $ __gnu_cxx/`operator!=`(ef3c5749062e825c). p_end; ++cxx . . $ __gnu_cxx/__normal_iterator#operator++(93f2e9c3bc4efc49).p )
240 if ( !(*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(c076846f881f3e7e).p)->isSynonymcxx . . $ ClassifiableEntry#isSynonym(50ce9a9e25b4a850).() )
241 (*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(c076846f881f3e7e).p)->initADbyTaxonomycxx . . $ TRole#initADbyTaxonomy(739d502f68d79167). ( pTaxcxx . . $ RoleMaster#pTax., nRoles );
242
243 // complete role automaton's info
244 for ( p =cxx . . $ __gnu_cxx/__normal_iterator#`operator=`(13fabb7b1515efd5). p_begin; p !=cxx . . $ __gnu_cxx/`operator!=`(ef3c5749062e825c). p_end; ++cxx . . $ __gnu_cxx/__normal_iterator#operator++(93f2e9c3bc4efc49).p )
245 if ( !(*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(c076846f881f3e7e).p)->isSynonymcxx . . $ ClassifiableEntry#isSynonym(50ce9a9e25b4a850).() )
246 (*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(c076846f881f3e7e).p)->completeAutomatoncxx . . $ TRole#completeAutomaton(2c44cd906ae4e829).(nRoles);
247
248 // now all usual roles has their own automata, set up Bottom's automata
249 emptyRolecxx . . $ RoleMaster#emptyRole..completeAutomatoncxx . . $ TRole#completeAutomaton(2c44cd906ae4e829).(nRoles);
250
251 // prepare taxonomy to the real usage
252 pTaxcxx . . $ RoleMaster#pTax.->finalisecxx . . $ Taxonomy#finalise(49f6e7a06ebc5aa8).();
253
254 // stage 3.5: apply Disjoint axioms to roles; check and correct disjoints in hierarchy
255 if ( !DJRolesAcxx . . $ RoleMaster#DJRolesA..emptycxx . . $ std/vector#empty(50ce9a9e25b4a850).() )
256 {
257 for ( iteratorcxx . . $ RoleMaster#iterator# q = DJRolesAcxx . . $ RoleMaster#DJRolesA..begincxx . . $ std/vector#begin(33b10a496a38335b).(), q_end = DJRolesAcxx . . $ RoleMaster#DJRolesA..endcxx . . $ std/vector#end(33b10a496a38335b).(), r = DJRolesBcxx . . $ RoleMaster#DJRolesB..begincxx . . $ std/vector#begin(33b10a496a38335b).();
258 q !=cxx . . $ __gnu_cxx/`operator!=`(ef3c5749062e825c). q_end; ++cxx . . $ __gnu_cxx/__normal_iterator#operator++(93f2e9c3bc4efc49).q, ++cxx . . $ __gnu_cxx/__normal_iterator#operator++(93f2e9c3bc4efc49).r )
259 {
260 TRolecxx . . $ TRole#* R = resolveSynonymcxx . . $ resolveSynonym(98ea26de6545f0ca).(*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(c076846f881f3e7e).q);
261 TRolecxx . . $ TRole#* S = resolveSynonymcxx . . $ resolveSynonym(98ea26de6545f0ca).(*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(c076846f881f3e7e).r);
262 R->addDisjointRolecxx . . $ TRole#addDisjointRole(3d6e099a537f0595).(S);
263 S->addDisjointRolecxx . . $ TRole#addDisjointRole(3d6e099a537f0595).(R);
264 R->inversecxx . . $ TRole#inverse(6cda9dc08d29302e).()->addDisjointRolecxx . . $ TRole#addDisjointRole(3d6e099a537f0595).(S->inversecxx . . $ TRole#inverse(6cda9dc08d29302e).());
265 S->inversecxx . . $ TRole#inverse(6cda9dc08d29302e).()->addDisjointRolecxx . . $ TRole#addDisjointRole(3d6e099a537f0595).(R->inversecxx . . $ TRole#inverse(6cda9dc08d29302e).());
266 }
267
268 for ( p =cxx . . $ __gnu_cxx/__normal_iterator#`operator=`(13fabb7b1515efd5). p_begin; p !=cxx . . $ __gnu_cxx/`operator!=`(ef3c5749062e825c). p_end; ++cxx . . $ __gnu_cxx/__normal_iterator#operator++(93f2e9c3bc4efc49).p )
269 if ( !(*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(c076846f881f3e7e).p)->isSynonymcxx . . $ ClassifiableEntry#isSynonym(50ce9a9e25b4a850).() && (*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(c076846f881f3e7e).p)->isDisjointcxx . . $ TRole#isDisjoint(50ce9a9e25b4a850).() )
270 (*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(c076846f881f3e7e).p)->checkHierarchicalDisjointcxx . . $ TRole#checkHierarchicalDisjoint(49f6e7a06ebc5aa8).();
271 }
272
273 // stage 4: init other fields for the roles. The whole hierarchy is known here
274 for ( p =cxx . . $ __gnu_cxx/__normal_iterator#`operator=`(13fabb7b1515efd5). p_begin; p !=cxx . . $ __gnu_cxx/`operator!=`(ef3c5749062e825c). p_end; ++cxx . . $ __gnu_cxx/__normal_iterator#operator++(93f2e9c3bc4efc49).p )
275 if ( !(*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(c076846f881f3e7e).p)->isSynonymcxx . . $ ClassifiableEntry#isSynonym(50ce9a9e25b4a850).() )
276 (*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(c076846f881f3e7e).p)->postProcesscxx . . $ TRole#postProcess(49f6e7a06ebc5aa8).();
277
278 // the last stage: check whether all roles are consistent
279 for ( p =cxx . . $ __gnu_cxx/__normal_iterator#`operator=`(13fabb7b1515efd5). p_begin; p !=cxx . . $ __gnu_cxx/`operator!=`(ef3c5749062e825c). p_end; ++cxx . . $ __gnu_cxx/__normal_iterator#operator++(93f2e9c3bc4efc49).p )
280 if ( !(*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(c076846f881f3e7e).p)->isSynonymcxx . . $ ClassifiableEntry#isSynonym(50ce9a9e25b4a850).() )
281 (*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(c076846f881f3e7e).p)->consistentcxx . . $ TRole#consistent(83f5f38750778ac8).();
282 }