diff options
Diffstat (limited to 'Tests/ca.mcgill.ecse.dslreasoner.standalone.test')
14 files changed, 180 insertions, 891 deletions
diff --git a/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/metamodels/yakindu.aird b/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/metamodels/yakindu.aird index be45a301..518acc99 100644 --- a/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/metamodels/yakindu.aird +++ b/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/metamodels/yakindu.aird | |||
@@ -2,7 +2,6 @@ | |||
2 | <xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:description="http://www.eclipse.org/sirius/description/1.1.0" xmlns:description_1="http://www.eclipse.org/sirius/diagram/description/1.1.0" xmlns:diagram="http://www.eclipse.org/sirius/diagram/1.1.0" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmlns:style="http://www.eclipse.org/sirius/diagram/description/style/1.1.0" xmlns:viewpoint="http://www.eclipse.org/sirius/1.1.0" xsi:schemaLocation="http://www.eclipse.org/sirius/description/1.1.0 http://www.eclipse.org/sirius/1.1.0#//description http://www.eclipse.org/sirius/diagram/description/1.1.0 http://www.eclipse.org/sirius/diagram/1.1.0#//description http://www.eclipse.org/sirius/diagram/description/style/1.1.0 http://www.eclipse.org/sirius/diagram/1.1.0#//description/style"> | 2 | <xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:description="http://www.eclipse.org/sirius/description/1.1.0" xmlns:description_1="http://www.eclipse.org/sirius/diagram/description/1.1.0" xmlns:diagram="http://www.eclipse.org/sirius/diagram/1.1.0" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmlns:style="http://www.eclipse.org/sirius/diagram/description/style/1.1.0" xmlns:viewpoint="http://www.eclipse.org/sirius/1.1.0" xsi:schemaLocation="http://www.eclipse.org/sirius/description/1.1.0 http://www.eclipse.org/sirius/1.1.0#//description http://www.eclipse.org/sirius/diagram/description/1.1.0 http://www.eclipse.org/sirius/diagram/1.1.0#//description http://www.eclipse.org/sirius/diagram/description/style/1.1.0 http://www.eclipse.org/sirius/diagram/1.1.0#//description/style"> |
3 | <viewpoint:DAnalysis uid="_e7vq8FybEemc87q3iJlCgw" selectedViews="_feFjAFybEemc87q3iJlCgw _feTlcFybEemc87q3iJlCgw _feUzkFybEemc87q3iJlCgw _feWBsFybEemc87q3iJlCgw" version="14.1.0.201810161215"> | 3 | <viewpoint:DAnalysis uid="_e7vq8FybEemc87q3iJlCgw" selectedViews="_feFjAFybEemc87q3iJlCgw _feTlcFybEemc87q3iJlCgw _feUzkFybEemc87q3iJlCgw _feWBsFybEemc87q3iJlCgw" version="14.1.0.201810161215"> |
4 | <semanticResources>yakindu.ecore</semanticResources> | 4 | <semanticResources>yakindu.ecore</semanticResources> |
5 | <semanticResources>yakindu.genmodel</semanticResources> | ||
6 | <ownedViews xmi:type="viewpoint:DView" uid="_feFjAFybEemc87q3iJlCgw"> | 5 | <ownedViews xmi:type="viewpoint:DView" uid="_feFjAFybEemc87q3iJlCgw"> |
7 | <viewpoint xmi:type="description:Viewpoint" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']"/> | 6 | <viewpoint xmi:type="description:Viewpoint" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']"/> |
8 | <ownedRepresentationDescriptors xmi:type="viewpoint:DRepresentationDescriptor" uid="_gE_K8FybEemc87q3iJlCgw" name="yakindu class diagram" repPath="#_gDD4UFybEemc87q3iJlCgw"> | 7 | <ownedRepresentationDescriptors xmi:type="viewpoint:DRepresentationDescriptor" uid="_gE_K8FybEemc87q3iJlCgw" name="yakindu class diagram" repPath="#_gDD4UFybEemc87q3iJlCgw"> |
diff --git a/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/metamodels/yakindu.ecore b/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/metamodels/yakindu.ecore index 0c944db8..0e800e4a 100644 --- a/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/metamodels/yakindu.ecore +++ b/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/metamodels/yakindu.ecore | |||
@@ -1,26 +1,33 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8"?> | 1 | <?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" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="yakindu" nsURI="YakinduMetamodel" nsPrefix="yakindu"> | 2 | <ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
3 | <eClassifiers xsi:type="ecore:EClass" name="Pseudostate" abstract="true" eSuperTypes="//Vertex"/> | 3 | xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="yakindu" nsURI="YakinduMetamodel" nsPrefix="yakindu"> |
4 | <eClassifiers xsi:type="ecore:EClass" name="Pseudostate" abstract="true" eSuperTypes="#//Vertex"/> | ||
4 | <eClassifiers xsi:type="ecore:EClass" name="Vertex" abstract="true"> | 5 | <eClassifiers xsi:type="ecore:EClass" name="Vertex" abstract="true"> |
5 | <eStructuralFeatures xsi:type="ecore:EReference" name="incomingTransitions" ordered="false" upperBound="-1" eType="//Transition" eOpposite="//Transition/target"/> | 6 | <eStructuralFeatures xsi:type="ecore:EReference" name="incomingTransitions" ordered="false" |
6 | <eStructuralFeatures xsi:type="ecore:EReference" name="outgoingTransitions" ordered="false" upperBound="-1" eType="//Transition" containment="true" eOpposite="//Transition/source"/> | 7 | upperBound="-1" eType="#//Transition" eOpposite="#//Transition/target"/> |
8 | <eStructuralFeatures xsi:type="ecore:EReference" name="outgoingTransitions" ordered="false" | ||
9 | upperBound="-1" eType="#//Transition" containment="true" eOpposite="#//Transition/source"/> | ||
7 | </eClassifiers> | 10 | </eClassifiers> |
8 | <eClassifiers xsi:type="ecore:EClass" name="Region"> | 11 | <eClassifiers xsi:type="ecore:EClass" name="Region"> |
9 | <eStructuralFeatures xsi:type="ecore:EReference" name="vertices" ordered="false" upperBound="-1" eType="//Vertex" containment="true"/> | 12 | <eStructuralFeatures xsi:type="ecore:EReference" name="vertices" ordered="false" |
13 | upperBound="-1" eType="#//Vertex" containment="true"/> | ||
10 | </eClassifiers> | 14 | </eClassifiers> |
11 | <eClassifiers xsi:type="ecore:EClass" name="Transition"> | 15 | <eClassifiers xsi:type="ecore:EClass" name="Transition"> |
12 | <eStructuralFeatures xsi:type="ecore:EReference" name="target" ordered="false" lowerBound="1" eType="//Vertex" eOpposite="//Vertex/incomingTransitions"/> | 16 | <eStructuralFeatures xsi:type="ecore:EReference" name="target" ordered="false" |
13 | <eStructuralFeatures xsi:type="ecore:EReference" name="source" ordered="false" eType="//Vertex" eOpposite="//Vertex/outgoingTransitions"/> | 17 | lowerBound="1" eType="#//Vertex" eOpposite="#//Vertex/incomingTransitions"/> |
18 | <eStructuralFeatures xsi:type="ecore:EReference" name="source" ordered="false" | ||
19 | eType="#//Vertex" eOpposite="#//Vertex/outgoingTransitions"/> | ||
14 | </eClassifiers> | 20 | </eClassifiers> |
15 | <eClassifiers xsi:type="ecore:EClass" name="Statechart" eSuperTypes="//CompositeElement"/> | 21 | <eClassifiers xsi:type="ecore:EClass" name="Statechart" eSuperTypes="#//CompositeElement"/> |
16 | <eClassifiers xsi:type="ecore:EClass" name="Entry" eSuperTypes="//Pseudostate"/> | 22 | <eClassifiers xsi:type="ecore:EClass" name="Entry" eSuperTypes="#//Pseudostate"/> |
17 | <eClassifiers xsi:type="ecore:EClass" name="Synchronization" eSuperTypes="//Pseudostate"/> | 23 | <eClassifiers xsi:type="ecore:EClass" name="Synchronization" eSuperTypes="#//Pseudostate"/> |
18 | <eClassifiers xsi:type="ecore:EClass" name="State" eSuperTypes="//RegularState //CompositeElement"/> | 24 | <eClassifiers xsi:type="ecore:EClass" name="State" eSuperTypes="#//RegularState #//CompositeElement"/> |
19 | <eClassifiers xsi:type="ecore:EClass" name="RegularState" abstract="true" eSuperTypes="//Vertex"/> | 25 | <eClassifiers xsi:type="ecore:EClass" name="RegularState" abstract="true" eSuperTypes="#//Vertex"/> |
20 | <eClassifiers xsi:type="ecore:EClass" name="CompositeElement" abstract="true"> | 26 | <eClassifiers xsi:type="ecore:EClass" name="CompositeElement" abstract="true"> |
21 | <eStructuralFeatures xsi:type="ecore:EReference" name="regions" upperBound="-1" eType="//Region" containment="true"/> | 27 | <eStructuralFeatures xsi:type="ecore:EReference" name="regions" upperBound="-1" |
28 | eType="#//Region" containment="true"/> | ||
22 | </eClassifiers> | 29 | </eClassifiers> |
23 | <eClassifiers xsi:type="ecore:EClass" name="Choice" eSuperTypes="//Pseudostate"/> | 30 | <eClassifiers xsi:type="ecore:EClass" name="Choice" eSuperTypes="#//Pseudostate"/> |
24 | <eClassifiers xsi:type="ecore:EClass" name="Exit" eSuperTypes="//Pseudostate"/> | 31 | <eClassifiers xsi:type="ecore:EClass" name="Exit" eSuperTypes="#//Pseudostate"/> |
25 | <eClassifiers xsi:type="ecore:EClass" name="FinalState" eSuperTypes="//RegularState"/> | 32 | <eClassifiers xsi:type="ecore:EClass" name="FinalState" eSuperTypes="#//RegularState"/> |
26 | </ecore:EPackage> | 33 | </ecore:EPackage> |
diff --git a/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/metamodels/yakindu.genmodel b/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/metamodels/yakindu.genmodel index b1f75d76..46801b3e 100644 --- a/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/metamodels/yakindu.genmodel +++ b/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/metamodels/yakindu.genmodel | |||
@@ -5,7 +5,7 @@ | |||
5 | rootExtendsClass="org.eclipse.emf.ecore.impl.MinimalEObjectImpl$Container" importerID="org.eclipse.emf.importer.ecore" | 5 | rootExtendsClass="org.eclipse.emf.ecore.impl.MinimalEObjectImpl$Container" importerID="org.eclipse.emf.importer.ecore" |
6 | complianceLevel="8.0" copyrightFields="false" operationReflection="true" importOrganizing="true"> | 6 | complianceLevel="8.0" copyrightFields="false" operationReflection="true" importOrganizing="true"> |
7 | <foreignModel>yakindu.ecore</foreignModel> | 7 | <foreignModel>yakindu.ecore</foreignModel> |
8 | <genPackages prefix="yakindu" basePackage="ca.mcgill.ecse.dslreasoner.standalone.test" | 8 | <genPackages prefix="Yakindu" basePackage="ca.mcgill.ecse.dslreasoner.standalone.test" |
9 | disposableProviderFactory="true" ecorePackage="yakindu.ecore#/"> | 9 | disposableProviderFactory="true" ecorePackage="yakindu.ecore#/"> |
10 | <genClasses image="false" ecoreClass="yakindu.ecore#//Pseudostate"/> | 10 | <genClasses image="false" ecoreClass="yakindu.ecore#//Pseudostate"/> |
11 | <genClasses image="false" ecoreClass="yakindu.ecore#//Vertex"> | 11 | <genClasses image="false" ecoreClass="yakindu.ecore#//Vertex"> |
diff --git a/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/metamodels/yakindu.genmodel_ b/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/metamodels/yakindu.genmodel_ new file mode 100644 index 00000000..b1f75d76 --- /dev/null +++ b/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/metamodels/yakindu.genmodel_ | |||
@@ -0,0 +1,34 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8"?> | ||
2 | <genmodel:GenModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" | ||
3 | xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/ca.mcgill.ecse.dslreasoner.standalone.test/src" | ||
4 | modelPluginID="ca.mcgill.ecse.dslreasoner.standalone.test" modelName="Yakindu" | ||
5 | rootExtendsClass="org.eclipse.emf.ecore.impl.MinimalEObjectImpl$Container" importerID="org.eclipse.emf.importer.ecore" | ||
6 | complianceLevel="8.0" copyrightFields="false" operationReflection="true" importOrganizing="true"> | ||
7 | <foreignModel>yakindu.ecore</foreignModel> | ||
8 | <genPackages prefix="yakindu" basePackage="ca.mcgill.ecse.dslreasoner.standalone.test" | ||
9 | disposableProviderFactory="true" ecorePackage="yakindu.ecore#/"> | ||
10 | <genClasses image="false" ecoreClass="yakindu.ecore#//Pseudostate"/> | ||
11 | <genClasses image="false" ecoreClass="yakindu.ecore#//Vertex"> | ||
12 | <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference yakindu.ecore#//Vertex/incomingTransitions"/> | ||
13 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference yakindu.ecore#//Vertex/outgoingTransitions"/> | ||
14 | </genClasses> | ||
15 | <genClasses ecoreClass="yakindu.ecore#//Region"> | ||
16 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference yakindu.ecore#//Region/vertices"/> | ||
17 | </genClasses> | ||
18 | <genClasses ecoreClass="yakindu.ecore#//Transition"> | ||
19 | <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference yakindu.ecore#//Transition/target"/> | ||
20 | <genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference yakindu.ecore#//Transition/source"/> | ||
21 | </genClasses> | ||
22 | <genClasses ecoreClass="yakindu.ecore#//Statechart"/> | ||
23 | <genClasses ecoreClass="yakindu.ecore#//Entry"/> | ||
24 | <genClasses ecoreClass="yakindu.ecore#//Synchronization"/> | ||
25 | <genClasses ecoreClass="yakindu.ecore#//State"/> | ||
26 | <genClasses image="false" ecoreClass="yakindu.ecore#//RegularState"/> | ||
27 | <genClasses image="false" ecoreClass="yakindu.ecore#//CompositeElement"> | ||
28 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference yakindu.ecore#//CompositeElement/regions"/> | ||
29 | </genClasses> | ||
30 | <genClasses ecoreClass="yakindu.ecore#//Choice"/> | ||
31 | <genClasses ecoreClass="yakindu.ecore#//Exit"/> | ||
32 | <genClasses ecoreClass="yakindu.ecore#//FinalState"/> | ||
33 | </genPackages> | ||
34 | </genmodel:GenModel> | ||
diff --git a/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/plugin.xml b/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/plugin.xml index a2a573fc..0335dc9f 100644 --- a/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/plugin.xml +++ b/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/plugin.xml | |||
@@ -5,10 +5,6 @@ | |||
5 | <package class="ca.mcgill.ecse.dslreasoner.standalone.test.fam.famPackage" genModel="metamodels/fam.genmodel" uri="FamMetamodel"/> | 5 | <package class="ca.mcgill.ecse.dslreasoner.standalone.test.fam.famPackage" genModel="metamodels/fam.genmodel" uri="FamMetamodel"/> |
6 | </extension> | 6 | </extension> |
7 | <extension point="org.eclipse.emf.ecore.generated_package"> | 7 | <extension point="org.eclipse.emf.ecore.generated_package"> |
8 | <!-- @generated yakindu --> | ||
9 | <package class="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.yakinduPackage" genModel="metamodels/yakindu.genmodel" uri="YakinduMetamodel"/> | ||
10 | </extension> | ||
11 | <extension point="org.eclipse.emf.ecore.generated_package"> | ||
12 | <!-- @generated filesystem --> | 8 | <!-- @generated filesystem --> |
13 | <package class="ca.mcgill.ecse.dslreasoner.standalone.test.filesystem.filesystemPackage" genModel="metamodels/filesystem.genmodel" uri="FileSystemMetamodel"/> | 9 | <package class="ca.mcgill.ecse.dslreasoner.standalone.test.filesystem.filesystemPackage" genModel="metamodels/filesystem.genmodel" uri="FileSystemMetamodel"/> |
14 | </extension> | 10 | </extension> |
@@ -34,74 +30,6 @@ | |||
34 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.filesystem.queries.contentInNotLive"/> | 30 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.filesystem.queries.contentInNotLive"/> |
35 | </group> | 31 | </group> |
36 | </extension> | 32 | </extension> |
37 | <extension id="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.YakinduMutatedPatterns" point="org.eclipse.viatra.query.runtime.queryspecification"> | ||
38 | <group group="org.eclipse.viatra.query.runtime.extensibility.SingletonExtensionFactory:ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.YakinduMutatedPatterns" id="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.YakinduMutatedPatterns"> | ||
39 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.entryInRegion_M0"/> | ||
40 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.entryInRegion_M1"/> | ||
41 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.entryInRegion_M2"/> | ||
42 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.noEntryInRegion_M0"/> | ||
43 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.noEntryInRegion_M1"/> | ||
44 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.noEntryInRegion_M2"/> | ||
45 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.noEntryInRegion_M3"/> | ||
46 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.noEntryInRegion_M4"/> | ||
47 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.noEntryInRegion_M5"/> | ||
48 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.multipleEntryInRegion_M0"/> | ||
49 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.multipleEntryInRegion_M1"/> | ||
50 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.multipleEntryInRegion_M2"/> | ||
51 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.multipleEntryInRegion_M3"/> | ||
52 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.multipleEntryInRegion_M4"/> | ||
53 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.multipleEntryInRegion_M5"/> | ||
54 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.transition_M0"/> | ||
55 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.transition_M1"/> | ||
56 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.transition_M2"/> | ||
57 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.transition_M3"/> | ||
58 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.transition_M4"/> | ||
59 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.incomingToEntry_M0"/> | ||
60 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.incomingToEntry_1"/> | ||
61 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.incomingToEntry_2"/> | ||
62 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.incomingToEntry_3"/> | ||
63 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.incomingToEntry_4"/> | ||
64 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.incomingToEntry_5"/> | ||
65 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.noOutgoingTransitionFromEntry_M0"/> | ||
66 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.noOutgoingTransitionFromEntry_M1"/> | ||
67 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.noOutgoingTransitionFromEntry_M2"/> | ||
68 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.noOutgoingTransitionFromEntry_M3"/> | ||
69 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.noOutgoingTransitionFromEntry_M4"/> | ||
70 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.noOutgoingTransitionFromEntry_M5"/> | ||
71 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.multipleTransitionFromEntry_M0"/> | ||
72 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.multipleTransitionFromEntry_M1"/> | ||
73 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.multipleTransitionFromEntry_M2"/> | ||
74 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.multipleTransitionFromEntry_M3"/> | ||
75 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.multipleTransitionFromEntry_M4"/> | ||
76 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.outgoingFromExit_M0"/> | ||
77 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.outgoingFromExit_M1"/> | ||
78 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.outgoingFromExit_M2"/> | ||
79 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.outgoingFromFinal_M0"/> | ||
80 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.outgoingFromFinal_M1"/> | ||
81 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.outgoingFromFinal_M2"/> | ||
82 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.noStateInRegion_M0"/> | ||
83 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.noStateInRegion_M1"/> | ||
84 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.noStateInRegion_M2"/> | ||
85 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.noStateInRegion_M3"/> | ||
86 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.StateInRegion_M0"/> | ||
87 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.StateInRegion_M1"/> | ||
88 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.StateInRegion_M2"/> | ||
89 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.choiceHasNoOutgoing_M0"/> | ||
90 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.choiceHasNoOutgoing_M1"/> | ||
91 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.choiceHasNoOutgoing_M2"/> | ||
92 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.choiceHasNoOutgoing_M3"/> | ||
93 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.choiceHasNoOutgoing_M4"/> | ||
94 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.choiceHasNoOutgoing_M5"/> | ||
95 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.choiceHasNoOutgoing_M6"/> | ||
96 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.choiceHasNoIncoming_M0"/> | ||
97 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.choiceHasNoIncoming_M1"/> | ||
98 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.choiceHasNoIncoming_M2"/> | ||
99 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.choiceHasNoIncoming_M3"/> | ||
100 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.choiceHasNoIncoming_M4"/> | ||
101 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.choiceHasNoIncoming_M5"/> | ||
102 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.choiceHasNoIncoming_M6"/> | ||
103 | </group> | ||
104 | </extension> | ||
105 | <extension id="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.YakinduPatterns" point="org.eclipse.viatra.query.runtime.queryspecification"> | 33 | <extension id="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.YakinduPatterns" point="org.eclipse.viatra.query.runtime.queryspecification"> |
106 | <group group="org.eclipse.viatra.query.runtime.extensibility.SingletonExtensionFactory:ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.YakinduPatterns" id="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.YakinduPatterns"> | 34 | <group group="org.eclipse.viatra.query.runtime.extensibility.SingletonExtensionFactory:ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.YakinduPatterns" id="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.YakinduPatterns"> |
107 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.entryInRegion"/> | 35 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.entryInRegion"/> |
@@ -129,6 +57,8 @@ | |||
129 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.hasMultipleRegions"/> | 57 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.hasMultipleRegions"/> |
130 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.synchThree"/> | 58 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.synchThree"/> |
131 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.twoSynch"/> | 59 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.twoSynch"/> |
60 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.noSynch"/> | ||
61 | <query-specification fqn="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.synch"/> | ||
132 | </group> | 62 | </group> |
133 | </extension> | 63 | </extension> |
134 | <extension id="extension.derived.ca.mcgill.ecse.dslreasoner.standalone.test.fam.queries.model" point="org.eclipse.viatra.query.runtime.base.wellbehaving.derived.features"> | 64 | <extension id="extension.derived.ca.mcgill.ecse.dslreasoner.standalone.test.fam.queries.model" point="org.eclipse.viatra.query.runtime.base.wellbehaving.derived.features"> |
@@ -140,4 +70,8 @@ | |||
140 | <extension id="extension.derived.ca.mcgill.ecse.dslreasoner.standalone.test.filesystem.queries.live" point="org.eclipse.viatra.query.runtime.base.wellbehaving.derived.features"> | 70 | <extension id="extension.derived.ca.mcgill.ecse.dslreasoner.standalone.test.filesystem.queries.live" point="org.eclipse.viatra.query.runtime.base.wellbehaving.derived.features"> |
141 | <wellbehaving-derived-feature classifier-name="FileSystem" feature-name="live" package-nsUri="FileSystemMetamodel"/> | 71 | <wellbehaving-derived-feature classifier-name="FileSystem" feature-name="live" package-nsUri="FileSystemMetamodel"/> |
142 | </extension> | 72 | </extension> |
73 | <extension point="org.eclipse.emf.ecore.generated_package"> | ||
74 | <!-- @generated yakindu --> | ||
75 | <package class="ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.YakinduPackage" genModel="metamodels/yakindu.genmodel" uri="YakinduMetamodel"/> | ||
76 | </extension> | ||
143 | </plugin> | 77 | </plugin> |
diff --git a/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/queries/ca/mcgill/ecse/dslreasoner/standalone/test/yakindu/queries/yakinduMutatedPatterns.vql b/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/queries/ca/mcgill/ecse/dslreasoner/standalone/test/yakindu/queries/yakinduMutatedPatterns.vql_ index 2e498670..2e498670 100644 --- a/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/queries/ca/mcgill/ecse/dslreasoner/standalone/test/yakindu/queries/yakinduMutatedPatterns.vql +++ b/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/queries/ca/mcgill/ecse/dslreasoner/standalone/test/yakindu/queries/yakinduMutatedPatterns.vql_ | |||
diff --git a/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/queries/ca/mcgill/ecse/dslreasoner/standalone/test/yakindu/queries/yakinduPatterns.vql b/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/queries/ca/mcgill/ecse/dslreasoner/standalone/test/yakindu/queries/yakinduPatterns.vql index 597b1691..ea8184de 100644 --- a/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/queries/ca/mcgill/ecse/dslreasoner/standalone/test/yakindu/queries/yakinduPatterns.vql +++ b/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/queries/ca/mcgill/ecse/dslreasoner/standalone/test/yakindu/queries/yakinduPatterns.vql | |||
@@ -217,11 +217,11 @@ pattern twoSynch(s1 : Synchronization, s2 : Synchronization) { | |||
217 | /** | 217 | /** |
218 | * Model generation task: at least one synch | 218 | * Model generation task: at least one synch |
219 | */ | 219 | */ |
220 | //@Constraint(severity="error", message="error", key = {s}) | 220 | @Constraint(severity="error", message="error", key = {s}) |
221 | //pattern noSynch(s:Statechart) { | 221 | pattern noSynch(s:Statechart) { |
222 | // Statechart(s); | 222 | Statechart(s); |
223 | // neg find synch(_); | 223 | neg find synch(_); |
224 | //} | 224 | } |
225 | //pattern synch(s:Synchronization) { | 225 | pattern synch(s:Synchronization) { |
226 | // Synchronization(s); | 226 | Synchronization(s); |
227 | //} \ No newline at end of file | 227 | } \ No newline at end of file |
diff --git a/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src-gen/ca/mcgill/ecse/dslreasoner/standalone/test/ecore/queries/.gitignore b/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src-gen/ca/mcgill/ecse/dslreasoner/standalone/test/ecore/queries/.gitignore deleted file mode 100644 index a9786e0f..00000000 --- a/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src-gen/ca/mcgill/ecse/dslreasoner/standalone/test/ecore/queries/.gitignore +++ /dev/null | |||
@@ -1,13 +0,0 @@ | |||
1 | /.DirectSupertype.java._trace | ||
2 | /.Ecore.java._trace | ||
3 | /.LoopInInheritence.java._trace | ||
4 | /.NonSymmetricOpposite.java._trace | ||
5 | /.Opposite.java._trace | ||
6 | /.OppositeDifferentClass.java._trace | ||
7 | /.EcorePatterns.java._trace | ||
8 | /DirectSupertype.java | ||
9 | /EcorePatterns.java | ||
10 | /LoopInInheritence.java | ||
11 | /NonSymmetricOpposite.java | ||
12 | /Opposite.java | ||
13 | /OppositeDifferentClass.java | ||
diff --git a/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src-gen/ca/mcgill/ecse/dslreasoner/standalone/test/fam/queries/.gitignore b/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src-gen/ca/mcgill/ecse/dslreasoner/standalone/test/fam/queries/.gitignore deleted file mode 100644 index 60f1891b..00000000 --- a/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src-gen/ca/mcgill/ecse/dslreasoner/standalone/test/fam/queries/.gitignore +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | /.FamPatterns.java._trace | ||
2 | /.Model.java._trace | ||
3 | /.Parent.java._trace | ||
4 | /.RootElements.java._trace | ||
5 | /.TerminatorAndInformation.java._trace | ||
6 | /.Type.java._trace | ||
7 | /FamPatterns.java | ||
8 | /Model.java | ||
9 | /Parent.java | ||
10 | /RootElements.java | ||
diff --git a/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src-gen/ca/mcgill/ecse/dslreasoner/standalone/test/fam/queries/Type.java b/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src-gen/ca/mcgill/ecse/dslreasoner/standalone/test/fam/queries/Type.java deleted file mode 100644 index bc3230c5..00000000 --- a/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src-gen/ca/mcgill/ecse/dslreasoner/standalone/test/fam/queries/Type.java +++ /dev/null | |||
@@ -1,770 +0,0 @@ | |||
1 | /** | ||
2 | * Generated from platform:/resource/ca.mcgill.ecse.dslreasoner.standalone.test/queries/ca/mcgill/ecse/dslreasoner/standalone/test/fam/queries/famPatterns.vql | ||
3 | */ | ||
4 | package ca.mcgill.ecse.dslreasoner.standalone.test.fam.queries; | ||
5 | |||
6 | import ca.mcgill.ecse.dslreasoner.standalone.test.fam.Function; | ||
7 | import ca.mcgill.ecse.dslreasoner.standalone.test.fam.FunctionType; | ||
8 | import ca.mcgill.ecse.dslreasoner.standalone.test.fam.queries.Parent; | ||
9 | import ca.mcgill.ecse.dslreasoner.standalone.test.fam.queries.RootElements; | ||
10 | import java.util.Arrays; | ||
11 | import java.util.Collection; | ||
12 | import java.util.LinkedHashSet; | ||
13 | import java.util.List; | ||
14 | import java.util.Objects; | ||
15 | import java.util.Optional; | ||
16 | import java.util.Set; | ||
17 | import java.util.function.Consumer; | ||
18 | import java.util.stream.Collectors; | ||
19 | import java.util.stream.Stream; | ||
20 | import org.apache.log4j.Logger; | ||
21 | import org.eclipse.emf.ecore.EClass; | ||
22 | import org.eclipse.emf.ecore.EDataType; | ||
23 | import org.eclipse.viatra.query.runtime.api.IPatternMatch; | ||
24 | import org.eclipse.viatra.query.runtime.api.IQuerySpecification; | ||
25 | import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; | ||
26 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
27 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; | ||
28 | import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; | ||
29 | import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; | ||
30 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
31 | import org.eclipse.viatra.query.runtime.emf.types.EDataTypeInSlotsKey; | ||
32 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
33 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
34 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
35 | import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.PAnnotation; | ||
36 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; | ||
37 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
38 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.NegativePatternCall; | ||
39 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.ConstantValue; | ||
40 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.PositivePatternCall; | ||
41 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
42 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
43 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
44 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
45 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; | ||
46 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | ||
47 | import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; | ||
48 | |||
49 | /** | ||
50 | * A pattern-specific query specification that can instantiate Matcher in a type-safe way. | ||
51 | * | ||
52 | * <p>Original source: | ||
53 | * <code><pre> | ||
54 | * {@literal @}QueryBasedFeature | ||
55 | * pattern type(This : Function, Target : FunctionType) = { | ||
56 | * find rootElements(_Model, This); | ||
57 | * Target == FunctionType::Root; | ||
58 | * } or { | ||
59 | * neg find parent(_Child, This); | ||
60 | * neg find rootElements(_Model, This); | ||
61 | * Target == FunctionType::Leaf; | ||
62 | * } or { | ||
63 | * find parent(This, _Par); | ||
64 | * find parent(_Child, This); | ||
65 | * Target == FunctionType::Intermediate; | ||
66 | * } | ||
67 | * </pre></code> | ||
68 | * | ||
69 | * @see Matcher | ||
70 | * @see Match | ||
71 | * | ||
72 | */ | ||
73 | @SuppressWarnings("all") | ||
74 | public final class Type extends BaseGeneratedEMFQuerySpecification<Type.Matcher> { | ||
75 | /** | ||
76 | * Pattern-specific match representation of the ca.mcgill.ecse.dslreasoner.standalone.test.fam.queries.type pattern, | ||
77 | * to be used in conjunction with {@link Matcher}. | ||
78 | * | ||
79 | * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned. | ||
80 | * Each instance is a (possibly partial) substitution of pattern parameters, | ||
81 | * usable to represent a match of the pattern in the result of a query, | ||
82 | * or to specify the bound (fixed) input parameters when issuing a query. | ||
83 | * | ||
84 | * @see Matcher | ||
85 | * | ||
86 | */ | ||
87 | public static abstract class Match extends BasePatternMatch { | ||
88 | private Function fThis; | ||
89 | |||
90 | private FunctionType fTarget; | ||
91 | |||
92 | private static List<String> parameterNames = makeImmutableList("This", "Target"); | ||
93 | |||
94 | private Match(final Function pThis, final FunctionType pTarget) { | ||
95 | this.fThis = pThis; | ||
96 | this.fTarget = pTarget; | ||
97 | } | ||
98 | |||
99 | @Override | ||
100 | public Object get(final String parameterName) { | ||
101 | if ("This".equals(parameterName)) return this.fThis; | ||
102 | if ("Target".equals(parameterName)) return this.fTarget; | ||
103 | return null; | ||
104 | } | ||
105 | |||
106 | public Function getThis() { | ||
107 | return this.fThis; | ||
108 | } | ||
109 | |||
110 | public FunctionType getTarget() { | ||
111 | return this.fTarget; | ||
112 | } | ||
113 | |||
114 | @Override | ||
115 | public boolean set(final String parameterName, final Object newValue) { | ||
116 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
117 | if ("This".equals(parameterName) ) { | ||
118 | this.fThis = (Function) newValue; | ||
119 | return true; | ||
120 | } | ||
121 | if ("Target".equals(parameterName) ) { | ||
122 | this.fTarget = (FunctionType) newValue; | ||
123 | return true; | ||
124 | } | ||
125 | return false; | ||
126 | } | ||
127 | |||
128 | public void setThis(final Function pThis) { | ||
129 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
130 | this.fThis = pThis; | ||
131 | } | ||
132 | |||
133 | public void setTarget(final FunctionType pTarget) { | ||
134 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
135 | this.fTarget = pTarget; | ||
136 | } | ||
137 | |||
138 | @Override | ||
139 | public String patternName() { | ||
140 | return "ca.mcgill.ecse.dslreasoner.standalone.test.fam.queries.type"; | ||
141 | } | ||
142 | |||
143 | @Override | ||
144 | public List<String> parameterNames() { | ||
145 | return Type.Match.parameterNames; | ||
146 | } | ||
147 | |||
148 | @Override | ||
149 | public Object[] toArray() { | ||
150 | return new Object[]{fThis, fTarget}; | ||
151 | } | ||
152 | |||
153 | @Override | ||
154 | public Type.Match toImmutable() { | ||
155 | return isMutable() ? newMatch(fThis, fTarget) : this; | ||
156 | } | ||
157 | |||
158 | @Override | ||
159 | public String prettyPrint() { | ||
160 | StringBuilder result = new StringBuilder(); | ||
161 | result.append("\"This\"=" + prettyPrintValue(fThis) + ", "); | ||
162 | result.append("\"Target\"=" + prettyPrintValue(fTarget)); | ||
163 | return result.toString(); | ||
164 | } | ||
165 | |||
166 | @Override | ||
167 | public int hashCode() { | ||
168 | return Objects.hash(fThis, fTarget); | ||
169 | } | ||
170 | |||
171 | @Override | ||
172 | public boolean equals(final Object obj) { | ||
173 | if (this == obj) | ||
174 | return true; | ||
175 | if (obj == null) { | ||
176 | return false; | ||
177 | } | ||
178 | if ((obj instanceof Type.Match)) { | ||
179 | Type.Match other = (Type.Match) obj; | ||
180 | return Objects.equals(fThis, other.fThis) && Objects.equals(fTarget, other.fTarget); | ||
181 | } else { | ||
182 | // this should be infrequent | ||
183 | if (!(obj instanceof IPatternMatch)) { | ||
184 | return false; | ||
185 | } | ||
186 | IPatternMatch otherSig = (IPatternMatch) obj; | ||
187 | return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray()); | ||
188 | } | ||
189 | } | ||
190 | |||
191 | @Override | ||
192 | public Type specification() { | ||
193 | return Type.instance(); | ||
194 | } | ||
195 | |||
196 | /** | ||
197 | * Returns an empty, mutable match. | ||
198 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
199 | * | ||
200 | * @return the empty match. | ||
201 | * | ||
202 | */ | ||
203 | public static Type.Match newEmptyMatch() { | ||
204 | return new Mutable(null, null); | ||
205 | } | ||
206 | |||
207 | /** | ||
208 | * Returns a mutable (partial) match. | ||
209 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
210 | * | ||
211 | * @param pThis the fixed value of pattern parameter This, or null if not bound. | ||
212 | * @param pTarget the fixed value of pattern parameter Target, or null if not bound. | ||
213 | * @return the new, mutable (partial) match object. | ||
214 | * | ||
215 | */ | ||
216 | public static Type.Match newMutableMatch(final Function pThis, final FunctionType pTarget) { | ||
217 | return new Mutable(pThis, pTarget); | ||
218 | } | ||
219 | |||
220 | /** | ||
221 | * Returns a new (partial) match. | ||
222 | * This can be used e.g. to call the matcher with a partial match. | ||
223 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
224 | * @param pThis the fixed value of pattern parameter This, or null if not bound. | ||
225 | * @param pTarget the fixed value of pattern parameter Target, or null if not bound. | ||
226 | * @return the (partial) match object. | ||
227 | * | ||
228 | */ | ||
229 | public static Type.Match newMatch(final Function pThis, final FunctionType pTarget) { | ||
230 | return new Immutable(pThis, pTarget); | ||
231 | } | ||
232 | |||
233 | private static final class Mutable extends Type.Match { | ||
234 | Mutable(final Function pThis, final FunctionType pTarget) { | ||
235 | super(pThis, pTarget); | ||
236 | } | ||
237 | |||
238 | @Override | ||
239 | public boolean isMutable() { | ||
240 | return true; | ||
241 | } | ||
242 | } | ||
243 | |||
244 | private static final class Immutable extends Type.Match { | ||
245 | Immutable(final Function pThis, final FunctionType pTarget) { | ||
246 | super(pThis, pTarget); | ||
247 | } | ||
248 | |||
249 | @Override | ||
250 | public boolean isMutable() { | ||
251 | return false; | ||
252 | } | ||
253 | } | ||
254 | } | ||
255 | |||
256 | /** | ||
257 | * Generated pattern matcher API of the ca.mcgill.ecse.dslreasoner.standalone.test.fam.queries.type pattern, | ||
258 | * providing pattern-specific query methods. | ||
259 | * | ||
260 | * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)}, | ||
261 | * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}. | ||
262 | * | ||
263 | * <p>Matches of the pattern will be represented as {@link Match}. | ||
264 | * | ||
265 | * <p>Original source: | ||
266 | * <code><pre> | ||
267 | * {@literal @}QueryBasedFeature | ||
268 | * pattern type(This : Function, Target : FunctionType) = { | ||
269 | * find rootElements(_Model, This); | ||
270 | * Target == FunctionType::Root; | ||
271 | * } or { | ||
272 | * neg find parent(_Child, This); | ||
273 | * neg find rootElements(_Model, This); | ||
274 | * Target == FunctionType::Leaf; | ||
275 | * } or { | ||
276 | * find parent(This, _Par); | ||
277 | * find parent(_Child, This); | ||
278 | * Target == FunctionType::Intermediate; | ||
279 | * } | ||
280 | * </pre></code> | ||
281 | * | ||
282 | * @see Match | ||
283 | * @see Type | ||
284 | * | ||
285 | */ | ||
286 | public static class Matcher extends BaseMatcher<Type.Match> { | ||
287 | /** | ||
288 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
289 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
290 | * | ||
291 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
292 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
293 | * | ||
294 | */ | ||
295 | public static Type.Matcher on(final ViatraQueryEngine engine) { | ||
296 | // check if matcher already exists | ||
297 | Matcher matcher = engine.getExistingMatcher(querySpecification()); | ||
298 | if (matcher == null) { | ||
299 | matcher = (Matcher)engine.getMatcher(querySpecification()); | ||
300 | } | ||
301 | return matcher; | ||
302 | } | ||
303 | |||
304 | /** | ||
305 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
306 | * @return an initialized matcher | ||
307 | * @noreference This method is for internal matcher initialization by the framework, do not call it manually. | ||
308 | * | ||
309 | */ | ||
310 | public static Type.Matcher create() { | ||
311 | return new Matcher(); | ||
312 | } | ||
313 | |||
314 | private final static int POSITION_THIS = 0; | ||
315 | |||
316 | private final static int POSITION_TARGET = 1; | ||
317 | |||
318 | private final static Logger LOGGER = ViatraQueryLoggingUtil.getLogger(Type.Matcher.class); | ||
319 | |||
320 | /** | ||
321 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
322 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
323 | * | ||
324 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
325 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
326 | * | ||
327 | */ | ||
328 | private Matcher() { | ||
329 | super(querySpecification()); | ||
330 | } | ||
331 | |||
332 | /** | ||
333 | * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters. | ||
334 | * @param pThis the fixed value of pattern parameter This, or null if not bound. | ||
335 | * @param pTarget the fixed value of pattern parameter Target, or null if not bound. | ||
336 | * @return matches represented as a Match object. | ||
337 | * | ||
338 | */ | ||
339 | public Collection<Type.Match> getAllMatches(final Function pThis, final FunctionType pTarget) { | ||
340 | return rawStreamAllMatches(new Object[]{pThis, pTarget}).collect(Collectors.toSet()); | ||
341 | } | ||
342 | |||
343 | /** | ||
344 | * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters. | ||
345 | * </p> | ||
346 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
347 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
348 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
349 | * @param pThis the fixed value of pattern parameter This, or null if not bound. | ||
350 | * @param pTarget the fixed value of pattern parameter Target, or null if not bound. | ||
351 | * @return a stream of matches represented as a Match object. | ||
352 | * | ||
353 | */ | ||
354 | public Stream<Type.Match> streamAllMatches(final Function pThis, final FunctionType pTarget) { | ||
355 | return rawStreamAllMatches(new Object[]{pThis, pTarget}); | ||
356 | } | ||
357 | |||
358 | /** | ||
359 | * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
360 | * Neither determinism nor randomness of selection is guaranteed. | ||
361 | * @param pThis the fixed value of pattern parameter This, or null if not bound. | ||
362 | * @param pTarget the fixed value of pattern parameter Target, or null if not bound. | ||
363 | * @return a match represented as a Match object, or null if no match is found. | ||
364 | * | ||
365 | */ | ||
366 | public Optional<Type.Match> getOneArbitraryMatch(final Function pThis, final FunctionType pTarget) { | ||
367 | return rawGetOneArbitraryMatch(new Object[]{pThis, pTarget}); | ||
368 | } | ||
369 | |||
370 | /** | ||
371 | * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match, | ||
372 | * under any possible substitution of the unspecified parameters (if any). | ||
373 | * @param pThis the fixed value of pattern parameter This, or null if not bound. | ||
374 | * @param pTarget the fixed value of pattern parameter Target, or null if not bound. | ||
375 | * @return true if the input is a valid (partial) match of the pattern. | ||
376 | * | ||
377 | */ | ||
378 | public boolean hasMatch(final Function pThis, final FunctionType pTarget) { | ||
379 | return rawHasMatch(new Object[]{pThis, pTarget}); | ||
380 | } | ||
381 | |||
382 | /** | ||
383 | * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. | ||
384 | * @param pThis the fixed value of pattern parameter This, or null if not bound. | ||
385 | * @param pTarget the fixed value of pattern parameter Target, or null if not bound. | ||
386 | * @return the number of pattern matches found. | ||
387 | * | ||
388 | */ | ||
389 | public int countMatches(final Function pThis, final FunctionType pTarget) { | ||
390 | return rawCountMatches(new Object[]{pThis, pTarget}); | ||
391 | } | ||
392 | |||
393 | /** | ||
394 | * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
395 | * Neither determinism nor randomness of selection is guaranteed. | ||
396 | * @param pThis the fixed value of pattern parameter This, or null if not bound. | ||
397 | * @param pTarget the fixed value of pattern parameter Target, or null if not bound. | ||
398 | * @param processor the action that will process the selected match. | ||
399 | * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked | ||
400 | * | ||
401 | */ | ||
402 | public boolean forOneArbitraryMatch(final Function pThis, final FunctionType pTarget, final Consumer<? super Type.Match> processor) { | ||
403 | return rawForOneArbitraryMatch(new Object[]{pThis, pTarget}, processor); | ||
404 | } | ||
405 | |||
406 | /** | ||
407 | * Returns a new (partial) match. | ||
408 | * This can be used e.g. to call the matcher with a partial match. | ||
409 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
410 | * @param pThis the fixed value of pattern parameter This, or null if not bound. | ||
411 | * @param pTarget the fixed value of pattern parameter Target, or null if not bound. | ||
412 | * @return the (partial) match object. | ||
413 | * | ||
414 | */ | ||
415 | public Type.Match newMatch(final Function pThis, final FunctionType pTarget) { | ||
416 | return Type.Match.newMatch(pThis, pTarget); | ||
417 | } | ||
418 | |||
419 | /** | ||
420 | * Retrieve the set of values that occur in matches for This. | ||
421 | * @return the Set of all values or empty set if there are no matches | ||
422 | * | ||
423 | */ | ||
424 | protected Stream<Function> rawStreamAllValuesOfThis(final Object[] parameters) { | ||
425 | return rawStreamAllValues(POSITION_THIS, parameters).map(Function.class::cast); | ||
426 | } | ||
427 | |||
428 | /** | ||
429 | * Retrieve the set of values that occur in matches for This. | ||
430 | * @return the Set of all values or empty set if there are no matches | ||
431 | * | ||
432 | */ | ||
433 | public Set<Function> getAllValuesOfThis() { | ||
434 | return rawStreamAllValuesOfThis(emptyArray()).collect(Collectors.toSet()); | ||
435 | } | ||
436 | |||
437 | /** | ||
438 | * Retrieve the set of values that occur in matches for This. | ||
439 | * @return the Set of all values or empty set if there are no matches | ||
440 | * | ||
441 | */ | ||
442 | public Stream<Function> streamAllValuesOfThis() { | ||
443 | return rawStreamAllValuesOfThis(emptyArray()); | ||
444 | } | ||
445 | |||
446 | /** | ||
447 | * Retrieve the set of values that occur in matches for This. | ||
448 | * </p> | ||
449 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
450 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
451 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
452 | * | ||
453 | * @return the Stream of all values or empty set if there are no matches | ||
454 | * | ||
455 | */ | ||
456 | public Stream<Function> streamAllValuesOfThis(final Type.Match partialMatch) { | ||
457 | return rawStreamAllValuesOfThis(partialMatch.toArray()); | ||
458 | } | ||
459 | |||
460 | /** | ||
461 | * Retrieve the set of values that occur in matches for This. | ||
462 | * </p> | ||
463 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
464 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
465 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
466 | * | ||
467 | * @return the Stream of all values or empty set if there are no matches | ||
468 | * | ||
469 | */ | ||
470 | public Stream<Function> streamAllValuesOfThis(final FunctionType pTarget) { | ||
471 | return rawStreamAllValuesOfThis(new Object[]{null, pTarget}); | ||
472 | } | ||
473 | |||
474 | /** | ||
475 | * Retrieve the set of values that occur in matches for This. | ||
476 | * @return the Set of all values or empty set if there are no matches | ||
477 | * | ||
478 | */ | ||
479 | public Set<Function> getAllValuesOfThis(final Type.Match partialMatch) { | ||
480 | return rawStreamAllValuesOfThis(partialMatch.toArray()).collect(Collectors.toSet()); | ||
481 | } | ||
482 | |||
483 | /** | ||
484 | * Retrieve the set of values that occur in matches for This. | ||
485 | * @return the Set of all values or empty set if there are no matches | ||
486 | * | ||
487 | */ | ||
488 | public Set<Function> getAllValuesOfThis(final FunctionType pTarget) { | ||
489 | return rawStreamAllValuesOfThis(new Object[]{null, pTarget}).collect(Collectors.toSet()); | ||
490 | } | ||
491 | |||
492 | /** | ||
493 | * Retrieve the set of values that occur in matches for Target. | ||
494 | * @return the Set of all values or empty set if there are no matches | ||
495 | * | ||
496 | */ | ||
497 | protected Stream<FunctionType> rawStreamAllValuesOfTarget(final Object[] parameters) { | ||
498 | return rawStreamAllValues(POSITION_TARGET, parameters).map(FunctionType.class::cast); | ||
499 | } | ||
500 | |||
501 | /** | ||
502 | * Retrieve the set of values that occur in matches for Target. | ||
503 | * @return the Set of all values or empty set if there are no matches | ||
504 | * | ||
505 | */ | ||
506 | public Set<FunctionType> getAllValuesOfTarget() { | ||
507 | return rawStreamAllValuesOfTarget(emptyArray()).collect(Collectors.toSet()); | ||
508 | } | ||
509 | |||
510 | /** | ||
511 | * Retrieve the set of values that occur in matches for Target. | ||
512 | * @return the Set of all values or empty set if there are no matches | ||
513 | * | ||
514 | */ | ||
515 | public Stream<FunctionType> streamAllValuesOfTarget() { | ||
516 | return rawStreamAllValuesOfTarget(emptyArray()); | ||
517 | } | ||
518 | |||
519 | /** | ||
520 | * Retrieve the set of values that occur in matches for Target. | ||
521 | * </p> | ||
522 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
523 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
524 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
525 | * | ||
526 | * @return the Stream of all values or empty set if there are no matches | ||
527 | * | ||
528 | */ | ||
529 | public Stream<FunctionType> streamAllValuesOfTarget(final Type.Match partialMatch) { | ||
530 | return rawStreamAllValuesOfTarget(partialMatch.toArray()); | ||
531 | } | ||
532 | |||
533 | /** | ||
534 | * Retrieve the set of values that occur in matches for Target. | ||
535 | * </p> | ||
536 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
537 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
538 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
539 | * | ||
540 | * @return the Stream of all values or empty set if there are no matches | ||
541 | * | ||
542 | */ | ||
543 | public Stream<FunctionType> streamAllValuesOfTarget(final Function pThis) { | ||
544 | return rawStreamAllValuesOfTarget(new Object[]{pThis, null}); | ||
545 | } | ||
546 | |||
547 | /** | ||
548 | * Retrieve the set of values that occur in matches for Target. | ||
549 | * @return the Set of all values or empty set if there are no matches | ||
550 | * | ||
551 | */ | ||
552 | public Set<FunctionType> getAllValuesOfTarget(final Type.Match partialMatch) { | ||
553 | return rawStreamAllValuesOfTarget(partialMatch.toArray()).collect(Collectors.toSet()); | ||
554 | } | ||
555 | |||
556 | /** | ||
557 | * Retrieve the set of values that occur in matches for Target. | ||
558 | * @return the Set of all values or empty set if there are no matches | ||
559 | * | ||
560 | */ | ||
561 | public Set<FunctionType> getAllValuesOfTarget(final Function pThis) { | ||
562 | return rawStreamAllValuesOfTarget(new Object[]{pThis, null}).collect(Collectors.toSet()); | ||
563 | } | ||
564 | |||
565 | @Override | ||
566 | protected Type.Match tupleToMatch(final Tuple t) { | ||
567 | try { | ||
568 | return Type.Match.newMatch((Function) t.get(POSITION_THIS), (FunctionType) t.get(POSITION_TARGET)); | ||
569 | } catch(ClassCastException e) { | ||
570 | LOGGER.error("Element(s) in tuple not properly typed!",e); | ||
571 | return null; | ||
572 | } | ||
573 | } | ||
574 | |||
575 | @Override | ||
576 | protected Type.Match arrayToMatch(final Object[] match) { | ||
577 | try { | ||
578 | return Type.Match.newMatch((Function) match[POSITION_THIS], (FunctionType) match[POSITION_TARGET]); | ||
579 | } catch(ClassCastException e) { | ||
580 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
581 | return null; | ||
582 | } | ||
583 | } | ||
584 | |||
585 | @Override | ||
586 | protected Type.Match arrayToMatchMutable(final Object[] match) { | ||
587 | try { | ||
588 | return Type.Match.newMutableMatch((Function) match[POSITION_THIS], (FunctionType) match[POSITION_TARGET]); | ||
589 | } catch(ClassCastException e) { | ||
590 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
591 | return null; | ||
592 | } | ||
593 | } | ||
594 | |||
595 | /** | ||
596 | * @return the singleton instance of the query specification of this pattern | ||
597 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
598 | * | ||
599 | */ | ||
600 | public static IQuerySpecification<Type.Matcher> querySpecification() { | ||
601 | return Type.instance(); | ||
602 | } | ||
603 | } | ||
604 | |||
605 | private Type() { | ||
606 | super(GeneratedPQuery.INSTANCE); | ||
607 | } | ||
608 | |||
609 | /** | ||
610 | * @return the singleton instance of the query specification | ||
611 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
612 | * | ||
613 | */ | ||
614 | public static Type instance() { | ||
615 | try{ | ||
616 | return LazyHolder.INSTANCE; | ||
617 | } catch (ExceptionInInitializerError err) { | ||
618 | throw processInitializerError(err); | ||
619 | } | ||
620 | } | ||
621 | |||
622 | @Override | ||
623 | protected Type.Matcher instantiate(final ViatraQueryEngine engine) { | ||
624 | return Type.Matcher.on(engine); | ||
625 | } | ||
626 | |||
627 | @Override | ||
628 | public Type.Matcher instantiate() { | ||
629 | return Type.Matcher.create(); | ||
630 | } | ||
631 | |||
632 | @Override | ||
633 | public Type.Match newEmptyMatch() { | ||
634 | return Type.Match.newEmptyMatch(); | ||
635 | } | ||
636 | |||
637 | @Override | ||
638 | public Type.Match newMatch(final Object... parameters) { | ||
639 | return Type.Match.newMatch((ca.mcgill.ecse.dslreasoner.standalone.test.fam.Function) parameters[0], (ca.mcgill.ecse.dslreasoner.standalone.test.fam.FunctionType) parameters[1]); | ||
640 | } | ||
641 | |||
642 | /** | ||
643 | * Inner class allowing the singleton instance of {@link JvmGenericType: ca.mcgill.ecse.dslreasoner.standalone.test.fam.queries.Type (visibility: PUBLIC, simpleName: Type, identifier: ca.mcgill.ecse.dslreasoner.standalone.test.fam.queries.Type, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: ca.mcgill.ecse.dslreasoner.standalone.test.fam.queries) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created | ||
644 | * <b>not</b> at the class load time of the outer class, | ||
645 | * but rather at the first call to {@link JvmGenericType: ca.mcgill.ecse.dslreasoner.standalone.test.fam.queries.Type (visibility: PUBLIC, simpleName: Type, identifier: ca.mcgill.ecse.dslreasoner.standalone.test.fam.queries.Type, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: ca.mcgill.ecse.dslreasoner.standalone.test.fam.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}. | ||
646 | * | ||
647 | * <p> This workaround is required e.g. to support recursion. | ||
648 | * | ||
649 | */ | ||
650 | private static class LazyHolder { | ||
651 | private final static Type INSTANCE = new Type(); | ||
652 | |||
653 | /** | ||
654 | * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned. | ||
655 | * This initialization order is required to support indirect recursion. | ||
656 | * | ||
657 | * <p> The static initializer is defined using a helper field to work around limitations of the code generator. | ||
658 | * | ||
659 | */ | ||
660 | private final static Object STATIC_INITIALIZER = ensureInitialized(); | ||
661 | |||
662 | public static Object ensureInitialized() { | ||
663 | INSTANCE.ensureInitializedInternal(); | ||
664 | return null; | ||
665 | } | ||
666 | } | ||
667 | |||
668 | private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { | ||
669 | private final static Type.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
670 | |||
671 | private final PParameter parameter_This = new PParameter("This", "ca.mcgill.ecse.dslreasoner.standalone.test.fam.Function", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("FamMetamodel", "Function")), PParameterDirection.INOUT); | ||
672 | |||
673 | private final PParameter parameter_Target = new PParameter("Target", "ca.mcgill.ecse.dslreasoner.standalone.test.fam.FunctionType", new EDataTypeInSlotsKey((EDataType)getClassifierLiteralSafe("FamMetamodel", "FunctionType")), PParameterDirection.INOUT); | ||
674 | |||
675 | private final List<PParameter> parameters = Arrays.asList(parameter_This, parameter_Target); | ||
676 | |||
677 | private GeneratedPQuery() { | ||
678 | super(PVisibility.PUBLIC); | ||
679 | } | ||
680 | |||
681 | @Override | ||
682 | public String getFullyQualifiedName() { | ||
683 | return "ca.mcgill.ecse.dslreasoner.standalone.test.fam.queries.type"; | ||
684 | } | ||
685 | |||
686 | @Override | ||
687 | public List<String> getParameterNames() { | ||
688 | return Arrays.asList("This","Target"); | ||
689 | } | ||
690 | |||
691 | @Override | ||
692 | public List<PParameter> getParameters() { | ||
693 | return parameters; | ||
694 | } | ||
695 | |||
696 | @Override | ||
697 | public Set<PBody> doGetContainedBodies() { | ||
698 | setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); | ||
699 | Set<PBody> bodies = new LinkedHashSet<>(); | ||
700 | { | ||
701 | PBody body = new PBody(this); | ||
702 | PVariable var_This = body.getOrCreateVariableByName("This"); | ||
703 | PVariable var_Target = body.getOrCreateVariableByName("Target"); | ||
704 | PVariable var__Model = body.getOrCreateVariableByName("_Model"); | ||
705 | new TypeConstraint(body, Tuples.flatTupleOf(var_This), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("FamMetamodel", "Function"))); | ||
706 | new TypeConstraint(body, Tuples.flatTupleOf(var_Target), new EDataTypeInSlotsKey((EDataType)getClassifierLiteral("FamMetamodel", "FunctionType"))); | ||
707 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
708 | new ExportedParameter(body, var_This, parameter_This), | ||
709 | new ExportedParameter(body, var_Target, parameter_Target) | ||
710 | )); | ||
711 | // find rootElements(_Model, This) | ||
712 | new PositivePatternCall(body, Tuples.flatTupleOf(var__Model, var_This), RootElements.instance().getInternalQueryRepresentation()); | ||
713 | // Target == FunctionType::Root | ||
714 | PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); | ||
715 | new ConstantValue(body, var__virtual_0_, getEnumLiteral("FamMetamodel", "FunctionType", "Root").getInstance()); | ||
716 | new Equality(body, var_Target, var__virtual_0_); | ||
717 | bodies.add(body); | ||
718 | } | ||
719 | { | ||
720 | PBody body = new PBody(this); | ||
721 | PVariable var_This = body.getOrCreateVariableByName("This"); | ||
722 | PVariable var_Target = body.getOrCreateVariableByName("Target"); | ||
723 | PVariable var__Child = body.getOrCreateVariableByName("_Child"); | ||
724 | PVariable var__Model = body.getOrCreateVariableByName("_Model"); | ||
725 | new TypeConstraint(body, Tuples.flatTupleOf(var_This), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("FamMetamodel", "Function"))); | ||
726 | new TypeConstraint(body, Tuples.flatTupleOf(var_Target), new EDataTypeInSlotsKey((EDataType)getClassifierLiteral("FamMetamodel", "FunctionType"))); | ||
727 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
728 | new ExportedParameter(body, var_This, parameter_This), | ||
729 | new ExportedParameter(body, var_Target, parameter_Target) | ||
730 | )); | ||
731 | // neg find parent(_Child, This) | ||
732 | new NegativePatternCall(body, Tuples.flatTupleOf(var__Child, var_This), Parent.instance().getInternalQueryRepresentation()); | ||
733 | // neg find rootElements(_Model, This) | ||
734 | new NegativePatternCall(body, Tuples.flatTupleOf(var__Model, var_This), RootElements.instance().getInternalQueryRepresentation()); | ||
735 | // Target == FunctionType::Leaf | ||
736 | PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); | ||
737 | new ConstantValue(body, var__virtual_0_, getEnumLiteral("FamMetamodel", "FunctionType", "Leaf").getInstance()); | ||
738 | new Equality(body, var_Target, var__virtual_0_); | ||
739 | bodies.add(body); | ||
740 | } | ||
741 | { | ||
742 | PBody body = new PBody(this); | ||
743 | PVariable var_This = body.getOrCreateVariableByName("This"); | ||
744 | PVariable var_Target = body.getOrCreateVariableByName("Target"); | ||
745 | PVariable var__Par = body.getOrCreateVariableByName("_Par"); | ||
746 | PVariable var__Child = body.getOrCreateVariableByName("_Child"); | ||
747 | new TypeConstraint(body, Tuples.flatTupleOf(var_This), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("FamMetamodel", "Function"))); | ||
748 | new TypeConstraint(body, Tuples.flatTupleOf(var_Target), new EDataTypeInSlotsKey((EDataType)getClassifierLiteral("FamMetamodel", "FunctionType"))); | ||
749 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
750 | new ExportedParameter(body, var_This, parameter_This), | ||
751 | new ExportedParameter(body, var_Target, parameter_Target) | ||
752 | )); | ||
753 | // find parent(This, _Par) | ||
754 | new PositivePatternCall(body, Tuples.flatTupleOf(var_This, var__Par), Parent.instance().getInternalQueryRepresentation()); | ||
755 | // find parent(_Child, This) | ||
756 | new PositivePatternCall(body, Tuples.flatTupleOf(var__Child, var_This), Parent.instance().getInternalQueryRepresentation()); | ||
757 | // Target == FunctionType::Intermediate | ||
758 | PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); | ||
759 | new ConstantValue(body, var__virtual_0_, getEnumLiteral("FamMetamodel", "FunctionType", "Intermediate").getInstance()); | ||
760 | new Equality(body, var_Target, var__virtual_0_); | ||
761 | bodies.add(body); | ||
762 | } | ||
763 | { | ||
764 | PAnnotation annotation = new PAnnotation("QueryBasedFeature"); | ||
765 | addAnnotation(annotation); | ||
766 | } | ||
767 | return bodies; | ||
768 | } | ||
769 | } | ||
770 | } | ||
diff --git a/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src/ca/mcgill/ecse/dslreasoner/standalone/test/yakindu/Entry.java b/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src/ca/mcgill/ecse/dslreasoner/standalone/test/yakindu/Entry.java new file mode 100644 index 00000000..253dd2d1 --- /dev/null +++ b/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src/ca/mcgill/ecse/dslreasoner/standalone/test/yakindu/Entry.java | |||
@@ -0,0 +1,17 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package ca.mcgill.ecse.dslreasoner.standalone.test.yakindu; | ||
4 | |||
5 | |||
6 | /** | ||
7 | * <!-- begin-user-doc --> | ||
8 | * A representation of the model object '<em><b>Entry</b></em>'. | ||
9 | * <!-- end-user-doc --> | ||
10 | * | ||
11 | * | ||
12 | * @see ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.YakinduPackage#getEntry() | ||
13 | * @model | ||
14 | * @generated | ||
15 | */ | ||
16 | public interface Entry extends Pseudostate { | ||
17 | } // Entry | ||
diff --git a/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src/ca/mcgill/ecse/dslreasoner/standalone/test/yakindu/Synchronization.java b/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src/ca/mcgill/ecse/dslreasoner/standalone/test/yakindu/Synchronization.java new file mode 100644 index 00000000..6c6c80e7 --- /dev/null +++ b/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src/ca/mcgill/ecse/dslreasoner/standalone/test/yakindu/Synchronization.java | |||
@@ -0,0 +1,17 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package ca.mcgill.ecse.dslreasoner.standalone.test.yakindu; | ||
4 | |||
5 | |||
6 | /** | ||
7 | * <!-- begin-user-doc --> | ||
8 | * A representation of the model object '<em><b>Synchronization</b></em>'. | ||
9 | * <!-- end-user-doc --> | ||
10 | * | ||
11 | * | ||
12 | * @see ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.YakinduPackage#getSynchronization() | ||
13 | * @model | ||
14 | * @generated | ||
15 | */ | ||
16 | public interface Synchronization extends Pseudostate { | ||
17 | } // Synchronization | ||
diff --git a/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src/ca/mcgill/ecse/dslreasoner/standalone/test/yakindu/impl/EntryImpl.java b/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src/ca/mcgill/ecse/dslreasoner/standalone/test/yakindu/impl/EntryImpl.java new file mode 100644 index 00000000..eeba7c63 --- /dev/null +++ b/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src/ca/mcgill/ecse/dslreasoner/standalone/test/yakindu/impl/EntryImpl.java | |||
@@ -0,0 +1,37 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.impl; | ||
4 | |||
5 | import ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.Entry; | ||
6 | import ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.YakinduPackage; | ||
7 | |||
8 | import org.eclipse.emf.ecore.EClass; | ||
9 | |||
10 | /** | ||
11 | * <!-- begin-user-doc --> | ||
12 | * An implementation of the model object '<em><b>Entry</b></em>'. | ||
13 | * <!-- end-user-doc --> | ||
14 | * | ||
15 | * @generated | ||
16 | */ | ||
17 | public class EntryImpl extends PseudostateImpl implements Entry { | ||
18 | /** | ||
19 | * <!-- begin-user-doc --> | ||
20 | * <!-- end-user-doc --> | ||
21 | * @generated | ||
22 | */ | ||
23 | protected EntryImpl() { | ||
24 | super(); | ||
25 | } | ||
26 | |||
27 | /** | ||
28 | * <!-- begin-user-doc --> | ||
29 | * <!-- end-user-doc --> | ||
30 | * @generated | ||
31 | */ | ||
32 | @Override | ||
33 | protected EClass eStaticClass() { | ||
34 | return YakinduPackage.Literals.ENTRY; | ||
35 | } | ||
36 | |||
37 | } //EntryImpl | ||
diff --git a/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src/ca/mcgill/ecse/dslreasoner/standalone/test/yakindu/impl/SynchronizationImpl.java b/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src/ca/mcgill/ecse/dslreasoner/standalone/test/yakindu/impl/SynchronizationImpl.java new file mode 100644 index 00000000..eaf5ef23 --- /dev/null +++ b/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src/ca/mcgill/ecse/dslreasoner/standalone/test/yakindu/impl/SynchronizationImpl.java | |||
@@ -0,0 +1,37 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.impl; | ||
4 | |||
5 | import ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.Synchronization; | ||
6 | import ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.YakinduPackage; | ||
7 | |||
8 | import org.eclipse.emf.ecore.EClass; | ||
9 | |||
10 | /** | ||
11 | * <!-- begin-user-doc --> | ||
12 | * An implementation of the model object '<em><b>Synchronization</b></em>'. | ||
13 | * <!-- end-user-doc --> | ||
14 | * | ||
15 | * @generated | ||
16 | */ | ||
17 | public class SynchronizationImpl extends PseudostateImpl implements Synchronization { | ||
18 | /** | ||
19 | * <!-- begin-user-doc --> | ||
20 | * <!-- end-user-doc --> | ||
21 | * @generated | ||
22 | */ | ||
23 | protected SynchronizationImpl() { | ||
24 | super(); | ||
25 | } | ||
26 | |||
27 | /** | ||
28 | * <!-- begin-user-doc --> | ||
29 | * <!-- end-user-doc --> | ||
30 | * @generated | ||
31 | */ | ||
32 | @Override | ||
33 | protected EClass eStaticClass() { | ||
34 | return YakinduPackage.Literals.SYNCHRONIZATION; | ||
35 | } | ||
36 | |||
37 | } //SynchronizationImpl | ||