diff options
author | 2020-05-20 02:07:37 +0200 | |
---|---|---|
committer | 2020-05-20 02:07:37 +0200 | |
commit | eb081453e93e6e30c0b6bb92400275529ed3273b (patch) | |
tree | aba071677812e49eb101a429f01f28aa4f58a226 /Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/dse | |
parent | FIx Boolean export to gml (diff) | |
download | VIATRA-Generator-eb081453e93e6e30c0b6bb92400275529ed3273b.tar.gz VIATRA-Generator-eb081453e93e6e30c0b6bb92400275529ed3273b.tar.zst VIATRA-Generator-eb081453e93e6e30c0b6bb92400275529ed3273b.zip |
Fix attribute export to xmi
Diffstat (limited to 'Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/dse')
-rw-r--r-- | Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/dse/PartialModelAsLogicInterpretation.xtend | 63 |
1 files changed, 60 insertions, 3 deletions
diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/dse/PartialModelAsLogicInterpretation.xtend b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/dse/PartialModelAsLogicInterpretation.xtend index f61c7333..48922f5d 100644 --- a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/dse/PartialModelAsLogicInterpretation.xtend +++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/dse/PartialModelAsLogicInterpretation.xtend | |||
@@ -1,5 +1,6 @@ | |||
1 | package hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner.dse | 1 | package hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner.dse |
2 | 2 | ||
3 | import com.google.common.collect.ImmutableMap | ||
3 | import hu.bme.mit.inf.dslreasoner.logic.model.builder.LogicModelInterpretation | 4 | import hu.bme.mit.inf.dslreasoner.logic.model.builder.LogicModelInterpretation |
4 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.ConstantDeclaration | 5 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.ConstantDeclaration |
5 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.DefinedElement | 6 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.DefinedElement |
@@ -153,14 +154,70 @@ class PartialModelAsLogicInterpretation implements LogicModelInterpretation{ | |||
153 | } | 154 | } |
154 | 155 | ||
155 | override getAllIntegersInStructure() { | 156 | override getAllIntegersInStructure() { |
156 | new TreeSet(this.integerForwardTrace.keySet) | 157 | new TreeSet(allIntegersWithInterpretation.values) |
158 | } | ||
159 | |||
160 | override getAllIntegersWithInterpretation() { | ||
161 | val builder = new HashMap | ||
162 | for (entry : integerForwardTrace.entrySet) { | ||
163 | builder.put(entry.value, entry.key) | ||
164 | } | ||
165 | for (element : partialInterpretation.newElements) { | ||
166 | if (element instanceof IntegerElement) { | ||
167 | builder.put(element, element.value) | ||
168 | } | ||
169 | } | ||
170 | builder | ||
157 | } | 171 | } |
158 | 172 | ||
159 | override getAllRealsInStructure() { | 173 | override getAllRealsInStructure() { |
160 | new TreeSet(this.realForwardTrace.keySet) | 174 | new TreeSet(allRealsWithInterpretation.values) |
175 | } | ||
176 | |||
177 | override getAllRealsWithInterpretation() { | ||
178 | val builder = new HashMap | ||
179 | for (entry : realForwardTrace.entrySet) { | ||
180 | builder.put(entry.value, entry.key) | ||
181 | } | ||
182 | for (element : partialInterpretation.newElements) { | ||
183 | if (element instanceof RealElement) { | ||
184 | builder.put(element, element.value) | ||
185 | } | ||
186 | } | ||
187 | builder | ||
161 | } | 188 | } |
162 | 189 | ||
163 | override getAllStringsInStructure() { | 190 | override getAllStringsInStructure() { |
164 | new TreeSet(this.stringForwardTrace.keySet) | 191 | new TreeSet(allStringsWithInterpretation.values) |
192 | } | ||
193 | |||
194 | override getAllStringsWithInterpretation() { | ||
195 | val builder = new HashMap | ||
196 | for (entry : stringForwardTrace.entrySet) { | ||
197 | builder.put(entry.value, entry.key) | ||
198 | } | ||
199 | for (element : partialInterpretation.newElements) { | ||
200 | if (element instanceof StringElement) { | ||
201 | builder.put(element, element.value) | ||
202 | } | ||
203 | } | ||
204 | builder | ||
205 | } | ||
206 | |||
207 | override getAllBooleansInStructure() { | ||
208 | new TreeSet(allBooleansWithInterpretation.values) | ||
209 | } | ||
210 | |||
211 | override getAllBooleansWithInterpretation() { | ||
212 | val builder = new HashMap | ||
213 | for (entry : booleanForwardTrace.entrySet) { | ||
214 | builder.put(entry.value, entry.key) | ||
215 | } | ||
216 | for (element : partialInterpretation.newElements) { | ||
217 | if (element instanceof BooleanElement) { | ||
218 | builder.put(element, element.value) | ||
219 | } | ||
220 | } | ||
221 | builder | ||
165 | } | 222 | } |
166 | } \ No newline at end of file | 223 | } \ No newline at end of file |