Debian Codegraph @

Source/Reasoner/Answerer/COptimizedComplexBuildingPropertyVariableCompositionsItem.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_ANSWERER_COPTIMIZEDCOMPLEXBUILDINGPROPERTYVARIABLECOMPOSITIONSITEM_H
22 #define KONCLUDE_REASONER_ANSWERER_COPTIMIZEDCOMPLEXBUILDINGPROPERTYVARIABLECOMPOSITIONSITEM_H
23
24 // Libraries includes
25
26
27 // Namespace includes
28 #include "AnswererSettings.h"
29 #include "COptimizedComplexBuildingVariableCompositionsItem.h"
30
31
32 // Other includes
33 #include "Reasoner/Ontology/CRole.h"
34 #include "Reasoner/Ontology/OntologySettings.h"
35 #include "Reasoner/Ontology/CConceptProcessData.h"
36 #include "Reasoner/Ontology/CConcreteOntology.h"
37
38 #include "Parser/Expressions/CPropertyVariableExpression.h"
39
40 // Logger includes
41 #include "Logger/CLogger.h"
42
43
44 namespace Konclude {
45
46 using namespace Parser::Expression;
47
48 namespace Reasoner {
49
50 namespace Answerer {
51
52
53 /*!
54 *
55 * \class COptimizedComplexBuildingPropertyVariableCompositionsItem
56 * \author Andreas Steigmiller
57 * \version 0.1
58 * \brief TODO
59 *
60 */
61 class COptimizedComplexBuildingPropertyVariableCompositionsItem : public COptimizedComplexBuildingVariableCompositionsItem {
62 // public methods
63 public:
64 //! Constructor
65 COptimizedComplexBuildingPropertyVariableCompositionsItem(CComplexQueryExpressionProcessingData* queryProcessingData);
66 virtual ~COptimizedComplexBuildingPropertyVariableCompositionsItem();
67
68
69
70 virtual bool isWaitingComputation();
71
72 COptimizedComplexBuildingPropertyVariableCompositionsItem* addVariableComplexSuperRole(CPropertyVariableExpression* varExp, CRole* role);
73 COptimizedComplexBuildingPropertyVariableCompositionsItem* addVariableComplexSubRole(CPropertyVariableExpression* varExp, CRole* role);
74
75 QSet<CPropertyVariableExpression*>* getRemainingVariableExpressionSet();
76 QSet<CPropertyVariableExpression*>* getAllVariableSet();
77
78 QList<CRole*> getVariableSuperRoles(CPropertyVariableExpression* varExp);
79 QList<CRole*> getVariableSubRoles(CPropertyVariableExpression* varExp);
80
81 bool isInitializedBaseRoleVariableItems();
82 COptimizedComplexBuildingPropertyVariableCompositionsItem* setInitializedBaseRoleVariableItems(bool initialized);
83
84
85
86 QSet<QPair<CExpressionVariable*, CExpressionVariable*>>* getVariableSubSuperPropagationSet();
87 COptimizedComplexBuildingPropertyVariableCompositionsItem* addVariableSubSuperPropagation(CExpressionVariable* subVar, CExpressionVariable* superVar);
88 COptimizedComplexBuildingPropertyVariableCompositionsItem* removeVariableSubSuperPropagation(CExpressionVariable* subVar, CExpressionVariable* superVar);
89 bool hasVariableSubSuperPropagation(CExpressionVariable* subVar, CExpressionVariable* superVar);
90
91 QSet<QPair<CExpressionVariable*, CExpressionVariable*>> getVariableRemainingSubSuperPropagationSet(CExpressionVariable* varExp);
92 bool isRemovingPropagationDisconnecting(CExpressionVariable* varExp, CExpressionVariable* subVar, CExpressionVariable* superVar);
93
94 COptimizedComplexBuildingPropertyVariableCompositionsItem* setVariableExpressionUnhandled(CPropertyVariableExpression* varExp);
95 COptimizedComplexBuildingPropertyVariableCompositionsItem* setVariableExpressionHandled(CPropertyVariableExpression* varExp);
96
97
98 // protected methods
99 protected:
100
101 // protected variables
102 protected:
103 QHash<CPropertyVariableExpression*, CRole*> mVarSuperRoleHash;
104 QHash<CPropertyVariableExpression*, CRole*> mVarSubRoleHash;
105
106
107 bool mInitializedBaseRoleVariableItems;
108
109 QSet<CPropertyVariableExpression*> mRemainingVarExpSet;
110 QSet<CPropertyVariableExpression*> mAllVarExpSet;
111
112
113 QSet<QPair<CExpressionVariable*, CExpressionVariable*>> mVariableSubSuperPropagationSet;
114 QHash<CExpressionVariable*, CExpressionVariable*> mVariableSubPropagationHash;
115 QHash<CExpressionVariable*, CExpressionVariable*> mVariableSuperPropagationHash;
116
117 // private methods
118 private:
119
120 // private variables
121 private:
122
123 };
124
125 }; // end namespace Answerer
126
127 }; // end namespace Reasoner
128
129 }; // end namespace Konclude
130
131 #endif // KONCLUDE_REASONER_ANSWERER_COPTIMIZEDCOMPLEXBUILDINGPROPERTYVARIABLECOMPOSITIONSITEM_H