diff options
Diffstat (limited to 'Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretation2logic/src/hu/bme/mit/inf/dslreasoner')
1 files changed, 6 insertions, 4 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 761e77b1..9a737ab9 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 | |||
@@ -75,7 +75,9 @@ class InstanceModel2PartialInterpretation { | |||
75 | val attributesUsed = ecore2Logic.allAttributesInScope(ecore2LogicTrace).toSet | 75 | val attributesUsed = ecore2Logic.allAttributesInScope(ecore2LogicTrace).toSet |
76 | for(source : objects) { | 76 | for(source : objects) { |
77 | // Translating the references | 77 | // Translating the references |
78 | for(reference : source.eClass.EAllReferences.filter[referencesUsed.contains(it)]) { | 78 | for(reference : source.eClass.EAllReferences.filter[ |
79 | referencesUsed.contains(it) && !it.derived]) | ||
80 | { | ||
79 | val type = ecore2Logic.relationOfReference(ecore2LogicTrace,reference) | 81 | val type = ecore2Logic.relationOfReference(ecore2LogicTrace,reference) |
80 | val interpretation = type.lookup(partialInterpretationTrace.relation2Interpretation) | 82 | val interpretation = type.lookup(partialInterpretationTrace.relation2Interpretation) |
81 | val sourceElement = source.lookup(object2DefinedElement) | 83 | val sourceElement = source.lookup(object2DefinedElement) |
@@ -97,7 +99,7 @@ class InstanceModel2PartialInterpretation { | |||
97 | } | 99 | } |
98 | 100 | ||
99 | // Transforming the attributes | 101 | // Transforming the attributes |
100 | for(attribute : source.eClass.EAllAttributes.filter[attributesUsed.contains(it)]) { | 102 | for(attribute : source.eClass.EAllAttributes.filter[attributesUsed.contains(it) && !it.derived]) { |
101 | val type = ecore2Logic.relationOfAttribute(ecore2LogicTrace,attribute) | 103 | val type = ecore2Logic.relationOfAttribute(ecore2LogicTrace,attribute) |
102 | val interpretation = type.lookup(partialInterpretationTrace.relation2Interpretation) | 104 | val interpretation = type.lookup(partialInterpretationTrace.relation2Interpretation) |
103 | val sourceElement = source.lookup(object2DefinedElement) | 105 | val sourceElement = source.lookup(object2DefinedElement) |
@@ -105,7 +107,7 @@ class InstanceModel2PartialInterpretation { | |||
105 | val listOfTargets = source.eGet(attribute) as List<? extends EObject> | 107 | val listOfTargets = source.eGet(attribute) as List<? extends EObject> |
106 | for(target : listOfTargets) { | 108 | for(target : listOfTargets) { |
107 | val value = translateValue(target,ecore2LogicTrace,partialInterpretationTrace) | 109 | val value = translateValue(target,ecore2LogicTrace,partialInterpretationTrace) |
108 | if(value != null) { | 110 | if(value !== null) { |
109 | translateLink(interpretation,sourceElement,value) | 111 | translateLink(interpretation,sourceElement,value) |
110 | } | 112 | } |
111 | } | 113 | } |
@@ -113,7 +115,7 @@ class InstanceModel2PartialInterpretation { | |||
113 | val target = source.eGet(attribute) | 115 | val target = source.eGet(attribute) |
114 | if(target !== null) { | 116 | if(target !== null) { |
115 | val value = translateValue(target,ecore2LogicTrace,partialInterpretationTrace) | 117 | val value = translateValue(target,ecore2LogicTrace,partialInterpretationTrace) |
116 | if(value != null) { | 118 | if(value !== null) { |
117 | translateLink(interpretation,sourceElement,value) | 119 | translateLink(interpretation,sourceElement,value) |
118 | } | 120 | } |
119 | } | 121 | } |