Debian Codegraph @

Source/Reasoner/Taxonomy/CAbstractHierarchyBuilder.cpp

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_TAXONOMY_CABSTRACTHIERARCHYBUILDER_CPP
22 #define KONCLUDE_REASONER_TAXONOMY_CABSTRACTHIERARCHYBUILDER_CPP
23
24
25 #include "CAbstractHierarchyBuilder.h"
26
27
28 namespace Konclude {
29
30 namespace Reasoner {
31
32 namespace Taxonomy {
33
34
35 template<class T, class N, class E>
36 CAbstractHierarchyBuilder<T,N,E>::CAbstractHierarchyBuilder() {
37 }
38
39 template<class T, class N, class E>
40 T* CAbstractHierarchyBuilder<T,N,E>::setElementSatisfiable(const E& element, bool satisfiable) {
41 if (satisfiable) {
42 return setElementSatisfiable(element);
43 } else {
44 return setElementUnsatisfiable(element);
45 }
46 }
47
48
49 template<class T, class N, class E>
50 T* CAbstractHierarchyBuilder<T,N,E>::setElementSatisfiable(const E& element) {
51 N* node = getHierarchyNode(element,true);
52 return setNodeSatisfiable(node);
53 }
54
55
56 template<class T, class N, class E>
57 T* CAbstractHierarchyBuilder<T,N,E>::setElementUnsatisfiable(const E& element) {
58 N* node = getHierarchyNode(element,true);
59 return setNodeUnsatisfiable(node);
60 }
61
62
63 template<class T, class N, class E>
64 T* CAbstractHierarchyBuilder<T,N,E>::setElementSubsumption(const E& subsumerElement, const E& subsumedElement) {
65 N* subsumerNode = getHierarchyNode(subsumerElement,true);
66 N* subsumedNode = getHierarchyNode(subsumedElement,true);
67 return setNodeSubsumption(subsumerNode,subsumedNode);
68 }
69
70
71 template<class T, class N, class E>
72 T* CAbstractHierarchyBuilder<T,N,E>::setElementEquivalence(const E& element1, const E& element2) {
73 N* eqNode1 = getHierarchyNode(element1,true);
74 N* eqNode2 = getHierarchyNode(element2,true);
75 return setNodeEquivalence(eqNode1,eqNode2);
76 }
77
78 template<class T, class N, class E>
79 T* CAbstractHierarchyBuilder<T,N,E>::setNodeSatisfiable(N* node, bool satisfiable) {
80 if (satisfiable) {
81 return setNodeSatisfiable(node);
82 } else {
83 return setNodeUnsatisfiable(node);
84 }
85 }
86
87
88 }; // end namespace Taxonomy
89
90 }; // end namespace Reasoner
91
92 }; // end namespace Konclude
93
94 #endif // KONCLUDE_REASONER_TAXONOMY_CABSTRACTHIERARCHYBUILDER_CPP