diff options
author | 2018-07-16 18:25:34 +0200 | |
---|---|---|
committer | 2018-07-16 18:25:34 +0200 | |
commit | 59a53fc819355fb2809b23544a5ca19ffff802fb (patch) | |
tree | e67cba5ca12cfbba7d2dc68e6c07fe36c996e3f2 /Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/src/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretation2logic/PartialInterpretation2Logic.xtend | |
parent | Support for building float, double and BigDecimal literals (diff) | |
download | VIATRA-Generator-59a53fc819355fb2809b23544a5ca19ffff802fb.tar.gz VIATRA-Generator-59a53fc819355fb2809b23544a5ca19ffff802fb.tar.zst VIATRA-Generator-59a53fc819355fb2809b23544a5ca19ffff802fb.zip |
Scope support for attributes
Diffstat (limited to 'Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/src/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretation2logic/PartialInterpretation2Logic.xtend')
1 files changed, 19 insertions, 3 deletions
diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/src/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretation2logic/PartialInterpretation2Logic.xtend b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/src/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretation2logic/PartialInterpretation2Logic.xtend index 5d8d9313..bba4ae92 100644 --- a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/src/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretation2logic/PartialInterpretation2Logic.xtend +++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/src/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretation2logic/PartialInterpretation2Logic.xtend | |||
@@ -24,6 +24,9 @@ import org.eclipse.xtend.lib.annotations.Data | |||
24 | 24 | ||
25 | import static extension hu.bme.mit.inf.dslreasoner.util.CollectionsUtil.* | 25 | import static extension hu.bme.mit.inf.dslreasoner.util.CollectionsUtil.* |
26 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.PrimitiveElement | 26 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.PrimitiveElement |
27 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.BooleanElement | ||
28 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.IntegerElement | ||
29 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.RealElement | ||
27 | 30 | ||
28 | @Data class PartialInterpretation2Logic_Trace { | 31 | @Data class PartialInterpretation2Logic_Trace { |
29 | Map<DefinedElement,DefinedElement> new2Old = new HashMap | 32 | Map<DefinedElement,DefinedElement> new2Old = new HashMap |
@@ -148,7 +151,7 @@ class PartialInterpretation2Logic { | |||
148 | val ^annotation= Partial2logicannotationsFactory.eINSTANCE.createPartialModelRelation2Assertion | 151 | val ^annotation= Partial2logicannotationsFactory.eINSTANCE.createPartialModelRelation2Assertion |
149 | ^annotation.target = assertion | 152 | ^annotation.target = assertion |
150 | ^annotation.targetRelation = relation | 153 | ^annotation.targetRelation = relation |
151 | ^annotation.links += links.map[EcoreUtil.copy(it)] | 154 | //^annotation.links += links.map[EcoreUtil.copy(it)] |
152 | //val error= assertion.eAllContents.toIterable.filter(SymbolicValue).filter[it.symbolicReference === null] | 155 | //val error= assertion.eAllContents.toIterable.filter(SymbolicValue).filter[it.symbolicReference === null] |
153 | //error.forEach[println("error")] | 156 | //error.forEach[println("error")] |
154 | p.add(assertion) | 157 | p.add(assertion) |
@@ -162,12 +165,25 @@ class PartialInterpretation2Logic { | |||
162 | if((link.param1 !== null) && (link.param2 !== null)) { | 165 | if((link.param1 !== null) && (link.param2 !== null)) { |
163 | return createSymbolicValue=>[ | 166 | return createSymbolicValue=>[ |
164 | it.symbolicReference=relationDeclaration | 167 | it.symbolicReference=relationDeclaration |
165 | it.parameterSubstitutions += createSymbolicValue => [it.symbolicReference = link.param1] | 168 | it.parameterSubstitutions += createValueInLink(link.param1) |
166 | it.parameterSubstitutions += createSymbolicValue => [it.symbolicReference = link.param2] | 169 | it.parameterSubstitutions += createValueInLink(link.param2) |
167 | ] | 170 | ] |
168 | } else { | 171 | } else { |
169 | throw new IllegalArgumentException | 172 | throw new IllegalArgumentException |
170 | } | 173 | } |
171 | } else throw new UnsupportedOperationException | 174 | } else throw new UnsupportedOperationException |
172 | } | 175 | } |
176 | |||
177 | def private dispatch createValueInLink(BooleanElement element) { | ||
178 | return element.value.asTerm | ||
179 | } | ||
180 | def private dispatch createValueInLink(IntegerElement element) { | ||
181 | return element.value.asTerm | ||
182 | } | ||
183 | def private dispatch createValueInLink(RealElement element) { | ||
184 | return element.value.asTerm | ||
185 | } | ||
186 | def private dispatch createValueInLink(DefinedElement element) { | ||
187 | return createSymbolicValue => [it.symbolicReference = element] | ||
188 | } | ||
173 | } \ No newline at end of file | 189 | } \ No newline at end of file |