Debian Codegraph @

Source/Reasoner/Preprocess/CFullNominalSchemaGroundingPreProcess.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_PREPROCESS_CFULLNOMINALSCHEMAGROUNDINGPREPROCESS_H
22 #define KONCLUDE_REASONER_PREPROCESS_CFULLNOMINALSCHEMAGROUNDINGPREPROCESS_H
23
24 // Libraries includes
25 #include <QSet>
26
27 // Namespace includes
28 #include "CConcreteOntologyPreProcess.h"
29 #include "CConceptRoleIndividualLocator.h"
30 #include "CConceptTriggerLinker.h"
31
32
33 // Other includes
34 #include "Utilities/Container/CNegLinker.h"
35
36 #include "Config/CConfigDataReader.h"
37
38 #include "Reasoner/Generator/CConcreteOntologyInverseRoleBuilder.h"
39
40 #include "Reasoner/Ontology/CConceptTextFormater.h"
41 #include "Reasoner/Ontology/COntologyTextFormater.h"
42 #include "Reasoner/Ontology/CNominalSchemaTemplateVector.h"
43
44 // Logger includes
45 #include "Logger/CLogger.h"
46
47
48
49 namespace Konclude {
50
51 using namespace Config;
52 using namespace Utilities::Container;
53
54 namespace Reasoner {
55
56 using namespace Generator;
57 using namespace Ontology;
58
59 namespace Preprocess {
60
61
62 /*!
63 *
64 * \class CFullNominalSchemaGroundingPreProcess
65 * \author Andreas Steigmiller
66 * \version 0.1
67 * \brief TODO
68 *
69 */
70 class CFullNominalSchemaGroundingPreProcess : public CConcreteOntologyPreProcess {
71 // public methods
72 public:
73 //! Constructor
74 CFullNominalSchemaGroundingPreProcess();
75
76 //! Destructor
77 virtual ~CFullNominalSchemaGroundingPreProcess();
78
79 virtual CConcreteOntology *preprocess(CConcreteOntology *ontology, CPreProcessContext* context);
80
81
82 // protected methods
83 protected:
84 CConcept* createNominalSchemaAxiomCollectionConcept(CConcept* concept, bool negated, CNominalSchemaTemplate* nsTemplate);
85 void addConceptOperand(CConcept* concept, CConcept* opConcept, bool negated);
86
87 CConcept* createGroundedNominalSchemaConcept(CConcept* concept, CBOXHASH<CConcept*,CConcept*>* templConNomSchConHash, QHash<CConcept*, QSet<CConcept*>::const_iterator >* nomSchConIndividualItHash);
88
89 CConcept* createNominalSchemaConceptCopy(CConcept* concept);
90
91 bool requiresGCIGrounding(CNominalSchemaTemplate* nsTemplate, bool negated);
92 bool findAbsorbableNominalSchemas(CConcept* concept, bool negation, QSet<CConcept*>* absorbableNominalVariableSet);
93
94 // protected variables
95 protected:
96 CMemoryAllocationManager* mMemMan;
97
98 CConceptVector* mConceptVec;
99 CRoleVector* mRolesVec;
100 CConcept* mBottomConcept;
101 CConcept* mTopConcept;
102 cint64 mConceptCount;
103 cint64 mRoleCount;
104 CIndividualVector* mIndividualVector;
105 cint64 mIndividualCount;
106 CConcreteOntology* mOnto;
107 CMBox* mMBox;
108 CTBox* mTBox;
109
110 CNominalSchemaTemplateVector* mNomSchTemplVec;
111
112 QSet<CConcept*> mNominalConceptSet;
113
114
115 QHash< QPair<CConcept*,bool>, CConcept*> mCollConHash;
116 QHash< QPair<CConcept*,bool>, bool> mReqGroundConHash;
117
118 QHash<QByteArray,CConcept*> mConceptNomSchemIndiReplaceHash;
119
120 bool mConfReuseGroundedNominalSchemaConcepts;
121 bool mConfGroundNominalSchemaAbsorbableConcepts;
122 bool mConfFullyGroundNominalSchemaConcepts;
123
124 cint64 mStatGroundedTemplateCount;
125 cint64 mStatCreatedConceptCount;
126 cint64 mStatReplacedConceptCount;
127
128 cint64 mStatInstantiatedAxiomsCount;
129
130 // private methods
131 private:
132
133 // private variables
134 private:
135
136
137 };
138
139 }; // end namespace Preprocess
140
141 }; // end namespace Reasoner
142
143 }; // end namespace Konclude
144
145 #endif // KONCLUDE_REASONER_PREPROCESS_CFULLNOMINALSCHEMAGROUNDINGPREPROCESS_H