diff options
author | 2018-06-13 15:52:11 +0200 | |
---|---|---|
committer | 2018-06-13 15:52:11 +0200 | |
commit | 16970bfa029b11680df1179722bd9dfd5a4dcf95 (patch) | |
tree | 9718c6ab7ef6348bd29eb5cb81ef4ef58b086217 | |
parent | Updated partial model representation handling (diff) | |
download | VIATRA-Generator-16970bfa029b11680df1179722bd9dfd5a4dcf95.tar.gz VIATRA-Generator-16970bfa029b11680df1179722bd9dfd5a4dcf95.tar.zst VIATRA-Generator-16970bfa029b11680df1179722bd9dfd5a4dcf95.zip |
Support for updated partial model representation during generationScope-PS-Refactor
7 files changed, 53 insertions, 89 deletions
diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/GenericTypeIndexer.xtend b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/GenericTypeIndexer.xtend index a703ba4b..2dae95be 100644 --- a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/GenericTypeIndexer.xtend +++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/GenericTypeIndexer.xtend | |||
@@ -20,11 +20,11 @@ class GenericTypeIndexer extends TypeIndexer { | |||
20 | PartialInterpretation.newElements(interpretation,element); | 20 | PartialInterpretation.newElements(interpretation,element); |
21 | } | 21 | } |
22 | 22 | ||
23 | private pattern typeInterpretation(problem:LogicProblem, interpetation:PartialInterpretation, type:TypeDeclaration, typeInterpretation:PartialTypeInterpratation) { | 23 | private pattern typeInterpretation(problem:LogicProblem, interpetation:PartialInterpretation, type:TypeDeclaration, typeInterpretation:PartialComplexTypeInterpretation) { |
24 | find interpretation(problem,interpetation); | 24 | find interpretation(problem,interpetation); |
25 | LogicProblem.types(problem,type); | 25 | LogicProblem.types(problem,type); |
26 | PartialInterpretation.partialtypeinterpratation(interpetation,typeInterpretation); | 26 | PartialInterpretation.partialtypeinterpratation(interpetation,typeInterpretation); |
27 | PartialTypeInterpratation.interpretationOf(typeInterpretation,type); | 27 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); |
28 | } | 28 | } |
29 | 29 | ||
30 | private pattern directInstanceOf(problem:LogicProblem, interpetation:PartialInterpretation, element:DefinedElement, type:Type) { | 30 | private pattern directInstanceOf(problem:LogicProblem, interpetation:PartialInterpretation, element:DefinedElement, type:Type) { |
@@ -35,7 +35,7 @@ class GenericTypeIndexer extends TypeIndexer { | |||
35 | } or { | 35 | } or { |
36 | find mustExist(problem,interpetation,element); | 36 | find mustExist(problem,interpetation,element); |
37 | find typeInterpretation(problem,interpetation,type,typeInterpretation); | 37 | find typeInterpretation(problem,interpetation,type,typeInterpretation); |
38 | PartialTypeInterpratation.elements(typeInterpretation,element); | 38 | PartialComplexTypeInterpretation.elements(typeInterpretation,element); |
39 | } | 39 | } |
40 | 40 | ||
41 | /** | 41 | /** |
diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/GenericTypeRefinementGenerator.xtend b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/GenericTypeRefinementGenerator.xtend index c9e183ab..1aa3b955 100644 --- a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/GenericTypeRefinementGenerator.xtend +++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/GenericTypeRefinementGenerator.xtend | |||
@@ -42,7 +42,7 @@ class GenericTypeRefinementGenerator extends TypeRefinementGenerator { | |||
42 | { | 42 | { |
43 | find interpretation(problem,interpretation); | 43 | find interpretation(problem,interpretation); |
44 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | 44 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); |
45 | PartialTypeInterpratation.interpretationOf.name(typeInterpretation,"«type.name»"); | 45 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"«type.name»"); |
46 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | 46 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); |
47 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"«containmentRelation.name»"); | 47 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"«containmentRelation.name»"); |
48 | PartialInterpretation.partialrelationinterpretation(interpretation,inverseInterpretation); | 48 | PartialInterpretation.partialrelationinterpretation(interpretation,inverseInterpretation); |
@@ -61,7 +61,7 @@ class GenericTypeRefinementGenerator extends TypeRefinementGenerator { | |||
61 | { | 61 | { |
62 | find interpretation(problem,interpretation); | 62 | find interpretation(problem,interpretation); |
63 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | 63 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); |
64 | PartialTypeInterpratation.interpretationOf.name(typeInterpretation,"«type.name»"); | 64 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"«type.name»"); |
65 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | 65 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); |
66 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"«containmentRelation.name»"); | 66 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"«containmentRelation.name»"); |
67 | «base.typeIndexer.referInstanceOf((containmentRelation.parameters.get(0) as ComplexTypeReference).referred,Modality.MUST,"container")» | 67 | «base.typeIndexer.referInstanceOf((containmentRelation.parameters.get(0) as ComplexTypeReference).referred,Modality.MUST,"container")» |
@@ -79,7 +79,7 @@ class GenericTypeRefinementGenerator extends TypeRefinementGenerator { | |||
79 | find interpretation(problem,interpretation); | 79 | find interpretation(problem,interpretation); |
80 | neg find hasElementInContainment(problem,interpretation); | 80 | neg find hasElementInContainment(problem,interpretation); |
81 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | 81 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); |
82 | PartialTypeInterpratation.interpretationOf.name(type,"«type.name»"); | 82 | PartialComplexTypeInterpretation.interpretationOf.name(type,"«type.name»"); |
83 | «base.typeIndexer.referInstanceOf(type,Modality.MAY,"newObject")» | 83 | «base.typeIndexer.referInstanceOf(type,Modality.MAY,"newObject")» |
84 | find mayExist(problem, interpretation, newObject); | 84 | find mayExist(problem, interpretation, newObject); |
85 | neg find mustExist(problem, interpretation, newObject); | 85 | neg find mustExist(problem, interpretation, newObject); |
@@ -91,7 +91,7 @@ class GenericTypeRefinementGenerator extends TypeRefinementGenerator { | |||
91 | { | 91 | { |
92 | find interpretation(problem,interpretation); | 92 | find interpretation(problem,interpretation); |
93 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | 93 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); |
94 | PartialTypeInterpratation.interpretationOf.name(typeInterpretation,"«type.name»"); | 94 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"«type.name»"); |
95 | «base.typeIndexer.referInstanceOf(type,Modality.MAY,"newObject")» | 95 | «base.typeIndexer.referInstanceOf(type,Modality.MAY,"newObject")» |
96 | find mayExist(problem, interpretation, newObject); | 96 | find mayExist(problem, interpretation, newObject); |
97 | neg find mustExist(problem, interpretation, newObject); | 97 | neg find mustExist(problem, interpretation, newObject); |
diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/PatternGenerator.xtend b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/PatternGenerator.xtend index 34094cac..001ff13f 100644 --- a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/PatternGenerator.xtend +++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/PatternGenerator.xtend | |||
@@ -177,58 +177,23 @@ class PatternGenerator { | |||
177 | find interpretation(problem,interpetation); | 177 | find interpretation(problem,interpetation); |
178 | PartialInterpretation.newElements(interpetation,element); | 178 | PartialInterpretation.newElements(interpetation,element); |
179 | } | 179 | } |
180 | «IF problem.hasBoolean»or { | ||
181 | find interpretation(problem,interpetation); | ||
182 | PartialInterpretation.booleanelements(interpetation,element); | ||
183 | }«ENDIF» | ||
184 | «IF problem.hasInteger»or { | ||
185 | find interpretation(problem,interpetation); | ||
186 | PartialInterpretation.integerelements(interpetation,element); | ||
187 | }«ENDIF» | ||
188 | «IF problem.hasReal»or { | ||
189 | find interpretation(problem,interpetation); | ||
190 | PartialInterpretation.realelements(interpetation,element); | ||
191 | }«ENDIF» | ||
192 | «IF problem.hasString»or { | ||
193 | find interpretation(problem,interpetation); | ||
194 | PartialInterpretation.stringelements(interpetation,element); | ||
195 | }«ENDIF» | ||
196 | 180 | ||
197 | private pattern mayExist(problem:LogicProblem, interpetation:PartialInterpretation, element:DefinedElement) { | 181 | private pattern mayExist(problem:LogicProblem, interpetation:PartialInterpretation, element:DefinedElement) { |
198 | find mustExist(problem,interpetation,element); | 182 | find mustExist(problem,interpetation,element); |
199 | } or { | 183 | } or { |
200 | find interpretation(problem,interpetation); | 184 | find interpretation(problem,interpetation); |
201 | neg find elementCloseWorld(interpetation); | 185 | neg find elementCloseWorld(interpetation); |
202 | PartialInterpretation.openWorldElementPrototypes(interpetation,element); | 186 | PartialInterpretation.openWorldElements(interpetation,element); |
203 | } | 187 | } |
204 | «IF problem.hasInteger»or { | ||
205 | find interpretation(problem,interpetation); | ||
206 | neg find integerCloseWorld(interpetation); | ||
207 | PartialInterpretation.newIntegers(interpetation,element); | ||
208 | }«ENDIF» | ||
209 | «IF problem.hasReal»or { | ||
210 | find interpretation(problem,interpetation); | ||
211 | neg find realCloseWorld(interpetation); | ||
212 | PartialInterpretation.newReals(interpetation,element); | ||
213 | }«ENDIF» | ||
214 | «IF problem.hasString»or { | ||
215 | find interpretation(problem,interpetation); | ||
216 | neg find stringCloseWorld(interpetation); | ||
217 | PartialInterpretation.newStrings(interpetation,element); | ||
218 | }«ENDIF» | ||
219 | 188 | ||
220 | private pattern elementCloseWorld(interpetation:PartialInterpretation) { | 189 | private pattern elementCloseWorld(element:DefinedElement) { |
221 | PartialInterpretation.maxNewElements(interpetation,0); | 190 | PartialInterpretation.newElements(i,element); |
191 | PartialInterpretation.maxNewElements(i,0); | ||
192 | } or { | ||
193 | Scope.targetTypeInterpretation(scope,interpetation); | ||
194 | PartialTypeInterpratation.elements(interpetation,element); | ||
195 | Scope.maxNewElements(scope,0); | ||
222 | } | 196 | } |
223 | «IF problem.hasInteger»private pattern integerCloseWorld(interpetation:PartialInterpretation) { | ||
224 | PartialInterpretation.maxNewIntegers(interpetation,0); | ||
225 | }«ENDIF» | ||
226 | «IF problem.hasReal»private pattern realCloseWorld(interpetation:PartialInterpretation) { | ||
227 | PartialInterpretation.maxNewReals(interpetation,0); | ||
228 | }«ENDIF» | ||
229 | «IF problem.hasString»private pattern stringCloseWorld(interpetation:PartialInterpretation) { | ||
230 | PartialInterpretation.maxNewStrings(interpetation,0); | ||
231 | }«ENDIF» | ||
232 | 197 | ||
233 | //////////////////////// | 198 | //////////////////////// |
234 | // 0.2 Equivalence | 199 | // 0.2 Equivalence |
@@ -251,31 +216,31 @@ class PatternGenerator { | |||
251 | ////////// | 216 | ////////// |
252 | // 1.1.1 primitive Type Indexers | 217 | // 1.1.1 primitive Type Indexers |
253 | ////////// | 218 | ////////// |
254 | pattern instanceofBoolean(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | 219 | ««« pattern instanceofBoolean(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { |
255 | find interpretation(problem,interpretation); | 220 | ««« find interpretation(problem,interpretation); |
256 | PartialInterpretation.booleanelements(interpretation,element); | 221 | ««« PartialInterpretation.booleanelements(interpretation,element); |
257 | } | 222 | ««« } |
258 | pattern instanceofInteger(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | 223 | ««« pattern instanceofInteger(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { |
259 | find interpretation(problem,interpretation); | 224 | ««« find interpretation(problem,interpretation); |
260 | PartialInterpretation.integerelements(interpretation,element); | 225 | ««« PartialInterpretation.integerelements(interpretation,element); |
261 | } or { | 226 | ««« } or { |
262 | find interpretation(problem,interpretation); | 227 | ««« find interpretation(problem,interpretation); |
263 | PartialInterpretation.newIntegers(interpetation,element); | 228 | ««« PartialInterpretation.newIntegers(interpetation,element); |
264 | } | 229 | ««« } |
265 | pattern instanceofReal(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | 230 | ««« pattern instanceofReal(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { |
266 | find interpretation(problem,interpretation); | 231 | ««« find interpretation(problem,interpretation); |
267 | PartialInterpretation.realelements(interpretation,element); | 232 | ««« PartialInterpretation.realelements(interpretation,element); |
268 | } or { | 233 | ««« } or { |
269 | find interpretation(problem,interpretation); | 234 | ««« find interpretation(problem,interpretation); |
270 | PartialInterpretation.newReals(interpetation,element); | 235 | ««« PartialInterpretation.newReals(interpetation,element); |
271 | } | 236 | ««« } |
272 | pattern instanceofString(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | 237 | ««« pattern instanceofString(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { |
273 | find interpretation(problem,interpretation); | 238 | ««« find interpretation(problem,interpretation); |
274 | PartialInterpretation.stringelements(interpretation,element); | 239 | ««« PartialInterpretation.stringelements(interpretation,element); |
275 | } or { | 240 | ««« } or { |
276 | find interpretation(problem,interpretation); | 241 | ««« find interpretation(problem,interpretation); |
277 | PartialInterpretation.newStrings(interpetation,element); | 242 | ««« PartialInterpretation.newStrings(interpetation,element); |
278 | } | 243 | ««« } |
279 | 244 | ||
280 | ////////// | 245 | ////////// |
281 | // 1.1.2 domain-specific Type Indexers | 246 | // 1.1.2 domain-specific Type Indexers |
diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/TypeIndexerWithPreliminaryTypeAnalysis.xtend b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/TypeIndexerWithPreliminaryTypeAnalysis.xtend index fd0b7c18..7bdb9a5b 100644 --- a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/TypeIndexerWithPreliminaryTypeAnalysis.xtend +++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/TypeIndexerWithPreliminaryTypeAnalysis.xtend | |||
@@ -18,11 +18,11 @@ class TypeIndexerWithPreliminaryTypeAnalysis extends TypeIndexer{ | |||
18 | override requiresTypeAnalysis() { true } | 18 | override requiresTypeAnalysis() { true } |
19 | 19 | ||
20 | override getRequiredQueries() ''' | 20 | override getRequiredQueries() ''' |
21 | private pattern typeInterpretation(problem:LogicProblem, interpetation:PartialInterpretation, type:TypeDeclaration, typeInterpretation:PartialTypeInterpratation) { | 21 | private pattern typeInterpretation(problem:LogicProblem, interpetation:PartialInterpretation, type:TypeDeclaration, typeInterpretation:PartialComplexTypeInterpretation) { |
22 | find interpretation(problem,interpetation); | 22 | find interpretation(problem,interpetation); |
23 | LogicProblem.types(problem,type); | 23 | LogicProblem.types(problem,type); |
24 | PartialInterpretation.partialtypeinterpratation(interpetation,typeInterpretation); | 24 | PartialInterpretation.partialtypeinterpratation(interpetation,typeInterpretation); |
25 | PartialTypeInterpratation.interpretationOf(typeInterpretation,type); | 25 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); |
26 | } | 26 | } |
27 | 27 | ||
28 | private pattern directInstanceOf(problem:LogicProblem, interpetation:PartialInterpretation, element:DefinedElement, type:Type) { | 28 | private pattern directInstanceOf(problem:LogicProblem, interpetation:PartialInterpretation, element:DefinedElement, type:Type) { |
@@ -32,7 +32,7 @@ class TypeIndexerWithPreliminaryTypeAnalysis extends TypeIndexer{ | |||
32 | } or { | 32 | } or { |
33 | find interpretation(problem,interpetation); | 33 | find interpretation(problem,interpetation); |
34 | find typeInterpretation(problem,interpetation,type,typeInterpretation); | 34 | find typeInterpretation(problem,interpetation,type,typeInterpretation); |
35 | PartialTypeInterpratation.elements(typeInterpretation,element); | 35 | PartialComplexTypeInterpretation.elements(typeInterpretation,element); |
36 | } | 36 | } |
37 | ''' | 37 | ''' |
38 | 38 | ||
@@ -81,7 +81,7 @@ class TypeIndexerWithPreliminaryTypeAnalysis extends TypeIndexer{ | |||
81 | «ENDFOR» | 81 | «ENDFOR» |
82 | } or { | 82 | } or { |
83 | find interpretation(problem,interpretation); | 83 | find interpretation(problem,interpretation); |
84 | PartialInterpretation.openWorldElementPrototypes(interpetation,element); | 84 | PartialInterpretation.openWorldElements(interpetation,element); |
85 | } or | 85 | } or |
86 | «ENDIF» | 86 | «ENDIF» |
87 | { «referInstanceOf(type,Modality.MUST,"element")» } | 87 | { «referInstanceOf(type,Modality.MUST,"element")» } |
diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/TypeRefinementWithPreliminaryTypeAnalysis.xtend b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/TypeRefinementWithPreliminaryTypeAnalysis.xtend index 8a6efeeb..7c5f507b 100644 --- a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/TypeRefinementWithPreliminaryTypeAnalysis.xtend +++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/TypeRefinementWithPreliminaryTypeAnalysis.xtend | |||
@@ -41,7 +41,7 @@ class TypeRefinementWithPreliminaryTypeAnalysis extends TypeRefinementGenerator{ | |||
41 | { | 41 | { |
42 | find interpretation(problem,interpretation); | 42 | find interpretation(problem,interpretation); |
43 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | 43 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); |
44 | PartialTypeInterpratation.interpretationOf.name(typeInterpretation,"«type.name»"); | 44 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"«type.name»"); |
45 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | 45 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); |
46 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"«containmentRelation.name»"); | 46 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"«containmentRelation.name»"); |
47 | PartialInterpretation.partialrelationinterpretation(interpretation,inverseInterpretation); | 47 | PartialInterpretation.partialrelationinterpretation(interpretation,inverseInterpretation); |
@@ -60,7 +60,7 @@ class TypeRefinementWithPreliminaryTypeAnalysis extends TypeRefinementGenerator{ | |||
60 | { | 60 | { |
61 | find interpretation(problem,interpretation); | 61 | find interpretation(problem,interpretation); |
62 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | 62 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); |
63 | PartialTypeInterpratation.interpretationOf.name(typeInterpretation,"«type.name»"); | 63 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"«type.name»"); |
64 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | 64 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); |
65 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"«containmentRelation.name»"); | 65 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"«containmentRelation.name»"); |
66 | «base.typeIndexer.referInstanceOf((containmentRelation.parameters.get(0) as ComplexTypeReference).referred,Modality.MUST,"container")» | 66 | «base.typeIndexer.referInstanceOf((containmentRelation.parameters.get(0) as ComplexTypeReference).referred,Modality.MUST,"container")» |
@@ -78,7 +78,7 @@ class TypeRefinementWithPreliminaryTypeAnalysis extends TypeRefinementGenerator{ | |||
78 | find interpretation(problem,interpretation); | 78 | find interpretation(problem,interpretation); |
79 | neg find hasElementInContainment(problem,interpretation); | 79 | neg find hasElementInContainment(problem,interpretation); |
80 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | 80 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); |
81 | PartialTypeInterpratation.interpretationOf.name(typeInterpretation,"«type.name»"); | 81 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"«type.name»"); |
82 | «base.typeIndexer.referInstanceOf(type,Modality.MAY,"newObject")» | 82 | «base.typeIndexer.referInstanceOf(type,Modality.MAY,"newObject")» |
83 | find mayExist(problem, interpretation, newObject); | 83 | find mayExist(problem, interpretation, newObject); |
84 | neg find mustExist(problem, interpretation, newObject); | 84 | neg find mustExist(problem, interpretation, newObject); |
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 1e7b3c4c..0a21d99e 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 | |||
@@ -5,13 +5,12 @@ import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.LogiclanguageFactory | |||
5 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Relation | 5 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Relation |
6 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.RelationDeclaration | 6 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.RelationDeclaration |
7 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Type | 7 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Type |
8 | import hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.LogicProblem | ||
9 | import hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.ModelGenerationStatistics | 8 | import hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.ModelGenerationStatistics |
10 | import hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.patterns.GeneratedPatterns | 9 | import hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.patterns.GeneratedPatterns |
11 | import hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.patterns.ObjectCreationPrecondition | 10 | import hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.patterns.ObjectCreationPrecondition |
11 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.PartialComplexTypeInterpretation | ||
12 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.PartialInterpretation | 12 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.PartialInterpretation |
13 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.PartialRelationInterpretation | 13 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.PartialRelationInterpretation |
14 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.PartialTypeInterpratation | ||
15 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.PartialinterpretationFactory | 14 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.PartialinterpretationFactory |
16 | import java.util.LinkedHashMap | 15 | import java.util.LinkedHashMap |
17 | import org.eclipse.viatra.query.runtime.api.GenericPatternMatch | 16 | import org.eclipse.viatra.query.runtime.api.GenericPatternMatch |
@@ -71,7 +70,7 @@ class RefinementRuleProvider { | |||
71 | val interpretation = match.get(1) as PartialInterpretation | 70 | val interpretation = match.get(1) as PartialInterpretation |
72 | val relationInterpretation = match.get(2) as PartialRelationInterpretation | 71 | val relationInterpretation = match.get(2) as PartialRelationInterpretation |
73 | val inverseRelationInterpretation = match.get(3) as PartialRelationInterpretation | 72 | val inverseRelationInterpretation = match.get(3) as PartialRelationInterpretation |
74 | val typeInterpretation = match.get(4) as PartialTypeInterpratation | 73 | val typeInterpretation = match.get(4) as PartialComplexTypeInterpretation |
75 | val container = match.get(5) as DefinedElement | 74 | val container = match.get(5) as DefinedElement |
76 | 75 | ||
77 | val newElement = createDefinedElement | 76 | val newElement = createDefinedElement |
@@ -104,7 +103,7 @@ class RefinementRuleProvider { | |||
104 | //val problem = match.get(0) as LogicProblem | 103 | //val problem = match.get(0) as LogicProblem |
105 | val interpretation = match.get(1) as PartialInterpretation | 104 | val interpretation = match.get(1) as PartialInterpretation |
106 | val relationInterpretation = match.get(2) as PartialRelationInterpretation | 105 | val relationInterpretation = match.get(2) as PartialRelationInterpretation |
107 | val typeInterpretation = match.get(3) as PartialTypeInterpratation | 106 | val typeInterpretation = match.get(3) as PartialComplexTypeInterpretation |
108 | val container = match.get(4) as DefinedElement | 107 | val container = match.get(4) as DefinedElement |
109 | 108 | ||
110 | val newElement = createDefinedElement | 109 | val newElement = createDefinedElement |
@@ -133,7 +132,7 @@ class RefinementRuleProvider { | |||
133 | val startTime = System.nanoTime | 132 | val startTime = System.nanoTime |
134 | //val problem = match.get(0) as LogicProblem | 133 | //val problem = match.get(0) as LogicProblem |
135 | val interpretation = match.get(1) as PartialInterpretation | 134 | val interpretation = match.get(1) as PartialInterpretation |
136 | val typeInterpretation = match.get(2) as PartialTypeInterpratation | 135 | val typeInterpretation = match.get(2) as PartialComplexTypeInterpretation |
137 | 136 | ||
138 | val newElement = createDefinedElement | 137 | val newElement = createDefinedElement |
139 | if(nameNewElement) { | 138 | if(nameNewElement) { |
diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/util/ParseUtil.xtend b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/util/ParseUtil.xtend index 90b4f261..b6eddcd2 100644 --- a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/util/ParseUtil.xtend +++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/util/ParseUtil.xtend | |||
@@ -98,7 +98,7 @@ class ParseUtil { | |||
98 | val patternModel = resource.getContents().get(0) as PatternModel; | 98 | val patternModel = resource.getContents().get(0) as PatternModel; |
99 | 99 | ||
100 | EcoreUtil.resolveAll(resource) | 100 | EcoreUtil.resolveAll(resource) |
101 | //resource.validate | 101 | resource.validate |
102 | val res = new LinkedHashMap<String,IQuerySpecification<? extends ViatraQueryMatcher<? extends IPatternMatch>>> | 102 | val res = new LinkedHashMap<String,IQuerySpecification<? extends ViatraQueryMatcher<? extends IPatternMatch>>> |
103 | val patterns = new LinkedList<IQuerySpecification<?>> | 103 | val patterns = new LinkedList<IQuerySpecification<?>> |
104 | for(pattern : patternModel.patterns) { | 104 | for(pattern : patternModel.patterns) { |
@@ -106,7 +106,7 @@ class ParseUtil { | |||
106 | res.put(querySpecification.fullyQualifiedName,querySpecification) | 106 | res.put(querySpecification.fullyQualifiedName,querySpecification) |
107 | patterns += querySpecification | 107 | patterns += querySpecification |
108 | } | 108 | } |
109 | //resource.validate | 109 | resource.validate |
110 | 110 | ||
111 | return res | 111 | return res |
112 | } | 112 | } |