| 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_CLASSIFIER_COPTIMIZEDKPSETCLASSTESTINGITEM_H |
| 22 |
#define KONCLUDE_REASONER_CLASSIFIER_COPTIMIZEDKPSETCLASSTESTINGITEM_H |
| 23 |
|
| 24 |
// Libraries includes |
| 25 |
|
| 26 |
|
| 27 |
// Namespace includes |
| 28 |
#include "ClassifierSettings.h" |
| 29 |
#include "COptimizedKPSetClassPossibleSubsumptionMap.h" |
| 30 |
#include "CClassificationSatisfiablePossibleSubsumptionCalculationConceptReferenceLinking.h" |
| 31 |
#include "CClassificationClassPseudoModel.h" |
| 32 |
#include "CConceptSubsumerObserver.h" |
| 33 |
|
| 34 |
|
| 35 |
// Other includes |
| 36 |
#include "Reasoner/Ontology/CConcept.h" |
| 37 |
#include "Reasoner/Ontology/CConceptProcessData.h" |
| 38 |
#include "Reasoner/Ontology/CConceptSatisfiableReferenceLinkingData.h" |
| 39 |
|
| 40 |
#include "Reasoner/Consistiser/CIndividualDependenceTrackingMarker.h" |
| 41 |
|
| 42 |
#include "Reasoner/Taxonomy/CHierarchyNode.h" |
| 43 |
|
| 44 |
#include "Reasoner/Kernel/Cache/CCacheEntry.h" |
| 45 |
|
| 46 |
// Logger includes |
| 47 |
#include "Logger/CLogger.h" |
| 48 |
|
| 49 |
|
| 50 |
namespace Konclude { |
| 51 |
|
| 52 |
namespace Reasoner { |
| 53 |
|
| 54 |
using namespace Ontology; |
| 55 |
using namespace Taxonomy; |
| 56 |
using namespace Consistiser; |
| 57 |
using namespace Kernel::Cache; |
| 58 |
|
| 59 |
namespace Classifier { |
| 60 |
|
| 61 |
|
| 62 |
/*! |
| 63 |
* |
| 64 |
* \class COptimizedKPSetClassTestingItem |
| 65 |
* \author Andreas Steigmiller |
| 66 |
* \version 0.1 |
| 67 |
* \brief TODO |
| 68 |
* |
| 69 |
*/ |
| 70 |
class COptimizedKPSetClassTestingItem : public CClassificationSatisfiablePossibleSubsumptionCalculationConceptReferenceLinking, public CConceptSubsumerObserver, public CIndividualDependenceTrackingMarker { |
| 71 |
// public methods |
| 72 |
public: |
| 73 |
//! Constructor |
| 74 |
COptimizedKPSetClassTestingItem(); |
| 75 |
~COptimizedKPSetClassTestingItem(); |
| 76 |
|
| 77 |
|
| 78 |
COptimizedKPSetClassTestingItem* initSatisfiableTestingItem(CConcept* satTestConcept, QHash<CConcept*,CClassificationSatisfiableCalculationConceptReferenceLinking*>* conRefLinkDataHash); |
| 79 |
CConcept* getTestingConcept(); |
| 80 |
|
| 81 |
|
| 82 |
CHierarchyNode* getSatisfiableConceptHierarchyNode(); |
| 83 |
COptimizedKPSetClassTestingItem* setSatisfiableConceptHierarchyNode(CHierarchyNode* hierNode); |
| 84 |
|
| 85 |
QSet<COptimizedKPSetClassTestingItem*>* getSubsumingConceptItemSet(); |
| 86 |
QList<COptimizedKPSetClassTestingItem*>* getSubsumingConceptItemList(); |
| 87 |
cint64 getSubsumingConceptItemCount() const; |
| 88 |
bool hasSubsumerConceptItem(COptimizedKPSetClassTestingItem* item); |
| 89 |
|
| 90 |
QList<COptimizedKPSetClassTestingItem*>* getSuccessorItemList(); |
| 91 |
cint64 getUnprocessedPredecessorItemCount(); |
| 92 |
|
| 93 |
bool hasOnlyProcessedPredecessorItems(); |
| 94 |
COptimizedKPSetClassTestingItem* decUnprocessedPredecessorItems(cint64 decCount = 1); |
| 95 |
COptimizedKPSetClassTestingItem* incUnprocessedPredecessorItems(cint64 incCount = 1); |
| 96 |
COptimizedKPSetClassTestingItem* setUnprocessedPredecessorItems(cint64 predCount); |
| 97 |
|
| 98 |
COptimizedKPSetClassTestingItem* addSuccessorSatisfiableTestItem(COptimizedKPSetClassTestingItem* succItem); |
| 99 |
|
| 100 |
bool isSatisfiableTestOrdered(); |
| 101 |
bool isSatisfiableTested(); |
| 102 |
bool isResultUnsatisfiableDerivated(); |
| 103 |
bool isResultSatisfiableDerivated(); |
| 104 |
bool getSatisfiableTestedResult(); |
| 105 |
|
| 106 |
COptimizedKPSetClassTestingItem* setSatisfiableTestOrdered(bool satTestOrdered); |
| 107 |
COptimizedKPSetClassTestingItem* setSatisfiableTested(bool satTested); |
| 108 |
COptimizedKPSetClassTestingItem* setResultUnsatisfiableDerivated(bool unsatDerivated); |
| 109 |
COptimizedKPSetClassTestingItem* setResultSatisfiableDerivated(bool satDerivated); |
| 110 |
COptimizedKPSetClassTestingItem* setSatisfiableTestedResult(bool satTestedResult); |
| 111 |
|
| 112 |
|
| 113 |
COptimizedKPSetClassTestingItem* addSubsumingConceptItem(COptimizedKPSetClassTestingItem* subsumingItem); |
| 114 |
CConceptSubsumerObserver* tellConceptSupsumption(CConcept* subsumedConcept, CConcept* subsumerConcept); |
| 115 |
|
| 116 |
|
| 117 |
QList<COptimizedKPSetClassTestingItem*>* sortSubsumingConceptItemList(); |
| 118 |
|
| 119 |
bool isEquivalentItem(); |
| 120 |
COptimizedKPSetClassTestingItem* setEquivalentItem(bool equivalent); |
| 121 |
|
| 122 |
bool isPredecessorItem(); |
| 123 |
COptimizedKPSetClassTestingItem* setPredecessorItem(bool isPredecessorOfOneItem); |
| 124 |
|
| 125 |
bool isMoreConceptClassificationInformationRequired(); |
| 126 |
|
| 127 |
COptimizedKPSetClassPossibleSubsumptionMap* getPossibleSubsumptionMap(bool create = false); |
| 128 |
|
| 129 |
|
| 130 |
QSet<COptimizedKPSetClassTestingItem*>* getUpPropagationItemSet(); |
| 131 |
QSet<COptimizedKPSetClassTestingItem*>* getDownPropagationItemSet(); |
| 132 |
COptimizedKPSetClassTestingItem* addUpPropagationItem(COptimizedKPSetClassTestingItem* item); |
| 133 |
COptimizedKPSetClassTestingItem* addDownPropagationItem(COptimizedKPSetClassTestingItem* item); |
| 134 |
bool isPropagationConnected(); |
| 135 |
COptimizedKPSetClassTestingItem* setPropagationConnected(bool connected); |
| 136 |
|
| 137 |
|
| 138 |
virtual CClassPossibleSubsumptionMap* getClassPossibleSubsumptionMap(); |
| 139 |
bool isPossibleSubsumptionMapInitialized(); |
| 140 |
COptimizedKPSetClassTestingItem* setPossibleSubsumptionMapInitialized(bool initialized); |
| 141 |
|
| 142 |
CClassificationClassPseudoModel* getClassPseudoModel(); |
| 143 |
bool isClassPseudoModelInitalized(); |
| 144 |
COptimizedKPSetClassTestingItem* setClassPseudoModelInitalized(bool initialized); |
| 145 |
|
| 146 |
|
| 147 |
|
| 148 |
QSet<COptimizedKPSetClassTestingItem*>* getPossibleSubsumedSet(bool create); |
| 149 |
QList<COptimizedKPSetClassTestingItem*>* getPossibleSubsumedList(); |
| 150 |
COptimizedKPSetClassTestingItem* setPossibleSubsumedList(QList<COptimizedKPSetClassTestingItem*>* possSubsumedList); |
| 151 |
bool hasRemainingPossibleSubsumedItems(); |
| 152 |
|
| 153 |
|
| 154 |
|
| 155 |
|
| 156 |
CCacheEntry* getFastSatisfiabilityTestedSaturationCacheEntry(); |
| 157 |
COptimizedKPSetClassTestingItem* setFastSatisfiabilityTestedSaturationCacheEntry(CCacheEntry* cacheEntry); |
| 158 |
|
| 159 |
bool hasSuccessfullyFastSatisfiabilityTested(); |
| 160 |
COptimizedKPSetClassTestingItem* setSuccessfullyFastSatisfiabilityTested(bool successfullyTested); |
| 161 |
|
| 162 |
virtual CIndividualDependenceTrackingMarker* setIndividualDependenceTracked(); |
| 163 |
bool hasIndividualDependenceTracked(); |
| 164 |
|
| 165 |
// protected methods |
| 166 |
protected: |
| 167 |
|
| 168 |
// protected variables |
| 169 |
protected: |
| 170 |
CConcept* mConceptSat; |
| 171 |
CHierarchyNode* mConSatHierNode; |
| 172 |
|
| 173 |
QSet<COptimizedKPSetClassTestingItem*> mSubsumingConceptItemSet; |
| 174 |
QList<COptimizedKPSetClassTestingItem*> mSubsumingConceptItemList; |
| 175 |
|
| 176 |
QList<COptimizedKPSetClassTestingItem*> mSuccList; |
| 177 |
cint64 mPredCounter; |
| 178 |
|
| 179 |
// true, if the satisfiability testing for this concept has started |
| 180 |
bool mSatTestOrdered; |
| 181 |
// true, if the satisfiability testing has finished |
| 182 |
bool mTestedSat; |
| 183 |
// true, if for a super concept the unsatisfiability has been discovered |
| 184 |
bool mUnsatDerivated; |
| 185 |
// true, if for the concept the satisfiability has been extracted from a completion graph |
| 186 |
bool mSatDerivated; |
| 187 |
// true of false if the concept is satisfiable respectively unsatisfiable |
| 188 |
bool mSatTestedResult; |
| 189 |
|
| 190 |
bool mPropagationConnected; |
| 191 |
QSet<COptimizedKPSetClassTestingItem*> mUpPropagationItemSet; |
| 192 |
QSet<COptimizedKPSetClassTestingItem*> mDownPropagationItemSet; |
| 193 |
|
| 194 |
|
| 195 |
QSet<COptimizedKPSetClassTestingItem*>* mPossibleSubsumedSet; |
| 196 |
QList<COptimizedKPSetClassTestingItem*>* mPossibleSubsumedList; |
| 197 |
|
| 198 |
|
| 199 |
bool mEquiItem; |
| 200 |
bool mPredOfItem; |
| 201 |
|
| 202 |
COptimizedKPSetClassPossibleSubsumptionMap* mPossibleSubsumptionMap; |
| 203 |
bool mPossSubsumMapInitialized; |
| 204 |
|
| 205 |
//QString mSubsumingConceptString; |
| 206 |
CClassificationClassPseudoModel mPseudoModel; |
| 207 |
bool mPseudoModelInitialized; |
| 208 |
|
| 209 |
CCacheEntry* mFastSatCacheEntry; |
| 210 |
bool mSuccFastSatTested; |
| 211 |
|
| 212 |
bool mIndiDepTracked; |
| 213 |
|
| 214 |
QHash<CConcept*,CClassificationSatisfiableCalculationConceptReferenceLinking*>* mConRefLinkDataHash; |
| 215 |
|
| 216 |
// private methods |
| 217 |
private: |
| 218 |
|
| 219 |
// private variables |
| 220 |
private: |
| 221 |
|
| 222 |
}; |
| 223 |
|
| 224 |
}; // end namespace Classifier |
| 225 |
|
| 226 |
}; // end namespace Reasoner |
| 227 |
|
| 228 |
}; // end namespace Konclude |
| 229 |
|
| 230 |
#endif // KONCLUDE_REASONER_CLASSIFIER_COPTIMIZEDKPSETCLASSTESTINGITEM_H |