diff options
author | 2019-02-15 12:42:15 -0500 | |
---|---|---|
committer | 2020-06-07 19:06:30 -0400 | |
commit | cd87de919c733033557401e011102edc67c5f169 (patch) | |
tree | c19225558d63945cf7afea5e0dc92c738788d71a /Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src/ca/mcgill/ecse/dslreasoner/standalone/test/fam/queries | |
parent | Fix FAM Test. Begin Grammar Fix. (diff) | |
download | VIATRA-Generator-cd87de919c733033557401e011102edc67c5f169.tar.gz VIATRA-Generator-cd87de919c733033557401e011102edc67c5f169.tar.zst VIATRA-Generator-cd87de919c733033557401e011102edc67c5f169.zip |
Set up #19
Diffstat (limited to 'Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src/ca/mcgill/ecse/dslreasoner/standalone/test/fam/queries')
-rw-r--r-- | Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src/ca/mcgill/ecse/dslreasoner/standalone/test/fam/queries/famPatterns.vql | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src/ca/mcgill/ecse/dslreasoner/standalone/test/fam/queries/famPatterns.vql b/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src/ca/mcgill/ecse/dslreasoner/standalone/test/fam/queries/famPatterns.vql new file mode 100644 index 00000000..02d34dcd --- /dev/null +++ b/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src/ca/mcgill/ecse/dslreasoner/standalone/test/fam/queries/famPatterns.vql | |||
@@ -0,0 +1,103 @@ | |||
1 | package ca.mcgill.ecse.dslreasoner.standalone.test.fam.queries | ||
2 | |||
3 | import "FamMetamodel" | ||
4 | |||
5 | @Constraint(message="terminatorAndInformation", severity="error", key={T}) | ||
6 | pattern terminatorAndInformation(T : FAMTerminator, I : InformationLink) = { | ||
7 | FunctionalOutput.outgoingLinks(Out,I); | ||
8 | FunctionalOutput.terminator(Out,T); | ||
9 | } or { | ||
10 | InformationLink.to(I,In); | ||
11 | FunctionalInput.terminator(In,T); | ||
12 | } | ||
13 | |||
14 | @QueryBasedFeature | ||
15 | pattern type(This : Function, Target : FunctionType) = { | ||
16 | find rootElements(_Model, This); | ||
17 | Target == FunctionType::Root; | ||
18 | } or { | ||
19 | neg find parent(_Child, This); | ||
20 | neg find rootElements(_Model, This); | ||
21 | Target == FunctionType::Leaf; | ||
22 | } or { | ||
23 | find parent(This, _Par); | ||
24 | find parent(_Child, This); | ||
25 | Target == FunctionType::Intermediate; | ||
26 | } | ||
27 | |||
28 | pattern rootElements(Model: FunctionalArchitectureModel, Root : Function) = { | ||
29 | FunctionalArchitectureModel.rootElements(Model, Root); | ||
30 | } | ||
31 | |||
32 | pattern parent(Func : Function, Par : Function) = { | ||
33 | Function.parent(Func, Par); | ||
34 | } | ||
35 | |||
36 | @QueryBasedFeature | ||
37 | pattern model(This:FunctionalElement, Target: FunctionalArchitectureModel) { | ||
38 | FunctionalElement(This); | ||
39 | FunctionalArchitectureModel(Target); | ||
40 | } | ||
41 | |||
42 | /* | ||
43 | @Constraint(message="noRoot", severity="error", key={fam}) | ||
44 | pattern noRoot(fam: FunctionalArchitectureModel) { | ||
45 | FunctionalArchitectureModel(fam); | ||
46 | neg find hasRoot(_); | ||
47 | } | ||
48 | @Constraint(message="noIntermediate", severity="error", key={fam}) | ||
49 | pattern noInt(fam: FunctionalArchitectureModel) { | ||
50 | FunctionalArchitectureModel(fam); | ||
51 | neg find hasInt(_); | ||
52 | } | ||
53 | @Constraint(message="noLeaf", severity="error", key={fam}) | ||
54 | pattern noLeaf(fam: FunctionalArchitectureModel) { | ||
55 | FunctionalArchitectureModel(fam); | ||
56 | neg find hasLeaf(_); | ||
57 | } | ||
58 | */ | ||
59 | |||
60 | /* | ||
61 | @QueryBasedFeature | ||
62 | pattern model(This : FunctionalElement, Target : FunctionalArchitectureModel) = { | ||
63 | find parent+(This, Parent); | ||
64 | find rootElements(Target, Parent); | ||
65 | } or { | ||
66 | find rootElements(Target, This); | ||
67 | } | ||
68 | |||
69 | pattern interfaceData(FI : FunctionalInterface, FD : FunctionalData) = { | ||
70 | FunctionalInterface.data(FI, FD); | ||
71 | } | ||
72 | |||
73 | @QueryBasedFeature | ||
74 | pattern inputs(This : FunctionalInterface, Target : FunctionalInput) = { | ||
75 | find interfaceData(This, Target); | ||
76 | } | ||
77 | |||
78 | @QueryBasedFeature | ||
79 | pattern outputs(This : FunctionalInterface, Target : FunctionalOutput) = { | ||
80 | find interfaceData(This, Target); | ||
81 | } | ||
82 | |||
83 | @QueryBasedFeature | ||
84 | pattern outgoingLinks(This : FunctionalElement, Target : InformationLink) = { | ||
85 | FunctionalElement.interface.outputs(This, Output); | ||
86 | InformationLink.from(Target, Output); | ||
87 | } | ||
88 | |||
89 | @QueryBasedFeature | ||
90 | pattern incomingLinks(This : FunctionalElement, Target : InformationLink) = { | ||
91 | FunctionalElement.interface.inputs(This, Input); | ||
92 | InformationLink.to(Target, Input); | ||
93 | } | ||
94 | |||
95 | @QueryBasedFeature | ||
96 | pattern connects(This : FunctionalElement, Target : FunctionalElement) = { | ||
97 | FunctionalElement.outgoingLinks(This,Link); | ||
98 | FunctionalElement.incomingLinks(Target,Link); | ||
99 | }*/ | ||
100 | |||
101 | /*pattern frequency(a: Function, b : EInt) { | ||
102 | Function.minimumFrequency(a,b); | ||
103 | }*/ | ||