| 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 |
#include "CSatisfiableCalculationJob.h" |
| 22 |
|
| 23 |
|
| 24 |
namespace Konclude { |
| 25 |
|
| 26 |
namespace Reasoner { |
| 27 |
|
| 28 |
namespace Query { |
| 29 |
|
| 30 |
|
| 31 |
CSatisfiableCalculationJob::CSatisfiableCalculationJob() { |
| 32 |
mQueryData = nullptr; |
| 33 |
mSatCalcConstructLinker = nullptr; |
| 34 |
mCalculationConfiguration = nullptr; |
| 35 |
mCalclulationStatisticsCollector = nullptr; |
| 36 |
mPreyingAdapter = nullptr; |
| 37 |
mSatClassMessAdapter = nullptr; |
| 38 |
mJobInstantiation = nullptr; |
| 39 |
mAllowNonDeterministicSatisfiableCalculationContinuation = false; |
| 40 |
mRealMarkCandMessAdapter = nullptr; |
| 41 |
mSatIncConsTestingAdapter = nullptr; |
| 42 |
mSatIndDepTrackAdapter = nullptr; |
| 43 |
mPossAssCollAdapter = nullptr; |
| 44 |
mClassRoleMarkedMessageAdapter = nullptr; |
| 45 |
mAnswererSubsumptionMessageAdapter = nullptr; |
| 46 |
mAnswererInstancePropagationMessageAdapter = nullptr; |
| 47 |
mRepresentativeBackendUpdatingAdapter = nullptr; |
| 48 |
mAnswererMaterializationAdapter = nullptr; |
| 49 |
mCancellationAdapter = nullptr; |
| 50 |
mAnswererBindingPropagationAdapter = nullptr; |
| 51 |
mSatisfiablePossibleInstancesMergingAdapter = nullptr; |
| 52 |
mNextRelativeNodeID = 0; |
| 53 |
} |
| 54 |
|
| 55 |
|
| 56 |
CSatisfiableCalculationJob::~CSatisfiableCalculationJob() { |
| 57 |
delete mQueryData; |
| 58 |
CSatisfiableCalculationConstruct* satCalcConstructLinkerIt = mSatCalcConstructLinker; |
| 59 |
while (satCalcConstructLinkerIt) { |
| 60 |
CSatisfiableCalculationConstruct* tmpLinker = satCalcConstructLinkerIt; |
| 61 |
satCalcConstructLinkerIt = satCalcConstructLinkerIt->getNext(); |
| 62 |
delete tmpLinker; |
| 63 |
} |
| 64 |
} |
| 65 |
|
| 66 |
CCalculationJobQueryData* CSatisfiableCalculationJob::getQueryData() { |
| 67 |
return mQueryData; |
| 68 |
} |
| 69 |
|
| 70 |
CSatisfiableCalculationJob* CSatisfiableCalculationJob::setQueryData(CCalculationJobQueryData* takeQueryData) { |
| 71 |
delete mQueryData; |
| 72 |
mQueryData = takeQueryData; |
| 73 |
return this; |
| 74 |
} |
| 75 |
|
| 76 |
CSatisfiableCalculationJob* CSatisfiableCalculationJob::addSatisfiableCalculationConstruct(CSatisfiableCalculationConstruct* takeSatCalcConstruct) { |
| 77 |
if (takeSatCalcConstruct) { |
| 78 |
mSatCalcConstructLinker = takeSatCalcConstruct->append(mSatCalcConstructLinker); |
| 79 |
} |
| 80 |
return this; |
| 81 |
} |
| 82 |
|
| 83 |
CSatisfiableCalculationConstruct* CSatisfiableCalculationJob::getSatisfiableCalculationConstructs() { |
| 84 |
return mSatCalcConstructLinker; |
| 85 |
} |
| 86 |
|
| 87 |
CSatisfiableCalculationJob* CSatisfiableCalculationJob::setCalculationConfiguration(CCalculationConfigurationExtension *calculationConfiguration) { |
| 88 |
mCalculationConfiguration = calculationConfiguration; |
| 89 |
return this; |
| 90 |
} |
| 91 |
|
| 92 |
CCalculationConfigurationExtension* CSatisfiableCalculationJob::getCalculationConfiguration() { |
| 93 |
return mCalculationConfiguration; |
| 94 |
} |
| 95 |
|
| 96 |
CConfigurationBase* CSatisfiableCalculationJob::getConfiguration() { |
| 97 |
return mCalculationConfiguration; |
| 98 |
} |
| 99 |
|
| 100 |
CSatisfiableCalculationJob* CSatisfiableCalculationJob::setCalclulationStatisticsCollector(CCalculationStatisticsCollector* calclulationStatisticsCollector) { |
| 101 |
mCalclulationStatisticsCollector = calclulationStatisticsCollector; |
| 102 |
return this; |
| 103 |
} |
| 104 |
|
| 105 |
CCalculationStatisticsCollector* CSatisfiableCalculationJob::getCalclulationStatisticsCollector() { |
| 106 |
return mCalclulationStatisticsCollector; |
| 107 |
} |
| 108 |
|
| 109 |
CSatisfiableCalculationJob* CSatisfiableCalculationJob::setSatisfiableTaskPreyingAdapter(CTaskPreyingAdapter* preyingAdapter) { |
| 110 |
mPreyingAdapter = preyingAdapter; |
| 111 |
return this; |
| 112 |
} |
| 113 |
|
| 114 |
CTaskPreyingAdapter* CSatisfiableCalculationJob::getSatisfiableTaskPreyingAdapter() { |
| 115 |
return mPreyingAdapter; |
| 116 |
} |
| 117 |
|
| 118 |
|
| 119 |
CSatisfiableCalculationJob* CSatisfiableCalculationJob::setSatisfiableClassificationMessageAdapter(CSatisfiableTaskClassificationMessageAdapter* classMessObserver) { |
| 120 |
mSatClassMessAdapter = classMessObserver; |
| 121 |
return this; |
| 122 |
} |
| 123 |
|
| 124 |
CSatisfiableTaskClassificationMessageAdapter* CSatisfiableCalculationJob::getSatisfiableClassificationMessageAdapter() { |
| 125 |
return mSatClassMessAdapter; |
| 126 |
} |
| 127 |
|
| 128 |
|
| 129 |
CSatisfiableCalculationJobInstantiation* CSatisfiableCalculationJob::getConsecutivelyCalculationJobInstantiation() { |
| 130 |
return mJobInstantiation; |
| 131 |
} |
| 132 |
|
| 133 |
CSatisfiableCalculationJob* CSatisfiableCalculationJob::setConsecutivelyCalculationJobInstantiation(CSatisfiableCalculationJobInstantiation* jobInstantiation) { |
| 134 |
mJobInstantiation = jobInstantiation; |
| 135 |
return this; |
| 136 |
} |
| 137 |
|
| 138 |
|
| 139 |
bool CSatisfiableCalculationJob::allowNonDeterministicSatisfiableCalculationContinuation() { |
| 140 |
return mAllowNonDeterministicSatisfiableCalculationContinuation; |
| 141 |
} |
| 142 |
|
| 143 |
CSatisfiableCalculationJob* CSatisfiableCalculationJob::setAllowNonDeterministicSatisfiableCalculationContinuation(bool allow) { |
| 144 |
mAllowNonDeterministicSatisfiableCalculationContinuation = allow; |
| 145 |
return this; |
| 146 |
} |
| 147 |
|
| 148 |
|
| 149 |
cint64 CSatisfiableCalculationJob::getNextRelativeNodeID(bool moveNext) { |
| 150 |
return mNextRelativeNodeID; |
| 151 |
} |
| 152 |
|
| 153 |
|
| 154 |
CSatisfiableCalculationJob* CSatisfiableCalculationJob::setRealizationMarkedCandidatesMessageAdapter(CSatisfiableTaskRealizationMarkedCandidatesMessageAdapter* realMessObserver) { |
| 155 |
mRealMarkCandMessAdapter = realMessObserver; |
| 156 |
return this; |
| 157 |
} |
| 158 |
|
| 159 |
CSatisfiableTaskRealizationMarkedCandidatesMessageAdapter* CSatisfiableCalculationJob::getRealizationMarkedCandidatesMessageAdapter() { |
| 160 |
return mRealMarkCandMessAdapter; |
| 161 |
} |
| 162 |
|
| 163 |
CSatisfiableCalculationJob* CSatisfiableCalculationJob::setSatisfiableTaskIncrementalConsistencyTestingAdapter(CSatisfiableTaskIncrementalConsistencyTestingAdapter* incConsTestAdaptor) { |
| 164 |
mSatIncConsTestingAdapter = incConsTestAdaptor; |
| 165 |
return this; |
| 166 |
} |
| 167 |
|
| 168 |
CSatisfiableTaskIncrementalConsistencyTestingAdapter* CSatisfiableCalculationJob::getSatisfiableTaskIncrementalConsistencyTestingAdapter() { |
| 169 |
return mSatIncConsTestingAdapter; |
| 170 |
} |
| 171 |
|
| 172 |
CSatisfiableCalculationJob* CSatisfiableCalculationJob::setSatisfiableTaskIndividualDependenceTrackingAdapter(CSatisfiableTaskIndividualDependenceTrackingAdapter* indDepTrackAdaptor) { |
| 173 |
mSatIndDepTrackAdapter = indDepTrackAdaptor; |
| 174 |
return this; |
| 175 |
} |
| 176 |
|
| 177 |
CSatisfiableTaskIndividualDependenceTrackingAdapter* CSatisfiableCalculationJob::getSatisfiableTaskIndividualDependenceTrackingAdapter() { |
| 178 |
return mSatIndDepTrackAdapter; |
| 179 |
} |
| 180 |
|
| 181 |
CSatisfiableCalculationJob* CSatisfiableCalculationJob::setPossibleAssertionCollectionAdapter(CSatisfiableTaskRealizationPossibleAssertionCollectingAdapter* possAssCollAdapter) { |
| 182 |
mPossAssCollAdapter = possAssCollAdapter; |
| 183 |
return this; |
| 184 |
} |
| 185 |
|
| 186 |
CSatisfiableTaskRealizationPossibleAssertionCollectingAdapter* CSatisfiableCalculationJob::getPossibleAssertionCollectionAdapter() { |
| 187 |
return mPossAssCollAdapter; |
| 188 |
} |
| 189 |
|
| 190 |
CSatisfiableCalculationJob* CSatisfiableCalculationJob::setSatisfiableClassificationRoleMarkedMessageAdapter(CSatisfiableTaskClassificationRoleMarkedMessageAdapter* classRoleMarkedMessageAdapter) { |
| 191 |
mClassRoleMarkedMessageAdapter = classRoleMarkedMessageAdapter; |
| 192 |
return this; |
| 193 |
} |
| 194 |
|
| 195 |
CSatisfiableTaskClassificationRoleMarkedMessageAdapter* CSatisfiableCalculationJob::getSatisfiableClassificationRoleMarkedMessageAdapter() { |
| 196 |
return mClassRoleMarkedMessageAdapter; |
| 197 |
} |
| 198 |
|
| 199 |
CSatisfiableCalculationJob* CSatisfiableCalculationJob::setSatisfiableAnswererSubsumptionMessageAdapter(CSatisfiableTaskAnswererSubsumptionMessageAdapter* answererMessageAdapter) { |
| 200 |
mAnswererSubsumptionMessageAdapter = answererMessageAdapter; |
| 201 |
return this; |
| 202 |
} |
| 203 |
|
| 204 |
CSatisfiableTaskAnswererSubsumptionMessageAdapter* CSatisfiableCalculationJob::getSatisfiableAnswererSubsumptionMessageAdapter() { |
| 205 |
return mAnswererSubsumptionMessageAdapter; |
| 206 |
} |
| 207 |
|
| 208 |
CSatisfiableCalculationJob* CSatisfiableCalculationJob::setSatisfiableAnswererBindingPropagationAdapter(CSatisfiableTaskAnswererBindingPropagationAdapter* answererMessageAdapter) { |
| 209 |
mAnswererBindingPropagationAdapter = answererMessageAdapter; |
| 210 |
return this; |
| 211 |
} |
| 212 |
|
| 213 |
CSatisfiableTaskAnswererBindingPropagationAdapter* CSatisfiableCalculationJob::getSatisfiableAnswererBindingPropagationAdapter() { |
| 214 |
return mAnswererBindingPropagationAdapter; |
| 215 |
} |
| 216 |
|
| 217 |
|
| 218 |
CSatisfiableCalculationJob* CSatisfiableCalculationJob::setSatisfiablePossibleInstancesMergingAdapter(CSatisfiableTaskRealizationPossibleInstancesMergingAdapter* possInstMergingAdapter) { |
| 219 |
mSatisfiablePossibleInstancesMergingAdapter = possInstMergingAdapter; |
| 220 |
return this; |
| 221 |
} |
| 222 |
|
| 223 |
CSatisfiableTaskRealizationPossibleInstancesMergingAdapter* CSatisfiableCalculationJob::getSatisfiablePossibleInstancesMergingAdapter() { |
| 224 |
return mSatisfiablePossibleInstancesMergingAdapter; |
| 225 |
} |
| 226 |
|
| 227 |
|
| 228 |
CSatisfiableCalculationJob* CSatisfiableCalculationJob::setSatisfiableAnswererInstancePropagationMessageAdapter(CSatisfiableTaskAnswererInstancePropagationMessageAdapter* answererMessageAdapter) { |
| 229 |
mAnswererInstancePropagationMessageAdapter = answererMessageAdapter; |
| 230 |
return this; |
| 231 |
} |
| 232 |
|
| 233 |
CSatisfiableTaskAnswererInstancePropagationMessageAdapter* CSatisfiableCalculationJob::getSatisfiableAnswererInstancePropagationMessageAdapter() { |
| 234 |
return mAnswererInstancePropagationMessageAdapter; |
| 235 |
} |
| 236 |
|
| 237 |
|
| 238 |
CSatisfiableCalculationJob* CSatisfiableCalculationJob::setSatisfiableRepresentativeBackendCacheUpdatingAdapter(CSatisfiableTaskRepresentativeBackendUpdatingAdapter* representativeBackendUpdatingAdapter) { |
| 239 |
mRepresentativeBackendUpdatingAdapter = representativeBackendUpdatingAdapter; |
| 240 |
return this; |
| 241 |
} |
| 242 |
|
| 243 |
CSatisfiableTaskRepresentativeBackendUpdatingAdapter* CSatisfiableCalculationJob::getSatisfiableRepresentativeBackendCacheUpdatingAdapter() { |
| 244 |
return mRepresentativeBackendUpdatingAdapter; |
| 245 |
} |
| 246 |
|
| 247 |
|
| 248 |
CSatisfiableCalculationJob* CSatisfiableCalculationJob::setSatisfiableAnswererMaterializationAdapter(CSatisfiableTaskAnswererQueryingMaterializationAdapter* representativeBackendUpdatingAdapter) { |
| 249 |
mAnswererMaterializationAdapter = representativeBackendUpdatingAdapter; |
| 250 |
return this; |
| 251 |
} |
| 252 |
|
| 253 |
CSatisfiableTaskAnswererQueryingMaterializationAdapter* CSatisfiableCalculationJob::getSatisfiableAnswererMaterializationAdapter() { |
| 254 |
return mAnswererMaterializationAdapter; |
| 255 |
} |
| 256 |
|
| 257 |
|
| 258 |
CSatisfiableCalculationJob* CSatisfiableCalculationJob::setCancellationAdapter(CSatisfiableTaskCancellationAdapter* cancelAdapter) { |
| 259 |
mCancellationAdapter = cancelAdapter; |
| 260 |
return this; |
| 261 |
} |
| 262 |
|
| 263 |
CSatisfiableTaskCancellationAdapter* CSatisfiableCalculationJob::getCancellationAdapter() { |
| 264 |
return mCancellationAdapter; |
| 265 |
} |
| 266 |
|
| 267 |
|
| 268 |
}; // end namespace Query |
| 269 |
|
| 270 |
}; // end namespace Reasoner |
| 271 |
|
| 272 |
}; // end namespace Konclude |