Debian Codegraph @

Source/Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCacheEntry.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 #include "CSignatureSatisfiableExpanderCacheEntry.h"
22
23
24 namespace Konclude {
25
26 namespace Reasoner {
27
28 namespace Kernel {
29
30 namespace Cache {
31
32
33 CSignatureSatisfiableExpanderCacheEntry::CSignatureSatisfiableExpanderCacheEntry(CSignatureSatisfiableExpanderCacheContext* context) : mContext(context) {
34 mDetExpandValueLinker = nullptr;
35 mExpandBranchedLinker = nullptr;
36 mTagExpanderCacheValueHash = nullptr;
37 mDetExpandCount = 0;
38 mSatisfiable = false;
39 mSatisfiableWithoutBranchedConcept = false;
40 mMultipleExpanded = false;
41 }
42
43
44
45 CSignatureSatisfiableExpanderCacheEntry* CSignatureSatisfiableExpanderCacheEntry::appendExpanderCacheValueLinker(CExpanderCacheValueLinker* linker) {
46 CExpanderCacheValueLinker* linkerIt = linker;
47 while (linkerIt) {
48 ++mDetExpandCount;
49 linkerIt = linkerIt->getNext();
50 }
51 if (!mDetExpandValueLinker) {
52 mDetExpandValueLinker = linker;
53 } else {
54 mDetExpandValueLinker->append(linker);
55 }
56 return this;
57 }
58
59
60 CExpanderCacheValueLinker* CSignatureSatisfiableExpanderCacheEntry::getExpanderCacheValueLinker() {
61 return mDetExpandValueLinker;
62 }
63
64
65
66 CSignatureSatisfiableExpanderCacheEntry* CSignatureSatisfiableExpanderCacheEntry::appendExpanderBranchedLinker(CExpanderBranchedLinker* linker) {
67 if (mExpandBranchedLinker) {
68 mExpandBranchedLinker = linker->append(mExpandBranchedLinker);
69 } else {
70 mExpandBranchedLinker = linker;
71 }
72 return this;
73 }
74
75
76 CExpanderBranchedLinker* CSignatureSatisfiableExpanderCacheEntry::getExpanderBranchedLinker() {
77 return mExpandBranchedLinker;
78 }
79
80 CCACHINGHASH<cint64,CExpanderCacheValueLinker*>* CSignatureSatisfiableExpanderCacheEntry::getTagExpanderCacheValueHash() {
81 return mTagExpanderCacheValueHash;
82 }
83
84
85 CSignatureSatisfiableExpanderCacheEntry* CSignatureSatisfiableExpanderCacheEntry::setTagExpanderCacheValueHash(CCACHINGHASH<cint64,CExpanderCacheValueLinker*>* hash) {
86 mTagExpanderCacheValueHash = hash;
87 return this;
88 }
89
90
91 cint64 CSignatureSatisfiableExpanderCacheEntry::getExpanderCacheValueCount() {
92 return mDetExpandCount;
93 }
94
95 bool CSignatureSatisfiableExpanderCacheEntry::isSatisfiable() {
96 return mSatisfiable;
97 }
98
99 CSignatureSatisfiableExpanderCacheEntry* CSignatureSatisfiableExpanderCacheEntry::setSatisfiable(bool satisfiable) {
100 mSatisfiable = satisfiable;
101 return this;
102 }
103
104
105 bool CSignatureSatisfiableExpanderCacheEntry::isSatisfiableWithoutBranchedConcepts() {
106 return mSatisfiableWithoutBranchedConcept;
107 }
108
109 CSignatureSatisfiableExpanderCacheEntry* CSignatureSatisfiableExpanderCacheEntry::setSatisfiableWithoutBranchedConcepts(bool sat) {
110 mSatisfiableWithoutBranchedConcept = sat;
111 return this;
112 }
113
114 bool CSignatureSatisfiableExpanderCacheEntry::hasMultipleExpanded() {
115 return mMultipleExpanded;
116 }
117
118 CSignatureSatisfiableExpanderCacheEntry* CSignatureSatisfiableExpanderCacheEntry::setMultipleExpanded(bool expanded) {
119 mMultipleExpanded = expanded;
120 return this;
121 }
122
123
124 }; // end namespace Cache
125
126 }; // end namespace Kernel
127
128 }; // end namespace Reasoner
129
130 }; // end namespace Konclude