Debian Codegraph @

Source/Reasoner/Kernel/Algorithm/CConceptNominalSchemaGroundingHandler.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_ALGORITHM_CCONCEPTNOMINALSCHEMAGROUNDINGHANDLER_H
22 #define KONCLUDE_REASONER_KERNEL_ALGORITHM_CCONCEPTNOMINALSCHEMAGROUNDINGHANDLER_H
23
24 // Libraries includes
25
26
27 // Namespace includes
28 #include "AlgorithmSettings.h"
29 #include "CCalculationAlgorithmContext.h"
30
31 // Other includes
32 #include "Reasoner/Kernel/Process/CIndividualProcessNode.h"
33 #include "Reasoner/Kernel/Process/CConceptNominalSchemaGroundingHasher.h"
34
35 #include "Context/CContextBase.h"
36
37 // Logger includes
38 #include "Logger/CLogger.h"
39
40
41
42 namespace Konclude {
43
44 using namespace Context;
45
46 namespace Reasoner {
47
48 namespace Kernel {
49
50 using namespace Process;
51
52 namespace Algorithm {
53
54
55 typedef QPair<CConcept*,CPropagationBindingDescriptor*> TConceptPropagationBindingPair;
56
57 /*!
58 *
59 * \class CConceptNominalSchemaGroundingHandler
60 * \author Andreas Steigmiller
61 * \version 0.1
62 * \brief TODO
63 *
64 */
65 class CConceptNominalSchemaGroundingHandler {
66 // public methods
67 public:
68 //! Constructor
69 CConceptNominalSchemaGroundingHandler();
70
71 CSortedNegLinker<CConcept*>* getGroundingConceptLinker(CIndividualProcessNode* processNode, CPropagationBindingSet* propBindSet, CConcept* concept, bool negated, CPROCESSINGHASH<CConcept*,CPropagationBindingDescriptor*>*& groundedConPropBindDesHash, CPROCESSINGHASH<CVariable*,CPropagationBindingDescriptor*>*& additionalPropBindDesHash, CCalculationAlgorithmContext* calcAlgContext);
72 CSortedNegLinker<CConcept*>* getGroundingConceptLinker(CIndividualProcessNode* processNode, CVariableBindingPathSet* varBindPathSet, CConcept* concept, bool negated, CPROCESSINGHASH<CConcept*,CVariableBindingPathDescriptor*>*& groundedConVarBindPathDesHash, CCalculationAlgorithmContext* calcAlgContext);
73 CSortedNegLinker<CConcept*>* getGroundingConceptLinker(CIndividualProcessNode* processNode, CRepresentativeVariableBindingPathMap* repVarBindPathSetMap, CConcept* concept, bool negated, CPROCESSINGHASH<CConcept*,CVariableBindingPath*>*& groundedConVarBindPathHash, CCalculationAlgorithmContext* calcAlgContext);
74
75 // protected methods
76 protected:
77 CConcept* getNominalConcept(CIndividualProcessNode* processNode, bool forceNotPruned, CCalculationAlgorithmContext* calcAlgContext);
78 void collectAllNominalConcepts(CPROCESSINGSET<CConcept*>*& allNominalConceptSet, CCalculationAlgorithmContext* calcAlgContext);
79 void addConceptOperand(CConcept* concept, CConcept* opConcept, bool negated);
80 CConcept* createNominalSchemaConceptCopy(CConcept* concept);
81
82 CConcept* createGroundedNominalSchemaConcept(CConcept* concept, CBOXHASH<CConcept*,CConcept*>* templConNomSchConHash, QHash<CConcept*, CPROCESSINGHASH<CConcept*,TConceptPropagationBindingPair>::const_iterator >* nomSchConIndividualItHash, CCalculationAlgorithmContext* calcAlgContext);
83 CSortedNegLinker<CConcept*>* createGroundedNominalSchemaConcept(CConcept* concept, bool negated, CReapplyConceptLabelSet* conLabelSet, CBOXHASH<CConcept*,CConcept*>* templConNomSchConHash, QHash<CConcept*, CPROCESSINGHASH<CConcept*,TConceptPropagationBindingPair>::const_iterator >* nomSchConIndividualItHash, CCalculationAlgorithmContext* calcAlgContext);
84
85 CSortedNegLinker<CConcept*>* createNominalSchemaGroundingConcepts(CIndividualProcessNode* indiProcessNode, CConcept* concept, bool negated, CPROCESSINGHASH<CConcept*, TConceptPropagationBindingPair >* nominalSchemaVarBindedNominalHash, CPROCESSINGHASH<CConcept*,CPropagationBindingDescriptor*>*& groundedConPropBindDesHash, CNominalSchemaTemplate* nsTemplate, CCalculationAlgorithmContext* calcAlgContext);
86 CSortedNegLinker<CConcept*>* createNominalSchemaGroundingConcepts(CIndividualProcessNode* indiProcessNode, CConcept* concept, bool negated, CPROCESSINGHASH<CConcept*,TConceptPropagationBindingPair >* nominalSchemaVarBindedNominalHash, CNominalSchemaTemplate* nsTemplate, CCalculationAlgorithmContext* calcAlgContext);
87
88
89 bool forceExtensionLocalisation(CCalculationAlgorithmContext* calcAlgContext);
90
91 // protected variables
92 protected:
93 CMemoryAllocationManager* mMemMan;
94 CConceptVector* mConceptVec;
95 CTBox* mTBox;
96 CConceptNominalSchemaGroundingHash* mReplaceHash;
97 CProcessingDataBox* mDataBox;
98
99 bool mLocalizedExtensions;
100
101 bool mConfReuseGroundedNominalSchemaConcepts;
102
103
104 // private methods
105 private:
106
107 // private variables
108 private:
109
110 };
111
112 }; // end namespace Algorithm
113
114 }; // end namespace Kernel
115
116 }; // end namespace Reasoner
117
118 }; // end namespace Konclude
119
120 #endif // KONCLUDE_REASONER_KERNEL_ALGORITHM_CCONCEPTNOMINALSCHEMAGROUNDINGHANDLER_H