diff options
author | OszkarSemerath <oszkar.semerath@gmail.com> | 2018-05-12 18:42:48 +0200 |
---|---|---|
committer | OszkarSemerath <oszkar.semerath@gmail.com> | 2018-05-12 18:42:48 +0200 |
commit | ea2106d5a5b5302c407edc3151c42f8d90f3ed6a (patch) | |
tree | 759c044e7222af4e1d25fc1e4435cf26e02754b4 /Solvers | |
parent | Cleared metafiles (diff) | |
download | VIATRA-Generator-ea2106d5a5b5302c407edc3151c42f8d90f3ed6a.tar.gz VIATRA-Generator-ea2106d5a5b5302c407edc3151c42f8d90f3ed6a.tar.zst VIATRA-Generator-ea2106d5a5b5302c407edc3151c42f8d90f3ed6a.zip |
derived feature -> partial relation bugfix
Diffstat (limited to 'Solvers')
2 files changed, 6 insertions, 6 deletions
diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/rules/RefinementRuleProvider.xtend b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/rules/RefinementRuleProvider.xtend index e9af0638..1e7b3c4c 100644 --- a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/rules/RefinementRuleProvider.xtend +++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/rules/RefinementRuleProvider.xtend | |||
@@ -130,8 +130,6 @@ class RefinementRuleProvider { | |||
130 | } | 130 | } |
131 | } else { | 131 | } else { |
132 | ruleBuilder.action[match | | 132 | ruleBuilder.action[match | |
133 | println(name) | ||
134 | |||
135 | val startTime = System.nanoTime | 133 | val startTime = System.nanoTime |
136 | //val problem = match.get(0) as LogicProblem | 134 | //val problem = match.get(0) as LogicProblem |
137 | val interpretation = match.get(1) as PartialInterpretation | 135 | val interpretation = match.get(1) as PartialInterpretation |
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 | } |