Debian Codegraph @

Source/Reasoner/Consistiser/CIncrementalPrecomputationThread.h

raw
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_CONSISTISER_CINCREMENTALPRECOMPUTATIONTHREAD_H
22 #define KONCLUDE_REASONER_CONSISTISER_CINCREMENTALPRECOMPUTATIONTHREAD_H
23
24 // Libraries includes
25 #include <QStack>
26 #include <QListIterator>
27
28
29 // Namespace includes
30 #include "ConsistiserSettings.h"
31 #include "CPrecomputationThread.h"
32 #include "CPrecomputationTestingItem.h"
33 #include "CIncrementalConsistencePrecomputationTestingItem.h"
34 #include "CIncrementalOntologyPrecomputationItem.h"
35
36 // Other includes
37 #include "Reasoner/Kernel/Manager/CReasonerManager.h"
38
39 #include "Reasoner/Kernel/Cache/CReuseCompletionGraphCacheWriter.h"
40 #include "Reasoner/Kernel/Cache/CReuseCompletionGraphCacheEntryExpandWriteData.h"
41 #include "Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCache.h"
42
43 #include "Reasoner/Kernel/Task/CCalculationConfigurationExtension.h"
44 #include "Reasoner/Kernel/Task/CIncrementalConsistenceTaskData.h"
45
46 #include "Reasoner/Generator/CSatisfiableCalculationJobGenerator.h"
47
48 #include "Utilities/Memory/CTempMemoryPoolContainerAllocationManager.h"
49
50 // Logger includes
51 #include "Logger/CLogger.h"
52 #include "Logger/CLogIdentifier.h"
53
54
55 namespace Konclude {
56
57 using namespace Utilities::Memory;
58
59 namespace Reasoner {
60
61 using namespace Kernel::Task;
62 using namespace Kernel::Manager;
63 using namespace Kernel::Cache;
64 using namespace Generator;
65
66 namespace Consistiser {
67
68 using namespace Events;
69
70
71
72 /*!
73 *
74 * \class CIncrementalPrecomputationThread
75 * \author Andreas Steigmiller
76 * \version 0.1
77 * \brief TODO
78 *
79 */
80 class CIncrementalPrecomputationThread : public CPrecomputationThread, public CLogIdentifier {
81 // public methods
82 public:
83 //! Constructor
84 CIncrementalPrecomputationThread(CReasonerManager* reasonerManager);
85
86 //! Destructor
87 virtual ~CIncrementalPrecomputationThread();
88
89
90 // protected methods
91 protected:
92 virtual COntologyPrecomputationItem* initializeOntologyPrecomputionItem(CConcreteOntology* ontology, CConfigurationBase* config);
93
94 virtual bool createNextTest();
95
96 virtual bool finishOntologyPrecomputation(CIncrementalOntologyPrecomputationItem* incPreCompItem);
97 virtual bool precomputationTested(COntologyPrecomputationItem* ontPreCompItem, CPrecomputationTestingItem* preTestItem, CPrecomputationCalculatedCallbackEvent* pcce);
98 virtual bool precomputationTested(COntologyPrecomputationItem* ontPreCompItem, CPrecomputationTestingItem* preTestItem, CSaturationPrecomputationCalculatedCallbackEvent* pcce);
99
100 bool createIndividualPrecomputationCheck(CIncrementalOntologyPrecomputationItem* incPreCompItem);
101 bool createConsistencePrecomputationCheck(CIncrementalOntologyPrecomputationItem* incPreCompItem);
102
103 CConcreteOntology* getLastConsistentlyTestedOntologyVersion(CIncrementalOntologyPrecomputationItem* incPreCompItem);
104 QSet<CIndividual*>* getDirectlyChangedIndividuals(CConcreteOntology* lastOntologyVersion, CIncrementalOntologyPrecomputationItem* incPreCompItem);
105 QSet<CIndividual*>* getDirectlyChangedIndividualsFromLastConsistentlyTestedOntology(CIncrementalOntologyPrecomputationItem* incPreCompItem);
106
107 virtual bool precomputationIndividualsRetrieved(COntologyPrecomputationItem* ontPreCompItem, CRetrievedPrecomputationIndividualsCallbackEvent* pcce);
108
109 bool logIncrementalReasoningInfos(CIncrementalOntologyPrecomputationItem* incPreCompItem);
110
111 // protected variables
112 protected:
113 CReuseCompletionGraphCacheWriter* mReuseCompletionGraphCacheWriter;
114 CBackendRepresentativeMemoryCache* mBackendAssocCache;
115
116
117
118 // private methods
119 private:
120
121 // private variables
122 private:
123
124 };
125
126 }; // end namespace Consistiser
127
128 }; // end namespace Reasoner
129
130 }; // end namespace Konclude
131
132 #endif // KONCLUDE_REASONER_CONSISTISER_CINCREMENTALPRECOMPUTATIONTHREAD_H