diff options
author | 2021-01-15 04:40:17 -0500 | |
---|---|---|
committer | 2021-01-15 04:40:17 -0500 | |
commit | 2492b5f012b045917e7261bd5c78b432ec4d3dc6 (patch) | |
tree | a75d37badab96eb6c417955bc4e5488055335fcf /Domains/crossingScenario/queries/logProb2._vql | |
parent | some cleanup (diff) | |
download | VIATRA-Generator-2492b5f012b045917e7261bd5c78b432ec4d3dc6.tar.gz VIATRA-Generator-2492b5f012b045917e7261bd5c78b432ec4d3dc6.tar.zst VIATRA-Generator-2492b5f012b045917e7261bd5c78b432ec4d3dc6.zip |
Begin vql implementation + fix enums bug
Diffstat (limited to 'Domains/crossingScenario/queries/logProb2._vql')
-rw-r--r-- | Domains/crossingScenario/queries/logProb2._vql | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/Domains/crossingScenario/queries/logProb2._vql b/Domains/crossingScenario/queries/logProb2._vql new file mode 100644 index 00000000..284af8cb --- /dev/null +++ b/Domains/crossingScenario/queries/logProb2._vql | |||
@@ -0,0 +1,55 @@ | |||
1 | package queries | ||
2 | |||
3 | import epackage "http://www.bme.hu/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage" | ||
4 | import epackage "http://www.bme.hu/mit/inf/dslreasoner/logic/model/problem" | ||
5 | import epackage "http://www.bme.hu/mit/inf/dslreasoner/logic/model/language" | ||
6 | |||
7 | pattern UPMUSTPropagateConstraint1_pattern_queries_define_numWidth_small1( | ||
8 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
9 | var_l, | ||
10 | up_1) | ||
11 | { | ||
12 | // Original Constraints | ||
13 | // var_l exported | ||
14 | find mustInRelationnumWidth_attribute_Lane(problem,interpretation,var_l,var_nw); | ||
15 | var_virtual1 == const_S_Small_Size; | ||
16 | DefinedElement.name(const_S_Small_Size,"S_Small literal Size"); //LogicProblem.elements(problem,const_S_Small_Size); | ||
17 | find mustInRelationwidth_attribute_Lane(problem,interpretation,var_l,var_virtual1); | ||
18 | // Propagation for constraint | ||
19 | PrimitiveElement.valueSet(var_nw,setted_var_nw); RealElement.value(var_nw,value_var_nw); | ||
20 | // Matching variables | ||
21 | var_nw==up_1; | ||
22 | } | ||
23 | |||
24 | /** | ||
25 | * Matcher for detecting tuples t where []referenceCoord attribute Lane(source,target) | ||
26 | */pattern mustInRelationwidth_attribute_Lane( | ||
27 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
28 | source: DefinedElement, target:DefinedElement) | ||
29 | { | ||
30 | find interpretation(problem,interpretation); | ||
31 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
32 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"width attribute Lane"); | ||
33 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
34 | BinaryElementRelationLink.param1(link,source); | ||
35 | BinaryElementRelationLink.param2(link,target); | ||
36 | } | ||
37 | pattern mustInRelationnumWidth_attribute_Lane( | ||
38 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
39 | source: DefinedElement, target:DefinedElement) | ||
40 | { | ||
41 | find interpretation(problem,interpretation); | ||
42 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
43 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"numWidth attribute Lane"); | ||
44 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
45 | BinaryElementRelationLink.param1(link,source); | ||
46 | BinaryElementRelationLink.param2(link,target); | ||
47 | } | ||
48 | |||
49 | ////////// | ||
50 | // 0. Util | ||
51 | ////////// | ||
52 | pattern interpretation(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
53 | PartialInterpretation.problem(interpretation,problem); | ||
54 | } | ||
55 | |||