diff options
author | OszkarSemerath <oszkar.semerath@gmail.com> | 2018-06-13 13:27:33 +0200 |
---|---|---|
committer | OszkarSemerath <oszkar.semerath@gmail.com> | 2018-06-13 13:27:33 +0200 |
commit | 354f378b6b8ed4d50fc4f378fe48217f9881505c (patch) | |
tree | 35676794eb6870ca67b006b452d58b43cf3abb44 /Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/src/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage/neighbourhood | |
parent | type multiplicity is refined to 0 (diff) | |
download | VIATRA-Generator-354f378b6b8ed4d50fc4f378fe48217f9881505c.tar.gz VIATRA-Generator-354f378b6b8ed4d50fc4f378fe48217f9881505c.tar.zst VIATRA-Generator-354f378b6b8ed4d50fc4f378fe48217f9881505c.zip |
Updated partial model representation handling
Diffstat (limited to 'Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/src/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage/neighbourhood')
1 files changed, 12 insertions, 8 deletions
diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/src/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage/neighbourhood/PartialInterpretation2NeighbourhoodRepresentation.xtend b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/src/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage/neighbourhood/PartialInterpretation2NeighbourhoodRepresentation.xtend index a5739edf..bf593add 100644 --- a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/src/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage/neighbourhood/PartialInterpretation2NeighbourhoodRepresentation.xtend +++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/src/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage/neighbourhood/PartialInterpretation2NeighbourhoodRepresentation.xtend | |||
@@ -13,6 +13,8 @@ import java.util.Map | |||
13 | import java.util.Set | 13 | import java.util.Set |
14 | 14 | ||
15 | import static extension hu.bme.mit.inf.dslreasoner.util.CollectionsUtil.* | 15 | import static extension hu.bme.mit.inf.dslreasoner.util.CollectionsUtil.* |
16 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.PartialPrimitiveInterpretation | ||
17 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.PartialComplexTypeInterpretation | ||
16 | 18 | ||
17 | abstract class PartialInterpretation2NeighbourhoodRepresentation<ModelRepresentation,NodeRepresentation> { | 19 | abstract class PartialInterpretation2NeighbourhoodRepresentation<ModelRepresentation,NodeRepresentation> { |
18 | private val boolean deepRepresentation | 20 | private val boolean deepRepresentation |
@@ -33,6 +35,7 @@ abstract class PartialInterpretation2NeighbourhoodRepresentation<ModelRepresenta | |||
33 | * @param model The model to be represented. | 35 | * @param model The model to be represented. |
34 | * @param range The range of the neighbourhood. | 36 | * @param range The range of the neighbourhood. |
35 | * @param parallels The maximal number of parallel references to be differentiated. | 37 | * @param parallels The maximal number of parallel references to be differentiated. |
38 | * @param maxNumber The maximal number of elements in a equivalence class that chan be differentiated. | ||
36 | */ | 39 | */ |
37 | def public createRepresentation(PartialInterpretation model, int range, int parallels, int maxNumber) { | 40 | def public createRepresentation(PartialInterpretation model, int range, int parallels, int maxNumber) { |
38 | return createRepresentation(model,range,parallels,maxNumber,null,null) | 41 | return createRepresentation(model,range,parallels,maxNumber,null,null) |
@@ -187,10 +190,7 @@ abstract class PartialInterpretation2NeighbourhoodRepresentation<ModelRepresenta | |||
187 | return | 190 | return |
188 | model.problem.elements + | 191 | model.problem.elements + |
189 | model.newElements + | 192 | model.newElements + |
190 | model.booleanelements+ | 193 | model.openWorldElements |
191 | model.integerelements+ | ||
192 | model.stringelement+ | ||
193 | model.realelements | ||
194 | } | 194 | } |
195 | 195 | ||
196 | def private fillTypes(PartialInterpretation model, Map<DefinedElement, Set<String>> node2Type, Set<TypeDeclaration> relevantTypes) { | 196 | def private fillTypes(PartialInterpretation model, Map<DefinedElement, Set<String>> node2Type, Set<TypeDeclaration> relevantTypes) { |
@@ -202,10 +202,14 @@ abstract class PartialInterpretation2NeighbourhoodRepresentation<ModelRepresenta | |||
202 | // // Dont need | 202 | // // Dont need |
203 | // } | 203 | // } |
204 | for(typeInterpretation : model.partialtypeinterpratation) { | 204 | for(typeInterpretation : model.partialtypeinterpratation) { |
205 | val type = typeInterpretation.interpretationOf | 205 | if(typeInterpretation instanceof PartialPrimitiveInterpretation) { |
206 | if(type.isRelevant(relevantTypes)) { | 206 | |
207 | for(element : typeInterpretation.elements) { | 207 | } else if(typeInterpretation instanceof PartialComplexTypeInterpretation) { |
208 | element.lookup(node2Type).add(type.name) | 208 | val type = typeInterpretation.interpretationOf |
209 | if(type.isRelevant(relevantTypes)) { | ||
210 | for(element : typeInterpretation.elements) { | ||
211 | element.lookup(node2Type).add(type.name) | ||
212 | } | ||
209 | } | 213 | } |
210 | } | 214 | } |
211 | } | 215 | } |