| 1 |
/* This file is part of the FaCT++ DL reasoner |
| 2 |
Copyright (C) 2005-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 DLCOMPLETIONGRAPH_H |
| 21 |
#define DLCOMPLETIONGRAPH_Hcxx . . $ `Kernel/dlCompletionGraph.h:21:9`! |
| 22 |
|
| 23 |
#include <vector> |
| 24 |
|
| 25 |
#include "globaldef.h"cxx . . $ `<file>/Kernel/globaldef.h`/ |
| 26 |
#include "DeletelessAllocator.h"cxx . . $ `<file>/Kernel/DeletelessAllocator.h`/ |
| 27 |
#include "dlCompletionTree.h"cxx . . $ `<file>/Kernel/dlCompletionTree.h`/ |
| 28 |
#include "dlCompletionTreeArc.h"cxx . . $ `<file>/Kernel/dlCompletionTreeArc.h`/ |
| 29 |
#include "tSaveStack.h"cxx . . $ `<file>/Kernel/tSaveStack.h`/ |
| 30 |
#include "tRareSaveStack.h"cxx . . $ `<file>/Kernel/tRareSaveStack.h`/ |
| 31 |
|
| 32 |
class DlSatTestercxx . . $ DlSatTester#; |
| 33 |
|
| 34 |
/** |
| 35 |
* Class for maintaining graph of CT nodes. Behaves like |
| 36 |
* deleteless allocator for nodes, plus some obvious features |
| 37 |
*/ |
| 38 |
class DlCompletionGraphcxx . . $ DlCompletionGraph# |
| 39 |
{ |
| 40 |
protected: // typedefs |
| 41 |
/// type of the heap |
| 42 |
typedef stdcxx . . $ std/::vectorcxx . . $ std/vector#<DlCompletionTreecxx . . $ DlCompletionTree#*> nodeBaseTypecxx . . $ DlCompletionGraph#nodeBaseType#; |
| 43 |
|
| 44 |
public: // typedefs |
| 45 |
/// heap's RW iterator |
| 46 |
typedef nodeBaseTypecxx . . $ DlCompletionGraph#nodeBaseType#::iteratorcxx . . $ std/vector#iterator# iteratorcxx . . $ DlCompletionGraph#iterator#; |
| 47 |
/// heap's RO iterator |
| 48 |
typedef nodeBaseTypecxx . . $ DlCompletionGraph#nodeBaseType#::const_iteratorcxx . . $ std/vector#const_iterator# const_iteratorcxx . . $ DlCompletionGraph#const_iterator#; |
| 49 |
|
| 50 |
protected: // types |
| 51 |
/// class for S/R local state |
| 52 |
class SaveStatecxx . . $ DlCompletionGraph#SaveState# |
| 53 |
{ |
| 54 |
public: // members |
| 55 |
/// number of valid nodes |
| 56 |
size_tcxx . . $ std/size_t# nNodescxx . . $ DlCompletionGraph#SaveState#nNodes. = 0; |
| 57 |
/// end pointer of saved nodes |
| 58 |
size_tcxx . . $ std/size_t# sNodescxx . . $ DlCompletionGraph#SaveState#sNodes. = 0; |
| 59 |
/// number of used edges |
| 60 |
size_tcxx . . $ size_t# nEdgescxx . . $ DlCompletionGraph#SaveState#nEdges. = 0; |
| 61 |
}; // SaveState |
| 62 |
|
| 63 |
private: // constants |
| 64 |
/// initial value of IR level |
| 65 |
static const BipolarPointercxx . . $ BipolarPointer# initIRLevelcxx . . $ DlCompletionGraph#initIRLevel. = 0; |
| 66 |
|
| 67 |
private: // members |
| 68 |
/// allocator for edges |
| 69 |
DeletelessAllocatorcxx . . $ DeletelessAllocator#<DlCompletionTreeArccxx . . $ DlCompletionTreeArc#> CTEdgeHeapcxx . . $ DlCompletionGraph#CTEdgeHeap.; |
| 70 |
|
| 71 |
protected: // members |
| 72 |
/// heap itself |
| 73 |
nodeBaseTypecxx . . $ DlCompletionGraph#nodeBaseType# NodeBasecxx . . $ DlCompletionGraph#NodeBase.; |
| 74 |
/// nodes, saved on current branching level |
| 75 |
nodeBaseTypecxx . . $ DlCompletionGraph#nodeBaseType# SavedNodescxx . . $ DlCompletionGraph#SavedNodes.; |
| 76 |
/// host reasoner |
| 77 |
DlSatTestercxx . . $ DlSatTester#* pReasonercxx . . $ DlCompletionGraph#pReasoner.; |
| 78 |
/// remember the last generated ID for the node |
| 79 |
unsigned int nodeIdcxx . . $ DlCompletionGraph#nodeId. = 0; |
| 80 |
/// index of the next unallocated entry |
| 81 |
size_tcxx . . $ std/size_t# endUsedcxx . . $ DlCompletionGraph#endUsed. = 0; |
| 82 |
/// current branching level (synchronised with reasoner's one) |
| 83 |
unsigned int branchingLevelcxx . . $ DlCompletionGraph#branchingLevel.; |
| 84 |
/// current IR level (should be valid BP) |
| 85 |
BipolarPointercxx . . $ BipolarPointer# IRLevelcxx . . $ DlCompletionGraph#IRLevel.; |
| 86 |
/// stack for rarely changed information |
| 87 |
TRareSaveStackcxx . . $ TRareSaveStack# RareStackcxx . . $ DlCompletionGraph#RareStack.; |
| 88 |
/// stack for usual saving/restoring |
| 89 |
TSaveStackcxx . . $ TSaveStack#<SaveStatecxx . . $ DlCompletionGraph#SaveState#> Stackcxx . . $ DlCompletionGraph#Stack.; |
| 90 |
|
| 91 |
// helpers for the output |
| 92 |
|
| 93 |
/// bitmap to remember which node was printed |
| 94 |
stdcxx . . $ std/::vectorcxx . . $ std/vector#<bool> CGPFlagcxx . . $ DlCompletionGraph#CGPFlag.; |
| 95 |
/// indent to print CGraph nodes |
| 96 |
unsigned int CGPIndentcxx . . $ DlCompletionGraph#CGPIndent. = 0; |
| 97 |
|
| 98 |
// statistical members |
| 99 |
|
| 100 |
/// number of node' saves |
| 101 |
unsigned int nNodeSavescxx . . $ DlCompletionGraph#nNodeSaves. = 0; |
| 102 |
/// number of node' saves |
| 103 |
unsigned int nNodeRestorescxx . . $ DlCompletionGraph#nNodeRestores. = 0; |
| 104 |
/// maximal size of the graph |
| 105 |
size_tcxx . . $ std/size_t# maxGraphSizecxx . . $ DlCompletionGraph#maxGraphSize. = 0; |
| 106 |
|
| 107 |
// flags |
| 108 |
|
| 109 |
/// how many nodes skip before block; work only with FAIRNESS |
| 110 |
int nSkipBeforeBlockcxx . . $ DlCompletionGraph#nSkipBeforeBlock. = 0; |
| 111 |
/// use or not lazy blocking (ie test blocking only expanding exists) |
| 112 |
bool useLazyBlockingcxx . . $ DlCompletionGraph#useLazyBlocking. = true; |
| 113 |
/// whether to use Anywhere blocking as opposed to an ancestor one |
| 114 |
bool useAnywhereBlockingcxx . . $ DlCompletionGraph#useAnywhereBlocking. = true; |
| 115 |
|
| 116 |
/// check if session has inverse roles |
| 117 |
bool sessionHasInverseRolescxx . . $ DlCompletionGraph#sessionHasInverseRoles. = false; |
| 118 |
/// check if session has number restrictions |
| 119 |
bool sessionHasNumberRestrictionscxx . . $ DlCompletionGraph#sessionHasNumberRestrictions. = false; |
| 120 |
|
| 121 |
protected: // methods |
| 122 |
/// init vector [B,E) with new objects T |
| 123 |
void initNodeArraycxx . . $ DlCompletionGraph#initNodeArray(d16e16ddbc5e0330). ( iteratorcxx . . $ DlCompletionGraph#iterator# b, iteratorcxx . . $ DlCompletionGraph#iterator# e ) |
| 124 |
{ |
| 125 |
for ( iteratorcxx . . $ DlCompletionGraph#iterator# p = b; p !=cxx . . $ __gnu_cxx/`operator!=`(ef3c5749062e825c). e; ++cxx . . $ __gnu_cxx/__normal_iterator#operator++(93f2e9c3bc4efc49).p ) |
| 126 |
*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(c076846f881f3e7e).p = new DlCompletionTreecxx . . $ DlCompletionTree#DlCompletionTree(cb2f890c2fdad230).(nodeIdcxx . . $ DlCompletionGraph#nodeId.++); |
| 127 |
} |
| 128 |
/// increase heap size |
| 129 |
void growcxx . . $ DlCompletionGraph#grow(49f6e7a06ebc5aa8). ( void ) |
| 130 |
{ |
| 131 |
NodeBasecxx . . $ DlCompletionGraph#NodeBase..resizecxx . . $ std/vector#resize(2c44cd906ae4e829).(NodeBasecxx . . $ DlCompletionGraph#NodeBase..sizecxx . . $ std/vector#size(fe4d2d262d4164a8).()*2); |
| 132 |
initNodeArraycxx . . $ DlCompletionGraph#initNodeArray(d16e16ddbc5e0330). ( NodeBasecxx . . $ DlCompletionGraph#NodeBase..begincxx . . $ std/vector#begin(33b10a496a38335b).()+cxx . . $ __gnu_cxx/__normal_iterator#operator+(d0cb2d2ebd313f38).NodeBasecxx . . $ DlCompletionGraph#NodeBase..sizecxx . . $ std/vector#size(fe4d2d262d4164a8).()/2, NodeBasecxx . . $ DlCompletionGraph#NodeBase..endcxx . . $ std/vector#end(33b10a496a38335b).() ); |
| 133 |
} |
| 134 |
/// init root node |
| 135 |
void initRootcxx . . $ DlCompletionGraph#initRoot(49f6e7a06ebc5aa8). ( void ) |
| 136 |
{ |
| 137 |
fpp_assertcxx . . $ EFPPAssertion# ( endUsed == 0 ); |
| 138 |
getNewNodecxx . . $ DlCompletionGraph#getNewNode(8f504d760f19febe).(); |
| 139 |
} |
| 140 |
/// create edge between nodes with given label and creation level; @return from->to arc |
| 141 |
DlCompletionTreeArccxx . . $ DlCompletionTreeArc#* createEdgecxx . . $ DlCompletionGraph#createEdge(2369b4bf26f5db64). ( |
| 142 |
DlCompletionTreecxx . . $ DlCompletionTree#* from, |
| 143 |
DlCompletionTreecxx . . $ DlCompletionTree#* to, |
| 144 |
bool isPredEdge, |
| 145 |
const TRolecxx . . $ TRole#* roleName, |
| 146 |
const DepSetcxx . . $ DepSet#& dep ); |
| 147 |
|
| 148 |
/// Aux method for Merge(): add EDGE to the NODE wrt flag ISPREDEDGE and dep-set DEP |
| 149 |
DlCompletionTreeArccxx . . $ DlCompletionTreeArc#* moveEdgecxx . . $ DlCompletionGraph#moveEdge(58152daba81a1ee3). ( |
| 150 |
DlCompletionTreecxx . . $ DlCompletionTree#* node, |
| 151 |
DlCompletionTreeArccxx . . $ DlCompletionTreeArc#* edge, |
| 152 |
bool isPredEdge, const DepSetcxx . . $ DepSet#& dep ); |
| 153 |
|
| 154 |
/// invalidate EDGE, save restoring info |
| 155 |
void invalidateEdgecxx . . $ DlCompletionGraph#invalidateEdge(7cce2cce5bd28a53). ( DlCompletionTreeArccxx . . $ DlCompletionTreeArc#* edge ) { saveRareCondcxx . . $ DlCompletionGraph#saveRareCond(1cbbef85a2ba1293).(edge->savecxx . . $ DlCompletionTreeArc#save(85c56efe7ce37b0e).()); } |
| 156 |
|
| 157 |
//---------------------------------------------- |
| 158 |
// inequality relation methods |
| 159 |
//---------------------------------------------- |
| 160 |
|
| 161 |
/// update IR in P with IR from Q and additional dep-set |
| 162 |
void updateIRcxx . . $ DlCompletionGraph#updateIR(4c11a3ac995a241a). ( DlCompletionTreecxx . . $ DlCompletionTree#* p, const DlCompletionTreecxx . . $ DlCompletionTree#* q, const DepSetcxx . . $ DepSet#& toAdd ); |
| 163 |
|
| 164 |
//---------------------------------------------- |
| 165 |
// re-building blocking hierarchy |
| 166 |
//---------------------------------------------- |
| 167 |
|
| 168 |
/// check whether NODE is blocked by a BLOCKER |
| 169 |
bool isBlockedBycxx . . $ DlCompletionGraph#isBlockedBy(29f359e69572044c). ( const DlCompletionTreecxx . . $ DlCompletionTree#* node, const DlCompletionTreecxx . . $ DlCompletionTree#* blocker ) const; |
| 170 |
/// check if d-blocked node is still d-blocked |
| 171 |
bool isStillDBlockedcxx . . $ DlCompletionGraph#isStillDBlocked(e2c3b6f64f9879b7). ( const DlCompletionTreecxx . . $ DlCompletionTree#* node ) const { return node->isDBlockedcxx . . $ DlCompletionTree#isDBlocked(50ce9a9e25b4a850).() && isBlockedBycxx . . $ DlCompletionGraph#isBlockedBy(29f359e69572044c). ( node, node->Blockercxx . . $ DlCompletionTree#Blocker. ); } |
| 172 |
/// try to find d-blocker for a node using ancestor blocking |
| 173 |
void findDAncestorBlockercxx . . $ DlCompletionGraph#findDAncestorBlocker(3bf754c9a531d7e6). ( DlCompletionTreecxx . . $ DlCompletionTree#* node ); |
| 174 |
/// try to find d-blocker for a node using anywhere blocking |
| 175 |
void findDAnywhereBlockercxx . . $ DlCompletionGraph#findDAnywhereBlocker(3bf754c9a531d7e6). ( DlCompletionTreecxx . . $ DlCompletionTree#* node ); |
| 176 |
/// try to find d-blocker for a node |
| 177 |
void findDBlockercxx . . $ DlCompletionGraph#findDBlocker(3bf754c9a531d7e6). ( DlCompletionTreecxx . . $ DlCompletionTree#* node ) |
| 178 |
{ |
| 179 |
saveNodecxx . . $ DlCompletionGraph#saveNode(aa3cbc006cb08887). ( node, branchingLevelcxx . . $ DlCompletionGraph#branchingLevel. ); |
| 180 |
node->clearAffectedcxx . . $ DlCompletionTree#clearAffected(49f6e7a06ebc5aa8).(); |
| 181 |
if ( node->isBlockedcxx . . $ DlCompletionTree#isBlocked(50ce9a9e25b4a850).() ) |
| 182 |
saveRareCondcxx . . $ DlCompletionGraph#saveRareCond(1cbbef85a2ba1293).(node->setUBlockedcxx . . $ DlCompletionTree#setUBlocked(85c56efe7ce37b0e).()); |
| 183 |
if ( useAnywhereBlockingcxx . . $ DlCompletionGraph#useAnywhereBlocking. ) |
| 184 |
findDAnywhereBlockercxx . . $ DlCompletionGraph#findDAnywhereBlocker(3bf754c9a531d7e6).(node); |
| 185 |
else |
| 186 |
findDAncestorBlockercxx . . $ DlCompletionGraph#findDAncestorBlocker(3bf754c9a531d7e6).(node); |
| 187 |
} |
| 188 |
/// unblock all the children of the node |
| 189 |
void unblockNodeChildrencxx . . $ DlCompletionGraph#unblockNodeChildren(3bf754c9a531d7e6). ( DlCompletionTreecxx . . $ DlCompletionTree#* node ) |
| 190 |
{ |
| 191 |
for ( DlCompletionTreecxx . . $ DlCompletionTree#::const_edge_iteratorcxx . . $ DlCompletionTree#const_edge_iterator# q = nodecxx . . $ __gnu_cxx/__normal_iterator#__normal_iterator(ea0f1a22ba5f21a0).->begincxx . . $ DlCompletionTree#begin(de7d1c517ae77062).(), q_end = nodecxx . . $ __gnu_cxx/__normal_iterator#__normal_iterator(ea0f1a22ba5f21a0).->endcxx . . $ DlCompletionTree#end(de7d1c517ae77062).(); q <cxx . . $ __gnu_cxx/`operator<`(ef3c5749062e825c). q_end; ++cxx . . $ __gnu_cxx/__normal_iterator#operator++(93f2e9c3bc4efc49).q ) |
| 192 |
if ( (*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(c076846f881f3e7e).q)->isSuccEdgecxx . . $ DlCompletionTreeArc#isSuccEdge(50ce9a9e25b4a850).() && !(*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(c076846f881f3e7e).q)->isIBlockedcxx . . $ DlCompletionTreeArc#isIBlocked(50ce9a9e25b4a850).() && !(*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(c076846f881f3e7e).q)->isReflexiveEdgecxx . . $ DlCompletionTreeArc#isReflexiveEdge(50ce9a9e25b4a850).() ) // all of them are i-blocked |
| 193 |
unblockNodecxx . . $ DlCompletionGraph#unblockNode(b0d9ee120534554a). ( (*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(c076846f881f3e7e).q)->getArcEndcxx . . $ DlCompletionTreeArc#getArcEnd(1b0634bb62d2788b).(), false ); |
| 194 |
} |
| 195 |
/// mark node unblocked; unblock all the hierarchy |
| 196 |
void unblockNodecxx . . $ DlCompletionGraph#unblockNode(b0d9ee120534554a). ( DlCompletionTreecxx . . $ DlCompletionTree#* node, bool wasDBlocked ); |
| 197 |
|
| 198 |
/// mark NODE as a d-blocked by a BLOCKER |
| 199 |
void setNodeDBlockedcxx . . $ DlCompletionGraph#setNodeDBlocked(616fb35effd4bdc7). ( DlCompletionTreecxx . . $ DlCompletionTree#* node, const DlCompletionTreecxx . . $ DlCompletionTree#* blocker ) |
| 200 |
{ |
| 201 |
saveRareCondcxx . . $ DlCompletionGraph#saveRareCond(1cbbef85a2ba1293).(node->setDBlockedcxx . . $ DlCompletionTree#setDBlocked(5b1a0959643dd9be).(blocker)); |
| 202 |
propagateIBlockedStatuscxx . . $ DlCompletionGraph#propagateIBlockedStatus(616fb35effd4bdc7). ( node, node ); |
| 203 |
} |
| 204 |
/// mark NODE as an i-blocked by a BLOCKER |
| 205 |
void setNodeIBlockedcxx . . $ DlCompletionGraph#setNodeIBlocked(616fb35effd4bdc7). ( DlCompletionTreecxx . . $ DlCompletionTree#* node, const DlCompletionTreecxx . . $ DlCompletionTree#* blocker ) |
| 206 |
{ |
| 207 |
// nominal nodes can't be blocked |
| 208 |
if ( node->isPBlockedcxx . . $ DlCompletionTree#isPBlocked(50ce9a9e25b4a850).() || node->isNominalNodecxx . . $ DlCompletionTree#isNominalNode(50ce9a9e25b4a850).() ) |
| 209 |
return; |
| 210 |
|
| 211 |
node->clearAffectedcxx . . $ DlCompletionTree#clearAffected(49f6e7a06ebc5aa8).(); |
| 212 |
|
| 213 |
// already iBlocked -- nothing changes |
| 214 |
if ( node->isIBlockedcxx . . $ DlCompletionTree#isIBlocked(50ce9a9e25b4a850).() && node->Blockercxx . . $ DlCompletionTree#Blocker. == blocker ) |
| 215 |
return; |
| 216 |
// prevent node to be IBlocked due to reflexivity |
| 217 |
if ( node == blocker ) |
| 218 |
return; |
| 219 |
|
| 220 |
saveRareCondcxx . . $ DlCompletionGraph#saveRareCond(1cbbef85a2ba1293).(node->setIBlockedcxx . . $ DlCompletionTree#setIBlocked(5b1a0959643dd9be).(blocker)); |
| 221 |
propagateIBlockedStatuscxx . . $ DlCompletionGraph#propagateIBlockedStatus(616fb35effd4bdc7). ( node, blocker ); |
| 222 |
} |
| 223 |
/// propagate i-blocked status to all children of NODE |
| 224 |
void propagateIBlockedStatuscxx . . $ DlCompletionGraph#propagateIBlockedStatus(616fb35effd4bdc7). ( DlCompletionTreecxx . . $ DlCompletionTree#* node, const DlCompletionTreecxx . . $ DlCompletionTree#* blocker ) |
| 225 |
{ |
| 226 |
for ( DlCompletionTreecxx . . $ DlCompletionTree#::const_edge_iteratorcxx . . $ DlCompletionTree#const_edge_iterator# q = nodecxx . . $ __gnu_cxx/__normal_iterator#__normal_iterator(ea0f1a22ba5f21a0).->begincxx . . $ DlCompletionTree#begin(de7d1c517ae77062).(), q_end = nodecxx . . $ __gnu_cxx/__normal_iterator#__normal_iterator(ea0f1a22ba5f21a0).->endcxx . . $ DlCompletionTree#end(de7d1c517ae77062).(); q <cxx . . $ __gnu_cxx/`operator<`(ef3c5749062e825c). q_end; ++cxx . . $ __gnu_cxx/__normal_iterator#operator++(93f2e9c3bc4efc49).q ) |
| 227 |
if ( (*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(c076846f881f3e7e).q)->isSuccEdgecxx . . $ DlCompletionTreeArc#isSuccEdge(50ce9a9e25b4a850).() && !(*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(c076846f881f3e7e).q)->isIBlockedcxx . . $ DlCompletionTreeArc#isIBlocked(50ce9a9e25b4a850).() ) |
| 228 |
setNodeIBlockedcxx . . $ DlCompletionGraph#setNodeIBlocked(616fb35effd4bdc7). ( (*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(c076846f881f3e7e).q)->getArcEndcxx . . $ DlCompletionTreeArc#getArcEnd(1b0634bb62d2788b).(), blocker ); |
| 229 |
} |
| 230 |
/// @return true iff node might became unblocked |
| 231 |
bool canBeUnBlockedcxx . . $ DlCompletionGraph#canBeUnBlocked(297e82587742fbad). ( DlCompletionTreecxx . . $ DlCompletionTree#* node ) const |
| 232 |
{ |
| 233 |
// in presence of inverse roles it is not enough |
| 234 |
// to check the affected flag for both node and its blocker |
| 235 |
// see tModal* for example |
| 236 |
if ( sessionHasInverseRolescxx . . $ DlCompletionGraph#sessionHasInverseRoles. ) |
| 237 |
return true; |
| 238 |
// if node is affected -- it can be unblocked; |
| 239 |
// if blocker became blocked itself -- the same |
| 240 |
return node->isAffectedcxx . . $ DlCompletionTree#isAffected(50ce9a9e25b4a850).() || node->isIllegallyDBlockedcxx . . $ DlCompletionTree#isIllegallyDBlocked(50ce9a9e25b4a850).(); |
| 241 |
} |
| 242 |
|
| 243 |
// helpers for the graph printing |
| 244 |
|
| 245 |
/// print proper indentation |
| 246 |
void PrintIndentcxx . . $ DlCompletionGraph#PrintIndent(f7f45734e6842120). ( stdcxx . . $ std/::ostreamcxx . . $ std/ostream#& o ) |
| 247 |
{ |
| 248 |
o <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "\n|"; |
| 249 |
for ( unsigned int i = 1; i < CGPIndentcxx . . $ DlCompletionGraph#CGPIndent.; ++i ) |
| 250 |
o <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). " |"; |
| 251 |
} |
| 252 |
/// print node of the graph with proper indentation |
| 253 |
void PrintNodecxx . . $ DlCompletionGraph#PrintNode(dc708c26802d04b9). ( const DlCompletionTreecxx . . $ DlCompletionTree#* node, stdcxx . . $ std/::ostreamcxx . . $ std/ostream#& o ); |
| 254 |
/// print edge of the graph with proper indentation |
| 255 |
void PrintEdgecxx . . $ DlCompletionGraph#PrintEdge(3ed5e198e997ea1). ( DlCompletionTreecxx . . $ DlCompletionTree#::const_edge_iteratorcxx . . $ DlCompletionTree#const_edge_iterator# edge, const DlCompletionTreecxx . . $ DlCompletionTree#* parent, stdcxx . . $ std/::ostreamcxx . . $ std/ostream#& o ); |
| 256 |
|
| 257 |
public: // interface |
| 258 |
/// c'tor: make INIT_SIZE objects |
| 259 |
DlCompletionGraphcxx . . $ DlCompletionGraph#DlCompletionGraph(ca6525e6607bc4c2). ( unsigned int initSize, DlSatTestercxx . . $ DlSatTester#* p ) |
| 260 |
: NodeBasecxx . . $ std/vector#vector(83fdeebbe0501a83).(initSize) |
| 261 |
, pReasonercxx . . $ DlCompletionGraph#pReasoner.(p) |
| 262 |
, branchingLevelcxx . . $ DlCompletionGraph#branchingLevel.(InitBranchingLevelValuecxx . . $ InitBranchingLevelValue.) |
| 263 |
, IRLevelcxx . . $ DlCompletionGraph#IRLevel.(initIRLevelcxx . . $ DlCompletionGraph#initIRLevel.) |
| 264 |
{ |
| 265 |
initNodeArraycxx . . $ DlCompletionGraph#initNodeArray(d16e16ddbc5e0330). ( NodeBasecxx . . $ DlCompletionGraph#NodeBase..begincxx . . $ std/vector#begin(33b10a496a38335b).(), NodeBasecxx . . $ DlCompletionGraph#NodeBase..endcxx . . $ std/vector#end(33b10a496a38335b).() ); |
| 266 |
clearStatisticscxx . . $ DlCompletionGraph#clearStatistics(49f6e7a06ebc5aa8).(); |
| 267 |
initRootcxx . . $ DlCompletionGraph#initRoot(49f6e7a06ebc5aa8).(); |
| 268 |
} |
| 269 |
/// no copy c'tor |
| 270 |
DlCompletionGraphcxx . . $ DlCompletionGraph#DlCompletionGraph(178b83a355a51f85). ( const DlCompletionGraphcxx . . $ DlCompletionGraph#& ) = delete; |
| 271 |
/// no assignment |
| 272 |
DlCompletionGraphcxx . . $ DlCompletionGraph#& operatorcxx . . $ DlCompletionGraph#`operator=`(20f6028453e95e6a). = ( const DlCompletionGraphcxx . . $ DlCompletionGraph#& ) = delete; |
| 273 |
/// d'tor: delete all allocated nodes |
| 274 |
~cxx . . $ DlCompletionGraph#`~DlCompletionGraph`(49f6e7a06ebc5aa8).DlCompletionGraphcxx . . $ DlCompletionGraph#() |
| 275 |
{ |
| 276 |
for ( DlCompletionTreecxx . . $ DlCompletionTree#* node : NodeBasecxx . . $ DlCompletionGraph#NodeBase. ) |
| 277 |
delete node; |
| 278 |
} |
| 279 |
|
| 280 |
// flag setting |
| 281 |
|
| 282 |
/// set flags for blocking |
| 283 |
void initContextcxx . . $ DlCompletionGraph#initContext(d06ec138c316ab3d). ( int nSkip, bool useLB, bool useAB ) |
| 284 |
{ |
| 285 |
nSkipBeforeBlockcxx . . $ DlCompletionGraph#nSkipBeforeBlock. = nSkip; |
| 286 |
useLazyBlockingcxx . . $ DlCompletionGraph#useLazyBlocking. = useLB; |
| 287 |
useAnywhereBlockingcxx . . $ DlCompletionGraph#useAnywhereBlocking. = useAB; |
| 288 |
} |
| 289 |
/// set blocking method for a session |
| 290 |
void setBlockingMethodcxx . . $ DlCompletionGraph#setBlockingMethod(b0b38cda41d4ede4). ( bool hasInverse, bool hasQCR ) |
| 291 |
{ |
| 292 |
sessionHasInverseRolescxx . . $ DlCompletionGraph#sessionHasInverseRoles. = hasInverse; |
| 293 |
sessionHasNumberRestrictionscxx . . $ DlCompletionGraph#sessionHasNumberRestrictions. = hasQCR; |
| 294 |
} |
| 295 |
/// add concept C of a type TAG to NODE; call blocking check if appropriate |
| 296 |
void addConceptToNodecxx . . $ DlCompletionGraph#addConceptToNode(df4560871dbcb770). ( DlCompletionTreecxx . . $ DlCompletionTree#* node, const ConceptWDepcxx . . $ ConceptWDep#& c, bool isComplex ) |
| 297 |
{ |
| 298 |
node->addConceptcxx . . $ DlCompletionTree#addConcept(65b796d27884e484). ( c, isComplex ); |
| 299 |
|
| 300 |
if ( useLazyBlockingcxx . . $ DlCompletionGraph#useLazyBlocking. ) |
| 301 |
node->setAffectedcxx . . $ DlCompletionTree#setAffected(49f6e7a06ebc5aa8).(); |
| 302 |
else |
| 303 |
detectBlockedStatuscxx . . $ DlCompletionGraph#detectBlockedStatus(3bf754c9a531d7e6).(node); |
| 304 |
} |
| 305 |
|
| 306 |
// access to nodes |
| 307 |
|
| 308 |
/// get a root node (non-const) |
| 309 |
DlCompletionTreecxx . . $ DlCompletionTree#* getRootcxx . . $ DlCompletionGraph#getRoot(8f504d760f19febe). ( void ) { return NodeBasecxx . . $ DlCompletionGraph#NodeBase.[cxx . . $ std/vector#`operator[]`(428bb168810b9e52).0]->resolvePBlockercxx . . $ DlCompletionTree#resolvePBlocker(8f504d760f19febe).(); } |
| 310 |
/// get a root node (const) |
| 311 |
const DlCompletionTreecxx . . $ DlCompletionTree#* getRootcxx . . $ DlCompletionGraph#getRoot(19e040716207bced). ( void ) const { return NodeBasecxx . . $ DlCompletionGraph#NodeBase.[cxx . . $ std/vector#`operator[]`(b61e45a10b63f40a).0]->resolvePBlockercxx . . $ DlCompletionTree#resolvePBlocker(8f504d760f19febe).(); } |
| 312 |
/// get a node by it's ID |
| 313 |
DlCompletionTreecxx . . $ DlCompletionTree#* getNodecxx . . $ DlCompletionGraph#getNode(2c856eb5b0586200). ( unsigned int id ) |
| 314 |
{ |
| 315 |
if ( id >= endUsedcxx . . $ DlCompletionGraph#endUsed. ) |
| 316 |
return nullptr; |
| 317 |
return NodeBasecxx . . $ DlCompletionGraph#NodeBase.[cxx . . $ std/vector#`operator[]`(428bb168810b9e52).id]; |
| 318 |
} |
| 319 |
/// get new node (with internal level) |
| 320 |
DlCompletionTreecxx . . $ DlCompletionTree#* getNewNodecxx . . $ DlCompletionGraph#getNewNode(8f504d760f19febe). ( void ) |
| 321 |
{ |
| 322 |
if ( endUsedcxx . . $ DlCompletionGraph#endUsed. >= NodeBasecxx . . $ DlCompletionGraph#NodeBase..sizecxx . . $ std/vector#size(fe4d2d262d4164a8).() ) |
| 323 |
growcxx . . $ DlCompletionGraph#grow(49f6e7a06ebc5aa8).(); |
| 324 |
DlCompletionTreecxx . . $ DlCompletionTree#* ret = NodeBasecxx . . $ DlCompletionGraph#NodeBase.[cxx . . $ std/vector#`operator[]`(428bb168810b9e52).endUsedcxx . . $ DlCompletionGraph#endUsed.++]; |
| 325 |
ret->initcxx . . $ DlCompletionTree#init(cb2f890c2fdad230).(branchingLevelcxx . . $ DlCompletionGraph#branchingLevel.); |
| 326 |
return ret; |
| 327 |
} |
| 328 |
|
| 329 |
/// begin (RO) of USED nodes |
| 330 |
const_iteratorcxx . . $ DlCompletionGraph#const_iterator# begincxx . . $ DlCompletionGraph#begin(aa46d9ce02b37634). ( void ) const { return NodeBasecxx . . $ DlCompletionGraph#NodeBase..begincxx . . $ std/vector#begin(359ca5030082c9f).(); } |
| 331 |
/// end (RO) of USED nodes |
| 332 |
const_iteratorcxx . . $ DlCompletionGraph#const_iterator# endcxx . . $ DlCompletionGraph#end(aa46d9ce02b37634). ( void ) const { return NodeBasecxx . . $ DlCompletionGraph#NodeBase..begincxx . . $ std/vector#begin(359ca5030082c9f).()+cxx . . $ __gnu_cxx/__normal_iterator#operator+(d0cb2d2ebd313f38).(long)endUsedcxx . . $ DlCompletionGraph#endUsed.; } |
| 333 |
/// begin (RW) of USED nodes |
| 334 |
iteratorcxx . . $ DlCompletionGraph#iterator# begincxx . . $ DlCompletionGraph#begin(279e9fe68f310cbf). ( void ) { return NodeBasecxx . . $ DlCompletionGraph#NodeBase..begincxx . . $ std/vector#begin(33b10a496a38335b).(); } |
| 335 |
/// end (RW) of USED nodes |
| 336 |
iteratorcxx . . $ DlCompletionGraph#iterator# endcxx . . $ DlCompletionGraph#end(279e9fe68f310cbf). ( void ) { return NodeBasecxx . . $ DlCompletionGraph#NodeBase..begincxx . . $ std/vector#begin(33b10a496a38335b).()+cxx . . $ __gnu_cxx/__normal_iterator#operator+(d0cb2d2ebd313f38).(long)endUsedcxx . . $ DlCompletionGraph#endUsed.; } |
| 337 |
|
| 338 |
// blocking |
| 339 |
|
| 340 |
/// detect blocked status of current node by checking whether NODE and/or its ancestors are d-blocked |
| 341 |
void detectBlockedStatuscxx . . $ DlCompletionGraph#detectBlockedStatus(3bf754c9a531d7e6). ( DlCompletionTreecxx . . $ DlCompletionTree#* node ); |
| 342 |
/// update blocked status for d-blocked node |
| 343 |
void updateDBlockedStatuscxx . . $ DlCompletionGraph#updateDBlockedStatus(3bf754c9a531d7e6). ( DlCompletionTreecxx . . $ DlCompletionTree#* node ) |
| 344 |
{ |
| 345 |
if ( !canBeUnBlockedcxx . . $ DlCompletionGraph#canBeUnBlocked(297e82587742fbad).(node) ) |
| 346 |
return; |
| 347 |
if ( isStillDBlockedcxx . . $ DlCompletionGraph#isStillDBlocked(e2c3b6f64f9879b7).(node) ) |
| 348 |
// FIXME!! clear affected in all children |
| 349 |
node->clearAffectedcxx . . $ DlCompletionTree#clearAffected(49f6e7a06ebc5aa8).(); |
| 350 |
else |
| 351 |
detectBlockedStatuscxx . . $ DlCompletionGraph#detectBlockedStatus(3bf754c9a531d7e6).(node); |
| 352 |
fpp_assertcxx . . $ EFPPAssertion#EFPPAssertion(85c52e162fed56f9). ( !node->isAffected() ); |
| 353 |
} |
| 354 |
/// retest every d-blocked node in the CG. Use it after the CG was build |
| 355 |
void retestCGBlockedStatuscxx . . $ DlCompletionGraph#retestCGBlockedStatus(49f6e7a06ebc5aa8). ( void ) |
| 356 |
{ |
| 357 |
bool repeat; |
| 358 |
iteratorcxx . . $ DlCompletionGraph#iterator# pcxx . . $ __gnu_cxx/__normal_iterator#__normal_iterator(49f6e7a06ebc5aa8)., p_beg = begincxx . . $ DlCompletionGraph#begin(279e9fe68f310cbf).(), p_end = endcxx . . $ DlCompletionGraph#end(279e9fe68f310cbf).(); |
| 359 |
do |
| 360 |
{ |
| 361 |
for ( p =cxx . . $ __gnu_cxx/__normal_iterator#`operator=`(a296810e5ed7f79). p_beg; p <cxx . . $ __gnu_cxx/`operator<`(ef3c5749062e825c). p_end; ++cxx . . $ __gnu_cxx/__normal_iterator#operator++(93f2e9c3bc4efc49).p ) |
| 362 |
if ( (*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(c076846f881f3e7e).p)->isDBlockedcxx . . $ DlCompletionTree#isDBlocked(50ce9a9e25b4a850).() ) |
| 363 |
updateDBlockedStatuscxx . . $ DlCompletionGraph#updateDBlockedStatus(3bf754c9a531d7e6).(*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(c076846f881f3e7e).p); |
| 364 |
|
| 365 |
// we need to repeat the thing if something became unblocked and then blocked again, |
| 366 |
// in case one of the blockers became blocked itself; see tModal3 for such an example |
| 367 |
repeat = false; |
| 368 |
for ( p =cxx . . $ __gnu_cxx/__normal_iterator#`operator=`(a296810e5ed7f79). p_beg; p <cxx . . $ __gnu_cxx/`operator<`(ef3c5749062e825c). p_end; ++cxx . . $ __gnu_cxx/__normal_iterator#operator++(93f2e9c3bc4efc49).p ) |
| 369 |
if ( (*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(c076846f881f3e7e).p)->isIllegallyDBlockedcxx . . $ DlCompletionTree#isIllegallyDBlocked(50ce9a9e25b4a850).() ) |
| 370 |
{ |
| 371 |
repeat = true; |
| 372 |
break; |
| 373 |
} |
| 374 |
} while ( repeat ); |
| 375 |
} |
| 376 |
|
| 377 |
// fairness support |
| 378 |
|
| 379 |
/// @ return true if a fairness constraint C is violated in one of the loops in the CGraph |
| 380 |
DlCompletionTreecxx . . $ DlCompletionTree#* getFCViolatorcxx . . $ DlCompletionGraph#getFCViolator(d75bf3f3e31659ef). ( BipolarPointercxx . . $ BipolarPointer# C ) const |
| 381 |
{ |
| 382 |
for ( const_iteratorcxx . . $ DlCompletionGraph#const_iterator# p = begincxx . . $ DlCompletionGraph#begin(aa46d9ce02b37634).(), p_end = endcxx . . $ DlCompletionGraph#end(aa46d9ce02b37634).(); p <cxx . . $ __gnu_cxx/`operator<`(ef3c5749062e825c). p_end; ++cxx . . $ __gnu_cxx/__normal_iterator#operator++(93f2e9c3bc4efc49).p ) |
| 383 |
if ( (*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(c076846f881f3e7e).p)->isDBlockedcxx . . $ DlCompletionTree#isDBlocked(50ce9a9e25b4a850).() && !(*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(c076846f881f3e7e).p)->isLoopLabelledcxx . . $ DlCompletionTree#isLoopLabelled(83c267b20bac841a).(C) ) |
| 384 |
return const_cast<DlCompletionTreecxx . . $ DlCompletionTree#*>((*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(c076846f881f3e7e).p)->Blockercxx . . $ DlCompletionTree#Blocker.); |
| 385 |
return nullptr; |
| 386 |
} |
| 387 |
|
| 388 |
/// clear all the session statistics |
| 389 |
void clearStatisticscxx . . $ DlCompletionGraph#clearStatistics(49f6e7a06ebc5aa8). ( void ) |
| 390 |
{ |
| 391 |
nNodeSavescxx . . $ DlCompletionGraph#nNodeSaves. = 0; |
| 392 |
nNodeRestorescxx . . $ DlCompletionGraph#nNodeRestores. = 0; |
| 393 |
if ( maxGraphSizecxx . . $ DlCompletionGraph#maxGraphSize. < endUsedcxx . . $ DlCompletionGraph#endUsed. ) |
| 394 |
maxGraphSizecxx . . $ DlCompletionGraph#maxGraphSize. = endUsedcxx . . $ DlCompletionGraph#endUsed.; |
| 395 |
} |
| 396 |
/// mark all heap elements as unused |
| 397 |
void clearcxx . . $ DlCompletionGraph#clear(49f6e7a06ebc5aa8). ( void ) |
| 398 |
{ |
| 399 |
CTEdgeHeapcxx . . $ DlCompletionGraph#CTEdgeHeap..clearcxx . . $ growingArrayP#clear(49f6e7a06ebc5aa8).(); |
| 400 |
endUsedcxx . . $ DlCompletionGraph#endUsed. = 0; |
| 401 |
branchingLevelcxx . . $ DlCompletionGraph#branchingLevel. = InitBranchingLevelValuecxx . . $ InitBranchingLevelValue.; |
| 402 |
IRLevelcxx . . $ DlCompletionGraph#IRLevel. = initIRLevelcxx . . $ DlCompletionGraph#initIRLevel.; |
| 403 |
RareStackcxx . . $ DlCompletionGraph#RareStack..clearcxx . . $ TRareSaveStack#clear(49f6e7a06ebc5aa8).(); |
| 404 |
Stackcxx . . $ DlCompletionGraph#Stack..clearcxx . . $ growingArrayP#clear(49f6e7a06ebc5aa8).(); |
| 405 |
SavedNodescxx . . $ DlCompletionGraph#SavedNodes..clearcxx . . $ std/vector#clear(49f6e7a06ebc5aa8).(); |
| 406 |
initRootcxx . . $ DlCompletionGraph#initRoot(49f6e7a06ebc5aa8).(); |
| 407 |
} |
| 408 |
/// get number of nodes in the CGraph |
| 409 |
size_tcxx . . $ std/size_t# maxSizecxx . . $ DlCompletionGraph#maxSize(fe4d2d262d4164a8). ( void ) const { return maxGraphSizecxx . . $ DlCompletionGraph#maxGraphSize.; } |
| 410 |
|
| 411 |
/// save rarely appeared info if P is non-NULL |
| 412 |
void saveRareCondcxx . . $ DlCompletionGraph#saveRareCond(1cbbef85a2ba1293). ( TRestorercxx . . $ TRestorer#* p ) { if (p) RareStackcxx . . $ DlCompletionGraph#RareStack..pushcxx . . $ TRareSaveStack#push(1cbbef85a2ba1293).(p); } |
| 413 |
/// get the rare stack |
| 414 |
TRareSaveStackcxx . . $ TRareSaveStack#* getRareStackcxx . . $ DlCompletionGraph#getRareStack(f4029463feb83669). ( void ) { return &RareStackcxx . . $ DlCompletionGraph#RareStack.; } |
| 415 |
|
| 416 |
//---------------------------------------------- |
| 417 |
// role/node |
| 418 |
//---------------------------------------------- |
| 419 |
|
| 420 |
/// add role R with dep-set DEP to the label of the TO arc |
| 421 |
DlCompletionTreeArccxx . . $ DlCompletionTreeArc#* addRoleLabelcxx . . $ DlCompletionGraph#addRoleLabel(2369b4bf26f5db64). ( |
| 422 |
DlCompletionTreecxx . . $ DlCompletionTree#* from, |
| 423 |
DlCompletionTreecxx . . $ DlCompletionTree#* to, |
| 424 |
bool isPredEdge, |
| 425 |
const TRolecxx . . $ TRole#* R, // name of role (arc label) |
| 426 |
const DepSetcxx . . $ DepSet#& dep ) // dep-set of the arc label |
| 427 |
{ |
| 428 |
// check if CGraph already has FROM->TO edge labelled with RNAME |
| 429 |
DlCompletionTreeArccxx . . $ DlCompletionTreeArc#* ret = from->getEdgeLabelledcxx . . $ DlCompletionTree#getEdgeLabelled(9eec51ce6dfc960e). ( R, to ); |
| 430 |
if ( ret == nullptr ) |
| 431 |
ret = createEdgecxx . . $ DlCompletionGraph#createEdge(2369b4bf26f5db64). ( from, to, isPredEdge, R, dep ); |
| 432 |
else |
| 433 |
saveRareCondcxx . . $ DlCompletionGraph#saveRareCond(1cbbef85a2ba1293).(ret->addDepcxx . . $ DlCompletionTreeArc#addDep(f79dbcf51f32f0eb).(dep)); |
| 434 |
|
| 435 |
return ret; |
| 436 |
} |
| 437 |
/// Create an empty R-neighbour of FROM; @return an edge to created node |
| 438 |
DlCompletionTreeArccxx . . $ DlCompletionTreeArc#* createNeighbourcxx . . $ DlCompletionGraph#createNeighbour(3da37b6609f7179c). ( |
| 439 |
DlCompletionTreecxx . . $ DlCompletionTree#* from, |
| 440 |
bool isPredEdge, |
| 441 |
const TRolecxx . . $ TRole#* r, // name of role (arc label) |
| 442 |
const DepSetcxx . . $ DepSet#& dep ) // dep-set of the arc label |
| 443 |
{ |
| 444 |
if ( RKG_USE_DYNAMIC_BACKJUMPINGcxx . . $ `Kernel/globaldef.h:52:10`! ) |
| 445 |
fpp_assertcxx . . $ EFPPAssertion# ( branchingLevel == dep.level()+1 ); |
| 446 |
|
| 447 |
return createEdgecxx . . $ DlCompletionGraph#createEdge(2369b4bf26f5db64). ( from, getNewNodecxx . . $ DlCompletionGraph#getNewNode(8f504d760f19febe).(), isPredEdge, r, dep ); |
| 448 |
} |
| 449 |
/// Create an R-loop of NODE wrt dep-set DEP; @return a loop edge |
| 450 |
DlCompletionTreeArccxx . . $ DlCompletionTreeArc#* createLoopcxx . . $ DlCompletionGraph#createLoop(882ef0e58548cfd4). ( DlCompletionTreecxx . . $ DlCompletionTree#* node, const TRolecxx . . $ TRole#* r, const DepSetcxx . . $ DepSet#& dep ) |
| 451 |
{ |
| 452 |
return addRoleLabelcxx . . $ DlCompletionGraph#addRoleLabel(2369b4bf26f5db64). ( node, node, /*isPredEdge=*/false, r, dep ); |
| 453 |
} |
| 454 |
|
| 455 |
/// merge node FROM to node TO (do NOT copy label); fill EDGES with new edges added to TO |
| 456 |
void Mergecxx . . $ DlCompletionGraph#Merge(e2735435d305419c). ( DlCompletionTreecxx . . $ DlCompletionTree#* from, DlCompletionTreecxx . . $ DlCompletionTree#* to, const DepSetcxx . . $ DepSet#& toAdd, |
| 457 |
stdcxx . . $ std/::vectorcxx . . $ std/vector#<DlCompletionTreeArccxx . . $ DlCompletionTreeArc#*>& edges ); |
| 458 |
/// purge node P with given ROOT and DEP-set |
| 459 |
void purgeNodecxx . . $ DlCompletionGraph#purgeNode(4c11a3ac995a241a). ( DlCompletionTreecxx . . $ DlCompletionTree#* p, const DlCompletionTreecxx . . $ DlCompletionTree#* root, const DepSetcxx . . $ DepSet#& dep ); |
| 460 |
/// purge edge E with given ROOT and DEP-set |
| 461 |
void purgeEdgecxx . . $ DlCompletionGraph#purgeEdge(922b6183ddf1e042). ( DlCompletionTreeArccxx . . $ DlCompletionTreeArc#* e, const DlCompletionTreecxx . . $ DlCompletionTree#* root, const DepSetcxx . . $ DepSet#& dep ); |
| 462 |
|
| 463 |
//---------------------------------------------- |
| 464 |
// inequality relation interface |
| 465 |
//---------------------------------------------- |
| 466 |
|
| 467 |
/// init new IR set |
| 468 |
void initIRcxx . . $ DlCompletionGraph#initIR(49f6e7a06ebc5aa8). ( void ); |
| 469 |
/// make given NODE member of current IR set; @return true iff clash occurs |
| 470 |
bool setCurIRcxx . . $ DlCompletionGraph#setCurIR(9c3f4bbfaa7a98e6). ( DlCompletionTreecxx . . $ DlCompletionTree#* node, const DepSetcxx . . $ DepSet#& ds ); |
| 471 |
/// finalise current IR set |
| 472 |
void finiIRcxx . . $ DlCompletionGraph#finiIR(49f6e7a06ebc5aa8). ( void ); |
| 473 |
|
| 474 |
/// check if P and Q are in IR; if so, put the clash-set to DEP |
| 475 |
bool nonMergeablecxx . . $ DlCompletionGraph#nonMergeable(3cd92906c32a9a0b). ( const DlCompletionTreecxx . . $ DlCompletionTree#* p, const DlCompletionTreecxx . . $ DlCompletionTree#* q, DepSetcxx . . $ DepSet#& dep ) const; |
| 476 |
|
| 477 |
//---------------------------------------------- |
| 478 |
// save/restore |
| 479 |
//---------------------------------------------- |
| 480 |
|
| 481 |
/// save given node wrt level |
| 482 |
void saveNodecxx . . $ DlCompletionGraph#saveNode(aa3cbc006cb08887). ( DlCompletionTreecxx . . $ DlCompletionTree#* node, unsigned int level ) |
| 483 |
{ |
| 484 |
if ( node->needSavecxx . . $ DlCompletionTree#needSave(8de63fdb265b07c1).(level) ) |
| 485 |
{ |
| 486 |
node->savecxx . . $ DlCompletionTree#save(cb2f890c2fdad230).(level); |
| 487 |
SavedNodescxx . . $ DlCompletionGraph#SavedNodes..push_backcxx . . $ std/vector#push_back(77d9f17553126ecb).(node); |
| 488 |
++nNodeSavescxx . . $ DlCompletionGraph#nNodeSaves.; |
| 489 |
} |
| 490 |
} |
| 491 |
/// restore given node wrt level |
| 492 |
void restoreNodecxx . . $ DlCompletionGraph#restoreNode(aa3cbc006cb08887). ( DlCompletionTreecxx . . $ DlCompletionTree#* node, unsigned int level ) |
| 493 |
{ |
| 494 |
if ( node->needRestorecxx . . $ DlCompletionTree#needRestore(8de63fdb265b07c1).(level) ) |
| 495 |
{ |
| 496 |
node->restorecxx . . $ DlCompletionTree#restore(cb2f890c2fdad230).(level); |
| 497 |
++nNodeRestorescxx . . $ DlCompletionGraph#nNodeRestores.; |
| 498 |
} |
| 499 |
} |
| 500 |
/// save local state |
| 501 |
void savecxx . . $ DlCompletionGraph#save(49f6e7a06ebc5aa8). ( void ); |
| 502 |
/// restore state for the given LEVEL |
| 503 |
void restorecxx . . $ DlCompletionGraph#restore(cb2f890c2fdad230). ( unsigned int level ); |
| 504 |
|
| 505 |
// statistics |
| 506 |
|
| 507 |
/// get number of nodes saved during session |
| 508 |
unsigned int getNNodeSavescxx . . $ DlCompletionGraph#getNNodeSaves(ddd8539a2fcdd4ce). ( void ) const { return nNodeSavescxx . . $ DlCompletionGraph#nNodeSaves.; } |
| 509 |
/// get number of nodes restored during session |
| 510 |
unsigned int getNNodeRestorescxx . . $ DlCompletionGraph#getNNodeRestores(ddd8539a2fcdd4ce). ( void ) const { return nNodeRestorescxx . . $ DlCompletionGraph#nNodeRestores.; } |
| 511 |
|
| 512 |
// print |
| 513 |
|
| 514 |
/// print graph starting from the root |
| 515 |
void Printcxx . . $ DlCompletionGraph#Print(f7f45734e6842120). ( stdcxx . . $ std/::ostreamcxx . . $ std/ostream#& o ); |
| 516 |
}; // DlCompletionGraph |
| 517 |
|
| 518 |
// blocking |
| 519 |
|
| 520 |
#if defined(RKG_IR_IN_NODE_LABELcxx . . $ `Kernel/globaldef.h:69:9`!) |
| 521 |
inline bool |
| 522 |
DlCompletionGraphcxx . . $ DlCompletionGraph# :: nonMergeablecxx . . $ DlCompletionGraph#nonMergeable(3cd92906c32a9a0b). ( const DlCompletionTreecxx . . $ DlCompletionTree#* p, const DlCompletionTreecxx . . $ DlCompletionTree#* q, DepSetcxx . . $ DepSet#& dep ) const |
| 523 |
{ |
| 524 |
return p->nonMergeablecxx . . $ DlCompletionTree#nonMergeable(1fdb8df2fde94811). ( q, dep ); |
| 525 |
} |
| 526 |
|
| 527 |
inline void |
| 528 |
DlCompletionGraphcxx . . $ DlCompletionGraph# :: updateIRcxx . . $ DlCompletionGraph#updateIR(4c11a3ac995a241a). ( DlCompletionTreecxx . . $ DlCompletionTree#* p, const DlCompletionTreecxx . . $ DlCompletionTree#* q, const DepSetcxx . . $ DepSet#& toAdd ) |
| 529 |
{ |
| 530 |
saveRareCondcxx . . $ DlCompletionGraph#saveRareCond(1cbbef85a2ba1293). ( p->updateIRcxx . . $ DlCompletionTree#updateIR(7616d0d20370b11b). ( q, toAdd ) ); |
| 531 |
} |
| 532 |
|
| 533 |
inline void |
| 534 |
DlCompletionGraphcxx . . $ DlCompletionGraph# :: initIRcxx . . $ DlCompletionGraph#initIR(49f6e7a06ebc5aa8). ( void ) |
| 535 |
{ |
| 536 |
++IRLevelcxx . . $ DlCompletionGraph#IRLevel.; |
| 537 |
} |
| 538 |
|
| 539 |
inline bool |
| 540 |
DlCompletionGraphcxx . . $ DlCompletionGraph# :: setCurIRcxx . . $ DlCompletionGraph#setCurIR(9c3f4bbfaa7a98e6). ( DlCompletionTreecxx . . $ DlCompletionTree#* node, const DepSetcxx . . $ DepSet#& ds ) |
| 541 |
{ |
| 542 |
return node->initIRcxx . . $ DlCompletionTree#initIR(cbd92d0fb85c8e0). ( IRLevelcxx . . $ DlCompletionGraph#IRLevel., ds ); |
| 543 |
} |
| 544 |
|
| 545 |
inline void |
| 546 |
DlCompletionGraphcxx . . $ DlCompletionGraph# :: finiIRcxx . . $ DlCompletionGraph#finiIR(49f6e7a06ebc5aa8). ( void ) {} |
| 547 |
|
| 548 |
#endif // RKG_IR_IN_NODE_LABEL |
| 549 |
|
| 550 |
#endif |