diff options
author | 2018-03-24 22:08:23 -0400 | |
---|---|---|
committer | 2018-03-24 22:08:23 -0400 | |
commit | dbbf707d78c76f4bc001d7df2418bd6ceab12db3 (patch) | |
tree | 08739c6d7739bc4fa404a9c850f98bef9ea994e7 /Domains/Examples/ModelGenExampleFAM_plugin/src/hu/bme/mit/inf/dslreasoner/domains/transima | |
parent | upgraded attribute support for the graph solver (diff) | |
download | VIATRA-Generator-dbbf707d78c76f4bc001d7df2418bd6ceab12db3.tar.gz VIATRA-Generator-dbbf707d78c76f4bc001d7df2418bd6ceab12db3.tar.zst VIATRA-Generator-dbbf707d78c76f4bc001d7df2418bd6ceab12db3.zip |
example projects added
Diffstat (limited to 'Domains/Examples/ModelGenExampleFAM_plugin/src/hu/bme/mit/inf/dslreasoner/domains/transima')
-rw-r--r-- | Domains/Examples/ModelGenExampleFAM_plugin/src/hu/bme/mit/inf/dslreasoner/domains/transima/fam/FamPatterns.vql | 114 |
1 files changed, 114 insertions, 0 deletions
diff --git a/Domains/Examples/ModelGenExampleFAM_plugin/src/hu/bme/mit/inf/dslreasoner/domains/transima/fam/FamPatterns.vql b/Domains/Examples/ModelGenExampleFAM_plugin/src/hu/bme/mit/inf/dslreasoner/domains/transima/fam/FamPatterns.vql new file mode 100644 index 00000000..f0e48d42 --- /dev/null +++ b/Domains/Examples/ModelGenExampleFAM_plugin/src/hu/bme/mit/inf/dslreasoner/domains/transima/fam/FamPatterns.vql | |||
@@ -0,0 +1,114 @@ | |||
1 | package hu.bme.mit.inf.dslreasoner.domains.transima.fam | ||
2 | |||
3 | import epackage "http://www.inf.mit.bme.hu/viatrasolver/example/fam" | ||
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 | pattern hasRoot(F : Function) { | ||
43 | find rootElements(_Model, F); | ||
44 | } | ||
45 | pattern hasInt(F : Function) { | ||
46 | neg find parent(_Child, F); | ||
47 | neg find rootElements(_Model, F); | ||
48 | } | ||
49 | pattern hasLeaf(F : Function) { | ||
50 | find parent(F, _Par); | ||
51 | find parent(_Child, F); | ||
52 | } | ||
53 | /* | ||
54 | @Constraint(message="noRoot", severity="error", key={fam}) | ||
55 | pattern noRoot(fam: FunctionalArchitectureModel) { | ||
56 | FunctionalArchitectureModel(fam); | ||
57 | neg find hasRoot(_); | ||
58 | } | ||
59 | @Constraint(message="noIntermediate", severity="error", key={fam}) | ||
60 | pattern noInt(fam: FunctionalArchitectureModel) { | ||
61 | FunctionalArchitectureModel(fam); | ||
62 | neg find hasInt(_); | ||
63 | } | ||
64 | @Constraint(message="noLeaf", severity="error", key={fam}) | ||
65 | pattern noLeaf(fam: FunctionalArchitectureModel) { | ||
66 | FunctionalArchitectureModel(fam); | ||
67 | neg find hasLeaf(_); | ||
68 | }*/ | ||
69 | |||
70 | |||
71 | /* | ||
72 | @QueryBasedFeature | ||
73 | pattern model(This : FunctionalElement, Target : FunctionalArchitectureModel) = { | ||
74 | find parent+(This, Parent); | ||
75 | find rootElements(Target, Parent); | ||
76 | } or { | ||
77 | find rootElements(Target, This); | ||
78 | } | ||
79 | |||
80 | pattern interfaceData(FI : FunctionalInterface, FD : FunctionalData) = { | ||
81 | FunctionalInterface.data(FI, FD); | ||
82 | } | ||
83 | |||
84 | @QueryBasedFeature | ||
85 | pattern inputs(This : FunctionalInterface, Target : FunctionalInput) = { | ||
86 | find interfaceData(This, Target); | ||
87 | } | ||
88 | |||
89 | @QueryBasedFeature | ||
90 | pattern outputs(This : FunctionalInterface, Target : FunctionalOutput) = { | ||
91 | find interfaceData(This, Target); | ||
92 | } | ||
93 | |||
94 | @QueryBasedFeature | ||
95 | pattern outgoingLinks(This : FunctionalElement, Target : InformationLink) = { | ||
96 | FunctionalElement.interface.outputs(This, Output); | ||
97 | InformationLink.from(Target, Output); | ||
98 | } | ||
99 | |||
100 | @QueryBasedFeature | ||
101 | pattern incomingLinks(This : FunctionalElement, Target : InformationLink) = { | ||
102 | FunctionalElement.interface.inputs(This, Input); | ||
103 | InformationLink.to(Target, Input); | ||
104 | } | ||
105 | |||
106 | @QueryBasedFeature | ||
107 | pattern connects(This : FunctionalElement, Target : FunctionalElement) = { | ||
108 | FunctionalElement.outgoingLinks(This,Link); | ||
109 | FunctionalElement.incomingLinks(Target,Link); | ||
110 | }*/ | ||
111 | |||
112 | /*pattern frequency(a: Function, b : EInt) { | ||
113 | Function.minimumFrequency(a,b); | ||
114 | }*/ | ||