diff options
author | 2020-04-27 10:45:28 -0400 | |
---|---|---|
committer | 2020-04-27 10:45:28 -0400 | |
commit | 36ca60e5b6bd047a4f444d96241bd60a01bbab17 (patch) | |
tree | 472ee15861945af6b7056d19250734ffab4c3aef /Tests/MODELS2020-CaseStudies/case.study.familyTree.run/outputs/debug | |
parent | Merge branch 'Attribute-Solver' (diff) | |
download | VIATRA-Generator-36ca60e5b6bd047a4f444d96241bd60a01bbab17.tar.gz VIATRA-Generator-36ca60e5b6bd047a4f444d96241bd60a01bbab17.tar.zst VIATRA-Generator-36ca60e5b6bd047a4f444d96241bd60a01bbab17.zip |
rename Pledge Case Studies and add familyTree case study
Diffstat (limited to 'Tests/MODELS2020-CaseStudies/case.study.familyTree.run/outputs/debug')
3 files changed, 913 insertions, 0 deletions
diff --git a/Tests/MODELS2020-CaseStudies/case.study.familyTree.run/outputs/debug/generated3valued.vql_deactivated b/Tests/MODELS2020-CaseStudies/case.study.familyTree.run/outputs/debug/generated3valued.vql_deactivated new file mode 100644 index 00000000..bbaa6a26 --- /dev/null +++ b/Tests/MODELS2020-CaseStudies/case.study.familyTree.run/outputs/debug/generated3valued.vql_deactivated | |||
@@ -0,0 +1,672 @@ | |||
1 | import epackage "http://www.bme.hu/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage" | ||
2 | import epackage "http://www.bme.hu/mit/inf/dslreasoner/logic/model/problem" | ||
3 | import epackage "http://www.bme.hu/mit/inf/dslreasoner/logic/model/language" | ||
4 | |||
5 | ////////// | ||
6 | // 0. Util | ||
7 | ////////// | ||
8 | private pattern interpretation(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
9 | PartialInterpretation.problem(interpretation,problem); | ||
10 | } | ||
11 | |||
12 | ///////////////////////// | ||
13 | // 0.1 Existence | ||
14 | ///////////////////////// | ||
15 | /** [[exist(element)]]=1 */ | ||
16 | private pattern mustExist(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
17 | find interpretation(problem,interpretation); | ||
18 | LogicProblem.elements(problem,element); | ||
19 | } or { | ||
20 | find interpretation(problem,interpretation); | ||
21 | PartialInterpretation.newElements(interpretation,element); | ||
22 | } | ||
23 | |||
24 | /** [[exist(element)]]>=1/2 */ | ||
25 | private pattern mayExist(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
26 | find mustExist(problem,interpretation,element); | ||
27 | } or { | ||
28 | find interpretation(problem,interpretation); | ||
29 | neg find elementCloseWorld(element); | ||
30 | PartialInterpretation.openWorldElements(interpretation,element); | ||
31 | } | ||
32 | |||
33 | private pattern elementCloseWorld(element:DefinedElement) { | ||
34 | PartialInterpretation.openWorldElements(i,element); | ||
35 | PartialInterpretation.maxNewElements(i,0); | ||
36 | } or { | ||
37 | Scope.targetTypeInterpretation(scope,interpretation); | ||
38 | PartialTypeInterpratation.elements(interpretation,element); | ||
39 | Scope.maxNewElements(scope,0); | ||
40 | } | ||
41 | |||
42 | //////////////////////// | ||
43 | // 0.2 Equivalence | ||
44 | //////////////////////// | ||
45 | pattern mayEquivalent(problem:LogicProblem, interpretation:PartialInterpretation, a: DefinedElement, b: DefinedElement) | ||
46 | // For non-primitive type. Boolean types always must equivalent or cannot equivalent | ||
47 | { | ||
48 | find mayExist(problem,interpretation,a); | ||
49 | find mayExist(problem,interpretation,b); | ||
50 | a == b; | ||
51 | } or { | ||
52 | find mayExist(problem,interpretation,a); | ||
53 | find mayExist(problem,interpretation,b); | ||
54 | IntegerElement(a); | ||
55 | IntegerElement(b); | ||
56 | PrimitiveElement.valueSet(a,false); | ||
57 | } or { | ||
58 | find mayExist(problem,interpretation,a); | ||
59 | find mayExist(problem,interpretation,b); | ||
60 | IntegerElement(a); | ||
61 | IntegerElement(b); | ||
62 | PrimitiveElement.valueSet(b,false); | ||
63 | } or { | ||
64 | find mayExist(problem,interpretation,a); | ||
65 | find mayExist(problem,interpretation,b); | ||
66 | RealElement(a); | ||
67 | RealElement(b); | ||
68 | PrimitiveElement.valueSet(a,false); | ||
69 | } or { | ||
70 | find mayExist(problem,interpretation,a); | ||
71 | find mayExist(problem,interpretation,b); | ||
72 | RealElement(a); | ||
73 | RealElement(b); | ||
74 | PrimitiveElement.valueSet(b,false); | ||
75 | } or { | ||
76 | find mayExist(problem,interpretation,a); | ||
77 | find mayExist(problem,interpretation,b); | ||
78 | RealElement(a); | ||
79 | IntegerElement(b); | ||
80 | PrimitiveElement.valueSet(a,false); | ||
81 | } or { | ||
82 | find mayExist(problem,interpretation,a); | ||
83 | find mayExist(problem,interpretation,b); | ||
84 | RealElement(a); | ||
85 | IntegerElement(b); | ||
86 | PrimitiveElement.valueSet(b,false); | ||
87 | } or { | ||
88 | find mayExist(problem,interpretation,a); | ||
89 | find mayExist(problem,interpretation,b); | ||
90 | IntegerElement(a); | ||
91 | RealElement(b); | ||
92 | PrimitiveElement.valueSet(a,false); | ||
93 | } or { | ||
94 | find mayExist(problem,interpretation,a); | ||
95 | find mayExist(problem,interpretation,b); | ||
96 | IntegerElement(a); | ||
97 | RealElement(b); | ||
98 | PrimitiveElement.valueSet(b,false); | ||
99 | } or { | ||
100 | find mayExist(problem,interpretation,a); | ||
101 | find mayExist(problem,interpretation,b); | ||
102 | StringElement(a); | ||
103 | StringElement(b); | ||
104 | PrimitiveElement.valueSet(a,false); | ||
105 | } or { | ||
106 | find mayExist(problem,interpretation,a); | ||
107 | find mayExist(problem,interpretation,b); | ||
108 | StringElement(a); | ||
109 | StringElement(b); | ||
110 | PrimitiveElement.valueSet(b,false); | ||
111 | } | ||
112 | |||
113 | pattern mustEquivalent(problem:LogicProblem, interpretation:PartialInterpretation, a: DefinedElement, b: DefinedElement) { | ||
114 | // For non-primitive and Boolean primitive type | ||
115 | find mustExist(problem,interpretation,a); | ||
116 | find mustExist(problem,interpretation,b); | ||
117 | a == b; | ||
118 | } or { | ||
119 | find mustExist(problem,interpretation,a); | ||
120 | find mustExist(problem,interpretation,b); | ||
121 | PrimitiveElement.valueSet(a,true); | ||
122 | PrimitiveElement.valueSet(b,true); | ||
123 | IntegerElement.value(a,value); | ||
124 | IntegerElement.value(b,value); | ||
125 | } or { | ||
126 | find mustExist(problem,interpretation,a); | ||
127 | find mustExist(problem,interpretation,b); | ||
128 | PrimitiveElement.valueSet(a,true); | ||
129 | PrimitiveElement.valueSet(b,true); | ||
130 | RealElement.value(a,value); | ||
131 | RealElement.value(b,value); | ||
132 | } or { | ||
133 | find mustExist(problem,interpretation,a); | ||
134 | find mustExist(problem,interpretation,b); | ||
135 | PrimitiveElement.valueSet(a,true); | ||
136 | PrimitiveElement.valueSet(b,true); | ||
137 | RealElement.value(a,value); | ||
138 | IntegerElement.value(b,value); | ||
139 | } or { | ||
140 | find mustExist(problem,interpretation,a); | ||
141 | find mustExist(problem,interpretation,b); | ||
142 | PrimitiveElement.valueSet(a,true); | ||
143 | PrimitiveElement.valueSet(b,true); | ||
144 | IntegerElement.value(a,value); | ||
145 | RealElement.value(b,value); | ||
146 | } or { | ||
147 | find mustExist(problem,interpretation,a); | ||
148 | find mustExist(problem,interpretation,b); | ||
149 | PrimitiveElement.valueSet(a,true); | ||
150 | PrimitiveElement.valueSet(b,true); | ||
151 | StringElement.value(a,value); | ||
152 | StringElement.value(b,value); | ||
153 | } | ||
154 | |||
155 | ////////// | ||
156 | // 1. Problem-Specific Base Indexers | ||
157 | ////////// | ||
158 | // 1.1 Type Indexers | ||
159 | ////////// | ||
160 | // 1.1.1 Required Patterns by TypeIndexer | ||
161 | ////////// | ||
162 | private pattern typeInterpretation(problem:LogicProblem, interpretation:PartialInterpretation, type:TypeDeclaration, typeInterpretation:PartialComplexTypeInterpretation) { | ||
163 | find interpretation(problem,interpretation); | ||
164 | LogicProblem.types(problem,type); | ||
165 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
166 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
167 | } | ||
168 | |||
169 | private pattern directInstanceOf(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement, type:Type) { | ||
170 | find interpretation(problem,interpretation); | ||
171 | LogicProblem.types(problem,type); | ||
172 | TypeDefinition.elements(type,element); | ||
173 | } or { | ||
174 | find interpretation(problem,interpretation); | ||
175 | find typeInterpretation(problem,interpretation,type,typeInterpretation); | ||
176 | PartialComplexTypeInterpretation.elements(typeInterpretation,element); | ||
177 | } | ||
178 | |||
179 | private pattern isPrimitive(element: PrimitiveElement) { | ||
180 | PrimitiveElement(element); | ||
181 | } | ||
182 | ////////// | ||
183 | // 1.1.2 primitive Type Indexers | ||
184 | ////////// | ||
185 | // Currently unused. Refer primitive types as: | ||
186 | // > PrimitiveElement(element) | ||
187 | // specific types are referred as: | ||
188 | // > BooleanElement(variableName) | ||
189 | // > IntegerElement(variableName) | ||
190 | // > RealElement(variableName) | ||
191 | // > StringElement(variableName) | ||
192 | // And their value as | ||
193 | // > BooleanElement.value(variableName,value) | ||
194 | // > IntegerElement.value(variableName,value) | ||
195 | // > RealElement.value(variableName,value) | ||
196 | // > StringElement.value(variableName,value) | ||
197 | // Whether a value is set is defined by: | ||
198 | // > PrimitiveElement.valueSet(variableName,isFilled); | ||
199 | ////////// | ||
200 | // 1.1.3 domain-specific Type Indexers | ||
201 | ////////// | ||
202 | /** | ||
203 | * An element must be an instance of type "FamilyTree class". | ||
204 | */ | ||
205 | private pattern mustInstanceOfFamilyTree_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
206 | Type.name(type,"FamilyTree class"); | ||
207 | find directInstanceOf(problem,interpretation,element,type); | ||
208 | } | ||
209 | private pattern scopeDisallowsNewFamilyTree_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
210 | find interpretation(problem,interpretation); | ||
211 | PartialInterpretation.scopes(interpretation,scope); | ||
212 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
213 | Scope.maxNewElements(scope,0); | ||
214 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
215 | Type.name(type,"FamilyTree class"); | ||
216 | } | ||
217 | |||
218 | /** | ||
219 | * An element may be an instance of type "FamilyTree class". | ||
220 | */ | ||
221 | private pattern mayInstanceOfFamilyTree_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
222 | { | ||
223 | find interpretation(problem,interpretation); | ||
224 | PartialInterpretation.newElements(interpretation,element); | ||
225 | neg find mustInstanceOfMember_class(problem,interpretation,element); | ||
226 | neg find scopeDisallowsNewFamilyTree_class(problem, interpretation); | ||
227 | neg find isPrimitive(element); | ||
228 | } or { | ||
229 | find interpretation(problem,interpretation); | ||
230 | PartialInterpretation.openWorldElements(interpretation,element); | ||
231 | neg find mustInstanceOfMember_class(problem,interpretation,element); | ||
232 | neg find scopeDisallowsNewFamilyTree_class(problem, interpretation); | ||
233 | neg find isPrimitive(element); | ||
234 | } or | ||
235 | { find mustInstanceOfFamilyTree_class(problem,interpretation,element); } | ||
236 | /** | ||
237 | * An element must be an instance of type "Member class". | ||
238 | */ | ||
239 | private pattern mustInstanceOfMember_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
240 | Type.name(type,"Member class"); | ||
241 | find directInstanceOf(problem,interpretation,element,type); | ||
242 | } | ||
243 | private pattern scopeDisallowsNewMember_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
244 | find interpretation(problem,interpretation); | ||
245 | PartialInterpretation.scopes(interpretation,scope); | ||
246 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
247 | Scope.maxNewElements(scope,0); | ||
248 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
249 | Type.name(type,"Member class"); | ||
250 | } | ||
251 | |||
252 | /** | ||
253 | * An element may be an instance of type "Member class". | ||
254 | */ | ||
255 | private pattern mayInstanceOfMember_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
256 | { | ||
257 | find interpretation(problem,interpretation); | ||
258 | PartialInterpretation.newElements(interpretation,element); | ||
259 | neg find mustInstanceOfFamilyTree_class(problem,interpretation,element); | ||
260 | neg find scopeDisallowsNewMember_class(problem, interpretation); | ||
261 | neg find isPrimitive(element); | ||
262 | } or { | ||
263 | find interpretation(problem,interpretation); | ||
264 | PartialInterpretation.openWorldElements(interpretation,element); | ||
265 | neg find mustInstanceOfFamilyTree_class(problem,interpretation,element); | ||
266 | neg find scopeDisallowsNewMember_class(problem, interpretation); | ||
267 | neg find isPrimitive(element); | ||
268 | } or | ||
269 | { find mustInstanceOfMember_class(problem,interpretation,element); } | ||
270 | |||
271 | ////////// | ||
272 | // 1.2 Relation Declaration Indexers | ||
273 | ////////// | ||
274 | /** | ||
275 | * Matcher for detecting tuples t where []members reference FamilyTree(source,target) | ||
276 | */ | ||
277 | private pattern mustInRelationmembers_reference_FamilyTree( | ||
278 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
279 | source: DefinedElement, target:DefinedElement) | ||
280 | { | ||
281 | find interpretation(problem,interpretation); | ||
282 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
283 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"members reference FamilyTree"); | ||
284 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
285 | BinaryElementRelationLink.param1(link,source); | ||
286 | BinaryElementRelationLink.param2(link,target); | ||
287 | } | ||
288 | /** | ||
289 | * Matcher for detecting tuples t where <>members reference FamilyTree(source,target) | ||
290 | */ | ||
291 | private pattern mayInRelationmembers_reference_FamilyTree( | ||
292 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
293 | source: DefinedElement, target:DefinedElement) | ||
294 | { | ||
295 | find interpretation(problem,interpretation); | ||
296 | // The two endpoint of the link have to exist | ||
297 | find mayExist(problem, interpretation, source); | ||
298 | find mayExist(problem, interpretation, target); | ||
299 | // Type consistency | ||
300 | find mayInstanceOfFamilyTree_class(problem,interpretation,source); | ||
301 | find mayInstanceOfMember_class(problem,interpretation,target); | ||
302 | // The reference is containment, then a new reference cannot be create if: | ||
303 | // 1. Multiple parents | ||
304 | neg find mustContains4(problem,interpretation,_,target); | ||
305 | // 2. Circle in the containment hierarchy | ||
306 | neg find mustTransitiveContains(source,target); | ||
307 | } or { | ||
308 | find mustInRelationmembers_reference_FamilyTree(problem,interpretation,source,target); | ||
309 | } | ||
310 | /** | ||
311 | * Matcher for detecting tuples t where []children reference Member(source,target) | ||
312 | */ | ||
313 | private pattern mustInRelationchildren_reference_Member( | ||
314 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
315 | source: DefinedElement, target:DefinedElement) | ||
316 | { | ||
317 | find interpretation(problem,interpretation); | ||
318 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
319 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"children reference Member"); | ||
320 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
321 | BinaryElementRelationLink.param1(link,source); | ||
322 | BinaryElementRelationLink.param2(link,target); | ||
323 | } | ||
324 | /** | ||
325 | * Matcher for detecting tuples t where <>children reference Member(source,target) | ||
326 | */ | ||
327 | private pattern mayInRelationchildren_reference_Member( | ||
328 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
329 | source: DefinedElement, target:DefinedElement) | ||
330 | { | ||
331 | find interpretation(problem,interpretation); | ||
332 | // The two endpoint of the link have to exist | ||
333 | find mayExist(problem, interpretation, source); | ||
334 | find mayExist(problem, interpretation, target); | ||
335 | // Type consistency | ||
336 | find mayInstanceOfMember_class(problem,interpretation,source); | ||
337 | find mayInstanceOfMember_class(problem,interpretation,target); | ||
338 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
339 | // the upper bound of the opposite reference multiplicity should be considered. | ||
340 | numberOfExistingOppositeReferences == count find mustInRelationparents_reference_Member(problem,interpretation,target,_); | ||
341 | check(numberOfExistingOppositeReferences < 2); | ||
342 | } or { | ||
343 | find mustInRelationchildren_reference_Member(problem,interpretation,source,target); | ||
344 | } | ||
345 | /** | ||
346 | * Matcher for detecting tuples t where []parents reference Member(source,target) | ||
347 | */ | ||
348 | private pattern mustInRelationparents_reference_Member( | ||
349 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
350 | source: DefinedElement, target:DefinedElement) | ||
351 | { | ||
352 | find interpretation(problem,interpretation); | ||
353 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
354 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"parents reference Member"); | ||
355 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
356 | BinaryElementRelationLink.param1(link,source); | ||
357 | BinaryElementRelationLink.param2(link,target); | ||
358 | } | ||
359 | /** | ||
360 | * Matcher for detecting tuples t where <>parents reference Member(source,target) | ||
361 | */ | ||
362 | private pattern mayInRelationparents_reference_Member( | ||
363 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
364 | source: DefinedElement, target:DefinedElement) | ||
365 | { | ||
366 | find interpretation(problem,interpretation); | ||
367 | // The two endpoint of the link have to exist | ||
368 | find mayExist(problem, interpretation, source); | ||
369 | find mayExist(problem, interpretation, target); | ||
370 | // Type consistency | ||
371 | find mayInstanceOfMember_class(problem,interpretation,source); | ||
372 | find mayInstanceOfMember_class(problem,interpretation,target); | ||
373 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
374 | // the upper bound of the multiplicity should be considered. | ||
375 | numberOfExistingReferences == count find mustInRelationparents_reference_Member(problem,interpretation,source,_); | ||
376 | check(numberOfExistingReferences < 2); | ||
377 | } or { | ||
378 | find mustInRelationparents_reference_Member(problem,interpretation,source,target); | ||
379 | } | ||
380 | /** | ||
381 | * Matcher for detecting tuples t where []name attribute Member(source,target) | ||
382 | */ | ||
383 | private pattern mustInRelationname_attribute_Member( | ||
384 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
385 | source: DefinedElement, target:DefinedElement) | ||
386 | { | ||
387 | find interpretation(problem,interpretation); | ||
388 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
389 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"name attribute Member"); | ||
390 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
391 | BinaryElementRelationLink.param1(link,source); | ||
392 | BinaryElementRelationLink.param2(link,target); | ||
393 | } | ||
394 | /** | ||
395 | * Matcher for detecting tuples t where <>name attribute Member(source,target) | ||
396 | */ | ||
397 | private pattern mayInRelationname_attribute_Member( | ||
398 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
399 | source: DefinedElement, target:DefinedElement) | ||
400 | { | ||
401 | find interpretation(problem,interpretation); | ||
402 | // The two endpoint of the link have to exist | ||
403 | find mayExist(problem, interpretation, source); | ||
404 | find mayExist(problem, interpretation, target); | ||
405 | // Type consistency | ||
406 | find mayInstanceOfMember_class(problem,interpretation,source); | ||
407 | StringElement(target); | ||
408 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
409 | // the upper bound of the multiplicity should be considered. | ||
410 | numberOfExistingReferences == count find mustInRelationname_attribute_Member(problem,interpretation,source,_); | ||
411 | check(numberOfExistingReferences < 1); | ||
412 | } or { | ||
413 | find mustInRelationname_attribute_Member(problem,interpretation,source,target); | ||
414 | } | ||
415 | /** | ||
416 | * Matcher for detecting tuples t where []age attribute Member(source,target) | ||
417 | */ | ||
418 | private pattern mustInRelationage_attribute_Member( | ||
419 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
420 | source: DefinedElement, target:DefinedElement) | ||
421 | { | ||
422 | find interpretation(problem,interpretation); | ||
423 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
424 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"age attribute Member"); | ||
425 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
426 | BinaryElementRelationLink.param1(link,source); | ||
427 | BinaryElementRelationLink.param2(link,target); | ||
428 | } | ||
429 | /** | ||
430 | * Matcher for detecting tuples t where <>age attribute Member(source,target) | ||
431 | */ | ||
432 | private pattern mayInRelationage_attribute_Member( | ||
433 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
434 | source: DefinedElement, target:DefinedElement) | ||
435 | { | ||
436 | find interpretation(problem,interpretation); | ||
437 | // The two endpoint of the link have to exist | ||
438 | find mayExist(problem, interpretation, source); | ||
439 | find mayExist(problem, interpretation, target); | ||
440 | // Type consistency | ||
441 | find mayInstanceOfMember_class(problem,interpretation,source); | ||
442 | IntegerElement(target); | ||
443 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
444 | // the upper bound of the multiplicity should be considered. | ||
445 | numberOfExistingReferences == count find mustInRelationage_attribute_Member(problem,interpretation,source,_); | ||
446 | check(numberOfExistingReferences < 1); | ||
447 | } or { | ||
448 | find mustInRelationage_attribute_Member(problem,interpretation,source,target); | ||
449 | } | ||
450 | |||
451 | ////////// | ||
452 | // 1.3 Relation Definition Indexers | ||
453 | ////////// | ||
454 | // Must, May and Current queries for pattern queries memberIsItsOwnParent | ||
455 | private pattern mustInRelation_pattern_queries_memberIsItsOwnParent( | ||
456 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
457 | var_m) | ||
458 | { | ||
459 | find interpretation(problem,interpretation); | ||
460 | find mustInstanceOfMember_class(problem,interpretation,var_m); | ||
461 | // m is exported | ||
462 | find mustInstanceOfFamilyTree_class(problem,interpretation,var__0); | ||
463 | find mustInRelationmembers_reference_FamilyTree(problem,interpretation,var__0,var_virtual0); | ||
464 | find mustInstanceOfMember_class(problem,interpretation,var_virtual0); | ||
465 | find mustEquivalent(problem, interpretation, var_virtual0, var_m); | ||
466 | find mustInstanceOfMember_class(problem,interpretation,var_m); | ||
467 | find mustInRelationparents_reference_Member(problem,interpretation,var_m,var_virtual1); | ||
468 | find mustInstanceOfMember_class(problem,interpretation,var_virtual1); | ||
469 | find mustEquivalent(problem, interpretation, var_virtual1, var_p); | ||
470 | find mustEquivalent(problem, interpretation, var_m, var_p); | ||
471 | } | ||
472 | private pattern mayInRelation_pattern_queries_memberIsItsOwnParent( | ||
473 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
474 | var_m) | ||
475 | { | ||
476 | find interpretation(problem,interpretation); | ||
477 | find mayInstanceOfMember_class(problem,interpretation,var_m); | ||
478 | // m is exported | ||
479 | find mayInstanceOfFamilyTree_class(problem,interpretation,var__0); | ||
480 | find mayInRelationmembers_reference_FamilyTree(problem,interpretation,var__0,var_virtual0); | ||
481 | find mayInstanceOfMember_class(problem,interpretation,var_virtual0); | ||
482 | find mayEquivalent(problem, interpretation, var_virtual0, var_m); | ||
483 | find mayInstanceOfMember_class(problem,interpretation,var_m); | ||
484 | find mayInRelationparents_reference_Member(problem,interpretation,var_m,var_virtual1); | ||
485 | find mayInstanceOfMember_class(problem,interpretation,var_virtual1); | ||
486 | find mayEquivalent(problem, interpretation, var_virtual1, var_p); | ||
487 | find mayEquivalent(problem, interpretation, var_m, var_p); | ||
488 | } | ||
489 | private pattern currentInRelation_pattern_queries_memberIsItsOwnParent( | ||
490 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
491 | var_m) | ||
492 | { | ||
493 | find interpretation(problem,interpretation); | ||
494 | find mustInstanceOfMember_class(problem,interpretation,var_m); | ||
495 | // m is exported | ||
496 | find mustInstanceOfFamilyTree_class(problem,interpretation,var__0); | ||
497 | find mustInRelationmembers_reference_FamilyTree(problem,interpretation,var__0,var_virtual0); | ||
498 | find mustInstanceOfMember_class(problem,interpretation,var_virtual0); | ||
499 | find mustEquivalent(problem, interpretation, var_virtual0, var_m); | ||
500 | find mustInstanceOfMember_class(problem,interpretation,var_m); | ||
501 | find mustInRelationparents_reference_Member(problem,interpretation,var_m,var_virtual1); | ||
502 | find mustInstanceOfMember_class(problem,interpretation,var_virtual1); | ||
503 | find mustEquivalent(problem, interpretation, var_virtual1, var_p); | ||
504 | find mustEquivalent(problem, interpretation, var_m, var_p); | ||
505 | } | ||
506 | |||
507 | ////////// | ||
508 | // 1.4 Containment Indexer | ||
509 | ////////// | ||
510 | private pattern mustContains2(source: DefinedElement, target: DefinedElement) { | ||
511 | find mustContains4(_,_,source,target); | ||
512 | } | ||
513 | |||
514 | private pattern mustContains4(problem:LogicProblem, interpretation:PartialInterpretation, | ||
515 | source: DefinedElement, target: DefinedElement) | ||
516 | { find mustInRelationmembers_reference_FamilyTree(problem,interpretation,source,target); } | ||
517 | |||
518 | private pattern mustTransitiveContains(source,target) { | ||
519 | find mustContains2+(source,target); | ||
520 | } | ||
521 | |||
522 | ////////// | ||
523 | // 2. Invalidation Indexers | ||
524 | ////////// | ||
525 | // 2.1 Invalidated by WF Queries | ||
526 | ////////// | ||
527 | pattern invalidatedBy_pattern_queries_memberIsItsOwnParent(problem:LogicProblem, interpretation:PartialInterpretation, | ||
528 | var_m) | ||
529 | { | ||
530 | find mustInRelation_pattern_queries_memberIsItsOwnParent(problem,interpretation,var_m); | ||
531 | } | ||
532 | |||
533 | ////////// | ||
534 | // 3. Unfinishedness Indexers | ||
535 | ////////// | ||
536 | // 3.1 Unfinishedness Measured by Multiplicity | ||
537 | ////////// | ||
538 | |||
539 | ////////// | ||
540 | // 3.2 Unfinishedness Measured by WF Queries | ||
541 | ////////// | ||
542 | pattern unfinishedBy_pattern_queries_memberIsItsOwnParent(problem:LogicProblem, interpretation:PartialInterpretation, | ||
543 | var_m) | ||
544 | { | ||
545 | find currentInRelation_pattern_queries_memberIsItsOwnParent(problem,interpretation,var_m); | ||
546 | } | ||
547 | |||
548 | ////////// | ||
549 | // 4. Refinement Indexers | ||
550 | ////////// | ||
551 | // 4.1 Object constructors | ||
552 | ////////// | ||
553 | private pattern hasElementInContainment(problem:LogicProblem, interpretation:PartialInterpretation) | ||
554 | { | ||
555 | find interpretation(problem,interpretation); | ||
556 | find mustInstanceOfFamilyTree_class(problem,interpretation,root); | ||
557 | find mustExist(problem, interpretation, root); | ||
558 | }or{ | ||
559 | find interpretation(problem,interpretation); | ||
560 | find mustInstanceOfMember_class(problem,interpretation,root); | ||
561 | find mustExist(problem, interpretation, root); | ||
562 | } | ||
563 | pattern createObject_FamilyTree_class( | ||
564 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
565 | typeInterpretation:PartialComplexTypeInterpretation) | ||
566 | { | ||
567 | find interpretation(problem,interpretation); | ||
568 | neg find hasElementInContainment(problem,interpretation); | ||
569 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
570 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FamilyTree class"); | ||
571 | find mayInstanceOfFamilyTree_class(problem,interpretation,newObject); | ||
572 | find mayExist(problem, interpretation, newObject); | ||
573 | neg find mustExist(problem, interpretation, newObject); | ||
574 | } | ||
575 | pattern createObject_Member_class_by_members_reference_FamilyTree( | ||
576 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
577 | relationInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
578 | container:DefinedElement) | ||
579 | { | ||
580 | find interpretation(problem,interpretation); | ||
581 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
582 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"Member class"); | ||
583 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
584 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"members reference FamilyTree"); | ||
585 | find mustInstanceOfFamilyTree_class(problem,interpretation,container); | ||
586 | find mayInstanceOfMember_class(problem,interpretation,newObject); | ||
587 | find mayInRelationmembers_reference_FamilyTree(problem,interpretation,container,newObject); | ||
588 | find mustExist(problem, interpretation, container); | ||
589 | neg find mustExist(problem, interpretation, newObject); | ||
590 | } | ||
591 | pattern createObject_Member_class( | ||
592 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
593 | typeInterpretation:PartialComplexTypeInterpretation) | ||
594 | { | ||
595 | find interpretation(problem,interpretation); | ||
596 | neg find hasElementInContainment(problem,interpretation); | ||
597 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
598 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"Member class"); | ||
599 | find mayInstanceOfMember_class(problem,interpretation,newObject); | ||
600 | find mayExist(problem, interpretation, newObject); | ||
601 | neg find mustExist(problem, interpretation, newObject); | ||
602 | } | ||
603 | |||
604 | ////////// | ||
605 | // 4.2 Type refinement | ||
606 | ////////// | ||
607 | pattern refineTypeTo_FamilyTree_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
608 | find interpretation(problem,interpretation); | ||
609 | PartialInterpretation.newElements(interpretation,element); | ||
610 | find mayInstanceOfFamilyTree_class(problem,interpretation,element); | ||
611 | neg find mustInstanceOfFamilyTree_class(problem,interpretation,element); | ||
612 | neg find mustInstanceOfMember_class(problem,interpretation,element); | ||
613 | } | ||
614 | pattern refineTypeTo_Member_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
615 | find interpretation(problem,interpretation); | ||
616 | PartialInterpretation.newElements(interpretation,element); | ||
617 | find mayInstanceOfMember_class(problem,interpretation,element); | ||
618 | neg find mustInstanceOfFamilyTree_class(problem,interpretation,element); | ||
619 | neg find mustInstanceOfMember_class(problem,interpretation,element); | ||
620 | } | ||
621 | |||
622 | ////////// | ||
623 | // 4.3 Relation refinement | ||
624 | ////////// | ||
625 | pattern refineRelation_children_reference_Member_and_parents_reference_Member( | ||
626 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
627 | relationIterpretation:PartialRelationInterpretation, oppositeInterpretation:PartialRelationInterpretation, | ||
628 | from: DefinedElement, to: DefinedElement) | ||
629 | { | ||
630 | find interpretation(problem,interpretation); | ||
631 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
632 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"children reference Member"); | ||
633 | PartialInterpretation.partialrelationinterpretation(interpretation,oppositeInterpretation); | ||
634 | PartialRelationInterpretation.interpretationOf.name(oppositeInterpretation,"parents reference Member"); | ||
635 | find mustExist(problem, interpretation, from); | ||
636 | find mustExist(problem, interpretation, to); | ||
637 | find mustInstanceOfMember_class(problem,interpretation,from); | ||
638 | find mustInstanceOfMember_class(problem,interpretation,to); | ||
639 | find mayInRelationchildren_reference_Member(problem,interpretation,from,to); | ||
640 | neg find mustInRelationchildren_reference_Member(problem,interpretation,from,to); | ||
641 | } | ||
642 | pattern refineRelation_name_attribute_Member( | ||
643 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
644 | relationIterpretation:PartialRelationInterpretation, | ||
645 | from: DefinedElement, to: DefinedElement) | ||
646 | { | ||
647 | find interpretation(problem,interpretation); | ||
648 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
649 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"name attribute Member"); | ||
650 | find mustExist(problem, interpretation, from); | ||
651 | find mustExist(problem, interpretation, to); | ||
652 | find mustInstanceOfMember_class(problem,interpretation,from); | ||
653 | StringElement(to); | ||
654 | find mayInRelationname_attribute_Member(problem,interpretation,from,to); | ||
655 | neg find mustInRelationname_attribute_Member(problem,interpretation,from,to); | ||
656 | } | ||
657 | pattern refineRelation_age_attribute_Member( | ||
658 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
659 | relationIterpretation:PartialRelationInterpretation, | ||
660 | from: DefinedElement, to: DefinedElement) | ||
661 | { | ||
662 | find interpretation(problem,interpretation); | ||
663 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
664 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"age attribute Member"); | ||
665 | find mustExist(problem, interpretation, from); | ||
666 | find mustExist(problem, interpretation, to); | ||
667 | find mustInstanceOfMember_class(problem,interpretation,from); | ||
668 | IntegerElement(to); | ||
669 | find mayInRelationage_attribute_Member(problem,interpretation,from,to); | ||
670 | neg find mustInRelationage_attribute_Member(problem,interpretation,from,to); | ||
671 | } | ||
672 | |||
diff --git a/Tests/MODELS2020-CaseStudies/case.study.familyTree.run/outputs/debug/generation.logicproblem b/Tests/MODELS2020-CaseStudies/case.study.familyTree.run/outputs/debug/generation.logicproblem new file mode 100644 index 00000000..dd3b15b1 --- /dev/null +++ b/Tests/MODELS2020-CaseStudies/case.study.familyTree.run/outputs/debug/generation.logicproblem | |||
@@ -0,0 +1,190 @@ | |||
1 | <?xml version="1.0" encoding="ASCII"?> | ||
2 | <language:LogicProblem xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore2logicannotations="http://www.bme.hu/mit/inf/dslreasoner/logic/model/language/ecore2logicannotation" xmlns:language="http://www.bme.hu/mit/inf/dslreasoner/logic/model/problem" xmlns:language_1="http://www.bme.hu/mit/inf/dslreasoner/logic/model/language" xmlns:viatra2logicannotations="http://www.bme.hu/mit/inf/dslreasoner/logic/model/language/viatra2logicannotation"> | ||
3 | <types xsi:type="language_1:TypeDeclaration" name="FamilyTree class"/> | ||
4 | <types xsi:type="language_1:TypeDeclaration" name="Member class"/> | ||
5 | <assertions name="upperMultiplicity parents Member" annotations="//@annotations.0"> | ||
6 | <value xsi:type="language_1:Forall"> | ||
7 | <quantifiedVariables name="src"> | ||
8 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.1"/> | ||
9 | </quantifiedVariables> | ||
10 | <quantifiedVariables name="trg 1"> | ||
11 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.1"/> | ||
12 | </quantifiedVariables> | ||
13 | <quantifiedVariables name="trg 2"> | ||
14 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.1"/> | ||
15 | </quantifiedVariables> | ||
16 | <quantifiedVariables name="trg 3"> | ||
17 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.1"/> | ||
18 | </quantifiedVariables> | ||
19 | <expression xsi:type="language_1:Impl"> | ||
20 | <leftOperand xsi:type="language_1:And"> | ||
21 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.2"> | ||
22 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.0/@value/@quantifiedVariables.0"/> | ||
23 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.0/@value/@quantifiedVariables.1"/> | ||
24 | </operands> | ||
25 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.2"> | ||
26 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.0/@value/@quantifiedVariables.0"/> | ||
27 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.0/@value/@quantifiedVariables.2"/> | ||
28 | </operands> | ||
29 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.2"> | ||
30 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.0/@value/@quantifiedVariables.0"/> | ||
31 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.0/@value/@quantifiedVariables.3"/> | ||
32 | </operands> | ||
33 | </leftOperand> | ||
34 | <rightOperand xsi:type="language_1:Not"> | ||
35 | <operand xsi:type="language_1:Distinct"> | ||
36 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.0/@value/@quantifiedVariables.1"/> | ||
37 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.0/@value/@quantifiedVariables.2"/> | ||
38 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.0/@value/@quantifiedVariables.3"/> | ||
39 | </operand> | ||
40 | </rightOperand> | ||
41 | </expression> | ||
42 | </value> | ||
43 | </assertions> | ||
44 | <assertions name="oppositeReference children Member" annotations="//@annotations.1"> | ||
45 | <value xsi:type="language_1:Forall"> | ||
46 | <quantifiedVariables name="src"> | ||
47 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.1"/> | ||
48 | </quantifiedVariables> | ||
49 | <quantifiedVariables name="trg"> | ||
50 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.1"/> | ||
51 | </quantifiedVariables> | ||
52 | <expression xsi:type="language_1:Iff"> | ||
53 | <leftOperand xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.1"> | ||
54 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.1/@value/@quantifiedVariables.0"/> | ||
55 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.1/@value/@quantifiedVariables.1"/> | ||
56 | </leftOperand> | ||
57 | <rightOperand xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.2"> | ||
58 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.1/@value/@quantifiedVariables.1"/> | ||
59 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.1/@value/@quantifiedVariables.0"/> | ||
60 | </rightOperand> | ||
61 | </expression> | ||
62 | </value> | ||
63 | </assertions> | ||
64 | <assertions name="upperMultiplicity name Member" annotations="//@annotations.2"> | ||
65 | <value xsi:type="language_1:Forall"> | ||
66 | <quantifiedVariables name="src"> | ||
67 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.1"/> | ||
68 | </quantifiedVariables> | ||
69 | <quantifiedVariables name="trg 1"> | ||
70 | <range xsi:type="language_1:StringTypeReference"/> | ||
71 | </quantifiedVariables> | ||
72 | <quantifiedVariables name="trg 2"> | ||
73 | <range xsi:type="language_1:StringTypeReference"/> | ||
74 | </quantifiedVariables> | ||
75 | <expression xsi:type="language_1:Impl"> | ||
76 | <leftOperand xsi:type="language_1:And"> | ||
77 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.3"> | ||
78 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.2/@value/@quantifiedVariables.0"/> | ||
79 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.2/@value/@quantifiedVariables.1"/> | ||
80 | </operands> | ||
81 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.3"> | ||
82 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.2/@value/@quantifiedVariables.0"/> | ||
83 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.2/@value/@quantifiedVariables.2"/> | ||
84 | </operands> | ||
85 | </leftOperand> | ||
86 | <rightOperand xsi:type="language_1:Not"> | ||
87 | <operand xsi:type="language_1:Distinct"> | ||
88 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.2/@value/@quantifiedVariables.1"/> | ||
89 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.2/@value/@quantifiedVariables.2"/> | ||
90 | </operand> | ||
91 | </rightOperand> | ||
92 | </expression> | ||
93 | </value> | ||
94 | </assertions> | ||
95 | <assertions name="upperMultiplicity age Member" annotations="//@annotations.3"> | ||
96 | <value xsi:type="language_1:Forall"> | ||
97 | <quantifiedVariables name="src"> | ||
98 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.1"/> | ||
99 | </quantifiedVariables> | ||
100 | <quantifiedVariables name="trg 1"> | ||
101 | <range xsi:type="language_1:IntTypeReference"/> | ||
102 | </quantifiedVariables> | ||
103 | <quantifiedVariables name="trg 2"> | ||
104 | <range xsi:type="language_1:IntTypeReference"/> | ||
105 | </quantifiedVariables> | ||
106 | <expression xsi:type="language_1:Impl"> | ||
107 | <leftOperand xsi:type="language_1:And"> | ||
108 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.4"> | ||
109 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.3/@value/@quantifiedVariables.0"/> | ||
110 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.3/@value/@quantifiedVariables.1"/> | ||
111 | </operands> | ||
112 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.4"> | ||
113 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.3/@value/@quantifiedVariables.0"/> | ||
114 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.3/@value/@quantifiedVariables.2"/> | ||
115 | </operands> | ||
116 | </leftOperand> | ||
117 | <rightOperand xsi:type="language_1:Not"> | ||
118 | <operand xsi:type="language_1:Distinct"> | ||
119 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.3/@value/@quantifiedVariables.1"/> | ||
120 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.3/@value/@quantifiedVariables.2"/> | ||
121 | </operand> | ||
122 | </rightOperand> | ||
123 | </expression> | ||
124 | </value> | ||
125 | </assertions> | ||
126 | <assertions name="errorpattern queries memberIsItsOwnParent" annotations="//@annotations.5"> | ||
127 | <value xsi:type="language_1:Forall"> | ||
128 | <quantifiedVariables name="p0"> | ||
129 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.1"/> | ||
130 | </quantifiedVariables> | ||
131 | <expression xsi:type="language_1:Not"> | ||
132 | <operand xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.5"> | ||
133 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.4/@value/@quantifiedVariables.0"/> | ||
134 | </operand> | ||
135 | </expression> | ||
136 | </value> | ||
137 | </assertions> | ||
138 | <relations xsi:type="language_1:RelationDeclaration" name="members reference FamilyTree"> | ||
139 | <parameters xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
140 | <parameters xsi:type="language_1:ComplexTypeReference" referred="//@types.1"/> | ||
141 | </relations> | ||
142 | <relations xsi:type="language_1:RelationDeclaration" name="children reference Member"> | ||
143 | <parameters xsi:type="language_1:ComplexTypeReference" referred="//@types.1"/> | ||
144 | <parameters xsi:type="language_1:ComplexTypeReference" referred="//@types.1"/> | ||
145 | </relations> | ||
146 | <relations xsi:type="language_1:RelationDeclaration" name="parents reference Member"> | ||
147 | <parameters xsi:type="language_1:ComplexTypeReference" referred="//@types.1"/> | ||
148 | <parameters xsi:type="language_1:ComplexTypeReference" referred="//@types.1"/> | ||
149 | </relations> | ||
150 | <relations xsi:type="language_1:RelationDeclaration" name="name attribute Member"> | ||
151 | <parameters xsi:type="language_1:ComplexTypeReference" referred="//@types.1"/> | ||
152 | <parameters xsi:type="language_1:StringTypeReference"/> | ||
153 | </relations> | ||
154 | <relations xsi:type="language_1:RelationDeclaration" name="age attribute Member"> | ||
155 | <parameters xsi:type="language_1:ComplexTypeReference" referred="//@types.1"/> | ||
156 | <parameters xsi:type="language_1:IntTypeReference"/> | ||
157 | </relations> | ||
158 | <relations xsi:type="language_1:RelationDefinition" name="pattern queries memberIsItsOwnParent" annotations="//@annotations.4"> | ||
159 | <parameters xsi:type="language_1:ComplexTypeReference" referred="//@types.1"/> | ||
160 | <variables name="parameter m"> | ||
161 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.1"/> | ||
162 | </variables> | ||
163 | <value xsi:type="language_1:Or"> | ||
164 | <operands xsi:type="language_1:Exists"> | ||
165 | <quantifiedVariables name="variable 0"> | ||
166 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
167 | </quantifiedVariables> | ||
168 | <expression xsi:type="language_1:And"> | ||
169 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.0"> | ||
170 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.5/@value/@operands.0/@quantifiedVariables.0"/> | ||
171 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.5/@variables.0"/> | ||
172 | </operands> | ||
173 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.2"> | ||
174 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.5/@variables.0"/> | ||
175 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.5/@variables.0"/> | ||
176 | </operands> | ||
177 | </expression> | ||
178 | </operands> | ||
179 | </value> | ||
180 | </relations> | ||
181 | <containmentHierarchies typesOrderedInHierarchy="//@types.0 //@types.1" containmentRelations="//@relations.0"/> | ||
182 | <annotations xsi:type="ecore2logicannotations:UpperMultiplicityAssertion" target="//@assertions.0" relation="//@relations.2" upper="2"/> | ||
183 | <annotations xsi:type="ecore2logicannotations:InverseRelationAssertion" target="//@assertions.1" inverseA="//@relations.1" inverseB="//@relations.2"/> | ||
184 | <annotations xsi:type="ecore2logicannotations:UpperMultiplicityAssertion" target="//@assertions.2" relation="//@relations.3" upper="1"/> | ||
185 | <annotations xsi:type="ecore2logicannotations:UpperMultiplicityAssertion" target="//@assertions.3" relation="//@relations.4" upper="1"/> | ||
186 | <annotations xsi:type="viatra2logicannotations:TransfomedViatraQuery" target="//@relations.5" patternFullyQualifiedName="queries.memberIsItsOwnParent"> | ||
187 | <variableTrace targetLogicVariable="//@relations.5/@value/@operands.0/@quantifiedVariables.0"/> | ||
188 | </annotations> | ||
189 | <annotations xsi:type="viatra2logicannotations:TransformedViatraWellformednessConstraint" target="//@assertions.4" query="//@annotations.4"/> | ||
190 | </language:LogicProblem> | ||
diff --git a/Tests/MODELS2020-CaseStudies/case.study.familyTree.run/outputs/debug/init.partialmodel b/Tests/MODELS2020-CaseStudies/case.study.familyTree.run/outputs/debug/init.partialmodel new file mode 100644 index 00000000..949d6b64 --- /dev/null +++ b/Tests/MODELS2020-CaseStudies/case.study.familyTree.run/outputs/debug/init.partialmodel | |||
@@ -0,0 +1,51 @@ | |||
1 | <?xml version="1.0" encoding="ASCII"?> | ||
2 | <partialinterpretation:PartialInterpretation xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:language="http://www.bme.hu/mit/inf/dslreasoner/logic/model/language" xmlns:partialinterpretation="http://www.bme.hu/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage" minNewElements="6" maxNewElements="6"> | ||
3 | <problem href="outputs/debug/generation.logicproblem#/"/> | ||
4 | <partialrelationinterpretation> | ||
5 | <interpretationOf href="outputs/debug/generation.logicproblem#//@relations.0"/> | ||
6 | <param1 xsi:type="language:ComplexTypeReference" href="outputs/debug/generation.logicproblem#//@relations.0/@parameters.0"/> | ||
7 | <param2 xsi:type="language:ComplexTypeReference" href="outputs/debug/generation.logicproblem#//@relations.0/@parameters.1"/> | ||
8 | </partialrelationinterpretation> | ||
9 | <partialrelationinterpretation> | ||
10 | <interpretationOf href="outputs/debug/generation.logicproblem#//@relations.1"/> | ||
11 | <param1 xsi:type="language:ComplexTypeReference" href="outputs/debug/generation.logicproblem#//@relations.1/@parameters.0"/> | ||
12 | <param2 xsi:type="language:ComplexTypeReference" href="outputs/debug/generation.logicproblem#//@relations.1/@parameters.1"/> | ||
13 | </partialrelationinterpretation> | ||
14 | <partialrelationinterpretation> | ||
15 | <interpretationOf href="outputs/debug/generation.logicproblem#//@relations.2"/> | ||
16 | <param1 xsi:type="language:ComplexTypeReference" href="outputs/debug/generation.logicproblem#//@relations.2/@parameters.0"/> | ||
17 | <param2 xsi:type="language:ComplexTypeReference" href="outputs/debug/generation.logicproblem#//@relations.2/@parameters.1"/> | ||
18 | </partialrelationinterpretation> | ||
19 | <partialrelationinterpretation> | ||
20 | <interpretationOf href="outputs/debug/generation.logicproblem#//@relations.3"/> | ||
21 | <param1 xsi:type="language:ComplexTypeReference" href="outputs/debug/generation.logicproblem#//@relations.3/@parameters.0"/> | ||
22 | <param2 xsi:type="language:StringTypeReference" href="outputs/debug/generation.logicproblem#//@relations.3/@parameters.1"/> | ||
23 | </partialrelationinterpretation> | ||
24 | <partialrelationinterpretation> | ||
25 | <interpretationOf href="outputs/debug/generation.logicproblem#//@relations.4"/> | ||
26 | <param1 xsi:type="language:ComplexTypeReference" href="outputs/debug/generation.logicproblem#//@relations.4/@parameters.0"/> | ||
27 | <param2 xsi:type="language:IntTypeReference" href="outputs/debug/generation.logicproblem#//@relations.4/@parameters.1"/> | ||
28 | </partialrelationinterpretation> | ||
29 | <newElements xsi:type="partialinterpretation:BooleanElement" name="true" valueSet="true" value="true"/> | ||
30 | <newElements xsi:type="partialinterpretation:BooleanElement" name="false" valueSet="true"/> | ||
31 | <newElements xsi:type="partialinterpretation:IntegerElement" name="1" valueSet="true" value="1"/> | ||
32 | <newElements xsi:type="partialinterpretation:IntegerElement" name="2" valueSet="true" value="2"/> | ||
33 | <newElements xsi:type="partialinterpretation:IntegerElement" name="3" valueSet="true" value="3"/> | ||
34 | <newElements xsi:type="partialinterpretation:IntegerElement" name="4" valueSet="true" value="4"/> | ||
35 | <newElements xsi:type="partialinterpretation:IntegerElement" name="5" valueSet="true" value="5"/> | ||
36 | <partialtypeinterpratation xsi:type="partialinterpretation:PartialBooleanInterpretation" elements="//@newElements.0 //@newElements.1"/> | ||
37 | <partialtypeinterpratation xsi:type="partialinterpretation:PartialIntegerInterpretation" elements="//@newElements.2 //@newElements.3 //@newElements.4 //@newElements.5 //@newElements.6"/> | ||
38 | <partialtypeinterpratation xsi:type="partialinterpretation:PartialRealInterpretation" elements="//@openWorldElements.0"/> | ||
39 | <partialtypeinterpratation xsi:type="partialinterpretation:PartialStringInterpretation" elements="//@openWorldElements.1"/> | ||
40 | <partialtypeinterpratation xsi:type="partialinterpretation:PartialComplexTypeInterpretation" scopes="//@scopes.0"> | ||
41 | <interpretationOf href="outputs/debug/generation.logicproblem#//@types.0"/> | ||
42 | </partialtypeinterpratation> | ||
43 | <partialtypeinterpratation xsi:type="partialinterpretation:PartialComplexTypeInterpretation" scopes="//@scopes.1"> | ||
44 | <interpretationOf href="outputs/debug/generation.logicproblem#//@types.1"/> | ||
45 | </partialtypeinterpratation> | ||
46 | <openWorldElements xsi:type="partialinterpretation:RealElement" name="New Reals"/> | ||
47 | <openWorldElements xsi:type="partialinterpretation:StringElement" name="New Strings"/> | ||
48 | <openWorldElements name="New Objects"/> | ||
49 | <scopes targetTypeInterpretation="//@partialtypeinterpratation.4"/> | ||
50 | <scopes targetTypeInterpretation="//@partialtypeinterpratation.5"/> | ||
51 | </partialinterpretation:PartialInterpretation> | ||