aboutsummaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorLibravatar ArenBabikian <aren.babikian@mail.mcgill.ca>2020-05-11 12:51:37 -0400
committerLibravatar ArenBabikian <aren.babikian@mail.mcgill.ca>2020-05-11 12:51:37 -0400
commit58a9431a90d2ca147f56c45dcfd4654145550a01 (patch)
tree2a718ae79c198dd07268190e0b6d750ec7c7a6a2 /Tests
parentFine Tune PLEDGE Case Study Project and Main Method (diff)
downloadVIATRA-Generator-58a9431a90d2ca147f56c45dcfd4654145550a01.tar.gz
VIATRA-Generator-58a9431a90d2ca147f56c45dcfd4654145550a01.tar.zst
VIATRA-Generator-58a9431a90d2ca147f56c45dcfd4654145550a01.zip
Add Satellite Case Study to testing framework
Diffstat (limited to 'Tests')
-rw-r--r--Tests/MODELS2020-CaseStudies/case.study.pledge.originalFiles/.gitignore1
-rw-r--r--Tests/MODELS2020-CaseStudies/case.study.pledge.originalFiles/xtend-gen/converter/.UML2TGF.xtendbinbin6885 -> 6885 bytes
-rw-r--r--Tests/MODELS2020-CaseStudies/case.study.pledge.run/.classpath2
-rw-r--r--Tests/MODELS2020-CaseStudies/case.study.pledge.run/.gitignore3
-rw-r--r--Tests/MODELS2020-CaseStudies/case.study.pledge.run/bin/.gitignore2
-rw-r--r--Tests/MODELS2020-CaseStudies/case.study.pledge.run/bin/queries/.gitignore120
-rw-r--r--Tests/MODELS2020-CaseStudies/case.study.pledge.run/bin/queries/case_study_A.vql2
-rw-r--r--Tests/MODELS2020-CaseStudies/case.study.pledge.run/config/genericSatellite.vsconfig25
-rw-r--r--Tests/MODELS2020-CaseStudies/case.study.pledge.run/inputs/SatelliteInstance.xmi7
-rw-r--r--Tests/MODELS2020-CaseStudies/case.study.pledge.run/plugin.xml44
-rw-r--r--Tests/MODELS2020-CaseStudies/case.study.pledge.run/src-gen/queries/.gitignore120
-rw-r--r--Tests/MODELS2020-CaseStudies/case.study.pledge.run/src-gen/queries/Case_study_short.java64
-rw-r--r--Tests/MODELS2020-CaseStudies/case.study.pledge.run/src-gen/queries/X_inv48.java555
-rw-r--r--Tests/MODELS2020-CaseStudies/case.study.pledge.run/src/queries/SatelliteQueries.vql390
-rw-r--r--Tests/MODELS2020-CaseStudies/case.study.pledge.run/src/queries/case_study_A.vql2
-rw-r--r--Tests/MODELS2020-CaseStudies/case.study.pledge.run/src/run/GenerateFromConfig.xtend4
-rw-r--r--Tests/MODELS2020-CaseStudies/case.study.pledge.run/xtend-gen/run/.GenerateFromConfig.xtendbinbin10678 -> 10676 bytes
-rw-r--r--Tests/MODELS2020-CaseStudies/case.study.pledge.run/xtend-gen/run/.GeneratePledgeModels.xtendbinbin16725 -> 16725 bytes
-rw-r--r--Tests/MODELS2020-CaseStudies/case.study.pledge.run/xtend-gen/run/.gitignore10
-rw-r--r--Tests/MODELS2020-CaseStudies/case.study.pledge.run/xtend-gen/run/GenerateFromConfig.java4
20 files changed, 433 insertions, 922 deletions
diff --git a/Tests/MODELS2020-CaseStudies/case.study.pledge.originalFiles/.gitignore b/Tests/MODELS2020-CaseStudies/case.study.pledge.originalFiles/.gitignore
index ae3c1726..3197db31 100644
--- a/Tests/MODELS2020-CaseStudies/case.study.pledge.originalFiles/.gitignore
+++ b/Tests/MODELS2020-CaseStudies/case.study.pledge.originalFiles/.gitignore
@@ -1 +1,2 @@
1/bin/ 1/bin/
2/xtend-gen/ \ No newline at end of file
diff --git a/Tests/MODELS2020-CaseStudies/case.study.pledge.originalFiles/xtend-gen/converter/.UML2TGF.xtendbin b/Tests/MODELS2020-CaseStudies/case.study.pledge.originalFiles/xtend-gen/converter/.UML2TGF.xtendbin
index 4a962cb6..134582c5 100644
--- a/Tests/MODELS2020-CaseStudies/case.study.pledge.originalFiles/xtend-gen/converter/.UML2TGF.xtendbin
+++ b/Tests/MODELS2020-CaseStudies/case.study.pledge.originalFiles/xtend-gen/converter/.UML2TGF.xtendbin
Binary files differ
diff --git a/Tests/MODELS2020-CaseStudies/case.study.pledge.run/.classpath b/Tests/MODELS2020-CaseStudies/case.study.pledge.run/.classpath
index 29ba3981..3f0838b6 100644
--- a/Tests/MODELS2020-CaseStudies/case.study.pledge.run/.classpath
+++ b/Tests/MODELS2020-CaseStudies/case.study.pledge.run/.classpath
@@ -3,7 +3,7 @@
3 <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> 3 <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
4 <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> 4 <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
5 <classpathentry kind="src" path="src"/> 5 <classpathentry kind="src" path="src"/>
6 <classpathentry kind="src" path="xtend-gen"/>
7 <classpathentry kind="src" path="src-gen"/> 6 <classpathentry kind="src" path="src-gen"/>
7 <classpathentry kind="src" path="xtend-gen"/>
8 <classpathentry kind="output" path="bin"/> 8 <classpathentry kind="output" path="bin"/>
9</classpath> 9</classpath>
diff --git a/Tests/MODELS2020-CaseStudies/case.study.pledge.run/.gitignore b/Tests/MODELS2020-CaseStudies/case.study.pledge.run/.gitignore
index 16be8f21..9e0e784a 100644
--- a/Tests/MODELS2020-CaseStudies/case.study.pledge.run/.gitignore
+++ b/Tests/MODELS2020-CaseStudies/case.study.pledge.run/.gitignore
@@ -1 +1,4 @@
1/output/ 1/output/
2/src-gen/
3/xtend-gen/
4/bin/ \ No newline at end of file
diff --git a/Tests/MODELS2020-CaseStudies/case.study.pledge.run/bin/.gitignore b/Tests/MODELS2020-CaseStudies/case.study.pledge.run/bin/.gitignore
deleted file mode 100644
index 3d70f0da..00000000
--- a/Tests/MODELS2020-CaseStudies/case.study.pledge.run/bin/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
1/queries/
2/run/
diff --git a/Tests/MODELS2020-CaseStudies/case.study.pledge.run/bin/queries/.gitignore b/Tests/MODELS2020-CaseStudies/case.study.pledge.run/bin/queries/.gitignore
deleted file mode 100644
index f679c1a8..00000000
--- a/Tests/MODELS2020-CaseStudies/case.study.pledge.run/bin/queries/.gitignore
+++ /dev/null
@@ -1,120 +0,0 @@
1/.Inv17.java._trace
2/.Inv20.java._trace
3/.Inv33_con.java._trace
4/.Inv34.java._trace
5/.Inv35.java._trace
6/.Inv47.java._trace
7/.Inv48.java._trace
8/.Inv48_helper.java._trace
9/.Case_study_A.java._trace
10/.Inv49.java._trace
11/.Inv49_con.java._trace
12/.Inv49_helper.java._trace
13/.H_inv49.java._trace
14/.Ocl_inv49.java._trace
15/.Vql_inv49.java._trace
16/.Vql_inv492.java._trace
17/.H1_inv48.java._trace
18/.H2_inv48.java._trace
19/.Vql_inv48.java._trace
20/.H3_inv48.java._trace
21/.H1_inv49.java._trace
22/.H2_inv49.java._trace
23/.H_inv47.java._trace
24/.Inv35test.java._trace
25/.Inv33.java._trace
26/.X.java._trace
27/.H_inv16_moreThan1.java._trace
28/.H_inv48_1.java._trace
29/.H_inv48_2.java._trace
30/.H_inv48_3.java._trace
31/.H_inv49_1.java._trace
32/.H_inv49_2.java._trace
33/.Inv16.java._trace
34/.Inv15.java._trace
35/.H_inv13.java._trace
36/.Inv13.java._trace
37/.Inv12.java._trace
38/.H_inv12_notNonRes.java._trace
39/.H_inv12_notZZ.java._trace
40/.H_inv11_incOver100.java._trace
41/.Inv11.java._trace
42/.H_inv11_incNotOver100.java._trace
43/.H_inv8_notEI.java._trace
44/.Inv8.java._trace
45/.H_inv08_notEI.java._trace
46/.Inv08.java._trace
47/.H_inv08_inRange.java._trace
48/.X_inv08_inRange.java._trace
49/.X_inv08_notEI.java._trace
50/.X_inv11_incNotOver100.java._trace
51/.X_inv11_incOver100.java._trace
52/.X_inv12_notNonRes.java._trace
53/.X_inv12_notZZ.java._trace
54/.X_inv13.java._trace
55/.X_inv47.java._trace
56/.X_inv48_1.java._trace
57/.X_inv48_2.java._trace
58/.X_inv48_3.java._trace
59/.X_inv49_1.java._trace
60/.X_inv49_2.java._trace
61/.X_inv48_Dis.java._trace
62/.X_inv48_notDis.java._trace
63/.X_inv08_noType.java._trace
64/.X_inv08_invalidType.java._trace
65/.Inv06.java._trace
66/.X_inv06_inRange.java._trace
67/.Inv05.java._trace
68/.X_inv05_inRange.java._trace
69/.Inv03.java._trace
70/.X_inv03_noAll.java._trace
71/.X_inv03_eligAll.java._trace
72/.X_inv03_hasAll.java._trace
73/.Inv07.java._trace
74/.Inv10.java._trace
75/.X_inv15.java._trace
76/Inv03.java
77/Inv05.java
78/Inv06.java
79/X_inv03_eligAll.java
80/X_inv03_hasAll.java
81/X_inv05_inRange.java
82/Case_study_A.java
83/Inv07.java
84/Inv08.java
85/Inv10.java
86/Inv11.java
87/Inv12.java
88/Inv13.java
89/Inv15.java
90/Inv17.java
91/Inv20.java
92/Inv33.java
93/Inv34.java
94/Inv35.java
95/Inv47.java
96/Inv48.java
97/Inv49.java
98/X_inv08_inRange.java
99/X_inv08_noType.java
100/X_inv08_notEI.java
101/X_inv11_incNotOver100.java
102/X_inv11_incOver100.java
103/X_inv12_notNonRes.java
104/X_inv12_notZZ.java
105/X_inv13.java
106/X_inv15.java
107/X_inv47.java
108/X_inv48_3.java
109/X_inv48_Dis.java
110/X_inv48_notDis.java
111/X_inv49_1.java
112/X_inv49_2.java
113/.FamilyTreeConstraints.java._trace
114/.MemberHasParent.java._trace
115/.MemberIsItsOwnParent.java._trace
116/.NegativeAge.java._trace
117/.ParentTooYoung.java._trace
118/.TwoMembersHaveNoParent.java._trace
119/.Case_study_short.java._trace
120/.X_inv48.java._trace
diff --git a/Tests/MODELS2020-CaseStudies/case.study.pledge.run/bin/queries/case_study_A.vql b/Tests/MODELS2020-CaseStudies/case.study.pledge.run/bin/queries/case_study_A.vql
index 01cdf372..d879fd7c 100644
--- a/Tests/MODELS2020-CaseStudies/case.study.pledge.run/bin/queries/case_study_A.vql
+++ b/Tests/MODELS2020-CaseStudies/case.study.pledge.run/bin/queries/case_study_A.vql
@@ -1,5 +1,5 @@
1package queries 1package queries
2 2
3import "http:///TaxCard.ecore" 3import "http:///TaxCard.ecore"
4 4
5//AttributeRemoved -> DF 5//AttributeRemoved -> DF
diff --git a/Tests/MODELS2020-CaseStudies/case.study.pledge.run/config/genericSatellite.vsconfig b/Tests/MODELS2020-CaseStudies/case.study.pledge.run/config/genericSatellite.vsconfig
new file mode 100644
index 00000000..b683073a
--- /dev/null
+++ b/Tests/MODELS2020-CaseStudies/case.study.pledge.run/config/genericSatellite.vsconfig
@@ -0,0 +1,25 @@
1import epackage "../../../Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/model/satellite.ecore"
2//import viatra "../../../Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.vql"
3import viatra "src/queries/SatelliteQueries.vql"
4
5generate {
6 metamodel = { package satellite }
7 constraints = { package hu.bme.mit.inf.dslreasoner.domains.satellite.queries }
8 partial-model = { "inputs/SatelliteInstance.xmi"}
9 solver = ViatraSolver
10 scope = {
11 #node += 64..128
12 }
13
14 config = {
15 runtime = 10000,
16 log-level = normal
17 }
18
19 runs = 1
20
21 debug = "outputs/debug"
22 log = "outputs/log.txt"
23 output = "outputs/models"
24 statistics = "outputs/statistics.csv"
25}
diff --git a/Tests/MODELS2020-CaseStudies/case.study.pledge.run/inputs/SatelliteInstance.xmi b/Tests/MODELS2020-CaseStudies/case.study.pledge.run/inputs/SatelliteInstance.xmi
new file mode 100644
index 00000000..3d07a199
--- /dev/null
+++ b/Tests/MODELS2020-CaseStudies/case.study.pledge.run/inputs/SatelliteInstance.xmi
@@ -0,0 +1,7 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<satellite:InterferometryMission
3 xmi:version="2.0"
4 xmlns:xmi="http://www.omg.org/XMI"
5 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
6 xmlns:satellite="http://www.example.org/satellite"
7 xsi:schemaLocation="http://www.example.org/satellite ../model/satellite.ecore"/>
diff --git a/Tests/MODELS2020-CaseStudies/case.study.pledge.run/plugin.xml b/Tests/MODELS2020-CaseStudies/case.study.pledge.run/plugin.xml
index a6ebe14f..80125d37 100644
--- a/Tests/MODELS2020-CaseStudies/case.study.pledge.run/plugin.xml
+++ b/Tests/MODELS2020-CaseStudies/case.study.pledge.run/plugin.xml
@@ -1,48 +1,4 @@
1<?xml version="1.0" encoding="UTF-8"?><plugin> 1<?xml version="1.0" encoding="UTF-8"?><plugin>
2 <extension id="queries.Case_study_A" point="org.eclipse.viatra.query.runtime.queryspecification">
3 <group group="org.eclipse.viatra.query.runtime.extensibility.SingletonExtensionFactory:queries.Case_study_A" id="queries.Case_study_A">
4 <query-specification fqn="queries.inv03"/>
5 <query-specification fqn="queries.x_inv03_eligAll"/>
6 <query-specification fqn="queries.x_inv03_hasAll"/>
7 <query-specification fqn="queries.inv05"/>
8 <query-specification fqn="queries.x_inv05_inRange"/>
9 <query-specification fqn="queries.inv06"/>
10 <query-specification fqn="queries.inv07"/>
11 <query-specification fqn="queries.inv08"/>
12 <query-specification fqn="queries.x_inv08_notEI"/>
13 <query-specification fqn="queries.x_inv08_noType"/>
14 <query-specification fqn="queries.x_inv08_inRange"/>
15 <query-specification fqn="queries.inv10"/>
16 <query-specification fqn="queries.inv11"/>
17 <query-specification fqn="queries.x_inv11_incOver100"/>
18 <query-specification fqn="queries.x_inv11_incNotOver100"/>
19 <query-specification fqn="queries.inv12"/>
20 <query-specification fqn="queries.x_inv12_notNonRes"/>
21 <query-specification fqn="queries.x_inv12_notZZ"/>
22 <query-specification fqn="queries.inv13"/>
23 <query-specification fqn="queries.x_inv13"/>
24 <query-specification fqn="queries.inv15"/>
25 <query-specification fqn="queries.x_inv15"/>
26 <query-specification fqn="queries.inv17"/>
27 <query-specification fqn="queries.inv20"/>
28 <query-specification fqn="queries.inv33"/>
29 <query-specification fqn="queries.inv34"/>
30 <query-specification fqn="queries.inv35"/>
31 <query-specification fqn="queries.inv47"/>
32 <query-specification fqn="queries.x_inv47"/>
33 <query-specification fqn="queries.inv48"/>
34 <query-specification fqn="queries.x_inv48"/>
35 <query-specification fqn="queries.inv49"/>
36 <query-specification fqn="queries.x_inv49_1"/>
37 <query-specification fqn="queries.x_inv49_2"/>
38 </group>
39 </extension>
40 <extension id="queries.Case_study_short" point="org.eclipse.viatra.query.runtime.queryspecification">
41 <group group="org.eclipse.viatra.query.runtime.extensibility.SingletonExtensionFactory:queries.Case_study_short" id="queries.Case_study_short">
42 <query-specification fqn="queries.inv48"/>
43 <query-specification fqn="queries.x_inv48"/>
44 </group>
45 </extension>
46 <extension id="queries.FamilyTreeConstraints" point="org.eclipse.viatra.query.runtime.queryspecification"> 2 <extension id="queries.FamilyTreeConstraints" point="org.eclipse.viatra.query.runtime.queryspecification">
47 <group group="org.eclipse.viatra.query.runtime.extensibility.SingletonExtensionFactory:queries.FamilyTreeConstraints" id="queries.FamilyTreeConstraints"> 3 <group group="org.eclipse.viatra.query.runtime.extensibility.SingletonExtensionFactory:queries.FamilyTreeConstraints" id="queries.FamilyTreeConstraints">
48 <query-specification fqn="queries.memberIsItsOwnParent"/> 4 <query-specification fqn="queries.memberIsItsOwnParent"/>
diff --git a/Tests/MODELS2020-CaseStudies/case.study.pledge.run/src-gen/queries/.gitignore b/Tests/MODELS2020-CaseStudies/case.study.pledge.run/src-gen/queries/.gitignore
deleted file mode 100644
index f679c1a8..00000000
--- a/Tests/MODELS2020-CaseStudies/case.study.pledge.run/src-gen/queries/.gitignore
+++ /dev/null
@@ -1,120 +0,0 @@
1/.Inv17.java._trace
2/.Inv20.java._trace
3/.Inv33_con.java._trace
4/.Inv34.java._trace
5/.Inv35.java._trace
6/.Inv47.java._trace
7/.Inv48.java._trace
8/.Inv48_helper.java._trace
9/.Case_study_A.java._trace
10/.Inv49.java._trace
11/.Inv49_con.java._trace
12/.Inv49_helper.java._trace
13/.H_inv49.java._trace
14/.Ocl_inv49.java._trace
15/.Vql_inv49.java._trace
16/.Vql_inv492.java._trace
17/.H1_inv48.java._trace
18/.H2_inv48.java._trace
19/.Vql_inv48.java._trace
20/.H3_inv48.java._trace
21/.H1_inv49.java._trace
22/.H2_inv49.java._trace
23/.H_inv47.java._trace
24/.Inv35test.java._trace
25/.Inv33.java._trace
26/.X.java._trace
27/.H_inv16_moreThan1.java._trace
28/.H_inv48_1.java._trace
29/.H_inv48_2.java._trace
30/.H_inv48_3.java._trace
31/.H_inv49_1.java._trace
32/.H_inv49_2.java._trace
33/.Inv16.java._trace
34/.Inv15.java._trace
35/.H_inv13.java._trace
36/.Inv13.java._trace
37/.Inv12.java._trace
38/.H_inv12_notNonRes.java._trace
39/.H_inv12_notZZ.java._trace
40/.H_inv11_incOver100.java._trace
41/.Inv11.java._trace
42/.H_inv11_incNotOver100.java._trace
43/.H_inv8_notEI.java._trace
44/.Inv8.java._trace
45/.H_inv08_notEI.java._trace
46/.Inv08.java._trace
47/.H_inv08_inRange.java._trace
48/.X_inv08_inRange.java._trace
49/.X_inv08_notEI.java._trace
50/.X_inv11_incNotOver100.java._trace
51/.X_inv11_incOver100.java._trace
52/.X_inv12_notNonRes.java._trace
53/.X_inv12_notZZ.java._trace
54/.X_inv13.java._trace
55/.X_inv47.java._trace
56/.X_inv48_1.java._trace
57/.X_inv48_2.java._trace
58/.X_inv48_3.java._trace
59/.X_inv49_1.java._trace
60/.X_inv49_2.java._trace
61/.X_inv48_Dis.java._trace
62/.X_inv48_notDis.java._trace
63/.X_inv08_noType.java._trace
64/.X_inv08_invalidType.java._trace
65/.Inv06.java._trace
66/.X_inv06_inRange.java._trace
67/.Inv05.java._trace
68/.X_inv05_inRange.java._trace
69/.Inv03.java._trace
70/.X_inv03_noAll.java._trace
71/.X_inv03_eligAll.java._trace
72/.X_inv03_hasAll.java._trace
73/.Inv07.java._trace
74/.Inv10.java._trace
75/.X_inv15.java._trace
76/Inv03.java
77/Inv05.java
78/Inv06.java
79/X_inv03_eligAll.java
80/X_inv03_hasAll.java
81/X_inv05_inRange.java
82/Case_study_A.java
83/Inv07.java
84/Inv08.java
85/Inv10.java
86/Inv11.java
87/Inv12.java
88/Inv13.java
89/Inv15.java
90/Inv17.java
91/Inv20.java
92/Inv33.java
93/Inv34.java
94/Inv35.java
95/Inv47.java
96/Inv48.java
97/Inv49.java
98/X_inv08_inRange.java
99/X_inv08_noType.java
100/X_inv08_notEI.java
101/X_inv11_incNotOver100.java
102/X_inv11_incOver100.java
103/X_inv12_notNonRes.java
104/X_inv12_notZZ.java
105/X_inv13.java
106/X_inv15.java
107/X_inv47.java
108/X_inv48_3.java
109/X_inv48_Dis.java
110/X_inv48_notDis.java
111/X_inv49_1.java
112/X_inv49_2.java
113/.FamilyTreeConstraints.java._trace
114/.MemberHasParent.java._trace
115/.MemberIsItsOwnParent.java._trace
116/.NegativeAge.java._trace
117/.ParentTooYoung.java._trace
118/.TwoMembersHaveNoParent.java._trace
119/.Case_study_short.java._trace
120/.X_inv48.java._trace
diff --git a/Tests/MODELS2020-CaseStudies/case.study.pledge.run/src-gen/queries/Case_study_short.java b/Tests/MODELS2020-CaseStudies/case.study.pledge.run/src-gen/queries/Case_study_short.java
deleted file mode 100644
index 5c72b809..00000000
--- a/Tests/MODELS2020-CaseStudies/case.study.pledge.run/src-gen/queries/Case_study_short.java
+++ /dev/null
@@ -1,64 +0,0 @@
1/**
2 * Generated from platform:/resource/case.study.pledge.run/src/queries/case_study_short.vql
3 */
4package queries;
5
6import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
7import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedPatternGroup;
8import queries.Inv48;
9import queries.X_inv48;
10
11/**
12 * A pattern group formed of all public patterns defined in case_study_short.vql.
13 *
14 * <p>Use the static instance as any {@link interface org.eclipse.viatra.query.runtime.api.IQueryGroup}, to conveniently prepare
15 * a VIATRA Query engine for matching all patterns originally defined in file case_study_short.vql,
16 * in order to achieve better performance than one-by-one on-demand matcher initialization.
17 *
18 * <p> From package queries, the group contains the definition of the following patterns: <ul>
19 * <li>inv48</li>
20 * <li>x_inv48</li>
21 * </ul>
22 *
23 * @see IQueryGroup
24 *
25 */
26@SuppressWarnings("all")
27public final class Case_study_short extends BaseGeneratedPatternGroup {
28 /**
29 * Access the pattern group.
30 *
31 * @return the singleton instance of the group
32 * @throws ViatraQueryRuntimeException if there was an error loading the generated code of pattern specifications
33 *
34 */
35 public static Case_study_short instance() {
36 if (INSTANCE == null) {
37 INSTANCE = new Case_study_short();
38 }
39 return INSTANCE;
40 }
41
42 private static Case_study_short INSTANCE;
43
44 private Case_study_short() {
45 querySpecifications.add(Inv48.instance());
46 querySpecifications.add(X_inv48.instance());
47 }
48
49 public Inv48 getInv48() {
50 return Inv48.instance();
51 }
52
53 public Inv48.Matcher getInv48(final ViatraQueryEngine engine) {
54 return Inv48.Matcher.on(engine);
55 }
56
57 public X_inv48 getX_inv48() {
58 return X_inv48.instance();
59 }
60
61 public X_inv48.Matcher getX_inv48(final ViatraQueryEngine engine) {
62 return X_inv48.Matcher.on(engine);
63 }
64}
diff --git a/Tests/MODELS2020-CaseStudies/case.study.pledge.run/src-gen/queries/X_inv48.java b/Tests/MODELS2020-CaseStudies/case.study.pledge.run/src-gen/queries/X_inv48.java
deleted file mode 100644
index 436818c4..00000000
--- a/Tests/MODELS2020-CaseStudies/case.study.pledge.run/src-gen/queries/X_inv48.java
+++ /dev/null
@@ -1,555 +0,0 @@
1/**
2 * Generated from platform:/resource/case.study.pledge.run/src/queries/case_study_short.vql
3 */
4package queries;
5
6import Taxation.Physical_Person;
7import java.util.Arrays;
8import java.util.Collection;
9import java.util.LinkedHashSet;
10import java.util.List;
11import java.util.Objects;
12import java.util.Optional;
13import java.util.Set;
14import java.util.function.Consumer;
15import java.util.stream.Collectors;
16import java.util.stream.Stream;
17import org.apache.log4j.Logger;
18import org.eclipse.emf.ecore.EClass;
19import org.eclipse.emf.ecore.EDataType;
20import org.eclipse.viatra.query.runtime.api.IPatternMatch;
21import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
22import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
23import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
24import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification;
25import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher;
26import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch;
27import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
28import org.eclipse.viatra.query.runtime.emf.types.EDataTypeInSlotsKey;
29import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey;
30import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
31import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
32import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
33import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
34import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
35import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.ConstantValue;
36import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
37import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
38import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
39import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
40import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple;
41import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
42import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil;
43
44/**
45 * A pattern-specific query specification that can instantiate Matcher in a type-safe way.
46 *
47 * <p>Original source:
48 * <code><pre>
49 * pattern x_inv48(p : Physical_Person) {
50 * Physical_Person.disability_type(p, ::NONE);
51 * }
52 * </pre></code>
53 *
54 * @see Matcher
55 * @see Match
56 *
57 */
58@SuppressWarnings("all")
59public final class X_inv48 extends BaseGeneratedEMFQuerySpecification<X_inv48.Matcher> {
60 /**
61 * Pattern-specific match representation of the queries.x_inv48 pattern,
62 * to be used in conjunction with {@link Matcher}.
63 *
64 * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned.
65 * Each instance is a (possibly partial) substitution of pattern parameters,
66 * usable to represent a match of the pattern in the result of a query,
67 * or to specify the bound (fixed) input parameters when issuing a query.
68 *
69 * @see Matcher
70 *
71 */
72 public static abstract class Match extends BasePatternMatch {
73 private Physical_Person fP;
74
75 private static List<String> parameterNames = makeImmutableList("p");
76
77 private Match(final Physical_Person pP) {
78 this.fP = pP;
79 }
80
81 @Override
82 public Object get(final String parameterName) {
83 switch(parameterName) {
84 case "p": return this.fP;
85 default: return null;
86 }
87 }
88
89 @Override
90 public Object get(final int index) {
91 switch(index) {
92 case 0: return this.fP;
93 default: return null;
94 }
95 }
96
97 public Physical_Person getP() {
98 return this.fP;
99 }
100
101 @Override
102 public boolean set(final String parameterName, final Object newValue) {
103 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
104 if ("p".equals(parameterName) ) {
105 this.fP = (Physical_Person) newValue;
106 return true;
107 }
108 return false;
109 }
110
111 public void setP(final Physical_Person pP) {
112 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
113 this.fP = pP;
114 }
115
116 @Override
117 public String patternName() {
118 return "queries.x_inv48";
119 }
120
121 @Override
122 public List<String> parameterNames() {
123 return X_inv48.Match.parameterNames;
124 }
125
126 @Override
127 public Object[] toArray() {
128 return new Object[]{fP};
129 }
130
131 @Override
132 public X_inv48.Match toImmutable() {
133 return isMutable() ? newMatch(fP) : this;
134 }
135
136 @Override
137 public String prettyPrint() {
138 StringBuilder result = new StringBuilder();
139 result.append("\"p\"=" + prettyPrintValue(fP));
140 return result.toString();
141 }
142
143 @Override
144 public int hashCode() {
145 return Objects.hash(fP);
146 }
147
148 @Override
149 public boolean equals(final Object obj) {
150 if (this == obj)
151 return true;
152 if (obj == null) {
153 return false;
154 }
155 if ((obj instanceof X_inv48.Match)) {
156 X_inv48.Match other = (X_inv48.Match) obj;
157 return Objects.equals(fP, other.fP);
158 } else {
159 // this should be infrequent
160 if (!(obj instanceof IPatternMatch)) {
161 return false;
162 }
163 IPatternMatch otherSig = (IPatternMatch) obj;
164 return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray());
165 }
166 }
167
168 @Override
169 public X_inv48 specification() {
170 return X_inv48.instance();
171 }
172
173 /**
174 * Returns an empty, mutable match.
175 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
176 *
177 * @return the empty match.
178 *
179 */
180 public static X_inv48.Match newEmptyMatch() {
181 return new Mutable(null);
182 }
183
184 /**
185 * Returns a mutable (partial) match.
186 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
187 *
188 * @param pP the fixed value of pattern parameter p, or null if not bound.
189 * @return the new, mutable (partial) match object.
190 *
191 */
192 public static X_inv48.Match newMutableMatch(final Physical_Person pP) {
193 return new Mutable(pP);
194 }
195
196 /**
197 * Returns a new (partial) match.
198 * This can be used e.g. to call the matcher with a partial match.
199 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
200 * @param pP the fixed value of pattern parameter p, or null if not bound.
201 * @return the (partial) match object.
202 *
203 */
204 public static X_inv48.Match newMatch(final Physical_Person pP) {
205 return new Immutable(pP);
206 }
207
208 private static final class Mutable extends X_inv48.Match {
209 Mutable(final Physical_Person pP) {
210 super(pP);
211 }
212
213 @Override
214 public boolean isMutable() {
215 return true;
216 }
217 }
218
219 private static final class Immutable extends X_inv48.Match {
220 Immutable(final Physical_Person pP) {
221 super(pP);
222 }
223
224 @Override
225 public boolean isMutable() {
226 return false;
227 }
228 }
229 }
230
231 /**
232 * Generated pattern matcher API of the queries.x_inv48 pattern,
233 * providing pattern-specific query methods.
234 *
235 * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)},
236 * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}.
237 *
238 * <p>Matches of the pattern will be represented as {@link Match}.
239 *
240 * <p>Original source:
241 * <code><pre>
242 * pattern x_inv48(p : Physical_Person) {
243 * Physical_Person.disability_type(p, ::NONE);
244 * }
245 * </pre></code>
246 *
247 * @see Match
248 * @see X_inv48
249 *
250 */
251 public static class Matcher extends BaseMatcher<X_inv48.Match> {
252 /**
253 * Initializes the pattern matcher within an existing VIATRA Query engine.
254 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
255 *
256 * @param engine the existing VIATRA Query engine in which this matcher will be created.
257 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
258 *
259 */
260 public static X_inv48.Matcher on(final ViatraQueryEngine engine) {
261 // check if matcher already exists
262 Matcher matcher = engine.getExistingMatcher(querySpecification());
263 if (matcher == null) {
264 matcher = (Matcher)engine.getMatcher(querySpecification());
265 }
266 return matcher;
267 }
268
269 /**
270 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
271 * @return an initialized matcher
272 * @noreference This method is for internal matcher initialization by the framework, do not call it manually.
273 *
274 */
275 public static X_inv48.Matcher create() {
276 return new Matcher();
277 }
278
279 private static final int POSITION_P = 0;
280
281 private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(X_inv48.Matcher.class);
282
283 /**
284 * Initializes the pattern matcher within an existing VIATRA Query engine.
285 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
286 *
287 * @param engine the existing VIATRA Query engine in which this matcher will be created.
288 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
289 *
290 */
291 private Matcher() {
292 super(querySpecification());
293 }
294
295 /**
296 * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
297 * @param pP the fixed value of pattern parameter p, or null if not bound.
298 * @return matches represented as a Match object.
299 *
300 */
301 public Collection<X_inv48.Match> getAllMatches(final Physical_Person pP) {
302 return rawStreamAllMatches(new Object[]{pP}).collect(Collectors.toSet());
303 }
304
305 /**
306 * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters.
307 * </p>
308 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
309 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
310 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
311 * @param pP the fixed value of pattern parameter p, or null if not bound.
312 * @return a stream of matches represented as a Match object.
313 *
314 */
315 public Stream<X_inv48.Match> streamAllMatches(final Physical_Person pP) {
316 return rawStreamAllMatches(new Object[]{pP});
317 }
318
319 /**
320 * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
321 * Neither determinism nor randomness of selection is guaranteed.
322 * @param pP the fixed value of pattern parameter p, or null if not bound.
323 * @return a match represented as a Match object, or null if no match is found.
324 *
325 */
326 public Optional<X_inv48.Match> getOneArbitraryMatch(final Physical_Person pP) {
327 return rawGetOneArbitraryMatch(new Object[]{pP});
328 }
329
330 /**
331 * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
332 * under any possible substitution of the unspecified parameters (if any).
333 * @param pP the fixed value of pattern parameter p, or null if not bound.
334 * @return true if the input is a valid (partial) match of the pattern.
335 *
336 */
337 public boolean hasMatch(final Physical_Person pP) {
338 return rawHasMatch(new Object[]{pP});
339 }
340
341 /**
342 * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
343 * @param pP the fixed value of pattern parameter p, or null if not bound.
344 * @return the number of pattern matches found.
345 *
346 */
347 public int countMatches(final Physical_Person pP) {
348 return rawCountMatches(new Object[]{pP});
349 }
350
351 /**
352 * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
353 * Neither determinism nor randomness of selection is guaranteed.
354 * @param pP the fixed value of pattern parameter p, or null if not bound.
355 * @param processor the action that will process the selected match.
356 * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked
357 *
358 */
359 public boolean forOneArbitraryMatch(final Physical_Person pP, final Consumer<? super X_inv48.Match> processor) {
360 return rawForOneArbitraryMatch(new Object[]{pP}, processor);
361 }
362
363 /**
364 * Returns a new (partial) match.
365 * This can be used e.g. to call the matcher with a partial match.
366 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
367 * @param pP the fixed value of pattern parameter p, or null if not bound.
368 * @return the (partial) match object.
369 *
370 */
371 public X_inv48.Match newMatch(final Physical_Person pP) {
372 return X_inv48.Match.newMatch(pP);
373 }
374
375 /**
376 * Retrieve the set of values that occur in matches for p.
377 * @return the Set of all values or empty set if there are no matches
378 *
379 */
380 protected Stream<Physical_Person> rawStreamAllValuesOfp(final Object[] parameters) {
381 return rawStreamAllValues(POSITION_P, parameters).map(Physical_Person.class::cast);
382 }
383
384 /**
385 * Retrieve the set of values that occur in matches for p.
386 * @return the Set of all values or empty set if there are no matches
387 *
388 */
389 public Set<Physical_Person> getAllValuesOfp() {
390 return rawStreamAllValuesOfp(emptyArray()).collect(Collectors.toSet());
391 }
392
393 /**
394 * Retrieve the set of values that occur in matches for p.
395 * @return the Set of all values or empty set if there are no matches
396 *
397 */
398 public Stream<Physical_Person> streamAllValuesOfp() {
399 return rawStreamAllValuesOfp(emptyArray());
400 }
401
402 @Override
403 protected X_inv48.Match tupleToMatch(final Tuple t) {
404 try {
405 return X_inv48.Match.newMatch((Physical_Person) t.get(POSITION_P));
406 } catch(ClassCastException e) {
407 LOGGER.error("Element(s) in tuple not properly typed!",e);
408 return null;
409 }
410 }
411
412 @Override
413 protected X_inv48.Match arrayToMatch(final Object[] match) {
414 try {
415 return X_inv48.Match.newMatch((Physical_Person) match[POSITION_P]);
416 } catch(ClassCastException e) {
417 LOGGER.error("Element(s) in array not properly typed!",e);
418 return null;
419 }
420 }
421
422 @Override
423 protected X_inv48.Match arrayToMatchMutable(final Object[] match) {
424 try {
425 return X_inv48.Match.newMutableMatch((Physical_Person) match[POSITION_P]);
426 } catch(ClassCastException e) {
427 LOGGER.error("Element(s) in array not properly typed!",e);
428 return null;
429 }
430 }
431
432 /**
433 * @return the singleton instance of the query specification of this pattern
434 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
435 *
436 */
437 public static IQuerySpecification<X_inv48.Matcher> querySpecification() {
438 return X_inv48.instance();
439 }
440 }
441
442 private X_inv48() {
443 super(GeneratedPQuery.INSTANCE);
444 }
445
446 /**
447 * @return the singleton instance of the query specification
448 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
449 *
450 */
451 public static X_inv48 instance() {
452 try{
453 return LazyHolder.INSTANCE;
454 } catch (ExceptionInInitializerError err) {
455 throw processInitializerError(err);
456 }
457 }
458
459 @Override
460 protected X_inv48.Matcher instantiate(final ViatraQueryEngine engine) {
461 return X_inv48.Matcher.on(engine);
462 }
463
464 @Override
465 public X_inv48.Matcher instantiate() {
466 return X_inv48.Matcher.create();
467 }
468
469 @Override
470 public X_inv48.Match newEmptyMatch() {
471 return X_inv48.Match.newEmptyMatch();
472 }
473
474 @Override
475 public X_inv48.Match newMatch(final Object... parameters) {
476 return X_inv48.Match.newMatch((Taxation.Physical_Person) parameters[0]);
477 }
478
479 /**
480 * Inner class allowing the singleton instance of {@link X_inv48} to be created
481 * <b>not</b> at the class load time of the outer class,
482 * but rather at the first call to {@link X_inv48#instance()}.
483 *
484 * <p> This workaround is required e.g. to support recursion.
485 *
486 */
487 private static class LazyHolder {
488 private static final X_inv48 INSTANCE = new X_inv48();
489
490 /**
491 * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
492 * This initialization order is required to support indirect recursion.
493 *
494 * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
495 *
496 */
497 private static final Object STATIC_INITIALIZER = ensureInitialized();
498
499 public static Object ensureInitialized() {
500 INSTANCE.ensureInitializedInternal();
501 return null;
502 }
503 }
504
505 private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
506 private static final X_inv48.GeneratedPQuery INSTANCE = new GeneratedPQuery();
507
508 private final PParameter parameter_p = new PParameter("p", "Taxation.Physical_Person", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http:///TaxCard.ecore", "Physical_Person")), PParameterDirection.INOUT);
509
510 private final List<PParameter> parameters = Arrays.asList(parameter_p);
511
512 private GeneratedPQuery() {
513 super(PVisibility.PUBLIC);
514 }
515
516 @Override
517 public String getFullyQualifiedName() {
518 return "queries.x_inv48";
519 }
520
521 @Override
522 public List<String> getParameterNames() {
523 return Arrays.asList("p");
524 }
525
526 @Override
527 public List<PParameter> getParameters() {
528 return parameters;
529 }
530
531 @Override
532 public Set<PBody> doGetContainedBodies() {
533 setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
534 Set<PBody> bodies = new LinkedHashSet<>();
535 {
536 PBody body = new PBody(this);
537 PVariable var_p = body.getOrCreateVariableByName("p");
538 new TypeConstraint(body, Tuples.flatTupleOf(var_p), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http:///TaxCard.ecore", "Physical_Person")));
539 body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
540 new ExportedParameter(body, var_p, parameter_p)
541 ));
542 // Physical_Person.disability_type(p, ::NONE)
543 PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
544 new ConstantValue(body, var__virtual_0_, getEnumLiteral("http:///TaxCard.ecore", "Disability_Types", "NONE").getInstance());
545 new TypeConstraint(body, Tuples.flatTupleOf(var_p), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http:///TaxCard.ecore", "Physical_Person")));
546 PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}");
547 new TypeConstraint(body, Tuples.flatTupleOf(var_p, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http:///TaxCard.ecore", "Physical_Person", "disability_type")));
548 new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_), new EDataTypeInSlotsKey((EDataType)getClassifierLiteral("http:///TaxCard.ecore", "Disability_Types")));
549 new Equality(body, var__virtual_1_, var__virtual_0_);
550 bodies.add(body);
551 }
552 return bodies;
553 }
554 }
555}
diff --git a/Tests/MODELS2020-CaseStudies/case.study.pledge.run/src/queries/SatelliteQueries.vql b/Tests/MODELS2020-CaseStudies/case.study.pledge.run/src/queries/SatelliteQueries.vql
new file mode 100644
index 00000000..57b5933a
--- /dev/null
+++ b/Tests/MODELS2020-CaseStudies/case.study.pledge.run/src/queries/SatelliteQueries.vql
@@ -0,0 +1,390 @@
1package hu.bme.mit.inf.dslreasoner.domains.satellite.queries
2
3import "http://www.example.org/satellite"
4
5@Constraint(severity = "error", key = {Element},
6 message = "A communicating element may not have two transmitting communication subsystems.")
7pattern communicationLinkDoesNotStartAtContainingElement(Element : CommunicatingElement) {
8 find transmittingCommSubsystem(Element, Comm1);
9 find transmittingCommSubsystem(Element, Comm2);
10 Comm1 != Comm2;
11}
12
13private pattern transmittingCommSubsystem(Element : CommunicatingElement, Comm : CommSubsystem) {
14 CommunicatingElement.commSubsystem(Element, Comm);
15 CommSubsystem.target(Comm, _);
16}
17
18@Constraint(severity = "error", key = {Station},
19 message = "The ground station network may not have outgoing communication links.")
20pattern transmittingGroundStationNetwork(Station : GroundStationNetwork) {
21 find transmittingCommSubsystem(Station, _);
22}
23
24@Constraint(severity = "error", key = {Station},
25 message = "The ground station network may not have UHF communication subsystems.")
26pattern roundStationNetworkUHF(Station : GroundStationNetwork) {
27 CommunicatingElement.commSubsystem(Station, Comm);
28 UHFCommSubsystem(Comm);
29}
30
31// At least two spacecraft must have the interferometry payload configured
32
33@Constraint(severity = "error", key = {Mission},
34 message = "Interferometry mission needs at least two spacecraft configured with the interferometry payload.")
35pattern notEnoughInterferometryPayloads(Mission : InterferometryMission) {
36 InterferometryMission(Mission);
37 neg find atLeastTwoInterferometryPayloads(Mission);
38}
39
40private pattern atLeastTwoInterferometryPayloads(Mission : InterferometryMission) {
41 find spacecraftWithInterferometryPayload(Mission, Spacecraft1);
42 find spacecraftWithInterferometryPayload(Mission, Spacecraft2);
43 Spacecraft1 != Spacecraft2;
44}
45
46private pattern spacecraftWithInterferometryPayload(Mission : ConstellationMission, Spacecraft : Spacecraft) {
47 ConstellationMission.spacecraft(Mission, Spacecraft);
48 Spacecraft.payload(Spacecraft, Payload);
49 InterferometryPayload(Payload);
50}
51
52// All spacecraft must have some communication path to the ground station
53
54//@Constraint(severity = "error", key = {Spacecraft},
55// message = "Spacecraft has no communication path to the ground station.")
56//pattern noLinkToGroundStation(Spacecraft : Spacecraft) {
57// ConstellationMission.groundStationNetwork(Mission, GroundStation);
58// ConstellationMission.spacecraft(Mission, Spacecraft);
59// neg find indirectCommunicationLink(Spacecraft, GroundStation);
60//}
61
62//@Constraint(severity = "error", key = {Spacecraft}, message = "UNSAT")
63//pattern unsat_linkToGroundStation(Spacecraft : Spacecraft) {
64// ConstellationMission.groundStationNetwork(Mission, GroundStation);
65// ConstellationMission.spacecraft(Mission, Spacecraft);
66// find indirectCommunicationLink(Spacecraft, GroundStation);
67//}
68
69//@Constraint(severity = "error", key = {Mission}, message = "UNSAT")
70//pattern unsat_linkToGroundStation(Mission : InterferometryMission) {
71// InterferometryMission(Mission);
72// neg find noLinkToGroundStation(_);
73//}
74
75//@Constraint(severity = "error", key = {Spacecraft},
76// message = "Spacecraft has no potential communication path to the ground station.")
77//pattern noPotentialLinkToGroundStation(Spacecraft : Spacecraft) {
78// ConstellationMission.groundStationNetwork(Mission, GroundStation);
79// ConstellationMission.spacecraft(Mission, Spacecraft);
80// neg find indirectLinkAllowed(Spacecraft, GroundStation);
81//}
82
83//private pattern indirectLinkAllowed(From : Spacecraft, To : CommunicatingElement) {
84// find linkAllowed+(From, To);
85//}
86
87//private pattern linkAllowed(From : Spacecraft, To : CommunicatingElement) {
88// find matchingAntenna(From, To);
89// neg find cubeSat3U(From);
90//} or {
91// find matchingAntenna(From, To);
92// CubeSat3U(From);
93//} or {
94// find matchingAntenna(From, To);
95// CubeSat3U(From);
96// GroundStationNetwork(To);
97//}
98
99//private pattern matchingAntenna(From : Spacecraft, To : CommunicatingElement) {
100// CommunicatingElement.commSubsystem(From, FromSys);
101// CommunicatingElement.commSubsystem(To, ToSys);
102// find matchingCommSubsystem(FromSys, ToSys);
103//}
104
105private pattern matchingCommSubsystem(From : CommSubsystem, To : CommSubsystem) {
106 UHFCommSubsystem(From);
107 UHFCommSubsystem(To);
108} or {
109 XCommSubsystem(From);
110 XCommSubsystem(To);
111} or {
112 KaCommSubsystem(From);
113 KaCommSubsystem(To);
114}
115
116//private pattern cubeSat3U(Sat : CubeSat3U) {
117// CubeSat3U(Sat);
118//}
119
120// No communication loops may exist
121// No spacecraft may directly communicate with itself
122
123@Constraint(severity = "error", key = {Element},
124 message = "Communication loop.")
125pattern communicationLoop(Element : CommunicatingElement) {
126 find indirectCommunicationLink(Element, Element);
127}
128
129private pattern indirectCommunicationLink(Source : CommunicatingElement, Target : CommunicatingElement) {
130 find directCommunicationLink+(Source, Target);
131}
132
133private pattern directCommunicationLink(Source : CommunicatingElement, Target : CommunicatingElement) {
134 CommSubsystem.target(SourceSubsystem, TargetSubsystem);
135 CommunicatingElement.commSubsystem(Source, SourceSubsystem);
136 CommunicatingElement.commSubsystem(Target, TargetSubsystem);
137}
138
139// Source and target communication systems must be compatible.
140
141@Constraint(severity = "error", key = {SourceSubsystem},
142 message = "Two ends of a communication link must use the same band.")
143pattern incompatibleSourceAndTargetBand(SourceSubsystem : CommSubsystem) {
144 CommSubsystem.target(SourceSubsystem, TargetSubsystem);
145 neg find matchingCommSubsystem(SourceSubsystem, TargetSubsystem);
146}
147
148// 3U CubeSats are assumed to only be able to downlink to Earth using an X-band trasmitter,
149// but cross-link using UHF
150
151@Constraint(severity = "error", key = {Sat},
152 message = "3U CubeSats can only cross-link using UHF.")
153pattern threeUCubeSatWithNonUhfCrossLink(Sat : CubeSat3U) {
154 CommunicatingElement.commSubsystem(Sat, SourceComm);
155 neg find commSubsystemBandUhf(SourceComm);
156 CommSubsystem.target(SourceComm, TargetComm);
157 CommunicatingElement.commSubsystem(Target, TargetComm);
158 neg find groundStationNetwork(Target);
159}
160
161private pattern commSubsystemBandUhf(Comm : UHFCommSubsystem) {
162 UHFCommSubsystem(Comm);
163}
164
165private pattern groundStationNetwork(Network : GroundStationNetwork) {
166 GroundStationNetwork(Network);
167}
168
169// Only a Small Satellite can be configured with a Ka-band communication system
170
171@Constraint(severity = "error", key = {Spacecraft},
172 message = "Only a Small Satellite can be configured with a Ka-band communication system.")
173pattern cubeSatWithKaAntenna(Spacecraft : Spacecraft) {
174 CommunicatingElement.commSubsystem(Spacecraft, Comm);
175 KaCommSubsystem(Comm);
176 neg find smallSat(Spacecraft);
177}
178
179pattern smallSat(Sat : SmallSat) {
180 SmallSat(Sat);
181}
182
183@Constraint(severity = "error", key = {c1,c2}, message = "error")
184pattern differentFrequency(c1 : CommSubsystem, c2 : CommSubsystem) {
185 CommSubsystem.target(c1,c2);
186 CommSubsystem.frequency(c1,f1);
187 CommSubsystem.frequency(c2,f2);
188 check(f1!=f2);
189}
190
191@Constraint(severity = "error", key = {s,s}, message = "error")
192pattern tooHighFrequencyForUHF(s : UHFCommSubsystem) {
193 UHFCommSubsystem(s);
194 CommSubsystem.frequency(s,f);
195 check(f>1000);//1GHz
196}
197@Constraint(severity = "error", key = {s,s}, message = "error")
198pattern tooLowFrequencyForUHF(s : UHFCommSubsystem) {
199 UHFCommSubsystem(s);
200 CommSubsystem.frequency(s,f);
201 check(f<300);//300MHz
202}
203@Constraint(severity = "error", key = {s,s}, message = "error")
204pattern tooHighFrequencyForKaComm(s : KaCommSubsystem) {
205 KaCommSubsystem(s);
206 CommSubsystem.frequency(s,f);
207 check(f>40000);//40GHz
208}
209@Constraint(severity = "error", key = {s,s}, message = "error")
210pattern tooLowFrequencyForKaComm(s : KaCommSubsystem) {
211 KaCommSubsystem(s);
212 CommSubsystem.frequency(s,f);
213 check(f<26500);//26.5GHz
214}
215@Constraint(severity = "error", key = {s,s}, message = "error")
216pattern tooHighFrequencyForXComm(s : XCommSubsystem) {
217 XCommSubsystem(s);
218 CommSubsystem.frequency(s,f);
219 check(f>12000);//12GHz
220}
221@Constraint(severity = "error", key = {s,s}, message = "error")
222pattern tooLowFrequencyForXComm(s : XCommSubsystem) {
223 XCommSubsystem(s);
224 CommSubsystem.frequency(s,f);
225 check(f<8000);//8GHz
226}
227@Constraint(severity = "error", key = {s,s}, message = "error")
228pattern tooHighPathLengthForSatelite(s:CommSubsystem) {
229 CommSubsystem.pathLength(s,l);
230 CommSubsystem.target(s,ts);
231 Spacecraft.commSubsystem(_,ts);
232 check(l>250);//250km
233}
234@Constraint(severity = "error", key = {s,s}, message = "error")
235pattern tooLowPathLengthForSatelite(s:CommSubsystem) {
236 CommSubsystem.pathLength(s,l);
237 CommSubsystem.target(s,ts);
238 Spacecraft.commSubsystem(_,ts);
239 check(l<150);//150km
240}
241@Constraint(severity = "error", key = {s,s}, message = "error")
242pattern tooLowPathLengthForGroundStation(s:CommSubsystem) {
243 CommSubsystem.pathLength(s,l);
244 CommSubsystem.target(s,ts);
245 GroundStationNetwork.commSubsystem(_,ts);
246 check(l!=385000);//385.000km
247}
248////
249//// Metrics
250////
251//
252//// Coverage
253//
254//pattern coverageMetric(Coverage : java Double) {
255// Coverage == sum find missionCoverage(_, #_);
256//}
257//
258//private pattern missionCoverage(Mission : InterferometryMission, Coverage : java Double) {
259// InterferometryMission.observationTime(Mission, ObservationTime);
260// ObserverCount == count find spacecraftWithInterferometryPayload(Mission, _);
261// Coverage == eval(Math.pow(1 - 2.0 / ObserverCount, 1 + 9 * (1.0 / ObservationTime)) + 0.05 * ObservationTime / 3);
262//}
263//
264//// Time
265//
266//pattern timeMetric(Time : java Double) {
267// Time == sum find missionTime(_, #_);
268//}
269//
270//private pattern missionTime(Mission : InterferometryMission, Time : java Double) {
271// InterferometryMission.observationTime(Mission, ObservationTime);
272// TrasmitTime == sum find transmitTime(Mission, _, #_);
273// Time == eval(TrasmitTime + 60.0 * ObservationTime);
274//}
275//
276//private pattern transmitTime(Mission : InterferometryMission, Spacecraft : Spacecraft, TransmitTime : java Double) {
277// ConstellationMission.spacecraft(Mission, Spacecraft);
278// find scienceData(Spacecraft, ScienceData);
279// IncomingData == sum find incomingData(Spacecraft, _, #_);
280// find transmitRate(Spacecraft, TransmitRate);
281// TransmitTime == eval((ScienceData + IncomingData) / (7.5 * TransmitRate));
282//}
283//
284//private pattern incomingData(Spacecraft : Spacecraft, Source : Spacecraft, Data : java Double) {
285// find indirectCommunicationLink(Source, Spacecraft);
286// find scienceData(Source, Data);
287//}
288//
289//private pattern scienceData(Spacecraft : Spacecraft, Data : java Double) {
290// ConstellationMission.spacecraft(Mission, Spacecraft);
291// InterferometryMission.observationTime(Mission, ObservationTime);
292// Data == eval(12.0 * ObservationTime);
293//}
294//
295//private pattern transmitRate(Spacecraft : Spacecraft, TransmitRate : java Double) {
296// find spacecraftUplink(Spacecraft, Comm, Target);
297// UHFCommSubsystem(Comm);
298// Spacecraft(Target);
299// TransmitRate == 5.0;
300//} or {
301// find spacecraftUplink(Spacecraft, Comm, Target);
302// XCommSubsystem(Comm);
303// Spacecraft(Target);
304// TransmitRate == 1.6;
305//} or {
306// find spacecraftUplink(Spacecraft, Comm, Target);
307// XCommSubsystem(Comm);
308// GroundStationNetwork(Target);
309// TransmitRate == 0.7;
310//} or {
311// find spacecraftUplink(Spacecraft, Comm, Target);
312// KaCommSubsystem(Comm);
313// Spacecraft(Target);
314// TransmitRate == 220.0;
315//} or {
316// find spacecraftUplink(Spacecraft, Comm, Target);
317// KaCommSubsystem(Comm);
318// GroundStationNetwork(Target);
319// TransmitRate == 80.0;
320//}
321//
322//private pattern spacecraftUplink(Spacecraft : Spacecraft, TargetSubsystem : CommSubsystem, Target : CommunicatingElement) {
323// CommunicatingElement.commSubsystem.target(Spacecraft, TargetSubsystem);
324// CommunicatingElement.commSubsystem(Target, TargetSubsystem);
325//}
326//
327//// Cost
328//
329//pattern costMetric(Cost : java Double) {
330// Cost == sum find missionCost(_, #_);
331//}
332//
333//private pattern missionCost(Mission : InterferometryMission, Cost : java Double) {
334// InterferometryMission.observationTime(Mission, ObservationTime);
335// SpacecraftCost == sum find spacecraftCost(Mission, _, #_);
336// Cost == eval(SpacecraftCost + 100000.0 * ObservationTime);
337//}
338//
339//private pattern spacecraftCost(Mission : InterferometryMission, Spacecraft : Spacecraft, Cost : java Double) {
340// ConstellationMission.spacecraft(Mission, Spacecraft);
341// find spacecraftOfKindCount(Spacecraft, KindCount);
342// find basePrice(Spacecraft, BasePrice);
343// find interferometryPayloadCost(Spacecraft, InterferometryPayloadCost);
344// find additionalCommSubsystemCost(Spacecraft, AdditionalCommSubsystemCost);
345// Cost == eval(BasePrice * Math.pow(KindCount, -0.25) + InterferometryPayloadCost + AdditionalCommSubsystemCost);
346//}
347//
348//private pattern spacecraftOfKindCount(Sat : Spacecraft, Count : java Integer) {
349// CubeSat3U(Sat);
350// Count == count find cubeSat3U(_);
351//} or {
352// CubeSat6U(Sat);
353// Count == count find cubeSat6U(_);
354//} or {
355// SmallSat(Sat);
356// Count == count find smallSat(_);
357//}
358//
359//private pattern basePrice(Spacecraft : Spacecraft, BasePrice : java Double) {
360// CubeSat3U(Spacecraft);
361// BasePrice == 250000.0;
362//} or {
363// CubeSat6U(Spacecraft);
364// BasePrice == 750000.0;
365//} or {
366// SmallSat(Spacecraft);
367// BasePrice == 3000000.0;
368//}
369//
370//private pattern interferometryPayloadCost(Spacecraft : Spacecraft, Cost : java Double) {
371// find spacecraftWithInterferometryPayload(_, Spacecraft);
372// Cost == 50000.0;
373//} or {
374// neg find spacecraftWithInterferometryPayload(_, Spacecraft);
375// Cost == 0.0;
376//}
377//
378//private pattern additionalCommSubsystemCost(Spacecraft : Spacecraft, Cost : java Double) {
379// find spacecraftWithTwoCommSubsystems(Spacecraft);
380// Cost == 100000.0;
381//} or {
382// neg find spacecraftWithTwoCommSubsystems(Spacecraft);
383// Cost == 0.0;
384//}
385//
386//private pattern spacecraftWithTwoCommSubsystems(Spacecraft : Spacecraft) {
387// Spacecraft.commSubsystem(Spacecraft, Subsystem1);
388// Spacecraft.commSubsystem(Spacecraft, Subsystem2);
389// Subsystem1 != Subsystem2;
390//}
diff --git a/Tests/MODELS2020-CaseStudies/case.study.pledge.run/src/queries/case_study_A.vql b/Tests/MODELS2020-CaseStudies/case.study.pledge.run/src/queries/case_study_A.vql
index 01cdf372..d879fd7c 100644
--- a/Tests/MODELS2020-CaseStudies/case.study.pledge.run/src/queries/case_study_A.vql
+++ b/Tests/MODELS2020-CaseStudies/case.study.pledge.run/src/queries/case_study_A.vql
@@ -1,5 +1,5 @@
1package queries 1package queries
2 2
3import "http:///TaxCard.ecore" 3import "http:///TaxCard.ecore"
4 4
5//AttributeRemoved -> DF 5//AttributeRemoved -> DF
diff --git a/Tests/MODELS2020-CaseStudies/case.study.pledge.run/src/run/GenerateFromConfig.xtend b/Tests/MODELS2020-CaseStudies/case.study.pledge.run/src/run/GenerateFromConfig.xtend
index bd77634f..5cda1e16 100644
--- a/Tests/MODELS2020-CaseStudies/case.study.pledge.run/src/run/GenerateFromConfig.xtend
+++ b/Tests/MODELS2020-CaseStudies/case.study.pledge.run/src/run/GenerateFromConfig.xtend
@@ -53,10 +53,10 @@ class GenerateFromConfig {
53 static val SIZE_MUL = 1 53 static val SIZE_MUL = 1
54 static val SIZE_INC = 5 54 static val SIZE_INC = 5
55 55
56 static var REPS = 1 56 static var REPS = 5
57 static val RUNTIME = 2100 57 static val RUNTIME = 2100
58 58
59 static val DOMAIN = "Taxation" // "FamilyTree", "Taxation" 59 static val DOMAIN = "Satellite" // "FamilyTree", "Taxation", "Satellite"
60 static val QUERIES = true 60 static val QUERIES = true
61 static val INITIAL = true 61 static val INITIAL = true
62 static val INDIV_WRT = false 62 static val INDIV_WRT = false
diff --git a/Tests/MODELS2020-CaseStudies/case.study.pledge.run/xtend-gen/run/.GenerateFromConfig.xtendbin b/Tests/MODELS2020-CaseStudies/case.study.pledge.run/xtend-gen/run/.GenerateFromConfig.xtendbin
index 87d1cc1e..9a7cc0d6 100644
--- a/Tests/MODELS2020-CaseStudies/case.study.pledge.run/xtend-gen/run/.GenerateFromConfig.xtendbin
+++ b/Tests/MODELS2020-CaseStudies/case.study.pledge.run/xtend-gen/run/.GenerateFromConfig.xtendbin
Binary files differ
diff --git a/Tests/MODELS2020-CaseStudies/case.study.pledge.run/xtend-gen/run/.GeneratePledgeModels.xtendbin b/Tests/MODELS2020-CaseStudies/case.study.pledge.run/xtend-gen/run/.GeneratePledgeModels.xtendbin
index e7e5d9f0..526b322a 100644
--- a/Tests/MODELS2020-CaseStudies/case.study.pledge.run/xtend-gen/run/.GeneratePledgeModels.xtendbin
+++ b/Tests/MODELS2020-CaseStudies/case.study.pledge.run/xtend-gen/run/.GeneratePledgeModels.xtendbin
Binary files differ
diff --git a/Tests/MODELS2020-CaseStudies/case.study.pledge.run/xtend-gen/run/.gitignore b/Tests/MODELS2020-CaseStudies/case.study.pledge.run/xtend-gen/run/.gitignore
deleted file mode 100644
index 5f2a65d9..00000000
--- a/Tests/MODELS2020-CaseStudies/case.study.pledge.run/xtend-gen/run/.gitignore
+++ /dev/null
@@ -1,10 +0,0 @@
1/.GenerateScenarios.java._trace
2/.checkQueries.java._trace
3/.RunGenerator.xtendbin
4/GenerateScenarios.java
5/.GenerateScenarios.xtendbin
6/.GeneratePledgeModels.java._trace
7/.GeneratePledgeModels.xtendbin
8/GeneratePledgeModels.java
9/.UML2TGF.java._trace
10/.GenerateFromConfig.java._trace
diff --git a/Tests/MODELS2020-CaseStudies/case.study.pledge.run/xtend-gen/run/GenerateFromConfig.java b/Tests/MODELS2020-CaseStudies/case.study.pledge.run/xtend-gen/run/GenerateFromConfig.java
index 35f173be..5410113e 100644
--- a/Tests/MODELS2020-CaseStudies/case.study.pledge.run/xtend-gen/run/GenerateFromConfig.java
+++ b/Tests/MODELS2020-CaseStudies/case.study.pledge.run/xtend-gen/run/GenerateFromConfig.java
@@ -47,11 +47,11 @@ public class GenerateFromConfig {
47 47
48 private static final int SIZE_INC = 5; 48 private static final int SIZE_INC = 5;
49 49
50 private static int REPS = 1; 50 private static int REPS = 5;
51 51
52 private static final int RUNTIME = 2100; 52 private static final int RUNTIME = 2100;
53 53
54 private static final String DOMAIN = "Taxation"; 54 private static final String DOMAIN = "Satellite";
55 55
56 private static final boolean QUERIES = true; 56 private static final boolean QUERIES = true;
57 57