| 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_CDATATYPEINDIVIDUALPROCESSNODEHANDLER_H |
| 22 |
#define KONCLUDE_REASONER_KERNEL_ALGORITHM_CDATATYPEINDIVIDUALPROCESSNODEHANDLER_H |
| 23 |
|
| 24 |
// Libraries includes |
| 25 |
|
| 26 |
|
| 27 |
// Namespace includes |
| 28 |
#include "AlgorithmSettings.h" |
| 29 |
#include "CCalculationAlgorithmContext.h" |
| 30 |
#include "CCalculationClashProcessingException.h" |
| 31 |
#include "CIndividualProcessNodeValueSpaceHandler.h" |
| 32 |
#include "CIndividualProcessNodeRealValueSpaceHandler.h" |
| 33 |
#include "CIndividualProcessNodeUnknownValueSpaceHandler.h" |
| 34 |
#include "CIndividualProcessNodeStringValueSpaceHandler.h" |
| 35 |
#include "CIndividualProcessNodeBooleanValueSpaceHandler.h" |
| 36 |
#include "CIndividualProcessNodeDoubleValueSpaceHandler.h" |
| 37 |
#include "CIndividualProcessNodeFloatValueSpaceHandler.h" |
| 38 |
#include "CIndividualProcessNodeIRIValueSpaceHandler.h" |
| 39 |
#include "CIndividualProcessNodeXMLValueSpaceHandler.h" |
| 40 |
#include "CIndividualProcessNodeBinaryBase64DataValueSpaceHandler.h" |
| 41 |
#include "CIndividualProcessNodeBinaryHexDataValueSpaceHandler.h" |
| 42 |
#include "CIndividualProcessNodeDateTimeValueSpaceHandler.h" |
| 43 |
#include "CDatatypeDependencyCollection.h" |
| 44 |
#include "CDependencyFactory.h" |
| 45 |
|
| 46 |
// Other includes |
| 47 |
#include "Reasoner/Kernel/Process/CIndividualProcessNode.h" |
| 48 |
#include "Reasoner/Kernel/Process/CClashedDatatypeValueSpaceExclusionDescriptor.h" |
| 49 |
|
| 50 |
#include "Reasoner/Kernel/Process/Dependency/CDependencyTrackPoint.h" |
| 51 |
|
| 52 |
#include "Context/CContextBase.h" |
| 53 |
|
| 54 |
// Logger includes |
| 55 |
#include "Logger/CLogger.h" |
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
namespace Konclude { |
| 60 |
|
| 61 |
using namespace Context; |
| 62 |
|
| 63 |
namespace Reasoner { |
| 64 |
|
| 65 |
namespace Kernel { |
| 66 |
|
| 67 |
using namespace Process; |
| 68 |
using namespace Dependency; |
| 69 |
|
| 70 |
namespace Algorithm { |
| 71 |
|
| 72 |
/*! |
| 73 |
* |
| 74 |
* \class CDatatypeIndividualProcessNodeHandler |
| 75 |
* \author Andreas Steigmiller |
| 76 |
* \version 0.1 |
| 77 |
* \brief TODO |
| 78 |
* |
| 79 |
*/ |
| 80 |
class CDatatypeIndividualProcessNodeHandler { |
| 81 |
// public methods |
| 82 |
public: |
| 83 |
//! Constructor |
| 84 |
CDatatypeIndividualProcessNodeHandler(); |
| 85 |
|
| 86 |
//! Destructor |
| 87 |
virtual ~CDatatypeIndividualProcessNodeHandler(); |
| 88 |
|
| 89 |
|
| 90 |
bool triggerDataLiteralConcept(CIndividualProcessNode* indiProcNode, CDataLiteral* dataLiteral, bool negated, CDependencyTrackPoint* depTrackPoint, CConcept* triggerConcept, CConceptDescriptor*& triggeredConcepts, CCalculationAlgorithmContext* calcAlgContext); |
| 91 |
bool triggerDatatypeConcept(CIndividualProcessNode* indiProcNode, CDatatype* datatype, bool negated, CDependencyTrackPoint* depTrackPoint, CConcept* triggerConcept, CConceptDescriptor*& triggeredConcepts, CCalculationAlgorithmContext* calcAlgContext); |
| 92 |
bool triggerDataRestrictionConcept(CIndividualProcessNode* indiProcNode, CConcept* dataRestriction, bool negated, CDependencyTrackPoint* depTrackPoint, CConcept* triggerConcept, CConceptDescriptor*& triggeredConcepts, CCalculationAlgorithmContext* calcAlgContext); |
| 93 |
|
| 94 |
|
| 95 |
bool addDataLiteral(CIndividualProcessNode* indiProcNode, CDataLiteral* dataLiteral, bool negated, CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContext* calcAlgContext); |
| 96 |
|
| 97 |
|
| 98 |
bool addDataRestriction(CIndividualProcessNode* indiProcNode, CConcept* dataRestricionConcept, bool negated, CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContext* calcAlgContext); |
| 99 |
|
| 100 |
|
| 101 |
bool addDatatype(CIndividualProcessNode* indiProcNode, CConcept* datatypeConcept, bool negated, CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContext* calcAlgContext); |
| 102 |
|
| 103 |
|
| 104 |
bool triggerValueSpaceConcepts(CIndividualProcessNode* indiProcNode, CConceptDescriptor*& triggeredConcepts, CCalculationAlgorithmContext* calcAlgContext); |
| 105 |
|
| 106 |
|
| 107 |
bool involveDistinctNodeForSatisfiabilityChecking(CIndividualProcessNode* indiProcNode, CCalculationAlgorithmContext* calcAlgContext); |
| 108 |
bool requiresSatisfiabilityChecking(CIndividualProcessNode* indiProcNode, CCalculationAlgorithmContext* calcAlgContext); |
| 109 |
|
| 110 |
bool checkSatisfiability(CIndividualProcessNode* indiProcNode, CPROCESSINGSET<CIndividualProcessNode*>* distinctIndividualNodeSet, CCalculationAlgorithmContext* calcAlgContext); |
| 111 |
|
| 112 |
bool notifyDistinctChanges(CIndividualProcessNode* indiProcNode, CCalculationAlgorithmContext* calcAlgContext); |
| 113 |
|
| 114 |
// protected methods |
| 115 |
protected: |
| 116 |
|
| 117 |
void throwDatatypeValueSpaceExclusionClash(CClashedDependencyDescriptor* depDesLinker, CIndividualProcessNode* indiProcNode, CCalculationAlgorithmContext* calcAlgContext); |
| 118 |
|
| 119 |
|
| 120 |
CIndividualProcessNodeValueSpaceHandler* getValueSpaceHandler(CDatatypeValueSpaceType* valueSpaceType, CCalculationAlgorithmContext* calcAlgContext); |
| 121 |
|
| 122 |
CClashedDependencyDescriptor* createClashedDependencyDescriptor(CClashedDependencyDescriptor* appendDepDesLinker, CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContext* calcAlgContext); |
| 123 |
CClashedDependencyDescriptor* copyClashedDependencyDescriptors(CClashedDependencyDescriptor* appendDepDesLinker, CClashedDependencyDescriptor* copyDepDesLinker, CCalculationAlgorithmContext* calcAlgContext); |
| 124 |
|
| 125 |
bool processValueSpaceModified(CIndividualProcessNode* indiProcNode, CCalculationAlgorithmContext* calcAlgContext); |
| 126 |
|
| 127 |
cint64 getDisjointCount(CIndividualProcessNode* indiProcNode, CCalculationAlgorithmContext* calcAlgContext); |
| 128 |
|
| 129 |
|
| 130 |
bool closeOtherValueSpaces(CIndividualProcessNode* indiProcNode, CDatatypeValueSpaceType* exceptionValueSpaceType, CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContext* calcAlgContext); |
| 131 |
bool closeValueSpace(CIndividualProcessNode* indiProcNode, CDatatypeValueSpaceType* closeValueSpaceType, CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContext* calcAlgContext); |
| 132 |
|
| 133 |
bool testAllValueSpacesClashed(CIndividualProcessNode* indiProcNode, CCalculationAlgorithmContext* calcAlgContext); |
| 134 |
|
| 135 |
CConceptDescriptor* triggerValueSpaceConcepts(CIndividualProcessNode* indiProcNode, CConceptDescriptor* appendConceptLinker, cint64& remainingRequiredValuesCount, CDatatypeValueSpaceData* valueSpaceData, CDatatypeValueSpaceType* valueSpaceType, CDatatypeDependencyCollection* depCollection, CCalculationAlgorithmContext* calcAlgContext); |
| 136 |
|
| 137 |
bool addValueSpacesDependencies(CIndividualProcessNode* indiProcNode, CDatatypeValueSpaceDependencyCollector* depCollection, CCalculationAlgorithmContext* calcAlgContext); |
| 138 |
|
| 139 |
bool addValueSpaceDependencies(CIndividualProcessNode* indiProcNode, CDatatypeValueSpaceData* valueSpaceData, CDatatypeValueSpaceType* valueSpaceType, CDatatypeValueSpaceDependencyCollector* depCollection, CCalculationAlgorithmContext* calcAlgContext); |
| 140 |
|
| 141 |
|
| 142 |
bool countPossibleValues(CIndividualProcessNode* indiProcNode, CDatatypeValueSpaceValuesCounter* valuesCounter, CCalculationAlgorithmContext* calcAlgContext); |
| 143 |
|
| 144 |
|
| 145 |
bool seachNextPossibleDataValue(CIndividualProcessNode* indiProcNode, CDataLiteralValue*& nextValue, CDatatypeValueSpaceType*& nextValueSpaceType, CDataLiteralValue* lastValue, CDatatypeValueTestingCollection* valueTestingCollection, CCalculationAlgorithmContext* calcAlgContext); |
| 146 |
|
| 147 |
bool addDistinctDependencies(CIndividualProcessNode* indiProcNode, CDatatypeValueSpaceDependencyCollector* depCollection, CCalculationAlgorithmContext* calcAlgContext); |
| 148 |
|
| 149 |
|
| 150 |
bool areOtherValueSpacesClosed(CIndividualProcessNode* indiProcNode, CDatatypeValueSpaceType* openValueSpaceType, CCalculationAlgorithmContext* calcAlgContext); |
| 151 |
CDatatypeDependencyCollection* addClosedValueSpacedDependencies(CIndividualProcessNode* indiProcNode, CDatatypeDependencyCollection* depCollection, CCalculationAlgorithmContext* calcAlgContext); |
| 152 |
|
| 153 |
|
| 154 |
// protected variables |
| 155 |
protected: |
| 156 |
bool mConfBuildDependencies; |
| 157 |
|
| 158 |
CIndividualProcessNodeValueSpaceHandler* mValueSpaceHandlerArray[CDatatypeValueSpaceType::VALUESPACETYPECOUNT]; |
| 159 |
|
| 160 |
|
| 161 |
// private methods |
| 162 |
private: |
| 163 |
|
| 164 |
// private variables |
| 165 |
private: |
| 166 |
|
| 167 |
}; |
| 168 |
|
| 169 |
}; // end namespace Algorithm |
| 170 |
|
| 171 |
}; // end namespace Kernel |
| 172 |
|
| 173 |
}; // end namespace Reasoner |
| 174 |
|
| 175 |
}; // end namespace Konclude |
| 176 |
|
| 177 |
#endif // KONCLUDE_REASONER_KERNEL_ALGORITHM_CDATATYPEINDIVIDUALPROCESSNODEHANDLER_H |