diff options
Diffstat (limited to 'Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretation2logic/src/hu/bme/mit/inf')
1 files changed, 6 insertions, 3 deletions
diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretation2logic/src/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretation2logic/InstanceModel2PartialInterpretation.xtend b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretation2logic/src/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretation2logic/InstanceModel2PartialInterpretation.xtend index 58c41a49..626e3baa 100644 --- a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretation2logic/src/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretation2logic/InstanceModel2PartialInterpretation.xtend +++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretation2logic/src/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretation2logic/InstanceModel2PartialInterpretation.xtend | |||
@@ -70,9 +70,11 @@ class InstanceModel2PartialInterpretation { | |||
70 | object2DefinedElement.put(object, element) | 70 | object2DefinedElement.put(object, element) |
71 | } | 71 | } |
72 | 72 | ||
73 | val referencesUsed = ecore2Logic.allReferencesInScope(ecore2LogicTrace).toSet | ||
74 | val attributesUsed = ecore2Logic.allAttributesInScope(ecore2LogicTrace).toSet | ||
73 | for(source : objects) { | 75 | for(source : objects) { |
74 | // Translating the references | 76 | // Translating the references |
75 | for(reference : source.eClass.EAllReferences) { | 77 | for(reference : source.eClass.EAllReferences.filter[referencesUsed.contains(it)]) { |
76 | val type = ecore2Logic.relationOfReference(ecore2LogicTrace,reference) | 78 | val type = ecore2Logic.relationOfReference(ecore2LogicTrace,reference) |
77 | val interpretation = type.lookup(partialInterpretationTrace.relation2Interpretation) | 79 | val interpretation = type.lookup(partialInterpretationTrace.relation2Interpretation) |
78 | val sourceElement = source.lookup(object2DefinedElement) | 80 | val sourceElement = source.lookup(object2DefinedElement) |
@@ -90,8 +92,9 @@ class InstanceModel2PartialInterpretation { | |||
90 | } | 92 | } |
91 | } | 93 | } |
92 | } | 94 | } |
93 | // Transforming the relations | 95 | |
94 | for(attribute : source.eClass.EAllAttributes) { | 96 | // Transforming the attributes |
97 | for(attribute : source.eClass.EAllAttributes.filter[referencesUsed.contains(it)]) { | ||
95 | val type = ecore2Logic.relationOfAttribute(ecore2LogicTrace,attribute) | 98 | val type = ecore2Logic.relationOfAttribute(ecore2LogicTrace,attribute) |
96 | val interpretation = type.lookup(partialInterpretationTrace.relation2Interpretation) | 99 | val interpretation = type.lookup(partialInterpretationTrace.relation2Interpretation) |
97 | val sourceElement = source.lookup(object2DefinedElement) | 100 | val sourceElement = source.lookup(object2DefinedElement) |