Debian Codegraph @

Source/Reasoner/Kernel/Process/CReapplyConceptSaturationLabelSet.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_KERNEL_PROCESS_CREAPPLYCONCEPTSATURATIONLABELSET_H
22 #define KONCLUDE_REASONER_KERNEL_PROCESS_CREAPPLYCONCEPTSATURATIONLABELSET_H
23
24 // Libraries includes
25
26
27 // Namespace includes
28 #include "ProcessSettings.h"
29 #include "CProcessContext.h"
30 #include "CConceptSaturationDescriptorReapplyData.h"
31 #include "CImplicationReapplyConceptSaturationDescriptor.h"
32 #include "CReapplyConceptSaturationLabelSetIterator.h"
33 #include "CSaturationModifiedProcessUpdateLinker.h"
34 #include "CConceptSetFlags.h"
35
36 // Other includes
37
38
39 // Logger includes
40 #include "Logger/CLogger.h"
41
42
43
44 namespace Konclude {
45
46 namespace Reasoner {
47
48 namespace Kernel {
49
50 namespace Process {
51
52 /*!
53 *
54 * \class CReapplyConceptSaturationLabelSet
55 * \author Andreas Steigmiller
56 * \version 0.1
57 * \brief TODO
58 *
59 */
60 class CReapplyConceptSaturationLabelSet {
61 // public methods
62 public:
63 //! Constructor
64 CReapplyConceptSaturationLabelSet(CProcessContext* processContext = nullptr);
65
66
67 CReapplyConceptSaturationLabelSet* initReapplyConceptSaturationLabelSet();
68 CReapplyConceptSaturationLabelSet* copyReapplyConceptSaturationLabelSet(CReapplyConceptSaturationLabelSet* copyConceptSaturationLabelSet, bool tryFlatLabelCopy);
69
70 cint64 getConceptCount();
71 cint64 getTotalCount();
72
73 bool getConceptSaturationDescriptor(cint64 conTag, CConceptSaturationDescriptor*& conSatDes, CImplicationReapplyConceptSaturationDescriptor*& impReapplyConSatDes);
74 bool getConceptSaturationDescriptor(CConcept* concept, CConceptSaturationDescriptor*& conSatDes, CImplicationReapplyConceptSaturationDescriptor*& impReapplyConSatDes);
75
76
77 bool getConceptDescriptorAndReapplyQueue(CConcept* concept, CConceptSaturationDescriptor*& conSatDes, CImplicationReapplyConceptSaturationDescriptor*& impReapplyConSatDes);
78 bool getConceptDescriptorAndReapplyQueue(cint64 conTag, CConceptSaturationDescriptor*& conSatDes, CImplicationReapplyConceptSaturationDescriptor*& impReapplyConSatDes);
79
80 bool hasConceptSaturationDescriptor(CConceptSaturationDescriptor* conSatDes);
81
82 bool hasConcept(CConcept* concept, bool negated);
83 bool hasConcept(cint64 conTag, bool negated);
84
85 bool hasConcept(CConcept* concept, bool* containsNegated = nullptr);
86 bool hasConcept(cint64 conTag, bool* containsNegated = nullptr);
87 bool containsConcept(CConcept* concept, bool* containsNegated = nullptr);
88 bool containsConcept(CConcept* concept, bool negated);
89
90 bool containsConceptOrReapllyQueue(cint64 conTag);
91
92
93 bool containsConceptSaturationDescriptor(CConceptSaturationDescriptor* conSatDes);
94
95
96 bool hasModifiedUpdateLinkers();
97 CSaturationModifiedProcessUpdateLinker* getModifiedUpdateLinker();
98 CReapplyConceptSaturationLabelSet* addModifiedUpdateLinker(CSaturationModifiedProcessUpdateLinker* modUpdateLinker);
99 CReapplyConceptSaturationLabelSet* setModifiedUpdateLinker(CSaturationModifiedProcessUpdateLinker* modUpdateLinker);
100
101
102 bool insertConceptReturnClashed(CConceptSaturationDescriptor* conSatDes, bool* newInsertion = nullptr, CImplicationReapplyConceptSaturationDescriptor*** impReapplyConSatDesPtr = nullptr);
103
104 bool insertConceptReapplicationReturnTriggered(cint64 conTag, CImplicationReapplyConceptSaturationDescriptor* reapplyImpReapplyConSatDes, CConceptSaturationDescriptor** conSatDes);
105
106
107 CConceptSaturationDescriptor* getConceptSaturationDescriptionLinker();
108
109
110 CReapplyConceptSaturationLabelSetIterator getIterator(bool iterateConSatDes = true, bool iterateReapplies = true);
111
112
113 CConceptSetFlags* getConceptFlags();
114
115 bool areAllConceptsInAdditionalHash();
116
117 CConceptSaturationDescriptor* getLastNominalIndependentConceptSaturationDescriptorLinker();
118 CReapplyConceptSaturationLabelSet* setLastNominalIndependentConceptSaturationDescriptorLinker(CConceptSaturationDescriptor* conSatDes);
119
120 // protected methods
121 protected:
122
123 // protected variables
124 protected:
125 CPROCESSHASH<cint64,CConceptSaturationDescriptorReapplyData>* mConceptDesDepHash;
126 CPROCESSHASH<cint64,CConceptSaturationDescriptorReapplyData>* mAdditionalConceptDesDepHash;
127 CConceptSaturationDescriptor* mConceptSatDesLinker;
128 CConceptSaturationDescriptor* mLastNominalIndepConSatDes;
129 CConceptSetFlags mConceptFlags;
130
131 cint64 mConceptCount;
132 cint64 mTotelCount;
133
134 const static cint64 ADDITIONALCOPYSIZE = 300;
135
136 CSaturationModifiedProcessUpdateLinker* mModifiedUpdateLinker;
137
138 CProcessContext* mProcessContext;
139
140 // private methods
141 private:
142
143 // private variables
144 private:
145
146 };
147
148 }; // end namespace Process
149
150 }; // end namespace Kernel
151
152 }; // end namespace Reasoner
153
154 }; // end namespace Konclude
155
156 #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CREAPPLYCONCEPTSATURATIONLABELSET_H