| 1 |
/* |
| 2 |
* Copyright (C) 2013-2015, 2019 by the Konclude Developer Team. |
| 3 |
* |
| 4 |
* This file is part of the reasoning system Konclude. |
| 5 |
* For details and support, see <http://konclude.com/>. |
| 6 |
* |
| 7 |
* Konclude is free software: you can redistribute it and/or modify |
| 8 |
* it under the terms of version 3 of the GNU Lesser General Public |
| 9 |
* License (LGPLv3) as published by the Free Software Foundation. |
| 10 |
* |
| 11 |
* Konclude is distributed in the hope that it will be useful, |
| 12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 |
* GNU (Lesser) General Public License for more details. |
| 15 |
* |
| 16 |
* You should have received a copy of the GNU (Lesser) General Public |
| 17 |
* License along with Konclude. If not, see <http://www.gnu.org/licenses/>. |
| 18 |
* |
| 19 |
*/ |
| 20 |
|
| 21 |
#ifndef KONCLUDE_REASONER_KERNEL_ALGORITHM_CCOMPLETIONGRAPHCACHEHANDLER_H |
| 22 |
#define KONCLUDE_REASONER_KERNEL_ALGORITHM_CCOMPLETIONGRAPHCACHEHANDLER_H |
| 23 |
|
| 24 |
// Libraries includes |
| 25 |
|
| 26 |
|
| 27 |
// Namespace includes |
| 28 |
#include "AlgorithmSettings.h" |
| 29 |
#include "CCalculationAlgorithmContext.h" |
| 30 |
#include "CClashDescriptorFactory.h" |
| 31 |
#include "CTrackedClashedDescriptor.h" |
| 32 |
#include "CCalculationAlgorithmContextBase.h" |
| 33 |
#include "CIndividualNodeBackendCacheHandler.h" |
| 34 |
|
| 35 |
// Other includes |
| 36 |
#include "Reasoner/Kernel/Process/CIndividualProcessNode.h" |
| 37 |
#include "Reasoner/Kernel/Process/CClashedDependencyDescriptor.h" |
| 38 |
#include "Reasoner/Kernel/Process/CIndividualNodeSatisfiableExpandingCacheStoringData.h" |
| 39 |
|
| 40 |
#include "Reasoner/Kernel/Process/Dependency/CDependencyTrackPoint.h" |
| 41 |
|
| 42 |
#include "Reasoner/Kernel/Task/CConsistenceTaskData.h" |
| 43 |
|
| 44 |
#include "Context/CContextBase.h" |
| 45 |
|
| 46 |
// Logger includes |
| 47 |
#include "Logger/CLogger.h" |
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
namespace Konclude { |
| 52 |
|
| 53 |
using namespace Context; |
| 54 |
|
| 55 |
namespace Reasoner { |
| 56 |
|
| 57 |
namespace Kernel { |
| 58 |
|
| 59 |
using namespace Process; |
| 60 |
using namespace Dependency; |
| 61 |
using namespace Task; |
| 62 |
|
| 63 |
namespace Algorithm { |
| 64 |
|
| 65 |
/*! |
| 66 |
* |
| 67 |
* \class CCompletionGraphCacheHandler |
| 68 |
* \author Andreas Steigmiller |
| 69 |
* \version 0.1 |
| 70 |
* \brief TODO |
| 71 |
* |
| 72 |
*/ |
| 73 |
class CCompletionGraphCacheHandler { |
| 74 |
// public methods |
| 75 |
public: |
| 76 |
//! Constructor |
| 77 |
CCompletionGraphCacheHandler(CIndividualNodeBackendCacheHandler* backendCacheHandler); |
| 78 |
|
| 79 |
//! Destructor |
| 80 |
virtual ~CCompletionGraphCacheHandler(); |
| 81 |
|
| 82 |
bool isIndividualNodeCompletionGraphConsistenceBlocked(CIndividualProcessNode* individualNode, bool& conceptSetExtended, CCalculationAlgorithmContext* calcAlgContext); |
| 83 |
bool isIndividualNodeCompletionGraphConsistencePresentNonBlocked(CIndividualProcessNode* individualNode, CCalculationAlgorithmContext* calcAlgContext); |
| 84 |
|
| 85 |
bool getReactivationIndividuals(CIndividualProcessNode* individualNode, CIndividualReactivationProcessingQueue* reactProcQueue, CCalculationAlgorithmContext* calcAlgContext); |
| 86 |
|
| 87 |
// protected methods |
| 88 |
protected: |
| 89 |
bool testCompletionGraphCached(CIndividualProcessNode* individualNode, CIndividualProcessNode* detSatIndiNode, CIndividualProcessNode* compGraphCachedIndiNode, CCalculationAlgorithmContext* calcAlgContext); |
| 90 |
|
| 91 |
|
| 92 |
bool testConceptLabelExtended(CIndividualProcessNode* individualNode, CIndividualProcessNode* detSatIndiNode, CIndividualProcessNode* compGraphCachedIndiNode, CCalculationAlgorithmContext* calcAlgContext); |
| 93 |
|
| 94 |
bool testConceptLabelSubSetCompletionGraphCached(CIndividualProcessNode* individualNode, CIndividualProcessNode* detSatIndiNode, CIndividualProcessNode* compGraphCachedIndiNode, CCalculationAlgorithmContext* calcAlgContext); |
| 95 |
bool testDistinctSubSetCompletionGraphCached(CIndividualProcessNode* individualNode, CIndividualProcessNode* detSatIndiNode, CIndividualProcessNode* compGraphCachedIndiNode, CCalculationAlgorithmContext* calcAlgContext); |
| 96 |
bool testMergingSubSetCompletionGraphCached(CIndividualProcessNode* individualNode, CIndividualProcessNode* detSatIndiNode, CIndividualProcessNode* compGraphCachedIndiNode, CCalculationAlgorithmContext* calcAlgContext); |
| 97 |
bool testBindingSubSetCompletionGraphCached(CIndividualProcessNode* individualNode, CIndividualProcessNode* detSatIndiNode, CIndividualProcessNode* compGraphCachedIndiNode, CCalculationAlgorithmContext* calcAlgContext); |
| 98 |
|
| 99 |
bool testCriticalConcept(CIndividualProcessNode* individualNode, CIndividualProcessNode* detSatIndiNode, CIndividualProcessNode* compGraphCachedIndiNode, CConceptDescriptor* conDes, bool containedFlag, CCalculationAlgorithmContext* calcAlgContext); |
| 100 |
bool testCriticalB2AutomateTransitionOperands(CIndividualProcessNode* individualNode, CIndividualProcessNode* detSatIndiNode, CIndividualProcessNode* compGraphCachedIndiNode, CConcept* concept, bool conNegation, CCalculationAlgorithmContext* calcAlgContext); |
| 101 |
|
| 102 |
bool checkPropagatedConceptsMissing(CConcept* concept, bool conNegation, CIndividualProcessNode* succIndi, CConceptOperator* conOperator, CIndividualProcessNode* compGraphCachedIndiNode); |
| 103 |
|
| 104 |
bool loadConsistenceModelData(CCalculationAlgorithmContext* calcAlgContext); |
| 105 |
|
| 106 |
|
| 107 |
bool visitMergedIndividualsBackendSynchronisationData(CIndividualProcessNode* indiNode, function<bool(CIndividualProcessNode* baseIndiNode, CIndividualProcessNode* mergedDataIndiNode)> visitFunc, CCalculationAlgorithmContext* calcAlgContext); |
| 108 |
|
| 109 |
|
| 110 |
// protected variables |
| 111 |
protected: |
| 112 |
CConcreteOntology* mLastOntology; |
| 113 |
bool mLastLoadedCachedCompletionGraph; |
| 114 |
bool mPreviousConsistencyCachedCompletionGraph; |
| 115 |
CSatisfiableCalculationTask* mCalcTask; |
| 116 |
CSatisfiableCalculationTask* mDetSatCalcTask; |
| 117 |
CSatisfiableCalculationTask* mCompGraphCachedCalcTask; |
| 118 |
CIndividualProcessNodeVector* mIndiProcNodeVec; |
| 119 |
CIndividualProcessNodeVector* mDetSatProcNodeVec; |
| 120 |
CIndividualProcessNodeVector* mCompGraphCachedProcNodeVec; |
| 121 |
cint64 mDetLocalizationTag; |
| 122 |
bool mIncrementalExpansionCaching; |
| 123 |
cint64 mCurrentIncrementalExpansionID; |
| 124 |
CConfiguration* mLastConfig; |
| 125 |
|
| 126 |
|
| 127 |
CIndividualNodeBackendCacheHandler* mBackendCacheHandler; |
| 128 |
|
| 129 |
|
| 130 |
// private methods |
| 131 |
private: |
| 132 |
|
| 133 |
// private variables |
| 134 |
private: |
| 135 |
|
| 136 |
}; |
| 137 |
|
| 138 |
}; // end namespace Algorithm |
| 139 |
|
| 140 |
}; // end namespace Kernel |
| 141 |
|
| 142 |
}; // end namespace Reasoner |
| 143 |
|
| 144 |
}; // end namespace Konclude |
| 145 |
|
| 146 |
#endif // KONCLUDE_REASONER_KERNEL_ALGORITHM_CCOMPLETIONGRAPHCACHEHANDLER_H |