diff options
author | 2018-06-13 15:52:11 +0200 | |
---|---|---|
committer | 2018-06-13 15:52:11 +0200 | |
commit | 16970bfa029b11680df1179722bd9dfd5a4dcf95 (patch) | |
tree | 9718c6ab7ef6348bd29eb5cb81ef4ef58b086217 /Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/PatternGenerator.xtend | |
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
Diffstat (limited to 'Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/PatternGenerator.xtend')
-rw-r--r-- | Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/PatternGenerator.xtend | 101 |
1 files changed, 33 insertions, 68 deletions
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 |