diff options
author | 2019-09-08 16:12:55 -0400 | |
---|---|---|
committer | 2020-06-07 19:42:29 -0400 | |
commit | 4aee5bcc86b9e6b515fbbdac030df42147be7dc1 (patch) | |
tree | ce9f8aa1cf0ab33d4304b9ce3a0abf4beb7b757a /Domains | |
parent | VAMPIRE: complete first version of VampireModelInterpretation (diff) | |
download | VIATRA-Generator-4aee5bcc86b9e6b515fbbdac030df42147be7dc1.tar.gz VIATRA-Generator-4aee5bcc86b9e6b515fbbdac030df42147be7dc1.tar.zst VIATRA-Generator-4aee5bcc86b9e6b515fbbdac030df42147be7dc1.zip |
VAMPIRE: Implement wf constraint handling
Diffstat (limited to 'Domains')
3 files changed, 118 insertions, 39 deletions
diff --git a/Domains/Examples/ModelGenExampleFAM_plugin/model/FamMetamodel.ecore b/Domains/Examples/ModelGenExampleFAM_plugin/model/FamMetamodel.ecore index 9654ba41..a8a3bf64 100644 --- a/Domains/Examples/ModelGenExampleFAM_plugin/model/FamMetamodel.ecore +++ b/Domains/Examples/ModelGenExampleFAM_plugin/model/FamMetamodel.ecore | |||
@@ -1,3 +1,4 @@ | |||
1 | <<<<<<< HEAD | ||
1 | <?xml version="1.0" encoding="UTF-8"?> | 2 | <?xml version="1.0" encoding="UTF-8"?> |
2 | <ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | 3 | <ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
3 | xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="functionalarchitecture" nsURI="http://www.inf.mit.bme.hu/viatrasolver/example/fam" | 4 | xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="functionalarchitecture" nsURI="http://www.inf.mit.bme.hu/viatrasolver/example/fam" |
@@ -67,3 +68,66 @@ | |||
67 | <eLiterals name="Leaf" value="2"/> | 68 | <eLiterals name="Leaf" value="2"/> |
68 | </eClassifiers> | 69 | </eClassifiers> |
69 | </ecore:EPackage> | 70 | </ecore:EPackage> |
71 | ======= | ||
72 | <?xml version="1.0" encoding="UTF-8"?> | ||
73 | <ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
74 | xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="functionalarchitecture" nsURI="http://www.inf.mit.bme.hu/viatrasolver/example/fam" | ||
75 | nsPrefix="functionalarchitecture"> | ||
76 | <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore"> | ||
77 | <details key="settingDelegates" value="org.eclipse.viatra.query.querybasedfeature"/> | ||
78 | </eAnnotations> | ||
79 | <eClassifiers xsi:type="ecore:EClass" name="FunctionalElement" abstract="true"> | ||
80 | <eStructuralFeatures xsi:type="ecore:EReference" name="interface" eType="#//FunctionalInterface" | ||
81 | containment="true" eOpposite="#//FunctionalInterface/element"/> | ||
82 | <eStructuralFeatures xsi:type="ecore:EReference" name="model" lowerBound="1" eType="#//FunctionalArchitectureModel" | ||
83 | volatile="true" transient="true" derived="true"/> | ||
84 | <eStructuralFeatures xsi:type="ecore:EReference" name="parent" eType="#//Function" | ||
85 | eOpposite="#//Function/subElements"/> | ||
86 | </eClassifiers> | ||
87 | <eClassifiers xsi:type="ecore:EClass" name="FunctionalArchitectureModel"> | ||
88 | <eStructuralFeatures xsi:type="ecore:EReference" name="rootElements" upperBound="-1" | ||
89 | eType="#//FunctionalElement" containment="true"/> | ||
90 | </eClassifiers> | ||
91 | <eClassifiers xsi:type="ecore:EClass" name="Function" eSuperTypes="#//FunctionalElement"> | ||
92 | <eStructuralFeatures xsi:type="ecore:EReference" name="subElements" upperBound="-1" | ||
93 | eType="#//FunctionalElement" containment="true" eOpposite="#//FunctionalElement/parent"/> | ||
94 | <eStructuralFeatures xsi:type="ecore:EAttribute" name="type" lowerBound="1" eType="#//FunctionType" | ||
95 | changeable="false" volatile="true" transient="true" derived="true"/> | ||
96 | </eClassifiers> | ||
97 | <eClassifiers xsi:type="ecore:EClass" name="FAMTerminator"> | ||
98 | <eStructuralFeatures xsi:type="ecore:EReference" name="data" eType="#//FunctionalData" | ||
99 | eOpposite="#//FunctionalData/terminator"/> | ||
100 | </eClassifiers> | ||
101 | <eClassifiers xsi:type="ecore:EClass" name="InformationLink"> | ||
102 | <eStructuralFeatures xsi:type="ecore:EReference" name="from" eType="#//FunctionalOutput" | ||
103 | eOpposite="#//FunctionalOutput/outgoingLinks"/> | ||
104 | <eStructuralFeatures xsi:type="ecore:EReference" name="to" lowerBound="1" eType="#//FunctionalInput" | ||
105 | eOpposite="#//FunctionalInput/IncomingLinks"/> | ||
106 | </eClassifiers> | ||
107 | <eClassifiers xsi:type="ecore:EClass" name="FunctionalInterface"> | ||
108 | <eStructuralFeatures xsi:type="ecore:EReference" name="data" upperBound="-1" eType="#//FunctionalData" | ||
109 | containment="true" eOpposite="#//FunctionalData/interface"/> | ||
110 | <eStructuralFeatures xsi:type="ecore:EReference" name="element" eType="#//FunctionalElement" | ||
111 | eOpposite="#//FunctionalElement/interface"/> | ||
112 | </eClassifiers> | ||
113 | <eClassifiers xsi:type="ecore:EClass" name="FunctionalInput" eSuperTypes="#//FunctionalData"> | ||
114 | <eStructuralFeatures xsi:type="ecore:EReference" name="IncomingLinks" upperBound="-1" | ||
115 | eType="#//InformationLink" eOpposite="#//InformationLink/to"/> | ||
116 | </eClassifiers> | ||
117 | <eClassifiers xsi:type="ecore:EClass" name="FunctionalOutput" eSuperTypes="#//FunctionalData"> | ||
118 | <eStructuralFeatures xsi:type="ecore:EReference" name="outgoingLinks" upperBound="-1" | ||
119 | eType="#//InformationLink" containment="true" eOpposite="#//InformationLink/from"/> | ||
120 | </eClassifiers> | ||
121 | <eClassifiers xsi:type="ecore:EClass" name="FunctionalData" abstract="true"> | ||
122 | <eStructuralFeatures xsi:type="ecore:EReference" name="terminator" eType="#//FAMTerminator" | ||
123 | containment="true" eOpposite="#//FAMTerminator/data"/> | ||
124 | <eStructuralFeatures xsi:type="ecore:EReference" name="interface" eType="#//FunctionalInterface" | ||
125 | eOpposite="#//FunctionalInterface/data"/> | ||
126 | </eClassifiers> | ||
127 | <eClassifiers xsi:type="ecore:EEnum" name="FunctionType"> | ||
128 | <eLiterals name="Root"/> | ||
129 | <eLiterals name="Intermediate" value="1"/> | ||
130 | <eLiterals name="Leaf" value="2"/> | ||
131 | </eClassifiers> | ||
132 | </ecore:EPackage> | ||
133 | >>>>>>> 71108d46... VAMPIRE: Implement wf constraint handling | ||
diff --git a/Domains/Examples/ModelGenExampleFAM_plugin/plugin.xml b/Domains/Examples/ModelGenExampleFAM_plugin/plugin.xml index 213ec0ed..c7fcc081 100644 --- a/Domains/Examples/ModelGenExampleFAM_plugin/plugin.xml +++ b/Domains/Examples/ModelGenExampleFAM_plugin/plugin.xml | |||
@@ -1,3 +1,4 @@ | |||
1 | <<<<<<< HEAD | ||
1 | <?xml version="1.0" encoding="UTF-8"?><plugin> | 2 | <?xml version="1.0" encoding="UTF-8"?><plugin> |
2 | <extension id="extension.derived.hu.bme.mit.inf.dslreasoner.domains.transima.fam.model" point="org.eclipse.viatra.query.runtime.base.wellbehaving.derived.features"> | 3 | <extension id="extension.derived.hu.bme.mit.inf.dslreasoner.domains.transima.fam.model" point="org.eclipse.viatra.query.runtime.base.wellbehaving.derived.features"> |
3 | <wellbehaving-derived-feature classifier-name="FunctionalElement" feature-name="model" package-nsUri="http://www.inf.mit.bme.hu/viatrasolver/example/fam"/> | 4 | <wellbehaving-derived-feature classifier-name="FunctionalElement" feature-name="model" package-nsUri="http://www.inf.mit.bme.hu/viatrasolver/example/fam"/> |
@@ -22,3 +23,16 @@ | |||
22 | </group> | 23 | </group> |
23 | </extension> | 24 | </extension> |
24 | </plugin> | 25 | </plugin> |
26 | ======= | ||
27 | <?xml version="1.0" encoding="UTF-8"?><plugin> | ||
28 | <extension point="org.eclipse.emf.ecore.generated_package"> | ||
29 | <!-- @generated FamMetamodel --> | ||
30 | <package class="functionalarchitecture.FunctionalarchitecturePackage" genModel="model/FamMetamodel.genmodel" uri="http://www.inf.mit.bme.hu/viatrasolver/example/fam"/> | ||
31 | </extension> | ||
32 | <extension id="hu.bme.mit.inf.dslreasoner.domains.transima.fam.FamPatterns" point="org.eclipse.viatra.query.runtime.queryspecification"> | ||
33 | <group group="org.eclipse.viatra.query.runtime.extensibility.SingletonExtensionFactory:hu.bme.mit.inf.dslreasoner.domains.transima.fam.FamPatterns" id="hu.bme.mit.inf.dslreasoner.domains.transima.fam.FamPatterns"> | ||
34 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.transima.fam.terminatorAndInformation"/> | ||
35 | </group> | ||
36 | </extension> | ||
37 | </plugin> | ||
38 | >>>>>>> 71108d46... VAMPIRE: Implement wf constraint handling | ||
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 index f0e48d42..15f70963 100644 --- 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 | |||
@@ -11,45 +11,46 @@ pattern terminatorAndInformation(T : FAMTerminator, I : InformationLink) = { | |||
11 | FunctionalInput.terminator(In,T); | 11 | FunctionalInput.terminator(In,T); |
12 | } | 12 | } |
13 | 13 | ||
14 | @QueryBasedFeature | 14 | //@QueryBasedFeature |
15 | pattern type(This : Function, Target : FunctionType) = { | 15 | //pattern type(This : Function, Target : FunctionType) = { |
16 | find rootElements(_Model, This); | 16 | // find rootElements(_Model, This); |
17 | Target == FunctionType::Root; | 17 | // Target == FunctionType::Root; |
18 | } or { | 18 | //} or { |
19 | neg find parent(_Child, This); | 19 | // neg find parent(_Child, This); |
20 | neg find rootElements(_Model, This); | 20 | // neg find rootElements(_Model, This); |
21 | Target == FunctionType::Leaf; | 21 | // Target == FunctionType::Leaf; |
22 | } or { | 22 | //} or { |
23 | find parent(This, _Par); | 23 | // find parent(This, _Par); |
24 | find parent(_Child, This); | 24 | // find parent(_Child, This); |
25 | Target == FunctionType::Intermediate; | 25 | // Target == FunctionType::Intermediate; |
26 | } | 26 | //} |
27 | 27 | // | |
28 | pattern rootElements(Model: FunctionalArchitectureModel, Root : Function) = { | 28 | ////@Constraint |
29 | FunctionalArchitectureModel.rootElements(Model, Root); | 29 | //pattern rootElements(Model: FunctionalArchitectureModel, Root : Function) = { |
30 | } | 30 | // FunctionalArchitectureModel.rootElements(Model, Root); |
31 | 31 | //} | |
32 | pattern parent(Func : Function, Par : Function) = { | 32 | // |
33 | Function.parent(Func, Par); | 33 | //pattern parent(Func : Function, Par : Function) = { |
34 | } | 34 | // Function.parent(Func, Par); |
35 | 35 | //} | |
36 | @QueryBasedFeature | 36 | // |
37 | pattern model(This:FunctionalElement, Target: FunctionalArchitectureModel) { | 37 | //@QueryBasedFeature |
38 | FunctionalElement(This); | 38 | //pattern model(This:FunctionalElement, Target: FunctionalArchitectureModel) { |
39 | FunctionalArchitectureModel(Target); | 39 | // FunctionalElement(This); |
40 | } | 40 | // FunctionalArchitectureModel(Target); |
41 | 41 | //} | |
42 | pattern hasRoot(F : Function) { | 42 | // |
43 | find rootElements(_Model, F); | 43 | //pattern hasRoot(F : Function) { |
44 | } | 44 | // find rootElements(_Model, F); |
45 | pattern hasInt(F : Function) { | 45 | //} |
46 | neg find parent(_Child, F); | 46 | //pattern hasInt(F : Function) { |
47 | neg find rootElements(_Model, F); | 47 | // neg find parent(_Child, F); |
48 | } | 48 | // neg find rootElements(_Model, F); |
49 | pattern hasLeaf(F : Function) { | 49 | //} |
50 | find parent(F, _Par); | 50 | //pattern hasLeaf(F : Function) { |
51 | find parent(_Child, F); | 51 | // find parent(F, _Par); |
52 | } | 52 | // find parent(_Child, F); |
53 | //} | ||
53 | /* | 54 | /* |
54 | @Constraint(message="noRoot", severity="error", key={fam}) | 55 | @Constraint(message="noRoot", severity="error", key={fam}) |
55 | pattern noRoot(fam: FunctionalArchitectureModel) { | 56 | pattern noRoot(fam: FunctionalArchitectureModel) { |