diff options
author | 2017-08-02 21:08:02 +0200 | |
---|---|---|
committer | 2017-08-02 21:08:02 +0200 | |
commit | 80158bfdf3c75382d023c5d7953efe1645ab7e92 (patch) | |
tree | 94d7de72b710e952fa332868525b8aa024c11f6f /Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretation2logic/src/hu | |
parent | Added methods to decide which attribure or enum type is mapped ot the (diff) | |
download | VIATRA-Generator-80158bfdf3c75382d023c5d7953efe1645ab7e92.tar.gz VIATRA-Generator-80158bfdf3c75382d023c5d7953efe1645ab7e92.tar.zst VIATRA-Generator-80158bfdf3c75382d023c5d7953efe1645ab7e92.zip |
attributes and references that not included to a logic problem are
excluded from the partial model mapping.
Diffstat (limited to 'Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretation2logic/src/hu')
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) |