diff options
author | 2017-08-15 02:55:57 +0200 | |
---|---|---|
committer | 2017-08-15 02:55:57 +0200 | |
commit | 1cc691755412d988975357316d7ef079e45458aa (patch) | |
tree | 5e0a2d11a9d0e8e623d609ef0c1cdbc4a2c56fb9 /Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretation2logic/src/hu/bme/mit/inf | |
parent | Partial interpretation from initial instance model (diff) | |
download | VIATRA-Generator-1cc691755412d988975357316d7ef079e45458aa.tar.gz VIATRA-Generator-1cc691755412d988975357316d7ef079e45458aa.tar.zst VIATRA-Generator-1cc691755412d988975357316d7ef079e45458aa.zip |
Type scope support for initial instance model mapping
Diffstat (limited to 'Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretation2logic/src/hu/bme/mit/inf')
2 files changed, 11 insertions, 6 deletions
diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretation2logic/src/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretation2logic/InstanceModel2Logic.xtend b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretation2logic/src/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretation2logic/InstanceModel2Logic.xtend index 2910a702..216ae348 100644 --- a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretation2logic/src/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretation2logic/InstanceModel2Logic.xtend +++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretation2logic/src/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretation2logic/InstanceModel2Logic.xtend | |||
@@ -5,6 +5,7 @@ import hu.bme.mit.inf.dslreasoner.logic.model.builder.TracedOutput | |||
5 | import hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.LogicProblem | 5 | import hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.LogicProblem |
6 | import java.util.List | 6 | import java.util.List |
7 | import org.eclipse.emf.ecore.EObject | 7 | import org.eclipse.emf.ecore.EObject |
8 | import hu.bme.mit.inf.dslreasoner.logic.model.builder.TypeScopes | ||
8 | 9 | ||
9 | class InstanceModel2Logic { | 10 | class InstanceModel2Logic { |
10 | val InstanceModel2PartialInterpretation instanceModel2PartialInterpretation = new InstanceModel2PartialInterpretation | 11 | val InstanceModel2PartialInterpretation instanceModel2PartialInterpretation = new InstanceModel2PartialInterpretation |
@@ -12,9 +13,10 @@ class InstanceModel2Logic { | |||
12 | 13 | ||
13 | public def transform( | 14 | public def transform( |
14 | TracedOutput<LogicProblem, Ecore2Logic_Trace> metamodelTranslationResult, | 15 | TracedOutput<LogicProblem, Ecore2Logic_Trace> metamodelTranslationResult, |
15 | List<EObject> objects) | 16 | List<EObject> objects, |
17 | TypeScopes typeScopes) | ||
16 | { | 18 | { |
17 | val res1 = this.instanceModel2PartialInterpretation.transform(metamodelTranslationResult,objects,true) | 19 | val res1 = this.instanceModel2PartialInterpretation.transform(metamodelTranslationResult,objects,true,typeScopes) |
18 | this.partialInterpretation2Logic.transformPartialIntepretation2Logic(metamodelTranslationResult.output,res1) | 20 | this.partialInterpretation2Logic.transformPartialIntepretation2Logic(metamodelTranslationResult.output,res1) |
19 | return metamodelTranslationResult//.output | 21 | return metamodelTranslationResult//.output |
20 | } | 22 | } |
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 96e174a4..4c6cf769 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 | |||
@@ -19,6 +19,7 @@ import org.eclipse.emf.ecore.EObject | |||
19 | import static extension hu.bme.mit.inf.dslreasoner.util.CollectionsUtil.* | 19 | import static extension hu.bme.mit.inf.dslreasoner.util.CollectionsUtil.* |
20 | import org.eclipse.emf.ecore.resource.Resource | 20 | import org.eclipse.emf.ecore.resource.Resource |
21 | import hu.bme.mit.inf.dslreasoner.logic.model.builder.TracedOutput | 21 | import hu.bme.mit.inf.dslreasoner.logic.model.builder.TracedOutput |
22 | import hu.bme.mit.inf.dslreasoner.logic.model.builder.TypeScopes | ||
22 | 23 | ||
23 | class InstanceModel2PartialInterpretation { | 24 | class InstanceModel2PartialInterpretation { |
24 | val extension LogiclanguageFactory factory = LogiclanguageFactory.eINSTANCE | 25 | val extension LogiclanguageFactory factory = LogiclanguageFactory.eINSTANCE |
@@ -29,20 +30,22 @@ class InstanceModel2PartialInterpretation { | |||
29 | public def transform( | 30 | public def transform( |
30 | TracedOutput<LogicProblem, Ecore2Logic_Trace> metamodelTranslationResult, | 31 | TracedOutput<LogicProblem, Ecore2Logic_Trace> metamodelTranslationResult, |
31 | Resource resource, | 32 | Resource resource, |
32 | boolean withID) | 33 | boolean withID, |
34 | TypeScopes typeScopes) | ||
33 | { | 35 | { |
34 | val objects = resource.allContents.toList | 36 | val objects = resource.allContents.toList |
35 | return transform(metamodelTranslationResult,objects,withID) | 37 | return transform(metamodelTranslationResult,objects,withID,typeScopes) |
36 | } | 38 | } |
37 | 39 | ||
38 | public def transform( | 40 | public def transform( |
39 | TracedOutput<LogicProblem, Ecore2Logic_Trace> metamodelTranslationResult, | 41 | TracedOutput<LogicProblem, Ecore2Logic_Trace> metamodelTranslationResult, |
40 | List<EObject> objects, | 42 | List<EObject> objects, |
41 | boolean withID) | 43 | boolean withID, |
44 | TypeScopes typeScopes) | ||
42 | { | 45 | { |
43 | val problem = metamodelTranslationResult.output | 46 | val problem = metamodelTranslationResult.output |
44 | val ecore2LogicTrace = metamodelTranslationResult.trace | 47 | val ecore2LogicTrace = metamodelTranslationResult.trace |
45 | val tracedOutput = partialInterpretationInitialiser.initialisePartialInterpretation(problem, null) | 48 | val tracedOutput = partialInterpretationInitialiser.initialisePartialInterpretation(problem, typeScopes) |
46 | val partialInterpretation = tracedOutput.output | 49 | val partialInterpretation = tracedOutput.output |
47 | val partialInterpretationTrace = tracedOutput.trace | 50 | val partialInterpretationTrace = tracedOutput.trace |
48 | 51 | ||