diff options
author | Kristóf Marussy <marussy@mit.bme.hu> | 2020-08-06 16:07:16 +0200 |
---|---|---|
committer | Kristóf Marussy <marussy@mit.bme.hu> | 2020-08-06 16:07:16 +0200 |
commit | a620f07468780778bd55dcffc30245def37ece69 (patch) | |
tree | 57189ad9c8bf15211a05a3cd50ee90e90f434557 | |
parent | Fix time measurement (diff) | |
download | VIATRA-Generator-a620f07468780778bd55dcffc30245def37ece69.tar.gz VIATRA-Generator-a620f07468780778bd55dcffc30245def37ece69.tar.zst VIATRA-Generator-a620f07468780778bd55dcffc30245def37ece69.zip |
MoDeS3 unit propagation WIP
69 files changed, 20874 insertions, 106 deletions
diff --git a/Application/hu.bme.mit.inf.dslreasoner.application.ide/xtend-gen/hu/bme/mit/inf/dslreasoner/application/ide/.ApplicationConfigurationIdeModule.xtendbin b/Application/hu.bme.mit.inf.dslreasoner.application.ide/xtend-gen/hu/bme/mit/inf/dslreasoner/application/ide/.ApplicationConfigurationIdeModule.xtendbin index 2a740f24..1e457bb2 100644 --- a/Application/hu.bme.mit.inf.dslreasoner.application.ide/xtend-gen/hu/bme/mit/inf/dslreasoner/application/ide/.ApplicationConfigurationIdeModule.xtendbin +++ b/Application/hu.bme.mit.inf.dslreasoner.application.ide/xtend-gen/hu/bme/mit/inf/dslreasoner/application/ide/.ApplicationConfigurationIdeModule.xtendbin | |||
Binary files differ | |||
diff --git a/Application/hu.bme.mit.inf.dslreasoner.application.ide/xtend-gen/hu/bme/mit/inf/dslreasoner/application/ide/.ApplicationConfigurationIdeSetup.xtendbin b/Application/hu.bme.mit.inf.dslreasoner.application.ide/xtend-gen/hu/bme/mit/inf/dslreasoner/application/ide/.ApplicationConfigurationIdeSetup.xtendbin index 6fd0f505..6ad24fc0 100644 --- a/Application/hu.bme.mit.inf.dslreasoner.application.ide/xtend-gen/hu/bme/mit/inf/dslreasoner/application/ide/.ApplicationConfigurationIdeSetup.xtendbin +++ b/Application/hu.bme.mit.inf.dslreasoner.application.ide/xtend-gen/hu/bme/mit/inf/dslreasoner/application/ide/.ApplicationConfigurationIdeSetup.xtendbin | |||
Binary files differ | |||
diff --git a/Application/org.eclipse.viatra.solver.language.ui/xtend-gen/org/eclipse/viatra/solver/language/ui/syntaxcoloring/.SolverSemanticHighlightCalculator.xtendbin b/Application/org.eclipse.viatra.solver.language.ui/xtend-gen/org/eclipse/viatra/solver/language/ui/syntaxcoloring/.SolverSemanticHighlightCalculator.xtendbin index 0b252347..18c9aee3 100644 --- a/Application/org.eclipse.viatra.solver.language.ui/xtend-gen/org/eclipse/viatra/solver/language/ui/syntaxcoloring/.SolverSemanticHighlightCalculator.xtendbin +++ b/Application/org.eclipse.viatra.solver.language.ui/xtend-gen/org/eclipse/viatra/solver/language/ui/syntaxcoloring/.SolverSemanticHighlightCalculator.xtendbin | |||
Binary files differ | |||
diff --git a/Application/org.eclipse.viatra.solver.language.ui/xtend-gen/org/eclipse/viatra/solver/language/ui/syntaxcoloring/.SolverSemanticTextAttributeProvider.xtendbin b/Application/org.eclipse.viatra.solver.language.ui/xtend-gen/org/eclipse/viatra/solver/language/ui/syntaxcoloring/.SolverSemanticTextAttributeProvider.xtendbin index 930ba6bf..0ebd4493 100644 --- a/Application/org.eclipse.viatra.solver.language.ui/xtend-gen/org/eclipse/viatra/solver/language/ui/syntaxcoloring/.SolverSemanticTextAttributeProvider.xtendbin +++ b/Application/org.eclipse.viatra.solver.language.ui/xtend-gen/org/eclipse/viatra/solver/language/ui/syntaxcoloring/.SolverSemanticTextAttributeProvider.xtendbin | |||
Binary files differ | |||
diff --git a/Application/org.eclipse.viatra.solver.language.ui/xtend-gen/org/eclipse/viatra/solver/language/validation/.SolverLanguageValidator.xtendbin b/Application/org.eclipse.viatra.solver.language.ui/xtend-gen/org/eclipse/viatra/solver/language/validation/.SolverLanguageValidator.xtendbin index 65fea578..bb484ba1 100644 --- a/Application/org.eclipse.viatra.solver.language.ui/xtend-gen/org/eclipse/viatra/solver/language/validation/.SolverLanguageValidator.xtendbin +++ b/Application/org.eclipse.viatra.solver.language.ui/xtend-gen/org/eclipse/viatra/solver/language/validation/.SolverLanguageValidator.xtendbin | |||
Binary files differ | |||
diff --git a/Application/org.eclipse.viatra.solver.language/xtend-gen/org/eclipse/viatra/solver/language/parser/antlr/.SolverLanguageTokenDefInjectingParser.xtendbin b/Application/org.eclipse.viatra.solver.language/xtend-gen/org/eclipse/viatra/solver/language/parser/antlr/.SolverLanguageTokenDefInjectingParser.xtendbin index 340908fe..61448536 100644 --- a/Application/org.eclipse.viatra.solver.language/xtend-gen/org/eclipse/viatra/solver/language/parser/antlr/.SolverLanguageTokenDefInjectingParser.xtendbin +++ b/Application/org.eclipse.viatra.solver.language/xtend-gen/org/eclipse/viatra/solver/language/parser/antlr/.SolverLanguageTokenDefInjectingParser.xtendbin | |||
Binary files differ | |||
diff --git a/Application/org.eclipse.viatra.solver.language/xtend-gen/org/eclipse/viatra/solver/language/serializer/.SolverLanguageSyntheticTokenSyntacticSequencer.xtendbin b/Application/org.eclipse.viatra.solver.language/xtend-gen/org/eclipse/viatra/solver/language/serializer/.SolverLanguageSyntheticTokenSyntacticSequencer.xtendbin index 21b52163..9af9309d 100644 --- a/Application/org.eclipse.viatra.solver.language/xtend-gen/org/eclipse/viatra/solver/language/serializer/.SolverLanguageSyntheticTokenSyntacticSequencer.xtendbin +++ b/Application/org.eclipse.viatra.solver.language/xtend-gen/org/eclipse/viatra/solver/language/serializer/.SolverLanguageSyntheticTokenSyntacticSequencer.xtendbin | |||
Binary files differ | |||
diff --git a/Domains/ca.mcgill.rtgmrt.example.modes3/.classpath b/Domains/ca.mcgill.rtgmrt.example.modes3/.classpath new file mode 100644 index 00000000..73ebde52 --- /dev/null +++ b/Domains/ca.mcgill.rtgmrt.example.modes3/.classpath | |||
@@ -0,0 +1,10 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8"?> | ||
2 | <classpath> | ||
3 | <classpathentry kind="src" path="ecore-gen"/> | ||
4 | <classpathentry kind="src" path="src"/> | ||
5 | <classpathentry kind="src" path="xtend-gen"/> | ||
6 | <classpathentry kind="src" path="vql-gen"/> | ||
7 | <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/> | ||
8 | <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> | ||
9 | <classpathentry kind="output" path="bin"/> | ||
10 | </classpath> | ||
diff --git a/Domains/ca.mcgill.rtgmrt.example.modes3/.gitignore b/Domains/ca.mcgill.rtgmrt.example.modes3/.gitignore new file mode 100644 index 00000000..ae3c1726 --- /dev/null +++ b/Domains/ca.mcgill.rtgmrt.example.modes3/.gitignore | |||
@@ -0,0 +1 @@ | |||
/bin/ | |||
diff --git a/Domains/ca.mcgill.rtgmrt.example.modes3/.project b/Domains/ca.mcgill.rtgmrt.example.modes3/.project new file mode 100644 index 00000000..5e0fbc45 --- /dev/null +++ b/Domains/ca.mcgill.rtgmrt.example.modes3/.project | |||
@@ -0,0 +1,40 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8"?> | ||
2 | <projectDescription> | ||
3 | <name>ca.mcgill.rtgmrt.example.modes3</name> | ||
4 | <comment></comment> | ||
5 | <projects> | ||
6 | </projects> | ||
7 | <buildSpec> | ||
8 | <buildCommand> | ||
9 | <name>org.eclipse.viatra.query.tooling.ui.projectbuilder</name> | ||
10 | <arguments> | ||
11 | </arguments> | ||
12 | </buildCommand> | ||
13 | <buildCommand> | ||
14 | <name>org.eclipse.xtext.ui.shared.xtextBuilder</name> | ||
15 | <arguments> | ||
16 | </arguments> | ||
17 | </buildCommand> | ||
18 | <buildCommand> | ||
19 | <name>org.eclipse.jdt.core.javabuilder</name> | ||
20 | <arguments> | ||
21 | </arguments> | ||
22 | </buildCommand> | ||
23 | <buildCommand> | ||
24 | <name>org.eclipse.pde.ManifestBuilder</name> | ||
25 | <arguments> | ||
26 | </arguments> | ||
27 | </buildCommand> | ||
28 | <buildCommand> | ||
29 | <name>org.eclipse.pde.SchemaBuilder</name> | ||
30 | <arguments> | ||
31 | </arguments> | ||
32 | </buildCommand> | ||
33 | </buildSpec> | ||
34 | <natures> | ||
35 | <nature>org.eclipse.jdt.core.javanature</nature> | ||
36 | <nature>org.eclipse.pde.PluginNature</nature> | ||
37 | <nature>org.eclipse.xtext.ui.shared.xtextNature</nature> | ||
38 | <nature>org.eclipse.viatra.query.projectnature</nature> | ||
39 | </natures> | ||
40 | </projectDescription> | ||
diff --git a/Domains/ca.mcgill.rtgmrt.example.modes3/.settings/org.eclipse.viatra.query.patternlanguage.emf.EMFPatternLanguage.prefs b/Domains/ca.mcgill.rtgmrt.example.modes3/.settings/org.eclipse.viatra.query.patternlanguage.emf.EMFPatternLanguage.prefs new file mode 100644 index 00000000..31cda49a --- /dev/null +++ b/Domains/ca.mcgill.rtgmrt.example.modes3/.settings/org.eclipse.viatra.query.patternlanguage.emf.EMFPatternLanguage.prefs | |||
@@ -0,0 +1,27 @@ | |||
1 | BuilderConfiguration.is_project_specific=true | ||
2 | autobuilding=true | ||
3 | eclipse.preferences.version=1 | ||
4 | generateEclipseExtensions=true | ||
5 | generateGeneratedAnnotation=false | ||
6 | generateManifestEntries=true | ||
7 | generateMatchProcessors=false | ||
8 | generateMatchers=NESTED_CLASS | ||
9 | generateSuppressWarnings=true | ||
10 | generatedAnnotationComment= | ||
11 | includeDateInGenerated=false | ||
12 | outlet.DEFAULT_OUTPUT.cleanDirectory=false | ||
13 | outlet.DEFAULT_OUTPUT.cleanupDerived=true | ||
14 | outlet.DEFAULT_OUTPUT.createDirectory=true | ||
15 | outlet.DEFAULT_OUTPUT.derived=true | ||
16 | outlet.DEFAULT_OUTPUT.directory=./vql-gen | ||
17 | outlet.DEFAULT_OUTPUT.hideLocalSyntheticVariables=true | ||
18 | outlet.DEFAULT_OUTPUT.installDslAsPrimarySource=false | ||
19 | outlet.DEFAULT_OUTPUT.keepLocalHistory=true | ||
20 | outlet.DEFAULT_OUTPUT.override=true | ||
21 | outlet.DEFAULT_OUTPUT.sourceFolder.ecore-gen.directory= | ||
22 | outlet.DEFAULT_OUTPUT.sourceFolder.ecore-gen.ignore= | ||
23 | outlet.DEFAULT_OUTPUT.sourceFolder.src.directory= | ||
24 | outlet.DEFAULT_OUTPUT.sourceFolder.src.ignore= | ||
25 | outlet.DEFAULT_OUTPUT.userOutputPerSourceFolder= | ||
26 | targetJavaVersion=JAVA5 | ||
27 | useJavaCompilerCompliance=true | ||
diff --git a/Domains/ca.mcgill.rtgmrt.example.modes3/META-INF/MANIFEST.MF b/Domains/ca.mcgill.rtgmrt.example.modes3/META-INF/MANIFEST.MF new file mode 100644 index 00000000..53e4a39c --- /dev/null +++ b/Domains/ca.mcgill.rtgmrt.example.modes3/META-INF/MANIFEST.MF | |||
@@ -0,0 +1,34 @@ | |||
1 | Manifest-Version: 1.0 | ||
2 | Bundle-ManifestVersion: 2 | ||
3 | Bundle-Name: %pluginName | ||
4 | Bundle-SymbolicName: ca.mcgill.rtgmrt.example.modes3;singleton:=true | ||
5 | Bundle-Version: 0.1.0.qualifier | ||
6 | Bundle-Vendor: %providerName | ||
7 | Bundle-Localization: plugin | ||
8 | Export-Package: modes3, | ||
9 | modes3.impl, | ||
10 | modes3.queries, | ||
11 | modes3.util | ||
12 | Require-Bundle: org.eclipse.viatra.query.runtime, | ||
13 | org.eclipse.viatra.query.runtime.rete, | ||
14 | org.eclipse.viatra.query.runtime.localsearch, | ||
15 | org.eclipse.xtext.xbase.lib, | ||
16 | org.eclipse.emf.ecore;visibility:=reexport, | ||
17 | org.eclipse.core.runtime, | ||
18 | org.eclipse.xtend.lib;bundle-version="2.21.0", | ||
19 | org.eclipse.xtend.lib.macro;bundle-version="2.21.0", | ||
20 | hu.bme.mit.inf.dslreasoner.application;bundle-version="1.0.0", | ||
21 | hu.bme.mit.inf.dslreasoner.logic.model;bundle-version="1.0.0", | ||
22 | hu.bme.mit.inf.dslreasoner.logic2ecore;bundle-version="1.0.0", | ||
23 | hu.bme.mit.inf.dslreasoner.viatra2logic;bundle-version="1.0.0", | ||
24 | hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatraquery;bundle-version="1.0.0", | ||
25 | hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage;bundle-version="1.0.0", | ||
26 | hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner;bundle-version="1.0.0", | ||
27 | hu.bme.mit.inf.dslreasoner.ecore2logic;bundle-version="1.0.0", | ||
28 | org.eclipse.emf.ecore.xmi;bundle-version="2.16.0", | ||
29 | hu.bme.mit.inf.dslreasoner.visualisation;bundle-version="1.0.0", | ||
30 | org.eclipse.viatra.query.patternlanguage.emf;bundle-version="2.4.0" | ||
31 | Bundle-RequiredExecutionEnvironment: J2SE-1.5 | ||
32 | Bundle-ActivationPolicy: lazy | ||
33 | Import-Package: org.apache.log4j | ||
34 | Automatic-Module-Name: ca.mcgill.rtgmrt.example.modes3 | ||
diff --git a/Domains/ca.mcgill.rtgmrt.example.modes3/build.properties b/Domains/ca.mcgill.rtgmrt.example.modes3/build.properties new file mode 100644 index 00000000..a431f6b2 --- /dev/null +++ b/Domains/ca.mcgill.rtgmrt.example.modes3/build.properties | |||
@@ -0,0 +1,11 @@ | |||
1 | bin.includes = .,\ | ||
2 | model/,\ | ||
3 | META-INF/,\ | ||
4 | plugin.xml,\ | ||
5 | plugin.properties | ||
6 | jars.compile.order = . | ||
7 | source.. = src/,\ | ||
8 | ecore-gen/,\ | ||
9 | vql-gen/,\ | ||
10 | xtend-gen/ | ||
11 | output.. = bin/ | ||
diff --git a/Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/Modes3Factory.java b/Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/Modes3Factory.java new file mode 100644 index 00000000..73188db1 --- /dev/null +++ b/Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/Modes3Factory.java | |||
@@ -0,0 +1,69 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package modes3; | ||
4 | |||
5 | import org.eclipse.emf.ecore.EFactory; | ||
6 | |||
7 | /** | ||
8 | * <!-- begin-user-doc --> | ||
9 | * The <b>Factory</b> for the model. | ||
10 | * It provides a create method for each non-abstract class of the model. | ||
11 | * <!-- end-user-doc --> | ||
12 | * @see modes3.Modes3Package | ||
13 | * @generated | ||
14 | */ | ||
15 | public interface Modes3Factory extends EFactory { | ||
16 | /** | ||
17 | * The singleton instance of the factory. | ||
18 | * <!-- begin-user-doc --> | ||
19 | * <!-- end-user-doc --> | ||
20 | * @generated | ||
21 | */ | ||
22 | Modes3Factory eINSTANCE = modes3.impl.Modes3FactoryImpl.init(); | ||
23 | |||
24 | /** | ||
25 | * Returns a new object of class '<em>Segment</em>'. | ||
26 | * <!-- begin-user-doc --> | ||
27 | * <!-- end-user-doc --> | ||
28 | * @return a new object of class '<em>Segment</em>'. | ||
29 | * @generated | ||
30 | */ | ||
31 | Segment createSegment(); | ||
32 | |||
33 | /** | ||
34 | * Returns a new object of class '<em>Model Root</em>'. | ||
35 | * <!-- begin-user-doc --> | ||
36 | * <!-- end-user-doc --> | ||
37 | * @return a new object of class '<em>Model Root</em>'. | ||
38 | * @generated | ||
39 | */ | ||
40 | Modes3ModelRoot createModes3ModelRoot(); | ||
41 | |||
42 | /** | ||
43 | * Returns a new object of class '<em>Turnout</em>'. | ||
44 | * <!-- begin-user-doc --> | ||
45 | * <!-- end-user-doc --> | ||
46 | * @return a new object of class '<em>Turnout</em>'. | ||
47 | * @generated | ||
48 | */ | ||
49 | Turnout createTurnout(); | ||
50 | |||
51 | /** | ||
52 | * Returns a new object of class '<em>Train</em>'. | ||
53 | * <!-- begin-user-doc --> | ||
54 | * <!-- end-user-doc --> | ||
55 | * @return a new object of class '<em>Train</em>'. | ||
56 | * @generated | ||
57 | */ | ||
58 | Train createTrain(); | ||
59 | |||
60 | /** | ||
61 | * Returns the package supported by this factory. | ||
62 | * <!-- begin-user-doc --> | ||
63 | * <!-- end-user-doc --> | ||
64 | * @return the package supported by this factory. | ||
65 | * @generated | ||
66 | */ | ||
67 | Modes3Package getModes3Package(); | ||
68 | |||
69 | } //Modes3Factory | ||
diff --git a/Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/Modes3ModelRoot.java b/Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/Modes3ModelRoot.java new file mode 100644 index 00000000..4f925b7a --- /dev/null +++ b/Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/Modes3ModelRoot.java | |||
@@ -0,0 +1,87 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package modes3; | ||
4 | |||
5 | import org.eclipse.emf.common.util.EList; | ||
6 | |||
7 | import org.eclipse.emf.ecore.EObject; | ||
8 | |||
9 | /** | ||
10 | * <!-- begin-user-doc --> | ||
11 | * A representation of the model object '<em><b>Model Root</b></em>'. | ||
12 | * <!-- end-user-doc --> | ||
13 | * | ||
14 | * <p> | ||
15 | * The following features are supported: | ||
16 | * </p> | ||
17 | * <ul> | ||
18 | * <li>{@link modes3.Modes3ModelRoot#getId <em>Id</em>}</li> | ||
19 | * <li>{@link modes3.Modes3ModelRoot#getTrains <em>Trains</em>}</li> | ||
20 | * <li>{@link modes3.Modes3ModelRoot#getSegments <em>Segments</em>}</li> | ||
21 | * <li>{@link modes3.Modes3ModelRoot#getTurnouts <em>Turnouts</em>}</li> | ||
22 | * </ul> | ||
23 | * | ||
24 | * @see modes3.Modes3Package#getModes3ModelRoot() | ||
25 | * @model | ||
26 | * @generated | ||
27 | */ | ||
28 | public interface Modes3ModelRoot extends EObject { | ||
29 | /** | ||
30 | * Returns the value of the '<em><b>Id</b></em>' attribute. | ||
31 | * <!-- begin-user-doc --> | ||
32 | * <!-- end-user-doc --> | ||
33 | * @return the value of the '<em>Id</em>' attribute. | ||
34 | * @see #setId(int) | ||
35 | * @see modes3.Modes3Package#getModes3ModelRoot_Id() | ||
36 | * @model | ||
37 | * @generated | ||
38 | */ | ||
39 | int getId(); | ||
40 | |||
41 | /** | ||
42 | * Sets the value of the '{@link modes3.Modes3ModelRoot#getId <em>Id</em>}' attribute. | ||
43 | * <!-- begin-user-doc --> | ||
44 | * <!-- end-user-doc --> | ||
45 | * @param value the new value of the '<em>Id</em>' attribute. | ||
46 | * @see #getId() | ||
47 | * @generated | ||
48 | */ | ||
49 | void setId(int value); | ||
50 | |||
51 | /** | ||
52 | * Returns the value of the '<em><b>Trains</b></em>' containment reference list. | ||
53 | * The list contents are of type {@link modes3.Train}. | ||
54 | * <!-- begin-user-doc --> | ||
55 | * <!-- end-user-doc --> | ||
56 | * @return the value of the '<em>Trains</em>' containment reference list. | ||
57 | * @see modes3.Modes3Package#getModes3ModelRoot_Trains() | ||
58 | * @model containment="true" | ||
59 | * @generated | ||
60 | */ | ||
61 | EList<Train> getTrains(); | ||
62 | |||
63 | /** | ||
64 | * Returns the value of the '<em><b>Segments</b></em>' containment reference list. | ||
65 | * The list contents are of type {@link modes3.Segment}. | ||
66 | * <!-- begin-user-doc --> | ||
67 | * <!-- end-user-doc --> | ||
68 | * @return the value of the '<em>Segments</em>' containment reference list. | ||
69 | * @see modes3.Modes3Package#getModes3ModelRoot_Segments() | ||
70 | * @model containment="true" | ||
71 | * @generated | ||
72 | */ | ||
73 | EList<Segment> getSegments(); | ||
74 | |||
75 | /** | ||
76 | * Returns the value of the '<em><b>Turnouts</b></em>' containment reference list. | ||
77 | * The list contents are of type {@link modes3.Turnout}. | ||
78 | * <!-- begin-user-doc --> | ||
79 | * <!-- end-user-doc --> | ||
80 | * @return the value of the '<em>Turnouts</em>' containment reference list. | ||
81 | * @see modes3.Modes3Package#getModes3ModelRoot_Turnouts() | ||
82 | * @model containment="true" | ||
83 | * @generated | ||
84 | */ | ||
85 | EList<Turnout> getTurnouts(); | ||
86 | |||
87 | } // Modes3ModelRoot | ||
diff --git a/Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/Modes3Package.java b/Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/Modes3Package.java new file mode 100644 index 00000000..4760af9d --- /dev/null +++ b/Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/Modes3Package.java | |||
@@ -0,0 +1,640 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package modes3; | ||
4 | |||
5 | import org.eclipse.emf.ecore.EAttribute; | ||
6 | import org.eclipse.emf.ecore.EClass; | ||
7 | import org.eclipse.emf.ecore.EPackage; | ||
8 | import org.eclipse.emf.ecore.EReference; | ||
9 | |||
10 | /** | ||
11 | * <!-- begin-user-doc --> | ||
12 | * The <b>Package</b> for the model. | ||
13 | * It contains accessors for the meta objects to represent | ||
14 | * <ul> | ||
15 | * <li>each class,</li> | ||
16 | * <li>each feature of each class,</li> | ||
17 | * <li>each operation of each class,</li> | ||
18 | * <li>each enum,</li> | ||
19 | * <li>and each data type</li> | ||
20 | * </ul> | ||
21 | * <!-- end-user-doc --> | ||
22 | * @see modes3.Modes3Factory | ||
23 | * @model kind="package" | ||
24 | * @generated | ||
25 | */ | ||
26 | public interface Modes3Package extends EPackage { | ||
27 | /** | ||
28 | * The package name. | ||
29 | * <!-- begin-user-doc --> | ||
30 | * <!-- end-user-doc --> | ||
31 | * @generated | ||
32 | */ | ||
33 | String eNAME = "modes3"; | ||
34 | |||
35 | /** | ||
36 | * The package namespace URI. | ||
37 | * <!-- begin-user-doc --> | ||
38 | * <!-- end-user-doc --> | ||
39 | * @generated | ||
40 | */ | ||
41 | String eNS_URI = "http://www.ece.mcgill.ca/wcet/modes3"; | ||
42 | |||
43 | /** | ||
44 | * The package namespace name. | ||
45 | * <!-- begin-user-doc --> | ||
46 | * <!-- end-user-doc --> | ||
47 | * @generated | ||
48 | */ | ||
49 | String eNS_PREFIX = "modes3"; | ||
50 | |||
51 | /** | ||
52 | * The singleton instance of the package. | ||
53 | * <!-- begin-user-doc --> | ||
54 | * <!-- end-user-doc --> | ||
55 | * @generated | ||
56 | */ | ||
57 | Modes3Package eINSTANCE = modes3.impl.Modes3PackageImpl.init(); | ||
58 | |||
59 | /** | ||
60 | * The meta object id for the '{@link modes3.impl.SegmentImpl <em>Segment</em>}' class. | ||
61 | * <!-- begin-user-doc --> | ||
62 | * <!-- end-user-doc --> | ||
63 | * @see modes3.impl.SegmentImpl | ||
64 | * @see modes3.impl.Modes3PackageImpl#getSegment() | ||
65 | * @generated | ||
66 | */ | ||
67 | int SEGMENT = 0; | ||
68 | |||
69 | /** | ||
70 | * The feature id for the '<em><b>Connected To</b></em>' reference list. | ||
71 | * <!-- begin-user-doc --> | ||
72 | * <!-- end-user-doc --> | ||
73 | * @generated | ||
74 | * @ordered | ||
75 | */ | ||
76 | int SEGMENT__CONNECTED_TO = 0; | ||
77 | |||
78 | /** | ||
79 | * The feature id for the '<em><b>Occupied By</b></em>' reference. | ||
80 | * <!-- begin-user-doc --> | ||
81 | * <!-- end-user-doc --> | ||
82 | * @generated | ||
83 | * @ordered | ||
84 | */ | ||
85 | int SEGMENT__OCCUPIED_BY = 1; | ||
86 | |||
87 | /** | ||
88 | * The feature id for the '<em><b>Id</b></em>' attribute. | ||
89 | * <!-- begin-user-doc --> | ||
90 | * <!-- end-user-doc --> | ||
91 | * @generated | ||
92 | * @ordered | ||
93 | */ | ||
94 | int SEGMENT__ID = 2; | ||
95 | |||
96 | /** | ||
97 | * The number of structural features of the '<em>Segment</em>' class. | ||
98 | * <!-- begin-user-doc --> | ||
99 | * <!-- end-user-doc --> | ||
100 | * @generated | ||
101 | * @ordered | ||
102 | */ | ||
103 | int SEGMENT_FEATURE_COUNT = 3; | ||
104 | |||
105 | /** | ||
106 | * The number of operations of the '<em>Segment</em>' class. | ||
107 | * <!-- begin-user-doc --> | ||
108 | * <!-- end-user-doc --> | ||
109 | * @generated | ||
110 | * @ordered | ||
111 | */ | ||
112 | int SEGMENT_OPERATION_COUNT = 0; | ||
113 | |||
114 | /** | ||
115 | * The meta object id for the '{@link modes3.impl.Modes3ModelRootImpl <em>Model Root</em>}' class. | ||
116 | * <!-- begin-user-doc --> | ||
117 | * <!-- end-user-doc --> | ||
118 | * @see modes3.impl.Modes3ModelRootImpl | ||
119 | * @see modes3.impl.Modes3PackageImpl#getModes3ModelRoot() | ||
120 | * @generated | ||
121 | */ | ||
122 | int MODES3_MODEL_ROOT = 1; | ||
123 | |||
124 | /** | ||
125 | * The feature id for the '<em><b>Id</b></em>' attribute. | ||
126 | * <!-- begin-user-doc --> | ||
127 | * <!-- end-user-doc --> | ||
128 | * @generated | ||
129 | * @ordered | ||
130 | */ | ||
131 | int MODES3_MODEL_ROOT__ID = 0; | ||
132 | |||
133 | /** | ||
134 | * The feature id for the '<em><b>Trains</b></em>' containment reference list. | ||
135 | * <!-- begin-user-doc --> | ||
136 | * <!-- end-user-doc --> | ||
137 | * @generated | ||
138 | * @ordered | ||
139 | */ | ||
140 | int MODES3_MODEL_ROOT__TRAINS = 1; | ||
141 | |||
142 | /** | ||
143 | * The feature id for the '<em><b>Segments</b></em>' containment reference list. | ||
144 | * <!-- begin-user-doc --> | ||
145 | * <!-- end-user-doc --> | ||
146 | * @generated | ||
147 | * @ordered | ||
148 | */ | ||
149 | int MODES3_MODEL_ROOT__SEGMENTS = 2; | ||
150 | |||
151 | /** | ||
152 | * The feature id for the '<em><b>Turnouts</b></em>' containment reference list. | ||
153 | * <!-- begin-user-doc --> | ||
154 | * <!-- end-user-doc --> | ||
155 | * @generated | ||
156 | * @ordered | ||
157 | */ | ||
158 | int MODES3_MODEL_ROOT__TURNOUTS = 3; | ||
159 | |||
160 | /** | ||
161 | * The number of structural features of the '<em>Model Root</em>' class. | ||
162 | * <!-- begin-user-doc --> | ||
163 | * <!-- end-user-doc --> | ||
164 | * @generated | ||
165 | * @ordered | ||
166 | */ | ||
167 | int MODES3_MODEL_ROOT_FEATURE_COUNT = 4; | ||
168 | |||
169 | /** | ||
170 | * The number of operations of the '<em>Model Root</em>' class. | ||
171 | * <!-- begin-user-doc --> | ||
172 | * <!-- end-user-doc --> | ||
173 | * @generated | ||
174 | * @ordered | ||
175 | */ | ||
176 | int MODES3_MODEL_ROOT_OPERATION_COUNT = 0; | ||
177 | |||
178 | /** | ||
179 | * The meta object id for the '{@link modes3.impl.TurnoutImpl <em>Turnout</em>}' class. | ||
180 | * <!-- begin-user-doc --> | ||
181 | * <!-- end-user-doc --> | ||
182 | * @see modes3.impl.TurnoutImpl | ||
183 | * @see modes3.impl.Modes3PackageImpl#getTurnout() | ||
184 | * @generated | ||
185 | */ | ||
186 | int TURNOUT = 2; | ||
187 | |||
188 | /** | ||
189 | * The feature id for the '<em><b>Connected To</b></em>' reference list. | ||
190 | * <!-- begin-user-doc --> | ||
191 | * <!-- end-user-doc --> | ||
192 | * @generated | ||
193 | * @ordered | ||
194 | */ | ||
195 | int TURNOUT__CONNECTED_TO = SEGMENT__CONNECTED_TO; | ||
196 | |||
197 | /** | ||
198 | * The feature id for the '<em><b>Occupied By</b></em>' reference. | ||
199 | * <!-- begin-user-doc --> | ||
200 | * <!-- end-user-doc --> | ||
201 | * @generated | ||
202 | * @ordered | ||
203 | */ | ||
204 | int TURNOUT__OCCUPIED_BY = SEGMENT__OCCUPIED_BY; | ||
205 | |||
206 | /** | ||
207 | * The feature id for the '<em><b>Id</b></em>' attribute. | ||
208 | * <!-- begin-user-doc --> | ||
209 | * <!-- end-user-doc --> | ||
210 | * @generated | ||
211 | * @ordered | ||
212 | */ | ||
213 | int TURNOUT__ID = SEGMENT__ID; | ||
214 | |||
215 | /** | ||
216 | * The feature id for the '<em><b>Straight</b></em>' reference. | ||
217 | * <!-- begin-user-doc --> | ||
218 | * <!-- end-user-doc --> | ||
219 | * @generated | ||
220 | * @ordered | ||
221 | */ | ||
222 | int TURNOUT__STRAIGHT = SEGMENT_FEATURE_COUNT + 0; | ||
223 | |||
224 | /** | ||
225 | * The feature id for the '<em><b>Divergent</b></em>' reference. | ||
226 | * <!-- begin-user-doc --> | ||
227 | * <!-- end-user-doc --> | ||
228 | * @generated | ||
229 | * @ordered | ||
230 | */ | ||
231 | int TURNOUT__DIVERGENT = SEGMENT_FEATURE_COUNT + 1; | ||
232 | |||
233 | /** | ||
234 | * The number of structural features of the '<em>Turnout</em>' class. | ||
235 | * <!-- begin-user-doc --> | ||
236 | * <!-- end-user-doc --> | ||
237 | * @generated | ||
238 | * @ordered | ||
239 | */ | ||
240 | int TURNOUT_FEATURE_COUNT = SEGMENT_FEATURE_COUNT + 2; | ||
241 | |||
242 | /** | ||
243 | * The number of operations of the '<em>Turnout</em>' class. | ||
244 | * <!-- begin-user-doc --> | ||
245 | * <!-- end-user-doc --> | ||
246 | * @generated | ||
247 | * @ordered | ||
248 | */ | ||
249 | int TURNOUT_OPERATION_COUNT = SEGMENT_OPERATION_COUNT + 0; | ||
250 | |||
251 | /** | ||
252 | * The meta object id for the '{@link modes3.impl.TrainImpl <em>Train</em>}' class. | ||
253 | * <!-- begin-user-doc --> | ||
254 | * <!-- end-user-doc --> | ||
255 | * @see modes3.impl.TrainImpl | ||
256 | * @see modes3.impl.Modes3PackageImpl#getTrain() | ||
257 | * @generated | ||
258 | */ | ||
259 | int TRAIN = 3; | ||
260 | |||
261 | /** | ||
262 | * The feature id for the '<em><b>Location</b></em>' reference. | ||
263 | * <!-- begin-user-doc --> | ||
264 | * <!-- end-user-doc --> | ||
265 | * @generated | ||
266 | * @ordered | ||
267 | */ | ||
268 | int TRAIN__LOCATION = 0; | ||
269 | |||
270 | /** | ||
271 | * The feature id for the '<em><b>Id</b></em>' attribute. | ||
272 | * <!-- begin-user-doc --> | ||
273 | * <!-- end-user-doc --> | ||
274 | * @generated | ||
275 | * @ordered | ||
276 | */ | ||
277 | int TRAIN__ID = 1; | ||
278 | |||
279 | /** | ||
280 | * The feature id for the '<em><b>Speed</b></em>' attribute. | ||
281 | * <!-- begin-user-doc --> | ||
282 | * <!-- end-user-doc --> | ||
283 | * @generated | ||
284 | * @ordered | ||
285 | */ | ||
286 | int TRAIN__SPEED = 2; | ||
287 | |||
288 | /** | ||
289 | * The number of structural features of the '<em>Train</em>' class. | ||
290 | * <!-- begin-user-doc --> | ||
291 | * <!-- end-user-doc --> | ||
292 | * @generated | ||
293 | * @ordered | ||
294 | */ | ||
295 | int TRAIN_FEATURE_COUNT = 3; | ||
296 | |||
297 | /** | ||
298 | * The number of operations of the '<em>Train</em>' class. | ||
299 | * <!-- begin-user-doc --> | ||
300 | * <!-- end-user-doc --> | ||
301 | * @generated | ||
302 | * @ordered | ||
303 | */ | ||
304 | int TRAIN_OPERATION_COUNT = 0; | ||
305 | |||
306 | |||
307 | /** | ||
308 | * Returns the meta object for class '{@link modes3.Segment <em>Segment</em>}'. | ||
309 | * <!-- begin-user-doc --> | ||
310 | * <!-- end-user-doc --> | ||
311 | * @return the meta object for class '<em>Segment</em>'. | ||
312 | * @see modes3.Segment | ||
313 | * @generated | ||
314 | */ | ||
315 | EClass getSegment(); | ||
316 | |||
317 | /** | ||
318 | * Returns the meta object for the reference list '{@link modes3.Segment#getConnectedTo <em>Connected To</em>}'. | ||
319 | * <!-- begin-user-doc --> | ||
320 | * <!-- end-user-doc --> | ||
321 | * @return the meta object for the reference list '<em>Connected To</em>'. | ||
322 | * @see modes3.Segment#getConnectedTo() | ||
323 | * @see #getSegment() | ||
324 | * @generated | ||
325 | */ | ||
326 | EReference getSegment_ConnectedTo(); | ||
327 | |||
328 | /** | ||
329 | * Returns the meta object for the reference '{@link modes3.Segment#getOccupiedBy <em>Occupied By</em>}'. | ||
330 | * <!-- begin-user-doc --> | ||
331 | * <!-- end-user-doc --> | ||
332 | * @return the meta object for the reference '<em>Occupied By</em>'. | ||
333 | * @see modes3.Segment#getOccupiedBy() | ||
334 | * @see #getSegment() | ||
335 | * @generated | ||
336 | */ | ||
337 | EReference getSegment_OccupiedBy(); | ||
338 | |||
339 | /** | ||
340 | * Returns the meta object for the attribute '{@link modes3.Segment#getId <em>Id</em>}'. | ||
341 | * <!-- begin-user-doc --> | ||
342 | * <!-- end-user-doc --> | ||
343 | * @return the meta object for the attribute '<em>Id</em>'. | ||
344 | * @see modes3.Segment#getId() | ||
345 | * @see #getSegment() | ||
346 | * @generated | ||
347 | */ | ||
348 | EAttribute getSegment_Id(); | ||
349 | |||
350 | /** | ||
351 | * Returns the meta object for class '{@link modes3.Modes3ModelRoot <em>Model Root</em>}'. | ||
352 | * <!-- begin-user-doc --> | ||
353 | * <!-- end-user-doc --> | ||
354 | * @return the meta object for class '<em>Model Root</em>'. | ||
355 | * @see modes3.Modes3ModelRoot | ||
356 | * @generated | ||
357 | */ | ||
358 | EClass getModes3ModelRoot(); | ||
359 | |||
360 | /** | ||
361 | * Returns the meta object for the attribute '{@link modes3.Modes3ModelRoot#getId <em>Id</em>}'. | ||
362 | * <!-- begin-user-doc --> | ||
363 | * <!-- end-user-doc --> | ||
364 | * @return the meta object for the attribute '<em>Id</em>'. | ||
365 | * @see modes3.Modes3ModelRoot#getId() | ||
366 | * @see #getModes3ModelRoot() | ||
367 | * @generated | ||
368 | */ | ||
369 | EAttribute getModes3ModelRoot_Id(); | ||
370 | |||
371 | /** | ||
372 | * Returns the meta object for the containment reference list '{@link modes3.Modes3ModelRoot#getTrains <em>Trains</em>}'. | ||
373 | * <!-- begin-user-doc --> | ||
374 | * <!-- end-user-doc --> | ||
375 | * @return the meta object for the containment reference list '<em>Trains</em>'. | ||
376 | * @see modes3.Modes3ModelRoot#getTrains() | ||
377 | * @see #getModes3ModelRoot() | ||
378 | * @generated | ||
379 | */ | ||
380 | EReference getModes3ModelRoot_Trains(); | ||
381 | |||
382 | /** | ||
383 | * Returns the meta object for the containment reference list '{@link modes3.Modes3ModelRoot#getSegments <em>Segments</em>}'. | ||
384 | * <!-- begin-user-doc --> | ||
385 | * <!-- end-user-doc --> | ||
386 | * @return the meta object for the containment reference list '<em>Segments</em>'. | ||
387 | * @see modes3.Modes3ModelRoot#getSegments() | ||
388 | * @see #getModes3ModelRoot() | ||
389 | * @generated | ||
390 | */ | ||
391 | EReference getModes3ModelRoot_Segments(); | ||
392 | |||
393 | /** | ||
394 | * Returns the meta object for the containment reference list '{@link modes3.Modes3ModelRoot#getTurnouts <em>Turnouts</em>}'. | ||
395 | * <!-- begin-user-doc --> | ||
396 | * <!-- end-user-doc --> | ||
397 | * @return the meta object for the containment reference list '<em>Turnouts</em>'. | ||
398 | * @see modes3.Modes3ModelRoot#getTurnouts() | ||
399 | * @see #getModes3ModelRoot() | ||
400 | * @generated | ||
401 | */ | ||
402 | EReference getModes3ModelRoot_Turnouts(); | ||
403 | |||
404 | /** | ||
405 | * Returns the meta object for class '{@link modes3.Turnout <em>Turnout</em>}'. | ||
406 | * <!-- begin-user-doc --> | ||
407 | * <!-- end-user-doc --> | ||
408 | * @return the meta object for class '<em>Turnout</em>'. | ||
409 | * @see modes3.Turnout | ||
410 | * @generated | ||
411 | */ | ||
412 | EClass getTurnout(); | ||
413 | |||
414 | /** | ||
415 | * Returns the meta object for the reference '{@link modes3.Turnout#getStraight <em>Straight</em>}'. | ||
416 | * <!-- begin-user-doc --> | ||
417 | * <!-- end-user-doc --> | ||
418 | * @return the meta object for the reference '<em>Straight</em>'. | ||
419 | * @see modes3.Turnout#getStraight() | ||
420 | * @see #getTurnout() | ||
421 | * @generated | ||
422 | */ | ||
423 | EReference getTurnout_Straight(); | ||
424 | |||
425 | /** | ||
426 | * Returns the meta object for the reference '{@link modes3.Turnout#getDivergent <em>Divergent</em>}'. | ||
427 | * <!-- begin-user-doc --> | ||
428 | * <!-- end-user-doc --> | ||
429 | * @return the meta object for the reference '<em>Divergent</em>'. | ||
430 | * @see modes3.Turnout#getDivergent() | ||
431 | * @see #getTurnout() | ||
432 | * @generated | ||
433 | */ | ||
434 | EReference getTurnout_Divergent(); | ||
435 | |||
436 | /** | ||
437 | * Returns the meta object for class '{@link modes3.Train <em>Train</em>}'. | ||
438 | * <!-- begin-user-doc --> | ||
439 | * <!-- end-user-doc --> | ||
440 | * @return the meta object for class '<em>Train</em>'. | ||
441 | * @see modes3.Train | ||
442 | * @generated | ||
443 | */ | ||
444 | EClass getTrain(); | ||
445 | |||
446 | /** | ||
447 | * Returns the meta object for the reference '{@link modes3.Train#getLocation <em>Location</em>}'. | ||
448 | * <!-- begin-user-doc --> | ||
449 | * <!-- end-user-doc --> | ||
450 | * @return the meta object for the reference '<em>Location</em>'. | ||
451 | * @see modes3.Train#getLocation() | ||
452 | * @see #getTrain() | ||
453 | * @generated | ||
454 | */ | ||
455 | EReference getTrain_Location(); | ||
456 | |||
457 | /** | ||
458 | * Returns the meta object for the attribute '{@link modes3.Train#getId <em>Id</em>}'. | ||
459 | * <!-- begin-user-doc --> | ||
460 | * <!-- end-user-doc --> | ||
461 | * @return the meta object for the attribute '<em>Id</em>'. | ||
462 | * @see modes3.Train#getId() | ||
463 | * @see #getTrain() | ||
464 | * @generated | ||
465 | */ | ||
466 | EAttribute getTrain_Id(); | ||
467 | |||
468 | /** | ||
469 | * Returns the meta object for the attribute '{@link modes3.Train#getSpeed <em>Speed</em>}'. | ||
470 | * <!-- begin-user-doc --> | ||
471 | * <!-- end-user-doc --> | ||
472 | * @return the meta object for the attribute '<em>Speed</em>'. | ||
473 | * @see modes3.Train#getSpeed() | ||
474 | * @see #getTrain() | ||
475 | * @generated | ||
476 | */ | ||
477 | EAttribute getTrain_Speed(); | ||
478 | |||
479 | /** | ||
480 | * Returns the factory that creates the instances of the model. | ||
481 | * <!-- begin-user-doc --> | ||
482 | * <!-- end-user-doc --> | ||
483 | * @return the factory that creates the instances of the model. | ||
484 | * @generated | ||
485 | */ | ||
486 | Modes3Factory getModes3Factory(); | ||
487 | |||
488 | /** | ||
489 | * <!-- begin-user-doc --> | ||
490 | * Defines literals for the meta objects that represent | ||
491 | * <ul> | ||
492 | * <li>each class,</li> | ||
493 | * <li>each feature of each class,</li> | ||
494 | * <li>each operation of each class,</li> | ||
495 | * <li>each enum,</li> | ||
496 | * <li>and each data type</li> | ||
497 | * </ul> | ||
498 | * <!-- end-user-doc --> | ||
499 | * @generated | ||
500 | */ | ||
501 | interface Literals { | ||
502 | /** | ||
503 | * The meta object literal for the '{@link modes3.impl.SegmentImpl <em>Segment</em>}' class. | ||
504 | * <!-- begin-user-doc --> | ||
505 | * <!-- end-user-doc --> | ||
506 | * @see modes3.impl.SegmentImpl | ||
507 | * @see modes3.impl.Modes3PackageImpl#getSegment() | ||
508 | * @generated | ||
509 | */ | ||
510 | EClass SEGMENT = eINSTANCE.getSegment(); | ||
511 | |||
512 | /** | ||
513 | * The meta object literal for the '<em><b>Connected To</b></em>' reference list feature. | ||
514 | * <!-- begin-user-doc --> | ||
515 | * <!-- end-user-doc --> | ||
516 | * @generated | ||
517 | */ | ||
518 | EReference SEGMENT__CONNECTED_TO = eINSTANCE.getSegment_ConnectedTo(); | ||
519 | |||
520 | /** | ||
521 | * The meta object literal for the '<em><b>Occupied By</b></em>' reference feature. | ||
522 | * <!-- begin-user-doc --> | ||
523 | * <!-- end-user-doc --> | ||
524 | * @generated | ||
525 | */ | ||
526 | EReference SEGMENT__OCCUPIED_BY = eINSTANCE.getSegment_OccupiedBy(); | ||
527 | |||
528 | /** | ||
529 | * The meta object literal for the '<em><b>Id</b></em>' attribute feature. | ||
530 | * <!-- begin-user-doc --> | ||
531 | * <!-- end-user-doc --> | ||
532 | * @generated | ||
533 | */ | ||
534 | EAttribute SEGMENT__ID = eINSTANCE.getSegment_Id(); | ||
535 | |||
536 | /** | ||
537 | * The meta object literal for the '{@link modes3.impl.Modes3ModelRootImpl <em>Model Root</em>}' class. | ||
538 | * <!-- begin-user-doc --> | ||
539 | * <!-- end-user-doc --> | ||
540 | * @see modes3.impl.Modes3ModelRootImpl | ||
541 | * @see modes3.impl.Modes3PackageImpl#getModes3ModelRoot() | ||
542 | * @generated | ||
543 | */ | ||
544 | EClass MODES3_MODEL_ROOT = eINSTANCE.getModes3ModelRoot(); | ||
545 | |||
546 | /** | ||
547 | * The meta object literal for the '<em><b>Id</b></em>' attribute feature. | ||
548 | * <!-- begin-user-doc --> | ||
549 | * <!-- end-user-doc --> | ||
550 | * @generated | ||
551 | */ | ||
552 | EAttribute MODES3_MODEL_ROOT__ID = eINSTANCE.getModes3ModelRoot_Id(); | ||
553 | |||
554 | /** | ||
555 | * The meta object literal for the '<em><b>Trains</b></em>' containment reference list feature. | ||
556 | * <!-- begin-user-doc --> | ||
557 | * <!-- end-user-doc --> | ||
558 | * @generated | ||
559 | */ | ||
560 | EReference MODES3_MODEL_ROOT__TRAINS = eINSTANCE.getModes3ModelRoot_Trains(); | ||
561 | |||
562 | /** | ||
563 | * The meta object literal for the '<em><b>Segments</b></em>' containment reference list feature. | ||
564 | * <!-- begin-user-doc --> | ||
565 | * <!-- end-user-doc --> | ||
566 | * @generated | ||
567 | */ | ||
568 | EReference MODES3_MODEL_ROOT__SEGMENTS = eINSTANCE.getModes3ModelRoot_Segments(); | ||
569 | |||
570 | /** | ||
571 | * The meta object literal for the '<em><b>Turnouts</b></em>' containment reference list feature. | ||
572 | * <!-- begin-user-doc --> | ||
573 | * <!-- end-user-doc --> | ||
574 | * @generated | ||
575 | */ | ||
576 | EReference MODES3_MODEL_ROOT__TURNOUTS = eINSTANCE.getModes3ModelRoot_Turnouts(); | ||
577 | |||
578 | /** | ||
579 | * The meta object literal for the '{@link modes3.impl.TurnoutImpl <em>Turnout</em>}' class. | ||
580 | * <!-- begin-user-doc --> | ||
581 | * <!-- end-user-doc --> | ||
582 | * @see modes3.impl.TurnoutImpl | ||
583 | * @see modes3.impl.Modes3PackageImpl#getTurnout() | ||
584 | * @generated | ||
585 | */ | ||
586 | EClass TURNOUT = eINSTANCE.getTurnout(); | ||
587 | |||
588 | /** | ||
589 | * The meta object literal for the '<em><b>Straight</b></em>' reference feature. | ||
590 | * <!-- begin-user-doc --> | ||
591 | * <!-- end-user-doc --> | ||
592 | * @generated | ||
593 | */ | ||
594 | EReference TURNOUT__STRAIGHT = eINSTANCE.getTurnout_Straight(); | ||
595 | |||
596 | /** | ||
597 | * The meta object literal for the '<em><b>Divergent</b></em>' reference feature. | ||
598 | * <!-- begin-user-doc --> | ||
599 | * <!-- end-user-doc --> | ||
600 | * @generated | ||
601 | */ | ||
602 | EReference TURNOUT__DIVERGENT = eINSTANCE.getTurnout_Divergent(); | ||
603 | |||
604 | /** | ||
605 | * The meta object literal for the '{@link modes3.impl.TrainImpl <em>Train</em>}' class. | ||
606 | * <!-- begin-user-doc --> | ||
607 | * <!-- end-user-doc --> | ||
608 | * @see modes3.impl.TrainImpl | ||
609 | * @see modes3.impl.Modes3PackageImpl#getTrain() | ||
610 | * @generated | ||
611 | */ | ||
612 | EClass TRAIN = eINSTANCE.getTrain(); | ||
613 | |||
614 | /** | ||
615 | * The meta object literal for the '<em><b>Location</b></em>' reference feature. | ||
616 | * <!-- begin-user-doc --> | ||
617 | * <!-- end-user-doc --> | ||
618 | * @generated | ||
619 | */ | ||
620 | EReference TRAIN__LOCATION = eINSTANCE.getTrain_Location(); | ||
621 | |||
622 | /** | ||
623 | * The meta object literal for the '<em><b>Id</b></em>' attribute feature. | ||
624 | * <!-- begin-user-doc --> | ||
625 | * <!-- end-user-doc --> | ||
626 | * @generated | ||
627 | */ | ||
628 | EAttribute TRAIN__ID = eINSTANCE.getTrain_Id(); | ||
629 | |||
630 | /** | ||
631 | * The meta object literal for the '<em><b>Speed</b></em>' attribute feature. | ||
632 | * <!-- begin-user-doc --> | ||
633 | * <!-- end-user-doc --> | ||
634 | * @generated | ||
635 | */ | ||
636 | EAttribute TRAIN__SPEED = eINSTANCE.getTrain_Speed(); | ||
637 | |||
638 | } | ||
639 | |||
640 | } //Modes3Package | ||
diff --git a/Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/Segment.java b/Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/Segment.java new file mode 100644 index 00000000..002f25a5 --- /dev/null +++ b/Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/Segment.java | |||
@@ -0,0 +1,86 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package modes3; | ||
4 | |||
5 | import org.eclipse.emf.common.util.EList; | ||
6 | |||
7 | import org.eclipse.emf.ecore.EObject; | ||
8 | |||
9 | /** | ||
10 | * <!-- begin-user-doc --> | ||
11 | * A representation of the model object '<em><b>Segment</b></em>'. | ||
12 | * <!-- end-user-doc --> | ||
13 | * | ||
14 | * <p> | ||
15 | * The following features are supported: | ||
16 | * </p> | ||
17 | * <ul> | ||
18 | * <li>{@link modes3.Segment#getConnectedTo <em>Connected To</em>}</li> | ||
19 | * <li>{@link modes3.Segment#getOccupiedBy <em>Occupied By</em>}</li> | ||
20 | * <li>{@link modes3.Segment#getId <em>Id</em>}</li> | ||
21 | * </ul> | ||
22 | * | ||
23 | * @see modes3.Modes3Package#getSegment() | ||
24 | * @model | ||
25 | * @generated | ||
26 | */ | ||
27 | public interface Segment extends EObject { | ||
28 | /** | ||
29 | * Returns the value of the '<em><b>Connected To</b></em>' reference list. | ||
30 | * The list contents are of type {@link modes3.Segment}. | ||
31 | * <!-- begin-user-doc --> | ||
32 | * <!-- end-user-doc --> | ||
33 | * @return the value of the '<em>Connected To</em>' reference list. | ||
34 | * @see modes3.Modes3Package#getSegment_ConnectedTo() | ||
35 | * @model upper="2" | ||
36 | * @generated | ||
37 | */ | ||
38 | EList<Segment> getConnectedTo(); | ||
39 | |||
40 | /** | ||
41 | * Returns the value of the '<em><b>Occupied By</b></em>' reference. | ||
42 | * It is bidirectional and its opposite is '{@link modes3.Train#getLocation <em>Location</em>}'. | ||
43 | * <!-- begin-user-doc --> | ||
44 | * <!-- end-user-doc --> | ||
45 | * @return the value of the '<em>Occupied By</em>' reference. | ||
46 | * @see #setOccupiedBy(Train) | ||
47 | * @see modes3.Modes3Package#getSegment_OccupiedBy() | ||
48 | * @see modes3.Train#getLocation | ||
49 | * @model opposite="location" | ||
50 | * @generated | ||
51 | */ | ||
52 | Train getOccupiedBy(); | ||
53 | |||
54 | /** | ||
55 | * Sets the value of the '{@link modes3.Segment#getOccupiedBy <em>Occupied By</em>}' reference. | ||
56 | * <!-- begin-user-doc --> | ||
57 | * <!-- end-user-doc --> | ||
58 | * @param value the new value of the '<em>Occupied By</em>' reference. | ||
59 | * @see #getOccupiedBy() | ||
60 | * @generated | ||
61 | */ | ||
62 | void setOccupiedBy(Train value); | ||
63 | |||
64 | /** | ||
65 | * Returns the value of the '<em><b>Id</b></em>' attribute. | ||
66 | * <!-- begin-user-doc --> | ||
67 | * <!-- end-user-doc --> | ||
68 | * @return the value of the '<em>Id</em>' attribute. | ||
69 | * @see #setId(int) | ||
70 | * @see modes3.Modes3Package#getSegment_Id() | ||
71 | * @model | ||
72 | * @generated | ||
73 | */ | ||
74 | int getId(); | ||
75 | |||
76 | /** | ||
77 | * Sets the value of the '{@link modes3.Segment#getId <em>Id</em>}' attribute. | ||
78 | * <!-- begin-user-doc --> | ||
79 | * <!-- end-user-doc --> | ||
80 | * @param value the new value of the '<em>Id</em>' attribute. | ||
81 | * @see #getId() | ||
82 | * @generated | ||
83 | */ | ||
84 | void setId(int value); | ||
85 | |||
86 | } // Segment | ||
diff --git a/Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/Train.java b/Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/Train.java new file mode 100644 index 00000000..1829586d --- /dev/null +++ b/Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/Train.java | |||
@@ -0,0 +1,94 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package modes3; | ||
4 | |||
5 | import org.eclipse.emf.ecore.EObject; | ||
6 | |||
7 | /** | ||
8 | * <!-- begin-user-doc --> | ||
9 | * A representation of the model object '<em><b>Train</b></em>'. | ||
10 | * <!-- end-user-doc --> | ||
11 | * | ||
12 | * <p> | ||
13 | * The following features are supported: | ||
14 | * </p> | ||
15 | * <ul> | ||
16 | * <li>{@link modes3.Train#getLocation <em>Location</em>}</li> | ||
17 | * <li>{@link modes3.Train#getId <em>Id</em>}</li> | ||
18 | * <li>{@link modes3.Train#getSpeed <em>Speed</em>}</li> | ||
19 | * </ul> | ||
20 | * | ||
21 | * @see modes3.Modes3Package#getTrain() | ||
22 | * @model | ||
23 | * @generated | ||
24 | */ | ||
25 | public interface Train extends EObject { | ||
26 | /** | ||
27 | * Returns the value of the '<em><b>Location</b></em>' reference. | ||
28 | * It is bidirectional and its opposite is '{@link modes3.Segment#getOccupiedBy <em>Occupied By</em>}'. | ||
29 | * <!-- begin-user-doc --> | ||
30 | * <!-- end-user-doc --> | ||
31 | * @return the value of the '<em>Location</em>' reference. | ||
32 | * @see #setLocation(Segment) | ||
33 | * @see modes3.Modes3Package#getTrain_Location() | ||
34 | * @see modes3.Segment#getOccupiedBy | ||
35 | * @model opposite="occupiedBy" required="true" | ||
36 | * @generated | ||
37 | */ | ||
38 | Segment getLocation(); | ||
39 | |||
40 | /** | ||
41 | * Sets the value of the '{@link modes3.Train#getLocation <em>Location</em>}' reference. | ||
42 | * <!-- begin-user-doc --> | ||
43 | * <!-- end-user-doc --> | ||
44 | * @param value the new value of the '<em>Location</em>' reference. | ||
45 | * @see #getLocation() | ||
46 | * @generated | ||
47 | */ | ||
48 | void setLocation(Segment value); | ||
49 | |||
50 | /** | ||
51 | * Returns the value of the '<em><b>Id</b></em>' attribute. | ||
52 | * <!-- begin-user-doc --> | ||
53 | * <!-- end-user-doc --> | ||
54 | * @return the value of the '<em>Id</em>' attribute. | ||
55 | * @see #setId(int) | ||
56 | * @see modes3.Modes3Package#getTrain_Id() | ||
57 | * @model | ||
58 | * @generated | ||
59 | */ | ||
60 | int getId(); | ||
61 | |||
62 | /** | ||
63 | * Sets the value of the '{@link modes3.Train#getId <em>Id</em>}' attribute. | ||
64 | * <!-- begin-user-doc --> | ||
65 | * <!-- end-user-doc --> | ||
66 | * @param value the new value of the '<em>Id</em>' attribute. | ||
67 | * @see #getId() | ||
68 | * @generated | ||
69 | */ | ||
70 | void setId(int value); | ||
71 | |||
72 | /** | ||
73 | * Returns the value of the '<em><b>Speed</b></em>' attribute. | ||
74 | * <!-- begin-user-doc --> | ||
75 | * <!-- end-user-doc --> | ||
76 | * @return the value of the '<em>Speed</em>' attribute. | ||
77 | * @see #setSpeed(double) | ||
78 | * @see modes3.Modes3Package#getTrain_Speed() | ||
79 | * @model | ||
80 | * @generated | ||
81 | */ | ||
82 | double getSpeed(); | ||
83 | |||
84 | /** | ||
85 | * Sets the value of the '{@link modes3.Train#getSpeed <em>Speed</em>}' attribute. | ||
86 | * <!-- begin-user-doc --> | ||
87 | * <!-- end-user-doc --> | ||
88 | * @param value the new value of the '<em>Speed</em>' attribute. | ||
89 | * @see #getSpeed() | ||
90 | * @generated | ||
91 | */ | ||
92 | void setSpeed(double value); | ||
93 | |||
94 | } // Train | ||
diff --git a/Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/Turnout.java b/Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/Turnout.java new file mode 100644 index 00000000..799f8d7b --- /dev/null +++ b/Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/Turnout.java | |||
@@ -0,0 +1,68 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package modes3; | ||
4 | |||
5 | |||
6 | /** | ||
7 | * <!-- begin-user-doc --> | ||
8 | * A representation of the model object '<em><b>Turnout</b></em>'. | ||
9 | * <!-- end-user-doc --> | ||
10 | * | ||
11 | * <p> | ||
12 | * The following features are supported: | ||
13 | * </p> | ||
14 | * <ul> | ||
15 | * <li>{@link modes3.Turnout#getStraight <em>Straight</em>}</li> | ||
16 | * <li>{@link modes3.Turnout#getDivergent <em>Divergent</em>}</li> | ||
17 | * </ul> | ||
18 | * | ||
19 | * @see modes3.Modes3Package#getTurnout() | ||
20 | * @model | ||
21 | * @generated | ||
22 | */ | ||
23 | public interface Turnout extends Segment { | ||
24 | /** | ||
25 | * Returns the value of the '<em><b>Straight</b></em>' reference. | ||
26 | * <!-- begin-user-doc --> | ||
27 | * <!-- end-user-doc --> | ||
28 | * @return the value of the '<em>Straight</em>' reference. | ||
29 | * @see #setStraight(Segment) | ||
30 | * @see modes3.Modes3Package#getTurnout_Straight() | ||
31 | * @model required="true" | ||
32 | * @generated | ||
33 | */ | ||
34 | Segment getStraight(); | ||
35 | |||
36 | /** | ||
37 | * Sets the value of the '{@link modes3.Turnout#getStraight <em>Straight</em>}' reference. | ||
38 | * <!-- begin-user-doc --> | ||
39 | * <!-- end-user-doc --> | ||
40 | * @param value the new value of the '<em>Straight</em>' reference. | ||
41 | * @see #getStraight() | ||
42 | * @generated | ||
43 | */ | ||
44 | void setStraight(Segment value); | ||
45 | |||
46 | /** | ||
47 | * Returns the value of the '<em><b>Divergent</b></em>' reference. | ||
48 | * <!-- begin-user-doc --> | ||
49 | * <!-- end-user-doc --> | ||
50 | * @return the value of the '<em>Divergent</em>' reference. | ||
51 | * @see #setDivergent(Segment) | ||
52 | * @see modes3.Modes3Package#getTurnout_Divergent() | ||
53 | * @model required="true" | ||
54 | * @generated | ||
55 | */ | ||
56 | Segment getDivergent(); | ||
57 | |||
58 | /** | ||
59 | * Sets the value of the '{@link modes3.Turnout#getDivergent <em>Divergent</em>}' reference. | ||
60 | * <!-- begin-user-doc --> | ||
61 | * <!-- end-user-doc --> | ||
62 | * @param value the new value of the '<em>Divergent</em>' reference. | ||
63 | * @see #getDivergent() | ||
64 | * @generated | ||
65 | */ | ||
66 | void setDivergent(Segment value); | ||
67 | |||
68 | } // Turnout | ||
diff --git a/Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/impl/Modes3FactoryImpl.java b/Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/impl/Modes3FactoryImpl.java new file mode 100644 index 00000000..6ec86cb6 --- /dev/null +++ b/Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/impl/Modes3FactoryImpl.java | |||
@@ -0,0 +1,128 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package modes3.impl; | ||
4 | |||
5 | import modes3.*; | ||
6 | |||
7 | import org.eclipse.emf.ecore.EClass; | ||
8 | import org.eclipse.emf.ecore.EObject; | ||
9 | import org.eclipse.emf.ecore.EPackage; | ||
10 | |||
11 | import org.eclipse.emf.ecore.impl.EFactoryImpl; | ||
12 | |||
13 | import org.eclipse.emf.ecore.plugin.EcorePlugin; | ||
14 | |||
15 | /** | ||
16 | * <!-- begin-user-doc --> | ||
17 | * An implementation of the model <b>Factory</b>. | ||
18 | * <!-- end-user-doc --> | ||
19 | * @generated | ||
20 | */ | ||
21 | public class Modes3FactoryImpl extends EFactoryImpl implements Modes3Factory { | ||
22 | /** | ||
23 | * Creates the default factory implementation. | ||
24 | * <!-- begin-user-doc --> | ||
25 | * <!-- end-user-doc --> | ||
26 | * @generated | ||
27 | */ | ||
28 | public static Modes3Factory init() { | ||
29 | try { | ||
30 | Modes3Factory theModes3Factory = (Modes3Factory)EPackage.Registry.INSTANCE.getEFactory(Modes3Package.eNS_URI); | ||
31 | if (theModes3Factory != null) { | ||
32 | return theModes3Factory; | ||
33 | } | ||
34 | } | ||
35 | catch (Exception exception) { | ||
36 | EcorePlugin.INSTANCE.log(exception); | ||
37 | } | ||
38 | return new Modes3FactoryImpl(); | ||
39 | } | ||
40 | |||
41 | /** | ||
42 | * Creates an instance of the factory. | ||
43 | * <!-- begin-user-doc --> | ||
44 | * <!-- end-user-doc --> | ||
45 | * @generated | ||
46 | */ | ||
47 | public Modes3FactoryImpl() { | ||
48 | super(); | ||
49 | } | ||
50 | |||
51 | /** | ||
52 | * <!-- begin-user-doc --> | ||
53 | * <!-- end-user-doc --> | ||
54 | * @generated | ||
55 | */ | ||
56 | @Override | ||
57 | public EObject create(EClass eClass) { | ||
58 | switch (eClass.getClassifierID()) { | ||
59 | case Modes3Package.SEGMENT: return createSegment(); | ||
60 | case Modes3Package.MODES3_MODEL_ROOT: return createModes3ModelRoot(); | ||
61 | case Modes3Package.TURNOUT: return createTurnout(); | ||
62 | case Modes3Package.TRAIN: return createTrain(); | ||
63 | default: | ||
64 | throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); | ||
65 | } | ||
66 | } | ||
67 | |||
68 | /** | ||
69 | * <!-- begin-user-doc --> | ||
70 | * <!-- end-user-doc --> | ||
71 | * @generated | ||
72 | */ | ||
73 | public Segment createSegment() { | ||
74 | SegmentImpl segment = new SegmentImpl(); | ||
75 | return segment; | ||
76 | } | ||
77 | |||
78 | /** | ||
79 | * <!-- begin-user-doc --> | ||
80 | * <!-- end-user-doc --> | ||
81 | * @generated | ||
82 | */ | ||
83 | public Modes3ModelRoot createModes3ModelRoot() { | ||
84 | Modes3ModelRootImpl modes3ModelRoot = new Modes3ModelRootImpl(); | ||
85 | return modes3ModelRoot; | ||
86 | } | ||
87 | |||
88 | /** | ||
89 | * <!-- begin-user-doc --> | ||
90 | * <!-- end-user-doc --> | ||
91 | * @generated | ||
92 | */ | ||
93 | public Turnout createTurnout() { | ||
94 | TurnoutImpl turnout = new TurnoutImpl(); | ||
95 | return turnout; | ||
96 | } | ||
97 | |||
98 | /** | ||
99 | * <!-- begin-user-doc --> | ||
100 | * <!-- end-user-doc --> | ||
101 | * @generated | ||
102 | */ | ||
103 | public Train createTrain() { | ||
104 | TrainImpl train = new TrainImpl(); | ||
105 | return train; | ||
106 | } | ||
107 | |||
108 | /** | ||
109 | * <!-- begin-user-doc --> | ||
110 | * <!-- end-user-doc --> | ||
111 | * @generated | ||
112 | */ | ||
113 | public Modes3Package getModes3Package() { | ||
114 | return (Modes3Package)getEPackage(); | ||
115 | } | ||
116 | |||
117 | /** | ||
118 | * <!-- begin-user-doc --> | ||
119 | * <!-- end-user-doc --> | ||
120 | * @deprecated | ||
121 | * @generated | ||
122 | */ | ||
123 | @Deprecated | ||
124 | public static Modes3Package getPackage() { | ||
125 | return Modes3Package.eINSTANCE; | ||
126 | } | ||
127 | |||
128 | } //Modes3FactoryImpl | ||
diff --git a/Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/impl/Modes3ModelRootImpl.java b/Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/impl/Modes3ModelRootImpl.java new file mode 100644 index 00000000..d1ee25ff --- /dev/null +++ b/Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/impl/Modes3ModelRootImpl.java | |||
@@ -0,0 +1,296 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package modes3.impl; | ||
4 | |||
5 | import java.util.Collection; | ||
6 | |||
7 | import modes3.Modes3ModelRoot; | ||
8 | import modes3.Modes3Package; | ||
9 | import modes3.Segment; | ||
10 | import modes3.Train; | ||
11 | import modes3.Turnout; | ||
12 | |||
13 | import org.eclipse.emf.common.notify.Notification; | ||
14 | import org.eclipse.emf.common.notify.NotificationChain; | ||
15 | |||
16 | import org.eclipse.emf.common.util.EList; | ||
17 | |||
18 | import org.eclipse.emf.ecore.EClass; | ||
19 | import org.eclipse.emf.ecore.InternalEObject; | ||
20 | |||
21 | import org.eclipse.emf.ecore.impl.ENotificationImpl; | ||
22 | import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; | ||
23 | |||
24 | import org.eclipse.emf.ecore.util.EObjectContainmentEList; | ||
25 | import org.eclipse.emf.ecore.util.InternalEList; | ||
26 | |||
27 | /** | ||
28 | * <!-- begin-user-doc --> | ||
29 | * An implementation of the model object '<em><b>Model Root</b></em>'. | ||
30 | * <!-- end-user-doc --> | ||
31 | * <p> | ||
32 | * The following features are implemented: | ||
33 | * </p> | ||
34 | * <ul> | ||
35 | * <li>{@link modes3.impl.Modes3ModelRootImpl#getId <em>Id</em>}</li> | ||
36 | * <li>{@link modes3.impl.Modes3ModelRootImpl#getTrains <em>Trains</em>}</li> | ||
37 | * <li>{@link modes3.impl.Modes3ModelRootImpl#getSegments <em>Segments</em>}</li> | ||
38 | * <li>{@link modes3.impl.Modes3ModelRootImpl#getTurnouts <em>Turnouts</em>}</li> | ||
39 | * </ul> | ||
40 | * | ||
41 | * @generated | ||
42 | */ | ||
43 | public class Modes3ModelRootImpl extends MinimalEObjectImpl.Container implements Modes3ModelRoot { | ||
44 | /** | ||
45 | * The default value of the '{@link #getId() <em>Id</em>}' attribute. | ||
46 | * <!-- begin-user-doc --> | ||
47 | * <!-- end-user-doc --> | ||
48 | * @see #getId() | ||
49 | * @generated | ||
50 | * @ordered | ||
51 | */ | ||
52 | protected static final int ID_EDEFAULT = 0; | ||
53 | |||
54 | /** | ||
55 | * The cached value of the '{@link #getId() <em>Id</em>}' attribute. | ||
56 | * <!-- begin-user-doc --> | ||
57 | * <!-- end-user-doc --> | ||
58 | * @see #getId() | ||
59 | * @generated | ||
60 | * @ordered | ||
61 | */ | ||
62 | protected int id = ID_EDEFAULT; | ||
63 | |||
64 | /** | ||
65 | * The cached value of the '{@link #getTrains() <em>Trains</em>}' containment reference list. | ||
66 | * <!-- begin-user-doc --> | ||
67 | * <!-- end-user-doc --> | ||
68 | * @see #getTrains() | ||
69 | * @generated | ||
70 | * @ordered | ||
71 | */ | ||
72 | protected EList<Train> trains; | ||
73 | |||
74 | /** | ||
75 | * The cached value of the '{@link #getSegments() <em>Segments</em>}' containment reference list. | ||
76 | * <!-- begin-user-doc --> | ||
77 | * <!-- end-user-doc --> | ||
78 | * @see #getSegments() | ||
79 | * @generated | ||
80 | * @ordered | ||
81 | */ | ||
82 | protected EList<Segment> segments; | ||
83 | |||
84 | /** | ||
85 | * The cached value of the '{@link #getTurnouts() <em>Turnouts</em>}' containment reference list. | ||
86 | * <!-- begin-user-doc --> | ||
87 | * <!-- end-user-doc --> | ||
88 | * @see #getTurnouts() | ||
89 | * @generated | ||
90 | * @ordered | ||
91 | */ | ||
92 | protected EList<Turnout> turnouts; | ||
93 | |||
94 | /** | ||
95 | * <!-- begin-user-doc --> | ||
96 | * <!-- end-user-doc --> | ||
97 | * @generated | ||
98 | */ | ||
99 | protected Modes3ModelRootImpl() { | ||
100 | super(); | ||
101 | } | ||
102 | |||
103 | /** | ||
104 | * <!-- begin-user-doc --> | ||
105 | * <!-- end-user-doc --> | ||
106 | * @generated | ||
107 | */ | ||
108 | @Override | ||
109 | protected EClass eStaticClass() { | ||
110 | return Modes3Package.Literals.MODES3_MODEL_ROOT; | ||
111 | } | ||
112 | |||
113 | /** | ||
114 | * <!-- begin-user-doc --> | ||
115 | * <!-- end-user-doc --> | ||
116 | * @generated | ||
117 | */ | ||
118 | public int getId() { | ||
119 | return id; | ||
120 | } | ||
121 | |||
122 | /** | ||
123 | * <!-- begin-user-doc --> | ||
124 | * <!-- end-user-doc --> | ||
125 | * @generated | ||
126 | */ | ||
127 | public void setId(int newId) { | ||
128 | int oldId = id; | ||
129 | id = newId; | ||
130 | if (eNotificationRequired()) | ||
131 | eNotify(new ENotificationImpl(this, Notification.SET, Modes3Package.MODES3_MODEL_ROOT__ID, oldId, id)); | ||
132 | } | ||
133 | |||
134 | /** | ||
135 | * <!-- begin-user-doc --> | ||
136 | * <!-- end-user-doc --> | ||
137 | * @generated | ||
138 | */ | ||
139 | public EList<Train> getTrains() { | ||
140 | if (trains == null) { | ||
141 | trains = new EObjectContainmentEList<Train>(Train.class, this, Modes3Package.MODES3_MODEL_ROOT__TRAINS); | ||
142 | } | ||
143 | return trains; | ||
144 | } | ||
145 | |||
146 | /** | ||
147 | * <!-- begin-user-doc --> | ||
148 | * <!-- end-user-doc --> | ||
149 | * @generated | ||
150 | */ | ||
151 | public EList<Segment> getSegments() { | ||
152 | if (segments == null) { | ||
153 | segments = new EObjectContainmentEList<Segment>(Segment.class, this, Modes3Package.MODES3_MODEL_ROOT__SEGMENTS); | ||
154 | } | ||
155 | return segments; | ||
156 | } | ||
157 | |||
158 | /** | ||
159 | * <!-- begin-user-doc --> | ||
160 | * <!-- end-user-doc --> | ||
161 | * @generated | ||
162 | */ | ||
163 | public EList<Turnout> getTurnouts() { | ||
164 | if (turnouts == null) { | ||
165 | turnouts = new EObjectContainmentEList<Turnout>(Turnout.class, this, Modes3Package.MODES3_MODEL_ROOT__TURNOUTS); | ||
166 | } | ||
167 | return turnouts; | ||
168 | } | ||
169 | |||
170 | /** | ||
171 | * <!-- begin-user-doc --> | ||
172 | * <!-- end-user-doc --> | ||
173 | * @generated | ||
174 | */ | ||
175 | @Override | ||
176 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | ||
177 | switch (featureID) { | ||
178 | case Modes3Package.MODES3_MODEL_ROOT__TRAINS: | ||
179 | return ((InternalEList<?>)getTrains()).basicRemove(otherEnd, msgs); | ||
180 | case Modes3Package.MODES3_MODEL_ROOT__SEGMENTS: | ||
181 | return ((InternalEList<?>)getSegments()).basicRemove(otherEnd, msgs); | ||
182 | case Modes3Package.MODES3_MODEL_ROOT__TURNOUTS: | ||
183 | return ((InternalEList<?>)getTurnouts()).basicRemove(otherEnd, msgs); | ||
184 | } | ||
185 | return super.eInverseRemove(otherEnd, featureID, msgs); | ||
186 | } | ||
187 | |||
188 | /** | ||
189 | * <!-- begin-user-doc --> | ||
190 | * <!-- end-user-doc --> | ||
191 | * @generated | ||
192 | */ | ||
193 | @Override | ||
194 | public Object eGet(int featureID, boolean resolve, boolean coreType) { | ||
195 | switch (featureID) { | ||
196 | case Modes3Package.MODES3_MODEL_ROOT__ID: | ||
197 | return getId(); | ||
198 | case Modes3Package.MODES3_MODEL_ROOT__TRAINS: | ||
199 | return getTrains(); | ||
200 | case Modes3Package.MODES3_MODEL_ROOT__SEGMENTS: | ||
201 | return getSegments(); | ||
202 | case Modes3Package.MODES3_MODEL_ROOT__TURNOUTS: | ||
203 | return getTurnouts(); | ||
204 | } | ||
205 | return super.eGet(featureID, resolve, coreType); | ||
206 | } | ||
207 | |||
208 | /** | ||
209 | * <!-- begin-user-doc --> | ||
210 | * <!-- end-user-doc --> | ||
211 | * @generated | ||
212 | */ | ||
213 | @SuppressWarnings("unchecked") | ||
214 | @Override | ||
215 | public void eSet(int featureID, Object newValue) { | ||
216 | switch (featureID) { | ||
217 | case Modes3Package.MODES3_MODEL_ROOT__ID: | ||
218 | setId((Integer)newValue); | ||
219 | return; | ||
220 | case Modes3Package.MODES3_MODEL_ROOT__TRAINS: | ||
221 | getTrains().clear(); | ||
222 | getTrains().addAll((Collection<? extends Train>)newValue); | ||
223 | return; | ||
224 | case Modes3Package.MODES3_MODEL_ROOT__SEGMENTS: | ||
225 | getSegments().clear(); | ||
226 | getSegments().addAll((Collection<? extends Segment>)newValue); | ||
227 | return; | ||
228 | case Modes3Package.MODES3_MODEL_ROOT__TURNOUTS: | ||
229 | getTurnouts().clear(); | ||
230 | getTurnouts().addAll((Collection<? extends Turnout>)newValue); | ||
231 | return; | ||
232 | } | ||
233 | super.eSet(featureID, newValue); | ||
234 | } | ||
235 | |||
236 | /** | ||
237 | * <!-- begin-user-doc --> | ||
238 | * <!-- end-user-doc --> | ||
239 | * @generated | ||
240 | */ | ||
241 | @Override | ||
242 | public void eUnset(int featureID) { | ||
243 | switch (featureID) { | ||
244 | case Modes3Package.MODES3_MODEL_ROOT__ID: | ||
245 | setId(ID_EDEFAULT); | ||
246 | return; | ||
247 | case Modes3Package.MODES3_MODEL_ROOT__TRAINS: | ||
248 | getTrains().clear(); | ||
249 | return; | ||
250 | case Modes3Package.MODES3_MODEL_ROOT__SEGMENTS: | ||
251 | getSegments().clear(); | ||
252 | return; | ||
253 | case Modes3Package.MODES3_MODEL_ROOT__TURNOUTS: | ||
254 | getTurnouts().clear(); | ||
255 | return; | ||
256 | } | ||
257 | super.eUnset(featureID); | ||
258 | } | ||
259 | |||
260 | /** | ||
261 | * <!-- begin-user-doc --> | ||
262 | * <!-- end-user-doc --> | ||
263 | * @generated | ||
264 | */ | ||
265 | @Override | ||
266 | public boolean eIsSet(int featureID) { | ||
267 | switch (featureID) { | ||
268 | case Modes3Package.MODES3_MODEL_ROOT__ID: | ||
269 | return id != ID_EDEFAULT; | ||
270 | case Modes3Package.MODES3_MODEL_ROOT__TRAINS: | ||
271 | return trains != null && !trains.isEmpty(); | ||
272 | case Modes3Package.MODES3_MODEL_ROOT__SEGMENTS: | ||
273 | return segments != null && !segments.isEmpty(); | ||
274 | case Modes3Package.MODES3_MODEL_ROOT__TURNOUTS: | ||
275 | return turnouts != null && !turnouts.isEmpty(); | ||
276 | } | ||
277 | return super.eIsSet(featureID); | ||
278 | } | ||
279 | |||
280 | /** | ||
281 | * <!-- begin-user-doc --> | ||
282 | * <!-- end-user-doc --> | ||
283 | * @generated | ||
284 | */ | ||
285 | @Override | ||
286 | public String toString() { | ||
287 | if (eIsProxy()) return super.toString(); | ||
288 | |||
289 | StringBuilder result = new StringBuilder(super.toString()); | ||
290 | result.append(" (id: "); | ||
291 | result.append(id); | ||
292 | result.append(')'); | ||
293 | return result.toString(); | ||
294 | } | ||
295 | |||
296 | } //Modes3ModelRootImpl | ||
diff --git a/Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/impl/Modes3PackageImpl.java b/Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/impl/Modes3PackageImpl.java new file mode 100644 index 00000000..2b9e828c --- /dev/null +++ b/Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/impl/Modes3PackageImpl.java | |||
@@ -0,0 +1,363 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package modes3.impl; | ||
4 | |||
5 | import modes3.Modes3Factory; | ||
6 | import modes3.Modes3ModelRoot; | ||
7 | import modes3.Modes3Package; | ||
8 | import modes3.Segment; | ||
9 | import modes3.Train; | ||
10 | import modes3.Turnout; | ||
11 | |||
12 | import org.eclipse.emf.ecore.EAttribute; | ||
13 | import org.eclipse.emf.ecore.EClass; | ||
14 | import org.eclipse.emf.ecore.EPackage; | ||
15 | import org.eclipse.emf.ecore.EReference; | ||
16 | |||
17 | import org.eclipse.emf.ecore.impl.EPackageImpl; | ||
18 | |||
19 | /** | ||
20 | * <!-- begin-user-doc --> | ||
21 | * An implementation of the model <b>Package</b>. | ||
22 | * <!-- end-user-doc --> | ||
23 | * @generated | ||
24 | */ | ||
25 | public class Modes3PackageImpl extends EPackageImpl implements Modes3Package { | ||
26 | /** | ||
27 | * <!-- begin-user-doc --> | ||
28 | * <!-- end-user-doc --> | ||
29 | * @generated | ||
30 | */ | ||
31 | private EClass segmentEClass = null; | ||
32 | |||
33 | /** | ||
34 | * <!-- begin-user-doc --> | ||
35 | * <!-- end-user-doc --> | ||
36 | * @generated | ||
37 | */ | ||
38 | private EClass modes3ModelRootEClass = null; | ||
39 | |||
40 | /** | ||
41 | * <!-- begin-user-doc --> | ||
42 | * <!-- end-user-doc --> | ||
43 | * @generated | ||
44 | */ | ||
45 | private EClass turnoutEClass = null; | ||
46 | |||
47 | /** | ||
48 | * <!-- begin-user-doc --> | ||
49 | * <!-- end-user-doc --> | ||
50 | * @generated | ||
51 | */ | ||
52 | private EClass trainEClass = null; | ||
53 | |||
54 | /** | ||
55 | * Creates an instance of the model <b>Package</b>, registered with | ||
56 | * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package | ||
57 | * package URI value. | ||
58 | * <p>Note: the correct way to create the package is via the static | ||
59 | * factory method {@link #init init()}, which also performs | ||
60 | * initialization of the package, or returns the registered package, | ||
61 | * if one already exists. | ||
62 | * <!-- begin-user-doc --> | ||
63 | * <!-- end-user-doc --> | ||
64 | * @see org.eclipse.emf.ecore.EPackage.Registry | ||
65 | * @see modes3.Modes3Package#eNS_URI | ||
66 | * @see #init() | ||
67 | * @generated | ||
68 | */ | ||
69 | private Modes3PackageImpl() { | ||
70 | super(eNS_URI, Modes3Factory.eINSTANCE); | ||
71 | } | ||
72 | |||
73 | /** | ||
74 | * <!-- begin-user-doc --> | ||
75 | * <!-- end-user-doc --> | ||
76 | * @generated | ||
77 | */ | ||
78 | private static boolean isInited = false; | ||
79 | |||
80 | /** | ||
81 | * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends. | ||
82 | * | ||
83 | * <p>This method is used to initialize {@link Modes3Package#eINSTANCE} when that field is accessed. | ||
84 | * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. | ||
85 | * <!-- begin-user-doc --> | ||
86 | * <!-- end-user-doc --> | ||
87 | * @see #eNS_URI | ||
88 | * @see #createPackageContents() | ||
89 | * @see #initializePackageContents() | ||
90 | * @generated | ||
91 | */ | ||
92 | public static Modes3Package init() { | ||
93 | if (isInited) return (Modes3Package)EPackage.Registry.INSTANCE.getEPackage(Modes3Package.eNS_URI); | ||
94 | |||
95 | // Obtain or create and register package | ||
96 | Object registeredModes3Package = EPackage.Registry.INSTANCE.get(eNS_URI); | ||
97 | Modes3PackageImpl theModes3Package = registeredModes3Package instanceof Modes3PackageImpl ? (Modes3PackageImpl)registeredModes3Package : new Modes3PackageImpl(); | ||
98 | |||
99 | isInited = true; | ||
100 | |||
101 | // Create package meta-data objects | ||
102 | theModes3Package.createPackageContents(); | ||
103 | |||
104 | // Initialize created meta-data | ||
105 | theModes3Package.initializePackageContents(); | ||
106 | |||
107 | // Mark meta-data to indicate it can't be changed | ||
108 | theModes3Package.freeze(); | ||
109 | |||
110 | // Update the registry and return the package | ||
111 | EPackage.Registry.INSTANCE.put(Modes3Package.eNS_URI, theModes3Package); | ||
112 | return theModes3Package; | ||
113 | } | ||
114 | |||
115 | /** | ||
116 | * <!-- begin-user-doc --> | ||
117 | * <!-- end-user-doc --> | ||
118 | * @generated | ||
119 | */ | ||
120 | public EClass getSegment() { | ||
121 | return segmentEClass; | ||
122 | } | ||
123 | |||
124 | /** | ||
125 | * <!-- begin-user-doc --> | ||
126 | * <!-- end-user-doc --> | ||
127 | * @generated | ||
128 | */ | ||
129 | public EReference getSegment_ConnectedTo() { | ||
130 | return (EReference)segmentEClass.getEStructuralFeatures().get(0); | ||
131 | } | ||
132 | |||
133 | /** | ||
134 | * <!-- begin-user-doc --> | ||
135 | * <!-- end-user-doc --> | ||
136 | * @generated | ||
137 | */ | ||
138 | public EReference getSegment_OccupiedBy() { | ||
139 | return (EReference)segmentEClass.getEStructuralFeatures().get(1); | ||
140 | } | ||
141 | |||
142 | /** | ||
143 | * <!-- begin-user-doc --> | ||
144 | * <!-- end-user-doc --> | ||
145 | * @generated | ||
146 | */ | ||
147 | public EAttribute getSegment_Id() { | ||
148 | return (EAttribute)segmentEClass.getEStructuralFeatures().get(2); | ||
149 | } | ||
150 | |||
151 | /** | ||
152 | * <!-- begin-user-doc --> | ||
153 | * <!-- end-user-doc --> | ||
154 | * @generated | ||
155 | */ | ||
156 | public EClass getModes3ModelRoot() { | ||
157 | return modes3ModelRootEClass; | ||
158 | } | ||
159 | |||
160 | /** | ||
161 | * <!-- begin-user-doc --> | ||
162 | * <!-- end-user-doc --> | ||
163 | * @generated | ||
164 | */ | ||
165 | public EAttribute getModes3ModelRoot_Id() { | ||
166 | return (EAttribute)modes3ModelRootEClass.getEStructuralFeatures().get(0); | ||
167 | } | ||
168 | |||
169 | /** | ||
170 | * <!-- begin-user-doc --> | ||
171 | * <!-- end-user-doc --> | ||
172 | * @generated | ||
173 | */ | ||
174 | public EReference getModes3ModelRoot_Trains() { | ||
175 | return (EReference)modes3ModelRootEClass.getEStructuralFeatures().get(1); | ||
176 | } | ||
177 | |||
178 | /** | ||
179 | * <!-- begin-user-doc --> | ||
180 | * <!-- end-user-doc --> | ||
181 | * @generated | ||
182 | */ | ||
183 | public EReference getModes3ModelRoot_Segments() { | ||
184 | return (EReference)modes3ModelRootEClass.getEStructuralFeatures().get(2); | ||
185 | } | ||
186 | |||
187 | /** | ||
188 | * <!-- begin-user-doc --> | ||
189 | * <!-- end-user-doc --> | ||
190 | * @generated | ||
191 | */ | ||
192 | public EReference getModes3ModelRoot_Turnouts() { | ||
193 | return (EReference)modes3ModelRootEClass.getEStructuralFeatures().get(3); | ||
194 | } | ||
195 | |||
196 | /** | ||
197 | * <!-- begin-user-doc --> | ||
198 | * <!-- end-user-doc --> | ||
199 | * @generated | ||
200 | */ | ||
201 | public EClass getTurnout() { | ||
202 | return turnoutEClass; | ||
203 | } | ||
204 | |||
205 | /** | ||
206 | * <!-- begin-user-doc --> | ||
207 | * <!-- end-user-doc --> | ||
208 | * @generated | ||
209 | */ | ||
210 | public EReference getTurnout_Straight() { | ||
211 | return (EReference)turnoutEClass.getEStructuralFeatures().get(0); | ||
212 | } | ||
213 | |||
214 | /** | ||
215 | * <!-- begin-user-doc --> | ||
216 | * <!-- end-user-doc --> | ||
217 | * @generated | ||
218 | */ | ||
219 | public EReference getTurnout_Divergent() { | ||
220 | return (EReference)turnoutEClass.getEStructuralFeatures().get(1); | ||
221 | } | ||
222 | |||
223 | /** | ||
224 | * <!-- begin-user-doc --> | ||
225 | * <!-- end-user-doc --> | ||
226 | * @generated | ||
227 | */ | ||
228 | public EClass getTrain() { | ||
229 | return trainEClass; | ||
230 | } | ||
231 | |||
232 | /** | ||
233 | * <!-- begin-user-doc --> | ||
234 | * <!-- end-user-doc --> | ||
235 | * @generated | ||
236 | */ | ||
237 | public EReference getTrain_Location() { | ||
238 | return (EReference)trainEClass.getEStructuralFeatures().get(0); | ||
239 | } | ||
240 | |||
241 | /** | ||
242 | * <!-- begin-user-doc --> | ||
243 | * <!-- end-user-doc --> | ||
244 | * @generated | ||
245 | */ | ||
246 | public EAttribute getTrain_Id() { | ||
247 | return (EAttribute)trainEClass.getEStructuralFeatures().get(1); | ||
248 | } | ||
249 | |||
250 | /** | ||
251 | * <!-- begin-user-doc --> | ||
252 | * <!-- end-user-doc --> | ||
253 | * @generated | ||
254 | */ | ||
255 | public EAttribute getTrain_Speed() { | ||
256 | return (EAttribute)trainEClass.getEStructuralFeatures().get(2); | ||
257 | } | ||
258 | |||
259 | /** | ||
260 | * <!-- begin-user-doc --> | ||
261 | * <!-- end-user-doc --> | ||
262 | * @generated | ||
263 | */ | ||
264 | public Modes3Factory getModes3Factory() { | ||
265 | return (Modes3Factory)getEFactoryInstance(); | ||
266 | } | ||
267 | |||
268 | /** | ||
269 | * <!-- begin-user-doc --> | ||
270 | * <!-- end-user-doc --> | ||
271 | * @generated | ||
272 | */ | ||
273 | private boolean isCreated = false; | ||
274 | |||
275 | /** | ||
276 | * Creates the meta-model objects for the package. This method is | ||
277 | * guarded to have no affect on any invocation but its first. | ||
278 | * <!-- begin-user-doc --> | ||
279 | * <!-- end-user-doc --> | ||
280 | * @generated | ||
281 | */ | ||
282 | public void createPackageContents() { | ||
283 | if (isCreated) return; | ||
284 | isCreated = true; | ||
285 | |||
286 | // Create classes and their features | ||
287 | segmentEClass = createEClass(SEGMENT); | ||
288 | createEReference(segmentEClass, SEGMENT__CONNECTED_TO); | ||
289 | createEReference(segmentEClass, SEGMENT__OCCUPIED_BY); | ||
290 | createEAttribute(segmentEClass, SEGMENT__ID); | ||
291 | |||
292 | modes3ModelRootEClass = createEClass(MODES3_MODEL_ROOT); | ||
293 | createEAttribute(modes3ModelRootEClass, MODES3_MODEL_ROOT__ID); | ||
294 | createEReference(modes3ModelRootEClass, MODES3_MODEL_ROOT__TRAINS); | ||
295 | createEReference(modes3ModelRootEClass, MODES3_MODEL_ROOT__SEGMENTS); | ||
296 | createEReference(modes3ModelRootEClass, MODES3_MODEL_ROOT__TURNOUTS); | ||
297 | |||
298 | turnoutEClass = createEClass(TURNOUT); | ||
299 | createEReference(turnoutEClass, TURNOUT__STRAIGHT); | ||
300 | createEReference(turnoutEClass, TURNOUT__DIVERGENT); | ||
301 | |||
302 | trainEClass = createEClass(TRAIN); | ||
303 | createEReference(trainEClass, TRAIN__LOCATION); | ||
304 | createEAttribute(trainEClass, TRAIN__ID); | ||
305 | createEAttribute(trainEClass, TRAIN__SPEED); | ||
306 | } | ||
307 | |||
308 | /** | ||
309 | * <!-- begin-user-doc --> | ||
310 | * <!-- end-user-doc --> | ||
311 | * @generated | ||
312 | */ | ||
313 | private boolean isInitialized = false; | ||
314 | |||
315 | /** | ||
316 | * Complete the initialization of the package and its meta-model. This | ||
317 | * method is guarded to have no affect on any invocation but its first. | ||
318 | * <!-- begin-user-doc --> | ||
319 | * <!-- end-user-doc --> | ||
320 | * @generated | ||
321 | */ | ||
322 | public void initializePackageContents() { | ||
323 | if (isInitialized) return; | ||
324 | isInitialized = true; | ||
325 | |||
326 | // Initialize package | ||
327 | setName(eNAME); | ||
328 | setNsPrefix(eNS_PREFIX); | ||
329 | setNsURI(eNS_URI); | ||
330 | |||
331 | // Create type parameters | ||
332 | |||
333 | // Set bounds for type parameters | ||
334 | |||
335 | // Add supertypes to classes | ||
336 | turnoutEClass.getESuperTypes().add(this.getSegment()); | ||
337 | |||
338 | // Initialize classes, features, and operations; add parameters | ||
339 | initEClass(segmentEClass, Segment.class, "Segment", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); | ||
340 | initEReference(getSegment_ConnectedTo(), this.getSegment(), null, "connectedTo", null, 0, 2, Segment.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
341 | initEReference(getSegment_OccupiedBy(), this.getTrain(), this.getTrain_Location(), "occupiedBy", null, 0, 1, Segment.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
342 | initEAttribute(getSegment_Id(), ecorePackage.getEInt(), "id", null, 0, 1, Segment.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
343 | |||
344 | initEClass(modes3ModelRootEClass, Modes3ModelRoot.class, "Modes3ModelRoot", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); | ||
345 | initEAttribute(getModes3ModelRoot_Id(), ecorePackage.getEInt(), "id", null, 0, 1, Modes3ModelRoot.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
346 | initEReference(getModes3ModelRoot_Trains(), this.getTrain(), null, "trains", null, 0, -1, Modes3ModelRoot.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
347 | initEReference(getModes3ModelRoot_Segments(), this.getSegment(), null, "segments", null, 0, -1, Modes3ModelRoot.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
348 | initEReference(getModes3ModelRoot_Turnouts(), this.getTurnout(), null, "turnouts", null, 0, -1, Modes3ModelRoot.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
349 | |||
350 | initEClass(turnoutEClass, Turnout.class, "Turnout", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); | ||
351 | initEReference(getTurnout_Straight(), this.getSegment(), null, "straight", null, 1, 1, Turnout.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
352 | initEReference(getTurnout_Divergent(), this.getSegment(), null, "divergent", null, 1, 1, Turnout.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
353 | |||
354 | initEClass(trainEClass, Train.class, "Train", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); | ||
355 | initEReference(getTrain_Location(), this.getSegment(), this.getSegment_OccupiedBy(), "location", null, 1, 1, Train.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
356 | initEAttribute(getTrain_Id(), ecorePackage.getEInt(), "id", null, 0, 1, Train.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
357 | initEAttribute(getTrain_Speed(), ecorePackage.getEDouble(), "speed", null, 0, 1, Train.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
358 | |||
359 | // Create resource | ||
360 | createResource(eNS_URI); | ||
361 | } | ||
362 | |||
363 | } //Modes3PackageImpl | ||
diff --git a/Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/impl/SegmentImpl.java b/Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/impl/SegmentImpl.java new file mode 100644 index 00000000..905bcec1 --- /dev/null +++ b/Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/impl/SegmentImpl.java | |||
@@ -0,0 +1,319 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package modes3.impl; | ||
4 | |||
5 | import java.util.Collection; | ||
6 | |||
7 | import modes3.Modes3Package; | ||
8 | import modes3.Segment; | ||
9 | import modes3.Train; | ||
10 | |||
11 | import org.eclipse.emf.common.notify.Notification; | ||
12 | import org.eclipse.emf.common.notify.NotificationChain; | ||
13 | |||
14 | import org.eclipse.emf.common.util.EList; | ||
15 | |||
16 | import org.eclipse.emf.ecore.EClass; | ||
17 | import org.eclipse.emf.ecore.InternalEObject; | ||
18 | |||
19 | import org.eclipse.emf.ecore.impl.ENotificationImpl; | ||
20 | import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; | ||
21 | |||
22 | import org.eclipse.emf.ecore.util.EObjectResolvingEList; | ||
23 | |||
24 | /** | ||
25 | * <!-- begin-user-doc --> | ||
26 | * An implementation of the model object '<em><b>Segment</b></em>'. | ||
27 | * <!-- end-user-doc --> | ||
28 | * <p> | ||
29 | * The following features are implemented: | ||
30 | * </p> | ||
31 | * <ul> | ||
32 | * <li>{@link modes3.impl.SegmentImpl#getConnectedTo <em>Connected To</em>}</li> | ||
33 | * <li>{@link modes3.impl.SegmentImpl#getOccupiedBy <em>Occupied By</em>}</li> | ||
34 | * <li>{@link modes3.impl.SegmentImpl#getId <em>Id</em>}</li> | ||
35 | * </ul> | ||
36 | * | ||
37 | * @generated | ||
38 | */ | ||
39 | public class SegmentImpl extends MinimalEObjectImpl.Container implements Segment { | ||
40 | /** | ||
41 | * The cached value of the '{@link #getConnectedTo() <em>Connected To</em>}' reference list. | ||
42 | * <!-- begin-user-doc --> | ||
43 | * <!-- end-user-doc --> | ||
44 | * @see #getConnectedTo() | ||
45 | * @generated | ||
46 | * @ordered | ||
47 | */ | ||
48 | protected EList<Segment> connectedTo; | ||
49 | |||
50 | /** | ||
51 | * The cached value of the '{@link #getOccupiedBy() <em>Occupied By</em>}' reference. | ||
52 | * <!-- begin-user-doc --> | ||
53 | * <!-- end-user-doc --> | ||
54 | * @see #getOccupiedBy() | ||
55 | * @generated | ||
56 | * @ordered | ||
57 | */ | ||
58 | protected Train occupiedBy; | ||
59 | |||
60 | /** | ||
61 | * The default value of the '{@link #getId() <em>Id</em>}' attribute. | ||
62 | * <!-- begin-user-doc --> | ||
63 | * <!-- end-user-doc --> | ||
64 | * @see #getId() | ||
65 | * @generated | ||
66 | * @ordered | ||
67 | */ | ||
68 | protected static final int ID_EDEFAULT = 0; | ||
69 | |||
70 | /** | ||
71 | * The cached value of the '{@link #getId() <em>Id</em>}' attribute. | ||
72 | * <!-- begin-user-doc --> | ||
73 | * <!-- end-user-doc --> | ||
74 | * @see #getId() | ||
75 | * @generated | ||
76 | * @ordered | ||
77 | */ | ||
78 | protected int id = ID_EDEFAULT; | ||
79 | |||
80 | /** | ||
81 | * <!-- begin-user-doc --> | ||
82 | * <!-- end-user-doc --> | ||
83 | * @generated | ||
84 | */ | ||
85 | protected SegmentImpl() { | ||
86 | super(); | ||
87 | } | ||
88 | |||
89 | /** | ||
90 | * <!-- begin-user-doc --> | ||
91 | * <!-- end-user-doc --> | ||
92 | * @generated | ||
93 | */ | ||
94 | @Override | ||
95 | protected EClass eStaticClass() { | ||
96 | return Modes3Package.Literals.SEGMENT; | ||
97 | } | ||
98 | |||
99 | /** | ||
100 | * <!-- begin-user-doc --> | ||
101 | * <!-- end-user-doc --> | ||
102 | * @generated | ||
103 | */ | ||
104 | public EList<Segment> getConnectedTo() { | ||
105 | if (connectedTo == null) { | ||
106 | connectedTo = new EObjectResolvingEList<Segment>(Segment.class, this, Modes3Package.SEGMENT__CONNECTED_TO); | ||
107 | } | ||
108 | return connectedTo; | ||
109 | } | ||
110 | |||
111 | /** | ||
112 | * <!-- begin-user-doc --> | ||
113 | * <!-- end-user-doc --> | ||
114 | * @generated | ||
115 | */ | ||
116 | public Train getOccupiedBy() { | ||
117 | if (occupiedBy != null && occupiedBy.eIsProxy()) { | ||
118 | InternalEObject oldOccupiedBy = (InternalEObject)occupiedBy; | ||
119 | occupiedBy = (Train)eResolveProxy(oldOccupiedBy); | ||
120 | if (occupiedBy != oldOccupiedBy) { | ||
121 | if (eNotificationRequired()) | ||
122 | eNotify(new ENotificationImpl(this, Notification.RESOLVE, Modes3Package.SEGMENT__OCCUPIED_BY, oldOccupiedBy, occupiedBy)); | ||
123 | } | ||
124 | } | ||
125 | return occupiedBy; | ||
126 | } | ||
127 | |||
128 | /** | ||
129 | * <!-- begin-user-doc --> | ||
130 | * <!-- end-user-doc --> | ||
131 | * @generated | ||
132 | */ | ||
133 | public Train basicGetOccupiedBy() { | ||
134 | return occupiedBy; | ||
135 | } | ||
136 | |||
137 | /** | ||
138 | * <!-- begin-user-doc --> | ||
139 | * <!-- end-user-doc --> | ||
140 | * @generated | ||
141 | */ | ||
142 | public NotificationChain basicSetOccupiedBy(Train newOccupiedBy, NotificationChain msgs) { | ||
143 | Train oldOccupiedBy = occupiedBy; | ||
144 | occupiedBy = newOccupiedBy; | ||
145 | if (eNotificationRequired()) { | ||
146 | ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, Modes3Package.SEGMENT__OCCUPIED_BY, oldOccupiedBy, newOccupiedBy); | ||
147 | if (msgs == null) msgs = notification; else msgs.add(notification); | ||
148 | } | ||
149 | return msgs; | ||
150 | } | ||
151 | |||
152 | /** | ||
153 | * <!-- begin-user-doc --> | ||
154 | * <!-- end-user-doc --> | ||
155 | * @generated | ||
156 | */ | ||
157 | public void setOccupiedBy(Train newOccupiedBy) { | ||
158 | if (newOccupiedBy != occupiedBy) { | ||
159 | NotificationChain msgs = null; | ||
160 | if (occupiedBy != null) | ||
161 | msgs = ((InternalEObject)occupiedBy).eInverseRemove(this, Modes3Package.TRAIN__LOCATION, Train.class, msgs); | ||
162 | if (newOccupiedBy != null) | ||
163 | msgs = ((InternalEObject)newOccupiedBy).eInverseAdd(this, Modes3Package.TRAIN__LOCATION, Train.class, msgs); | ||
164 | msgs = basicSetOccupiedBy(newOccupiedBy, msgs); | ||
165 | if (msgs != null) msgs.dispatch(); | ||
166 | } | ||
167 | else if (eNotificationRequired()) | ||
168 | eNotify(new ENotificationImpl(this, Notification.SET, Modes3Package.SEGMENT__OCCUPIED_BY, newOccupiedBy, newOccupiedBy)); | ||
169 | } | ||
170 | |||
171 | /** | ||
172 | * <!-- begin-user-doc --> | ||
173 | * <!-- end-user-doc --> | ||
174 | * @generated | ||
175 | */ | ||
176 | public int getId() { | ||
177 | return id; | ||
178 | } | ||
179 | |||
180 | /** | ||
181 | * <!-- begin-user-doc --> | ||
182 | * <!-- end-user-doc --> | ||
183 | * @generated | ||
184 | */ | ||
185 | public void setId(int newId) { | ||
186 | int oldId = id; | ||
187 | id = newId; | ||
188 | if (eNotificationRequired()) | ||
189 | eNotify(new ENotificationImpl(this, Notification.SET, Modes3Package.SEGMENT__ID, oldId, id)); | ||
190 | } | ||
191 | |||
192 | /** | ||
193 | * <!-- begin-user-doc --> | ||
194 | * <!-- end-user-doc --> | ||
195 | * @generated | ||
196 | */ | ||
197 | @Override | ||
198 | public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | ||
199 | switch (featureID) { | ||
200 | case Modes3Package.SEGMENT__OCCUPIED_BY: | ||
201 | if (occupiedBy != null) | ||
202 | msgs = ((InternalEObject)occupiedBy).eInverseRemove(this, Modes3Package.TRAIN__LOCATION, Train.class, msgs); | ||
203 | return basicSetOccupiedBy((Train)otherEnd, msgs); | ||
204 | } | ||
205 | return super.eInverseAdd(otherEnd, featureID, msgs); | ||
206 | } | ||
207 | |||
208 | /** | ||
209 | * <!-- begin-user-doc --> | ||
210 | * <!-- end-user-doc --> | ||
211 | * @generated | ||
212 | */ | ||
213 | @Override | ||
214 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | ||
215 | switch (featureID) { | ||
216 | case Modes3Package.SEGMENT__OCCUPIED_BY: | ||
217 | return basicSetOccupiedBy(null, msgs); | ||
218 | } | ||
219 | return super.eInverseRemove(otherEnd, featureID, msgs); | ||
220 | } | ||
221 | |||
222 | /** | ||
223 | * <!-- begin-user-doc --> | ||
224 | * <!-- end-user-doc --> | ||
225 | * @generated | ||
226 | */ | ||
227 | @Override | ||
228 | public Object eGet(int featureID, boolean resolve, boolean coreType) { | ||
229 | switch (featureID) { | ||
230 | case Modes3Package.SEGMENT__CONNECTED_TO: | ||
231 | return getConnectedTo(); | ||
232 | case Modes3Package.SEGMENT__OCCUPIED_BY: | ||
233 | if (resolve) return getOccupiedBy(); | ||
234 | return basicGetOccupiedBy(); | ||
235 | case Modes3Package.SEGMENT__ID: | ||
236 | return getId(); | ||
237 | } | ||
238 | return super.eGet(featureID, resolve, coreType); | ||
239 | } | ||
240 | |||
241 | /** | ||
242 | * <!-- begin-user-doc --> | ||
243 | * <!-- end-user-doc --> | ||
244 | * @generated | ||
245 | */ | ||
246 | @SuppressWarnings("unchecked") | ||
247 | @Override | ||
248 | public void eSet(int featureID, Object newValue) { | ||
249 | switch (featureID) { | ||
250 | case Modes3Package.SEGMENT__CONNECTED_TO: | ||
251 | getConnectedTo().clear(); | ||
252 | getConnectedTo().addAll((Collection<? extends Segment>)newValue); | ||
253 | return; | ||
254 | case Modes3Package.SEGMENT__OCCUPIED_BY: | ||
255 | setOccupiedBy((Train)newValue); | ||
256 | return; | ||
257 | case Modes3Package.SEGMENT__ID: | ||
258 | setId((Integer)newValue); | ||
259 | return; | ||
260 | } | ||
261 | super.eSet(featureID, newValue); | ||
262 | } | ||
263 | |||
264 | /** | ||
265 | * <!-- begin-user-doc --> | ||
266 | * <!-- end-user-doc --> | ||
267 | * @generated | ||
268 | */ | ||
269 | @Override | ||
270 | public void eUnset(int featureID) { | ||
271 | switch (featureID) { | ||
272 | case Modes3Package.SEGMENT__CONNECTED_TO: | ||
273 | getConnectedTo().clear(); | ||
274 | return; | ||
275 | case Modes3Package.SEGMENT__OCCUPIED_BY: | ||
276 | setOccupiedBy((Train)null); | ||
277 | return; | ||
278 | case Modes3Package.SEGMENT__ID: | ||
279 | setId(ID_EDEFAULT); | ||
280 | return; | ||
281 | } | ||
282 | super.eUnset(featureID); | ||
283 | } | ||
284 | |||
285 | /** | ||
286 | * <!-- begin-user-doc --> | ||
287 | * <!-- end-user-doc --> | ||
288 | * @generated | ||
289 | */ | ||
290 | @Override | ||
291 | public boolean eIsSet(int featureID) { | ||
292 | switch (featureID) { | ||
293 | case Modes3Package.SEGMENT__CONNECTED_TO: | ||
294 | return connectedTo != null && !connectedTo.isEmpty(); | ||
295 | case Modes3Package.SEGMENT__OCCUPIED_BY: | ||
296 | return occupiedBy != null; | ||
297 | case Modes3Package.SEGMENT__ID: | ||
298 | return id != ID_EDEFAULT; | ||
299 | } | ||
300 | return super.eIsSet(featureID); | ||
301 | } | ||
302 | |||
303 | /** | ||
304 | * <!-- begin-user-doc --> | ||
305 | * <!-- end-user-doc --> | ||
306 | * @generated | ||
307 | */ | ||
308 | @Override | ||
309 | public String toString() { | ||
310 | if (eIsProxy()) return super.toString(); | ||
311 | |||
312 | StringBuilder result = new StringBuilder(super.toString()); | ||
313 | result.append(" (id: "); | ||
314 | result.append(id); | ||
315 | result.append(')'); | ||
316 | return result.toString(); | ||
317 | } | ||
318 | |||
319 | } //SegmentImpl | ||
diff --git a/Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/impl/TrainImpl.java b/Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/impl/TrainImpl.java new file mode 100644 index 00000000..f096dca8 --- /dev/null +++ b/Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/impl/TrainImpl.java | |||
@@ -0,0 +1,332 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package modes3.impl; | ||
4 | |||
5 | import modes3.Modes3Package; | ||
6 | import modes3.Segment; | ||
7 | import modes3.Train; | ||
8 | |||
9 | import org.eclipse.emf.common.notify.Notification; | ||
10 | import org.eclipse.emf.common.notify.NotificationChain; | ||
11 | |||
12 | import org.eclipse.emf.ecore.EClass; | ||
13 | import org.eclipse.emf.ecore.InternalEObject; | ||
14 | |||
15 | import org.eclipse.emf.ecore.impl.ENotificationImpl; | ||
16 | import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; | ||
17 | |||
18 | /** | ||
19 | * <!-- begin-user-doc --> | ||
20 | * An implementation of the model object '<em><b>Train</b></em>'. | ||
21 | * <!-- end-user-doc --> | ||
22 | * <p> | ||
23 | * The following features are implemented: | ||
24 | * </p> | ||
25 | * <ul> | ||
26 | * <li>{@link modes3.impl.TrainImpl#getLocation <em>Location</em>}</li> | ||
27 | * <li>{@link modes3.impl.TrainImpl#getId <em>Id</em>}</li> | ||
28 | * <li>{@link modes3.impl.TrainImpl#getSpeed <em>Speed</em>}</li> | ||
29 | * </ul> | ||
30 | * | ||
31 | * @generated | ||
32 | */ | ||
33 | public class TrainImpl extends MinimalEObjectImpl.Container implements Train { | ||
34 | /** | ||
35 | * The cached value of the '{@link #getLocation() <em>Location</em>}' reference. | ||
36 | * <!-- begin-user-doc --> | ||
37 | * <!-- end-user-doc --> | ||
38 | * @see #getLocation() | ||
39 | * @generated | ||
40 | * @ordered | ||
41 | */ | ||
42 | protected Segment location; | ||
43 | |||
44 | /** | ||
45 | * The default value of the '{@link #getId() <em>Id</em>}' attribute. | ||
46 | * <!-- begin-user-doc --> | ||
47 | * <!-- end-user-doc --> | ||
48 | * @see #getId() | ||
49 | * @generated | ||
50 | * @ordered | ||
51 | */ | ||
52 | protected static final int ID_EDEFAULT = 0; | ||
53 | |||
54 | /** | ||
55 | * The cached value of the '{@link #getId() <em>Id</em>}' attribute. | ||
56 | * <!-- begin-user-doc --> | ||
57 | * <!-- end-user-doc --> | ||
58 | * @see #getId() | ||
59 | * @generated | ||
60 | * @ordered | ||
61 | */ | ||
62 | protected int id = ID_EDEFAULT; | ||
63 | |||
64 | /** | ||
65 | * The default value of the '{@link #getSpeed() <em>Speed</em>}' attribute. | ||
66 | * <!-- begin-user-doc --> | ||
67 | * <!-- end-user-doc --> | ||
68 | * @see #getSpeed() | ||
69 | * @generated | ||
70 | * @ordered | ||
71 | */ | ||
72 | protected static final double SPEED_EDEFAULT = 0.0; | ||
73 | |||
74 | /** | ||
75 | * The cached value of the '{@link #getSpeed() <em>Speed</em>}' attribute. | ||
76 | * <!-- begin-user-doc --> | ||
77 | * <!-- end-user-doc --> | ||
78 | * @see #getSpeed() | ||
79 | * @generated | ||
80 | * @ordered | ||
81 | */ | ||
82 | protected double speed = SPEED_EDEFAULT; | ||
83 | |||
84 | /** | ||
85 | * <!-- begin-user-doc --> | ||
86 | * <!-- end-user-doc --> | ||
87 | * @generated | ||
88 | */ | ||
89 | protected TrainImpl() { | ||
90 | super(); | ||
91 | } | ||
92 | |||
93 | /** | ||
94 | * <!-- begin-user-doc --> | ||
95 | * <!-- end-user-doc --> | ||
96 | * @generated | ||
97 | */ | ||
98 | @Override | ||
99 | protected EClass eStaticClass() { | ||
100 | return Modes3Package.Literals.TRAIN; | ||
101 | } | ||
102 | |||
103 | /** | ||
104 | * <!-- begin-user-doc --> | ||
105 | * <!-- end-user-doc --> | ||
106 | * @generated | ||
107 | */ | ||
108 | public Segment getLocation() { | ||
109 | if (location != null && location.eIsProxy()) { | ||
110 | InternalEObject oldLocation = (InternalEObject)location; | ||
111 | location = (Segment)eResolveProxy(oldLocation); | ||
112 | if (location != oldLocation) { | ||
113 | if (eNotificationRequired()) | ||
114 | eNotify(new ENotificationImpl(this, Notification.RESOLVE, Modes3Package.TRAIN__LOCATION, oldLocation, location)); | ||
115 | } | ||
116 | } | ||
117 | return location; | ||
118 | } | ||
119 | |||
120 | /** | ||
121 | * <!-- begin-user-doc --> | ||
122 | * <!-- end-user-doc --> | ||
123 | * @generated | ||
124 | */ | ||
125 | public Segment basicGetLocation() { | ||
126 | return location; | ||
127 | } | ||
128 | |||
129 | /** | ||
130 | * <!-- begin-user-doc --> | ||
131 | * <!-- end-user-doc --> | ||
132 | * @generated | ||
133 | */ | ||
134 | public NotificationChain basicSetLocation(Segment newLocation, NotificationChain msgs) { | ||
135 | Segment oldLocation = location; | ||
136 | location = newLocation; | ||
137 | if (eNotificationRequired()) { | ||
138 | ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, Modes3Package.TRAIN__LOCATION, oldLocation, newLocation); | ||
139 | if (msgs == null) msgs = notification; else msgs.add(notification); | ||
140 | } | ||
141 | return msgs; | ||
142 | } | ||
143 | |||
144 | /** | ||
145 | * <!-- begin-user-doc --> | ||
146 | * <!-- end-user-doc --> | ||
147 | * @generated | ||
148 | */ | ||
149 | public void setLocation(Segment newLocation) { | ||
150 | if (newLocation != location) { | ||
151 | NotificationChain msgs = null; | ||
152 | if (location != null) | ||
153 | msgs = ((InternalEObject)location).eInverseRemove(this, Modes3Package.SEGMENT__OCCUPIED_BY, Segment.class, msgs); | ||
154 | if (newLocation != null) | ||
155 | msgs = ((InternalEObject)newLocation).eInverseAdd(this, Modes3Package.SEGMENT__OCCUPIED_BY, Segment.class, msgs); | ||
156 | msgs = basicSetLocation(newLocation, msgs); | ||
157 | if (msgs != null) msgs.dispatch(); | ||
158 | } | ||
159 | else if (eNotificationRequired()) | ||
160 | eNotify(new ENotificationImpl(this, Notification.SET, Modes3Package.TRAIN__LOCATION, newLocation, newLocation)); | ||
161 | } | ||
162 | |||
163 | /** | ||
164 | * <!-- begin-user-doc --> | ||
165 | * <!-- end-user-doc --> | ||
166 | * @generated | ||
167 | */ | ||
168 | public int getId() { | ||
169 | return id; | ||
170 | } | ||
171 | |||
172 | /** | ||
173 | * <!-- begin-user-doc --> | ||
174 | * <!-- end-user-doc --> | ||
175 | * @generated | ||
176 | */ | ||
177 | public void setId(int newId) { | ||
178 | int oldId = id; | ||
179 | id = newId; | ||
180 | if (eNotificationRequired()) | ||
181 | eNotify(new ENotificationImpl(this, Notification.SET, Modes3Package.TRAIN__ID, oldId, id)); | ||
182 | } | ||
183 | |||
184 | /** | ||
185 | * <!-- begin-user-doc --> | ||
186 | * <!-- end-user-doc --> | ||
187 | * @generated | ||
188 | */ | ||
189 | public double getSpeed() { | ||
190 | return speed; | ||
191 | } | ||
192 | |||
193 | /** | ||
194 | * <!-- begin-user-doc --> | ||
195 | * <!-- end-user-doc --> | ||
196 | * @generated | ||
197 | */ | ||
198 | public void setSpeed(double newSpeed) { | ||
199 | double oldSpeed = speed; | ||
200 | speed = newSpeed; | ||
201 | if (eNotificationRequired()) | ||
202 | eNotify(new ENotificationImpl(this, Notification.SET, Modes3Package.TRAIN__SPEED, oldSpeed, speed)); | ||
203 | } | ||
204 | |||
205 | /** | ||
206 | * <!-- begin-user-doc --> | ||
207 | * <!-- end-user-doc --> | ||
208 | * @generated | ||
209 | */ | ||
210 | @Override | ||
211 | public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | ||
212 | switch (featureID) { | ||
213 | case Modes3Package.TRAIN__LOCATION: | ||
214 | if (location != null) | ||
215 | msgs = ((InternalEObject)location).eInverseRemove(this, Modes3Package.SEGMENT__OCCUPIED_BY, Segment.class, msgs); | ||
216 | return basicSetLocation((Segment)otherEnd, msgs); | ||
217 | } | ||
218 | return super.eInverseAdd(otherEnd, featureID, msgs); | ||
219 | } | ||
220 | |||
221 | /** | ||
222 | * <!-- begin-user-doc --> | ||
223 | * <!-- end-user-doc --> | ||
224 | * @generated | ||
225 | */ | ||
226 | @Override | ||
227 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | ||
228 | switch (featureID) { | ||
229 | case Modes3Package.TRAIN__LOCATION: | ||
230 | return basicSetLocation(null, msgs); | ||
231 | } | ||
232 | return super.eInverseRemove(otherEnd, featureID, msgs); | ||
233 | } | ||
234 | |||
235 | /** | ||
236 | * <!-- begin-user-doc --> | ||
237 | * <!-- end-user-doc --> | ||
238 | * @generated | ||
239 | */ | ||
240 | @Override | ||
241 | public Object eGet(int featureID, boolean resolve, boolean coreType) { | ||
242 | switch (featureID) { | ||
243 | case Modes3Package.TRAIN__LOCATION: | ||
244 | if (resolve) return getLocation(); | ||
245 | return basicGetLocation(); | ||
246 | case Modes3Package.TRAIN__ID: | ||
247 | return getId(); | ||
248 | case Modes3Package.TRAIN__SPEED: | ||
249 | return getSpeed(); | ||
250 | } | ||
251 | return super.eGet(featureID, resolve, coreType); | ||
252 | } | ||
253 | |||
254 | /** | ||
255 | * <!-- begin-user-doc --> | ||
256 | * <!-- end-user-doc --> | ||
257 | * @generated | ||
258 | */ | ||
259 | @Override | ||
260 | public void eSet(int featureID, Object newValue) { | ||
261 | switch (featureID) { | ||
262 | case Modes3Package.TRAIN__LOCATION: | ||
263 | setLocation((Segment)newValue); | ||
264 | return; | ||
265 | case Modes3Package.TRAIN__ID: | ||
266 | setId((Integer)newValue); | ||
267 | return; | ||
268 | case Modes3Package.TRAIN__SPEED: | ||
269 | setSpeed((Double)newValue); | ||
270 | return; | ||
271 | } | ||
272 | super.eSet(featureID, newValue); | ||
273 | } | ||
274 | |||
275 | /** | ||
276 | * <!-- begin-user-doc --> | ||
277 | * <!-- end-user-doc --> | ||
278 | * @generated | ||
279 | */ | ||
280 | @Override | ||
281 | public void eUnset(int featureID) { | ||
282 | switch (featureID) { | ||
283 | case Modes3Package.TRAIN__LOCATION: | ||
284 | setLocation((Segment)null); | ||
285 | return; | ||
286 | case Modes3Package.TRAIN__ID: | ||
287 | setId(ID_EDEFAULT); | ||
288 | return; | ||
289 | case Modes3Package.TRAIN__SPEED: | ||
290 | setSpeed(SPEED_EDEFAULT); | ||
291 | return; | ||
292 | } | ||
293 | super.eUnset(featureID); | ||
294 | } | ||
295 | |||
296 | /** | ||
297 | * <!-- begin-user-doc --> | ||
298 | * <!-- end-user-doc --> | ||
299 | * @generated | ||
300 | */ | ||
301 | @Override | ||
302 | public boolean eIsSet(int featureID) { | ||
303 | switch (featureID) { | ||
304 | case Modes3Package.TRAIN__LOCATION: | ||
305 | return location != null; | ||
306 | case Modes3Package.TRAIN__ID: | ||
307 | return id != ID_EDEFAULT; | ||
308 | case Modes3Package.TRAIN__SPEED: | ||
309 | return speed != SPEED_EDEFAULT; | ||
310 | } | ||
311 | return super.eIsSet(featureID); | ||
312 | } | ||
313 | |||
314 | /** | ||
315 | * <!-- begin-user-doc --> | ||
316 | * <!-- end-user-doc --> | ||
317 | * @generated | ||
318 | */ | ||
319 | @Override | ||
320 | public String toString() { | ||
321 | if (eIsProxy()) return super.toString(); | ||
322 | |||
323 | StringBuilder result = new StringBuilder(super.toString()); | ||
324 | result.append(" (id: "); | ||
325 | result.append(id); | ||
326 | result.append(", speed: "); | ||
327 | result.append(speed); | ||
328 | result.append(')'); | ||
329 | return result.toString(); | ||
330 | } | ||
331 | |||
332 | } //TrainImpl | ||
diff --git a/Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/impl/TurnoutImpl.java b/Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/impl/TurnoutImpl.java new file mode 100644 index 00000000..d20a104e --- /dev/null +++ b/Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/impl/TurnoutImpl.java | |||
@@ -0,0 +1,216 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package modes3.impl; | ||
4 | |||
5 | import modes3.Modes3Package; | ||
6 | import modes3.Segment; | ||
7 | import modes3.Turnout; | ||
8 | |||
9 | import org.eclipse.emf.common.notify.Notification; | ||
10 | |||
11 | import org.eclipse.emf.ecore.EClass; | ||
12 | import org.eclipse.emf.ecore.InternalEObject; | ||
13 | |||
14 | import org.eclipse.emf.ecore.impl.ENotificationImpl; | ||
15 | |||
16 | /** | ||
17 | * <!-- begin-user-doc --> | ||
18 | * An implementation of the model object '<em><b>Turnout</b></em>'. | ||
19 | * <!-- end-user-doc --> | ||
20 | * <p> | ||
21 | * The following features are implemented: | ||
22 | * </p> | ||
23 | * <ul> | ||
24 | * <li>{@link modes3.impl.TurnoutImpl#getStraight <em>Straight</em>}</li> | ||
25 | * <li>{@link modes3.impl.TurnoutImpl#getDivergent <em>Divergent</em>}</li> | ||
26 | * </ul> | ||
27 | * | ||
28 | * @generated | ||
29 | */ | ||
30 | public class TurnoutImpl extends SegmentImpl implements Turnout { | ||
31 | /** | ||
32 | * The cached value of the '{@link #getStraight() <em>Straight</em>}' reference. | ||
33 | * <!-- begin-user-doc --> | ||
34 | * <!-- end-user-doc --> | ||
35 | * @see #getStraight() | ||
36 | * @generated | ||
37 | * @ordered | ||
38 | */ | ||
39 | protected Segment straight; | ||
40 | |||
41 | /** | ||
42 | * The cached value of the '{@link #getDivergent() <em>Divergent</em>}' reference. | ||
43 | * <!-- begin-user-doc --> | ||
44 | * <!-- end-user-doc --> | ||
45 | * @see #getDivergent() | ||
46 | * @generated | ||
47 | * @ordered | ||
48 | */ | ||
49 | protected Segment divergent; | ||
50 | |||
51 | /** | ||
52 | * <!-- begin-user-doc --> | ||
53 | * <!-- end-user-doc --> | ||
54 | * @generated | ||
55 | */ | ||
56 | protected TurnoutImpl() { | ||
57 | super(); | ||
58 | } | ||
59 | |||
60 | /** | ||
61 | * <!-- begin-user-doc --> | ||
62 | * <!-- end-user-doc --> | ||
63 | * @generated | ||
64 | */ | ||
65 | @Override | ||
66 | protected EClass eStaticClass() { | ||
67 | return Modes3Package.Literals.TURNOUT; | ||
68 | } | ||
69 | |||
70 | /** | ||
71 | * <!-- begin-user-doc --> | ||
72 | * <!-- end-user-doc --> | ||
73 | * @generated | ||
74 | */ | ||
75 | public Segment getStraight() { | ||
76 | if (straight != null && straight.eIsProxy()) { | ||
77 | InternalEObject oldStraight = (InternalEObject)straight; | ||
78 | straight = (Segment)eResolveProxy(oldStraight); | ||
79 | if (straight != oldStraight) { | ||
80 | if (eNotificationRequired()) | ||
81 | eNotify(new ENotificationImpl(this, Notification.RESOLVE, Modes3Package.TURNOUT__STRAIGHT, oldStraight, straight)); | ||
82 | } | ||
83 | } | ||
84 | return straight; | ||
85 | } | ||
86 | |||
87 | /** | ||
88 | * <!-- begin-user-doc --> | ||
89 | * <!-- end-user-doc --> | ||
90 | * @generated | ||
91 | */ | ||
92 | public Segment basicGetStraight() { | ||
93 | return straight; | ||
94 | } | ||
95 | |||
96 | /** | ||
97 | * <!-- begin-user-doc --> | ||
98 | * <!-- end-user-doc --> | ||
99 | * @generated | ||
100 | */ | ||
101 | public void setStraight(Segment newStraight) { | ||
102 | Segment oldStraight = straight; | ||
103 | straight = newStraight; | ||
104 | if (eNotificationRequired()) | ||
105 | eNotify(new ENotificationImpl(this, Notification.SET, Modes3Package.TURNOUT__STRAIGHT, oldStraight, straight)); | ||
106 | } | ||
107 | |||
108 | /** | ||
109 | * <!-- begin-user-doc --> | ||
110 | * <!-- end-user-doc --> | ||
111 | * @generated | ||
112 | */ | ||
113 | public Segment getDivergent() { | ||
114 | if (divergent != null && divergent.eIsProxy()) { | ||
115 | InternalEObject oldDivergent = (InternalEObject)divergent; | ||
116 | divergent = (Segment)eResolveProxy(oldDivergent); | ||
117 | if (divergent != oldDivergent) { | ||
118 | if (eNotificationRequired()) | ||
119 | eNotify(new ENotificationImpl(this, Notification.RESOLVE, Modes3Package.TURNOUT__DIVERGENT, oldDivergent, divergent)); | ||
120 | } | ||
121 | } | ||
122 | return divergent; | ||
123 | } | ||
124 | |||
125 | /** | ||
126 | * <!-- begin-user-doc --> | ||
127 | * <!-- end-user-doc --> | ||
128 | * @generated | ||
129 | */ | ||
130 | public Segment basicGetDivergent() { | ||
131 | return divergent; | ||
132 | } | ||
133 | |||
134 | /** | ||
135 | * <!-- begin-user-doc --> | ||
136 | * <!-- end-user-doc --> | ||
137 | * @generated | ||
138 | */ | ||
139 | public void setDivergent(Segment newDivergent) { | ||
140 | Segment oldDivergent = divergent; | ||
141 | divergent = newDivergent; | ||
142 | if (eNotificationRequired()) | ||
143 | eNotify(new ENotificationImpl(this, Notification.SET, Modes3Package.TURNOUT__DIVERGENT, oldDivergent, divergent)); | ||
144 | } | ||
145 | |||
146 | /** | ||
147 | * <!-- begin-user-doc --> | ||
148 | * <!-- end-user-doc --> | ||
149 | * @generated | ||
150 | */ | ||
151 | @Override | ||
152 | public Object eGet(int featureID, boolean resolve, boolean coreType) { | ||
153 | switch (featureID) { | ||
154 | case Modes3Package.TURNOUT__STRAIGHT: | ||
155 | if (resolve) return getStraight(); | ||
156 | return basicGetStraight(); | ||
157 | case Modes3Package.TURNOUT__DIVERGENT: | ||
158 | if (resolve) return getDivergent(); | ||
159 | return basicGetDivergent(); | ||
160 | } | ||
161 | return super.eGet(featureID, resolve, coreType); | ||
162 | } | ||
163 | |||
164 | /** | ||
165 | * <!-- begin-user-doc --> | ||
166 | * <!-- end-user-doc --> | ||
167 | * @generated | ||
168 | */ | ||
169 | @Override | ||
170 | public void eSet(int featureID, Object newValue) { | ||
171 | switch (featureID) { | ||
172 | case Modes3Package.TURNOUT__STRAIGHT: | ||
173 | setStraight((Segment)newValue); | ||
174 | return; | ||
175 | case Modes3Package.TURNOUT__DIVERGENT: | ||
176 | setDivergent((Segment)newValue); | ||
177 | return; | ||
178 | } | ||
179 | super.eSet(featureID, newValue); | ||
180 | } | ||
181 | |||
182 | /** | ||
183 | * <!-- begin-user-doc --> | ||
184 | * <!-- end-user-doc --> | ||
185 | * @generated | ||
186 | */ | ||
187 | @Override | ||
188 | public void eUnset(int featureID) { | ||
189 | switch (featureID) { | ||
190 | case Modes3Package.TURNOUT__STRAIGHT: | ||
191 | setStraight((Segment)null); | ||
192 | return; | ||
193 | case Modes3Package.TURNOUT__DIVERGENT: | ||
194 | setDivergent((Segment)null); | ||
195 | return; | ||
196 | } | ||
197 | super.eUnset(featureID); | ||
198 | } | ||
199 | |||
200 | /** | ||
201 | * <!-- begin-user-doc --> | ||
202 | * <!-- end-user-doc --> | ||
203 | * @generated | ||
204 | */ | ||
205 | @Override | ||
206 | public boolean eIsSet(int featureID) { | ||
207 | switch (featureID) { | ||
208 | case Modes3Package.TURNOUT__STRAIGHT: | ||
209 | return straight != null; | ||
210 | case Modes3Package.TURNOUT__DIVERGENT: | ||
211 | return divergent != null; | ||
212 | } | ||
213 | return super.eIsSet(featureID); | ||
214 | } | ||
215 | |||
216 | } //TurnoutImpl | ||
diff --git a/Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/util/Modes3AdapterFactory.java b/Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/util/Modes3AdapterFactory.java new file mode 100644 index 00000000..86568e9d --- /dev/null +++ b/Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/util/Modes3AdapterFactory.java | |||
@@ -0,0 +1,174 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package modes3.util; | ||
4 | |||
5 | import modes3.*; | ||
6 | |||
7 | import org.eclipse.emf.common.notify.Adapter; | ||
8 | import org.eclipse.emf.common.notify.Notifier; | ||
9 | |||
10 | import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; | ||
11 | |||
12 | import org.eclipse.emf.ecore.EObject; | ||
13 | |||
14 | /** | ||
15 | * <!-- begin-user-doc --> | ||
16 | * The <b>Adapter Factory</b> for the model. | ||
17 | * It provides an adapter <code>createXXX</code> method for each class of the model. | ||
18 | * <!-- end-user-doc --> | ||
19 | * @see modes3.Modes3Package | ||
20 | * @generated | ||
21 | */ | ||
22 | public class Modes3AdapterFactory extends AdapterFactoryImpl { | ||
23 | /** | ||
24 | * The cached model package. | ||
25 | * <!-- begin-user-doc --> | ||
26 | * <!-- end-user-doc --> | ||
27 | * @generated | ||
28 | */ | ||
29 | protected static Modes3Package modelPackage; | ||
30 | |||
31 | /** | ||
32 | * Creates an instance of the adapter factory. | ||
33 | * <!-- begin-user-doc --> | ||
34 | * <!-- end-user-doc --> | ||
35 | * @generated | ||
36 | */ | ||
37 | public Modes3AdapterFactory() { | ||
38 | if (modelPackage == null) { | ||
39 | modelPackage = Modes3Package.eINSTANCE; | ||
40 | } | ||
41 | } | ||
42 | |||
43 | /** | ||
44 | * Returns whether this factory is applicable for the type of the object. | ||
45 | * <!-- begin-user-doc --> | ||
46 | * This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model. | ||
47 | * <!-- end-user-doc --> | ||
48 | * @return whether this factory is applicable for the type of the object. | ||
49 | * @generated | ||
50 | */ | ||
51 | @Override | ||
52 | public boolean isFactoryForType(Object object) { | ||
53 | if (object == modelPackage) { | ||
54 | return true; | ||
55 | } | ||
56 | if (object instanceof EObject) { | ||
57 | return ((EObject)object).eClass().getEPackage() == modelPackage; | ||
58 | } | ||
59 | return false; | ||
60 | } | ||
61 | |||
62 | /** | ||
63 | * The switch that delegates to the <code>createXXX</code> methods. | ||
64 | * <!-- begin-user-doc --> | ||
65 | * <!-- end-user-doc --> | ||
66 | * @generated | ||
67 | */ | ||
68 | protected Modes3Switch<Adapter> modelSwitch = | ||
69 | new Modes3Switch<Adapter>() { | ||
70 | @Override | ||
71 | public Adapter caseSegment(Segment object) { | ||
72 | return createSegmentAdapter(); | ||
73 | } | ||
74 | @Override | ||
75 | public Adapter caseModes3ModelRoot(Modes3ModelRoot object) { | ||
76 | return createModes3ModelRootAdapter(); | ||
77 | } | ||
78 | @Override | ||
79 | public Adapter caseTurnout(Turnout object) { | ||
80 | return createTurnoutAdapter(); | ||
81 | } | ||
82 | @Override | ||
83 | public Adapter caseTrain(Train object) { | ||
84 | return createTrainAdapter(); | ||
85 | } | ||
86 | @Override | ||
87 | public Adapter defaultCase(EObject object) { | ||
88 | return createEObjectAdapter(); | ||
89 | } | ||
90 | }; | ||
91 | |||
92 | /** | ||
93 | * Creates an adapter for the <code>target</code>. | ||
94 | * <!-- begin-user-doc --> | ||
95 | * <!-- end-user-doc --> | ||
96 | * @param target the object to adapt. | ||
97 | * @return the adapter for the <code>target</code>. | ||
98 | * @generated | ||
99 | */ | ||
100 | @Override | ||
101 | public Adapter createAdapter(Notifier target) { | ||
102 | return modelSwitch.doSwitch((EObject)target); | ||
103 | } | ||
104 | |||
105 | |||
106 | /** | ||
107 | * Creates a new adapter for an object of class '{@link modes3.Segment <em>Segment</em>}'. | ||
108 | * <!-- begin-user-doc --> | ||
109 | * This default implementation returns null so that we can easily ignore cases; | ||
110 | * it's useful to ignore a case when inheritance will catch all the cases anyway. | ||
111 | * <!-- end-user-doc --> | ||
112 | * @return the new adapter. | ||
113 | * @see modes3.Segment | ||
114 | * @generated | ||
115 | */ | ||
116 | public Adapter createSegmentAdapter() { | ||
117 | return null; | ||
118 | } | ||
119 | |||
120 | /** | ||
121 | * Creates a new adapter for an object of class '{@link modes3.Modes3ModelRoot <em>Model Root</em>}'. | ||
122 | * <!-- begin-user-doc --> | ||
123 | * This default implementation returns null so that we can easily ignore cases; | ||
124 | * it's useful to ignore a case when inheritance will catch all the cases anyway. | ||
125 | * <!-- end-user-doc --> | ||
126 | * @return the new adapter. | ||
127 | * @see modes3.Modes3ModelRoot | ||
128 | * @generated | ||
129 | */ | ||
130 | public Adapter createModes3ModelRootAdapter() { | ||
131 | return null; | ||
132 | } | ||
133 | |||
134 | /** | ||
135 | * Creates a new adapter for an object of class '{@link modes3.Turnout <em>Turnout</em>}'. | ||
136 | * <!-- begin-user-doc --> | ||
137 | * This default implementation returns null so that we can easily ignore cases; | ||
138 | * it's useful to ignore a case when inheritance will catch all the cases anyway. | ||
139 | * <!-- end-user-doc --> | ||
140 | * @return the new adapter. | ||
141 | * @see modes3.Turnout | ||
142 | * @generated | ||
143 | */ | ||
144 | public Adapter createTurnoutAdapter() { | ||
145 | return null; | ||
146 | } | ||
147 | |||
148 | /** | ||
149 | * Creates a new adapter for an object of class '{@link modes3.Train <em>Train</em>}'. | ||
150 | * <!-- begin-user-doc --> | ||
151 | * This default implementation returns null so that we can easily ignore cases; | ||
152 | * it's useful to ignore a case when inheritance will catch all the cases anyway. | ||
153 | * <!-- end-user-doc --> | ||
154 | * @return the new adapter. | ||
155 | * @see modes3.Train | ||
156 | * @generated | ||
157 | */ | ||
158 | public Adapter createTrainAdapter() { | ||
159 | return null; | ||
160 | } | ||
161 | |||
162 | /** | ||
163 | * Creates a new adapter for the default case. | ||
164 | * <!-- begin-user-doc --> | ||
165 | * This default implementation returns null. | ||
166 | * <!-- end-user-doc --> | ||
167 | * @return the new adapter. | ||
168 | * @generated | ||
169 | */ | ||
170 | public Adapter createEObjectAdapter() { | ||
171 | return null; | ||
172 | } | ||
173 | |||
174 | } //Modes3AdapterFactory | ||
diff --git a/Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/util/Modes3Switch.java b/Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/util/Modes3Switch.java new file mode 100644 index 00000000..5dab272b --- /dev/null +++ b/Domains/ca.mcgill.rtgmrt.example.modes3/ecore-gen/modes3/util/Modes3Switch.java | |||
@@ -0,0 +1,174 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package modes3.util; | ||
4 | |||
5 | import modes3.*; | ||
6 | |||
7 | import org.eclipse.emf.ecore.EObject; | ||
8 | import org.eclipse.emf.ecore.EPackage; | ||
9 | |||
10 | import org.eclipse.emf.ecore.util.Switch; | ||
11 | |||
12 | /** | ||
13 | * <!-- begin-user-doc --> | ||
14 | * The <b>Switch</b> for the model's inheritance hierarchy. | ||
15 | * It supports the call {@link #doSwitch(EObject) doSwitch(object)} | ||
16 | * to invoke the <code>caseXXX</code> method for each class of the model, | ||
17 | * starting with the actual class of the object | ||
18 | * and proceeding up the inheritance hierarchy | ||
19 | * until a non-null result is returned, | ||
20 | * which is the result of the switch. | ||
21 | * <!-- end-user-doc --> | ||
22 | * @see modes3.Modes3Package | ||
23 | * @generated | ||
24 | */ | ||
25 | public class Modes3Switch<T> extends Switch<T> { | ||
26 | /** | ||
27 | * The cached model package | ||
28 | * <!-- begin-user-doc --> | ||
29 | * <!-- end-user-doc --> | ||
30 | * @generated | ||
31 | */ | ||
32 | protected static Modes3Package modelPackage; | ||
33 | |||
34 | /** | ||
35 | * Creates an instance of the switch. | ||
36 | * <!-- begin-user-doc --> | ||
37 | * <!-- end-user-doc --> | ||
38 | * @generated | ||
39 | */ | ||
40 | public Modes3Switch() { | ||
41 | if (modelPackage == null) { | ||
42 | modelPackage = Modes3Package.eINSTANCE; | ||
43 | } | ||
44 | } | ||
45 | |||
46 | /** | ||
47 | * Checks whether this is a switch for the given package. | ||
48 | * <!-- begin-user-doc --> | ||
49 | * <!-- end-user-doc --> | ||
50 | * @param ePackage the package in question. | ||
51 | * @return whether this is a switch for the given package. | ||
52 | * @generated | ||
53 | */ | ||
54 | @Override | ||
55 | protected boolean isSwitchFor(EPackage ePackage) { | ||
56 | return ePackage == modelPackage; | ||
57 | } | ||
58 | |||
59 | /** | ||
60 | * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result. | ||
61 | * <!-- begin-user-doc --> | ||
62 | * <!-- end-user-doc --> | ||
63 | * @return the first non-null result returned by a <code>caseXXX</code> call. | ||
64 | * @generated | ||
65 | */ | ||
66 | @Override | ||
67 | protected T doSwitch(int classifierID, EObject theEObject) { | ||
68 | switch (classifierID) { | ||
69 | case Modes3Package.SEGMENT: { | ||
70 | Segment segment = (Segment)theEObject; | ||
71 | T result = caseSegment(segment); | ||
72 | if (result == null) result = defaultCase(theEObject); | ||
73 | return result; | ||
74 | } | ||
75 | case Modes3Package.MODES3_MODEL_ROOT: { | ||
76 | Modes3ModelRoot modes3ModelRoot = (Modes3ModelRoot)theEObject; | ||
77 | T result = caseModes3ModelRoot(modes3ModelRoot); | ||
78 | if (result == null) result = defaultCase(theEObject); | ||
79 | return result; | ||
80 | } | ||
81 | case Modes3Package.TURNOUT: { | ||
82 | Turnout turnout = (Turnout)theEObject; | ||
83 | T result = caseTurnout(turnout); | ||
84 | if (result == null) result = caseSegment(turnout); | ||
85 | if (result == null) result = defaultCase(theEObject); | ||
86 | return result; | ||
87 | } | ||
88 | case Modes3Package.TRAIN: { | ||
89 | Train train = (Train)theEObject; | ||
90 | T result = caseTrain(train); | ||
91 | if (result == null) result = defaultCase(theEObject); | ||
92 | return result; | ||
93 | } | ||
94 | default: return defaultCase(theEObject); | ||
95 | } | ||
96 | } | ||
97 | |||
98 | /** | ||
99 | * Returns the result of interpreting the object as an instance of '<em>Segment</em>'. | ||
100 | * <!-- begin-user-doc --> | ||
101 | * This implementation returns null; | ||
102 | * returning a non-null result will terminate the switch. | ||
103 | * <!-- end-user-doc --> | ||
104 | * @param object the target of the switch. | ||
105 | * @return the result of interpreting the object as an instance of '<em>Segment</em>'. | ||
106 | * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) | ||
107 | * @generated | ||
108 | */ | ||
109 | public T caseSegment(Segment object) { | ||
110 | return null; | ||
111 | } | ||
112 | |||
113 | /** | ||
114 | * Returns the result of interpreting the object as an instance of '<em>Model Root</em>'. | ||
115 | * <!-- begin-user-doc --> | ||
116 | * This implementation returns null; | ||
117 | * returning a non-null result will terminate the switch. | ||
118 | * <!-- end-user-doc --> | ||
119 | * @param object the target of the switch. | ||
120 | * @return the result of interpreting the object as an instance of '<em>Model Root</em>'. | ||
121 | * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) | ||
122 | * @generated | ||
123 | */ | ||
124 | public T caseModes3ModelRoot(Modes3ModelRoot object) { | ||
125 | return null; | ||
126 | } | ||
127 | |||
128 | /** | ||
129 | * Returns the result of interpreting the object as an instance of '<em>Turnout</em>'. | ||
130 | * <!-- begin-user-doc --> | ||
131 | * This implementation returns null; | ||
132 | * returning a non-null result will terminate the switch. | ||
133 | * <!-- end-user-doc --> | ||
134 | * @param object the target of the switch. | ||
135 | * @return the result of interpreting the object as an instance of '<em>Turnout</em>'. | ||
136 | * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) | ||
137 | * @generated | ||
138 | */ | ||
139 | public T caseTurnout(Turnout object) { | ||
140 | return null; | ||
141 | } | ||
142 | |||
143 | /** | ||
144 | * Returns the result of interpreting the object as an instance of '<em>Train</em>'. | ||
145 | * <!-- begin-user-doc --> | ||
146 | * This implementation returns null; | ||
147 | * returning a non-null result will terminate the switch. | ||
148 | * <!-- end-user-doc --> | ||
149 | * @param object the target of the switch. | ||
150 | * @return the result of interpreting the object as an instance of '<em>Train</em>'. | ||
151 | * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) | ||
152 | * @generated | ||
153 | */ | ||
154 | public T caseTrain(Train object) { | ||
155 | return null; | ||
156 | } | ||
157 | |||
158 | /** | ||
159 | * Returns the result of interpreting the object as an instance of '<em>EObject</em>'. | ||
160 | * <!-- begin-user-doc --> | ||
161 | * This implementation returns null; | ||
162 | * returning a non-null result will terminate the switch, but this is the last case anyway. | ||
163 | * <!-- end-user-doc --> | ||
164 | * @param object the target of the switch. | ||
165 | * @return the result of interpreting the object as an instance of '<em>EObject</em>'. | ||
166 | * @see #doSwitch(org.eclipse.emf.ecore.EObject) | ||
167 | * @generated | ||
168 | */ | ||
169 | @Override | ||
170 | public T defaultCase(EObject object) { | ||
171 | return null; | ||
172 | } | ||
173 | |||
174 | } //Modes3Switch | ||
diff --git a/Domains/ca.mcgill.rtgmrt.example.modes3/model/modes3.aird_deactivated b/Domains/ca.mcgill.rtgmrt.example.modes3/model/modes3.aird_deactivated new file mode 100644 index 00000000..f5400732 --- /dev/null +++ b/Domains/ca.mcgill.rtgmrt.example.modes3/model/modes3.aird_deactivated | |||
@@ -0,0 +1,1531 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8"?> | ||
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="_R4-4YA7_Eee1dfpzdcS6YA" selectedViews="_R6jlsA7_Eee1dfpzdcS6YA _OHrasBFUEeeHWeeZwj2u8w _OH-VoBFUEeeHWeeZwj2u8w _OIvxsBFUEeeHWeeZwj2u8w" version="14.3.0.201909031200"> | ||
4 | <semanticResources>http://www.eclipse.org/emf/2002/Ecore</semanticResources> | ||
5 | <semanticResources>modes3.ecore</semanticResources> | ||
6 | <semanticResources>modes3.genmodel</semanticResources> | ||
7 | <semanticResources>../src/modes3/queries/Modes3Queries.vql</semanticResources> | ||
8 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch</semanticResources> | ||
9 | <semanticResources>java:/Objects/java.lang.Object</semanticResources> | ||
10 | <semanticResources>java:/Objects/jdk.internal.HotSpotIntrinsicCandidate</semanticResources> | ||
11 | <semanticResources>java:/Objects/java.lang.annotation.Target</semanticResources> | ||
12 | <semanticResources>java:/Objects/java.lang.annotation.ElementType</semanticResources> | ||
13 | <semanticResources>java:/Objects/java.lang.Enum</semanticResources> | ||
14 | <semanticResources>java:/Objects/java.lang.Comparable</semanticResources> | ||
15 | <semanticResources>java:/Primitives</semanticResources> | ||
16 | <semanticResources>java:/Objects/java.lang.CloneNotSupportedException</semanticResources> | ||
17 | <semanticResources>java:/Objects/java.lang.Exception</semanticResources> | ||
18 | <semanticResources>java:/Objects/java.lang.Throwable</semanticResources> | ||
19 | <semanticResources>java:/Objects/java.io.Serializable</semanticResources> | ||
20 | <semanticResources>java:/Objects/java.lang.Deprecated</semanticResources> | ||
21 | <semanticResources>java:/Objects/java.lang.annotation.Retention</semanticResources> | ||
22 | <semanticResources>java:/Objects/java.lang.annotation.RetentionPolicy</semanticResources> | ||
23 | <semanticResources>java:/Objects/java.lang.String</semanticResources> | ||
24 | <semanticResources>java:/Objects/java.lang.CharSequence</semanticResources> | ||
25 | <semanticResources>java:/Objects/java.util.stream.IntStream</semanticResources> | ||
26 | <semanticResources>java:/Objects/java.util.stream.BaseStream</semanticResources> | ||
27 | <semanticResources>java:/Objects/java.lang.AutoCloseable</semanticResources> | ||
28 | <semanticResources>java:/Objects/java.lang.Class</semanticResources> | ||
29 | <semanticResources>java:/Objects/java.lang.reflect.GenericDeclaration</semanticResources> | ||
30 | <semanticResources>java:/Objects/java.lang.reflect.AnnotatedElement</semanticResources> | ||
31 | <semanticResources>java:/Objects/java.lang.annotation.Annotation</semanticResources> | ||
32 | <semanticResources>java:/Objects/java.lang.InterruptedException</semanticResources> | ||
33 | <semanticResources>java:/Objects/java.lang.StackTraceElement</semanticResources> | ||
34 | <semanticResources>java:/Objects/java.lang.Module</semanticResources> | ||
35 | <semanticResources>java:/Objects/java.lang.WeakPairMap</semanticResources> | ||
36 | <semanticResources>java:/Objects/java.lang.ref.ReferenceQueue</semanticResources> | ||
37 | <semanticResources>java:/Objects/java.lang.ref.Reference</semanticResources> | ||
38 | <semanticResources>java:/Objects/java.lang.Thread</semanticResources> | ||
39 | <semanticResources>java:/Objects/java.lang.Runnable</semanticResources> | ||
40 | <semanticResources>java:/Objects/java.lang.FunctionalInterface</semanticResources> | ||
41 | <semanticResources>java:/Objects/java.lang.annotation.Documented</semanticResources> | ||
42 | <semanticResources>java:/Objects/java.io.ObjectInputStream</semanticResources> | ||
43 | <semanticResources>java:/Objects/java.io.InputStream</semanticResources> | ||
44 | <semanticResources>java:/Objects/java.io.Closeable</semanticResources> | ||
45 | <semanticResources>java:/Objects/java.io.IOException</semanticResources> | ||
46 | <semanticResources>java:/Objects/java.util.Comparator</semanticResources> | ||
47 | <semanticResources>java:/Objects/java.util.function.Function</semanticResources> | ||
48 | <semanticResources>java:/Objects/java.lang.ClassNotFoundException</semanticResources> | ||
49 | <semanticResources>java:/Objects/java.lang.ReflectiveOperationException</semanticResources> | ||
50 | <semanticResources>java:/Objects/java.lang.StringBuffer</semanticResources> | ||
51 | <semanticResources>java:/Objects/java.lang.AbstractStringBuilder</semanticResources> | ||
52 | <semanticResources>java:/Objects/java.lang.Appendable</semanticResources> | ||
53 | <semanticResources>java:/Objects/java.io.ObjectStreamException</semanticResources> | ||
54 | <semanticResources>java:/Objects/java.io.PrintStream</semanticResources> | ||
55 | <semanticResources>java:/Objects/java.io.FilterOutputStream</semanticResources> | ||
56 | <semanticResources>java:/Objects/java.io.OutputStream</semanticResources> | ||
57 | <semanticResources>java:/Objects/java.io.Flushable</semanticResources> | ||
58 | <semanticResources>java:/Objects/java.io.ObjectInput</semanticResources> | ||
59 | <semanticResources>java:/Objects/java.io.DataInput</semanticResources> | ||
60 | <semanticResources>java:/Objects/java.io.ObjectStreamConstants</semanticResources> | ||
61 | <semanticResources>java:/Objects/java.io.SerializablePermission</semanticResources> | ||
62 | <semanticResources>java:/Objects/java.security.BasicPermission</semanticResources> | ||
63 | <semanticResources>java:/Objects/java.security.Permission</semanticResources> | ||
64 | <semanticResources>java:/Objects/java.security.Guard</semanticResources> | ||
65 | <semanticResources>java:/Objects/java.lang.SecurityException</semanticResources> | ||
66 | <semanticResources>java:/Objects/java.lang.RuntimeException</semanticResources> | ||
67 | <semanticResources>java:/Objects/java.lang.StringBuilder</semanticResources> | ||
68 | <semanticResources>java:/Objects/java.io.ObjectOutputStream</semanticResources> | ||
69 | <semanticResources>java:/Objects/java.io.ObjectOutput</semanticResources> | ||
70 | <semanticResources>java:/Objects/java.io.DataOutput</semanticResources> | ||
71 | <semanticResources>java:/Objects/java.io.DataInputStream</semanticResources> | ||
72 | <semanticResources>java:/Objects/java.io.FilterInputStream</semanticResources> | ||
73 | <semanticResources>java:/Objects/java.util.concurrent.ConcurrentMap</semanticResources> | ||
74 | <semanticResources>java:/Objects/java.util.Map</semanticResources> | ||
75 | <semanticResources>java:/Objects/java.util.function.BiFunction</semanticResources> | ||
76 | <semanticResources>java:/Objects/java.io.PrintWriter</semanticResources> | ||
77 | <semanticResources>java:/Objects/java.io.Writer</semanticResources> | ||
78 | <semanticResources>java:/Objects/java.io.ObjectStreamClass</semanticResources> | ||
79 | <semanticResources>java:/Objects/java.io.InvalidClassException</semanticResources> | ||
80 | <semanticResources>java:/Objects/java.util.Set</semanticResources> | ||
81 | <semanticResources>java:/Objects/java.util.Collection</semanticResources> | ||
82 | <semanticResources>java:/Objects/java.lang.Iterable</semanticResources> | ||
83 | <semanticResources>java:/Objects/java.util.function.Consumer</semanticResources> | ||
84 | <semanticResources>java:/Objects/java.util.List</semanticResources> | ||
85 | <semanticResources>java:/Objects/java.util.Iterator</semanticResources> | ||
86 | <semanticResources>java:/Objects/java.lang.Boolean</semanticResources> | ||
87 | <semanticResources>java:/Objects/java.lang.StackFrameInfo</semanticResources> | ||
88 | <semanticResources>java:/Objects/java.lang.StackWalker</semanticResources> | ||
89 | <semanticResources>java:/Objects/java.lang.invoke.MethodType</semanticResources> | ||
90 | <semanticResources>java:/Objects/java.lang.ref.WeakReference</semanticResources> | ||
91 | <semanticResources>java:/Objects/java.lang.ThreadGroup</semanticResources> | ||
92 | <semanticResources>java:/Objects/java.lang.Void</semanticResources> | ||
93 | <semanticResources>java:/Objects/java.io.ObjectInputFilter</semanticResources> | ||
94 | <semanticResources>java:/Objects/java.lang.IllegalArgumentException</semanticResources> | ||
95 | <semanticResources>java:/Objects/java.io.UnsupportedEncodingException</semanticResources> | ||
96 | <semanticResources>java:/Objects/java.lang.reflect.Type</semanticResources> | ||
97 | <semanticResources>java:/Objects/java.lang.System</semanticResources> | ||
98 | <semanticResources>java:/Objects/java.util.function.Supplier</semanticResources> | ||
99 | <semanticResources>java:/Objects/java.lang.ClassLoader</semanticResources> | ||
100 | <semanticResources>java:/Objects/java.util.Deque</semanticResources> | ||
101 | <semanticResources>java:/Objects/java.util.Queue</semanticResources> | ||
102 | <semanticResources>java:/Objects/java.util.stream.Stream</semanticResources> | ||
103 | <semanticResources>java:/Objects/java.util.function.Predicate</semanticResources> | ||
104 | <semanticResources>java:/Objects/java.lang.module.ModuleDescriptor</semanticResources> | ||
105 | <semanticResources>java:/Objects/java.util.Optional</semanticResources> | ||
106 | <semanticResources>java:/Objects/java.io.ObjectInputValidation</semanticResources> | ||
107 | <semanticResources>java:/Objects/java.io.InvalidObjectException</semanticResources> | ||
108 | <semanticResources>java:/Objects/sun.reflect.annotation.AnnotationType</semanticResources> | ||
109 | <semanticResources>java:/Objects/java.lang.reflect.Method</semanticResources> | ||
110 | <semanticResources>java:/Objects/java.lang.reflect.Executable</semanticResources> | ||
111 | <semanticResources>java:/Objects/java.lang.reflect.AccessibleObject</semanticResources> | ||
112 | <semanticResources>java:/Objects/jdk.internal.reflect.CallerSensitive</semanticResources> | ||
113 | <semanticResources>java:/Objects/java.lang.ModuleLayer</semanticResources> | ||
114 | <semanticResources>java:/Objects/java.lang.module.Configuration</semanticResources> | ||
115 | <semanticResources>java:/Objects/java.lang.module.Resolver</semanticResources> | ||
116 | <semanticResources>java:/Objects/java.lang.module.ModuleFinder</semanticResources> | ||
117 | <semanticResources>java:/Objects/java.lang.module.ModuleReference</semanticResources> | ||
118 | <semanticResources>java:/Objects/java.net.URI</semanticResources> | ||
119 | <semanticResources>java:/Objects/java.net.URISyntaxException</semanticResources> | ||
120 | <semanticResources>java:/Objects/java.lang.ref.SoftReference</semanticResources> | ||
121 | <semanticResources>java:/Objects/jdk.internal.vm.annotation.ForceInline</semanticResources> | ||
122 | <semanticResources>java:/Objects/java.lang.module.ResolvedModule</semanticResources> | ||
123 | <semanticResources>java:/Objects/java.security.AccessControlContext</semanticResources> | ||
124 | <semanticResources>java:/Objects/java.security.ProtectionDomain</semanticResources> | ||
125 | <semanticResources>java:/Objects/sun.security.util.Debug</semanticResources> | ||
126 | <semanticResources>java:/Objects/java.math.BigInteger</semanticResources> | ||
127 | <semanticResources>java:/Objects/java.lang.Number</semanticResources> | ||
128 | <semanticResources>java:/Objects/java.io.StreamCorruptedException</semanticResources> | ||
129 | <semanticResources>java:/Objects/jdk.internal.misc.Unsafe</semanticResources> | ||
130 | <semanticResources>java:/Objects/java.lang.InstantiationException</semanticResources> | ||
131 | <semanticResources>java:/Objects/java.lang.reflect.Constructor</semanticResources> | ||
132 | <semanticResources>java:/Objects/jdk.internal.reflect.ConstructorAccessor</semanticResources> | ||
133 | <semanticResources>java:/Objects/java.lang.reflect.InvocationTargetException</semanticResources> | ||
134 | <semanticResources>java:/Objects/java.lang.reflect.Field</semanticResources> | ||
135 | <semanticResources>java:/Objects/java.lang.reflect.Member</semanticResources> | ||
136 | <semanticResources>java:/Objects/java.io.Externalizable</semanticResources> | ||
137 | <semanticResources>java:/Objects/java.io.NotActiveException</semanticResources> | ||
138 | <semanticResources>java:/Objects/java.lang.SecurityManager</semanticResources> | ||
139 | <semanticResources>java:/Objects/java.net.InetAddress</semanticResources> | ||
140 | <semanticResources>java:/Objects/java.net.UnknownHostException</semanticResources> | ||
141 | <semanticResources>java:/Objects/java.lang.reflect.AnnotatedType</semanticResources> | ||
142 | <semanticResources>java:/Objects/java.io.SerialCallbackContext</semanticResources> | ||
143 | <semanticResources>java:/Objects/java.security.PermissionCollection</semanticResources> | ||
144 | <semanticResources>java:/Objects/java.util.Enumeration</semanticResources> | ||
145 | <semanticResources>java:/Objects/java.util.stream.Collector</semanticResources> | ||
146 | <semanticResources>java:/Objects/java.util.function.BiConsumer</semanticResources> | ||
147 | <semanticResources>java:/Objects/java.util.concurrent.ConcurrentHashMap</semanticResources> | ||
148 | <semanticResources>java:/Objects/java.util.AbstractMap</semanticResources> | ||
149 | <semanticResources>java:/Objects/java.util.stream.DoubleStream</semanticResources> | ||
150 | <semanticResources>java:/Objects/java.lang.Double</semanticResources> | ||
151 | <semanticResources>java:/Objects/java.lang.NumberFormatException</semanticResources> | ||
152 | <semanticResources>java:/Objects/jdk.internal.reflect.ConstantPool</semanticResources> | ||
153 | <semanticResources>java:/Objects/sun.nio.ch.Interruptible</semanticResources> | ||
154 | <semanticResources>java:/Objects/java.util.stream.LongStream</semanticResources> | ||
155 | <semanticResources>java:/Objects/java.lang.Long</semanticResources> | ||
156 | <semanticResources>java:/Objects/java.lang.ThreadLocal</semanticResources> | ||
157 | <semanticResources>java:/Objects/java.util.concurrent.atomic.AtomicInteger</semanticResources> | ||
158 | <semanticResources>java:/Objects/java.util.function.IntBinaryOperator</semanticResources> | ||
159 | <semanticResources>java:/Objects/jdk.internal.vm.annotation.Contended</semanticResources> | ||
160 | <semanticResources>java:/Objects/java.security.DomainCombiner</semanticResources> | ||
161 | <semanticResources>java:/Objects/java.util.function.UnaryOperator</semanticResources> | ||
162 | <semanticResources>java:/Objects/java.security.AccessControlException</semanticResources> | ||
163 | <semanticResources>java:/Objects/java.lang.NoSuchMethodException</semanticResources> | ||
164 | <semanticResources>java:/Objects/java.lang.NoSuchFieldException</semanticResources> | ||
165 | <semanticResources>java:/Objects/sun.reflect.generics.factory.GenericsFactory</semanticResources> | ||
166 | <semanticResources>java:/Objects/java.lang.reflect.TypeVariable</semanticResources> | ||
167 | <semanticResources>java:/Objects/java.util.function.ToDoubleFunction</semanticResources> | ||
168 | <semanticResources>java:/Objects/jdk.internal.misc.JavaSecurityAccess</semanticResources> | ||
169 | <semanticResources>java:/Objects/java.security.PrivilegedAction</semanticResources> | ||
170 | <semanticResources>java:/Objects/java.util.function.ToIntFunction</semanticResources> | ||
171 | <semanticResources>java:/Objects/java.security.CodeSource</semanticResources> | ||
172 | <semanticResources>java:/Objects/java.net.URL</semanticResources> | ||
173 | <semanticResources>java:/Objects/java.net.URLStreamHandlerFactory</semanticResources> | ||
174 | <semanticResources>java:/Objects/java.net.URLStreamHandler</semanticResources> | ||
175 | <semanticResources>java:/Objects/java.net.URLConnection</semanticResources> | ||
176 | <semanticResources>java:/Objects/java.net.UnknownServiceException</semanticResources> | ||
177 | <semanticResources>java:/Objects/sun.reflect.generics.repository.ClassRepository</semanticResources> | ||
178 | <semanticResources>java:/Objects/sun.reflect.generics.repository.GenericDeclRepository</semanticResources> | ||
179 | <semanticResources>java:/Objects/sun.reflect.generics.repository.AbstractRepository</semanticResources> | ||
180 | <semanticResources>java:/Objects/sun.reflect.generics.visitor.Reifier</semanticResources> | ||
181 | <semanticResources>java:/Objects/sun.reflect.generics.visitor.TypeTreeVisitor</semanticResources> | ||
182 | <semanticResources>java:/Objects/sun.reflect.generics.tree.ArrayTypeSignature</semanticResources> | ||
183 | <semanticResources>java:/Objects/sun.reflect.generics.tree.FieldTypeSignature</semanticResources> | ||
184 | <semanticResources>java:/Objects/sun.reflect.generics.tree.BaseType</semanticResources> | ||
185 | <semanticResources>java:/Objects/sun.reflect.generics.tree.TypeSignature</semanticResources> | ||
186 | <semanticResources>java:/Objects/sun.reflect.generics.tree.ReturnType</semanticResources> | ||
187 | <semanticResources>java:/Objects/sun.reflect.generics.tree.TypeTree</semanticResources> | ||
188 | <semanticResources>java:/Objects/sun.reflect.generics.tree.Tree</semanticResources> | ||
189 | <semanticResources>java:/Objects/java.util.function.ToLongFunction</semanticResources> | ||
190 | <semanticResources>java:/Objects/java.security.Principal</semanticResources> | ||
191 | <semanticResources>java:/Objects/javax.security.auth.Subject</semanticResources> | ||
192 | <semanticResources>java:/Objects/javax.security.auth.AuthPermission</semanticResources> | ||
193 | <semanticResources>java:/Objects/java.security.cert.Certificate</semanticResources> | ||
194 | <semanticResources>java:/Objects/java.security.cert.CertificateEncodingException</semanticResources> | ||
195 | <semanticResources>java:/Objects/java.security.cert.CertificateException</semanticResources> | ||
196 | <semanticResources>java:/Objects/java.security.GeneralSecurityException</semanticResources> | ||
197 | <semanticResources>java:/Objects/java.nio.charset.Charset</semanticResources> | ||
198 | <semanticResources>java:/Objects/java.nio.charset.spi.CharsetProvider</semanticResources> | ||
199 | <semanticResources>java:/Objects/java.lang.SafeVarargs</semanticResources> | ||
200 | <semanticResources>java:/Objects/java.security.CodeSigner</semanticResources> | ||
201 | <semanticResources>java:/Objects/java.security.cert.CertPath</semanticResources> | ||
202 | <semanticResources>java:/Objects/java.util.function.BinaryOperator</semanticResources> | ||
203 | <semanticResources>java:/Objects/java.security.cert.CertificateFactory</semanticResources> | ||
204 | <semanticResources>java:/Objects/java.security.cert.CertificateFactorySpi</semanticResources> | ||
205 | <semanticResources>java:/Objects/java.security.cert.CRLException</semanticResources> | ||
206 | <semanticResources>java:/Objects/java.util.Locale</semanticResources> | ||
207 | <semanticResources>java:/Objects/java.lang.Cloneable</semanticResources> | ||
208 | <semanticResources>java:/Objects/java.util.function.IntFunction</semanticResources> | ||
209 | <semanticResources>java:/Objects/java.net.SocketPermission</semanticResources> | ||
210 | <semanticResources>java:/Objects/java.net.MalformedURLException</semanticResources> | ||
211 | <semanticResources>java:/Objects/java.lang.PublicMethods</semanticResources> | ||
212 | <semanticResources>java:/Objects/jdk.internal.reflect.ReflectionFactory</semanticResources> | ||
213 | <semanticResources>java:/Objects/java.lang.invoke.MethodHandle</semanticResources> | ||
214 | <semanticResources>java:/Objects/java.lang.invoke.LambdaForm</semanticResources> | ||
215 | <semanticResources>java:/Objects/sun.invoke.util.Wrapper</semanticResources> | ||
216 | <semanticResources>java:/Objects/java.lang.ClassCastException</semanticResources> | ||
217 | <semanticResources>java:/Objects/java.lang.Package</semanticResources> | ||
218 | <semanticResources>java:/Objects/java.lang.NamedPackage</semanticResources> | ||
219 | <semanticResources>java:/Objects/java.util.Spliterator</semanticResources> | ||
220 | <semanticResources>java:/Objects/java.util.function.DoubleConsumer</semanticResources> | ||
221 | <semanticResources>java:/Objects/java.net.Proxy</semanticResources> | ||
222 | <semanticResources>java:/Objects/java.net.SocketAddress</semanticResources> | ||
223 | <semanticResources>java:/Objects/java.lang.Integer</semanticResources> | ||
224 | <semanticResources>java:/Objects/java.net.spi.URLStreamHandlerProvider</semanticResources> | ||
225 | <semanticResources>java:/Objects/java.util.function.IntConsumer</semanticResources> | ||
226 | <semanticResources>java:/Objects/java.util.Hashtable</semanticResources> | ||
227 | <semanticResources>java:/Objects/java.util.Dictionary</semanticResources> | ||
228 | <semanticResources>java:/Objects/java.util.function.LongConsumer</semanticResources> | ||
229 | <semanticResources>java:/Objects/java.io.ObjectStreamField</semanticResources> | ||
230 | <semanticResources>java:/Objects/java.util.Random</semanticResources> | ||
231 | <semanticResources>java:/Objects/java.util.concurrent.atomic.AtomicLong</semanticResources> | ||
232 | <semanticResources>java:/Objects/java.util.function.LongBinaryOperator</semanticResources> | ||
233 | <semanticResources>java:/Objects/java.net.UrlDeserializedState</semanticResources> | ||
234 | <semanticResources>java:/Objects/java.util.function.LongUnaryOperator</semanticResources> | ||
235 | <semanticResources>java:/Objects/java.io.FileDescriptor</semanticResources> | ||
236 | <semanticResources>java:/Objects/jdk.internal.ref.PhantomCleanable</semanticResources> | ||
237 | <semanticResources>java:/Objects/java.lang.ref.PhantomReference</semanticResources> | ||
238 | <semanticResources>java:/Objects/java.io.DataOutputStream</semanticResources> | ||
239 | <semanticResources>java:/Objects/java.util.ListIterator</semanticResources> | ||
240 | <semanticResources>java:/Objects/java.io.SyncFailedException</semanticResources> | ||
241 | <semanticResources>java:/Objects/java.lang.IllegalAccessException</semanticResources> | ||
242 | <semanticResources>java:/Objects/java.lang.ClassValue</semanticResources> | ||
243 | <semanticResources>java:/Objects/java.util.WeakHashMap</semanticResources> | ||
244 | <semanticResources>java:/Objects/java.util.AbstractSet</semanticResources> | ||
245 | <semanticResources>java:/Objects/java.util.AbstractCollection</semanticResources> | ||
246 | <semanticResources>java:/Objects/jdk.internal.reflect.FieldAccessor</semanticResources> | ||
247 | <semanticResources>java:/Objects/sun.reflect.generics.repository.FieldRepository</semanticResources> | ||
248 | <semanticResources>java:/Objects/jdk.internal.reflect.MethodAccessor</semanticResources> | ||
249 | <semanticResources>java:/Objects/jdk.internal.reflect.LangReflectAccess</semanticResources> | ||
250 | <semanticResources>java:/Objects/java.util.function.DoublePredicate</semanticResources> | ||
251 | <semanticResources>java:/Objects/java.lang.ref.Cleaner</semanticResources> | ||
252 | <semanticResources>java:/Objects/java.util.concurrent.ThreadFactory</semanticResources> | ||
253 | <semanticResources>java:/Objects/java.io.OptionalDataException</semanticResources> | ||
254 | <semanticResources>java:/Objects/java.util.OptionalDouble</semanticResources> | ||
255 | <semanticResources>java:/Objects/java.util.function.DoubleSupplier</semanticResources> | ||
256 | <semanticResources>java:/Objects/jdk.internal.ref.CleanerImpl</semanticResources> | ||
257 | <semanticResources>java:/Objects/jdk.internal.ref.SoftCleanable</semanticResources> | ||
258 | <semanticResources>java:/Objects/sun.reflect.generics.repository.ConstructorRepository</semanticResources> | ||
259 | <semanticResources>java:/Objects/sun.reflect.generics.tree.MethodTypeSignature</semanticResources> | ||
260 | <semanticResources>java:/Objects/sun.reflect.generics.tree.Signature</semanticResources> | ||
261 | <semanticResources>java:/Objects/sun.reflect.generics.tree.FormalTypeParameter</semanticResources> | ||
262 | <semanticResources>java:/Objects/sun.reflect.generics.tree.TypeArgument</semanticResources> | ||
263 | <semanticResources>java:/Objects/sun.reflect.generics.tree.BooleanSignature</semanticResources> | ||
264 | <semanticResources>java:/Objects/sun.reflect.generics.tree.BottomSignature</semanticResources> | ||
265 | <semanticResources>java:/Objects/sun.reflect.generics.tree.ByteSignature</semanticResources> | ||
266 | <semanticResources>java:/Objects/sun.reflect.generics.tree.CharSignature</semanticResources> | ||
267 | <semanticResources>java:/Objects/sun.reflect.generics.tree.ClassTypeSignature</semanticResources> | ||
268 | <semanticResources>java:/Objects/sun.reflect.generics.tree.SimpleClassTypeSignature</semanticResources> | ||
269 | <semanticResources>java:/Objects/sun.reflect.generics.tree.DoubleSignature</semanticResources> | ||
270 | <semanticResources>java:/Objects/sun.reflect.generics.tree.FloatSignature</semanticResources> | ||
271 | <semanticResources>java:/Objects/sun.reflect.generics.tree.IntSignature</semanticResources> | ||
272 | <semanticResources>java:/Objects/sun.reflect.generics.tree.LongSignature</semanticResources> | ||
273 | <semanticResources>java:/Objects/sun.reflect.generics.tree.ShortSignature</semanticResources> | ||
274 | <semanticResources>java:/Objects/sun.reflect.generics.tree.TypeVariableSignature</semanticResources> | ||
275 | <semanticResources>java:/Objects/sun.reflect.generics.tree.VoidDescriptor</semanticResources> | ||
276 | <semanticResources>java:/Objects/sun.reflect.generics.tree.Wildcard</semanticResources> | ||
277 | <semanticResources>java:/Objects/sun.reflect.generics.visitor.Visitor</semanticResources> | ||
278 | <semanticResources>java:/Objects/sun.reflect.generics.tree.ClassSignature</semanticResources> | ||
279 | <semanticResources>java:/Objects/sun.reflect.generics.repository.MethodRepository</semanticResources> | ||
280 | <semanticResources>java:/Objects/jdk.internal.ref.WeakCleanable</semanticResources> | ||
281 | <semanticResources>java:/Objects/java.lang.invoke.BoundMethodHandle</semanticResources> | ||
282 | <semanticResources>java:/Objects/java.lang.invoke.ClassSpecializer</semanticResources> | ||
283 | <semanticResources>java:/Objects/jdk.internal.org.objectweb.asm.MethodVisitor</semanticResources> | ||
284 | <semanticResources>java:/Objects/jdk.internal.org.objectweb.asm.AnnotationVisitor</semanticResources> | ||
285 | <semanticResources>java:/Objects/java.lang.invoke.MemberName</semanticResources> | ||
286 | <semanticResources>java:/Objects/java.lang.invoke.ResolvedMethodName</semanticResources> | ||
287 | <semanticResources>java:/Objects/java.lang.invoke.MethodHandleImpl</semanticResources> | ||
288 | <semanticResources>java:/Objects/java.lang.invoke.DelegatingMethodHandle</semanticResources> | ||
289 | <semanticResources>java:/Objects/java.lang.reflect.Parameter</semanticResources> | ||
290 | <semanticResources>java:/Objects/java.lang.invoke.MethodTypeForm</semanticResources> | ||
291 | <semanticResources>java:/Objects/jdk.internal.vm.annotation.Stable</semanticResources> | ||
292 | <semanticResources>java:/Objects/java.util.function.IntUnaryOperator</semanticResources> | ||
293 | <semanticResources>java:/Objects/java.util.function.IntPredicate</semanticResources> | ||
294 | <semanticResources>java:/Objects/java.util.function.ObjIntConsumer</semanticResources> | ||
295 | <semanticResources>java:/Objects/java.util.OptionalInt</semanticResources> | ||
296 | <semanticResources>java:/Objects/java.util.function.IntSupplier</semanticResources> | ||
297 | <semanticResources>java:/Objects/java.util.PrimitiveIterator</semanticResources> | ||
298 | <semanticResources>java:/Objects/java.util.function.IntToDoubleFunction</semanticResources> | ||
299 | <semanticResources>java:/Objects/java.util.function.IntToLongFunction</semanticResources> | ||
300 | <semanticResources>java:/Objects/java.util.IntSummaryStatistics</semanticResources> | ||
301 | <semanticResources>java:/Objects/java.lang.TypeNotPresentException</semanticResources> | ||
302 | <semanticResources>java:/Objects/java.lang.UnsupportedOperationException</semanticResources> | ||
303 | <semanticResources>java:/Objects/java.io.FileNotFoundException</semanticResources> | ||
304 | <semanticResources>java:/Objects/java.util.function.ObjDoubleConsumer</semanticResources> | ||
305 | <semanticResources>java:/Objects/java.util.function.DoubleFunction</semanticResources> | ||
306 | <semanticResources>java:/Objects/java.util.function.DoubleUnaryOperator</semanticResources> | ||
307 | <semanticResources>java:/Objects/java.util.function.DoubleToIntFunction</semanticResources> | ||
308 | <semanticResources>java:/Objects/java.util.function.DoubleToLongFunction</semanticResources> | ||
309 | <semanticResources>java:/Objects/java.util.function.DoubleBinaryOperator</semanticResources> | ||
310 | <semanticResources>java:/Objects/java.util.DoubleSummaryStatistics</semanticResources> | ||
311 | <semanticResources>java:/Objects/java.lang.invoke.Invokers</semanticResources> | ||
312 | <semanticResources>java:/Objects/java.lang.invoke.VarHandle</semanticResources> | ||
313 | <semanticResources>java:/Objects/java.lang.invoke.VarForm</semanticResources> | ||
314 | <semanticResources>java:/Objects/java.lang.invoke.LambdaFormEditor</semanticResources> | ||
315 | <semanticResources>java:/Objects/java.lang.invoke.LambdaFormBuffer</semanticResources> | ||
316 | <semanticResources>java:/Objects/java.util.ArrayList</semanticResources> | ||
317 | <semanticResources>java:/Objects/java.util.AbstractList</semanticResources> | ||
318 | <semanticResources>java:/Objects/java.util.RandomAccess</semanticResources> | ||
319 | <semanticResources>java:/Objects/java.lang.IndexOutOfBoundsException</semanticResources> | ||
320 | <semanticResources>java:/Objects/java.util.function.LongPredicate</semanticResources> | ||
321 | <semanticResources>java:/Objects/java.util.function.ObjLongConsumer</semanticResources> | ||
322 | <semanticResources>java:/Objects/java.util.OptionalLong</semanticResources> | ||
323 | <semanticResources>java:/Objects/java.util.function.LongSupplier</semanticResources> | ||
324 | <semanticResources>java:/Objects/java.util.function.LongFunction</semanticResources> | ||
325 | <semanticResources>java:/Objects/java.util.function.LongToDoubleFunction</semanticResources> | ||
326 | <semanticResources>java:/Objects/java.util.function.LongToIntFunction</semanticResources> | ||
327 | <semanticResources>java:/Objects/java.util.LongSummaryStatistics</semanticResources> | ||
328 | <semanticResources>java:/Objects/java.util.concurrent.CountedCompleter</semanticResources> | ||
329 | <semanticResources>java:/Objects/java.util.concurrent.ForkJoinTask</semanticResources> | ||
330 | <semanticResources>java:/Objects/java.util.concurrent.Future</semanticResources> | ||
331 | <semanticResources>java:/Objects/java.util.concurrent.ExecutionException</semanticResources> | ||
332 | <semanticResources>java:/Objects/java.io.File</semanticResources> | ||
333 | <semanticResources>java:/Objects/java.security.SecureRandom</semanticResources> | ||
334 | <semanticResources>java:/Objects/java.util.regex.Pattern</semanticResources> | ||
335 | <semanticResources>java:/Objects/java.util.regex.Matcher</semanticResources> | ||
336 | <semanticResources>java:/Objects/java.util.regex.MatchResult</semanticResources> | ||
337 | <semanticResources>java:/Objects/java.util.function.ToDoubleBiFunction</semanticResources> | ||
338 | <semanticResources>java:/Objects/java.lang.invoke.CallSite</semanticResources> | ||
339 | <semanticResources>java:/Objects/java.lang.invoke.WrongMethodTypeException</semanticResources> | ||
340 | <semanticResources>java:/Objects/java.io.OutputStreamWriter</semanticResources> | ||
341 | <semanticResources>java:/Objects/java.nio.charset.CharsetEncoder</semanticResources> | ||
342 | <semanticResources>java:/Objects/java.nio.CharBuffer</semanticResources> | ||
343 | <semanticResources>java:/Objects/java.nio.Buffer</semanticResources> | ||
344 | <semanticResources>java:/Objects/java.util.function.ToIntBiFunction</semanticResources> | ||
345 | <semanticResources>java:/Objects/jdk.internal.vm.annotation.DontInline</semanticResources> | ||
346 | <semanticResources>java:/Objects/java.lang.ArrayIndexOutOfBoundsException</semanticResources> | ||
347 | <semanticResources>java:/Objects/java.lang.ClassFormatError</semanticResources> | ||
348 | <semanticResources>java:/Objects/java.lang.LinkageError</semanticResources> | ||
349 | <semanticResources>java:/Objects/java.lang.Error</semanticResources> | ||
350 | <semanticResources>java:/Objects/java.nio.ByteBuffer</semanticResources> | ||
351 | <semanticResources>java:/Objects/java.nio.DoubleBuffer</semanticResources> | ||
352 | <semanticResources>java:/Objects/java.nio.ByteOrder</semanticResources> | ||
353 | <semanticResources>java:/Objects/java.util.function.ToLongBiFunction</semanticResources> | ||
354 | <semanticResources>java:/Objects/java.lang.invoke.MethodHandleNatives</semanticResources> | ||
355 | <semanticResources>java:/Objects/java.lang.NoSuchMethodError</semanticResources> | ||
356 | <semanticResources>java:/Objects/java.lang.IncompatibleClassChangeError</semanticResources> | ||
357 | <semanticResources>java:/Objects/java.lang.AssertionStatusDirectives</semanticResources> | ||
358 | <semanticResources>java:/Objects/java.util.concurrent.atomic.AtomicReference</semanticResources> | ||
359 | <semanticResources>java:/Objects/java.util.concurrent.locks.ReentrantLock</semanticResources> | ||
360 | <semanticResources>java:/Objects/java.util.concurrent.locks.Lock</semanticResources> | ||
361 | <semanticResources>java:/Objects/java.util.concurrent.locks.Condition</semanticResources> | ||
362 | <semanticResources>java:/Objects/java.util.concurrent.TimeUnit</semanticResources> | ||
363 | <semanticResources>java:/Objects/java.time.Duration</semanticResources> | ||
364 | <semanticResources>java:/Objects/java.time.temporal.TemporalAmount</semanticResources> | ||
365 | <semanticResources>java:/Objects/java.time.temporal.Temporal</semanticResources> | ||
366 | <semanticResources>java:/Objects/java.time.temporal.TemporalAccessor</semanticResources> | ||
367 | <semanticResources>java:/Objects/java.time.temporal.TemporalField</semanticResources> | ||
368 | <semanticResources>java:/Objects/java.time.temporal.TemporalUnit</semanticResources> | ||
369 | <semanticResources>java:/Objects/java.util.concurrent.RunnableFuture</semanticResources> | ||
370 | <semanticResources>java:/Objects/jdk.internal.perf.PerfCounter</semanticResources> | ||
371 | <semanticResources>java:/Objects/java.nio.LongBuffer</semanticResources> | ||
372 | <semanticResources>java:/Objects/java.net.ContentHandler</semanticResources> | ||
373 | <semanticResources>java:/Objects/java.util.concurrent.Callable</semanticResources> | ||
374 | <semanticResources>java:/Objects/jdk.internal.misc.JavaLangInvokeAccess</semanticResources> | ||
375 | <semanticResources>java:/Objects/java.util.HashMap</semanticResources> | ||
376 | <semanticResources>java:/Objects/java.util.LinkedHashMap</semanticResources> | ||
377 | <semanticResources>java:/Objects/jdk.internal.perf.Perf</semanticResources> | ||
378 | <semanticResources>java:/Objects/java.util.concurrent.TimeoutException</semanticResources> | ||
379 | <semanticResources>java:/Objects/java.util.Vector</semanticResources> | ||
380 | <semanticResources>java:/Objects/java.nio.FloatBuffer</semanticResources> | ||
381 | <semanticResources>java:/Objects/java.net.FileNameMap</semanticResources> | ||
382 | <semanticResources>java:/Objects/java.util.concurrent.ForkJoinPool</semanticResources> | ||
383 | <semanticResources>java:/Objects/java.util.concurrent.AbstractExecutorService</semanticResources> | ||
384 | <semanticResources>java:/Objects/java.util.concurrent.ExecutorService</semanticResources> | ||
385 | <semanticResources>java:/Objects/java.util.concurrent.Executor</semanticResources> | ||
386 | <semanticResources>java:/Objects/java.time.temporal.ChronoUnit</semanticResources> | ||
387 | <semanticResources>java:/Objects/java.nio.IntBuffer</semanticResources> | ||
388 | <semanticResources>java:/Objects/java.net.ContentHandlerFactory</semanticResources> | ||
389 | <semanticResources>java:/Objects/java.math.BigDecimal</semanticResources> | ||
390 | <semanticResources>java:/Objects/java.math.MathContext</semanticResources> | ||
391 | <semanticResources>java:/Objects/java.math.RoundingMode</semanticResources> | ||
392 | <semanticResources>java:/Objects/java.nio.ShortBuffer</semanticResources> | ||
393 | <semanticResources>java:/Objects/sun.net.www.MessageHeader</semanticResources> | ||
394 | <semanticResources>java:/Objects/java.util.regex.PatternSyntaxException</semanticResources> | ||
395 | <semanticResources>java:/Objects/java.security.Timestamp</semanticResources> | ||
396 | <semanticResources>java:/Objects/java.util.Date</semanticResources> | ||
397 | <semanticResources>java:/Objects/java.time.Instant</semanticResources> | ||
398 | <semanticResources>java:/Objects/java.time.temporal.TemporalAdjuster</semanticResources> | ||
399 | <semanticResources>java:/Objects/java.lang.Readable</semanticResources> | ||
400 | <semanticResources>java:/Objects/java.util.regex.IntHashSet</semanticResources> | ||
401 | <semanticResources>java:/Objects/java.time.temporal.TemporalQuery</semanticResources> | ||
402 | <semanticResources>java:/Objects/jdk.internal.org.objectweb.asm.Attribute</semanticResources> | ||
403 | <semanticResources>java:/Objects/jdk.internal.org.objectweb.asm.ClassReader</semanticResources> | ||
404 | <semanticResources>java:/Objects/jdk.internal.org.objectweb.asm.ClassVisitor</semanticResources> | ||
405 | <semanticResources>java:/Objects/jdk.internal.org.objectweb.asm.FieldVisitor</semanticResources> | ||
406 | <semanticResources>java:/Objects/jdk.internal.org.objectweb.asm.TypePath</semanticResources> | ||
407 | <semanticResources>java:/Objects/java.time.temporal.ValueRange</semanticResources> | ||
408 | <semanticResources>java:/Objects/jdk.internal.org.objectweb.asm.Handle</semanticResources> | ||
409 | <semanticResources>java:/Objects/java.time.format.ResolverStyle</semanticResources> | ||
410 | <semanticResources>java:/Objects/jdk.internal.org.objectweb.asm.Label</semanticResources> | ||
411 | <semanticResources>java:/Objects/jdk.internal.org.objectweb.asm.MethodWriter</semanticResources> | ||
412 | <semanticResources>java:/Objects/jdk.internal.org.objectweb.asm.ClassWriter</semanticResources> | ||
413 | <semanticResources>java:/Objects/jdk.internal.org.objectweb.asm.Item</semanticResources> | ||
414 | <semanticResources>java:/Objects/sun.util.locale.InternalLocaleBuilder</semanticResources> | ||
415 | <semanticResources>java:/Objects/sun.util.locale.LocaleSyntaxException</semanticResources> | ||
416 | <semanticResources>java:/Objects/sun.util.calendar.BaseCalendar</semanticResources> | ||
417 | <semanticResources>java:/Objects/sun.util.calendar.AbstractCalendar</semanticResources> | ||
418 | <semanticResources>java:/Objects/sun.util.calendar.CalendarSystem</semanticResources> | ||
419 | <semanticResources>java:/Objects/sun.util.calendar.CalendarDate</semanticResources> | ||
420 | <semanticResources>java:/Objects/java.util.TimeZone</semanticResources> | ||
421 | <semanticResources>java:/Objects/java.time.ZoneId</semanticResources> | ||
422 | <semanticResources>java:/Objects/java.time.format.TextStyle</semanticResources> | ||
423 | <semanticResources>java:/Objects/jdk.internal.org.objectweb.asm.ByteVector</semanticResources> | ||
424 | <semanticResources>java:/Objects/sun.util.locale.LocaleObjectCache</semanticResources> | ||
425 | <semanticResources>java:/Objects/sun.util.locale.BaseLocale</semanticResources> | ||
426 | <semanticResources>java:/Objects/sun.util.locale.LocaleExtensions</semanticResources> | ||
427 | <semanticResources>java:/Objects/java.lang.Character</semanticResources> | ||
428 | <semanticResources>java:/Objects/jdk.internal.org.objectweb.asm.Context</semanticResources> | ||
429 | <semanticResources>java:/Objects/sun.util.locale.provider.LocaleServiceProviderPool</semanticResources> | ||
430 | <semanticResources>java:/Objects/java.util.spi.LocaleServiceProvider</semanticResources> | ||
431 | <semanticResources>java:/Objects/java.math.MutableBigInteger</semanticResources> | ||
432 | <semanticResources>java:/Objects/java.util.spi.LocaleNameProvider</semanticResources> | ||
433 | <semanticResources>java:/Objects/java.util.concurrent.ForkJoinWorkerThread</semanticResources> | ||
434 | <semanticResources>java:/Objects/java.util.ResourceBundle</semanticResources> | ||
435 | <semanticResources>java:/Objects/java.util.ServiceLoader</semanticResources> | ||
436 | <semanticResources>java:/Objects/jdk.internal.module.ServicesCatalog</semanticResources> | ||
437 | <semanticResources>java:/Objects/jdk.internal.loader.ClassLoaderValue</semanticResources> | ||
438 | <semanticResources>java:/Objects/jdk.internal.loader.AbstractClassLoaderValue</semanticResources> | ||
439 | <semanticResources>java:/Objects/java.lang.IllegalStateException</semanticResources> | ||
440 | <semanticResources>java:/Objects/java.util.Formatter</semanticResources> | ||
441 | <semanticResources>java:/Objects/java.util.Calendar</semanticResources> | ||
442 | <semanticResources>java:/Objects/java.text.DateFormatSymbols</semanticResources> | ||
443 | <semanticResources>java:/Objects/java.lang.RuntimePermission</semanticResources> | ||
444 | <semanticResources>java:/Objects/jdk.internal.org.objectweb.asm.ModuleVisitor</semanticResources> | ||
445 | <semanticResources>java:/Objects/sun.util.locale.provider.LocaleResources</semanticResources> | ||
446 | <semanticResources>java:/Objects/sun.util.locale.provider.ResourceBundleBasedAdapter</semanticResources> | ||
447 | <semanticResources>java:/Objects/sun.util.resources.LocaleData</semanticResources> | ||
448 | <semanticResources>java:/Objects/java.util.spi.ResourceBundleProvider</semanticResources> | ||
449 | <semanticResources>java:/Objects/jdk.internal.vm.annotation.ReservedStackAccess</semanticResources> | ||
450 | <semanticResources>java:/Objects/jdk.internal.org.objectweb.asm.AnnotationWriter</semanticResources> | ||
451 | <semanticResources>java:/Objects/jdk.internal.org.objectweb.asm.FieldWriter</semanticResources> | ||
452 | <semanticResources>java:/Objects/jdk.internal.org.objectweb.asm.ModuleWriter</semanticResources> | ||
453 | <semanticResources>java:/Objects/java.util.MissingResourceException</semanticResources> | ||
454 | <semanticResources>java:/Objects/java.io.BufferedWriter</semanticResources> | ||
455 | <semanticResources>java:/Objects/sun.util.locale.LanguageTag</semanticResources> | ||
456 | <semanticResources>java:/Objects/sun.util.locale.ParseStatus</semanticResources> | ||
457 | <semanticResources>java:/Objects/sun.util.locale.StringTokenIterator</semanticResources> | ||
458 | <semanticResources>java:/Objects/sun.util.locale.Extension</semanticResources> | ||
459 | <semanticResources>java:/Objects/java.util.SortedMap</semanticResources> | ||
460 | <semanticResources>java:/Objects/jdk.internal.org.objectweb.asm.Frame</semanticResources> | ||
461 | <semanticResources>java:/Objects/jdk.internal.org.objectweb.asm.Type</semanticResources> | ||
462 | <semanticResources>java:/Objects/sun.util.locale.provider.LocaleProviderAdapter</semanticResources> | ||
463 | <semanticResources>java:/Objects/sun.util.locale.provider.FallbackLocaleProviderAdapter</semanticResources> | ||
464 | <semanticResources>java:/Objects/sun.util.locale.provider.JRELocaleProviderAdapter</semanticResources> | ||
465 | <semanticResources>java:/Objects/java.text.spi.BreakIteratorProvider</semanticResources> | ||
466 | <semanticResources>java:/Objects/java.text.BreakIterator</semanticResources> | ||
467 | <semanticResources>java:/Objects/java.text.CharacterIterator</semanticResources> | ||
468 | <semanticResources>java:/Objects/sun.util.calendar.Era</semanticResources> | ||
469 | <semanticResources>java:/Objects/java.util.concurrent.locks.AbstractQueuedSynchronizer</semanticResources> | ||
470 | <semanticResources>java:/Objects/java.util.concurrent.locks.AbstractOwnableSynchronizer</semanticResources> | ||
471 | <semanticResources>java:/Objects/java.io.FilenameFilter</semanticResources> | ||
472 | <semanticResources>java:/Objects/jdk.internal.org.objectweb.asm.Handler</semanticResources> | ||
473 | <semanticResources>java:/Objects/sun.util.calendar.Gregorian</semanticResources> | ||
474 | <semanticResources>java:/Objects/java.time.ZoneOffset</semanticResources> | ||
475 | <semanticResources>java:/Objects/java.time.zone.ZoneRules</semanticResources> | ||
476 | <semanticResources>java:/Objects/java.time.zone.ZoneOffsetTransition</semanticResources> | ||
477 | <semanticResources>java:/Objects/java.time.LocalDateTime</semanticResources> | ||
478 | <semanticResources>java:/Objects/java.time.chrono.ChronoLocalDateTime</semanticResources> | ||
479 | <semanticResources>java:/Objects/java.time.chrono.ChronoZonedDateTime</semanticResources> | ||
480 | <semanticResources>java:/Objects/java.time.format.DateTimeFormatter</semanticResources> | ||
481 | <semanticResources>java:/Objects/java.text.Format</semanticResources> | ||
482 | <semanticResources>java:/Objects/java.text.AttributedCharacterIterator</semanticResources> | ||
483 | <semanticResources>java:/Objects/java.time.zone.ZoneOffsetTransitionRule</semanticResources> | ||
484 | <semanticResources>java:/Objects/java.time.Month</semanticResources> | ||
485 | <semanticResources>java:/Objects/jdk.internal.org.objectweb.asm.Edge</semanticResources> | ||
486 | <semanticResources>java:/Objects/java.time.DayOfWeek</semanticResources> | ||
487 | <semanticResources>java:/Objects/sun.invoke.empty.Empty</semanticResources> | ||
488 | <semanticResources>java:/Objects/java.time.LocalTime</semanticResources> | ||
489 | <semanticResources>java:/Objects/java.time.LocalDate</semanticResources> | ||
490 | <semanticResources>java:/Objects/java.time.chrono.ChronoLocalDate</semanticResources> | ||
491 | <semanticResources>java:/Objects/java.time.chrono.Chronology</semanticResources> | ||
492 | <semanticResources>java:/Objects/java.time.chrono.Era</semanticResources> | ||
493 | <semanticResources>java:/Objects/java.lang.InternalError</semanticResources> | ||
494 | <semanticResources>java:/Objects/java.lang.VirtualMachineError</semanticResources> | ||
495 | <semanticResources>java:/Objects/java.io.FileFilter</semanticResources> | ||
496 | <semanticResources>java:/Objects/java.lang.reflect.ParameterizedType</semanticResources> | ||
497 | <semanticResources>java:/Objects/java.time.OffsetTime</semanticResources> | ||
498 | <semanticResources>java:/Objects/java.time.OffsetDateTime</semanticResources> | ||
499 | <semanticResources>java:/Objects/java.time.ZonedDateTime</semanticResources> | ||
500 | <semanticResources>java:/Objects/java.time.Clock</semanticResources> | ||
501 | <semanticResources>java:/Objects/java.lang.reflect.WildcardType</semanticResources> | ||
502 | <semanticResources>java:/Objects/java.time.Period</semanticResources> | ||
503 | <semanticResources>java:/Objects/java.time.chrono.ChronoPeriod</semanticResources> | ||
504 | <semanticResources>java:/Objects/java.net.NetworkInterface</semanticResources> | ||
505 | <semanticResources>java:/Objects/java.net.SocketException</semanticResources> | ||
506 | <semanticResources>java:/Objects/java.util.spi.ResourceBundleControlProvider</semanticResources> | ||
507 | <semanticResources>java:/Objects/java.time.chrono.IsoChronology</semanticResources> | ||
508 | <semanticResources>java:/Objects/java.time.chrono.AbstractChronology</semanticResources> | ||
509 | <semanticResources>java:/Objects/java.time.temporal.ChronoField</semanticResources> | ||
510 | <semanticResources>java:/Objects/java.net.InetAddressImpl</semanticResources> | ||
511 | <semanticResources>java:/Objects/java.time.chrono.IsoEra</semanticResources> | ||
512 | <semanticResources>java:/Objects/java.util.NavigableSet</semanticResources> | ||
513 | <semanticResources>java:/Objects/java.util.SortedSet</semanticResources> | ||
514 | <semanticResources>java:/Objects/java.net.InterfaceAddress</semanticResources> | ||
515 | <semanticResources>java:/Objects/java.net.Inet4Address</semanticResources> | ||
516 | <semanticResources>java:/Objects/java.security.PublicKey</semanticResources> | ||
517 | <semanticResources>java:/Objects/java.security.Key</semanticResources> | ||
518 | <semanticResources>java:/Objects/java.text.FieldPosition</semanticResources> | ||
519 | <semanticResources>java:/Objects/java.text.ParseException</semanticResources> | ||
520 | <semanticResources>java:/Objects/java.util.ServiceConfigurationError</semanticResources> | ||
521 | <semanticResources>java:/Objects/java.nio.file.Path</semanticResources> | ||
522 | <semanticResources>java:/Objects/java.nio.file.Watchable</semanticResources> | ||
523 | <semanticResources>java:/Objects/java.nio.file.WatchService</semanticResources> | ||
524 | <semanticResources>java:/Objects/java.nio.file.WatchKey</semanticResources> | ||
525 | <semanticResources>java:/Objects/java.nio.file.WatchEvent</semanticResources> | ||
526 | <semanticResources>java:/Objects/java.text.ParsePosition</semanticResources> | ||
527 | <semanticResources>java:/Objects/java.time.format.DateTimeFormatterBuilder</semanticResources> | ||
528 | <semanticResources>java:/Objects/java.time.format.DateTimePrintContext</semanticResources> | ||
529 | <semanticResources>java:/Objects/java.time.format.DecimalStyle</semanticResources> | ||
530 | <semanticResources>java:/Objects/java.time.format.DateTimeParseException</semanticResources> | ||
531 | <semanticResources>java:/Objects/java.time.DateTimeException</semanticResources> | ||
532 | <semanticResources>java:/Objects/java.io.FileSystem</semanticResources> | ||
533 | <semanticResources>java:/Objects/java.time.format.FormatStyle</semanticResources> | ||
534 | <semanticResources>java:/Objects/java.security.NoSuchAlgorithmException</semanticResources> | ||
535 | <semanticResources>java:/Objects/java.security.SecureRandomSpi</semanticResources> | ||
536 | <semanticResources>java:/Objects/java.security.SecureRandomParameters</semanticResources> | ||
537 | <semanticResources>java:/Objects/java.time.format.DateTimeParseContext</semanticResources> | ||
538 | <semanticResources>java:/Objects/java.time.format.Parsed</semanticResources> | ||
539 | <semanticResources>java:/Objects/java.io.BufferedReader</semanticResources> | ||
540 | <semanticResources>java:/Objects/java.io.Reader</semanticResources> | ||
541 | <semanticResources>java:/Objects/java.time.format.SignStyle</semanticResources> | ||
542 | <semanticResources>java:/Objects/java.security.InvalidKeyException</semanticResources> | ||
543 | <semanticResources>java:/Objects/java.security.KeyException</semanticResources> | ||
544 | <semanticResources>java:/Objects/java.security.Provider</semanticResources> | ||
545 | <semanticResources>java:/Objects/java.util.Properties</semanticResources> | ||
546 | <semanticResources>java:/Objects/java.util.InvalidPropertiesFormatException</semanticResources> | ||
547 | <semanticResources>java:/Objects/java.io.NotSerializableException</semanticResources> | ||
548 | <semanticResources>java:/Objects/jdk.internal.misc.JavaLangAccess</semanticResources> | ||
549 | <semanticResources>java:/Objects/java.nio.charset.CharacterCodingException</semanticResources> | ||
550 | <semanticResources>java:/Objects/java.security.NoSuchProviderException</semanticResources> | ||
551 | <semanticResources>java:/Objects/java.lang.LayerInstantiationException</semanticResources> | ||
552 | <semanticResources>java:/Objects/java.security.MessageDigest</semanticResources> | ||
553 | <semanticResources>java:/Objects/java.security.MessageDigestSpi</semanticResources> | ||
554 | <semanticResources>java:/Objects/java.security.DigestException</semanticResources> | ||
555 | <semanticResources>java:/Objects/java.time.format.DateTimeTextProvider</semanticResources> | ||
556 | <semanticResources>java:/Objects/sun.security.util.MessageDigestSpi2</semanticResources> | ||
557 | <semanticResources>java:/Objects/javax.crypto.SecretKey</semanticResources> | ||
558 | <semanticResources>java:/Objects/javax.security.auth.Destroyable</semanticResources> | ||
559 | <semanticResources>java:/Objects/javax.security.auth.DestroyFailedException</semanticResources> | ||
560 | <semanticResources>java:/Objects/jdk.internal.module.ModuleTarget</semanticResources> | ||
561 | <semanticResources>java:/Objects/java.nio.file.FileSystem</semanticResources> | ||
562 | <semanticResources>java:/Objects/java.nio.file.FileStore</semanticResources> | ||
563 | <semanticResources>java:/Objects/java.nio.file.attribute.FileStoreAttributeView</semanticResources> | ||
564 | <semanticResources>java:/Objects/java.nio.file.attribute.AttributeView</semanticResources> | ||
565 | <semanticResources>java:/Objects/java.nio.file.LinkOption</semanticResources> | ||
566 | <semanticResources>java:/Objects/java.nio.file.OpenOption</semanticResources> | ||
567 | <semanticResources>java:/Objects/java.nio.file.PathMatcher</semanticResources> | ||
568 | <semanticResources>java:/Objects/java.security.SignatureException</semanticResources> | ||
569 | <semanticResources>java:/Objects/java.nio.file.attribute.UserPrincipalLookupService</semanticResources> | ||
570 | <semanticResources>java:/Objects/java.nio.file.attribute.GroupPrincipal</semanticResources> | ||
571 | <semanticResources>java:/Objects/java.nio.file.attribute.UserPrincipal</semanticResources> | ||
572 | <semanticResources>java:/Objects/java.nio.file.spi.FileSystemProvider</semanticResources> | ||
573 | <semanticResources>java:/Objects/java.nio.file.AccessMode</semanticResources> | ||
574 | <semanticResources>java:/Objects/java.nio.charset.CharsetDecoder</semanticResources> | ||
575 | <semanticResources>java:/Objects/java.nio.charset.CoderResult</semanticResources> | ||
576 | <semanticResources>java:/Objects/java.nio.file.attribute.FileAttributeView</semanticResources> | ||
577 | <semanticResources>java:/Objects/java.util.LinkedList</semanticResources> | ||
578 | <semanticResources>java:/Objects/java.util.AbstractSequentialList</semanticResources> | ||
579 | <semanticResources>java:/Objects/sun.util.resources.Bundles</semanticResources> | ||
580 | <semanticResources>java:/Objects/jdk.internal.misc.JavaUtilResourceBundleAccess</semanticResources> | ||
581 | <semanticResources>java:/Objects/java.util.EnumSet</semanticResources> | ||
582 | <semanticResources>java:/Objects/java.security.cert.CRL</semanticResources> | ||
583 | <semanticResources>java:/Objects/java.security.PrivilegedExceptionAction</semanticResources> | ||
584 | <semanticResources>java:/Objects/java.security.PrivilegedActionException</semanticResources> | ||
585 | <semanticResources>java:/Objects/java.lang.module.ModuleReader</semanticResources> | ||
586 | <semanticResources>java:/Objects/java.nio.file.CopyOption</semanticResources> | ||
587 | <semanticResources>java:/Objects/java.nio.file.attribute.FileAttribute</semanticResources> | ||
588 | <semanticResources>java:/Objects/java.nio.channels.AsynchronousFileChannel</semanticResources> | ||
589 | <semanticResources>java:/Objects/java.nio.channels.AsynchronousChannel</semanticResources> | ||
590 | <semanticResources>java:/Objects/java.nio.channels.Channel</semanticResources> | ||
591 | <semanticResources>java:/Objects/java.nio.channels.SeekableByteChannel</semanticResources> | ||
592 | <semanticResources>java:/Objects/java.nio.channels.ByteChannel</semanticResources> | ||
593 | <semanticResources>java:/Objects/java.nio.channels.ReadableByteChannel</semanticResources> | ||
594 | <semanticResources>java:/Objects/java.nio.file.DirectoryStream</semanticResources> | ||
595 | <semanticResources>java:/Objects/sun.util.resources.OpenListResourceBundle</semanticResources> | ||
596 | <semanticResources>java:/Objects/java.nio.channels.FileChannel</semanticResources> | ||
597 | <semanticResources>java:/Objects/java.nio.channels.spi.AbstractInterruptibleChannel</semanticResources> | ||
598 | <semanticResources>java:/Objects/java.nio.channels.InterruptibleChannel</semanticResources> | ||
599 | <semanticResources>java:/Objects/java.nio.file.attribute.BasicFileAttributes</semanticResources> | ||
600 | <semanticResources>java:/Objects/java.nio.file.attribute.FileTime</semanticResources> | ||
601 | <semanticResources>java:/Objects/java.nio.channels.FileLock</semanticResources> | ||
602 | <semanticResources>java:/Objects/java.nio.channels.WritableByteChannel</semanticResources> | ||
603 | <semanticResources>java:/Objects/java.nio.channels.CompletionHandler</semanticResources> | ||
604 | <semanticResources>java:/Objects/java.nio.channels.GatheringByteChannel</semanticResources> | ||
605 | <semanticResources>java:/Objects/java.nio.channels.ScatteringByteChannel</semanticResources> | ||
606 | <semanticResources>java:/Objects/java.nio.MappedByteBuffer</semanticResources> | ||
607 | <semanticResources>java:/Objects/sun.util.resources.TimeZoneNamesBundle</semanticResources> | ||
608 | <semanticResources>java:/Objects/java.nio.channels.AsynchronousCloseException</semanticResources> | ||
609 | <semanticResources>java:/Objects/java.nio.channels.ClosedChannelException</semanticResources> | ||
610 | <semanticResources>java:/Objects/sun.nio.cs.StreamEncoder</semanticResources> | ||
611 | <semanticResources>java:/Objects/sun.util.resources.ParallelListResourceBundle</semanticResources> | ||
612 | <semanticResources>java:/Objects/java.util.concurrent.atomic.AtomicMarkableReference</semanticResources> | ||
613 | <semanticResources>java:/Objects/java.nio.charset.CodingErrorAction</semanticResources> | ||
614 | <semanticResources>java:/Objects/java.util.spi.CalendarDataProvider</semanticResources> | ||
615 | <semanticResources>java:/Objects/java.io.Console</semanticResources> | ||
616 | <semanticResources>java:/Objects/java.util.spi.CalendarNameProvider</semanticResources> | ||
617 | <semanticResources>java:/Objects/java.io.FileOutputStream</semanticResources> | ||
618 | <semanticResources>java:/Objects/jdk.internal.misc.JavaIOFileDescriptorAccess</semanticResources> | ||
619 | <semanticResources>java:/Objects/sun.util.spi.CalendarProvider</semanticResources> | ||
620 | <semanticResources>java:/Objects/java.text.spi.CollatorProvider</semanticResources> | ||
621 | <semanticResources>java:/Objects/java.text.Collator</semanticResources> | ||
622 | <semanticResources>java:/Objects/java.text.CollationKey</semanticResources> | ||
623 | <semanticResources>java:/Objects/java.util.spi.CurrencyNameProvider</semanticResources> | ||
624 | <semanticResources>java:/Objects/java.text.spi.DateFormatProvider</semanticResources> | ||
625 | <semanticResources>java:/Objects/java.text.DateFormat</semanticResources> | ||
626 | <semanticResources>java:/Objects/java.text.NumberFormat</semanticResources> | ||
627 | <semanticResources>java:/Objects/java.util.Currency</semanticResources> | ||
628 | <semanticResources>java:/Objects/java.util.HashSet</semanticResources> | ||
629 | <semanticResources>java:/Objects/java.text.spi.DateFormatSymbolsProvider</semanticResources> | ||
630 | <semanticResources>java:/Objects/java.text.spi.DecimalFormatSymbolsProvider</semanticResources> | ||
631 | <semanticResources>java:/Objects/java.text.DecimalFormatSymbols</semanticResources> | ||
632 | <semanticResources>java:/Objects/sun.text.spi.JavaTimeDateTimePatternProvider</semanticResources> | ||
633 | <semanticResources>java:/Objects/java.text.spi.NumberFormatProvider</semanticResources> | ||
634 | <semanticResources>java:/Objects/java.util.spi.TimeZoneNameProvider</semanticResources> | ||
635 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.IPatternMatch</semanticResources> | ||
636 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.IQuerySpecification</semanticResources> | ||
637 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.psystem.queries.PQueryHeader</semanticResources> | ||
638 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.psystem.annotations.PAnnotation</semanticResources> | ||
639 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter</semanticResources> | ||
640 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.context.IInputKey</semanticResources> | ||
641 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection</semanticResources> | ||
642 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility</semanticResources> | ||
643 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.psystem.queries.PQuery</semanticResources> | ||
644 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.psystem.PTraceable</semanticResources> | ||
645 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.psystem.queries.PDisjunction</semanticResources> | ||
646 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.psystem.PBody</semanticResources> | ||
647 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.psystem.PVariable</semanticResources> | ||
648 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.psystem.PConstraint</semanticResources> | ||
649 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.context.IQueryMetaContext</semanticResources> | ||
650 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.context.InputKeyImplication</semanticResources> | ||
651 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.context.IPosetComparator</semanticResources> | ||
652 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.tuple.Tuple</semanticResources> | ||
653 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.tuple.AbstractTuple</semanticResources> | ||
654 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.tuple.ITuple</semanticResources> | ||
655 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.psystem.TypeJudgement</semanticResources> | ||
656 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter</semanticResources> | ||
657 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.psystem.VariableDeferredPConstraint</semanticResources> | ||
658 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.psystem.DeferredPConstraint</semanticResources> | ||
659 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.psystem.BasePConstraint</semanticResources> | ||
660 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint</semanticResources> | ||
661 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.backend.QueryHintOption</semanticResources> | ||
662 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.backend.IQueryBackendFactory</semanticResources> | ||
663 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.backend.IMatcherCapability</semanticResources> | ||
664 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.context.IQueryBackendContext</semanticResources> | ||
665 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.backend.IQueryBackendHintProvider</semanticResources> | ||
666 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.psystem.queries.PProblem</semanticResources> | ||
667 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.planning.QueryProcessingException</semanticResources> | ||
668 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.ViatraQueryRuntimeException</semanticResources> | ||
669 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.planning.SubPlan</semanticResources> | ||
670 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.planning.operations.POperation</semanticResources> | ||
671 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.backend.IQueryBackend</semanticResources> | ||
672 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.backend.IQueryResultProvider</semanticResources> | ||
673 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.backend.IUpdateable</semanticResources> | ||
674 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.tuple.TupleMask</semanticResources> | ||
675 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.tuple.IModifiableTuple</semanticResources> | ||
676 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.util.Accuracy</semanticResources> | ||
677 | <semanticResources>java:/Objects/org.apache.log4j.Logger</semanticResources> | ||
678 | <semanticResources>java:/Objects/org.apache.log4j.Category</semanticResources> | ||
679 | <semanticResources>java:/Objects/org.apache.log4j.spi.AppenderAttachable</semanticResources> | ||
680 | <semanticResources>java:/Objects/org.apache.log4j.Appender</semanticResources> | ||
681 | <semanticResources>java:/Objects/org.apache.log4j.spi.Filter</semanticResources> | ||
682 | <semanticResources>java:/Objects/org.apache.log4j.spi.OptionHandler</semanticResources> | ||
683 | <semanticResources>java:/Objects/org.apache.log4j.spi.LoggingEvent</semanticResources> | ||
684 | <semanticResources>java:/Objects/org.apache.log4j.Priority</semanticResources> | ||
685 | <semanticResources>java:/Objects/org.apache.log4j.Level</semanticResources> | ||
686 | <semanticResources>java:/Objects/org.apache.log4j.spi.ThrowableInformation</semanticResources> | ||
687 | <semanticResources>java:/Objects/org.apache.log4j.spi.LocationInfo</semanticResources> | ||
688 | <semanticResources>java:/Objects/java.io.StringWriter</semanticResources> | ||
689 | <semanticResources>java:/Objects/org.apache.log4j.spi.LoggerRepository</semanticResources> | ||
690 | <semanticResources>java:/Objects/org.apache.log4j.spi.HierarchyEventListener</semanticResources> | ||
691 | <semanticResources>java:/Objects/org.apache.log4j.helpers.AppenderAttachableImpl</semanticResources> | ||
692 | <semanticResources>java:/Objects/org.apache.log4j.spi.ErrorHandler</semanticResources> | ||
693 | <semanticResources>java:/Objects/org.apache.log4j.spi.LoggerFactory</semanticResources> | ||
694 | <semanticResources>java:/Objects/org.apache.log4j.Layout</semanticResources> | ||
695 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.psystem.analysis.QueryAnalyzer</semanticResources> | ||
696 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.context.IQueryCacheContext</semanticResources> | ||
697 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.context.IQueryResultProviderAccess</semanticResources> | ||
698 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.context.IQueryRuntimeContext</semanticResources> | ||
699 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.context.IQueryRuntimeContextListener</semanticResources> | ||
700 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.context.IndexingService</semanticResources> | ||
701 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.ViatraQueryEngine</semanticResources> | ||
702 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.scope.IBaseIndex</semanticResources> | ||
703 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.scope.ViatraBaseIndexChangeListener</semanticResources> | ||
704 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.scope.IIndexingErrorListener</semanticResources> | ||
705 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.scope.IInstanceObserver</semanticResources> | ||
706 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.ViatraQueryMatcher</semanticResources> | ||
707 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.scope.QueryScope</semanticResources> | ||
708 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.internal.apiimpl.EngineContextFactory</semanticResources> | ||
709 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.scope.IEngineContext</semanticResources> | ||
710 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.ViatraQueryEngineOptions</semanticResources> | ||
711 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.impl.BaseMatcher</semanticResources> | ||
712 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.internal.apiimpl.QueryResultWrapper</semanticResources> | ||
713 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification</semanticResources> | ||
714 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.impl.BaseQuerySpecification</semanticResources> | ||
715 | <semanticResources>java:/Objects/java.lang.ExceptionInInitializerError</semanticResources> | ||
716 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.exception.ViatraQueryException</semanticResources> | ||
717 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.psystem.queries.QueryInitializationException</semanticResources> | ||
718 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedPatternGroup</semanticResources> | ||
719 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.impl.BaseQueryGroup</semanticResources> | ||
720 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.IQueryGroup</semanticResources> | ||
721 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.AdvancedViatraQueryEngine</semanticResources> | ||
722 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.ViatraQueryEngineLifecycleListener</semanticResources> | ||
723 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.IMatchUpdateListener</semanticResources> | ||
724 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.ViatraQueryModelUpdateListener</semanticResources> | ||
725 | <semanticResources>java:/Objects/java.lang.Override</semanticResources> | ||
726 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery</semanticResources> | ||
727 | <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.psystem.queries.BasePQuery</semanticResources> | ||
728 | <semanticResources>java:/Objects/org.eclipse.emf.ecore.EClassifier</semanticResources> | ||
729 | <semanticResources>java:/Objects/org.eclipse.emf.ecore.ENamedElement</semanticResources> | ||
730 | <semanticResources>java:/Objects/org.eclipse.emf.ecore.EModelElement</semanticResources> | ||
731 | <semanticResources>java:/Objects/org.eclipse.emf.ecore.EObject</semanticResources> | ||
732 | <semanticResources>java:/Objects/org.eclipse.emf.common.notify.Notifier</semanticResources> | ||
733 | <semanticResources>java:/Objects/org.eclipse.emf.common.util.EList</semanticResources> | ||
734 | <semanticResources>java:/Objects/org.eclipse.emf.common.notify.Adapter</semanticResources> | ||
735 | <semanticResources>java:/Objects/org.eclipse.emf.common.notify.Notification</semanticResources> | ||
736 | <semanticResources>java:/Objects/org.eclipse.emf.common.util.TreeIterator</semanticResources> | ||
737 | <semanticResources>java:/Objects/org.eclipse.emf.ecore.EClass</semanticResources> | ||
738 | <semanticResources>java:/Objects/org.eclipse.emf.ecore.EAttribute</semanticResources> | ||
739 | <semanticResources>java:/Objects/org.eclipse.emf.ecore.EStructuralFeature</semanticResources> | ||
740 | <semanticResources>java:/Objects/org.eclipse.emf.ecore.ETypedElement</semanticResources> | ||
741 | <semanticResources>java:/Objects/org.eclipse.emf.ecore.EGenericType</semanticResources> | ||
742 | <semanticResources>java:/Objects/org.eclipse.emf.ecore.ETypeParameter</semanticResources> | ||
743 | <semanticResources>java:/Objects/org.eclipse.emf.ecore.EAnnotation</semanticResources> | ||
744 | <semanticResources>java:/Objects/org.eclipse.emf.common.util.EMap</semanticResources> | ||
745 | <semanticResources>java:/Objects/org.eclipse.emf.ecore.EReference</semanticResources> | ||
746 | <semanticResources>java:/Objects/org.eclipse.emf.ecore.InternalEObject</semanticResources> | ||
747 | <semanticResources>java:/Objects/org.eclipse.emf.common.notify.NotificationChain</semanticResources> | ||
748 | <semanticResources>java:/Objects/org.eclipse.emf.ecore.resource.Resource</semanticResources> | ||
749 | <semanticResources>java:/Objects/org.eclipse.emf.common.util.URI</semanticResources> | ||
750 | <semanticResources>java:/Objects/org.eclipse.emf.common.util.Pool</semanticResources> | ||
751 | <semanticResources>java:/Objects/org.eclipse.emf.common.util.WeakInterningHashSet</semanticResources> | ||
752 | <semanticResources>java:/Objects/org.eclipse.emf.common.util.InterningSet</semanticResources> | ||
753 | <semanticResources>java:/Objects/java.util.concurrent.locks.ReentrantReadWriteLock</semanticResources> | ||
754 | <semanticResources>java:/Objects/java.util.concurrent.locks.ReadWriteLock</semanticResources> | ||
755 | <semanticResources>java:/Objects/java.lang.IllegalMonitorStateException</semanticResources> | ||
756 | <semanticResources>java:/Objects/org.eclipse.emf.common.util.SegmentSequence</semanticResources> | ||
757 | <semanticResources>java:/Objects/org.eclipse.emf.common.util.CommonUtil</semanticResources> | ||
758 | <semanticResources>java:/Objects/org.eclipse.emf.ecore.resource.ResourceSet</semanticResources> | ||
759 | <semanticResources>java:/Objects/org.eclipse.emf.common.notify.AdapterFactory</semanticResources> | ||
760 | <semanticResources>java:/Objects/org.eclipse.emf.ecore.EPackage</semanticResources> | ||
761 | <semanticResources>java:/Objects/org.eclipse.emf.ecore.EFactory</semanticResources> | ||
762 | <semanticResources>java:/Objects/org.eclipse.emf.ecore.EDataType</semanticResources> | ||
763 | <semanticResources>java:/Objects/org.eclipse.emf.common.CommonPlugin</semanticResources> | ||
764 | <semanticResources>java:/Objects/org.eclipse.emf.common.EMFPlugin</semanticResources> | ||
765 | <semanticResources>java:/Objects/org.eclipse.emf.common.util.DelegatingResourceLocator</semanticResources> | ||
766 | <semanticResources>java:/Objects/org.eclipse.emf.common.util.ResourceLocator</semanticResources> | ||
767 | <semanticResources>java:/Objects/org.eclipse.emf.common.util.Logger</semanticResources> | ||
768 | <semanticResources>java:/Objects/org.eclipse.core.runtime.Plugin</semanticResources> | ||
769 | <semanticResources>java:/Objects/org.osgi.framework.BundleActivator</semanticResources> | ||
770 | <semanticResources>java:/Objects/org.osgi.framework.BundleContext</semanticResources> | ||
771 | <semanticResources>java:/Objects/org.osgi.framework.BundleReference</semanticResources> | ||
772 | <semanticResources>java:/Objects/org.osgi.framework.Bundle</semanticResources> | ||
773 | <semanticResources>java:/Objects/org.osgi.framework.ServiceReference</semanticResources> | ||
774 | <semanticResources>java:/Objects/java.security.cert.X509Certificate</semanticResources> | ||
775 | <semanticResources>java:/Objects/java.security.cert.X509Extension</semanticResources> | ||
776 | <semanticResources>java:/Objects/java.security.cert.CertificateExpiredException</semanticResources> | ||
777 | <semanticResources>java:/Objects/java.security.cert.CertificateNotYetValidException</semanticResources> | ||
778 | <semanticResources>java:/Objects/java.security.cert.CertificateParsingException</semanticResources> | ||
779 | <semanticResources>java:/Objects/javax.security.auth.x500.X500Principal</semanticResources> | ||
780 | <semanticResources>java:/Objects/sun.security.x509.X500Name</semanticResources> | ||
781 | <semanticResources>java:/Objects/sun.security.x509.GeneralNameInterface</semanticResources> | ||
782 | <semanticResources>java:/Objects/sun.security.util.DerOutputStream</semanticResources> | ||
783 | <semanticResources>java:/Objects/java.io.ByteArrayOutputStream</semanticResources> | ||
784 | <semanticResources>java:/Objects/sun.security.util.DerEncoder</semanticResources> | ||
785 | <semanticResources>java:/Objects/sun.security.util.DerValue</semanticResources> | ||
786 | <semanticResources>java:/Objects/sun.security.util.DerInputBuffer</semanticResources> | ||
787 | <semanticResources>java:/Objects/java.io.ByteArrayInputStream</semanticResources> | ||
788 | <semanticResources>java:/Objects/sun.security.util.BitArray</semanticResources> | ||
789 | <semanticResources>java:/Objects/sun.security.util.DerInputStream</semanticResources> | ||
790 | <semanticResources>java:/Objects/sun.security.util.ObjectIdentifier</semanticResources> | ||
791 | <semanticResources>java:/Objects/sun.security.util.ByteArrayLexOrder</semanticResources> | ||
792 | <semanticResources>java:/Objects/sun.security.util.ByteArrayTagOrder</semanticResources> | ||
793 | <semanticResources>java:/Objects/sun.security.x509.RDN</semanticResources> | ||
794 | <semanticResources>java:/Objects/sun.security.x509.AVA</semanticResources> | ||
795 | <semanticResources>java:/Objects/java.lang.Byte</semanticResources> | ||
796 | <semanticResources>java:/Objects/org.osgi.framework.Version</semanticResources> | ||
797 | <semanticResources>java:/Objects/org.osgi.framework.BundleException</semanticResources> | ||
798 | <semanticResources>java:/Objects/org.osgi.framework.BundleListener</semanticResources> | ||
799 | <semanticResources>java:/Objects/java.util.EventListener</semanticResources> | ||
800 | <semanticResources>java:/Objects/org.osgi.framework.BundleEvent</semanticResources> | ||
801 | <semanticResources>java:/Objects/java.util.EventObject</semanticResources> | ||
802 | <semanticResources>java:/Objects/org.osgi.framework.FrameworkListener</semanticResources> | ||
803 | <semanticResources>java:/Objects/org.osgi.framework.FrameworkEvent</semanticResources> | ||
804 | <semanticResources>java:/Objects/org.osgi.framework.ServiceListener</semanticResources> | ||
805 | <semanticResources>java:/Objects/org.osgi.framework.ServiceEvent</semanticResources> | ||
806 | <semanticResources>java:/Objects/org.osgi.framework.InvalidSyntaxException</semanticResources> | ||
807 | <semanticResources>java:/Objects/org.osgi.framework.Filter</semanticResources> | ||
808 | <semanticResources>java:/Objects/org.osgi.framework.ServiceObjects</semanticResources> | ||
809 | <semanticResources>java:/Objects/org.osgi.framework.ServiceRegistration</semanticResources> | ||
810 | <semanticResources>java:/Objects/org.osgi.framework.ServiceFactory</semanticResources> | ||
811 | <semanticResources>java:/Objects/org.eclipse.core.runtime.IPath</semanticResources> | ||
812 | <semanticResources>java:/Objects/org.eclipse.osgi.service.debug.DebugOptions</semanticResources> | ||
813 | <semanticResources>java:/Objects/org.eclipse.osgi.service.debug.DebugTrace</semanticResources> | ||
814 | <semanticResources>java:/Objects/org.eclipse.core.runtime.ILog</semanticResources> | ||
815 | <semanticResources>java:/Objects/org.eclipse.core.runtime.ILogListener</semanticResources> | ||
816 | <semanticResources>java:/Objects/org.eclipse.core.runtime.IStatus</semanticResources> | ||
817 | <semanticResources>java:/Objects/org.eclipse.core.runtime.Preferences</semanticResources> | ||
818 | <semanticResources>java:/Objects/org.eclipse.core.runtime.CoreException</semanticResources> | ||
819 | <semanticResources>java:/Objects/org.eclipse.core.runtime.ListenerList</semanticResources> | ||
820 | <semanticResources>java:/Objects/org.osgi.util.tracker.ServiceTracker</semanticResources> | ||
821 | <semanticResources>java:/Objects/org.osgi.util.tracker.ServiceTrackerCustomizer</semanticResources> | ||
822 | <semanticResources>java:/Objects/org.osgi.framework.AllServiceListener</semanticResources> | ||
823 | <semanticResources>java:/Objects/org.osgi.util.tracker.AbstractTracked</semanticResources> | ||
824 | <semanticResources>java:/Objects/org.eclipse.emf.ecore.EOperation</semanticResources> | ||
825 | <semanticResources>java:/Objects/org.eclipse.emf.ecore.EParameter</semanticResources> | ||
826 | <semanticResources>java:/Objects/org.eclipse.emf.ecore.util.FeatureMap</semanticResources> | ||
827 | <semanticResources>java:/Objects/org.eclipse.emf.ecore.util.InternalEList</semanticResources> | ||
828 | <semanticResources>java:/Objects/org.eclipse.emf.ecore.util.EContentsEList</semanticResources> | ||
829 | <semanticResources>java:/Objects/org.eclipse.emf.ecore.util.AbstractSequentialInternalEList</semanticResources> | ||
830 | <semanticResources>java:/Objects/org.eclipse.emf.ecore.resource.URIConverter</semanticResources> | ||
831 | <semanticResources>java:/Objects/java.io.InputStreamReader</semanticResources> | ||
832 | <semanticResources>java:/Objects/sun.nio.cs.StreamDecoder</semanticResources> | ||
833 | <semanticResources>java:/Objects/java.io.FileInputStream</semanticResources> | ||
834 | <semanticResources>java:/Objects/org.eclipse.emf.ecore.resource.ContentHandler</semanticResources> | ||
835 | <semanticResources>java:/Objects/org.eclipse.emf.ecore.resource.URIHandler</semanticResources> | ||
836 | <semanticResources>java:/Objects/org.eclipse.emf.ecore.EEnumLiteral</semanticResources> | ||
837 | <semanticResources>java:/Objects/org.eclipse.emf.common.util.Enumerator</semanticResources> | ||
838 | <semanticResources>java:/Objects/org.eclipse.emf.ecore.EEnum</semanticResources> | ||
839 | <semanticResources>java:/Objects/modes3.Segment</semanticResources> | ||
840 | <semanticResources>java:/Objects/modes3.Train</semanticResources> | ||
841 | <semanticResources>java:/Objects/java.lang.SuppressWarnings</semanticResources> | ||
842 | <semanticResources>java:/Objects/modes3.Turnout</semanticResources> | ||
843 | <semanticResources>../src/modes3/run/Modes3ModelGenerator.xtend</semanticResources> | ||
844 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.annotations.FinalFieldsConstructor</semanticResources> | ||
845 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.Active</semanticResources> | ||
846 | <semanticResources>java:/Objects/com.google.common.annotations.Beta</semanticResources> | ||
847 | <semanticResources>java:/Objects/com.google.common.annotations.GwtCompatible</semanticResources> | ||
848 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.annotations.FinalFieldsConstructorProcessor</semanticResources> | ||
849 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.TransformationParticipant</semanticResources> | ||
850 | <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.Extension</semanticResources> | ||
851 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.TransformationContext</semanticResources> | ||
852 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.services.Tracability</semanticResources> | ||
853 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.declaration.Element</semanticResources> | ||
854 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.services.ProblemSupport</semanticResources> | ||
855 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.services.Problem</semanticResources> | ||
856 | <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.Procedures</semanticResources> | ||
857 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.services.TypeReferenceProvider</semanticResources> | ||
858 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.declaration.TypeReference</semanticResources> | ||
859 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.declaration.ResolvedMethod</semanticResources> | ||
860 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.declaration.ResolvedExecutable</semanticResources> | ||
861 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.declaration.ExecutableDeclaration</semanticResources> | ||
862 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.declaration.TypeParameterDeclarator</semanticResources> | ||
863 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.declaration.MemberDeclaration</semanticResources> | ||
864 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.declaration.Declaration</semanticResources> | ||
865 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.declaration.AnnotationTarget</semanticResources> | ||
866 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.declaration.NamedElement</semanticResources> | ||
867 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.declaration.CompilationUnit</semanticResources> | ||
868 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.file.Path</semanticResources> | ||
869 | <semanticResources>java:/Objects/com.google.common.collect.ImmutableList</semanticResources> | ||
870 | <semanticResources>java:/Objects/com.google.common.collect.ImmutableCollection</semanticResources> | ||
871 | <semanticResources>java:/Objects/com.google.common.collect.UnmodifiableIterator</semanticResources> | ||
872 | <semanticResources>java:/Objects/com.google.common.annotations.VisibleForTesting</semanticResources> | ||
873 | <semanticResources>java:/Objects/com.google.common.collect.UnmodifiableListIterator</semanticResources> | ||
874 | <semanticResources>java:/Objects/com.google.common.base.Splitter</semanticResources> | ||
875 | <semanticResources>java:/Objects/com.google.common.base.AbstractIterator</semanticResources> | ||
876 | <semanticResources>java:/Objects/com.google.common.base.CharMatcher</semanticResources> | ||
877 | <semanticResources>java:/Objects/com.google.common.base.Predicate</semanticResources> | ||
878 | <semanticResources>java:/Objects/com.google.common.annotations.GwtIncompatible</semanticResources> | ||
879 | <semanticResources>java:/Objects/java.util.BitSet</semanticResources> | ||
880 | <semanticResources>java:/Objects/com.google.common.base.CommonPattern</semanticResources> | ||
881 | <semanticResources>java:/Objects/com.google.common.base.CommonMatcher</semanticResources> | ||
882 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.declaration.TypeDeclaration</semanticResources> | ||
883 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.declaration.Type</semanticResources> | ||
884 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.declaration.AnnotationReference</semanticResources> | ||
885 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.declaration.AnnotationTypeDeclaration</semanticResources> | ||
886 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.declaration.AnnotationTypeElementDeclaration</semanticResources> | ||
887 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.expression.Expression</semanticResources> | ||
888 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.declaration.Modifier</semanticResources> | ||
889 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.declaration.Visibility</semanticResources> | ||
890 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.declaration.EnumerationValueDeclaration</semanticResources> | ||
891 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.declaration.EnumerationTypeDeclaration</semanticResources> | ||
892 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.declaration.ConstructorDeclaration</semanticResources> | ||
893 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.declaration.ParameterDeclaration</semanticResources> | ||
894 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.declaration.FieldDeclaration</semanticResources> | ||
895 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.declaration.MethodDeclaration</semanticResources> | ||
896 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.declaration.TypeParameterDeclaration</semanticResources> | ||
897 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.declaration.ClassDeclaration</semanticResources> | ||
898 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.declaration.InterfaceDeclaration</semanticResources> | ||
899 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.declaration.ResolvedConstructor</semanticResources> | ||
900 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.declaration.ResolvedParameter</semanticResources> | ||
901 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.declaration.ResolvedTypeParameter</semanticResources> | ||
902 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.services.TypeLookup</semanticResources> | ||
903 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.services.GlobalTypeLookup</semanticResources> | ||
904 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.declaration.MutableAnnotationTypeDeclaration</semanticResources> | ||
905 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.declaration.MutableTypeDeclaration</semanticResources> | ||
906 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.declaration.MutableMemberDeclaration</semanticResources> | ||
907 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.declaration.MutableDeclaration</semanticResources> | ||
908 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.declaration.MutableAnnotationTarget</semanticResources> | ||
909 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.declaration.MutableNamedElement</semanticResources> | ||
910 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.declaration.MutableElement</semanticResources> | ||
911 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.declaration.MutableConstructorDeclaration</semanticResources> | ||
912 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.declaration.MutableExecutableDeclaration</semanticResources> | ||
913 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.declaration.MutableTypeParameterDeclarator</semanticResources> | ||
914 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.declaration.MutableTypeParameterDeclaration</semanticResources> | ||
915 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.declaration.MutableFieldDeclaration</semanticResources> | ||
916 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.declaration.CompilationStrategy</semanticResources> | ||
917 | <semanticResources>java:/Objects/org.eclipse.xtend2.lib.StringConcatenationClient</semanticResources> | ||
918 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.declaration.MutableMethodDeclaration</semanticResources> | ||
919 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.declaration.MutableParameterDeclaration</semanticResources> | ||
920 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.declaration.MutableClassDeclaration</semanticResources> | ||
921 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.declaration.MutableEnumerationTypeDeclaration</semanticResources> | ||
922 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.declaration.MutableEnumerationValueDeclaration</semanticResources> | ||
923 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.declaration.MutableInterfaceDeclaration</semanticResources> | ||
924 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.declaration.MutableAnnotationTypeElementDeclaration</semanticResources> | ||
925 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.file.FileSystemSupport</semanticResources> | ||
926 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.file.FileLocations</semanticResources> | ||
927 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.services.AnnotationReferenceProvider</semanticResources> | ||
928 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.services.AnnotationReferenceBuildContext</semanticResources> | ||
929 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.services.Associator</semanticResources> | ||
930 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.annotations.Data</semanticResources> | ||
931 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.annotations.DataProcessor</semanticResources> | ||
932 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.AbstractClassProcessor</semanticResources> | ||
933 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.RegisterGlobalsParticipant</semanticResources> | ||
934 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.RegisterGlobalsContext</semanticResources> | ||
935 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.services.UpstreamTypeLookup</semanticResources> | ||
936 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.services.SourceTypeLookup</semanticResources> | ||
937 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.CodeGenerationParticipant</semanticResources> | ||
938 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.CodeGenerationContext</semanticResources> | ||
939 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.file.MutableFileSystemSupport</semanticResources> | ||
940 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.ValidationParticipant</semanticResources> | ||
941 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.macro.ValidationContext</semanticResources> | ||
942 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.annotations.Accessors</semanticResources> | ||
943 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.annotations.AccessorsProcessor</semanticResources> | ||
944 | <semanticResources>java:/Objects/org.eclipse.xtend.lib.annotations.AccessorType</semanticResources> | ||
945 | <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.ArrayLiterals</semanticResources> | ||
946 | <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.Pure</semanticResources> | ||
947 | <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.Inline</semanticResources> | ||
948 | <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.CollectionLiterals</semanticResources> | ||
949 | <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.Pair</semanticResources> | ||
950 | <semanticResources>java:/Objects/java.util.LinkedHashSet</semanticResources> | ||
951 | <semanticResources>java:/Objects/java.util.TreeMap</semanticResources> | ||
952 | <semanticResources>java:/Objects/java.util.NavigableMap</semanticResources> | ||
953 | <semanticResources>java:/Objects/java.util.TreeSet</semanticResources> | ||
954 | <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.InputOutput</semanticResources> | ||
955 | <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.ArrayExtensions</semanticResources> | ||
956 | <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.BigDecimalExtensions</semanticResources> | ||
957 | <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.BigIntegerExtensions</semanticResources> | ||
958 | <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.BooleanExtensions</semanticResources> | ||
959 | <semanticResources>java:/Objects/com.google.common.primitives.Booleans</semanticResources> | ||
960 | <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.ByteExtensions</semanticResources> | ||
961 | <semanticResources>java:/Objects/java.lang.Math</semanticResources> | ||
962 | <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.CharacterExtensions</semanticResources> | ||
963 | <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.CollectionExtensions</semanticResources> | ||
964 | <semanticResources>java:/Objects/com.google.common.collect.Iterables</semanticResources> | ||
965 | <semanticResources>java:/Objects/com.google.common.collect.FluentIterable</semanticResources> | ||
966 | <semanticResources>java:/Objects/com.google.common.base.Function</semanticResources> | ||
967 | <semanticResources>java:/Objects/com.google.common.base.Optional</semanticResources> | ||
968 | <semanticResources>java:/Objects/com.google.common.base.Supplier</semanticResources> | ||
969 | <semanticResources>java:/Objects/com.google.common.collect.ImmutableListMultimap</semanticResources> | ||
970 | <semanticResources>java:/Objects/com.google.common.collect.ImmutableMultimap</semanticResources> | ||
971 | <semanticResources>java:/Objects/com.google.common.collect.BaseImmutableMultimap</semanticResources> | ||
972 | <semanticResources>java:/Objects/com.google.common.collect.AbstractMultimap</semanticResources> | ||
973 | <semanticResources>java:/Objects/com.google.common.collect.Multimap</semanticResources> | ||
974 | <semanticResources>java:/Objects/com.google.common.collect.Multiset</semanticResources> | ||
975 | <semanticResources>java:/Objects/com.google.common.collect.Multimaps</semanticResources> | ||
976 | <semanticResources>java:/Objects/com.google.common.collect.Maps</semanticResources> | ||
977 | <semanticResources>java:/Objects/com.google.common.collect.ImmutableMap</semanticResources> | ||
978 | <semanticResources>java:/Objects/com.google.common.collect.ImmutableSet</semanticResources> | ||
979 | <semanticResources>java:/Objects/com.google.common.collect.ImmutableSetMultimap</semanticResources> | ||
980 | <semanticResources>java:/Objects/com.google.common.collect.SetMultimap</semanticResources> | ||
981 | <semanticResources>java:/Objects/com.google.common.collect.Serialization</semanticResources> | ||
982 | <semanticResources>java:/Objects/com.google.common.collect.ImmutableMultiset</semanticResources> | ||
983 | <semanticResources>java:/Objects/com.google.common.collect.ImmutableMultisetGwtSerializationDependencies</semanticResources> | ||
984 | <semanticResources>java:/Objects/com.google.common.collect.IndexedImmutableSet</semanticResources> | ||
985 | <semanticResources>java:/Objects/com.google.common.collect.AbstractListMultimap</semanticResources> | ||
986 | <semanticResources>java:/Objects/com.google.common.collect.AbstractMapBasedMultimap</semanticResources> | ||
987 | <semanticResources>java:/Objects/com.google.common.collect.AbstractSetMultimap</semanticResources> | ||
988 | <semanticResources>java:/Objects/com.google.common.collect.AbstractSortedSetMultimap</semanticResources> | ||
989 | <semanticResources>java:/Objects/com.google.common.collect.SortedSetMultimap</semanticResources> | ||
990 | <semanticResources>java:/Objects/com.google.common.collect.AbstractMultiset</semanticResources> | ||
991 | <semanticResources>java:/Objects/com.google.common.collect.Multisets</semanticResources> | ||
992 | <semanticResources>java:/Objects/com.google.common.collect.Sets</semanticResources> | ||
993 | <semanticResources>java:/Objects/com.google.common.collect.ForwardingCollection</semanticResources> | ||
994 | <semanticResources>java:/Objects/com.google.common.collect.ForwardingObject</semanticResources> | ||
995 | <semanticResources>java:/Objects/com.google.common.collect.CartesianList</semanticResources> | ||
996 | <semanticResources>java:/Objects/com.google.common.collect.ForwardingNavigableSet</semanticResources> | ||
997 | <semanticResources>java:/Objects/com.google.common.collect.ForwardingSortedSet</semanticResources> | ||
998 | <semanticResources>java:/Objects/com.google.common.collect.ForwardingSet</semanticResources> | ||
999 | <semanticResources>java:/Objects/com.google.common.collect.Ordering</semanticResources> | ||
1000 | <semanticResources>java:/Objects/com.google.common.collect.Collections2</semanticResources> | ||
1001 | <semanticResources>java:/Objects/com.google.common.collect.AbstractIterator</semanticResources> | ||
1002 | <semanticResources>java:/Objects/java.util.concurrent.CopyOnWriteArraySet</semanticResources> | ||
1003 | <semanticResources>java:/Objects/java.util.concurrent.CopyOnWriteArrayList</semanticResources> | ||
1004 | <semanticResources>java:/Objects/com.google.common.collect.Range</semanticResources> | ||
1005 | <semanticResources>java:/Objects/com.google.common.collect.RangeGwtSerializationDependencies</semanticResources> | ||
1006 | <semanticResources>java:/Objects/com.google.common.collect.Cut</semanticResources> | ||
1007 | <semanticResources>java:/Objects/com.google.common.collect.DiscreteDomain</semanticResources> | ||
1008 | <semanticResources>java:/Objects/com.google.common.collect.BoundType</semanticResources> | ||
1009 | <semanticResources>java:/Objects/java.util.EnumMap</semanticResources> | ||
1010 | <semanticResources>java:/Objects/com.google.common.collect.ListMultimap</semanticResources> | ||
1011 | <semanticResources>java:/Objects/com.google.common.collect.ForwardingMultimap</semanticResources> | ||
1012 | <semanticResources>java:/Objects/com.google.common.collect.FilteredMultimap</semanticResources> | ||
1013 | <semanticResources>java:/Objects/com.google.common.collect.FilteredSetMultimap</semanticResources> | ||
1014 | <semanticResources>java:/Objects/com.google.common.base.Converter</semanticResources> | ||
1015 | <semanticResources>java:/Objects/com.google.common.collect.BiMap</semanticResources> | ||
1016 | <semanticResources>java:/Objects/com.google.common.collect.ForwardingMap</semanticResources> | ||
1017 | <semanticResources>java:/Objects/com.google.common.collect.AbstractNavigableMap</semanticResources> | ||
1018 | <semanticResources>java:/Objects/com.google.common.collect.MapDifference</semanticResources> | ||
1019 | <semanticResources>java:/Objects/com.google.common.collect.SortedMapDifference</semanticResources> | ||
1020 | <semanticResources>java:/Objects/com.google.common.collect.ForwardingSortedMap</semanticResources> | ||
1021 | <semanticResources>java:/Objects/com.google.common.base.Equivalence</semanticResources> | ||
1022 | <semanticResources>java:/Objects/java.util.function.BiPredicate</semanticResources> | ||
1023 | <semanticResources>java:/Objects/java.util.IdentityHashMap</semanticResources> | ||
1024 | <semanticResources>java:/Objects/com.google.common.collect.ForwardingMultiset</semanticResources> | ||
1025 | <semanticResources>java:/Objects/com.google.common.collect.SortedMultiset</semanticResources> | ||
1026 | <semanticResources>java:/Objects/com.google.common.collect.SortedMultisetBridge</semanticResources> | ||
1027 | <semanticResources>java:/Objects/com.google.common.collect.SortedIterable</semanticResources> | ||
1028 | <semanticResources>java:/Objects/com.google.common.base.Joiner</semanticResources> | ||
1029 | <semanticResources>java:/Objects/com.google.common.collect.ImmutableSortedSet</semanticResources> | ||
1030 | <semanticResources>java:/Objects/com.google.common.collect.ImmutableSortedSetFauxverideShim</semanticResources> | ||
1031 | <semanticResources>java:/Objects/com.google.common.collect.RegularImmutableSortedSet</semanticResources> | ||
1032 | <semanticResources>java:/Objects/com.google.common.collect.ImmutableSortedMap</semanticResources> | ||
1033 | <semanticResources>java:/Objects/com.google.common.collect.ImmutableSortedMapFauxverideShim</semanticResources> | ||
1034 | <semanticResources>java:/Objects/java.util.Collections</semanticResources> | ||
1035 | <semanticResources>java:/Objects/java.util.AbstractQueue</semanticResources> | ||
1036 | <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.ComparableExtensions</semanticResources> | ||
1037 | <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.DoubleExtensions</semanticResources> | ||
1038 | <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.FloatExtensions</semanticResources> | ||
1039 | <semanticResources>java:/Objects/java.lang.Float</semanticResources> | ||
1040 | <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.FunctionExtensions</semanticResources> | ||
1041 | <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.Functions</semanticResources> | ||
1042 | <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.IntegerExtensions</semanticResources> | ||
1043 | <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.ExclusiveRange</semanticResources> | ||
1044 | <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.IntegerRange</semanticResources> | ||
1045 | <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.IterableExtensions</semanticResources> | ||
1046 | <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.IteratorExtensions</semanticResources> | ||
1047 | <semanticResources>java:/Objects/com.google.common.collect.Iterators</semanticResources> | ||
1048 | <semanticResources>java:/Objects/com.google.common.collect.AbstractIndexedListIterator</semanticResources> | ||
1049 | <semanticResources>java:/Objects/com.google.common.collect.PeekingIterator</semanticResources> | ||
1050 | <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.ListExtensions</semanticResources> | ||
1051 | <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.LongExtensions</semanticResources> | ||
1052 | <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.MapExtensions</semanticResources> | ||
1053 | <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.internal.UnmodifiableMergingMapView</semanticResources> | ||
1054 | <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.ObjectExtensions</semanticResources> | ||
1055 | <semanticResources>java:/Objects/com.google.common.base.Objects</semanticResources> | ||
1056 | <semanticResources>java:/Objects/com.google.common.base.ExtraObjectsMethodsForWeb</semanticResources> | ||
1057 | <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.ProcedureExtensions</semanticResources> | ||
1058 | <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.ShortExtensions</semanticResources> | ||
1059 | <semanticResources>java:/Objects/java.lang.Short</semanticResources> | ||
1060 | <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.StringExtensions</semanticResources> | ||
1061 | <ownedViews xmi:type="viewpoint:DView" uid="_R6jlsA7_Eee1dfpzdcS6YA"> | ||
1062 | <viewpoint xmi:type="description:Viewpoint" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']"/> | ||
1063 | <ownedRepresentationDescriptors xmi:type="viewpoint:DRepresentationDescriptor" uid="_WlTx4R3XEeeQBfI0hkDaPg" name="modes3-domain" repPath="#_QqO3ABFUEeeHWeeZwj2u8w" changeId="5336d6ad-0418-43b4-b439-053a489228c4"> | ||
1064 | <description xmi:type="description_1:DiagramDescription" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']"/> | ||
1065 | <target xmi:type="ecore:EPackage" href="modes3.ecore#/"/> | ||
1066 | </ownedRepresentationDescriptors> | ||
1067 | </ownedViews> | ||
1068 | <ownedViews xmi:type="viewpoint:DView" uid="_OHrasBFUEeeHWeeZwj2u8w"> | ||
1069 | <viewpoint xmi:type="description:Viewpoint" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Review']"/> | ||
1070 | </ownedViews> | ||
1071 | <ownedViews xmi:type="viewpoint:DView" uid="_OH-VoBFUEeeHWeeZwj2u8w"> | ||
1072 | <viewpoint xmi:type="description:Viewpoint" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Archetype']"/> | ||
1073 | </ownedViews> | ||
1074 | <ownedViews xmi:type="viewpoint:DView" uid="_OIvxsBFUEeeHWeeZwj2u8w"> | ||
1075 | <viewpoint xmi:type="description:Viewpoint" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Generation']"/> | ||
1076 | </ownedViews> | ||
1077 | </viewpoint:DAnalysis> | ||
1078 | <diagram:DSemanticDiagram uid="_QqO3ABFUEeeHWeeZwj2u8w"> | ||
1079 | <ownedAnnotationEntries xmi:type="description:AnnotationEntry" uid="_QqO3ARFUEeeHWeeZwj2u8w" source="DANNOTATION_CUSTOMIZATION_KEY"> | ||
1080 | <data xmi:type="diagram:ComputedStyleDescriptionRegistry" uid="_QqO3AhFUEeeHWeeZwj2u8w"> | ||
1081 | <computedStyleDescriptions xmi:type="style:EdgeStyleDescription" xmi:id="_4vAR4GrPEeqC0oOqPAS8qg" sourceArrow="FillDiamond" routingStyle="manhattan"> | ||
1082 | <strokeColor xmi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/> | ||
1083 | <centerLabelStyleDescription xmi:type="style:CenterLabelStyleDescription" xmi:id="_4vAR4WrPEeqC0oOqPAS8qg" showIcon="false" labelExpression="service:render"> | ||
1084 | <labelColor xmi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/> | ||
1085 | </centerLabelStyleDescription> | ||
1086 | <endLabelStyleDescription xmi:type="style:EndLabelStyleDescription" xmi:id="_4vAR4mrPEeqC0oOqPAS8qg" labelSize="6" showIcon="false" labelExpression="service:eKeysLabel"> | ||
1087 | <labelColor xmi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='dark_blue']"/> | ||
1088 | </endLabelStyleDescription> | ||
1089 | </computedStyleDescriptions> | ||
1090 | <computedStyleDescriptions xmi:type="style:EdgeStyleDescription" xmi:id="_vpT04NGqEeqNWYR5K-zBag" routingStyle="manhattan"> | ||
1091 | <strokeColor xmi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/> | ||
1092 | <centerLabelStyleDescription xmi:type="style:CenterLabelStyleDescription" xmi:id="_vpT04dGqEeqNWYR5K-zBag" showIcon="false" labelExpression="service:render"> | ||
1093 | <labelFormat>bold</labelFormat> | ||
1094 | <labelColor xmi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/> | ||
1095 | </centerLabelStyleDescription> | ||
1096 | <endLabelStyleDescription xmi:type="style:EndLabelStyleDescription" xmi:id="_vpT04tGqEeqNWYR5K-zBag" labelSize="6" showIcon="false" labelExpression="service:eKeysLabel"> | ||
1097 | <labelColor xmi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='dark_blue']"/> | ||
1098 | </endLabelStyleDescription> | ||
1099 | </computedStyleDescriptions> | ||
1100 | </data> | ||
1101 | </ownedAnnotationEntries> | ||
1102 | <ownedAnnotationEntries xmi:type="description:AnnotationEntry" uid="_QqZPEBFUEeeHWeeZwj2u8w" source="GMF_DIAGRAMS"> | ||
1103 | <data xmi:type="notation:Diagram" xmi:id="_QqZPERFUEeeHWeeZwj2u8w" type="Sirius" element="_QqO3ABFUEeeHWeeZwj2u8w" measurementUnit="Pixel"> | ||
1104 | <children xmi:type="notation:Node" xmi:id="_u0Dbcx9kEee278vFHA2N9A" type="2003" element="_uyq7YB9kEee278vFHA2N9A"> | ||
1105 | <children xmi:type="notation:Node" xmi:id="_u0Dbdh9kEee278vFHA2N9A" type="5007"/> | ||
1106 | <children xmi:type="notation:Node" xmi:id="_u0ECgB9kEee278vFHA2N9A" type="7004"> | ||
1107 | <children xmi:type="notation:Node" xmi:id="_sGnOAGrPEeqC0oOqPAS8qg" type="3010" element="_sFw5cGrPEeqC0oOqPAS8qg"> | ||
1108 | <styles xmi:type="notation:FontStyle" xmi:id="_sGnOAWrPEeqC0oOqPAS8qg" fontColor="2697711" fontName="Noto Sans" fontHeight="8"/> | ||
1109 | <layoutConstraint xmi:type="notation:Location" xmi:id="_sGnOAmrPEeqC0oOqPAS8qg"/> | ||
1110 | </children> | ||
1111 | <styles xmi:type="notation:SortingStyle" xmi:id="_u0ECgR9kEee278vFHA2N9A"/> | ||
1112 | <styles xmi:type="notation:FilteringStyle" xmi:id="_u0ECgh9kEee278vFHA2N9A"/> | ||
1113 | </children> | ||
1114 | <styles xmi:type="notation:ShapeStyle" xmi:id="_u0DbdB9kEee278vFHA2N9A" fontColor="2697711" fontName="Droid Sans" fontHeight="8" fillColor="16250871"/> | ||
1115 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_u0DbdR9kEee278vFHA2N9A" x="108" y="144" width="151" height="51"/> | ||
1116 | </children> | ||
1117 | <children xmi:type="notation:Node" xmi:id="_HaIZUB9lEee278vFHA2N9A" type="2003" element="_HZ5IwB9lEee278vFHA2N9A"> | ||
1118 | <children xmi:type="notation:Node" xmi:id="_HaIZUx9lEee278vFHA2N9A" type="5007"/> | ||
1119 | <children xmi:type="notation:Node" xmi:id="_HaIZVB9lEee278vFHA2N9A" type="7004"> | ||
1120 | <children xmi:type="notation:Node" xmi:id="_4SIysL8WEeebfIyBIV4aqw" type="3010" element="_4R8lcL8WEeebfIyBIV4aqw"> | ||
1121 | <styles xmi:type="notation:FontStyle" xmi:id="_4SIysb8WEeebfIyBIV4aqw" fontColor="2697711" fontName="Noto Sans" fontHeight="8"/> | ||
1122 | <layoutConstraint xmi:type="notation:Location" xmi:id="_4SIysr8WEeebfIyBIV4aqw"/> | ||
1123 | </children> | ||
1124 | <styles xmi:type="notation:SortingStyle" xmi:id="_HaIZVR9lEee278vFHA2N9A"/> | ||
1125 | <styles xmi:type="notation:FilteringStyle" xmi:id="_HaIZVh9lEee278vFHA2N9A"/> | ||
1126 | </children> | ||
1127 | <styles xmi:type="notation:ShapeStyle" xmi:id="_HaIZUR9lEee278vFHA2N9A" fontName="Droid Sans" fontHeight="8"/> | ||
1128 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_HaIZUh9lEee278vFHA2N9A" x="256" y="60" width="126" height="62"/> | ||
1129 | </children> | ||
1130 | <children xmi:type="notation:Node" xmi:id="_I1qRkCB1EeeUF8d36bwwGg" type="2003" element="_I1kK8CB1EeeUF8d36bwwGg"> | ||
1131 | <children xmi:type="notation:Node" xmi:id="_I1qRkyB1EeeUF8d36bwwGg" type="5007"/> | ||
1132 | <children xmi:type="notation:Node" xmi:id="_I1qRlCB1EeeUF8d36bwwGg" type="7004"> | ||
1133 | <styles xmi:type="notation:SortingStyle" xmi:id="_I1qRlSB1EeeUF8d36bwwGg"/> | ||
1134 | <styles xmi:type="notation:FilteringStyle" xmi:id="_I1qRliB1EeeUF8d36bwwGg"/> | ||
1135 | </children> | ||
1136 | <styles xmi:type="notation:ShapeStyle" xmi:id="_I1qRkSB1EeeUF8d36bwwGg" fontName="Droid Sans" fontHeight="8" fillColor="16250871"/> | ||
1137 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_I1qRkiB1EeeUF8d36bwwGg" x="108" y="228" width="151" height="51"/> | ||
1138 | </children> | ||
1139 | <children xmi:type="notation:Node" xmi:id="_fHXZECB1EeeUF8d36bwwGg" type="2003" element="_fHIIgCB1EeeUF8d36bwwGg"> | ||
1140 | <children xmi:type="notation:Node" xmi:id="_fHXZEyB1EeeUF8d36bwwGg" type="5007"/> | ||
1141 | <children xmi:type="notation:Node" xmi:id="_fHXZFCB1EeeUF8d36bwwGg" type="7004"> | ||
1142 | <children xmi:type="notation:Node" xmi:id="_t3c5gGrPEeqC0oOqPAS8qg" type="3010" element="_t28jMGrPEeqC0oOqPAS8qg"> | ||
1143 | <styles xmi:type="notation:FontStyle" xmi:id="_t3c5gWrPEeqC0oOqPAS8qg" fontColor="2697711" fontName="Noto Sans" fontHeight="8"/> | ||
1144 | <layoutConstraint xmi:type="notation:Location" xmi:id="_t3c5gmrPEeqC0oOqPAS8qg"/> | ||
1145 | </children> | ||
1146 | <children xmi:type="notation:Node" xmi:id="_0lh7EGrPEeqC0oOqPAS8qg" type="3010" element="_0lKusGrPEeqC0oOqPAS8qg"> | ||
1147 | <styles xmi:type="notation:FontStyle" xmi:id="_0lh7EWrPEeqC0oOqPAS8qg" fontColor="2697711" fontName="Noto Sans" fontHeight="8"/> | ||
1148 | <layoutConstraint xmi:type="notation:Location" xmi:id="_0lh7EmrPEeqC0oOqPAS8qg"/> | ||
1149 | </children> | ||
1150 | <styles xmi:type="notation:SortingStyle" xmi:id="_fHXZFSB1EeeUF8d36bwwGg"/> | ||
1151 | <styles xmi:type="notation:FilteringStyle" xmi:id="_fHXZFiB1EeeUF8d36bwwGg"/> | ||
1152 | </children> | ||
1153 | <styles xmi:type="notation:ShapeStyle" xmi:id="_fHXZESB1EeeUF8d36bwwGg" fontName="Droid Sans" fontHeight="8" fillColor="16250871"/> | ||
1154 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_fHXZEiB1EeeUF8d36bwwGg" x="360" y="168" width="159" height="76"/> | ||
1155 | </children> | ||
1156 | <styles xmi:type="notation:DiagramStyle" xmi:id="_QqZPEhFUEeeHWeeZwj2u8w"> | ||
1157 | <horizontalGuides xmi:type="notation:Guide" xmi:id="_9p7HcBFWEeeHWeeZwj2u8w" position="-3"/> | ||
1158 | <horizontalGuides xmi:type="notation:Guide" xmi:id="__YY0YBFWEeeHWeeZwj2u8w" position="188"/> | ||
1159 | <horizontalGuides xmi:type="notation:Guide" xmi:id="_G_Ya8BFXEeeHWeeZwj2u8w" position="264"/> | ||
1160 | <horizontalGuides xmi:type="notation:Guide" xmi:id="_MV83ABFXEeeHWeeZwj2u8w" position="341"/> | ||
1161 | <horizontalGuides xmi:type="notation:Guide" xmi:id="_YR8u8BFXEeeHWeeZwj2u8w" position="491"/> | ||
1162 | <horizontalGuides xmi:type="notation:Guide" xmi:id="_5rK9cBFXEeeHWeeZwj2u8w" position="604"> | ||
1163 | <nodeMap xmi:type="notation:NodeEntry" xmi:id="_6OVU4BFXEeeHWeeZwj2u8w"/> | ||
1164 | </horizontalGuides> | ||
1165 | <horizontalGuides xmi:type="notation:Guide" xmi:id="_Dzs6YBPOEeeca8alBUq9TA" position="716"/> | ||
1166 | <verticalGuides xmi:type="notation:Guide" xmi:id="_WIJw4BFXEeeHWeeZwj2u8w" position="1170"> | ||
1167 | <nodeMap xmi:type="notation:NodeEntry" xmi:id="_Wx0Y8RFXEeeHWeeZwj2u8w"/> | ||
1168 | <nodeMap xmi:type="notation:NodeEntry" xmi:id="_YxACcRFXEeeHWeeZwj2u8w"/> | ||
1169 | </verticalGuides> | ||
1170 | <verticalGuides xmi:type="notation:Guide" xmi:id="_crsWYBFXEeeHWeeZwj2u8w" position="1438"> | ||
1171 | <nodeMap xmi:type="notation:NodeEntry" xmi:id="_dCqr8RFXEeeHWeeZwj2u8w"/> | ||
1172 | <nodeMap xmi:type="notation:NodeEntry" xmi:id="_ASJRcBFYEeeHWeeZwj2u8w" value="Left"/> | ||
1173 | <nodeMap xmi:type="notation:NodeEntry" xmi:id="_f25RoBPJEeeca8alBUq9TA" value="Left"/> | ||
1174 | </verticalGuides> | ||
1175 | <verticalGuides xmi:type="notation:Guide" xmi:id="_gf1WYBFXEeeHWeeZwj2u8w" position="1305"> | ||
1176 | <nodeMap xmi:type="notation:NodeEntry" xmi:id="_gyEV4RFXEeeHWeeZwj2u8w"/> | ||
1177 | <nodeMap xmi:type="notation:NodeEntry" xmi:id="_GzF18RFYEeeHWeeZwj2u8w"/> | ||
1178 | </verticalGuides> | ||
1179 | <verticalGuides xmi:type="notation:Guide" xmi:id="_oK8n8BFXEeeHWeeZwj2u8w" position="832"> | ||
1180 | <nodeMap xmi:type="notation:NodeEntry" xmi:id="_pTpVYBFXEeeHWeeZwj2u8w"/> | ||
1181 | <nodeMap xmi:type="notation:NodeEntry" xmi:id="_uO4Y8BFaEeeHWeeZwj2u8w"/> | ||
1182 | </verticalGuides> | ||
1183 | <verticalGuides xmi:type="notation:Guide" xmi:id="_q0VFABFXEeeHWeeZwj2u8w" position="490"> | ||
1184 | <nodeMap xmi:type="notation:NodeEntry" xmi:id="_roqsARFXEeeHWeeZwj2u8w"/> | ||
1185 | </verticalGuides> | ||
1186 | <verticalGuides xmi:type="notation:Guide" xmi:id="_twEdYBFXEeeHWeeZwj2u8w" position="659"> | ||
1187 | <nodeMap xmi:type="notation:NodeEntry" xmi:id="_uWEtcBFXEeeHWeeZwj2u8w"/> | ||
1188 | </verticalGuides> | ||
1189 | <verticalGuides xmi:type="notation:Guide" xmi:id="_z65n8BFXEeeHWeeZwj2u8w" position="1662"> | ||
1190 | <nodeMap xmi:type="notation:NodeEntry" xmi:id="_6OVU4RFXEeeHWeeZwj2u8w"/> | ||
1191 | <nodeMap xmi:type="notation:NodeEntry" xmi:id="_BPVScRFYEeeHWeeZwj2u8w" value="Left"/> | ||
1192 | <nodeMap xmi:type="notation:NodeEntry" xmi:id="_pmIMgBPIEeeca8alBUq9TA" value="Left"/> | ||
1193 | <nodeMap xmi:type="notation:NodeEntry" xmi:id="_UnN64BPOEeeca8alBUq9TA"/> | ||
1194 | </verticalGuides> | ||
1195 | <verticalGuides xmi:type="notation:Guide" xmi:id="_D1WScBFYEeeHWeeZwj2u8w" position="1815"> | ||
1196 | <nodeMap xmi:type="notation:NodeEntry" xmi:id="_FdQEYRFYEeeHWeeZwj2u8w"/> | ||
1197 | <nodeMap xmi:type="notation:NodeEntry" xmi:id="_85-0ERPOEeeca8alBUq9TA"/> | ||
1198 | </verticalGuides> | ||
1199 | <verticalGuides xmi:type="notation:Guide" xmi:id="_iXt2UBPOEeeca8alBUq9TA" position="1890"> | ||
1200 | <nodeMap xmi:type="notation:NodeEntry" xmi:id="_ji_9sRPOEeeca8alBUq9TA"/> | ||
1201 | <nodeMap xmi:type="notation:NodeEntry" xmi:id="_vBqZYRPOEeeca8alBUq9TA"/> | ||
1202 | </verticalGuides> | ||
1203 | <verticalGuides xmi:type="notation:Guide" xmi:id="_srmEcBPPEeeca8alBUq9TA" position="1739"> | ||
1204 | <nodeMap xmi:type="notation:NodeEntry" xmi:id="_zs6LEBPPEeeca8alBUq9TA"/> | ||
1205 | </verticalGuides> | ||
1206 | <verticalGuides xmi:type="notation:Guide" xmi:id="_6e7RcBPPEeeca8alBUq9TA" position="1966"> | ||
1207 | <nodeMap xmi:type="notation:NodeEntry" xmi:id="_7DL1ERPPEeeca8alBUq9TA"/> | ||
1208 | </verticalGuides> | ||
1209 | </styles> | ||
1210 | <edges xmi:type="notation:Edge" xmi:id="_59dRwCB1EeeUF8d36bwwGg" type="4001" element="_59UH0CB1EeeUF8d36bwwGg" source="_I1qRkCB1EeeUF8d36bwwGg" target="_u0Dbcx9kEee278vFHA2N9A"> | ||
1211 | <children xmi:type="notation:Node" xmi:id="_59dRxCB1EeeUF8d36bwwGg" type="6001"> | ||
1212 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_59dRxSB1EeeUF8d36bwwGg" y="48"/> | ||
1213 | </children> | ||
1214 | <children xmi:type="notation:Node" xmi:id="_59dRxiB1EeeUF8d36bwwGg" type="6002"> | ||
1215 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_59dRxyB1EeeUF8d36bwwGg" x="8"/> | ||
1216 | </children> | ||
1217 | <children xmi:type="notation:Node" xmi:id="_59dRyCB1EeeUF8d36bwwGg" type="6003"> | ||
1218 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_59dRySB1EeeUF8d36bwwGg" x="-10"/> | ||
1219 | </children> | ||
1220 | <styles xmi:type="notation:ConnectorStyle" xmi:id="_59dRwSB1EeeUF8d36bwwGg" routing="Rectilinear"/> | ||
1221 | <styles xmi:type="notation:FontStyle" xmi:id="_59dRwiB1EeeUF8d36bwwGg" fontColor="7490599" fontName="Droid Sans" fontHeight="8"/> | ||
1222 | <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_59dRwyB1EeeUF8d36bwwGg" points="[-34, 0, 24, 32]$[-34, -35, 24, -3]"/> | ||
1223 | <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_59dRyiB1EeeUF8d36bwwGg" id="(0.469910514541387,0.0)"/> | ||
1224 | <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_59dRyyB1EeeUF8d36bwwGg" id="(0.08713738976094071,1.0670553935860059)"/> | ||
1225 | </edges> | ||
1226 | <edges xmi:type="notation:Edge" xmi:id="_9vKBwCB1EeeUF8d36bwwGg" type="4001" element="_9vA30CB1EeeUF8d36bwwGg" source="_I1qRkCB1EeeUF8d36bwwGg" target="_u0Dbcx9kEee278vFHA2N9A"> | ||
1227 | <children xmi:type="notation:Node" xmi:id="_9vKo0CB1EeeUF8d36bwwGg" type="6001"> | ||
1228 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_9vKo0SB1EeeUF8d36bwwGg" x="5" y="-54" width="85" height="27"/> | ||
1229 | </children> | ||
1230 | <children xmi:type="notation:Node" xmi:id="_9vKo0iB1EeeUF8d36bwwGg" type="6002"> | ||
1231 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_9vKo0yB1EeeUF8d36bwwGg" x="2"/> | ||
1232 | </children> | ||
1233 | <children xmi:type="notation:Node" xmi:id="_9vKo1CB1EeeUF8d36bwwGg" type="6003"> | ||
1234 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_9vKo1SB1EeeUF8d36bwwGg" x="-10"/> | ||
1235 | </children> | ||
1236 | <styles xmi:type="notation:ConnectorStyle" xmi:id="_9vKBwSB1EeeUF8d36bwwGg" routing="Rectilinear"/> | ||
1237 | <styles xmi:type="notation:FontStyle" xmi:id="_9vKBwiB1EeeUF8d36bwwGg" fontColor="7490599" fontName="Droid Sans" fontHeight="8"/> | ||
1238 | <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_9vKBwyB1EeeUF8d36bwwGg" points="[-14, -24, -8, 63]$[-14, -59, -8, 28]"/> | ||
1239 | <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_9vKo1iB1EeeUF8d36bwwGg" id="(0.1796100990731863,0.49426020408163257)"/> | ||
1240 | <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_9vKo1yB1EeeUF8d36bwwGg" id="(0.13994120583504355,0.4347262714609653)"/> | ||
1241 | </edges> | ||
1242 | <edges xmi:type="notation:Edge" xmi:id="_h9HE4CB6EeeUF8d36bwwGg" type="4001" element="_h9BlUCB6EeeUF8d36bwwGg" source="_u0Dbcx9kEee278vFHA2N9A" target="_u0Dbcx9kEee278vFHA2N9A"> | ||
1243 | <children xmi:type="notation:Node" xmi:id="_h9HE5CB6EeeUF8d36bwwGg" type="6001"> | ||
1244 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_h9HE5SB6EeeUF8d36bwwGg" x="-12" y="-12"/> | ||
1245 | </children> | ||
1246 | <children xmi:type="notation:Node" xmi:id="_h9Hr8CB6EeeUF8d36bwwGg" type="6002"> | ||
1247 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_h9Hr8SB6EeeUF8d36bwwGg" x="5"/> | ||
1248 | </children> | ||
1249 | <children xmi:type="notation:Node" xmi:id="_h9Hr8iB6EeeUF8d36bwwGg" type="6003"> | ||
1250 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_h9Hr8yB6EeeUF8d36bwwGg" x="-2" y="-10"/> | ||
1251 | </children> | ||
1252 | <styles xmi:type="notation:ConnectorStyle" xmi:id="_h9HE4SB6EeeUF8d36bwwGg" routing="Rectilinear"/> | ||
1253 | <styles xmi:type="notation:FontStyle" xmi:id="_h9HE4iB6EeeUF8d36bwwGg" fontColor="7490599" fontName="Droid Sans" fontHeight="8"/> | ||
1254 | <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_h9HE4yB6EeeUF8d36bwwGg" points="[-31, -11, -46, -30]$[-31, -29, -46, -48]$[15, -29, 0, -48]$[15, -11, 0, -30]"/> | ||
1255 | <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_h9Hr9CB6EeeUF8d36bwwGg" id="(0.3775583781685063,0.23712342079689017)"/> | ||
1256 | <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_XjizcCIDEeeSweRcnMPZRQ" id="(0.4798657718120805,0.6224489795918368)"/> | ||
1257 | </edges> | ||
1258 | <edges xmi:type="notation:Edge" xmi:id="_O0izYDGjEeePY54_4mjBmA" type="4001" element="_OyqkEDGjEeePY54_4mjBmA" source="_u0Dbcx9kEee278vFHA2N9A" target="_fHXZECB1EeeUF8d36bwwGg"> | ||
1259 | <children xmi:type="notation:Node" xmi:id="_O0jacDGjEeePY54_4mjBmA" type="6001"> | ||
1260 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_O0jacTGjEeePY54_4mjBmA" x="-32" y="14"/> | ||
1261 | </children> | ||
1262 | <children xmi:type="notation:Node" xmi:id="_O0kBgDGjEeePY54_4mjBmA" type="6002"> | ||
1263 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_O0kBgTGjEeePY54_4mjBmA" x="25" y="-10"/> | ||
1264 | </children> | ||
1265 | <children xmi:type="notation:Node" xmi:id="_O0kBgjGjEeePY54_4mjBmA" type="6003"> | ||
1266 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_O0kBgzGjEeePY54_4mjBmA" x="-30" y="12"/> | ||
1267 | </children> | ||
1268 | <styles xmi:type="notation:ConnectorStyle" xmi:id="_O0izYTGjEeePY54_4mjBmA" routing="Rectilinear"/> | ||
1269 | <styles xmi:type="notation:FontStyle" xmi:id="_O0izYjGjEeePY54_4mjBmA" fontName="Segoe UI" fontHeight="8"/> | ||
1270 | <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_O0izYzGjEeePY54_4mjBmA" points="[1, 0, -104, -26]$[44, 0, -61, -26]$[44, 26, -61, 0]$[104, 26, -1, 0]"/> | ||
1271 | <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_O0kokDGjEeePY54_4mjBmA" id="(0.9932885906040269,0.5714285714285714)"/> | ||
1272 | <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_O0kokTGjEeePY54_4mjBmA" id="(0.006369426751592357,0.40540540540540543)"/> | ||
1273 | </edges> | ||
1274 | <edges xmi:type="notation:Edge" xmi:id="_4vdk4GrPEeqC0oOqPAS8qg" type="4001" element="_4u-ctmrPEeqC0oOqPAS8qg" source="_HaIZUB9lEee278vFHA2N9A" target="_fHXZECB1EeeUF8d36bwwGg"> | ||
1275 | <children xmi:type="notation:Node" xmi:id="_4vnV4GrPEeqC0oOqPAS8qg" type="6001"> | ||
1276 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_4vnV4WrPEeqC0oOqPAS8qg" x="44" y="38"/> | ||
1277 | </children> | ||
1278 | <children xmi:type="notation:Node" xmi:id="_4vokAGrPEeqC0oOqPAS8qg" type="6002"> | ||
1279 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_4vokAWrPEeqC0oOqPAS8qg" x="33" y="8"/> | ||
1280 | </children> | ||
1281 | <children xmi:type="notation:Node" xmi:id="_4vqZMGrPEeqC0oOqPAS8qg" type="6003"> | ||
1282 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_4vqZMWrPEeqC0oOqPAS8qg" x="-36"/> | ||
1283 | </children> | ||
1284 | <styles xmi:type="notation:ConnectorStyle" xmi:id="_4vdk4WrPEeqC0oOqPAS8qg" routing="Rectilinear"/> | ||
1285 | <styles xmi:type="notation:FontStyle" xmi:id="_4vdk4mrPEeqC0oOqPAS8qg" fontColor="7490599" fontName="Noto Sans" fontHeight="8"/> | ||
1286 | <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_4vdk42rPEeqC0oOqPAS8qg" points="[0, 33, -76, -61]$[59, 33, -17, -61]$[59, 94, -17, 0]"/> | ||
1287 | <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_4vv4wGrPEeqC0oOqPAS8qg" id="(1.0,0.24266609145815363)"/> | ||
1288 | <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_4vv4wWrPEeqC0oOqPAS8qg" id="(0.6114649681528662,0.0)"/> | ||
1289 | </edges> | ||
1290 | <edges xmi:type="notation:Edge" xmi:id="_-NwZkGrPEeqC0oOqPAS8qg" type="4001" element="_-NSfgGrPEeqC0oOqPAS8qg" source="_HaIZUB9lEee278vFHA2N9A" target="_u0Dbcx9kEee278vFHA2N9A"> | ||
1291 | <children xmi:type="notation:Node" xmi:id="_-NxAoGrPEeqC0oOqPAS8qg" type="6001"> | ||
1292 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_-NxAoWrPEeqC0oOqPAS8qg" x="-49" y="-29"/> | ||
1293 | </children> | ||
1294 | <children xmi:type="notation:Node" xmi:id="_-NxAomrPEeqC0oOqPAS8qg" type="6002"> | ||
1295 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_-NxAo2rPEeqC0oOqPAS8qg" x="10" y="-10"/> | ||
1296 | </children> | ||
1297 | <children xmi:type="notation:Node" xmi:id="_-NxApGrPEeqC0oOqPAS8qg" type="6003"> | ||
1298 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_-NxApWrPEeqC0oOqPAS8qg"/> | ||
1299 | </children> | ||
1300 | <styles xmi:type="notation:ConnectorStyle" xmi:id="_-NwZkWrPEeqC0oOqPAS8qg" routing="Rectilinear"/> | ||
1301 | <styles xmi:type="notation:FontStyle" xmi:id="_-NwZkmrPEeqC0oOqPAS8qg" fontColor="7490599" fontName="Noto Sans" fontHeight="8"/> | ||
1302 | <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_-NwZk2rPEeqC0oOqPAS8qg" points="[-62, -14, 52, -36]$[-102, -14, 12, -36]$[-102, 22, 12, 0]"/> | ||
1303 | <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_-NxnsGrPEeqC0oOqPAS8qg" id="(0.5,1.0353753235547887)"/> | ||
1304 | <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_-NxnsWrPEeqC0oOqPAS8qg" id="(0.6442953020134228,0.0)"/> | ||
1305 | </edges> | ||
1306 | <edges xmi:type="notation:Edge" xmi:id="_AwsQYGrQEeqC0oOqPAS8qg" type="4001" element="_AwjGgmrQEeqC0oOqPAS8qg" source="_HaIZUB9lEee278vFHA2N9A" target="_I1qRkCB1EeeUF8d36bwwGg"> | ||
1307 | <children xmi:type="notation:Node" xmi:id="_AwsQZGrQEeqC0oOqPAS8qg" type="6001"> | ||
1308 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_AwsQZWrQEeqC0oOqPAS8qg" x="150" y="-48"/> | ||
1309 | </children> | ||
1310 | <children xmi:type="notation:Node" xmi:id="_Aws3cGrQEeqC0oOqPAS8qg" type="6002"> | ||
1311 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Aws3cWrQEeqC0oOqPAS8qg" x="26" y="-10"/> | ||
1312 | </children> | ||
1313 | <children xmi:type="notation:Node" xmi:id="_Aws3cmrQEeqC0oOqPAS8qg" type="6003"> | ||
1314 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Aws3c2rQEeqC0oOqPAS8qg" x="71" y="10"/> | ||
1315 | </children> | ||
1316 | <styles xmi:type="notation:ConnectorStyle" xmi:id="_AwsQYWrQEeqC0oOqPAS8qg" routing="Rectilinear"/> | ||
1317 | <styles xmi:type="notation:FontStyle" xmi:id="_AwsQYmrQEeqC0oOqPAS8qg" fontColor="7490599" fontName="Noto Sans" fontHeight="8"/> | ||
1318 | <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_AwsQY2rQEeqC0oOqPAS8qg" points="[-84, -33, 40, -139]$[-316, -33, -192, -139]$[-316, 142, -192, 36]$[-232, 142, -108, 36]"/> | ||
1319 | <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_Aws3dGrQEeqC0oOqPAS8qg" id="(0.6774193548387096,1.0353753235547887)"/> | ||
1320 | <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_Aws3dWrQEeqC0oOqPAS8qg" id="(0.7248322147651006,0.0)"/> | ||
1321 | </edges> | ||
1322 | <edges xmi:type="notation:Edge" xmi:id="_Z0Ta0Gr8EeqC0oOqPAS8qg" type="4001" element="_Z0H0oGr8EeqC0oOqPAS8qg" source="_I1qRkCB1EeeUF8d36bwwGg" target="_u0Dbcx9kEee278vFHA2N9A"> | ||
1323 | <children xmi:type="notation:Node" xmi:id="_Z0UB4Gr8EeqC0oOqPAS8qg" type="6001"> | ||
1324 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Z0UB4Wr8EeqC0oOqPAS8qg" x="-10" y="2"/> | ||
1325 | </children> | ||
1326 | <children xmi:type="notation:Node" xmi:id="_Z0UB4mr8EeqC0oOqPAS8qg" type="6002"> | ||
1327 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Z0UB42r8EeqC0oOqPAS8qg" x="14" y="2"/> | ||
1328 | </children> | ||
1329 | <children xmi:type="notation:Node" xmi:id="_Z0UB5Gr8EeqC0oOqPAS8qg" type="6003"> | ||
1330 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Z0UB5Wr8EeqC0oOqPAS8qg" x="-18"/> | ||
1331 | </children> | ||
1332 | <styles xmi:type="notation:ConnectorStyle" xmi:id="_Z0Ta0Wr8EeqC0oOqPAS8qg" routing="Tree"/> | ||
1333 | <styles xmi:type="notation:FontStyle" xmi:id="_Z0Ta0mr8EeqC0oOqPAS8qg" fontName="Noto Sans" fontHeight="8"/> | ||
1334 | <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_Z0Ta02r8EeqC0oOqPAS8qg" points="[0, 0, 70, 60]$[0, 0, 70, 60]$[-12, 0, 58, 60]$[-12, -35, 58, 25]"/> | ||
1335 | <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_Z0UB5mr8EeqC0oOqPAS8qg" id="(0.9664429530201343,0.0)"/> | ||
1336 | <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_Z0UB52r8EeqC0oOqPAS8qg" id="(0.5,0.5)"/> | ||
1337 | </edges> | ||
1338 | </data> | ||
1339 | </ownedAnnotationEntries> | ||
1340 | <ownedDiagramElements xmi:type="diagram:DNodeList" uid="_uyq7YB9kEee278vFHA2N9A" name="Segment" tooltipText="" outgoingEdges="_h9BlUCB6EeeUF8d36bwwGg _OyqkEDGjEeePY54_4mjBmA" incomingEdges="_59UH0CB1EeeUF8d36bwwGg _9vA30CB1EeeUF8d36bwwGg _h9BlUCB6EeeUF8d36bwwGg _-NSfgGrPEeqC0oOqPAS8qg _Z0H0oGr8EeqC0oOqPAS8qg" width="12" height="10"> | ||
1341 | <target xmi:type="ecore:EClass" href="modes3.ecore#//Segment"/> | ||
1342 | <semanticElements xmi:type="ecore:EClass" href="modes3.ecore#//Segment"/> | ||
1343 | <arrangeConstraints>KEEP_LOCATION</arrangeConstraints> | ||
1344 | <arrangeConstraints>KEEP_SIZE</arrangeConstraints> | ||
1345 | <arrangeConstraints>KEEP_RATIO</arrangeConstraints> | ||
1346 | <ownedStyle xmi:type="diagram:FlatContainerStyle" uid="_srHpQWrPEeqC0oOqPAS8qg" borderSize="1" borderSizeComputationExpression="1" backgroundStyle="Liquid" backgroundColor="247,247,247" foregroundColor="247,247,247"> | ||
1347 | <customFeatures>backgroundColor</customFeatures> | ||
1348 | <customFeatures>foregroundColor</customFeatures> | ||
1349 | <description xmi:type="style:FlatContainerStyleDescription" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']/@style"/> | ||
1350 | </ownedStyle> | ||
1351 | <actualMapping xmi:type="description_1:ContainerMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']"/> | ||
1352 | <ownedElements xmi:type="diagram:DNodeListElement" uid="_sFw5cGrPEeqC0oOqPAS8qg" name="id : EInt" tooltipText=""> | ||
1353 | <target xmi:type="ecore:EAttribute" href="modes3.ecore#//Segment/id"/> | ||
1354 | <semanticElements xmi:type="ecore:EAttribute" href="modes3.ecore#//Segment/id"/> | ||
1355 | <ownedStyle xmi:type="diagram:BundledImage" uid="_srKskWrPEeqC0oOqPAS8qg" labelAlignment="LEFT"> | ||
1356 | <description xmi:type="style:BundledImageDescription" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']/@subNodeMappings[name='EC%20EAttribute']/@style"/> | ||
1357 | </ownedStyle> | ||
1358 | <actualMapping xmi:type="description_1:NodeMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']/@subNodeMappings[name='EC%20EAttribute']"/> | ||
1359 | </ownedElements> | ||
1360 | </ownedDiagramElements> | ||
1361 | <ownedDiagramElements xmi:type="diagram:DNodeList" uid="_HZ5IwB9lEee278vFHA2N9A" name="Modes3ModelRoot" tooltipText="" outgoingEdges="_4u-ctmrPEeqC0oOqPAS8qg _-NSfgGrPEeqC0oOqPAS8qg _AwjGgmrQEeqC0oOqPAS8qg" width="12" height="10"> | ||
1362 | <target xmi:type="ecore:EClass" href="modes3.ecore#//Modes3ModelRoot"/> | ||
1363 | <semanticElements xmi:type="ecore:EClass" href="modes3.ecore#//Modes3ModelRoot"/> | ||
1364 | <arrangeConstraints>KEEP_LOCATION</arrangeConstraints> | ||
1365 | <arrangeConstraints>KEEP_SIZE</arrangeConstraints> | ||
1366 | <arrangeConstraints>KEEP_RATIO</arrangeConstraints> | ||
1367 | <ownedStyle xmi:type="diagram:FlatContainerStyle" uid="_40AwsL8WEeebfIyBIV4aqw" borderSize="1" borderSizeComputationExpression="1" backgroundStyle="Liquid" foregroundColor="255,255,255"> | ||
1368 | <customFeatures>labelColor</customFeatures> | ||
1369 | <customFeatures>backgroundColor</customFeatures> | ||
1370 | <customFeatures>foregroundColor</customFeatures> | ||
1371 | <description xmi:type="style:FlatContainerStyleDescription" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']/@style"/> | ||
1372 | </ownedStyle> | ||
1373 | <actualMapping xmi:type="description_1:ContainerMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']"/> | ||
1374 | <ownedElements xmi:type="diagram:DNodeListElement" uid="_4R8lcL8WEeebfIyBIV4aqw" name="id : EInt" tooltipText=""> | ||
1375 | <target xmi:type="ecore:EAttribute" href="modes3.ecore#//Modes3ModelRoot/id"/> | ||
1376 | <semanticElements xmi:type="ecore:EAttribute" href="modes3.ecore#//Modes3ModelRoot/id"/> | ||
1377 | <ownedStyle xmi:type="diagram:BundledImage" uid="_40B-0L8WEeebfIyBIV4aqw" labelAlignment="LEFT"> | ||
1378 | <description xmi:type="style:BundledImageDescription" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']/@subNodeMappings[name='EC%20EAttribute']/@style"/> | ||
1379 | </ownedStyle> | ||
1380 | <actualMapping xmi:type="description_1:NodeMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']/@subNodeMappings[name='EC%20EAttribute']"/> | ||
1381 | </ownedElements> | ||
1382 | </ownedDiagramElements> | ||
1383 | <ownedDiagramElements xmi:type="diagram:DNodeList" uid="_I1kK8CB1EeeUF8d36bwwGg" name="Turnout" tooltipText="" outgoingEdges="_59UH0CB1EeeUF8d36bwwGg _9vA30CB1EeeUF8d36bwwGg _Z0H0oGr8EeqC0oOqPAS8qg" incomingEdges="_AwjGgmrQEeqC0oOqPAS8qg" width="12" height="10"> | ||
1384 | <target xmi:type="ecore:EClass" href="modes3.ecore#//Turnout"/> | ||
1385 | <semanticElements xmi:type="ecore:EClass" href="modes3.ecore#//Turnout"/> | ||
1386 | <arrangeConstraints>KEEP_LOCATION</arrangeConstraints> | ||
1387 | <arrangeConstraints>KEEP_SIZE</arrangeConstraints> | ||
1388 | <arrangeConstraints>KEEP_RATIO</arrangeConstraints> | ||
1389 | <ownedStyle xmi:type="diagram:FlatContainerStyle" uid="_I1kyACB1EeeUF8d36bwwGg" borderSize="1" borderSizeComputationExpression="1" backgroundStyle="Liquid" backgroundColor="247,247,247" foregroundColor="247,247,247"> | ||
1390 | <customFeatures>backgroundColor</customFeatures> | ||
1391 | <customFeatures>foregroundColor</customFeatures> | ||
1392 | <description xmi:type="style:FlatContainerStyleDescription" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']/@style"/> | ||
1393 | </ownedStyle> | ||
1394 | <actualMapping xmi:type="description_1:ContainerMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']"/> | ||
1395 | </ownedDiagramElements> | ||
1396 | <ownedDiagramElements xmi:type="diagram:DNodeList" uid="_fHIIgCB1EeeUF8d36bwwGg" name="Train" tooltipText="" incomingEdges="_OyqkEDGjEeePY54_4mjBmA _4u-ctmrPEeqC0oOqPAS8qg" width="12" height="10"> | ||
1397 | <target xmi:type="ecore:EClass" href="modes3.ecore#//Train"/> | ||
1398 | <semanticElements xmi:type="ecore:EClass" href="modes3.ecore#//Train"/> | ||
1399 | <arrangeConstraints>KEEP_LOCATION</arrangeConstraints> | ||
1400 | <arrangeConstraints>KEEP_SIZE</arrangeConstraints> | ||
1401 | <arrangeConstraints>KEEP_RATIO</arrangeConstraints> | ||
1402 | <ownedStyle xmi:type="diagram:FlatContainerStyle" uid="_1pOzwWrPEeqC0oOqPAS8qg" borderSize="1" borderSizeComputationExpression="1" backgroundStyle="Liquid" backgroundColor="247,247,247" foregroundColor="247,247,247"> | ||
1403 | <customFeatures>backgroundColor</customFeatures> | ||
1404 | <customFeatures>foregroundColor</customFeatures> | ||
1405 | <description xmi:type="style:FlatContainerStyleDescription" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']/@style"/> | ||
1406 | </ownedStyle> | ||
1407 | <actualMapping xmi:type="description_1:ContainerMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']"/> | ||
1408 | <ownedElements xmi:type="diagram:DNodeListElement" uid="_t28jMGrPEeqC0oOqPAS8qg" name="id : EInt" tooltipText=""> | ||
1409 | <target xmi:type="ecore:EAttribute" href="modes3.ecore#//Train/id"/> | ||
1410 | <semanticElements xmi:type="ecore:EAttribute" href="modes3.ecore#//Train/id"/> | ||
1411 | <ownedStyle xmi:type="diagram:BundledImage" uid="_uh_rUWrPEeqC0oOqPAS8qg" labelAlignment="LEFT"> | ||
1412 | <description xmi:type="style:BundledImageDescription" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']/@subNodeMappings[name='EC%20EAttribute']/@style"/> | ||
1413 | </ownedStyle> | ||
1414 | <actualMapping xmi:type="description_1:NodeMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']/@subNodeMappings[name='EC%20EAttribute']"/> | ||
1415 | </ownedElements> | ||
1416 | <ownedElements xmi:type="diagram:DNodeListElement" uid="_0lKusGrPEeqC0oOqPAS8qg" name="speed : EDouble = 0.0" tooltipText=""> | ||
1417 | <target xmi:type="ecore:EAttribute" href="modes3.ecore#//Train/speed"/> | ||
1418 | <semanticElements xmi:type="ecore:EAttribute" href="modes3.ecore#//Train/speed"/> | ||
1419 | <ownedStyle xmi:type="diagram:BundledImage" uid="_1pR3EmrPEeqC0oOqPAS8qg" labelAlignment="LEFT"> | ||
1420 | <description xmi:type="style:BundledImageDescription" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']/@subNodeMappings[name='EC%20EAttribute']/@style"/> | ||
1421 | </ownedStyle> | ||
1422 | <actualMapping xmi:type="description_1:NodeMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']/@subNodeMappings[name='EC%20EAttribute']"/> | ||
1423 | </ownedElements> | ||
1424 | </ownedDiagramElements> | ||
1425 | <ownedDiagramElements xmi:type="diagram:DEdge" uid="_59UH0CB1EeeUF8d36bwwGg" name="[1..1] straight" sourceNode="_I1kK8CB1EeeUF8d36bwwGg" targetNode="_uyq7YB9kEee278vFHA2N9A"> | ||
1426 | <target xmi:type="ecore:EReference" href="modes3.ecore#//Turnout/straight"/> | ||
1427 | <semanticElements xmi:type="ecore:EReference" href="modes3.ecore#//Turnout/straight"/> | ||
1428 | <ownedStyle xmi:type="diagram:EdgeStyle" uid="_wkfDsNGqEeqNWYR5K-zBag" description="_vpT04NGqEeqNWYR5K-zBag" routingStyle="manhattan" strokeColor="0,0,0"> | ||
1429 | <centerLabelStyle xmi:type="diagram:CenterLabelStyle" uid="_wkfDstGqEeqNWYR5K-zBag" showIcon="false"> | ||
1430 | <labelFormat>bold</labelFormat> | ||
1431 | </centerLabelStyle> | ||
1432 | <endLabelStyle xmi:type="diagram:EndLabelStyle" uid="_wkfDsdGqEeqNWYR5K-zBag" labelSize="6" showIcon="false" labelColor="39,76,114"/> | ||
1433 | </ownedStyle> | ||
1434 | <actualMapping xmi:type="description_1:EdgeMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@edgeMappings[name='EC_EReference']"/> | ||
1435 | </ownedDiagramElements> | ||
1436 | <ownedDiagramElements xmi:type="diagram:DEdge" uid="_9vA30CB1EeeUF8d36bwwGg" name="[1..1] divergent" sourceNode="_I1kK8CB1EeeUF8d36bwwGg" targetNode="_uyq7YB9kEee278vFHA2N9A"> | ||
1437 | <target xmi:type="ecore:EReference" href="modes3.ecore#//Turnout/divergent"/> | ||
1438 | <semanticElements xmi:type="ecore:EReference" href="modes3.ecore#//Turnout/divergent"/> | ||
1439 | <ownedStyle xmi:type="diagram:EdgeStyle" uid="_vpT049GqEeqNWYR5K-zBag" description="_vpT04NGqEeqNWYR5K-zBag" routingStyle="manhattan" strokeColor="0,0,0"> | ||
1440 | <centerLabelStyle xmi:type="diagram:CenterLabelStyle" uid="_vpT05dGqEeqNWYR5K-zBag" showIcon="false"> | ||
1441 | <labelFormat>bold</labelFormat> | ||
1442 | </centerLabelStyle> | ||
1443 | <endLabelStyle xmi:type="diagram:EndLabelStyle" uid="_vpT05NGqEeqNWYR5K-zBag" labelSize="6" showIcon="false" labelColor="39,76,114"/> | ||
1444 | </ownedStyle> | ||
1445 | <actualMapping xmi:type="description_1:EdgeMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@edgeMappings[name='EC_EReference']"/> | ||
1446 | </ownedDiagramElements> | ||
1447 | <ownedDiagramElements xmi:type="diagram:DEdge" uid="_h9BlUCB6EeeUF8d36bwwGg" name="[0..2] connectedTo" sourceNode="_uyq7YB9kEee278vFHA2N9A" targetNode="_uyq7YB9kEee278vFHA2N9A"> | ||
1448 | <target xmi:type="ecore:EReference" href="modes3.ecore#//Segment/connectedTo"/> | ||
1449 | <semanticElements xmi:type="ecore:EReference" href="modes3.ecore#//Segment/connectedTo"/> | ||
1450 | <ownedStyle xmi:type="diagram:EdgeStyle" uid="_h9CMYCB6EeeUF8d36bwwGg" routingStyle="manhattan" strokeColor="0,0,0"> | ||
1451 | <description xmi:type="style:EdgeStyleDescription" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@edgeMappings[name='EC_EReference']/@style"/> | ||
1452 | <centerLabelStyle xmi:type="diagram:CenterLabelStyle" uid="_h9CMYSB6EeeUF8d36bwwGg" showIcon="false"> | ||
1453 | <customFeatures>labelSize</customFeatures> | ||
1454 | </centerLabelStyle> | ||
1455 | <endLabelStyle xmi:type="diagram:EndLabelStyle" uid="_h9CMYiB6EeeUF8d36bwwGg" showIcon="false" labelColor="39,76,114"> | ||
1456 | <customFeatures>labelSize</customFeatures> | ||
1457 | </endLabelStyle> | ||
1458 | </ownedStyle> | ||
1459 | <actualMapping xmi:type="description_1:EdgeMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@edgeMappings[name='EC_EReference']"/> | ||
1460 | </ownedDiagramElements> | ||
1461 | <ownedDiagramElements xmi:type="diagram:DEdge" uid="_OyqkEDGjEeePY54_4mjBmA" sourceNode="_uyq7YB9kEee278vFHA2N9A" targetNode="_fHIIgCB1EeeUF8d36bwwGg" beginLabel="[1..1] location" endLabel="[0..1] occupiedBy"> | ||
1462 | <target xmi:type="ecore:EReference" href="modes3.ecore#//Segment/occupiedBy"/> | ||
1463 | <semanticElements xmi:type="ecore:EReference" href="modes3.ecore#//Train/location"/> | ||
1464 | <semanticElements xmi:type="ecore:EReference" href="modes3.ecore#//Segment/occupiedBy"/> | ||
1465 | <ownedStyle xmi:type="diagram:EdgeStyle" uid="_O0DEIDGjEeePY54_4mjBmA" sourceArrow="InputArrow" routingStyle="manhattan" strokeColor="0,0,0"> | ||
1466 | <description xmi:type="style:EdgeStyleDescription" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@edgeMappings[name='Bi-directional%20EC_EReference%20']/@style"/> | ||
1467 | <beginLabelStyle xmi:type="diagram:BeginLabelStyle" uid="_O0DEITGjEeePY54_4mjBmA" showIcon="false"/> | ||
1468 | <endLabelStyle xmi:type="diagram:EndLabelStyle" uid="_O0DEIjGjEeePY54_4mjBmA" showIcon="false"/> | ||
1469 | </ownedStyle> | ||
1470 | <actualMapping xmi:type="description_1:EdgeMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@edgeMappings[name='Bi-directional%20EC_EReference%20']"/> | ||
1471 | </ownedDiagramElements> | ||
1472 | <ownedDiagramElements xmi:type="diagram:DEdge" uid="_4u-ctmrPEeqC0oOqPAS8qg" name="[0..*] trains" sourceNode="_HZ5IwB9lEee278vFHA2N9A" targetNode="_fHIIgCB1EeeUF8d36bwwGg"> | ||
1473 | <target xmi:type="ecore:EReference" href="modes3.ecore#//Modes3ModelRoot/trains"/> | ||
1474 | <semanticElements xmi:type="ecore:EReference" href="modes3.ecore#//Modes3ModelRoot/trains"/> | ||
1475 | <ownedStyle xmi:type="diagram:EdgeStyle" uid="_4vA48GrPEeqC0oOqPAS8qg" description="_4vAR4GrPEeqC0oOqPAS8qg" sourceArrow="FillDiamond" routingStyle="manhattan" strokeColor="0,0,0"> | ||
1476 | <centerLabelStyle xmi:type="diagram:CenterLabelStyle" uid="_4vA48mrPEeqC0oOqPAS8qg" showIcon="false"> | ||
1477 | <customFeatures>labelSize</customFeatures> | ||
1478 | </centerLabelStyle> | ||
1479 | <endLabelStyle xmi:type="diagram:EndLabelStyle" uid="_4vA48WrPEeqC0oOqPAS8qg" showIcon="false" labelColor="39,76,114"> | ||
1480 | <customFeatures>labelSize</customFeatures> | ||
1481 | </endLabelStyle> | ||
1482 | </ownedStyle> | ||
1483 | <actualMapping xmi:type="description_1:EdgeMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@edgeMappings[name='EC_EReference']"/> | ||
1484 | </ownedDiagramElements> | ||
1485 | <ownedDiagramElements xmi:type="diagram:DEdge" uid="_-NSfgGrPEeqC0oOqPAS8qg" name="[0..*] segments" sourceNode="_HZ5IwB9lEee278vFHA2N9A" targetNode="_uyq7YB9kEee278vFHA2N9A"> | ||
1486 | <target xmi:type="ecore:EReference" href="modes3.ecore#//Modes3ModelRoot/segments"/> | ||
1487 | <semanticElements xmi:type="ecore:EReference" href="modes3.ecore#//Modes3ModelRoot/segments"/> | ||
1488 | <ownedStyle xmi:type="diagram:EdgeStyle" uid="_-NTtoGrPEeqC0oOqPAS8qg" description="_4vAR4GrPEeqC0oOqPAS8qg" sourceArrow="FillDiamond" routingStyle="manhattan" strokeColor="0,0,0"> | ||
1489 | <centerLabelStyle xmi:type="diagram:CenterLabelStyle" uid="_-NTtomrPEeqC0oOqPAS8qg" showIcon="false"> | ||
1490 | <customFeatures>labelSize</customFeatures> | ||
1491 | </centerLabelStyle> | ||
1492 | <endLabelStyle xmi:type="diagram:EndLabelStyle" uid="_-NTtoWrPEeqC0oOqPAS8qg" showIcon="false" labelColor="39,76,114"> | ||
1493 | <customFeatures>labelSize</customFeatures> | ||
1494 | </endLabelStyle> | ||
1495 | </ownedStyle> | ||
1496 | <actualMapping xmi:type="description_1:EdgeMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@edgeMappings[name='EC_EReference']"/> | ||
1497 | </ownedDiagramElements> | ||
1498 | <ownedDiagramElements xmi:type="diagram:DEdge" uid="_AwjGgmrQEeqC0oOqPAS8qg" name="[0..*] turnouts" sourceNode="_HZ5IwB9lEee278vFHA2N9A" targetNode="_I1kK8CB1EeeUF8d36bwwGg"> | ||
1499 | <target xmi:type="ecore:EReference" href="modes3.ecore#//Modes3ModelRoot/turnouts"/> | ||
1500 | <semanticElements xmi:type="ecore:EReference" href="modes3.ecore#//Modes3ModelRoot/turnouts"/> | ||
1501 | <ownedStyle xmi:type="diagram:EdgeStyle" uid="_AwjtgGrQEeqC0oOqPAS8qg" description="_4vAR4GrPEeqC0oOqPAS8qg" sourceArrow="FillDiamond" routingStyle="manhattan" strokeColor="0,0,0"> | ||
1502 | <centerLabelStyle xmi:type="diagram:CenterLabelStyle" uid="_AwjtgmrQEeqC0oOqPAS8qg" showIcon="false"> | ||
1503 | <customFeatures>labelSize</customFeatures> | ||
1504 | </centerLabelStyle> | ||
1505 | <endLabelStyle xmi:type="diagram:EndLabelStyle" uid="_AwjtgWrQEeqC0oOqPAS8qg" showIcon="false" labelColor="39,76,114"> | ||
1506 | <customFeatures>labelSize</customFeatures> | ||
1507 | </endLabelStyle> | ||
1508 | </ownedStyle> | ||
1509 | <actualMapping xmi:type="description_1:EdgeMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@edgeMappings[name='EC_EReference']"/> | ||
1510 | </ownedDiagramElements> | ||
1511 | <ownedDiagramElements xmi:type="diagram:DEdge" uid="_Z0H0oGr8EeqC0oOqPAS8qg" sourceNode="_I1kK8CB1EeeUF8d36bwwGg" targetNode="_uyq7YB9kEee278vFHA2N9A"> | ||
1512 | <target xmi:type="ecore:EClass" href="modes3.ecore#//Turnout"/> | ||
1513 | <semanticElements xmi:type="ecore:EClass" href="modes3.ecore#//Turnout"/> | ||
1514 | <ownedStyle xmi:type="diagram:EdgeStyle" uid="_Z0H0oWr8EeqC0oOqPAS8qg" targetArrow="InputClosedArrow" routingStyle="tree"> | ||
1515 | <description xmi:type="style:EdgeStyleDescription" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@edgeMappings[name='EC%20ESupertypes']/@style"/> | ||
1516 | <beginLabelStyle xmi:type="diagram:BeginLabelStyle" uid="_Z0H0omr8EeqC0oOqPAS8qg" showIcon="false"> | ||
1517 | <labelFormat>italic</labelFormat> | ||
1518 | </beginLabelStyle> | ||
1519 | <centerLabelStyle xmi:type="diagram:CenterLabelStyle" uid="_Z0H0o2r8EeqC0oOqPAS8qg" showIcon="false"/> | ||
1520 | </ownedStyle> | ||
1521 | <actualMapping xmi:type="description_1:EdgeMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@edgeMappings[name='EC%20ESupertypes']"/> | ||
1522 | </ownedDiagramElements> | ||
1523 | <description xmi:type="description_1:DiagramDescription" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']"/> | ||
1524 | <filterVariableHistory xmi:type="diagram:FilterVariableHistory" uid="_QqO3BRFUEeeHWeeZwj2u8w"/> | ||
1525 | <activatedLayers xmi:type="description_1:Layer" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer"/> | ||
1526 | <activatedLayers xmi:type="description_1:AdditionalLayer" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@additionalLayers[name='Package']"/> | ||
1527 | <activatedLayers xmi:type="description_1:AdditionalLayer" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@additionalLayers[name='Validation']"/> | ||
1528 | <activatedLayers xmi:type="description_1:AdditionalLayer" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Archetype']/@ownedRepresentationExtensions[name='Entities%20With%20Archetypes']/@layers[name='Archetypes']"/> | ||
1529 | <target xmi:type="ecore:EPackage" href="modes3.ecore#/"/> | ||
1530 | </diagram:DSemanticDiagram> | ||
1531 | </xmi:XMI> | ||
diff --git a/Domains/ca.mcgill.rtgmrt.example.modes3/model/modes3.ecore b/Domains/ca.mcgill.rtgmrt.example.modes3/model/modes3.ecore new file mode 100644 index 00000000..aa50b778 --- /dev/null +++ b/Domains/ca.mcgill.rtgmrt.example.modes3/model/modes3.ecore | |||
@@ -0,0 +1,32 @@ | |||
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" | ||
3 | xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="modes3" nsURI="http://www.ece.mcgill.ca/wcet/modes3" nsPrefix="modes3"> | ||
4 | <eClassifiers xsi:type="ecore:EClass" name="Segment"> | ||
5 | <eStructuralFeatures xsi:type="ecore:EReference" name="connectedTo" upperBound="2" | ||
6 | eType="#//Segment"/> | ||
7 | <eStructuralFeatures xsi:type="ecore:EReference" name="occupiedBy" eType="#//Train" | ||
8 | eOpposite="#//Train/location"/> | ||
9 | <eStructuralFeatures xsi:type="ecore:EAttribute" name="id" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/> | ||
10 | </eClassifiers> | ||
11 | <eClassifiers xsi:type="ecore:EClass" name="Modes3ModelRoot"> | ||
12 | <eStructuralFeatures xsi:type="ecore:EAttribute" name="id" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/> | ||
13 | <eStructuralFeatures xsi:type="ecore:EReference" name="trains" upperBound="-1" | ||
14 | eType="#//Train" containment="true"/> | ||
15 | <eStructuralFeatures xsi:type="ecore:EReference" name="segments" upperBound="-1" | ||
16 | eType="#//Segment" containment="true"/> | ||
17 | <eStructuralFeatures xsi:type="ecore:EReference" name="turnouts" upperBound="-1" | ||
18 | eType="#//Turnout" containment="true"/> | ||
19 | </eClassifiers> | ||
20 | <eClassifiers xsi:type="ecore:EClass" name="Turnout" eSuperTypes="#//Segment"> | ||
21 | <eStructuralFeatures xsi:type="ecore:EReference" name="straight" lowerBound="1" | ||
22 | eType="#//Segment"/> | ||
23 | <eStructuralFeatures xsi:type="ecore:EReference" name="divergent" lowerBound="1" | ||
24 | eType="#//Segment"/> | ||
25 | </eClassifiers> | ||
26 | <eClassifiers xsi:type="ecore:EClass" name="Train"> | ||
27 | <eStructuralFeatures xsi:type="ecore:EReference" name="location" lowerBound="1" | ||
28 | eType="#//Segment" eOpposite="#//Segment/occupiedBy"/> | ||
29 | <eStructuralFeatures xsi:type="ecore:EAttribute" name="id" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/> | ||
30 | <eStructuralFeatures xsi:type="ecore:EAttribute" name="speed" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDouble"/> | ||
31 | </eClassifiers> | ||
32 | </ecore:EPackage> | ||
diff --git a/Domains/ca.mcgill.rtgmrt.example.modes3/model/modes3.genmodel b/Domains/ca.mcgill.rtgmrt.example.modes3/model/modes3.genmodel new file mode 100644 index 00000000..1a6c7a84 --- /dev/null +++ b/Domains/ca.mcgill.rtgmrt.example.modes3/model/modes3.genmodel | |||
@@ -0,0 +1,30 @@ | |||
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.rtgmrt.example.modes3/ecore-gen" modelPluginID="ca.mcgill.rtgmrt.example.modes3" | ||
4 | modelName="Modes3" rootExtendsClass="org.eclipse.emf.ecore.impl.MinimalEObjectImpl$Container" | ||
5 | importerID="org.eclipse.emf.importer.ecore" complianceLevel="5.0" copyrightFields="false" | ||
6 | operationReflection="true" importOrganizing="true"> | ||
7 | <foreignModel>modes3.ecore</foreignModel> | ||
8 | <genPackages prefix="Modes3" disposableProviderFactory="true" ecorePackage="modes3.ecore#/"> | ||
9 | <genClasses ecoreClass="modes3.ecore#//Segment"> | ||
10 | <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference modes3.ecore#//Segment/connectedTo"/> | ||
11 | <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference modes3.ecore#//Segment/occupiedBy"/> | ||
12 | <genFeatures createChild="false" ecoreFeature="ecore:EAttribute modes3.ecore#//Segment/id"/> | ||
13 | </genClasses> | ||
14 | <genClasses ecoreClass="modes3.ecore#//Modes3ModelRoot"> | ||
15 | <genFeatures createChild="false" ecoreFeature="ecore:EAttribute modes3.ecore#//Modes3ModelRoot/id"/> | ||
16 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference modes3.ecore#//Modes3ModelRoot/trains"/> | ||
17 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference modes3.ecore#//Modes3ModelRoot/segments"/> | ||
18 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference modes3.ecore#//Modes3ModelRoot/turnouts"/> | ||
19 | </genClasses> | ||
20 | <genClasses ecoreClass="modes3.ecore#//Turnout"> | ||
21 | <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference modes3.ecore#//Turnout/straight"/> | ||
22 | <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference modes3.ecore#//Turnout/divergent"/> | ||
23 | </genClasses> | ||
24 | <genClasses ecoreClass="modes3.ecore#//Train"> | ||
25 | <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference modes3.ecore#//Train/location"/> | ||
26 | <genFeatures createChild="false" ecoreFeature="ecore:EAttribute modes3.ecore#//Train/id"/> | ||
27 | <genFeatures createChild="false" ecoreFeature="ecore:EAttribute modes3.ecore#//Train/speed"/> | ||
28 | </genClasses> | ||
29 | </genPackages> | ||
30 | </genmodel:GenModel> | ||
diff --git a/Domains/ca.mcgill.rtgmrt.example.modes3/output/solution.partialinterpretation b/Domains/ca.mcgill.rtgmrt.example.modes3/output/solution.partialinterpretation new file mode 100644 index 00000000..bbf46091 --- /dev/null +++ b/Domains/ca.mcgill.rtgmrt.example.modes3/output/solution.partialinterpretation | |||
@@ -0,0 +1,1068 @@ | |||
1 | <?xml version="1.0" encoding="ASCII"?> | ||
2 | <language:LogicProblem xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore2logicannotations="http://www.bme.hu/mit/inf/dslreasoner/logic/model/language/ecore2logicannotation" xmlns:language="http://www.bme.hu/mit/inf/dslreasoner/logic/model/problem" xmlns:language_1="http://www.bme.hu/mit/inf/dslreasoner/logic/model/language" xmlns:viatra2logicannotations="http://www.bme.hu/mit/inf/dslreasoner/logic/model/language/viatra2logicannotation"> | ||
3 | <types xsi:type="language_1:TypeDeclaration" name="Segment class" subtypes="//@types.2"/> | ||
4 | <types xsi:type="language_1:TypeDeclaration" name="Modes3ModelRoot class" subtypes="//@types.4 //@types.5" isAbstract="true"/> | ||
5 | <types xsi:type="language_1:TypeDeclaration" name="Turnout class" supertypes="//@types.0"/> | ||
6 | <types xsi:type="language_1:TypeDeclaration" name="Train class"/> | ||
7 | <types xsi:type="language_1:TypeDefinition" name="Modes3ModelRoot class DefinedPart" supertypes="//@types.1" elements="//@elements.0"/> | ||
8 | <types xsi:type="language_1:TypeDeclaration" name="Modes3ModelRoot class UndefinedPart" supertypes="//@types.1"/> | ||
9 | <assertions name="upperMultiplicity connectedTo Segment" annotations="//@annotations.0"> | ||
10 | <value xsi:type="language_1:Forall"> | ||
11 | <quantifiedVariables name="src"> | ||
12 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
13 | </quantifiedVariables> | ||
14 | <quantifiedVariables name="trg 1"> | ||
15 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
16 | </quantifiedVariables> | ||
17 | <quantifiedVariables name="trg 2"> | ||
18 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
19 | </quantifiedVariables> | ||
20 | <quantifiedVariables name="trg 3"> | ||
21 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
22 | </quantifiedVariables> | ||
23 | <expression xsi:type="language_1:Impl"> | ||
24 | <leftOperand xsi:type="language_1:And"> | ||
25 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.0"> | ||
26 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.0/@value/@quantifiedVariables.0"/> | ||
27 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.0/@value/@quantifiedVariables.1"/> | ||
28 | </operands> | ||
29 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.0"> | ||
30 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.0/@value/@quantifiedVariables.0"/> | ||
31 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.0/@value/@quantifiedVariables.2"/> | ||
32 | </operands> | ||
33 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.0"> | ||
34 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.0/@value/@quantifiedVariables.0"/> | ||
35 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.0/@value/@quantifiedVariables.3"/> | ||
36 | </operands> | ||
37 | </leftOperand> | ||
38 | <rightOperand xsi:type="language_1:Not"> | ||
39 | <operand xsi:type="language_1:Distinct"> | ||
40 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.0/@value/@quantifiedVariables.1"/> | ||
41 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.0/@value/@quantifiedVariables.2"/> | ||
42 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.0/@value/@quantifiedVariables.3"/> | ||
43 | </operand> | ||
44 | </rightOperand> | ||
45 | </expression> | ||
46 | </value> | ||
47 | </assertions> | ||
48 | <assertions name="upperMultiplicity occupiedBy Segment" annotations="//@annotations.1"> | ||
49 | <value xsi:type="language_1:Forall"> | ||
50 | <quantifiedVariables name="src"> | ||
51 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
52 | </quantifiedVariables> | ||
53 | <quantifiedVariables name="trg 1"> | ||
54 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.3"/> | ||
55 | </quantifiedVariables> | ||
56 | <quantifiedVariables name="trg 2"> | ||
57 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.3"/> | ||
58 | </quantifiedVariables> | ||
59 | <expression xsi:type="language_1:Impl"> | ||
60 | <leftOperand xsi:type="language_1:And"> | ||
61 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.1"> | ||
62 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.1/@value/@quantifiedVariables.0"/> | ||
63 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.1/@value/@quantifiedVariables.1"/> | ||
64 | </operands> | ||
65 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.1"> | ||
66 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.1/@value/@quantifiedVariables.0"/> | ||
67 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.1/@value/@quantifiedVariables.2"/> | ||
68 | </operands> | ||
69 | </leftOperand> | ||
70 | <rightOperand xsi:type="language_1:Not"> | ||
71 | <operand xsi:type="language_1:Distinct"> | ||
72 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.1/@value/@quantifiedVariables.1"/> | ||
73 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.1/@value/@quantifiedVariables.2"/> | ||
74 | </operand> | ||
75 | </rightOperand> | ||
76 | </expression> | ||
77 | </value> | ||
78 | </assertions> | ||
79 | <assertions name="lowerMultiplicity straight Turnout" annotations="//@annotations.2"> | ||
80 | <value xsi:type="language_1:Forall"> | ||
81 | <quantifiedVariables name="src"> | ||
82 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.2"/> | ||
83 | </quantifiedVariables> | ||
84 | <expression xsi:type="language_1:Exists"> | ||
85 | <quantifiedVariables name="trg 1"> | ||
86 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
87 | </quantifiedVariables> | ||
88 | <expression xsi:type="language_1:And"> | ||
89 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.5"> | ||
90 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.2/@value/@quantifiedVariables.0"/> | ||
91 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.2/@value/@expression/@quantifiedVariables.0"/> | ||
92 | </operands> | ||
93 | </expression> | ||
94 | </expression> | ||
95 | </value> | ||
96 | </assertions> | ||
97 | <assertions name="upperMultiplicity straight Turnout" annotations="//@annotations.3"> | ||
98 | <value xsi:type="language_1:Forall"> | ||
99 | <quantifiedVariables name="src"> | ||
100 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.2"/> | ||
101 | </quantifiedVariables> | ||
102 | <quantifiedVariables name="trg 1"> | ||
103 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
104 | </quantifiedVariables> | ||
105 | <quantifiedVariables name="trg 2"> | ||
106 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
107 | </quantifiedVariables> | ||
108 | <expression xsi:type="language_1:Impl"> | ||
109 | <leftOperand xsi:type="language_1:And"> | ||
110 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.5"> | ||
111 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.3/@value/@quantifiedVariables.0"/> | ||
112 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.3/@value/@quantifiedVariables.1"/> | ||
113 | </operands> | ||
114 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.5"> | ||
115 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.3/@value/@quantifiedVariables.0"/> | ||
116 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.3/@value/@quantifiedVariables.2"/> | ||
117 | </operands> | ||
118 | </leftOperand> | ||
119 | <rightOperand xsi:type="language_1:Not"> | ||
120 | <operand xsi:type="language_1:Distinct"> | ||
121 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.3/@value/@quantifiedVariables.1"/> | ||
122 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.3/@value/@quantifiedVariables.2"/> | ||
123 | </operand> | ||
124 | </rightOperand> | ||
125 | </expression> | ||
126 | </value> | ||
127 | </assertions> | ||
128 | <assertions name="lowerMultiplicity divergent Turnout" annotations="//@annotations.4"> | ||
129 | <value xsi:type="language_1:Forall"> | ||
130 | <quantifiedVariables name="src"> | ||
131 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.2"/> | ||
132 | </quantifiedVariables> | ||
133 | <expression xsi:type="language_1:Exists"> | ||
134 | <quantifiedVariables name="trg 1"> | ||
135 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
136 | </quantifiedVariables> | ||
137 | <expression xsi:type="language_1:And"> | ||
138 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.6"> | ||
139 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.4/@value/@quantifiedVariables.0"/> | ||
140 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.4/@value/@expression/@quantifiedVariables.0"/> | ||
141 | </operands> | ||
142 | </expression> | ||
143 | </expression> | ||
144 | </value> | ||
145 | </assertions> | ||
146 | <assertions name="upperMultiplicity divergent Turnout" annotations="//@annotations.5"> | ||
147 | <value xsi:type="language_1:Forall"> | ||
148 | <quantifiedVariables name="src"> | ||
149 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.2"/> | ||
150 | </quantifiedVariables> | ||
151 | <quantifiedVariables name="trg 1"> | ||
152 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
153 | </quantifiedVariables> | ||
154 | <quantifiedVariables name="trg 2"> | ||
155 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
156 | </quantifiedVariables> | ||
157 | <expression xsi:type="language_1:Impl"> | ||
158 | <leftOperand xsi:type="language_1:And"> | ||
159 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.6"> | ||
160 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.5/@value/@quantifiedVariables.0"/> | ||
161 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.5/@value/@quantifiedVariables.1"/> | ||
162 | </operands> | ||
163 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.6"> | ||
164 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.5/@value/@quantifiedVariables.0"/> | ||
165 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.5/@value/@quantifiedVariables.2"/> | ||
166 | </operands> | ||
167 | </leftOperand> | ||
168 | <rightOperand xsi:type="language_1:Not"> | ||
169 | <operand xsi:type="language_1:Distinct"> | ||
170 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.5/@value/@quantifiedVariables.1"/> | ||
171 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.5/@value/@quantifiedVariables.2"/> | ||
172 | </operand> | ||
173 | </rightOperand> | ||
174 | </expression> | ||
175 | </value> | ||
176 | </assertions> | ||
177 | <assertions name="lowerMultiplicity location Train" annotations="//@annotations.6"> | ||
178 | <value xsi:type="language_1:Forall"> | ||
179 | <quantifiedVariables name="src"> | ||
180 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.3"/> | ||
181 | </quantifiedVariables> | ||
182 | <expression xsi:type="language_1:Exists"> | ||
183 | <quantifiedVariables name="trg 1"> | ||
184 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
185 | </quantifiedVariables> | ||
186 | <expression xsi:type="language_1:And"> | ||
187 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.7"> | ||
188 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.6/@value/@quantifiedVariables.0"/> | ||
189 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.6/@value/@expression/@quantifiedVariables.0"/> | ||
190 | </operands> | ||
191 | </expression> | ||
192 | </expression> | ||
193 | </value> | ||
194 | </assertions> | ||
195 | <assertions name="upperMultiplicity location Train" annotations="//@annotations.7"> | ||
196 | <value xsi:type="language_1:Forall"> | ||
197 | <quantifiedVariables name="src"> | ||
198 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.3"/> | ||
199 | </quantifiedVariables> | ||
200 | <quantifiedVariables name="trg 1"> | ||
201 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
202 | </quantifiedVariables> | ||
203 | <quantifiedVariables name="trg 2"> | ||
204 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
205 | </quantifiedVariables> | ||
206 | <expression xsi:type="language_1:Impl"> | ||
207 | <leftOperand xsi:type="language_1:And"> | ||
208 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.7"> | ||
209 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.7/@value/@quantifiedVariables.0"/> | ||
210 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.7/@value/@quantifiedVariables.1"/> | ||
211 | </operands> | ||
212 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.7"> | ||
213 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.7/@value/@quantifiedVariables.0"/> | ||
214 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.7/@value/@quantifiedVariables.2"/> | ||
215 | </operands> | ||
216 | </leftOperand> | ||
217 | <rightOperand xsi:type="language_1:Not"> | ||
218 | <operand xsi:type="language_1:Distinct"> | ||
219 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.7/@value/@quantifiedVariables.1"/> | ||
220 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.7/@value/@quantifiedVariables.2"/> | ||
221 | </operand> | ||
222 | </rightOperand> | ||
223 | </expression> | ||
224 | </value> | ||
225 | </assertions> | ||
226 | <assertions name="oppositeReference occupiedBy Segment" annotations="//@annotations.8"> | ||
227 | <value xsi:type="language_1:Forall"> | ||
228 | <quantifiedVariables name="src"> | ||
229 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
230 | </quantifiedVariables> | ||
231 | <quantifiedVariables name="trg"> | ||
232 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.3"/> | ||
233 | </quantifiedVariables> | ||
234 | <expression xsi:type="language_1:Iff"> | ||
235 | <leftOperand xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.1"> | ||
236 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.8/@value/@quantifiedVariables.0"/> | ||
237 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.8/@value/@quantifiedVariables.1"/> | ||
238 | </leftOperand> | ||
239 | <rightOperand xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.7"> | ||
240 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.8/@value/@quantifiedVariables.1"/> | ||
241 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.8/@value/@quantifiedVariables.0"/> | ||
242 | </rightOperand> | ||
243 | </expression> | ||
244 | </value> | ||
245 | </assertions> | ||
246 | <assertions name="oppositeReference connectedTo reference Segment connectedTo reference Segment" annotations="//@annotations.9"> | ||
247 | <value xsi:type="language_1:Forall"> | ||
248 | <quantifiedVariables name="src"> | ||
249 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
250 | </quantifiedVariables> | ||
251 | <quantifiedVariables name="trg"> | ||
252 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
253 | </quantifiedVariables> | ||
254 | <expression xsi:type="language_1:Iff"> | ||
255 | <leftOperand xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.0"> | ||
256 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.9/@value/@quantifiedVariables.0"/> | ||
257 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.9/@value/@quantifiedVariables.1"/> | ||
258 | </leftOperand> | ||
259 | <rightOperand xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.0"> | ||
260 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.9/@value/@quantifiedVariables.1"/> | ||
261 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.9/@value/@quantifiedVariables.0"/> | ||
262 | </rightOperand> | ||
263 | </expression> | ||
264 | </value> | ||
265 | </assertions> | ||
266 | <assertions name="errorpattern modes3 queries turnoutInSegments" annotations="//@annotations.29"> | ||
267 | <value xsi:type="language_1:Forall"> | ||
268 | <quantifiedVariables name="p0"> | ||
269 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.2"/> | ||
270 | </quantifiedVariables> | ||
271 | <expression xsi:type="language_1:Not"> | ||
272 | <operand xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.8"> | ||
273 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.10/@value/@quantifiedVariables.0"/> | ||
274 | </operand> | ||
275 | </expression> | ||
276 | </value> | ||
277 | </assertions> | ||
278 | <assertions name="errorpattern modes3 queries unreachable" annotations="//@annotations.30"> | ||
279 | <value xsi:type="language_1:Forall"> | ||
280 | <quantifiedVariables name="p0"> | ||
281 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
282 | </quantifiedVariables> | ||
283 | <quantifiedVariables name="p1"> | ||
284 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
285 | </quantifiedVariables> | ||
286 | <expression xsi:type="language_1:Not"> | ||
287 | <operand xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.9"> | ||
288 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.11/@value/@quantifiedVariables.0"/> | ||
289 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.11/@value/@quantifiedVariables.1"/> | ||
290 | </operand> | ||
291 | </expression> | ||
292 | </value> | ||
293 | </assertions> | ||
294 | <assertions name="errorpattern modes3 queries turnoutOutputsAreSame" annotations="//@annotations.31"> | ||
295 | <value xsi:type="language_1:Forall"> | ||
296 | <quantifiedVariables name="p0"> | ||
297 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.2"/> | ||
298 | </quantifiedVariables> | ||
299 | <expression xsi:type="language_1:Not"> | ||
300 | <operand xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.11"> | ||
301 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.12/@value/@quantifiedVariables.0"/> | ||
302 | </operand> | ||
303 | </expression> | ||
304 | </value> | ||
305 | </assertions> | ||
306 | <assertions name="errorpattern modes3 queries turnoutConnectedToBothOutputs" annotations="//@annotations.32"> | ||
307 | <value xsi:type="language_1:Forall"> | ||
308 | <quantifiedVariables name="p0"> | ||
309 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.2"/> | ||
310 | </quantifiedVariables> | ||
311 | <expression xsi:type="language_1:Not"> | ||
312 | <operand xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.13"> | ||
313 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.13/@value/@quantifiedVariables.0"/> | ||
314 | </operand> | ||
315 | </expression> | ||
316 | </value> | ||
317 | </assertions> | ||
318 | <assertions name="errorpattern modes3 queries tooManyExtraInputsOfTurnout" annotations="//@annotations.33"> | ||
319 | <value xsi:type="language_1:Forall"> | ||
320 | <quantifiedVariables name="p0"> | ||
321 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.2"/> | ||
322 | </quantifiedVariables> | ||
323 | <expression xsi:type="language_1:Not"> | ||
324 | <operand xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.14"> | ||
325 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.14/@value/@quantifiedVariables.0"/> | ||
326 | </operand> | ||
327 | </expression> | ||
328 | </value> | ||
329 | </assertions> | ||
330 | <assertions name="errorpattern modes3 queries connectedToReflexive" annotations="//@annotations.34"> | ||
331 | <value xsi:type="language_1:Forall"> | ||
332 | <quantifiedVariables name="p0"> | ||
333 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
334 | </quantifiedVariables> | ||
335 | <expression xsi:type="language_1:Not"> | ||
336 | <operand xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.15"> | ||
337 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.15/@value/@quantifiedVariables.0"/> | ||
338 | </operand> | ||
339 | </expression> | ||
340 | </value> | ||
341 | </assertions> | ||
342 | <assertions name="errorpattern modes3 queries outputReflexive" annotations="//@annotations.35"> | ||
343 | <value xsi:type="language_1:Forall"> | ||
344 | <quantifiedVariables name="p0"> | ||
345 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.2"/> | ||
346 | </quantifiedVariables> | ||
347 | <expression xsi:type="language_1:Not"> | ||
348 | <operand xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.18"> | ||
349 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.16/@value/@quantifiedVariables.0"/> | ||
350 | </operand> | ||
351 | </expression> | ||
352 | </value> | ||
353 | </assertions> | ||
354 | <assertions name="errorpattern modes3 queries tooManyInputsOfSegment" annotations="//@annotations.36"> | ||
355 | <value xsi:type="language_1:Forall"> | ||
356 | <quantifiedVariables name="p0"> | ||
357 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
358 | </quantifiedVariables> | ||
359 | <expression xsi:type="language_1:Not"> | ||
360 | <operand xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.19"> | ||
361 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.17/@value/@quantifiedVariables.0"/> | ||
362 | </operand> | ||
363 | </expression> | ||
364 | </value> | ||
365 | </assertions> | ||
366 | <assertions name="errorpattern modes3 queries noExtraInputOfTurnout" annotations="//@annotations.37"> | ||
367 | <value xsi:type="language_1:Forall"> | ||
368 | <quantifiedVariables name="p0"> | ||
369 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.2"/> | ||
370 | </quantifiedVariables> | ||
371 | <expression xsi:type="language_1:Not"> | ||
372 | <operand xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.20"> | ||
373 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.18/@value/@quantifiedVariables.0"/> | ||
374 | </operand> | ||
375 | </expression> | ||
376 | </value> | ||
377 | </assertions> | ||
378 | <assertions name="errorpattern modes3 queries turnoutNotConnectedToOutput" annotations="//@annotations.38"> | ||
379 | <value xsi:type="language_1:Forall"> | ||
380 | <quantifiedVariables name="p0"> | ||
381 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.2"/> | ||
382 | </quantifiedVariables> | ||
383 | <expression xsi:type="language_1:Not"> | ||
384 | <operand xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.22"> | ||
385 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.19/@value/@quantifiedVariables.0"/> | ||
386 | </operand> | ||
387 | </expression> | ||
388 | </value> | ||
389 | </assertions> | ||
390 | <assertions name="errorpattern modes3 queries connectedToNotSymmetric" annotations="//@annotations.39"> | ||
391 | <value xsi:type="language_1:Forall"> | ||
392 | <quantifiedVariables name="p0"> | ||
393 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
394 | </quantifiedVariables> | ||
395 | <quantifiedVariables name="p1"> | ||
396 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
397 | </quantifiedVariables> | ||
398 | <expression xsi:type="language_1:Not"> | ||
399 | <operand xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.24"> | ||
400 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.20/@value/@quantifiedVariables.0"/> | ||
401 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.20/@value/@quantifiedVariables.1"/> | ||
402 | </operand> | ||
403 | </expression> | ||
404 | </value> | ||
405 | </assertions> | ||
406 | <assertions name="errorpattern modes3 queries noInputOfSegment" annotations="//@annotations.40"> | ||
407 | <value xsi:type="language_1:Forall"> | ||
408 | <quantifiedVariables name="p0"> | ||
409 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
410 | </quantifiedVariables> | ||
411 | <expression xsi:type="language_1:Not"> | ||
412 | <operand xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.26"> | ||
413 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.21/@value/@quantifiedVariables.0"/> | ||
414 | </operand> | ||
415 | </expression> | ||
416 | </value> | ||
417 | </assertions> | ||
418 | <relations xsi:type="language_1:RelationDeclaration" name="connectedTo reference Segment"> | ||
419 | <parameters xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
420 | <parameters xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
421 | </relations> | ||
422 | <relations xsi:type="language_1:RelationDeclaration" name="occupiedBy reference Segment"> | ||
423 | <parameters xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
424 | <parameters xsi:type="language_1:ComplexTypeReference" referred="//@types.3"/> | ||
425 | </relations> | ||
426 | <relations xsi:type="language_1:RelationDeclaration" name="trains reference Modes3ModelRoot"> | ||
427 | <parameters xsi:type="language_1:ComplexTypeReference" referred="//@types.1"/> | ||
428 | <parameters xsi:type="language_1:ComplexTypeReference" referred="//@types.3"/> | ||
429 | </relations> | ||
430 | <relations xsi:type="language_1:RelationDeclaration" name="segments reference Modes3ModelRoot"> | ||
431 | <parameters xsi:type="language_1:ComplexTypeReference" referred="//@types.1"/> | ||
432 | <parameters xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
433 | </relations> | ||
434 | <relations xsi:type="language_1:RelationDeclaration" name="turnouts reference Modes3ModelRoot"> | ||
435 | <parameters xsi:type="language_1:ComplexTypeReference" referred="//@types.1"/> | ||
436 | <parameters xsi:type="language_1:ComplexTypeReference" referred="//@types.2"/> | ||
437 | </relations> | ||
438 | <relations xsi:type="language_1:RelationDeclaration" name="straight reference Turnout"> | ||
439 | <parameters xsi:type="language_1:ComplexTypeReference" referred="//@types.2"/> | ||
440 | <parameters xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
441 | </relations> | ||
442 | <relations xsi:type="language_1:RelationDeclaration" name="divergent reference Turnout"> | ||
443 | <parameters xsi:type="language_1:ComplexTypeReference" referred="//@types.2"/> | ||
444 | <parameters xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
445 | </relations> | ||
446 | <relations xsi:type="language_1:RelationDeclaration" name="location reference Train"> | ||
447 | <parameters xsi:type="language_1:ComplexTypeReference" referred="//@types.3"/> | ||
448 | <parameters xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
449 | </relations> | ||
450 | <relations xsi:type="language_1:RelationDefinition" name="pattern modes3 queries turnoutInSegments" annotations="//@annotations.10"> | ||
451 | <parameters xsi:type="language_1:ComplexTypeReference" referred="//@types.2"/> | ||
452 | <variables name="parameter T"> | ||
453 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.2"/> | ||
454 | </variables> | ||
455 | <value xsi:type="language_1:Or"> | ||
456 | <operands xsi:type="language_1:Exists"> | ||
457 | <quantifiedVariables name="variable 0"> | ||
458 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.1"/> | ||
459 | </quantifiedVariables> | ||
460 | <expression xsi:type="language_1:And"> | ||
461 | <operands xsi:type="language_1:InstanceOf"> | ||
462 | <value xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.8/@variables.0"/> | ||
463 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.2"/> | ||
464 | </operands> | ||
465 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.3"> | ||
466 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.8/@value/@operands.0/@quantifiedVariables.0"/> | ||
467 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.8/@variables.0"/> | ||
468 | </operands> | ||
469 | </expression> | ||
470 | </operands> | ||
471 | </value> | ||
472 | </relations> | ||
473 | <relations xsi:type="language_1:RelationDefinition" name="pattern modes3 queries unreachable" annotations="//@annotations.11"> | ||
474 | <parameters xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
475 | <parameters xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
476 | <variables name="parameter S1"> | ||
477 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
478 | </variables> | ||
479 | <variables name="parameter S2"> | ||
480 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
481 | </variables> | ||
482 | <value xsi:type="language_1:Or"> | ||
483 | <operands xsi:type="language_1:And"> | ||
484 | <operands xsi:type="language_1:InstanceOf"> | ||
485 | <value xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.9/@variables.0"/> | ||
486 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
487 | </operands> | ||
488 | <operands xsi:type="language_1:InstanceOf"> | ||
489 | <value xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.9/@variables.1"/> | ||
490 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
491 | </operands> | ||
492 | <operands xsi:type="language_1:Not"> | ||
493 | <operand xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.21"> | ||
494 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.9/@variables.0"/> | ||
495 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.9/@variables.1"/> | ||
496 | </operand> | ||
497 | </operands> | ||
498 | </operands> | ||
499 | </value> | ||
500 | </relations> | ||
501 | <relations xsi:type="language_1:RelationDefinition" name="pattern modes3 queries turnout" annotations="//@annotations.12"> | ||
502 | <parameters xsi:type="language_1:ComplexTypeReference" referred="//@types.2"/> | ||
503 | <variables name="parameter T"> | ||
504 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.2"/> | ||
505 | </variables> | ||
506 | <value xsi:type="language_1:Or"> | ||
507 | <operands xsi:type="language_1:And"> | ||
508 | <operands xsi:type="language_1:InstanceOf"> | ||
509 | <value xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.10/@variables.0"/> | ||
510 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.2"/> | ||
511 | </operands> | ||
512 | </operands> | ||
513 | </value> | ||
514 | </relations> | ||
515 | <relations xsi:type="language_1:RelationDefinition" name="pattern modes3 queries turnoutOutputsAreSame" annotations="//@annotations.13"> | ||
516 | <parameters xsi:type="language_1:ComplexTypeReference" referred="//@types.2"/> | ||
517 | <variables name="parameter T"> | ||
518 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.2"/> | ||
519 | </variables> | ||
520 | <value xsi:type="language_1:Or"> | ||
521 | <operands xsi:type="language_1:Exists"> | ||
522 | <quantifiedVariables name="variable S"> | ||
523 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
524 | </quantifiedVariables> | ||
525 | <expression xsi:type="language_1:And"> | ||
526 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.5"> | ||
527 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.11/@variables.0"/> | ||
528 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.11/@value/@operands.0/@quantifiedVariables.0"/> | ||
529 | </operands> | ||
530 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.6"> | ||
531 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.11/@variables.0"/> | ||
532 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.11/@value/@operands.0/@quantifiedVariables.0"/> | ||
533 | </operands> | ||
534 | <operands xsi:type="language_1:InstanceOf"> | ||
535 | <value xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.11/@value/@operands.0/@quantifiedVariables.0"/> | ||
536 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
537 | </operands> | ||
538 | </expression> | ||
539 | </operands> | ||
540 | </value> | ||
541 | </relations> | ||
542 | <relations xsi:type="language_1:RelationDefinition" name="pattern modes3 queries extraInputOfTurnout" annotations="//@annotations.14"> | ||
543 | <parameters xsi:type="language_1:ComplexTypeReference" referred="//@types.2"/> | ||
544 | <parameters xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
545 | <variables name="parameter T"> | ||
546 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.2"/> | ||
547 | </variables> | ||
548 | <variables name="parameter S"> | ||
549 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
550 | </variables> | ||
551 | <value xsi:type="language_1:Or"> | ||
552 | <operands xsi:type="language_1:Exists"> | ||
553 | <quantifiedVariables name="variable Straight"> | ||
554 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
555 | </quantifiedVariables> | ||
556 | <quantifiedVariables name="variable Divergent"> | ||
557 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
558 | </quantifiedVariables> | ||
559 | <expression xsi:type="language_1:And"> | ||
560 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.5"> | ||
561 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.12/@variables.0"/> | ||
562 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.12/@value/@operands.0/@quantifiedVariables.0"/> | ||
563 | </operands> | ||
564 | <operands xsi:type="language_1:InstanceOf"> | ||
565 | <value xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.12/@value/@operands.0/@quantifiedVariables.0"/> | ||
566 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
567 | </operands> | ||
568 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.6"> | ||
569 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.12/@variables.0"/> | ||
570 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.12/@value/@operands.0/@quantifiedVariables.1"/> | ||
571 | </operands> | ||
572 | <operands xsi:type="language_1:InstanceOf"> | ||
573 | <value xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.12/@value/@operands.0/@quantifiedVariables.1"/> | ||
574 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
575 | </operands> | ||
576 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.25"> | ||
577 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.12/@variables.1"/> | ||
578 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.12/@variables.0"/> | ||
579 | </operands> | ||
580 | <operands xsi:type="language_1:Distinct"> | ||
581 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.12/@variables.1"/> | ||
582 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.12/@value/@operands.0/@quantifiedVariables.0"/> | ||
583 | </operands> | ||
584 | <operands xsi:type="language_1:Distinct"> | ||
585 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.12/@variables.1"/> | ||
586 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.12/@value/@operands.0/@quantifiedVariables.1"/> | ||
587 | </operands> | ||
588 | </expression> | ||
589 | </operands> | ||
590 | </value> | ||
591 | </relations> | ||
592 | <relations xsi:type="language_1:RelationDefinition" name="pattern modes3 queries turnoutConnectedToBothOutputs" annotations="//@annotations.15"> | ||
593 | <parameters xsi:type="language_1:ComplexTypeReference" referred="//@types.2"/> | ||
594 | <variables name="parameter T"> | ||
595 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.2"/> | ||
596 | </variables> | ||
597 | <value xsi:type="language_1:Or"> | ||
598 | <operands xsi:type="language_1:Exists"> | ||
599 | <quantifiedVariables name="variable Straight"> | ||
600 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
601 | </quantifiedVariables> | ||
602 | <quantifiedVariables name="variable Divergent"> | ||
603 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
604 | </quantifiedVariables> | ||
605 | <expression xsi:type="language_1:And"> | ||
606 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.5"> | ||
607 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.13/@variables.0"/> | ||
608 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.13/@value/@operands.0/@quantifiedVariables.0"/> | ||
609 | </operands> | ||
610 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.6"> | ||
611 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.13/@variables.0"/> | ||
612 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.13/@value/@operands.0/@quantifiedVariables.1"/> | ||
613 | </operands> | ||
614 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.0"> | ||
615 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.13/@variables.0"/> | ||
616 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.13/@value/@operands.0/@quantifiedVariables.0"/> | ||
617 | </operands> | ||
618 | <operands xsi:type="language_1:InstanceOf"> | ||
619 | <value xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.13/@value/@operands.0/@quantifiedVariables.0"/> | ||
620 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
621 | </operands> | ||
622 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.0"> | ||
623 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.13/@variables.0"/> | ||
624 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.13/@value/@operands.0/@quantifiedVariables.1"/> | ||
625 | </operands> | ||
626 | <operands xsi:type="language_1:InstanceOf"> | ||
627 | <value xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.13/@value/@operands.0/@quantifiedVariables.1"/> | ||
628 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
629 | </operands> | ||
630 | </expression> | ||
631 | </operands> | ||
632 | </value> | ||
633 | </relations> | ||
634 | <relations xsi:type="language_1:RelationDefinition" name="pattern modes3 queries tooManyExtraInputsOfTurnout" annotations="//@annotations.16"> | ||
635 | <parameters xsi:type="language_1:ComplexTypeReference" referred="//@types.2"/> | ||
636 | <variables name="parameter T"> | ||
637 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.2"/> | ||
638 | </variables> | ||
639 | <value xsi:type="language_1:Or"> | ||
640 | <operands xsi:type="language_1:Exists"> | ||
641 | <quantifiedVariables name="variable I1"> | ||
642 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
643 | </quantifiedVariables> | ||
644 | <quantifiedVariables name="variable I2"> | ||
645 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
646 | </quantifiedVariables> | ||
647 | <expression xsi:type="language_1:And"> | ||
648 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.12"> | ||
649 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.14/@variables.0"/> | ||
650 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.14/@value/@operands.0/@quantifiedVariables.0"/> | ||
651 | </operands> | ||
652 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.12"> | ||
653 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.14/@variables.0"/> | ||
654 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.14/@value/@operands.0/@quantifiedVariables.1"/> | ||
655 | </operands> | ||
656 | <operands xsi:type="language_1:Distinct"> | ||
657 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.14/@value/@operands.0/@quantifiedVariables.0"/> | ||
658 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.14/@value/@operands.0/@quantifiedVariables.1"/> | ||
659 | </operands> | ||
660 | </expression> | ||
661 | </operands> | ||
662 | </value> | ||
663 | </relations> | ||
664 | <relations xsi:type="language_1:RelationDefinition" name="pattern modes3 queries connectedToReflexive" annotations="//@annotations.17"> | ||
665 | <parameters xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
666 | <variables name="parameter S"> | ||
667 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
668 | </variables> | ||
669 | <value xsi:type="language_1:Or"> | ||
670 | <operands xsi:type="language_1:And"> | ||
671 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.0"> | ||
672 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.15/@variables.0"/> | ||
673 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.15/@variables.0"/> | ||
674 | </operands> | ||
675 | </operands> | ||
676 | </value> | ||
677 | </relations> | ||
678 | <relations xsi:type="language_1:RelationDefinition" name="pattern modes3 queries turnoutOutput" annotations="//@annotations.18"> | ||
679 | <parameters xsi:type="language_1:ComplexTypeReference" referred="//@types.2"/> | ||
680 | <parameters xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
681 | <variables name="parameter T"> | ||
682 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.2"/> | ||
683 | </variables> | ||
684 | <variables name="parameter S"> | ||
685 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
686 | </variables> | ||
687 | <value xsi:type="language_1:Or"> | ||
688 | <operands xsi:type="language_1:And"> | ||
689 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.5"> | ||
690 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.16/@variables.0"/> | ||
691 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.16/@variables.1"/> | ||
692 | </operands> | ||
693 | <operands xsi:type="language_1:InstanceOf"> | ||
694 | <value xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.16/@variables.1"/> | ||
695 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
696 | </operands> | ||
697 | </operands> | ||
698 | <operands xsi:type="language_1:And"> | ||
699 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.6"> | ||
700 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.16/@variables.0"/> | ||
701 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.16/@variables.1"/> | ||
702 | </operands> | ||
703 | <operands xsi:type="language_1:InstanceOf"> | ||
704 | <value xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.16/@variables.1"/> | ||
705 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
706 | </operands> | ||
707 | </operands> | ||
708 | </value> | ||
709 | </relations> | ||
710 | <relations xsi:type="language_1:RelationDefinition" name="pattern modes3 queries connectedTo" annotations="//@annotations.19"> | ||
711 | <parameters xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
712 | <parameters xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
713 | <variables name="parameter S1"> | ||
714 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
715 | </variables> | ||
716 | <variables name="parameter S2"> | ||
717 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
718 | </variables> | ||
719 | <value xsi:type="language_1:Or"> | ||
720 | <operands xsi:type="language_1:And"> | ||
721 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.0"> | ||
722 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.17/@variables.0"/> | ||
723 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.17/@variables.1"/> | ||
724 | </operands> | ||
725 | <operands xsi:type="language_1:InstanceOf"> | ||
726 | <value xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.17/@variables.1"/> | ||
727 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
728 | </operands> | ||
729 | </operands> | ||
730 | </value> | ||
731 | </relations> | ||
732 | <relations xsi:type="language_1:RelationDefinition" name="pattern modes3 queries outputReflexive" annotations="//@annotations.20"> | ||
733 | <parameters xsi:type="language_1:ComplexTypeReference" referred="//@types.2"/> | ||
734 | <variables name="parameter T"> | ||
735 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.2"/> | ||
736 | </variables> | ||
737 | <value xsi:type="language_1:Or"> | ||
738 | <operands xsi:type="language_1:And"> | ||
739 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.16"> | ||
740 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.18/@variables.0"/> | ||
741 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.18/@variables.0"/> | ||
742 | </operands> | ||
743 | </operands> | ||
744 | </value> | ||
745 | </relations> | ||
746 | <relations xsi:type="language_1:RelationDefinition" name="pattern modes3 queries tooManyInputsOfSegment" annotations="//@annotations.21"> | ||
747 | <parameters xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
748 | <variables name="parameter S"> | ||
749 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
750 | </variables> | ||
751 | <value xsi:type="language_1:Or"> | ||
752 | <operands xsi:type="language_1:Exists"> | ||
753 | <quantifiedVariables name="variable I1"> | ||
754 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
755 | </quantifiedVariables> | ||
756 | <quantifiedVariables name="variable I2"> | ||
757 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
758 | </quantifiedVariables> | ||
759 | <quantifiedVariables name="variable I3"> | ||
760 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
761 | </quantifiedVariables> | ||
762 | <expression xsi:type="language_1:And"> | ||
763 | <operands xsi:type="language_1:Not"> | ||
764 | <operand xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.10"> | ||
765 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.19/@variables.0"/> | ||
766 | </operand> | ||
767 | </operands> | ||
768 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.25"> | ||
769 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.19/@value/@operands.0/@quantifiedVariables.0"/> | ||
770 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.19/@variables.0"/> | ||
771 | </operands> | ||
772 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.25"> | ||
773 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.19/@value/@operands.0/@quantifiedVariables.1"/> | ||
774 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.19/@variables.0"/> | ||
775 | </operands> | ||
776 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.25"> | ||
777 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.19/@value/@operands.0/@quantifiedVariables.2"/> | ||
778 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.19/@variables.0"/> | ||
779 | </operands> | ||
780 | <operands xsi:type="language_1:Distinct"> | ||
781 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.19/@value/@operands.0/@quantifiedVariables.0"/> | ||
782 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.19/@value/@operands.0/@quantifiedVariables.1"/> | ||
783 | </operands> | ||
784 | <operands xsi:type="language_1:Distinct"> | ||
785 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.19/@value/@operands.0/@quantifiedVariables.0"/> | ||
786 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.19/@value/@operands.0/@quantifiedVariables.2"/> | ||
787 | </operands> | ||
788 | <operands xsi:type="language_1:Distinct"> | ||
789 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.19/@value/@operands.0/@quantifiedVariables.1"/> | ||
790 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.19/@value/@operands.0/@quantifiedVariables.2"/> | ||
791 | </operands> | ||
792 | </expression> | ||
793 | </operands> | ||
794 | </value> | ||
795 | </relations> | ||
796 | <relations xsi:type="language_1:RelationDefinition" name="pattern modes3 queries noExtraInputOfTurnout" annotations="//@annotations.22"> | ||
797 | <parameters xsi:type="language_1:ComplexTypeReference" referred="//@types.2"/> | ||
798 | <variables name="parameter T"> | ||
799 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.2"/> | ||
800 | </variables> | ||
801 | <value xsi:type="language_1:Or"> | ||
802 | <operands xsi:type="language_1:Forall"> | ||
803 | <quantifiedVariables name="variable 0"> | ||
804 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
805 | </quantifiedVariables> | ||
806 | <expression xsi:type="language_1:And"> | ||
807 | <operands xsi:type="language_1:InstanceOf"> | ||
808 | <value xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.20/@variables.0"/> | ||
809 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.2"/> | ||
810 | </operands> | ||
811 | <operands xsi:type="language_1:Not"> | ||
812 | <operand xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.12"> | ||
813 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.20/@variables.0"/> | ||
814 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.20/@value/@operands.0/@quantifiedVariables.0"/> | ||
815 | </operand> | ||
816 | </operands> | ||
817 | </expression> | ||
818 | </operands> | ||
819 | </value> | ||
820 | </relations> | ||
821 | <relations xsi:type="language_1:RelationDefinition" name="pattern modes3 queries reachable" annotations="//@annotations.23"> | ||
822 | <parameters xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
823 | <parameters xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
824 | <variables name="parameter S1"> | ||
825 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
826 | </variables> | ||
827 | <variables name="parameter S2"> | ||
828 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
829 | </variables> | ||
830 | <value xsi:type="language_1:Or"> | ||
831 | <operands xsi:type="language_1:And"> | ||
832 | <operands xsi:type="language_1:InstanceOf"> | ||
833 | <value xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.21/@variables.1"/> | ||
834 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
835 | </operands> | ||
836 | </operands> | ||
837 | <operands xsi:type="language_1:And"> | ||
838 | <operands xsi:type="language_1:TransitiveClosure" relation="//@relations.23"> | ||
839 | <leftOperand xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.21/@variables.0"/> | ||
840 | <rightOperand xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.21/@variables.1"/> | ||
841 | </operands> | ||
842 | </operands> | ||
843 | </value> | ||
844 | </relations> | ||
845 | <relations xsi:type="language_1:RelationDefinition" name="pattern modes3 queries turnoutNotConnectedToOutput" annotations="//@annotations.24"> | ||
846 | <parameters xsi:type="language_1:ComplexTypeReference" referred="//@types.2"/> | ||
847 | <variables name="parameter T"> | ||
848 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.2"/> | ||
849 | </variables> | ||
850 | <value xsi:type="language_1:Or"> | ||
851 | <operands xsi:type="language_1:Exists"> | ||
852 | <quantifiedVariables name="variable Straight"> | ||
853 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
854 | </quantifiedVariables> | ||
855 | <quantifiedVariables name="variable Divergent"> | ||
856 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
857 | </quantifiedVariables> | ||
858 | <expression xsi:type="language_1:And"> | ||
859 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.5"> | ||
860 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.22/@variables.0"/> | ||
861 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.22/@value/@operands.0/@quantifiedVariables.0"/> | ||
862 | </operands> | ||
863 | <operands xsi:type="language_1:InstanceOf"> | ||
864 | <value xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.22/@value/@operands.0/@quantifiedVariables.0"/> | ||
865 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
866 | </operands> | ||
867 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.6"> | ||
868 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.22/@variables.0"/> | ||
869 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.22/@value/@operands.0/@quantifiedVariables.1"/> | ||
870 | </operands> | ||
871 | <operands xsi:type="language_1:InstanceOf"> | ||
872 | <value xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.22/@value/@operands.0/@quantifiedVariables.1"/> | ||
873 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
874 | </operands> | ||
875 | <operands xsi:type="language_1:Not"> | ||
876 | <operand xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.17"> | ||
877 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.22/@variables.0"/> | ||
878 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.22/@value/@operands.0/@quantifiedVariables.0"/> | ||
879 | </operand> | ||
880 | </operands> | ||
881 | <operands xsi:type="language_1:Not"> | ||
882 | <operand xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.17"> | ||
883 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.22/@variables.0"/> | ||
884 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.22/@value/@operands.0/@quantifiedVariables.1"/> | ||
885 | </operand> | ||
886 | </operands> | ||
887 | </expression> | ||
888 | </operands> | ||
889 | </value> | ||
890 | </relations> | ||
891 | <relations xsi:type="language_1:RelationDefinition" name="pattern modes3 queries adjacent" annotations="//@annotations.25"> | ||
892 | <parameters xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
893 | <parameters xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
894 | <variables name="parameter S1"> | ||
895 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
896 | </variables> | ||
897 | <variables name="parameter S2"> | ||
898 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
899 | </variables> | ||
900 | <value xsi:type="language_1:Or"> | ||
901 | <operands xsi:type="language_1:And"> | ||
902 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.25"> | ||
903 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.23/@variables.0"/> | ||
904 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.23/@variables.1"/> | ||
905 | </operands> | ||
906 | </operands> | ||
907 | <operands xsi:type="language_1:And"> | ||
908 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.16"> | ||
909 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.23/@variables.1"/> | ||
910 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.23/@variables.0"/> | ||
911 | </operands> | ||
912 | </operands> | ||
913 | </value> | ||
914 | </relations> | ||
915 | <relations xsi:type="language_1:RelationDefinition" name="pattern modes3 queries connectedToNotSymmetric" annotations="//@annotations.26"> | ||
916 | <parameters xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
917 | <parameters xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
918 | <variables name="parameter S1"> | ||
919 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
920 | </variables> | ||
921 | <variables name="parameter S2"> | ||
922 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
923 | </variables> | ||
924 | <value xsi:type="language_1:Or"> | ||
925 | <operands xsi:type="language_1:And"> | ||
926 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.0"> | ||
927 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.24/@variables.0"/> | ||
928 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.24/@variables.1"/> | ||
929 | </operands> | ||
930 | <operands xsi:type="language_1:InstanceOf"> | ||
931 | <value xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.24/@variables.1"/> | ||
932 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
933 | </operands> | ||
934 | <operands xsi:type="language_1:Not"> | ||
935 | <operand xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.17"> | ||
936 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.24/@variables.1"/> | ||
937 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.24/@variables.0"/> | ||
938 | </operand> | ||
939 | </operands> | ||
940 | </operands> | ||
941 | </value> | ||
942 | </relations> | ||
943 | <relations xsi:type="language_1:RelationDefinition" name="pattern modes3 queries output" annotations="//@annotations.27"> | ||
944 | <parameters xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
945 | <parameters xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
946 | <variables name="parameter S1"> | ||
947 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
948 | </variables> | ||
949 | <variables name="parameter S2"> | ||
950 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
951 | </variables> | ||
952 | <value xsi:type="language_1:Or"> | ||
953 | <operands xsi:type="language_1:And"> | ||
954 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.0"> | ||
955 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.25/@variables.0"/> | ||
956 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.25/@variables.1"/> | ||
957 | </operands> | ||
958 | <operands xsi:type="language_1:InstanceOf"> | ||
959 | <value xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.25/@variables.1"/> | ||
960 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
961 | </operands> | ||
962 | </operands> | ||
963 | <operands xsi:type="language_1:And"> | ||
964 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.16"> | ||
965 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.25/@variables.0"/> | ||
966 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.25/@variables.1"/> | ||
967 | </operands> | ||
968 | </operands> | ||
969 | </value> | ||
970 | </relations> | ||
971 | <relations xsi:type="language_1:RelationDefinition" name="pattern modes3 queries noInputOfSegment" annotations="//@annotations.28"> | ||
972 | <parameters xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
973 | <variables name="parameter S"> | ||
974 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
975 | </variables> | ||
976 | <value xsi:type="language_1:Or"> | ||
977 | <operands xsi:type="language_1:Forall"> | ||
978 | <quantifiedVariables name="variable 0"> | ||
979 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
980 | </quantifiedVariables> | ||
981 | <expression xsi:type="language_1:And"> | ||
982 | <operands xsi:type="language_1:InstanceOf"> | ||
983 | <value xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.26/@variables.0"/> | ||
984 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | ||
985 | </operands> | ||
986 | <operands xsi:type="language_1:Not"> | ||
987 | <operand xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.10"> | ||
988 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.26/@variables.0"/> | ||
989 | </operand> | ||
990 | </operands> | ||
991 | <operands xsi:type="language_1:Not"> | ||
992 | <operand xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.25"> | ||
993 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.26/@value/@operands.0/@quantifiedVariables.0"/> | ||
994 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.26/@variables.0"/> | ||
995 | </operand> | ||
996 | </operands> | ||
997 | </expression> | ||
998 | </operands> | ||
999 | </value> | ||
1000 | </relations> | ||
1001 | <elements name="o 1" definedInType="//@types.4"/> | ||
1002 | <containmentHierarchies typesOrderedInHierarchy="//@types.0 //@types.2 //@types.3 //@types.1 //@types.4 //@types.5" containmentRelations="//@relations.2 //@relations.3 //@relations.4"/> | ||
1003 | <annotations xsi:type="ecore2logicannotations:UpperMultiplicityAssertion" target="//@assertions.0" relation="//@relations.0" upper="2"/> | ||
1004 | <annotations xsi:type="ecore2logicannotations:UpperMultiplicityAssertion" target="//@assertions.1" relation="//@relations.1" upper="1"/> | ||
1005 | <annotations xsi:type="ecore2logicannotations:LowerMultiplicityAssertion" target="//@assertions.2" relation="//@relations.5" lower="1"/> | ||
1006 | <annotations xsi:type="ecore2logicannotations:UpperMultiplicityAssertion" target="//@assertions.3" relation="//@relations.5" upper="1"/> | ||
1007 | <annotations xsi:type="ecore2logicannotations:LowerMultiplicityAssertion" target="//@assertions.4" relation="//@relations.6" lower="1"/> | ||
1008 | <annotations xsi:type="ecore2logicannotations:UpperMultiplicityAssertion" target="//@assertions.5" relation="//@relations.6" upper="1"/> | ||
1009 | <annotations xsi:type="ecore2logicannotations:LowerMultiplicityAssertion" target="//@assertions.6" relation="//@relations.7" lower="1"/> | ||
1010 | <annotations xsi:type="ecore2logicannotations:UpperMultiplicityAssertion" target="//@assertions.7" relation="//@relations.7" upper="1"/> | ||
1011 | <annotations xsi:type="ecore2logicannotations:InverseRelationAssertion" target="//@assertions.8" inverseA="//@relations.1" inverseB="//@relations.7"/> | ||
1012 | <annotations xsi:type="ecore2logicannotations:InverseRelationAssertion" target="//@assertions.9" inverseA="//@relations.0" inverseB="//@relations.0"/> | ||
1013 | <annotations xsi:type="viatra2logicannotations:TransfomedViatraQuery" target="//@relations.8" patternFullyQualifiedName="modes3.queries.turnoutInSegments"> | ||
1014 | <variableTrace targetLogicVariable="//@relations.8/@value/@operands.0/@quantifiedVariables.0"/> | ||
1015 | </annotations> | ||
1016 | <annotations xsi:type="viatra2logicannotations:TransfomedViatraQuery" target="//@relations.9" patternFullyQualifiedName="modes3.queries.unreachable"/> | ||
1017 | <annotations xsi:type="viatra2logicannotations:TransfomedViatraQuery" target="//@relations.10" patternFullyQualifiedName="modes3.queries.turnout"/> | ||
1018 | <annotations xsi:type="viatra2logicannotations:TransfomedViatraQuery" target="//@relations.11" patternFullyQualifiedName="modes3.queries.turnoutOutputsAreSame"> | ||
1019 | <variableTrace targetLogicVariable="//@relations.11/@value/@operands.0/@quantifiedVariables.0"/> | ||
1020 | </annotations> | ||
1021 | <annotations xsi:type="viatra2logicannotations:TransfomedViatraQuery" target="//@relations.12" patternFullyQualifiedName="modes3.queries.extraInputOfTurnout"> | ||
1022 | <variableTrace targetLogicVariable="//@relations.12/@value/@operands.0/@quantifiedVariables.0"/> | ||
1023 | <variableTrace targetLogicVariable="//@relations.12/@value/@operands.0/@quantifiedVariables.1"/> | ||
1024 | </annotations> | ||
1025 | <annotations xsi:type="viatra2logicannotations:TransfomedViatraQuery" target="//@relations.13" patternFullyQualifiedName="modes3.queries.turnoutConnectedToBothOutputs"> | ||
1026 | <variableTrace targetLogicVariable="//@relations.13/@value/@operands.0/@quantifiedVariables.0"/> | ||
1027 | <variableTrace targetLogicVariable="//@relations.13/@value/@operands.0/@quantifiedVariables.1"/> | ||
1028 | </annotations> | ||
1029 | <annotations xsi:type="viatra2logicannotations:TransfomedViatraQuery" target="//@relations.14" patternFullyQualifiedName="modes3.queries.tooManyExtraInputsOfTurnout"> | ||
1030 | <variableTrace targetLogicVariable="//@relations.14/@value/@operands.0/@quantifiedVariables.0"/> | ||
1031 | <variableTrace targetLogicVariable="//@relations.14/@value/@operands.0/@quantifiedVariables.1"/> | ||
1032 | </annotations> | ||
1033 | <annotations xsi:type="viatra2logicannotations:TransfomedViatraQuery" target="//@relations.15" patternFullyQualifiedName="modes3.queries.connectedToReflexive"/> | ||
1034 | <annotations xsi:type="viatra2logicannotations:TransfomedViatraQuery" target="//@relations.16" patternFullyQualifiedName="modes3.queries.turnoutOutput"/> | ||
1035 | <annotations xsi:type="viatra2logicannotations:TransfomedViatraQuery" target="//@relations.17" patternFullyQualifiedName="modes3.queries.connectedTo"/> | ||
1036 | <annotations xsi:type="viatra2logicannotations:TransfomedViatraQuery" target="//@relations.18" patternFullyQualifiedName="modes3.queries.outputReflexive"/> | ||
1037 | <annotations xsi:type="viatra2logicannotations:TransfomedViatraQuery" target="//@relations.19" patternFullyQualifiedName="modes3.queries.tooManyInputsOfSegment"> | ||
1038 | <variableTrace targetLogicVariable="//@relations.19/@value/@operands.0/@quantifiedVariables.0"/> | ||
1039 | <variableTrace targetLogicVariable="//@relations.19/@value/@operands.0/@quantifiedVariables.1"/> | ||
1040 | <variableTrace targetLogicVariable="//@relations.19/@value/@operands.0/@quantifiedVariables.2"/> | ||
1041 | </annotations> | ||
1042 | <annotations xsi:type="viatra2logicannotations:TransfomedViatraQuery" target="//@relations.20" patternFullyQualifiedName="modes3.queries.noExtraInputOfTurnout"> | ||
1043 | <variableTrace targetLogicVariable="//@relations.20/@value/@operands.0/@quantifiedVariables.0"/> | ||
1044 | </annotations> | ||
1045 | <annotations xsi:type="viatra2logicannotations:TransfomedViatraQuery" target="//@relations.21" patternFullyQualifiedName="modes3.queries.reachable"/> | ||
1046 | <annotations xsi:type="viatra2logicannotations:TransfomedViatraQuery" target="//@relations.22" patternFullyQualifiedName="modes3.queries.turnoutNotConnectedToOutput"> | ||
1047 | <variableTrace targetLogicVariable="//@relations.22/@value/@operands.0/@quantifiedVariables.0"/> | ||
1048 | <variableTrace targetLogicVariable="//@relations.22/@value/@operands.0/@quantifiedVariables.1"/> | ||
1049 | </annotations> | ||
1050 | <annotations xsi:type="viatra2logicannotations:TransfomedViatraQuery" target="//@relations.23" patternFullyQualifiedName="modes3.queries.adjacent"/> | ||
1051 | <annotations xsi:type="viatra2logicannotations:TransfomedViatraQuery" target="//@relations.24" patternFullyQualifiedName="modes3.queries.connectedToNotSymmetric"/> | ||
1052 | <annotations xsi:type="viatra2logicannotations:TransfomedViatraQuery" target="//@relations.25" patternFullyQualifiedName="modes3.queries.output"/> | ||
1053 | <annotations xsi:type="viatra2logicannotations:TransfomedViatraQuery" target="//@relations.26" patternFullyQualifiedName="modes3.queries.noInputOfSegment"> | ||
1054 | <variableTrace targetLogicVariable="//@relations.26/@value/@operands.0/@quantifiedVariables.0"/> | ||
1055 | </annotations> | ||
1056 | <annotations xsi:type="viatra2logicannotations:TransformedViatraWellformednessConstraint" target="//@assertions.10" query="//@annotations.10"/> | ||
1057 | <annotations xsi:type="viatra2logicannotations:TransformedViatraWellformednessConstraint" target="//@assertions.11" query="//@annotations.11"/> | ||
1058 | <annotations xsi:type="viatra2logicannotations:TransformedViatraWellformednessConstraint" target="//@assertions.12" query="//@annotations.13"/> | ||
1059 | <annotations xsi:type="viatra2logicannotations:TransformedViatraWellformednessConstraint" target="//@assertions.13" query="//@annotations.15"/> | ||
1060 | <annotations xsi:type="viatra2logicannotations:TransformedViatraWellformednessConstraint" target="//@assertions.14" query="//@annotations.16"/> | ||
1061 | <annotations xsi:type="viatra2logicannotations:TransformedViatraWellformednessConstraint" target="//@assertions.15" query="//@annotations.17"/> | ||
1062 | <annotations xsi:type="viatra2logicannotations:TransformedViatraWellformednessConstraint" target="//@assertions.16" query="//@annotations.20"/> | ||
1063 | <annotations xsi:type="viatra2logicannotations:TransformedViatraWellformednessConstraint" target="//@assertions.17" query="//@annotations.21"/> | ||
1064 | <annotations xsi:type="viatra2logicannotations:TransformedViatraWellformednessConstraint" target="//@assertions.18" query="//@annotations.22"/> | ||
1065 | <annotations xsi:type="viatra2logicannotations:TransformedViatraWellformednessConstraint" target="//@assertions.19" query="//@annotations.24"/> | ||
1066 | <annotations xsi:type="viatra2logicannotations:TransformedViatraWellformednessConstraint" target="//@assertions.20" query="//@annotations.26"/> | ||
1067 | <annotations xsi:type="viatra2logicannotations:TransformedViatraWellformednessConstraint" target="//@assertions.21" query="//@annotations.28"/> | ||
1068 | </language:LogicProblem> | ||
diff --git a/Domains/ca.mcgill.rtgmrt.example.modes3/output/solution1.gml b/Domains/ca.mcgill.rtgmrt.example.modes3/output/solution1.gml new file mode 100644 index 00000000..66b57d1a --- /dev/null +++ b/Domains/ca.mcgill.rtgmrt.example.modes3/output/solution1.gml | |||
@@ -0,0 +1,1191 @@ | |||
1 | graph | ||
2 | [ | ||
3 | node | ||
4 | [ | ||
5 | id 0 | ||
6 | graphics | ||
7 | [ | ||
8 | w 269.5 | ||
9 | h 54 | ||
10 | type "rectangle" | ||
11 | fill "#FFFFFF" | ||
12 | fill2 "#FFFFFF" | ||
13 | outline "#000000" | ||
14 | ] | ||
15 | LabelGraphics | ||
16 | [ | ||
17 | text "o 1" | ||
18 | outline "#000000" | ||
19 | fill "#FFFFFF" | ||
20 | fontSize 16 | ||
21 | fontName "Monospace" | ||
22 | autoSizePolicy "node_width" | ||
23 | anchor "t" | ||
24 | borderDistance 0.0 | ||
25 | ] | ||
26 | LabelGraphics | ||
27 | [ | ||
28 | text " | ||
29 | Modes3ModelRoot class DefinedPart | ||
30 | Modes3ModelRoot class | ||
31 | " | ||
32 | fontSize 14 | ||
33 | fontName "Consolas" | ||
34 | alignment "left" | ||
35 | anchor "tl" | ||
36 | borderDistance 6 | ||
37 | ] | ||
38 | ] | ||
39 | |||
40 | node | ||
41 | [ | ||
42 | id 1 | ||
43 | graphics | ||
44 | [ | ||
45 | w 41.800000000000004 | ||
46 | h 26 | ||
47 | type "rectangle" | ||
48 | fill "#FFFFFF" | ||
49 | fill2 "#FFFFFF" | ||
50 | outline "#000000" | ||
51 | ] | ||
52 | LabelGraphics | ||
53 | [ | ||
54 | text "true" | ||
55 | outline "#000000" | ||
56 | fill "#FFFFFF" | ||
57 | fontSize 16 | ||
58 | fontName "Monospace" | ||
59 | autoSizePolicy "node_width" | ||
60 | anchor "t" | ||
61 | borderDistance 0.0 | ||
62 | ] | ||
63 | LabelGraphics | ||
64 | [ | ||
65 | text " | ||
66 | " | ||
67 | fontSize 14 | ||
68 | fontName "Consolas" | ||
69 | alignment "left" | ||
70 | anchor "tl" | ||
71 | borderDistance 6 | ||
72 | ] | ||
73 | ] | ||
74 | |||
75 | node | ||
76 | [ | ||
77 | id 2 | ||
78 | graphics | ||
79 | [ | ||
80 | w 50.6 | ||
81 | h 26 | ||
82 | type "rectangle" | ||
83 | fill "#FFFFFF" | ||
84 | fill2 "#FFFFFF" | ||
85 | outline "#000000" | ||
86 | ] | ||
87 | LabelGraphics | ||
88 | [ | ||
89 | text "false" | ||
90 | outline "#000000" | ||
91 | fill "#FFFFFF" | ||
92 | fontSize 16 | ||
93 | fontName "Monospace" | ||
94 | autoSizePolicy "node_width" | ||
95 | anchor "t" | ||
96 | borderDistance 0.0 | ||
97 | ] | ||
98 | LabelGraphics | ||
99 | [ | ||
100 | text " | ||
101 | " | ||
102 | fontSize 14 | ||
103 | fontName "Consolas" | ||
104 | alignment "left" | ||
105 | anchor "tl" | ||
106 | borderDistance 6 | ||
107 | ] | ||
108 | ] | ||
109 | |||
110 | node | ||
111 | [ | ||
112 | id 3 | ||
113 | graphics | ||
114 | [ | ||
115 | w 115.50000000000001 | ||
116 | h 54 | ||
117 | type "rectangle" | ||
118 | fill "#FFFFFF" | ||
119 | fill2 "#FFFFFF" | ||
120 | outline "#000000" | ||
121 | ] | ||
122 | LabelGraphics | ||
123 | [ | ||
124 | text "null" | ||
125 | outline "#000000" | ||
126 | fill "#FFFFFF" | ||
127 | fontSize 16 | ||
128 | fontName "Monospace" | ||
129 | autoSizePolicy "node_width" | ||
130 | anchor "t" | ||
131 | borderDistance 0.0 | ||
132 | ] | ||
133 | LabelGraphics | ||
134 | [ | ||
135 | text " | ||
136 | Segment class | ||
137 | Turnout class | ||
138 | " | ||
139 | fontSize 14 | ||
140 | fontName "Consolas" | ||
141 | alignment "left" | ||
142 | anchor "tl" | ||
143 | borderDistance 6 | ||
144 | ] | ||
145 | ] | ||
146 | |||
147 | node | ||
148 | [ | ||
149 | id 4 | ||
150 | graphics | ||
151 | [ | ||
152 | w 100.10000000000001 | ||
153 | h 40 | ||
154 | type "rectangle" | ||
155 | fill "#FFFFFF" | ||
156 | fill2 "#FFFFFF" | ||
157 | outline "#000000" | ||
158 | ] | ||
159 | LabelGraphics | ||
160 | [ | ||
161 | text "null" | ||
162 | outline "#000000" | ||
163 | fill "#FFFFFF" | ||
164 | fontSize 16 | ||
165 | fontName "Monospace" | ||
166 | autoSizePolicy "node_width" | ||
167 | anchor "t" | ||
168 | borderDistance 0.0 | ||
169 | ] | ||
170 | LabelGraphics | ||
171 | [ | ||
172 | text " | ||
173 | Train class | ||
174 | " | ||
175 | fontSize 14 | ||
176 | fontName "Consolas" | ||
177 | alignment "left" | ||
178 | anchor "tl" | ||
179 | borderDistance 6 | ||
180 | ] | ||
181 | ] | ||
182 | |||
183 | node | ||
184 | [ | ||
185 | id 5 | ||
186 | graphics | ||
187 | [ | ||
188 | w 115.50000000000001 | ||
189 | h 40 | ||
190 | type "rectangle" | ||
191 | fill "#FFFFFF" | ||
192 | fill2 "#FFFFFF" | ||
193 | outline "#000000" | ||
194 | ] | ||
195 | LabelGraphics | ||
196 | [ | ||
197 | text "null" | ||
198 | outline "#000000" | ||
199 | fill "#FFFFFF" | ||
200 | fontSize 16 | ||
201 | fontName "Monospace" | ||
202 | autoSizePolicy "node_width" | ||
203 | anchor "t" | ||
204 | borderDistance 0.0 | ||
205 | ] | ||
206 | LabelGraphics | ||
207 | [ | ||
208 | text " | ||
209 | Segment class | ||
210 | " | ||
211 | fontSize 14 | ||
212 | fontName "Consolas" | ||
213 | alignment "left" | ||
214 | anchor "tl" | ||
215 | borderDistance 6 | ||
216 | ] | ||
217 | ] | ||
218 | |||
219 | node | ||
220 | [ | ||
221 | id 6 | ||
222 | graphics | ||
223 | [ | ||
224 | w 100.10000000000001 | ||
225 | h 40 | ||
226 | type "rectangle" | ||
227 | fill "#FFFFFF" | ||
228 | fill2 "#FFFFFF" | ||
229 | outline "#000000" | ||
230 | ] | ||
231 | LabelGraphics | ||
232 | [ | ||
233 | text "null" | ||
234 | outline "#000000" | ||
235 | fill "#FFFFFF" | ||
236 | fontSize 16 | ||
237 | fontName "Monospace" | ||
238 | autoSizePolicy "node_width" | ||
239 | anchor "t" | ||
240 | borderDistance 0.0 | ||
241 | ] | ||
242 | LabelGraphics | ||
243 | [ | ||
244 | text " | ||
245 | Train class | ||
246 | " | ||
247 | fontSize 14 | ||
248 | fontName "Consolas" | ||
249 | alignment "left" | ||
250 | anchor "tl" | ||
251 | borderDistance 6 | ||
252 | ] | ||
253 | ] | ||
254 | |||
255 | node | ||
256 | [ | ||
257 | id 7 | ||
258 | graphics | ||
259 | [ | ||
260 | w 115.50000000000001 | ||
261 | h 40 | ||
262 | type "rectangle" | ||
263 | fill "#FFFFFF" | ||
264 | fill2 "#FFFFFF" | ||
265 | outline "#000000" | ||
266 | ] | ||
267 | LabelGraphics | ||
268 | [ | ||
269 | text "null" | ||
270 | outline "#000000" | ||
271 | fill "#FFFFFF" | ||
272 | fontSize 16 | ||
273 | fontName "Monospace" | ||
274 | autoSizePolicy "node_width" | ||
275 | anchor "t" | ||
276 | borderDistance 0.0 | ||
277 | ] | ||
278 | LabelGraphics | ||
279 | [ | ||
280 | text " | ||
281 | Segment class | ||
282 | " | ||
283 | fontSize 14 | ||
284 | fontName "Consolas" | ||
285 | alignment "left" | ||
286 | anchor "tl" | ||
287 | borderDistance 6 | ||
288 | ] | ||
289 | ] | ||
290 | |||
291 | node | ||
292 | [ | ||
293 | id 8 | ||
294 | graphics | ||
295 | [ | ||
296 | w 100.10000000000001 | ||
297 | h 40 | ||
298 | type "rectangle" | ||
299 | fill "#FFFFFF" | ||
300 | fill2 "#FFFFFF" | ||
301 | outline "#000000" | ||
302 | ] | ||
303 | LabelGraphics | ||
304 | [ | ||
305 | text "null" | ||
306 | outline "#000000" | ||
307 | fill "#FFFFFF" | ||
308 | fontSize 16 | ||
309 | fontName "Monospace" | ||
310 | autoSizePolicy "node_width" | ||
311 | anchor "t" | ||
312 | borderDistance 0.0 | ||
313 | ] | ||
314 | LabelGraphics | ||
315 | [ | ||
316 | text " | ||
317 | Train class | ||
318 | " | ||
319 | fontSize 14 | ||
320 | fontName "Consolas" | ||
321 | alignment "left" | ||
322 | anchor "tl" | ||
323 | borderDistance 6 | ||
324 | ] | ||
325 | ] | ||
326 | |||
327 | node | ||
328 | [ | ||
329 | id 9 | ||
330 | graphics | ||
331 | [ | ||
332 | w 115.50000000000001 | ||
333 | h 40 | ||
334 | type "rectangle" | ||
335 | fill "#FFFFFF" | ||
336 | fill2 "#FFFFFF" | ||
337 | outline "#000000" | ||
338 | ] | ||
339 | LabelGraphics | ||
340 | [ | ||
341 | text "null" | ||
342 | outline "#000000" | ||
343 | fill "#FFFFFF" | ||
344 | fontSize 16 | ||
345 | fontName "Monospace" | ||
346 | autoSizePolicy "node_width" | ||
347 | anchor "t" | ||
348 | borderDistance 0.0 | ||
349 | ] | ||
350 | LabelGraphics | ||
351 | [ | ||
352 | text " | ||
353 | Segment class | ||
354 | " | ||
355 | fontSize 14 | ||
356 | fontName "Consolas" | ||
357 | alignment "left" | ||
358 | anchor "tl" | ||
359 | borderDistance 6 | ||
360 | ] | ||
361 | ] | ||
362 | |||
363 | node | ||
364 | [ | ||
365 | id 10 | ||
366 | graphics | ||
367 | [ | ||
368 | w 100.10000000000001 | ||
369 | h 40 | ||
370 | type "rectangle" | ||
371 | fill "#FFFFFF" | ||
372 | fill2 "#FFFFFF" | ||
373 | outline "#000000" | ||
374 | ] | ||
375 | LabelGraphics | ||
376 | [ | ||
377 | text "null" | ||
378 | outline "#000000" | ||
379 | fill "#FFFFFF" | ||
380 | fontSize 16 | ||
381 | fontName "Monospace" | ||
382 | autoSizePolicy "node_width" | ||
383 | anchor "t" | ||
384 | borderDistance 0.0 | ||
385 | ] | ||
386 | LabelGraphics | ||
387 | [ | ||
388 | text " | ||
389 | Train class | ||
390 | " | ||
391 | fontSize 14 | ||
392 | fontName "Consolas" | ||
393 | alignment "left" | ||
394 | anchor "tl" | ||
395 | borderDistance 6 | ||
396 | ] | ||
397 | ] | ||
398 | |||
399 | node | ||
400 | [ | ||
401 | id 11 | ||
402 | graphics | ||
403 | [ | ||
404 | w 115.50000000000001 | ||
405 | h 40 | ||
406 | type "rectangle" | ||
407 | fill "#FFFFFF" | ||
408 | fill2 "#FFFFFF" | ||
409 | outline "#000000" | ||
410 | ] | ||
411 | LabelGraphics | ||
412 | [ | ||
413 | text "null" | ||
414 | outline "#000000" | ||
415 | fill "#FFFFFF" | ||
416 | fontSize 16 | ||
417 | fontName "Monospace" | ||
418 | autoSizePolicy "node_width" | ||
419 | anchor "t" | ||
420 | borderDistance 0.0 | ||
421 | ] | ||
422 | LabelGraphics | ||
423 | [ | ||
424 | text " | ||
425 | Segment class | ||
426 | " | ||
427 | fontSize 14 | ||
428 | fontName "Consolas" | ||
429 | alignment "left" | ||
430 | anchor "tl" | ||
431 | borderDistance 6 | ||
432 | ] | ||
433 | ] | ||
434 | |||
435 | node | ||
436 | [ | ||
437 | id 12 | ||
438 | graphics | ||
439 | [ | ||
440 | w 100.10000000000001 | ||
441 | h 40 | ||
442 | type "rectangle" | ||
443 | fill "#FFFFFF" | ||
444 | fill2 "#FFFFFF" | ||
445 | outline "#000000" | ||
446 | ] | ||
447 | LabelGraphics | ||
448 | [ | ||
449 | text "null" | ||
450 | outline "#000000" | ||
451 | fill "#FFFFFF" | ||
452 | fontSize 16 | ||
453 | fontName "Monospace" | ||
454 | autoSizePolicy "node_width" | ||
455 | anchor "t" | ||
456 | borderDistance 0.0 | ||
457 | ] | ||
458 | LabelGraphics | ||
459 | [ | ||
460 | text " | ||
461 | Train class | ||
462 | " | ||
463 | fontSize 14 | ||
464 | fontName "Consolas" | ||
465 | alignment "left" | ||
466 | anchor "tl" | ||
467 | borderDistance 6 | ||
468 | ] | ||
469 | ] | ||
470 | |||
471 | node | ||
472 | [ | ||
473 | id 13 | ||
474 | graphics | ||
475 | [ | ||
476 | w 15.400000000000002 | ||
477 | h 26 | ||
478 | type "rectangle" | ||
479 | fill "#FFFFFF" | ||
480 | fill2 "#FFFFFF" | ||
481 | outline "#000000" | ||
482 | ] | ||
483 | LabelGraphics | ||
484 | [ | ||
485 | text "?" | ||
486 | outline "#000000" | ||
487 | fill "#FFFFFF" | ||
488 | fontSize 16 | ||
489 | fontName "Monospace" | ||
490 | autoSizePolicy "node_width" | ||
491 | anchor "t" | ||
492 | borderDistance 0.0 | ||
493 | ] | ||
494 | LabelGraphics | ||
495 | [ | ||
496 | text " | ||
497 | " | ||
498 | fontSize 14 | ||
499 | fontName "Consolas" | ||
500 | alignment "left" | ||
501 | anchor "tl" | ||
502 | borderDistance 6 | ||
503 | ] | ||
504 | ] | ||
505 | |||
506 | node | ||
507 | [ | ||
508 | id 14 | ||
509 | graphics | ||
510 | [ | ||
511 | w 15.400000000000002 | ||
512 | h 26 | ||
513 | type "rectangle" | ||
514 | fill "#FFFFFF" | ||
515 | fill2 "#FFFFFF" | ||
516 | outline "#000000" | ||
517 | ] | ||
518 | LabelGraphics | ||
519 | [ | ||
520 | text "?" | ||
521 | outline "#000000" | ||
522 | fill "#FFFFFF" | ||
523 | fontSize 16 | ||
524 | fontName "Monospace" | ||
525 | autoSizePolicy "node_width" | ||
526 | anchor "t" | ||
527 | borderDistance 0.0 | ||
528 | ] | ||
529 | LabelGraphics | ||
530 | [ | ||
531 | text " | ||
532 | " | ||
533 | fontSize 14 | ||
534 | fontName "Consolas" | ||
535 | alignment "left" | ||
536 | anchor "tl" | ||
537 | borderDistance 6 | ||
538 | ] | ||
539 | ] | ||
540 | |||
541 | node | ||
542 | [ | ||
543 | id 15 | ||
544 | graphics | ||
545 | [ | ||
546 | w 15.400000000000002 | ||
547 | h 26 | ||
548 | type "rectangle" | ||
549 | fill "#FFFFFF" | ||
550 | fill2 "#FFFFFF" | ||
551 | outline "#000000" | ||
552 | ] | ||
553 | LabelGraphics | ||
554 | [ | ||
555 | text "?" | ||
556 | outline "#000000" | ||
557 | fill "#FFFFFF" | ||
558 | fontSize 16 | ||
559 | fontName "Monospace" | ||
560 | autoSizePolicy "node_width" | ||
561 | anchor "t" | ||
562 | borderDistance 0.0 | ||
563 | ] | ||
564 | LabelGraphics | ||
565 | [ | ||
566 | text " | ||
567 | " | ||
568 | fontSize 14 | ||
569 | fontName "Consolas" | ||
570 | alignment "left" | ||
571 | anchor "tl" | ||
572 | borderDistance 6 | ||
573 | ] | ||
574 | ] | ||
575 | |||
576 | node | ||
577 | [ | ||
578 | id 16 | ||
579 | graphics | ||
580 | [ | ||
581 | w 103.4 | ||
582 | h 26 | ||
583 | type "rectangle" | ||
584 | fill "#FFFFFF" | ||
585 | fill2 "#FFFFFF" | ||
586 | outline "#000000" | ||
587 | ] | ||
588 | LabelGraphics | ||
589 | [ | ||
590 | text "New Objects" | ||
591 | outline "#000000" | ||
592 | fill "#FFFFFF" | ||
593 | fontSize 16 | ||
594 | fontName "Monospace" | ||
595 | autoSizePolicy "node_width" | ||
596 | anchor "t" | ||
597 | borderDistance 0.0 | ||
598 | ] | ||
599 | LabelGraphics | ||
600 | [ | ||
601 | text " | ||
602 | " | ||
603 | fontSize 14 | ||
604 | fontName "Consolas" | ||
605 | alignment "left" | ||
606 | anchor "tl" | ||
607 | borderDistance 6 | ||
608 | ] | ||
609 | ] | ||
610 | edge | ||
611 | [ | ||
612 | source 5 | ||
613 | target 3 | ||
614 | graphics | ||
615 | [ | ||
616 | fill "#000000" | ||
617 | targetArrow "standard" | ||
618 | ] | ||
619 | LabelGraphics | ||
620 | [ | ||
621 | text "connectedTo reference Segment" | ||
622 | fontSize 14 | ||
623 | fontName "Consolas" | ||
624 | configuration "AutoFlippingLabel" | ||
625 | model "six_pos" | ||
626 | position "thead" | ||
627 | ] | ||
628 | ] | ||
629 | edge | ||
630 | [ | ||
631 | source 3 | ||
632 | target 5 | ||
633 | graphics | ||
634 | [ | ||
635 | fill "#000000" | ||
636 | targetArrow "standard" | ||
637 | ] | ||
638 | LabelGraphics | ||
639 | [ | ||
640 | text "connectedTo reference Segment" | ||
641 | fontSize 14 | ||
642 | fontName "Consolas" | ||
643 | configuration "AutoFlippingLabel" | ||
644 | model "six_pos" | ||
645 | position "thead" | ||
646 | ] | ||
647 | ] | ||
648 | edge | ||
649 | [ | ||
650 | source 7 | ||
651 | target 3 | ||
652 | graphics | ||
653 | [ | ||
654 | fill "#000000" | ||
655 | targetArrow "standard" | ||
656 | ] | ||
657 | LabelGraphics | ||
658 | [ | ||
659 | text "connectedTo reference Segment" | ||
660 | fontSize 14 | ||
661 | fontName "Consolas" | ||
662 | configuration "AutoFlippingLabel" | ||
663 | model "six_pos" | ||
664 | position "thead" | ||
665 | ] | ||
666 | ] | ||
667 | edge | ||
668 | [ | ||
669 | source 3 | ||
670 | target 7 | ||
671 | graphics | ||
672 | [ | ||
673 | fill "#000000" | ||
674 | targetArrow "standard" | ||
675 | ] | ||
676 | LabelGraphics | ||
677 | [ | ||
678 | text "connectedTo reference Segment" | ||
679 | fontSize 14 | ||
680 | fontName "Consolas" | ||
681 | configuration "AutoFlippingLabel" | ||
682 | model "six_pos" | ||
683 | position "thead" | ||
684 | ] | ||
685 | ] | ||
686 | edge | ||
687 | [ | ||
688 | source 7 | ||
689 | target 9 | ||
690 | graphics | ||
691 | [ | ||
692 | fill "#000000" | ||
693 | targetArrow "standard" | ||
694 | ] | ||
695 | LabelGraphics | ||
696 | [ | ||
697 | text "connectedTo reference Segment" | ||
698 | fontSize 14 | ||
699 | fontName "Consolas" | ||
700 | configuration "AutoFlippingLabel" | ||
701 | model "six_pos" | ||
702 | position "thead" | ||
703 | ] | ||
704 | ] | ||
705 | edge | ||
706 | [ | ||
707 | source 9 | ||
708 | target 7 | ||
709 | graphics | ||
710 | [ | ||
711 | fill "#000000" | ||
712 | targetArrow "standard" | ||
713 | ] | ||
714 | LabelGraphics | ||
715 | [ | ||
716 | text "connectedTo reference Segment" | ||
717 | fontSize 14 | ||
718 | fontName "Consolas" | ||
719 | configuration "AutoFlippingLabel" | ||
720 | model "six_pos" | ||
721 | position "thead" | ||
722 | ] | ||
723 | ] | ||
724 | edge | ||
725 | [ | ||
726 | source 11 | ||
727 | target 5 | ||
728 | graphics | ||
729 | [ | ||
730 | fill "#000000" | ||
731 | targetArrow "standard" | ||
732 | ] | ||
733 | LabelGraphics | ||
734 | [ | ||
735 | text "connectedTo reference Segment" | ||
736 | fontSize 14 | ||
737 | fontName "Consolas" | ||
738 | configuration "AutoFlippingLabel" | ||
739 | model "six_pos" | ||
740 | position "thead" | ||
741 | ] | ||
742 | ] | ||
743 | edge | ||
744 | [ | ||
745 | source 5 | ||
746 | target 11 | ||
747 | graphics | ||
748 | [ | ||
749 | fill "#000000" | ||
750 | targetArrow "standard" | ||
751 | ] | ||
752 | LabelGraphics | ||
753 | [ | ||
754 | text "connectedTo reference Segment" | ||
755 | fontSize 14 | ||
756 | fontName "Consolas" | ||
757 | configuration "AutoFlippingLabel" | ||
758 | model "six_pos" | ||
759 | position "thead" | ||
760 | ] | ||
761 | ] | ||
762 | edge | ||
763 | [ | ||
764 | source 5 | ||
765 | target 6 | ||
766 | graphics | ||
767 | [ | ||
768 | fill "#000000" | ||
769 | targetArrow "standard" | ||
770 | ] | ||
771 | LabelGraphics | ||
772 | [ | ||
773 | text "occupiedBy reference Segment" | ||
774 | fontSize 14 | ||
775 | fontName "Consolas" | ||
776 | configuration "AutoFlippingLabel" | ||
777 | model "six_pos" | ||
778 | position "thead" | ||
779 | ] | ||
780 | ] | ||
781 | edge | ||
782 | [ | ||
783 | source 3 | ||
784 | target 4 | ||
785 | graphics | ||
786 | [ | ||
787 | fill "#000000" | ||
788 | targetArrow "standard" | ||
789 | ] | ||
790 | LabelGraphics | ||
791 | [ | ||
792 | text "occupiedBy reference Segment" | ||
793 | fontSize 14 | ||
794 | fontName "Consolas" | ||
795 | configuration "AutoFlippingLabel" | ||
796 | model "six_pos" | ||
797 | position "thead" | ||
798 | ] | ||
799 | ] | ||
800 | edge | ||
801 | [ | ||
802 | source 7 | ||
803 | target 8 | ||
804 | graphics | ||
805 | [ | ||
806 | fill "#000000" | ||
807 | targetArrow "standard" | ||
808 | ] | ||
809 | LabelGraphics | ||
810 | [ | ||
811 | text "occupiedBy reference Segment" | ||
812 | fontSize 14 | ||
813 | fontName "Consolas" | ||
814 | configuration "AutoFlippingLabel" | ||
815 | model "six_pos" | ||
816 | position "thead" | ||
817 | ] | ||
818 | ] | ||
819 | edge | ||
820 | [ | ||
821 | source 9 | ||
822 | target 10 | ||
823 | graphics | ||
824 | [ | ||
825 | fill "#000000" | ||
826 | targetArrow "standard" | ||
827 | ] | ||
828 | LabelGraphics | ||
829 | [ | ||
830 | text "occupiedBy reference Segment" | ||
831 | fontSize 14 | ||
832 | fontName "Consolas" | ||
833 | configuration "AutoFlippingLabel" | ||
834 | model "six_pos" | ||
835 | position "thead" | ||
836 | ] | ||
837 | ] | ||
838 | edge | ||
839 | [ | ||
840 | source 11 | ||
841 | target 12 | ||
842 | graphics | ||
843 | [ | ||
844 | fill "#000000" | ||
845 | targetArrow "standard" | ||
846 | ] | ||
847 | LabelGraphics | ||
848 | [ | ||
849 | text "occupiedBy reference Segment" | ||
850 | fontSize 14 | ||
851 | fontName "Consolas" | ||
852 | configuration "AutoFlippingLabel" | ||
853 | model "six_pos" | ||
854 | position "thead" | ||
855 | ] | ||
856 | ] | ||
857 | edge | ||
858 | [ | ||
859 | source 0 | ||
860 | target 4 | ||
861 | graphics | ||
862 | [ | ||
863 | fill "#000000" | ||
864 | width 3 | ||
865 | targetArrow "standard" | ||
866 | ] | ||
867 | LabelGraphics | ||
868 | [ | ||
869 | text "trains reference Modes3ModelRoot" | ||
870 | fontSize 14 | ||
871 | fontName "Consolas" | ||
872 | configuration "AutoFlippingLabel" | ||
873 | model "six_pos" | ||
874 | position "thead" | ||
875 | ] | ||
876 | ] | ||
877 | edge | ||
878 | [ | ||
879 | source 0 | ||
880 | target 6 | ||
881 | graphics | ||
882 | [ | ||
883 | fill "#000000" | ||
884 | width 3 | ||
885 | targetArrow "standard" | ||
886 | ] | ||
887 | LabelGraphics | ||
888 | [ | ||
889 | text "trains reference Modes3ModelRoot" | ||
890 | fontSize 14 | ||
891 | fontName "Consolas" | ||
892 | configuration "AutoFlippingLabel" | ||
893 | model "six_pos" | ||
894 | position "thead" | ||
895 | ] | ||
896 | ] | ||
897 | edge | ||
898 | [ | ||
899 | source 0 | ||
900 | target 8 | ||
901 | graphics | ||
902 | [ | ||
903 | fill "#000000" | ||
904 | width 3 | ||
905 | targetArrow "standard" | ||
906 | ] | ||
907 | LabelGraphics | ||
908 | [ | ||
909 | text "trains reference Modes3ModelRoot" | ||
910 | fontSize 14 | ||
911 | fontName "Consolas" | ||
912 | configuration "AutoFlippingLabel" | ||
913 | model "six_pos" | ||
914 | position "thead" | ||
915 | ] | ||
916 | ] | ||
917 | edge | ||
918 | [ | ||
919 | source 0 | ||
920 | target 10 | ||
921 | graphics | ||
922 | [ | ||
923 | fill "#000000" | ||
924 | width 3 | ||
925 | targetArrow "standard" | ||
926 | ] | ||
927 | LabelGraphics | ||
928 | [ | ||
929 | text "trains reference Modes3ModelRoot" | ||
930 | fontSize 14 | ||
931 | fontName "Consolas" | ||
932 | configuration "AutoFlippingLabel" | ||
933 | model "six_pos" | ||
934 | position "thead" | ||
935 | ] | ||
936 | ] | ||
937 | edge | ||
938 | [ | ||
939 | source 0 | ||
940 | target 12 | ||
941 | graphics | ||
942 | [ | ||
943 | fill "#000000" | ||
944 | width 3 | ||
945 | targetArrow "standard" | ||
946 | ] | ||
947 | LabelGraphics | ||
948 | [ | ||
949 | text "trains reference Modes3ModelRoot" | ||
950 | fontSize 14 | ||
951 | fontName "Consolas" | ||
952 | configuration "AutoFlippingLabel" | ||
953 | model "six_pos" | ||
954 | position "thead" | ||
955 | ] | ||
956 | ] | ||
957 | edge | ||
958 | [ | ||
959 | source 0 | ||
960 | target 5 | ||
961 | graphics | ||
962 | [ | ||
963 | fill "#000000" | ||
964 | width 3 | ||
965 | targetArrow "standard" | ||
966 | ] | ||
967 | LabelGraphics | ||
968 | [ | ||
969 | text "segments reference Modes3ModelRoot" | ||
970 | fontSize 14 | ||
971 | fontName "Consolas" | ||
972 | configuration "AutoFlippingLabel" | ||
973 | model "six_pos" | ||
974 | position "thead" | ||
975 | ] | ||
976 | ] | ||
977 | edge | ||
978 | [ | ||
979 | source 0 | ||
980 | target 7 | ||
981 | graphics | ||
982 | [ | ||
983 | fill "#000000" | ||
984 | width 3 | ||
985 | targetArrow "standard" | ||
986 | ] | ||
987 | LabelGraphics | ||
988 | [ | ||
989 | text "segments reference Modes3ModelRoot" | ||
990 | fontSize 14 | ||
991 | fontName "Consolas" | ||
992 | configuration "AutoFlippingLabel" | ||
993 | model "six_pos" | ||
994 | position "thead" | ||
995 | ] | ||
996 | ] | ||
997 | edge | ||
998 | [ | ||
999 | source 0 | ||
1000 | target 9 | ||
1001 | graphics | ||
1002 | [ | ||
1003 | fill "#000000" | ||
1004 | width 3 | ||
1005 | targetArrow "standard" | ||
1006 | ] | ||
1007 | LabelGraphics | ||
1008 | [ | ||
1009 | text "segments reference Modes3ModelRoot" | ||
1010 | fontSize 14 | ||
1011 | fontName "Consolas" | ||
1012 | configuration "AutoFlippingLabel" | ||
1013 | model "six_pos" | ||
1014 | position "thead" | ||
1015 | ] | ||
1016 | ] | ||
1017 | edge | ||
1018 | [ | ||
1019 | source 0 | ||
1020 | target 11 | ||
1021 | graphics | ||
1022 | [ | ||
1023 | fill "#000000" | ||
1024 | width 3 | ||
1025 | targetArrow "standard" | ||
1026 | ] | ||
1027 | LabelGraphics | ||
1028 | [ | ||
1029 | text "segments reference Modes3ModelRoot" | ||
1030 | fontSize 14 | ||
1031 | fontName "Consolas" | ||
1032 | configuration "AutoFlippingLabel" | ||
1033 | model "six_pos" | ||
1034 | position "thead" | ||
1035 | ] | ||
1036 | ] | ||
1037 | edge | ||
1038 | [ | ||
1039 | source 0 | ||
1040 | target 3 | ||
1041 | graphics | ||
1042 | [ | ||
1043 | fill "#000000" | ||
1044 | width 3 | ||
1045 | targetArrow "standard" | ||
1046 | ] | ||
1047 | LabelGraphics | ||
1048 | [ | ||
1049 | text "turnouts reference Modes3ModelRoot" | ||
1050 | fontSize 14 | ||
1051 | fontName "Consolas" | ||
1052 | configuration "AutoFlippingLabel" | ||
1053 | model "six_pos" | ||
1054 | position "thead" | ||
1055 | ] | ||
1056 | ] | ||
1057 | edge | ||
1058 | [ | ||
1059 | source 3 | ||
1060 | target 9 | ||
1061 | graphics | ||
1062 | [ | ||
1063 | fill "#000000" | ||
1064 | targetArrow "standard" | ||
1065 | ] | ||
1066 | LabelGraphics | ||
1067 | [ | ||
1068 | text "straight reference Turnout" | ||
1069 | fontSize 14 | ||
1070 | fontName "Consolas" | ||
1071 | configuration "AutoFlippingLabel" | ||
1072 | model "six_pos" | ||
1073 | position "thead" | ||
1074 | ] | ||
1075 | ] | ||
1076 | edge | ||
1077 | [ | ||
1078 | source 3 | ||
1079 | target 5 | ||
1080 | graphics | ||
1081 | [ | ||
1082 | fill "#000000" | ||
1083 | targetArrow "standard" | ||
1084 | ] | ||
1085 | LabelGraphics | ||
1086 | [ | ||
1087 | text "divergent reference Turnout" | ||
1088 | fontSize 14 | ||
1089 | fontName "Consolas" | ||
1090 | configuration "AutoFlippingLabel" | ||
1091 | model "six_pos" | ||
1092 | position "thead" | ||
1093 | ] | ||
1094 | ] | ||
1095 | edge | ||
1096 | [ | ||
1097 | source 6 | ||
1098 | target 5 | ||
1099 | graphics | ||
1100 | [ | ||
1101 | fill "#000000" | ||
1102 | targetArrow "standard" | ||
1103 | ] | ||
1104 | LabelGraphics | ||
1105 | [ | ||
1106 | text "location reference Train" | ||
1107 | fontSize 14 | ||
1108 | fontName "Consolas" | ||
1109 | configuration "AutoFlippingLabel" | ||
1110 | model "six_pos" | ||
1111 | position "thead" | ||
1112 | ] | ||
1113 | ] | ||
1114 | edge | ||
1115 | [ | ||
1116 | source 4 | ||
1117 | target 3 | ||
1118 | graphics | ||
1119 | [ | ||
1120 | fill "#000000" | ||
1121 | targetArrow "standard" | ||
1122 | ] | ||
1123 | LabelGraphics | ||
1124 | [ | ||
1125 | text "location reference Train" | ||
1126 | fontSize 14 | ||
1127 | fontName "Consolas" | ||
1128 | configuration "AutoFlippingLabel" | ||
1129 | model "six_pos" | ||
1130 | position "thead" | ||
1131 | ] | ||
1132 | ] | ||
1133 | edge | ||
1134 | [ | ||
1135 | source 8 | ||
1136 | target 7 | ||
1137 | graphics | ||
1138 | [ | ||
1139 | fill "#000000" | ||
1140 | targetArrow "standard" | ||
1141 | ] | ||
1142 | LabelGraphics | ||
1143 | [ | ||
1144 | text "location reference Train" | ||
1145 | fontSize 14 | ||
1146 | fontName "Consolas" | ||
1147 | configuration "AutoFlippingLabel" | ||
1148 | model "six_pos" | ||
1149 | position "thead" | ||
1150 | ] | ||
1151 | ] | ||
1152 | edge | ||
1153 | [ | ||
1154 | source 10 | ||
1155 | target 9 | ||
1156 | graphics | ||
1157 | [ | ||
1158 | fill "#000000" | ||
1159 | targetArrow "standard" | ||
1160 | ] | ||
1161 | LabelGraphics | ||
1162 | [ | ||
1163 | text "location reference Train" | ||
1164 | fontSize 14 | ||
1165 | fontName "Consolas" | ||
1166 | configuration "AutoFlippingLabel" | ||
1167 | model "six_pos" | ||
1168 | position "thead" | ||
1169 | ] | ||
1170 | ] | ||
1171 | edge | ||
1172 | [ | ||
1173 | source 12 | ||
1174 | target 11 | ||
1175 | graphics | ||
1176 | [ | ||
1177 | fill "#000000" | ||
1178 | targetArrow "standard" | ||
1179 | ] | ||
1180 | LabelGraphics | ||
1181 | [ | ||
1182 | text "location reference Train" | ||
1183 | fontSize 14 | ||
1184 | fontName "Consolas" | ||
1185 | configuration "AutoFlippingLabel" | ||
1186 | model "six_pos" | ||
1187 | position "thead" | ||
1188 | ] | ||
1189 | ] | ||
1190 | ] | ||
1191 | |||
diff --git a/Domains/ca.mcgill.rtgmrt.example.modes3/output/solution1.partialinterpretation b/Domains/ca.mcgill.rtgmrt.example.modes3/output/solution1.partialinterpretation new file mode 100644 index 00000000..8b50e17f --- /dev/null +++ b/Domains/ca.mcgill.rtgmrt.example.modes3/output/solution1.partialinterpretation | |||
@@ -0,0 +1,1037 @@ | |||
1 | <?xml version="1.0" encoding="ASCII"?> | ||
2 | <partialinterpretation:PartialInterpretation xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore2logicannotations="http://www.bme.hu/mit/inf/dslreasoner/logic/model/language/ecore2logicannotation" xmlns:language="http://www.bme.hu/mit/inf/dslreasoner/logic/model/language" xmlns:partialinterpretation="http://www.bme.hu/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage" xmlns:viatra2logicannotations="http://www.bme.hu/mit/inf/dslreasoner/logic/model/language/viatra2logicannotation" problem="//@problemConainer" maxNewElements="0"> | ||
3 | <partialrelationinterpretation interpretationOf="//@problemConainer/@relations.0" param1="//@problemConainer/@relations.0/@parameters.0" param2="//@problemConainer/@relations.0/@parameters.1"> | ||
4 | <relationlinks xsi:type="partialinterpretation:BinaryElementRelationLink" param1="//@newElements.4" param2="//@newElements.2"/> | ||
5 | <relationlinks xsi:type="partialinterpretation:BinaryElementRelationLink" param1="//@newElements.2" param2="//@newElements.4"/> | ||
6 | <relationlinks xsi:type="partialinterpretation:BinaryElementRelationLink" param1="//@newElements.6" param2="//@newElements.2"/> | ||
7 | <relationlinks xsi:type="partialinterpretation:BinaryElementRelationLink" param1="//@newElements.2" param2="//@newElements.6"/> | ||
8 | <relationlinks xsi:type="partialinterpretation:BinaryElementRelationLink" param1="//@newElements.6" param2="//@newElements.8"/> | ||
9 | <relationlinks xsi:type="partialinterpretation:BinaryElementRelationLink" param1="//@newElements.8" param2="//@newElements.6"/> | ||
10 | <relationlinks xsi:type="partialinterpretation:BinaryElementRelationLink" param1="//@newElements.10" param2="//@newElements.4"/> | ||
11 | <relationlinks xsi:type="partialinterpretation:BinaryElementRelationLink" param1="//@newElements.4" param2="//@newElements.10"/> | ||
12 | </partialrelationinterpretation> | ||
13 | <partialrelationinterpretation interpretationOf="//@problemConainer/@relations.1" param1="//@problemConainer/@relations.1/@parameters.0" param2="//@problemConainer/@relations.1/@parameters.1"> | ||
14 | <relationlinks xsi:type="partialinterpretation:BinaryElementRelationLink" param1="//@newElements.4" param2="//@newElements.5"/> | ||
15 | <relationlinks xsi:type="partialinterpretation:BinaryElementRelationLink" param1="//@newElements.2" param2="//@newElements.3"/> | ||
16 | <relationlinks xsi:type="partialinterpretation:BinaryElementRelationLink" param1="//@newElements.6" param2="//@newElements.7"/> | ||
17 | <relationlinks xsi:type="partialinterpretation:BinaryElementRelationLink" param1="//@newElements.8" param2="//@newElements.9"/> | ||
18 | <relationlinks xsi:type="partialinterpretation:BinaryElementRelationLink" param1="//@newElements.10" param2="//@newElements.11"/> | ||
19 | </partialrelationinterpretation> | ||
20 | <partialrelationinterpretation interpretationOf="//@problemConainer/@relations.2" param1="//@problemConainer/@relations.2/@parameters.0" param2="//@problemConainer/@relations.2/@parameters.1"> | ||
21 | <relationlinks xsi:type="partialinterpretation:BinaryElementRelationLink" param1="//@problemConainer/@elements.0" param2="//@newElements.3"/> | ||
22 | <relationlinks xsi:type="partialinterpretation:BinaryElementRelationLink" param1="//@problemConainer/@elements.0" param2="//@newElements.5"/> | ||
23 | <relationlinks xsi:type="partialinterpretation:BinaryElementRelationLink" param1="//@problemConainer/@elements.0" param2="//@newElements.7"/> | ||
24 | <relationlinks xsi:type="partialinterpretation:BinaryElementRelationLink" param1="//@problemConainer/@elements.0" param2="//@newElements.9"/> | ||
25 | <relationlinks xsi:type="partialinterpretation:BinaryElementRelationLink" param1="//@problemConainer/@elements.0" param2="//@newElements.11"/> | ||
26 | </partialrelationinterpretation> | ||
27 | <partialrelationinterpretation interpretationOf="//@problemConainer/@relations.3" param1="//@problemConainer/@relations.3/@parameters.0" param2="//@problemConainer/@relations.3/@parameters.1"> | ||
28 | <relationlinks xsi:type="partialinterpretation:BinaryElementRelationLink" param1="//@problemConainer/@elements.0" param2="//@newElements.4"/> | ||
29 | <relationlinks xsi:type="partialinterpretation:BinaryElementRelationLink" param1="//@problemConainer/@elements.0" param2="//@newElements.6"/> | ||
30 | <relationlinks xsi:type="partialinterpretation:BinaryElementRelationLink" param1="//@problemConainer/@elements.0" param2="//@newElements.8"/> | ||
31 | <relationlinks xsi:type="partialinterpretation:BinaryElementRelationLink" param1="//@problemConainer/@elements.0" param2="//@newElements.10"/> | ||
32 | </partialrelationinterpretation> | ||
33 | <partialrelationinterpretation interpretationOf="//@problemConainer/@relations.4" param1="//@problemConainer/@relations.4/@parameters.0" param2="//@problemConainer/@relations.4/@parameters.1"> | ||
34 | <relationlinks xsi:type="partialinterpretation:BinaryElementRelationLink" param1="//@problemConainer/@elements.0" param2="//@newElements.2"/> | ||
35 | </partialrelationinterpretation> | ||
36 | <partialrelationinterpretation interpretationOf="//@problemConainer/@relations.5" param1="//@problemConainer/@relations.5/@parameters.0" param2="//@problemConainer/@relations.5/@parameters.1"> | ||
37 | <relationlinks xsi:type="partialinterpretation:BinaryElementRelationLink" param1="//@newElements.2" param2="//@newElements.8"/> | ||
38 | </partialrelationinterpretation> | ||
39 | <partialrelationinterpretation interpretationOf="//@problemConainer/@relations.6" param1="//@problemConainer/@relations.6/@parameters.0" param2="//@problemConainer/@relations.6/@parameters.1"> | ||
40 | <relationlinks xsi:type="partialinterpretation:BinaryElementRelationLink" param1="//@newElements.2" param2="//@newElements.4"/> | ||
41 | </partialrelationinterpretation> | ||
42 | <partialrelationinterpretation interpretationOf="//@problemConainer/@relations.7" param1="//@problemConainer/@relations.7/@parameters.0" param2="//@problemConainer/@relations.7/@parameters.1"> | ||
43 | <relationlinks xsi:type="partialinterpretation:BinaryElementRelationLink" param1="//@newElements.5" param2="//@newElements.4"/> | ||
44 | <relationlinks xsi:type="partialinterpretation:BinaryElementRelationLink" param1="//@newElements.3" param2="//@newElements.2"/> | ||
45 | <relationlinks xsi:type="partialinterpretation:BinaryElementRelationLink" param1="//@newElements.7" param2="//@newElements.6"/> | ||
46 | <relationlinks xsi:type="partialinterpretation:BinaryElementRelationLink" param1="//@newElements.9" param2="//@newElements.8"/> | ||
47 | <relationlinks xsi:type="partialinterpretation:BinaryElementRelationLink" param1="//@newElements.11" param2="//@newElements.10"/> | ||
48 | </partialrelationinterpretation> | ||
49 | <newElements xsi:type="partialinterpretation:BooleanElement" name="true" valueSet="true" value="true"/> | ||
50 | <newElements xsi:type="partialinterpretation:BooleanElement" name="false" valueSet="true"/> | ||
51 | <newElements/> | ||
52 | <newElements/> | ||
53 | <newElements/> | ||
54 | <newElements/> | ||
55 | <newElements/> | ||
56 | <newElements/> | ||
57 | <newElements/> | ||
58 | <newElements/> | ||
59 | <newElements/> | ||
60 | <newElements/> | ||
61 | <partialtypeinterpratation xsi:type="partialinterpretation:PartialBooleanInterpretation" elements="//@newElements.0 //@newElements.1"/> | ||
62 | <partialtypeinterpratation xsi:type="partialinterpretation:PartialIntegerInterpretation" elements="//@openWorldElements.0"/> | ||
63 | <partialtypeinterpratation xsi:type="partialinterpretation:PartialRealInterpretation" elements="//@openWorldElements.1"/> | ||
64 | <partialtypeinterpratation xsi:type="partialinterpretation:PartialStringInterpretation" elements="//@openWorldElements.2"/> | ||
65 | <partialtypeinterpratation xsi:type="partialinterpretation:PartialComplexTypeInterpretation" elements="//@newElements.2 //@newElements.4 //@newElements.6 //@newElements.8 //@newElements.10" scopes="//@scopes.0" interpretationOf="//@problemConainer/@types.0"/> | ||
66 | <partialtypeinterpratation xsi:type="partialinterpretation:PartialComplexTypeInterpretation" elements="//@problemConainer/@elements.0" scopes="//@scopes.1" interpretationOf="//@problemConainer/@types.1"/> | ||
67 | <partialtypeinterpratation xsi:type="partialinterpretation:PartialComplexTypeInterpretation" elements="//@newElements.2" scopes="//@scopes.2" supertypeInterpretation="//@partialtypeinterpratation.4" interpretationOf="//@problemConainer/@types.2"/> | ||
68 | <partialtypeinterpratation xsi:type="partialinterpretation:PartialComplexTypeInterpretation" elements="//@newElements.3 //@newElements.5 //@newElements.7 //@newElements.9 //@newElements.11" scopes="//@scopes.3" interpretationOf="//@problemConainer/@types.3"/> | ||
69 | <partialtypeinterpratation xsi:type="partialinterpretation:PartialComplexTypeInterpretation" scopes="//@scopes.4" supertypeInterpretation="//@partialtypeinterpratation.5" interpretationOf="//@problemConainer/@types.5"/> | ||
70 | <openWorldElements xsi:type="partialinterpretation:IntegerElement" name="New Integers"/> | ||
71 | <openWorldElements xsi:type="partialinterpretation:RealElement" name="New Reals"/> | ||
72 | <openWorldElements xsi:type="partialinterpretation:StringElement" name="New Strings"/> | ||
73 | <openWorldElements name="New Objects"/> | ||
74 | <problemConainer> | ||
75 | <types xsi:type="language:TypeDeclaration" name="Segment class" subtypes="//@problemConainer/@types.2"/> | ||
76 | <types xsi:type="language:TypeDeclaration" name="Modes3ModelRoot class" subtypes="//@problemConainer/@types.4 //@problemConainer/@types.5" isAbstract="true"/> | ||
77 | <types xsi:type="language:TypeDeclaration" name="Turnout class" supertypes="//@problemConainer/@types.0"/> | ||
78 | <types xsi:type="language:TypeDeclaration" name="Train class"/> | ||
79 | <types xsi:type="language:TypeDefinition" name="Modes3ModelRoot class DefinedPart" supertypes="//@problemConainer/@types.1" elements="//@problemConainer/@elements.0"/> | ||
80 | <types xsi:type="language:TypeDeclaration" name="Modes3ModelRoot class UndefinedPart" supertypes="//@problemConainer/@types.1"/> | ||
81 | <assertions name="upperMultiplicity connectedTo Segment" annotations="//@problemConainer/@annotations.0"> | ||
82 | <value xsi:type="language:Forall"> | ||
83 | <quantifiedVariables name="src"> | ||
84 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
85 | </quantifiedVariables> | ||
86 | <quantifiedVariables name="trg 1"> | ||
87 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
88 | </quantifiedVariables> | ||
89 | <quantifiedVariables name="trg 2"> | ||
90 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
91 | </quantifiedVariables> | ||
92 | <quantifiedVariables name="trg 3"> | ||
93 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
94 | </quantifiedVariables> | ||
95 | <expression xsi:type="language:Impl"> | ||
96 | <leftOperand xsi:type="language:And"> | ||
97 | <operands xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.0"> | ||
98 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@assertions.0/@value/@quantifiedVariables.0"/> | ||
99 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@assertions.0/@value/@quantifiedVariables.1"/> | ||
100 | </operands> | ||
101 | <operands xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.0"> | ||
102 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@assertions.0/@value/@quantifiedVariables.0"/> | ||
103 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@assertions.0/@value/@quantifiedVariables.2"/> | ||
104 | </operands> | ||
105 | <operands xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.0"> | ||
106 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@assertions.0/@value/@quantifiedVariables.0"/> | ||
107 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@assertions.0/@value/@quantifiedVariables.3"/> | ||
108 | </operands> | ||
109 | </leftOperand> | ||
110 | <rightOperand xsi:type="language:Not"> | ||
111 | <operand xsi:type="language:Distinct"> | ||
112 | <operands xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@assertions.0/@value/@quantifiedVariables.1"/> | ||
113 | <operands xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@assertions.0/@value/@quantifiedVariables.2"/> | ||
114 | <operands xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@assertions.0/@value/@quantifiedVariables.3"/> | ||
115 | </operand> | ||
116 | </rightOperand> | ||
117 | </expression> | ||
118 | </value> | ||
119 | </assertions> | ||
120 | <assertions name="upperMultiplicity occupiedBy Segment" annotations="//@problemConainer/@annotations.1"> | ||
121 | <value xsi:type="language:Forall"> | ||
122 | <quantifiedVariables name="src"> | ||
123 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
124 | </quantifiedVariables> | ||
125 | <quantifiedVariables name="trg 1"> | ||
126 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.3"/> | ||
127 | </quantifiedVariables> | ||
128 | <quantifiedVariables name="trg 2"> | ||
129 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.3"/> | ||
130 | </quantifiedVariables> | ||
131 | <expression xsi:type="language:Impl"> | ||
132 | <leftOperand xsi:type="language:And"> | ||
133 | <operands xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.1"> | ||
134 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@assertions.1/@value/@quantifiedVariables.0"/> | ||
135 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@assertions.1/@value/@quantifiedVariables.1"/> | ||
136 | </operands> | ||
137 | <operands xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.1"> | ||
138 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@assertions.1/@value/@quantifiedVariables.0"/> | ||
139 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@assertions.1/@value/@quantifiedVariables.2"/> | ||
140 | </operands> | ||
141 | </leftOperand> | ||
142 | <rightOperand xsi:type="language:Not"> | ||
143 | <operand xsi:type="language:Distinct"> | ||
144 | <operands xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@assertions.1/@value/@quantifiedVariables.1"/> | ||
145 | <operands xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@assertions.1/@value/@quantifiedVariables.2"/> | ||
146 | </operand> | ||
147 | </rightOperand> | ||
148 | </expression> | ||
149 | </value> | ||
150 | </assertions> | ||
151 | <assertions name="lowerMultiplicity straight Turnout" annotations="//@problemConainer/@annotations.2"> | ||
152 | <value xsi:type="language:Forall"> | ||
153 | <quantifiedVariables name="src"> | ||
154 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.2"/> | ||
155 | </quantifiedVariables> | ||
156 | <expression xsi:type="language:Exists"> | ||
157 | <quantifiedVariables name="trg 1"> | ||
158 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
159 | </quantifiedVariables> | ||
160 | <expression xsi:type="language:And"> | ||
161 | <operands xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.5"> | ||
162 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@assertions.2/@value/@quantifiedVariables.0"/> | ||
163 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@assertions.2/@value/@expression/@quantifiedVariables.0"/> | ||
164 | </operands> | ||
165 | </expression> | ||
166 | </expression> | ||
167 | </value> | ||
168 | </assertions> | ||
169 | <assertions name="upperMultiplicity straight Turnout" annotations="//@problemConainer/@annotations.3"> | ||
170 | <value xsi:type="language:Forall"> | ||
171 | <quantifiedVariables name="src"> | ||
172 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.2"/> | ||
173 | </quantifiedVariables> | ||
174 | <quantifiedVariables name="trg 1"> | ||
175 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
176 | </quantifiedVariables> | ||
177 | <quantifiedVariables name="trg 2"> | ||
178 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
179 | </quantifiedVariables> | ||
180 | <expression xsi:type="language:Impl"> | ||
181 | <leftOperand xsi:type="language:And"> | ||
182 | <operands xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.5"> | ||
183 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@assertions.3/@value/@quantifiedVariables.0"/> | ||
184 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@assertions.3/@value/@quantifiedVariables.1"/> | ||
185 | </operands> | ||
186 | <operands xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.5"> | ||
187 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@assertions.3/@value/@quantifiedVariables.0"/> | ||
188 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@assertions.3/@value/@quantifiedVariables.2"/> | ||
189 | </operands> | ||
190 | </leftOperand> | ||
191 | <rightOperand xsi:type="language:Not"> | ||
192 | <operand xsi:type="language:Distinct"> | ||
193 | <operands xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@assertions.3/@value/@quantifiedVariables.1"/> | ||
194 | <operands xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@assertions.3/@value/@quantifiedVariables.2"/> | ||
195 | </operand> | ||
196 | </rightOperand> | ||
197 | </expression> | ||
198 | </value> | ||
199 | </assertions> | ||
200 | <assertions name="lowerMultiplicity divergent Turnout" annotations="//@problemConainer/@annotations.4"> | ||
201 | <value xsi:type="language:Forall"> | ||
202 | <quantifiedVariables name="src"> | ||
203 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.2"/> | ||
204 | </quantifiedVariables> | ||
205 | <expression xsi:type="language:Exists"> | ||
206 | <quantifiedVariables name="trg 1"> | ||
207 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
208 | </quantifiedVariables> | ||
209 | <expression xsi:type="language:And"> | ||
210 | <operands xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.6"> | ||
211 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@assertions.4/@value/@quantifiedVariables.0"/> | ||
212 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@assertions.4/@value/@expression/@quantifiedVariables.0"/> | ||
213 | </operands> | ||
214 | </expression> | ||
215 | </expression> | ||
216 | </value> | ||
217 | </assertions> | ||
218 | <assertions name="upperMultiplicity divergent Turnout" annotations="//@problemConainer/@annotations.5"> | ||
219 | <value xsi:type="language:Forall"> | ||
220 | <quantifiedVariables name="src"> | ||
221 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.2"/> | ||
222 | </quantifiedVariables> | ||
223 | <quantifiedVariables name="trg 1"> | ||
224 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
225 | </quantifiedVariables> | ||
226 | <quantifiedVariables name="trg 2"> | ||
227 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
228 | </quantifiedVariables> | ||
229 | <expression xsi:type="language:Impl"> | ||
230 | <leftOperand xsi:type="language:And"> | ||
231 | <operands xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.6"> | ||
232 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@assertions.5/@value/@quantifiedVariables.0"/> | ||
233 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@assertions.5/@value/@quantifiedVariables.1"/> | ||
234 | </operands> | ||
235 | <operands xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.6"> | ||
236 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@assertions.5/@value/@quantifiedVariables.0"/> | ||
237 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@assertions.5/@value/@quantifiedVariables.2"/> | ||
238 | </operands> | ||
239 | </leftOperand> | ||
240 | <rightOperand xsi:type="language:Not"> | ||
241 | <operand xsi:type="language:Distinct"> | ||
242 | <operands xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@assertions.5/@value/@quantifiedVariables.1"/> | ||
243 | <operands xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@assertions.5/@value/@quantifiedVariables.2"/> | ||
244 | </operand> | ||
245 | </rightOperand> | ||
246 | </expression> | ||
247 | </value> | ||
248 | </assertions> | ||
249 | <assertions name="lowerMultiplicity location Train" annotations="//@problemConainer/@annotations.6"> | ||
250 | <value xsi:type="language:Forall"> | ||
251 | <quantifiedVariables name="src"> | ||
252 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.3"/> | ||
253 | </quantifiedVariables> | ||
254 | <expression xsi:type="language:Exists"> | ||
255 | <quantifiedVariables name="trg 1"> | ||
256 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
257 | </quantifiedVariables> | ||
258 | <expression xsi:type="language:And"> | ||
259 | <operands xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.7"> | ||
260 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@assertions.6/@value/@quantifiedVariables.0"/> | ||
261 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@assertions.6/@value/@expression/@quantifiedVariables.0"/> | ||
262 | </operands> | ||
263 | </expression> | ||
264 | </expression> | ||
265 | </value> | ||
266 | </assertions> | ||
267 | <assertions name="upperMultiplicity location Train" annotations="//@problemConainer/@annotations.7"> | ||
268 | <value xsi:type="language:Forall"> | ||
269 | <quantifiedVariables name="src"> | ||
270 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.3"/> | ||
271 | </quantifiedVariables> | ||
272 | <quantifiedVariables name="trg 1"> | ||
273 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
274 | </quantifiedVariables> | ||
275 | <quantifiedVariables name="trg 2"> | ||
276 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
277 | </quantifiedVariables> | ||
278 | <expression xsi:type="language:Impl"> | ||
279 | <leftOperand xsi:type="language:And"> | ||
280 | <operands xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.7"> | ||
281 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@assertions.7/@value/@quantifiedVariables.0"/> | ||
282 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@assertions.7/@value/@quantifiedVariables.1"/> | ||
283 | </operands> | ||
284 | <operands xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.7"> | ||
285 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@assertions.7/@value/@quantifiedVariables.0"/> | ||
286 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@assertions.7/@value/@quantifiedVariables.2"/> | ||
287 | </operands> | ||
288 | </leftOperand> | ||
289 | <rightOperand xsi:type="language:Not"> | ||
290 | <operand xsi:type="language:Distinct"> | ||
291 | <operands xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@assertions.7/@value/@quantifiedVariables.1"/> | ||
292 | <operands xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@assertions.7/@value/@quantifiedVariables.2"/> | ||
293 | </operand> | ||
294 | </rightOperand> | ||
295 | </expression> | ||
296 | </value> | ||
297 | </assertions> | ||
298 | <assertions name="oppositeReference occupiedBy Segment" annotations="//@problemConainer/@annotations.8"> | ||
299 | <value xsi:type="language:Forall"> | ||
300 | <quantifiedVariables name="src"> | ||
301 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
302 | </quantifiedVariables> | ||
303 | <quantifiedVariables name="trg"> | ||
304 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.3"/> | ||
305 | </quantifiedVariables> | ||
306 | <expression xsi:type="language:Iff"> | ||
307 | <leftOperand xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.1"> | ||
308 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@assertions.8/@value/@quantifiedVariables.0"/> | ||
309 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@assertions.8/@value/@quantifiedVariables.1"/> | ||
310 | </leftOperand> | ||
311 | <rightOperand xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.7"> | ||
312 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@assertions.8/@value/@quantifiedVariables.1"/> | ||
313 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@assertions.8/@value/@quantifiedVariables.0"/> | ||
314 | </rightOperand> | ||
315 | </expression> | ||
316 | </value> | ||
317 | </assertions> | ||
318 | <assertions name="oppositeReference connectedTo reference Segment connectedTo reference Segment" annotations="//@problemConainer/@annotations.9"> | ||
319 | <value xsi:type="language:Forall"> | ||
320 | <quantifiedVariables name="src"> | ||
321 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
322 | </quantifiedVariables> | ||
323 | <quantifiedVariables name="trg"> | ||
324 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
325 | </quantifiedVariables> | ||
326 | <expression xsi:type="language:Iff"> | ||
327 | <leftOperand xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.0"> | ||
328 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@assertions.9/@value/@quantifiedVariables.0"/> | ||
329 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@assertions.9/@value/@quantifiedVariables.1"/> | ||
330 | </leftOperand> | ||
331 | <rightOperand xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.0"> | ||
332 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@assertions.9/@value/@quantifiedVariables.1"/> | ||
333 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@assertions.9/@value/@quantifiedVariables.0"/> | ||
334 | </rightOperand> | ||
335 | </expression> | ||
336 | </value> | ||
337 | </assertions> | ||
338 | <assertions name="errorpattern modes3 queries turnoutInSegments" annotations="//@problemConainer/@annotations.27"> | ||
339 | <value xsi:type="language:Forall"> | ||
340 | <quantifiedVariables name="p0"> | ||
341 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.2"/> | ||
342 | </quantifiedVariables> | ||
343 | <expression xsi:type="language:Not"> | ||
344 | <operand xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.8"> | ||
345 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@assertions.10/@value/@quantifiedVariables.0"/> | ||
346 | </operand> | ||
347 | </expression> | ||
348 | </value> | ||
349 | </assertions> | ||
350 | <assertions name="errorpattern modes3 queries tooManyInputsOfSegment" annotations="//@problemConainer/@annotations.28"> | ||
351 | <value xsi:type="language:Forall"> | ||
352 | <quantifiedVariables name="p0"> | ||
353 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
354 | </quantifiedVariables> | ||
355 | <expression xsi:type="language:Not"> | ||
356 | <operand xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.9"> | ||
357 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@assertions.11/@value/@quantifiedVariables.0"/> | ||
358 | </operand> | ||
359 | </expression> | ||
360 | </value> | ||
361 | </assertions> | ||
362 | <assertions name="errorpattern modes3 queries turnoutConnectedToBothOutputs" annotations="//@problemConainer/@annotations.29"> | ||
363 | <value xsi:type="language:Forall"> | ||
364 | <quantifiedVariables name="p0"> | ||
365 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.2"/> | ||
366 | </quantifiedVariables> | ||
367 | <expression xsi:type="language:Not"> | ||
368 | <operand xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.10"> | ||
369 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@assertions.12/@value/@quantifiedVariables.0"/> | ||
370 | </operand> | ||
371 | </expression> | ||
372 | </value> | ||
373 | </assertions> | ||
374 | <assertions name="errorpattern modes3 queries turnoutOutputsAreSame" annotations="//@problemConainer/@annotations.30"> | ||
375 | <value xsi:type="language:Forall"> | ||
376 | <quantifiedVariables name="p0"> | ||
377 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.2"/> | ||
378 | </quantifiedVariables> | ||
379 | <expression xsi:type="language:Not"> | ||
380 | <operand xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.12"> | ||
381 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@assertions.13/@value/@quantifiedVariables.0"/> | ||
382 | </operand> | ||
383 | </expression> | ||
384 | </value> | ||
385 | </assertions> | ||
386 | <assertions name="errorpattern modes3 queries tooManyExtraInputsOfTurnout" annotations="//@problemConainer/@annotations.31"> | ||
387 | <value xsi:type="language:Forall"> | ||
388 | <quantifiedVariables name="p0"> | ||
389 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.2"/> | ||
390 | </quantifiedVariables> | ||
391 | <expression xsi:type="language:Not"> | ||
392 | <operand xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.13"> | ||
393 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@assertions.14/@value/@quantifiedVariables.0"/> | ||
394 | </operand> | ||
395 | </expression> | ||
396 | </value> | ||
397 | </assertions> | ||
398 | <assertions name="errorpattern modes3 queries unreachable" annotations="//@problemConainer/@annotations.32"> | ||
399 | <value xsi:type="language:Forall"> | ||
400 | <quantifiedVariables name="p0"> | ||
401 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
402 | </quantifiedVariables> | ||
403 | <quantifiedVariables name="p1"> | ||
404 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
405 | </quantifiedVariables> | ||
406 | <expression xsi:type="language:Not"> | ||
407 | <operand xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.14"> | ||
408 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@assertions.15/@value/@quantifiedVariables.0"/> | ||
409 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@assertions.15/@value/@quantifiedVariables.1"/> | ||
410 | </operand> | ||
411 | </expression> | ||
412 | </value> | ||
413 | </assertions> | ||
414 | <assertions name="errorpattern modes3 queries connectedToReflexive" annotations="//@problemConainer/@annotations.33"> | ||
415 | <value xsi:type="language:Forall"> | ||
416 | <quantifiedVariables name="p0"> | ||
417 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
418 | </quantifiedVariables> | ||
419 | <expression xsi:type="language:Not"> | ||
420 | <operand xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.15"> | ||
421 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@assertions.16/@value/@quantifiedVariables.0"/> | ||
422 | </operand> | ||
423 | </expression> | ||
424 | </value> | ||
425 | </assertions> | ||
426 | <assertions name="errorpattern modes3 queries outputReflexive" annotations="//@problemConainer/@annotations.34"> | ||
427 | <value xsi:type="language:Forall"> | ||
428 | <quantifiedVariables name="p0"> | ||
429 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.2"/> | ||
430 | </quantifiedVariables> | ||
431 | <expression xsi:type="language:Not"> | ||
432 | <operand xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.18"> | ||
433 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@assertions.17/@value/@quantifiedVariables.0"/> | ||
434 | </operand> | ||
435 | </expression> | ||
436 | </value> | ||
437 | </assertions> | ||
438 | <assertions name="errorpattern modes3 queries noExtraInputOfTurnout" annotations="//@problemConainer/@annotations.35"> | ||
439 | <value xsi:type="language:Forall"> | ||
440 | <quantifiedVariables name="p0"> | ||
441 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.2"/> | ||
442 | </quantifiedVariables> | ||
443 | <expression xsi:type="language:Not"> | ||
444 | <operand xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.22"> | ||
445 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@assertions.18/@value/@quantifiedVariables.0"/> | ||
446 | </operand> | ||
447 | </expression> | ||
448 | </value> | ||
449 | </assertions> | ||
450 | <assertions name="errorpattern modes3 queries connectedToNotSymmetric" annotations="//@problemConainer/@annotations.36"> | ||
451 | <value xsi:type="language:Forall"> | ||
452 | <quantifiedVariables name="p0"> | ||
453 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
454 | </quantifiedVariables> | ||
455 | <quantifiedVariables name="p1"> | ||
456 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
457 | </quantifiedVariables> | ||
458 | <expression xsi:type="language:Not"> | ||
459 | <operand xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.23"> | ||
460 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@assertions.19/@value/@quantifiedVariables.0"/> | ||
461 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@assertions.19/@value/@quantifiedVariables.1"/> | ||
462 | </operand> | ||
463 | </expression> | ||
464 | </value> | ||
465 | </assertions> | ||
466 | <relations xsi:type="language:RelationDeclaration" name="connectedTo reference Segment"> | ||
467 | <parameters xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
468 | <parameters xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
469 | </relations> | ||
470 | <relations xsi:type="language:RelationDeclaration" name="occupiedBy reference Segment"> | ||
471 | <parameters xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
472 | <parameters xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.3"/> | ||
473 | </relations> | ||
474 | <relations xsi:type="language:RelationDeclaration" name="trains reference Modes3ModelRoot"> | ||
475 | <parameters xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.1"/> | ||
476 | <parameters xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.3"/> | ||
477 | </relations> | ||
478 | <relations xsi:type="language:RelationDeclaration" name="segments reference Modes3ModelRoot"> | ||
479 | <parameters xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.1"/> | ||
480 | <parameters xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
481 | </relations> | ||
482 | <relations xsi:type="language:RelationDeclaration" name="turnouts reference Modes3ModelRoot"> | ||
483 | <parameters xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.1"/> | ||
484 | <parameters xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.2"/> | ||
485 | </relations> | ||
486 | <relations xsi:type="language:RelationDeclaration" name="straight reference Turnout"> | ||
487 | <parameters xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.2"/> | ||
488 | <parameters xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
489 | </relations> | ||
490 | <relations xsi:type="language:RelationDeclaration" name="divergent reference Turnout"> | ||
491 | <parameters xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.2"/> | ||
492 | <parameters xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
493 | </relations> | ||
494 | <relations xsi:type="language:RelationDeclaration" name="location reference Train"> | ||
495 | <parameters xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.3"/> | ||
496 | <parameters xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
497 | </relations> | ||
498 | <relations xsi:type="language:RelationDefinition" name="pattern modes3 queries turnoutInSegments" annotations="//@problemConainer/@annotations.10"> | ||
499 | <parameters xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.2"/> | ||
500 | <variables name="parameter T"> | ||
501 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.2"/> | ||
502 | </variables> | ||
503 | <value xsi:type="language:Or"> | ||
504 | <operands xsi:type="language:Exists"> | ||
505 | <quantifiedVariables name="variable 0"> | ||
506 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.1"/> | ||
507 | </quantifiedVariables> | ||
508 | <expression xsi:type="language:And"> | ||
509 | <operands xsi:type="language:InstanceOf"> | ||
510 | <value xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.8/@variables.0"/> | ||
511 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.2"/> | ||
512 | </operands> | ||
513 | <operands xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.3"> | ||
514 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.8/@value/@operands.0/@quantifiedVariables.0"/> | ||
515 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.8/@variables.0"/> | ||
516 | </operands> | ||
517 | </expression> | ||
518 | </operands> | ||
519 | </value> | ||
520 | </relations> | ||
521 | <relations xsi:type="language:RelationDefinition" name="pattern modes3 queries tooManyInputsOfSegment" annotations="//@problemConainer/@annotations.11"> | ||
522 | <parameters xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
523 | <variables name="parameter S"> | ||
524 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
525 | </variables> | ||
526 | <value xsi:type="language:Or"> | ||
527 | <operands xsi:type="language:Exists"> | ||
528 | <quantifiedVariables name="variable I1"> | ||
529 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
530 | </quantifiedVariables> | ||
531 | <quantifiedVariables name="variable I2"> | ||
532 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
533 | </quantifiedVariables> | ||
534 | <quantifiedVariables name="variable I3"> | ||
535 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
536 | </quantifiedVariables> | ||
537 | <expression xsi:type="language:And"> | ||
538 | <operands xsi:type="language:Not"> | ||
539 | <operand xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.11"> | ||
540 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.9/@variables.0"/> | ||
541 | </operand> | ||
542 | </operands> | ||
543 | <operands xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.24"> | ||
544 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.9/@value/@operands.0/@quantifiedVariables.0"/> | ||
545 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.9/@variables.0"/> | ||
546 | </operands> | ||
547 | <operands xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.24"> | ||
548 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.9/@value/@operands.0/@quantifiedVariables.1"/> | ||
549 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.9/@variables.0"/> | ||
550 | </operands> | ||
551 | <operands xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.24"> | ||
552 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.9/@value/@operands.0/@quantifiedVariables.2"/> | ||
553 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.9/@variables.0"/> | ||
554 | </operands> | ||
555 | <operands xsi:type="language:Distinct"> | ||
556 | <operands xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.9/@value/@operands.0/@quantifiedVariables.0"/> | ||
557 | <operands xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.9/@value/@operands.0/@quantifiedVariables.1"/> | ||
558 | </operands> | ||
559 | <operands xsi:type="language:Distinct"> | ||
560 | <operands xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.9/@value/@operands.0/@quantifiedVariables.0"/> | ||
561 | <operands xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.9/@value/@operands.0/@quantifiedVariables.2"/> | ||
562 | </operands> | ||
563 | <operands xsi:type="language:Distinct"> | ||
564 | <operands xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.9/@value/@operands.0/@quantifiedVariables.1"/> | ||
565 | <operands xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.9/@value/@operands.0/@quantifiedVariables.2"/> | ||
566 | </operands> | ||
567 | </expression> | ||
568 | </operands> | ||
569 | </value> | ||
570 | </relations> | ||
571 | <relations xsi:type="language:RelationDefinition" name="pattern modes3 queries turnoutConnectedToBothOutputs" annotations="//@problemConainer/@annotations.12"> | ||
572 | <parameters xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.2"/> | ||
573 | <variables name="parameter T"> | ||
574 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.2"/> | ||
575 | </variables> | ||
576 | <value xsi:type="language:Or"> | ||
577 | <operands xsi:type="language:Exists"> | ||
578 | <quantifiedVariables name="variable Straight"> | ||
579 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
580 | </quantifiedVariables> | ||
581 | <quantifiedVariables name="variable Divergent"> | ||
582 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
583 | </quantifiedVariables> | ||
584 | <expression xsi:type="language:And"> | ||
585 | <operands xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.5"> | ||
586 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.10/@variables.0"/> | ||
587 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.10/@value/@operands.0/@quantifiedVariables.0"/> | ||
588 | </operands> | ||
589 | <operands xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.6"> | ||
590 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.10/@variables.0"/> | ||
591 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.10/@value/@operands.0/@quantifiedVariables.1"/> | ||
592 | </operands> | ||
593 | <operands xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.0"> | ||
594 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.10/@variables.0"/> | ||
595 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.10/@value/@operands.0/@quantifiedVariables.0"/> | ||
596 | </operands> | ||
597 | <operands xsi:type="language:InstanceOf"> | ||
598 | <value xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.10/@value/@operands.0/@quantifiedVariables.0"/> | ||
599 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
600 | </operands> | ||
601 | <operands xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.0"> | ||
602 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.10/@variables.0"/> | ||
603 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.10/@value/@operands.0/@quantifiedVariables.1"/> | ||
604 | </operands> | ||
605 | <operands xsi:type="language:InstanceOf"> | ||
606 | <value xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.10/@value/@operands.0/@quantifiedVariables.1"/> | ||
607 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
608 | </operands> | ||
609 | </expression> | ||
610 | </operands> | ||
611 | </value> | ||
612 | </relations> | ||
613 | <relations xsi:type="language:RelationDefinition" name="pattern modes3 queries turnout" annotations="//@problemConainer/@annotations.13"> | ||
614 | <parameters xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.2"/> | ||
615 | <variables name="parameter T"> | ||
616 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.2"/> | ||
617 | </variables> | ||
618 | <value xsi:type="language:Or"> | ||
619 | <operands xsi:type="language:And"> | ||
620 | <operands xsi:type="language:InstanceOf"> | ||
621 | <value xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.11/@variables.0"/> | ||
622 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.2"/> | ||
623 | </operands> | ||
624 | </operands> | ||
625 | </value> | ||
626 | </relations> | ||
627 | <relations xsi:type="language:RelationDefinition" name="pattern modes3 queries turnoutOutputsAreSame" annotations="//@problemConainer/@annotations.14"> | ||
628 | <parameters xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.2"/> | ||
629 | <variables name="parameter T"> | ||
630 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.2"/> | ||
631 | </variables> | ||
632 | <value xsi:type="language:Or"> | ||
633 | <operands xsi:type="language:Exists"> | ||
634 | <quantifiedVariables name="variable S"> | ||
635 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
636 | </quantifiedVariables> | ||
637 | <expression xsi:type="language:And"> | ||
638 | <operands xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.5"> | ||
639 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.12/@variables.0"/> | ||
640 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.12/@value/@operands.0/@quantifiedVariables.0"/> | ||
641 | </operands> | ||
642 | <operands xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.6"> | ||
643 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.12/@variables.0"/> | ||
644 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.12/@value/@operands.0/@quantifiedVariables.0"/> | ||
645 | </operands> | ||
646 | <operands xsi:type="language:InstanceOf"> | ||
647 | <value xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.12/@value/@operands.0/@quantifiedVariables.0"/> | ||
648 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
649 | </operands> | ||
650 | </expression> | ||
651 | </operands> | ||
652 | </value> | ||
653 | </relations> | ||
654 | <relations xsi:type="language:RelationDefinition" name="pattern modes3 queries tooManyExtraInputsOfTurnout" annotations="//@problemConainer/@annotations.15"> | ||
655 | <parameters xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.2"/> | ||
656 | <variables name="parameter T"> | ||
657 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.2"/> | ||
658 | </variables> | ||
659 | <value xsi:type="language:Or"> | ||
660 | <operands xsi:type="language:Exists"> | ||
661 | <quantifiedVariables name="variable I1"> | ||
662 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
663 | </quantifiedVariables> | ||
664 | <quantifiedVariables name="variable I2"> | ||
665 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
666 | </quantifiedVariables> | ||
667 | <expression xsi:type="language:And"> | ||
668 | <operands xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.20"> | ||
669 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.13/@variables.0"/> | ||
670 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.13/@value/@operands.0/@quantifiedVariables.0"/> | ||
671 | </operands> | ||
672 | <operands xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.20"> | ||
673 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.13/@variables.0"/> | ||
674 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.13/@value/@operands.0/@quantifiedVariables.1"/> | ||
675 | </operands> | ||
676 | <operands xsi:type="language:Distinct"> | ||
677 | <operands xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.13/@value/@operands.0/@quantifiedVariables.0"/> | ||
678 | <operands xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.13/@value/@operands.0/@quantifiedVariables.1"/> | ||
679 | </operands> | ||
680 | </expression> | ||
681 | </operands> | ||
682 | </value> | ||
683 | </relations> | ||
684 | <relations xsi:type="language:RelationDefinition" name="pattern modes3 queries unreachable" annotations="//@problemConainer/@annotations.16"> | ||
685 | <parameters xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
686 | <parameters xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
687 | <variables name="parameter S1"> | ||
688 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
689 | </variables> | ||
690 | <variables name="parameter S2"> | ||
691 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
692 | </variables> | ||
693 | <value xsi:type="language:Or"> | ||
694 | <operands xsi:type="language:And"> | ||
695 | <operands xsi:type="language:InstanceOf"> | ||
696 | <value xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.14/@variables.0"/> | ||
697 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
698 | </operands> | ||
699 | <operands xsi:type="language:InstanceOf"> | ||
700 | <value xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.14/@variables.1"/> | ||
701 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
702 | </operands> | ||
703 | <operands xsi:type="language:Not"> | ||
704 | <operand xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.21"> | ||
705 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.14/@variables.0"/> | ||
706 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.14/@variables.1"/> | ||
707 | </operand> | ||
708 | </operands> | ||
709 | </operands> | ||
710 | </value> | ||
711 | </relations> | ||
712 | <relations xsi:type="language:RelationDefinition" name="pattern modes3 queries connectedToReflexive" annotations="//@problemConainer/@annotations.17"> | ||
713 | <parameters xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
714 | <variables name="parameter S"> | ||
715 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
716 | </variables> | ||
717 | <value xsi:type="language:Or"> | ||
718 | <operands xsi:type="language:And"> | ||
719 | <operands xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.0"> | ||
720 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.15/@variables.0"/> | ||
721 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.15/@variables.0"/> | ||
722 | </operands> | ||
723 | </operands> | ||
724 | </value> | ||
725 | </relations> | ||
726 | <relations xsi:type="language:RelationDefinition" name="pattern modes3 queries turnoutOutput" annotations="//@problemConainer/@annotations.18"> | ||
727 | <parameters xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.2"/> | ||
728 | <parameters xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
729 | <variables name="parameter T"> | ||
730 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.2"/> | ||
731 | </variables> | ||
732 | <variables name="parameter S"> | ||
733 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
734 | </variables> | ||
735 | <value xsi:type="language:Or"> | ||
736 | <operands xsi:type="language:And"> | ||
737 | <operands xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.5"> | ||
738 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.16/@variables.0"/> | ||
739 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.16/@variables.1"/> | ||
740 | </operands> | ||
741 | <operands xsi:type="language:InstanceOf"> | ||
742 | <value xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.16/@variables.1"/> | ||
743 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
744 | </operands> | ||
745 | </operands> | ||
746 | <operands xsi:type="language:And"> | ||
747 | <operands xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.6"> | ||
748 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.16/@variables.0"/> | ||
749 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.16/@variables.1"/> | ||
750 | </operands> | ||
751 | <operands xsi:type="language:InstanceOf"> | ||
752 | <value xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.16/@variables.1"/> | ||
753 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
754 | </operands> | ||
755 | </operands> | ||
756 | </value> | ||
757 | </relations> | ||
758 | <relations xsi:type="language:RelationDefinition" name="pattern modes3 queries connectedTo" annotations="//@problemConainer/@annotations.19"> | ||
759 | <parameters xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
760 | <parameters xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
761 | <variables name="parameter S1"> | ||
762 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
763 | </variables> | ||
764 | <variables name="parameter S2"> | ||
765 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
766 | </variables> | ||
767 | <value xsi:type="language:Or"> | ||
768 | <operands xsi:type="language:And"> | ||
769 | <operands xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.0"> | ||
770 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.17/@variables.0"/> | ||
771 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.17/@variables.1"/> | ||
772 | </operands> | ||
773 | <operands xsi:type="language:InstanceOf"> | ||
774 | <value xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.17/@variables.1"/> | ||
775 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
776 | </operands> | ||
777 | </operands> | ||
778 | </value> | ||
779 | </relations> | ||
780 | <relations xsi:type="language:RelationDefinition" name="pattern modes3 queries outputReflexive" annotations="//@problemConainer/@annotations.20"> | ||
781 | <parameters xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.2"/> | ||
782 | <variables name="parameter T"> | ||
783 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.2"/> | ||
784 | </variables> | ||
785 | <value xsi:type="language:Or"> | ||
786 | <operands xsi:type="language:And"> | ||
787 | <operands xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.16"> | ||
788 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.18/@variables.0"/> | ||
789 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.18/@variables.0"/> | ||
790 | </operands> | ||
791 | </operands> | ||
792 | </value> | ||
793 | </relations> | ||
794 | <relations xsi:type="language:RelationDefinition" name="pattern modes3 queries adjacent" annotations="//@problemConainer/@annotations.21"> | ||
795 | <parameters xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
796 | <parameters xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
797 | <variables name="parameter S1"> | ||
798 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
799 | </variables> | ||
800 | <variables name="parameter S2"> | ||
801 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
802 | </variables> | ||
803 | <value xsi:type="language:Or"> | ||
804 | <operands xsi:type="language:And"> | ||
805 | <operands xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.24"> | ||
806 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.19/@variables.0"/> | ||
807 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.19/@variables.1"/> | ||
808 | </operands> | ||
809 | </operands> | ||
810 | <operands xsi:type="language:And"> | ||
811 | <operands xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.16"> | ||
812 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.19/@variables.1"/> | ||
813 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.19/@variables.0"/> | ||
814 | </operands> | ||
815 | </operands> | ||
816 | </value> | ||
817 | </relations> | ||
818 | <relations xsi:type="language:RelationDefinition" name="pattern modes3 queries extraInputOfTurnout" annotations="//@problemConainer/@annotations.22"> | ||
819 | <parameters xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.2"/> | ||
820 | <parameters xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
821 | <variables name="parameter T"> | ||
822 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.2"/> | ||
823 | </variables> | ||
824 | <variables name="parameter S"> | ||
825 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
826 | </variables> | ||
827 | <value xsi:type="language:Or"> | ||
828 | <operands xsi:type="language:Exists"> | ||
829 | <quantifiedVariables name="variable Straight"> | ||
830 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
831 | </quantifiedVariables> | ||
832 | <quantifiedVariables name="variable Divergent"> | ||
833 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
834 | </quantifiedVariables> | ||
835 | <expression xsi:type="language:And"> | ||
836 | <operands xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.5"> | ||
837 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.20/@variables.0"/> | ||
838 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.20/@value/@operands.0/@quantifiedVariables.0"/> | ||
839 | </operands> | ||
840 | <operands xsi:type="language:InstanceOf"> | ||
841 | <value xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.20/@value/@operands.0/@quantifiedVariables.0"/> | ||
842 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
843 | </operands> | ||
844 | <operands xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.6"> | ||
845 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.20/@variables.0"/> | ||
846 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.20/@value/@operands.0/@quantifiedVariables.1"/> | ||
847 | </operands> | ||
848 | <operands xsi:type="language:InstanceOf"> | ||
849 | <value xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.20/@value/@operands.0/@quantifiedVariables.1"/> | ||
850 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
851 | </operands> | ||
852 | <operands xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.24"> | ||
853 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.20/@variables.1"/> | ||
854 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.20/@variables.0"/> | ||
855 | </operands> | ||
856 | <operands xsi:type="language:Distinct"> | ||
857 | <operands xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.20/@variables.1"/> | ||
858 | <operands xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.20/@value/@operands.0/@quantifiedVariables.0"/> | ||
859 | </operands> | ||
860 | <operands xsi:type="language:Distinct"> | ||
861 | <operands xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.20/@variables.1"/> | ||
862 | <operands xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.20/@value/@operands.0/@quantifiedVariables.1"/> | ||
863 | </operands> | ||
864 | </expression> | ||
865 | </operands> | ||
866 | </value> | ||
867 | </relations> | ||
868 | <relations xsi:type="language:RelationDefinition" name="pattern modes3 queries reachable" annotations="//@problemConainer/@annotations.23"> | ||
869 | <parameters xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
870 | <parameters xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
871 | <variables name="parameter S1"> | ||
872 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
873 | </variables> | ||
874 | <variables name="parameter S2"> | ||
875 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
876 | </variables> | ||
877 | <value xsi:type="language:Or"> | ||
878 | <operands xsi:type="language:And"> | ||
879 | <operands xsi:type="language:InstanceOf"> | ||
880 | <value xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.21/@variables.1"/> | ||
881 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
882 | </operands> | ||
883 | </operands> | ||
884 | <operands xsi:type="language:And"> | ||
885 | <operands xsi:type="language:TransitiveClosure" relation="//@problemConainer/@relations.19"> | ||
886 | <leftOperand xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.21/@variables.0"/> | ||
887 | <rightOperand xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.21/@variables.1"/> | ||
888 | </operands> | ||
889 | </operands> | ||
890 | </value> | ||
891 | </relations> | ||
892 | <relations xsi:type="language:RelationDefinition" name="pattern modes3 queries noExtraInputOfTurnout" annotations="//@problemConainer/@annotations.24"> | ||
893 | <parameters xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.2"/> | ||
894 | <variables name="parameter T"> | ||
895 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.2"/> | ||
896 | </variables> | ||
897 | <value xsi:type="language:Or"> | ||
898 | <operands xsi:type="language:Forall"> | ||
899 | <quantifiedVariables name="variable 0"> | ||
900 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
901 | </quantifiedVariables> | ||
902 | <expression xsi:type="language:And"> | ||
903 | <operands xsi:type="language:InstanceOf"> | ||
904 | <value xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.22/@variables.0"/> | ||
905 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.2"/> | ||
906 | </operands> | ||
907 | <operands xsi:type="language:Not"> | ||
908 | <operand xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.20"> | ||
909 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.22/@variables.0"/> | ||
910 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.22/@value/@operands.0/@quantifiedVariables.0"/> | ||
911 | </operand> | ||
912 | </operands> | ||
913 | </expression> | ||
914 | </operands> | ||
915 | </value> | ||
916 | </relations> | ||
917 | <relations xsi:type="language:RelationDefinition" name="pattern modes3 queries connectedToNotSymmetric" annotations="//@problemConainer/@annotations.25"> | ||
918 | <parameters xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
919 | <parameters xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
920 | <variables name="parameter S1"> | ||
921 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
922 | </variables> | ||
923 | <variables name="parameter S2"> | ||
924 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
925 | </variables> | ||
926 | <value xsi:type="language:Or"> | ||
927 | <operands xsi:type="language:And"> | ||
928 | <operands xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.0"> | ||
929 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.23/@variables.0"/> | ||
930 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.23/@variables.1"/> | ||
931 | </operands> | ||
932 | <operands xsi:type="language:InstanceOf"> | ||
933 | <value xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.23/@variables.1"/> | ||
934 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
935 | </operands> | ||
936 | <operands xsi:type="language:Not"> | ||
937 | <operand xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.17"> | ||
938 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.23/@variables.1"/> | ||
939 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.23/@variables.0"/> | ||
940 | </operand> | ||
941 | </operands> | ||
942 | </operands> | ||
943 | </value> | ||
944 | </relations> | ||
945 | <relations xsi:type="language:RelationDefinition" name="pattern modes3 queries output" annotations="//@problemConainer/@annotations.26"> | ||
946 | <parameters xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
947 | <parameters xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
948 | <variables name="parameter S1"> | ||
949 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
950 | </variables> | ||
951 | <variables name="parameter S2"> | ||
952 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
953 | </variables> | ||
954 | <value xsi:type="language:Or"> | ||
955 | <operands xsi:type="language:And"> | ||
956 | <operands xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.0"> | ||
957 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.24/@variables.0"/> | ||
958 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.24/@variables.1"/> | ||
959 | </operands> | ||
960 | <operands xsi:type="language:InstanceOf"> | ||
961 | <value xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.24/@variables.1"/> | ||
962 | <range xsi:type="language:ComplexTypeReference" referred="//@problemConainer/@types.0"/> | ||
963 | </operands> | ||
964 | </operands> | ||
965 | <operands xsi:type="language:And"> | ||
966 | <operands xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.16"> | ||
967 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.24/@variables.0"/> | ||
968 | <parameterSubstitutions xsi:type="language:SymbolicValue" symbolicReference="//@problemConainer/@relations.24/@variables.1"/> | ||
969 | </operands> | ||
970 | </operands> | ||
971 | </value> | ||
972 | </relations> | ||
973 | <elements name="o 1" definedInType="//@problemConainer/@types.4"/> | ||
974 | <containmentHierarchies typesOrderedInHierarchy="//@problemConainer/@types.0 //@problemConainer/@types.2 //@problemConainer/@types.3 //@problemConainer/@types.1 //@problemConainer/@types.4 //@problemConainer/@types.5" containmentRelations="//@problemConainer/@relations.2 //@problemConainer/@relations.3 //@problemConainer/@relations.4"/> | ||
975 | <annotations xsi:type="ecore2logicannotations:UpperMultiplicityAssertion" target="//@problemConainer/@assertions.0" relation="//@problemConainer/@relations.0" upper="2"/> | ||
976 | <annotations xsi:type="ecore2logicannotations:UpperMultiplicityAssertion" target="//@problemConainer/@assertions.1" relation="//@problemConainer/@relations.1" upper="1"/> | ||
977 | <annotations xsi:type="ecore2logicannotations:LowerMultiplicityAssertion" target="//@problemConainer/@assertions.2" relation="//@problemConainer/@relations.5" lower="1"/> | ||
978 | <annotations xsi:type="ecore2logicannotations:UpperMultiplicityAssertion" target="//@problemConainer/@assertions.3" relation="//@problemConainer/@relations.5" upper="1"/> | ||
979 | <annotations xsi:type="ecore2logicannotations:LowerMultiplicityAssertion" target="//@problemConainer/@assertions.4" relation="//@problemConainer/@relations.6" lower="1"/> | ||
980 | <annotations xsi:type="ecore2logicannotations:UpperMultiplicityAssertion" target="//@problemConainer/@assertions.5" relation="//@problemConainer/@relations.6" upper="1"/> | ||
981 | <annotations xsi:type="ecore2logicannotations:LowerMultiplicityAssertion" target="//@problemConainer/@assertions.6" relation="//@problemConainer/@relations.7" lower="1"/> | ||
982 | <annotations xsi:type="ecore2logicannotations:UpperMultiplicityAssertion" target="//@problemConainer/@assertions.7" relation="//@problemConainer/@relations.7" upper="1"/> | ||
983 | <annotations xsi:type="ecore2logicannotations:InverseRelationAssertion" target="//@problemConainer/@assertions.8" inverseA="//@problemConainer/@relations.1" inverseB="//@problemConainer/@relations.7"/> | ||
984 | <annotations xsi:type="ecore2logicannotations:InverseRelationAssertion" target="//@problemConainer/@assertions.9" inverseA="//@problemConainer/@relations.0" inverseB="//@problemConainer/@relations.0"/> | ||
985 | <annotations xsi:type="viatra2logicannotations:TransfomedViatraQuery" target="//@problemConainer/@relations.8" patternFullyQualifiedName="modes3.queries.turnoutInSegments"> | ||
986 | <variableTrace targetLogicVariable="//@problemConainer/@relations.8/@value/@operands.0/@quantifiedVariables.0"/> | ||
987 | </annotations> | ||
988 | <annotations xsi:type="viatra2logicannotations:TransfomedViatraQuery" target="//@problemConainer/@relations.9" patternFullyQualifiedName="modes3.queries.tooManyInputsOfSegment"> | ||
989 | <variableTrace targetLogicVariable="//@problemConainer/@relations.9/@value/@operands.0/@quantifiedVariables.0"/> | ||
990 | <variableTrace targetLogicVariable="//@problemConainer/@relations.9/@value/@operands.0/@quantifiedVariables.1"/> | ||
991 | <variableTrace targetLogicVariable="//@problemConainer/@relations.9/@value/@operands.0/@quantifiedVariables.2"/> | ||
992 | </annotations> | ||
993 | <annotations xsi:type="viatra2logicannotations:TransfomedViatraQuery" target="//@problemConainer/@relations.10" patternFullyQualifiedName="modes3.queries.turnoutConnectedToBothOutputs"> | ||
994 | <variableTrace targetLogicVariable="//@problemConainer/@relations.10/@value/@operands.0/@quantifiedVariables.0"/> | ||
995 | <variableTrace targetLogicVariable="//@problemConainer/@relations.10/@value/@operands.0/@quantifiedVariables.1"/> | ||
996 | </annotations> | ||
997 | <annotations xsi:type="viatra2logicannotations:TransfomedViatraQuery" target="//@problemConainer/@relations.11" patternFullyQualifiedName="modes3.queries.turnout"/> | ||
998 | <annotations xsi:type="viatra2logicannotations:TransfomedViatraQuery" target="//@problemConainer/@relations.12" patternFullyQualifiedName="modes3.queries.turnoutOutputsAreSame"> | ||
999 | <variableTrace targetLogicVariable="//@problemConainer/@relations.12/@value/@operands.0/@quantifiedVariables.0"/> | ||
1000 | </annotations> | ||
1001 | <annotations xsi:type="viatra2logicannotations:TransfomedViatraQuery" target="//@problemConainer/@relations.13" patternFullyQualifiedName="modes3.queries.tooManyExtraInputsOfTurnout"> | ||
1002 | <variableTrace targetLogicVariable="//@problemConainer/@relations.13/@value/@operands.0/@quantifiedVariables.0"/> | ||
1003 | <variableTrace targetLogicVariable="//@problemConainer/@relations.13/@value/@operands.0/@quantifiedVariables.1"/> | ||
1004 | </annotations> | ||
1005 | <annotations xsi:type="viatra2logicannotations:TransfomedViatraQuery" target="//@problemConainer/@relations.14" patternFullyQualifiedName="modes3.queries.unreachable"/> | ||
1006 | <annotations xsi:type="viatra2logicannotations:TransfomedViatraQuery" target="//@problemConainer/@relations.15" patternFullyQualifiedName="modes3.queries.connectedToReflexive"/> | ||
1007 | <annotations xsi:type="viatra2logicannotations:TransfomedViatraQuery" target="//@problemConainer/@relations.16" patternFullyQualifiedName="modes3.queries.turnoutOutput"/> | ||
1008 | <annotations xsi:type="viatra2logicannotations:TransfomedViatraQuery" target="//@problemConainer/@relations.17" patternFullyQualifiedName="modes3.queries.connectedTo"/> | ||
1009 | <annotations xsi:type="viatra2logicannotations:TransfomedViatraQuery" target="//@problemConainer/@relations.18" patternFullyQualifiedName="modes3.queries.outputReflexive"/> | ||
1010 | <annotations xsi:type="viatra2logicannotations:TransfomedViatraQuery" target="//@problemConainer/@relations.19" patternFullyQualifiedName="modes3.queries.adjacent"/> | ||
1011 | <annotations xsi:type="viatra2logicannotations:TransfomedViatraQuery" target="//@problemConainer/@relations.20" patternFullyQualifiedName="modes3.queries.extraInputOfTurnout"> | ||
1012 | <variableTrace targetLogicVariable="//@problemConainer/@relations.20/@value/@operands.0/@quantifiedVariables.0"/> | ||
1013 | <variableTrace targetLogicVariable="//@problemConainer/@relations.20/@value/@operands.0/@quantifiedVariables.1"/> | ||
1014 | </annotations> | ||
1015 | <annotations xsi:type="viatra2logicannotations:TransfomedViatraQuery" target="//@problemConainer/@relations.21" patternFullyQualifiedName="modes3.queries.reachable"/> | ||
1016 | <annotations xsi:type="viatra2logicannotations:TransfomedViatraQuery" target="//@problemConainer/@relations.22" patternFullyQualifiedName="modes3.queries.noExtraInputOfTurnout"> | ||
1017 | <variableTrace targetLogicVariable="//@problemConainer/@relations.22/@value/@operands.0/@quantifiedVariables.0"/> | ||
1018 | </annotations> | ||
1019 | <annotations xsi:type="viatra2logicannotations:TransfomedViatraQuery" target="//@problemConainer/@relations.23" patternFullyQualifiedName="modes3.queries.connectedToNotSymmetric"/> | ||
1020 | <annotations xsi:type="viatra2logicannotations:TransfomedViatraQuery" target="//@problemConainer/@relations.24" patternFullyQualifiedName="modes3.queries.output"/> | ||
1021 | <annotations xsi:type="viatra2logicannotations:TransformedViatraWellformednessConstraint" target="//@problemConainer/@assertions.10" query="//@problemConainer/@annotations.10"/> | ||
1022 | <annotations xsi:type="viatra2logicannotations:TransformedViatraWellformednessConstraint" target="//@problemConainer/@assertions.11" query="//@problemConainer/@annotations.11"/> | ||
1023 | <annotations xsi:type="viatra2logicannotations:TransformedViatraWellformednessConstraint" target="//@problemConainer/@assertions.12" query="//@problemConainer/@annotations.12"/> | ||
1024 | <annotations xsi:type="viatra2logicannotations:TransformedViatraWellformednessConstraint" target="//@problemConainer/@assertions.13" query="//@problemConainer/@annotations.14"/> | ||
1025 | <annotations xsi:type="viatra2logicannotations:TransformedViatraWellformednessConstraint" target="//@problemConainer/@assertions.14" query="//@problemConainer/@annotations.15"/> | ||
1026 | <annotations xsi:type="viatra2logicannotations:TransformedViatraWellformednessConstraint" target="//@problemConainer/@assertions.15" query="//@problemConainer/@annotations.16"/> | ||
1027 | <annotations xsi:type="viatra2logicannotations:TransformedViatraWellformednessConstraint" target="//@problemConainer/@assertions.16" query="//@problemConainer/@annotations.17"/> | ||
1028 | <annotations xsi:type="viatra2logicannotations:TransformedViatraWellformednessConstraint" target="//@problemConainer/@assertions.17" query="//@problemConainer/@annotations.20"/> | ||
1029 | <annotations xsi:type="viatra2logicannotations:TransformedViatraWellformednessConstraint" target="//@problemConainer/@assertions.18" query="//@problemConainer/@annotations.24"/> | ||
1030 | <annotations xsi:type="viatra2logicannotations:TransformedViatraWellformednessConstraint" target="//@problemConainer/@assertions.19" query="//@problemConainer/@annotations.25"/> | ||
1031 | </problemConainer> | ||
1032 | <scopes maxNewElements="0" targetTypeInterpretation="//@partialtypeinterpratation.4"/> | ||
1033 | <scopes maxNewElements="0" targetTypeInterpretation="//@partialtypeinterpratation.5"/> | ||
1034 | <scopes maxNewElements="0" targetTypeInterpretation="//@partialtypeinterpratation.6"/> | ||
1035 | <scopes maxNewElements="0" targetTypeInterpretation="//@partialtypeinterpratation.7"/> | ||
1036 | <scopes maxNewElements="0" targetTypeInterpretation="//@partialtypeinterpratation.8"/> | ||
1037 | </partialinterpretation:PartialInterpretation> | ||
diff --git a/Domains/ca.mcgill.rtgmrt.example.modes3/output/solution1.png b/Domains/ca.mcgill.rtgmrt.example.modes3/output/solution1.png new file mode 100644 index 00000000..b6fa6e4e --- /dev/null +++ b/Domains/ca.mcgill.rtgmrt.example.modes3/output/solution1.png | |||
Binary files differ | |||
diff --git a/Domains/ca.mcgill.rtgmrt.example.modes3/plugin.properties b/Domains/ca.mcgill.rtgmrt.example.modes3/plugin.properties new file mode 100644 index 00000000..4eba0dd8 --- /dev/null +++ b/Domains/ca.mcgill.rtgmrt.example.modes3/plugin.properties | |||
@@ -0,0 +1,4 @@ | |||
1 | # | ||
2 | |||
3 | pluginName = ca.mcgill.rtgmrt.example.modes3 | ||
4 | providerName = www.example.org | ||
diff --git a/Domains/ca.mcgill.rtgmrt.example.modes3/plugin.xml b/Domains/ca.mcgill.rtgmrt.example.modes3/plugin.xml new file mode 100644 index 00000000..7341e19c --- /dev/null +++ b/Domains/ca.mcgill.rtgmrt.example.modes3/plugin.xml | |||
@@ -0,0 +1,28 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8"?><?eclipse version="3.0"?><!-- | ||
2 | --><plugin> | ||
3 | <extension point="org.eclipse.emf.ecore.generated_package"> | ||
4 | <!-- @generated modes3 --> | ||
5 | <package class="modes3.Modes3Package" genModel="model/modes3.genmodel" uri="http://www.ece.mcgill.ca/wcet/modes3"/> | ||
6 | </extension> | ||
7 | <extension id="modes3.queries.Modes3Queries" point="org.eclipse.viatra.query.runtime.queryspecification"> | ||
8 | <group group="org.eclipse.viatra.query.runtime.extensibility.SingletonExtensionFactory:modes3.queries.Modes3Queries" id="modes3.queries.Modes3Queries"> | ||
9 | <query-specification fqn="modes3.queries.turnoutInSegments"/> | ||
10 | <query-specification fqn="modes3.queries.connectedTo"/> | ||
11 | <query-specification fqn="modes3.queries.connectedToNotSymmetric"/> | ||
12 | <query-specification fqn="modes3.queries.connectedToReflexive"/> | ||
13 | <query-specification fqn="modes3.queries.turnoutOutput"/> | ||
14 | <query-specification fqn="modes3.queries.outputReflexive"/> | ||
15 | <query-specification fqn="modes3.queries.turnoutOutputsAreSame"/> | ||
16 | <query-specification fqn="modes3.queries.turnout"/> | ||
17 | <query-specification fqn="modes3.queries.output"/> | ||
18 | <query-specification fqn="modes3.queries.tooManyInputsOfSegment"/> | ||
19 | <query-specification fqn="modes3.queries.turnoutConnectedToBothOutputs"/> | ||
20 | <query-specification fqn="modes3.queries.extraInputOfTurnout"/> | ||
21 | <query-specification fqn="modes3.queries.noExtraInputOfTurnout"/> | ||
22 | <query-specification fqn="modes3.queries.tooManyExtraInputsOfTurnout"/> | ||
23 | <query-specification fqn="modes3.queries.adjacent"/> | ||
24 | <query-specification fqn="modes3.queries.reachable"/> | ||
25 | <query-specification fqn="modes3.queries.unreachable"/> | ||
26 | </group> | ||
27 | </extension> | ||
28 | </plugin> | ||
diff --git a/Domains/ca.mcgill.rtgmrt.example.modes3/src/modes3/queries/Modes3Queries.vql b/Domains/ca.mcgill.rtgmrt.example.modes3/src/modes3/queries/Modes3Queries.vql new file mode 100644 index 00000000..982e6cec --- /dev/null +++ b/Domains/ca.mcgill.rtgmrt.example.modes3/src/modes3/queries/Modes3Queries.vql | |||
@@ -0,0 +1,112 @@ | |||
1 | package modes3.queries | ||
2 | |||
3 | import "http://www.ece.mcgill.ca/wcet/modes3" | ||
4 | |||
5 | @Constraint(message = "turnoutInSegments", severity = "error", key = { T }) | ||
6 | pattern turnoutInSegments(T : Turnout) { | ||
7 | Modes3ModelRoot.segments(_, T); | ||
8 | } | ||
9 | |||
10 | pattern connectedTo(S1 : Segment, S2 : Segment) { | ||
11 | Segment.connectedTo(S1, S2); | ||
12 | } | ||
13 | |||
14 | @Constraint(message = "connectedToNotSymmetric", severity = "error", key = { S1, S2 }) | ||
15 | pattern connectedToNotSymmetric(S1 : Segment, S2 : Segment) { | ||
16 | Segment.connectedTo(S1, S2); | ||
17 | neg find connectedTo(S2, S1); | ||
18 | } | ||
19 | |||
20 | @Constraint(message = "connectedToReflexive", severity = "error", key = { S }) | ||
21 | pattern connectedToReflexive(S : Segment) { | ||
22 | Segment.connectedTo(S, S); | ||
23 | } | ||
24 | |||
25 | pattern turnoutOutput(T : Turnout, S : Segment) { | ||
26 | Turnout.straight(T, S); | ||
27 | } or { | ||
28 | Turnout.divergent(T, S); | ||
29 | } | ||
30 | |||
31 | @Constraint(message = "outputReflexive", severity = "error", key = { T }) | ||
32 | pattern outputReflexive(T : Turnout) { | ||
33 | find turnoutOutput(T, T); | ||
34 | } | ||
35 | |||
36 | @Constraint(message = "turnoutOutputsAreSame", severity = "error", key = { T }) | ||
37 | pattern turnoutOutputsAreSame(T : Turnout) { | ||
38 | Turnout.straight(T, S); | ||
39 | Turnout.divergent(T, S); | ||
40 | } | ||
41 | |||
42 | pattern turnout(T : Turnout) { | ||
43 | Turnout(T); | ||
44 | } | ||
45 | |||
46 | pattern output(S1 : Segment, S2 : Segment) { | ||
47 | Segment.connectedTo(S1, S2); | ||
48 | } or { | ||
49 | find turnoutOutput(S1, S2); | ||
50 | } | ||
51 | |||
52 | //@Constraint(message = "noInputOfSegment", severity = "error", key = { S }) | ||
53 | //pattern noInputOfSegment(S : Segment) { | ||
54 | // neg find turnout(S); | ||
55 | // neg find output(_, S); | ||
56 | //} | ||
57 | |||
58 | @Constraint(message = "tooManyInputsOfSegment", severity = "error", key = { S }) | ||
59 | pattern tooManyInputsOfSegment(S : Segment) { | ||
60 | neg find turnout(S); | ||
61 | find output(I1, S); | ||
62 | find output(I2, S); | ||
63 | find output(I3, S); | ||
64 | I1 != I2; | ||
65 | I1 != I3; | ||
66 | I2 != I3; | ||
67 | } | ||
68 | |||
69 | @Constraint(message = "turnoutConnectedToBothOutputs", severity = "error", key = { T }) | ||
70 | pattern turnoutConnectedToBothOutputs(T : Turnout) { | ||
71 | Turnout.straight(T, Straight); | ||
72 | Turnout.divergent(T, Divergent); | ||
73 | Segment.connectedTo(T, Straight); | ||
74 | Segment.connectedTo(T, Divergent); | ||
75 | } | ||
76 | |||
77 | pattern extraInputOfTurnout(T : Turnout, S : Segment) { | ||
78 | Turnout.straight(T, Straight); | ||
79 | Turnout.divergent(T, Divergent); | ||
80 | find output(S, T); | ||
81 | S != Straight; | ||
82 | S != Divergent; | ||
83 | } | ||
84 | |||
85 | @Constraint(message = "noExtraInputOfTurnout", severity = "error", key = { T }) | ||
86 | pattern noExtraInputOfTurnout(T : Turnout) { | ||
87 | neg find extraInputOfTurnout(T, _); | ||
88 | } | ||
89 | |||
90 | @Constraint(message = "tooManyExtraInputsOfTurnout", severity = "error", key = { T }) | ||
91 | pattern tooManyExtraInputsOfTurnout(T : Turnout) { | ||
92 | find extraInputOfTurnout(T, I1); | ||
93 | find extraInputOfTurnout(T, I2); | ||
94 | I1 != I2; | ||
95 | } | ||
96 | |||
97 | pattern adjacent(S1 : Segment, S2 : Segment) { | ||
98 | find output(S1, S2); | ||
99 | } or { | ||
100 | find turnoutOutput(S2, S1); | ||
101 | } | ||
102 | |||
103 | pattern reachable(S1 : Segment, S2 : Segment) { | ||
104 | S1 == S2; | ||
105 | } or { | ||
106 | find adjacent+(S1, S2); | ||
107 | } | ||
108 | |||
109 | @Constraint(message = "unreachable", severity = "error", key = { S1, S2 }) | ||
110 | pattern unreachable(S1 : Segment, S2 : Segment) { | ||
111 | neg find reachable(S1, S2); | ||
112 | } | ||
diff --git a/Domains/ca.mcgill.rtgmrt.example.modes3/src/modes3/run/Modes3ModelGenerator.xtend b/Domains/ca.mcgill.rtgmrt.example.modes3/src/modes3/run/Modes3ModelGenerator.xtend new file mode 100644 index 00000000..71d1798f --- /dev/null +++ b/Domains/ca.mcgill.rtgmrt.example.modes3/src/modes3/run/Modes3ModelGenerator.xtend | |||
@@ -0,0 +1,222 @@ | |||
1 | package modes3.run | ||
2 | |||
3 | import com.google.common.collect.ImmutableList | ||
4 | import com.google.common.collect.ImmutableSet | ||
5 | import hu.bme.mit.inf.dslreasoner.ecore2logic.EReferenceMapper_RelationsOverTypes_Trace | ||
6 | import hu.bme.mit.inf.dslreasoner.ecore2logic.Ecore2Logic | ||
7 | import hu.bme.mit.inf.dslreasoner.ecore2logic.Ecore2LogicConfiguration | ||
8 | import hu.bme.mit.inf.dslreasoner.ecore2logic.EcoreMetamodelDescriptor | ||
9 | import hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.Ecore2logicannotationsFactory | ||
10 | import hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.Ecore2logicannotationsPackage | ||
11 | import hu.bme.mit.inf.dslreasoner.logic.model.builder.LogicProblemBuilder | ||
12 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.LogiclanguagePackage | ||
13 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.TypeDefinition | ||
14 | import hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.LogicproblemPackage | ||
15 | import hu.bme.mit.inf.dslreasoner.logic.model.logicresult.ModelResult | ||
16 | import hu.bme.mit.inf.dslreasoner.viatra2logic.Viatra2Logic | ||
17 | import hu.bme.mit.inf.dslreasoner.viatra2logic.Viatra2LogicConfiguration | ||
18 | import hu.bme.mit.inf.dslreasoner.viatra2logic.ViatraQuerySetDescriptor | ||
19 | import hu.bme.mit.inf.dslreasoner.viatra2logic.viatra2logicannotations.Viatra2LogicAnnotationsPackage | ||
20 | import hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.TypeInferenceMethod | ||
21 | import hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.cardinality.PolyhedralScopePropagatorConstraints | ||
22 | import hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.cardinality.PolyhedralScopePropagatorSolver | ||
23 | import hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.cardinality.ScopePropagatorStrategy | ||
24 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretation2logic.InstanceModel2Logic | ||
25 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.PartialComplexTypeInterpretation | ||
26 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.PartialInterpretation | ||
27 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.PartialinterpretationPackage | ||
28 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.visualisation.PartialInterpretation2Gml | ||
29 | import hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner.StateCoderStrategy | ||
30 | import hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner.ViatraReasoner | ||
31 | import hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner.ViatraReasonerConfiguration | ||
32 | import hu.bme.mit.inf.dslreasoner.visualisation.pi2graphviz.GraphvizVisualiser | ||
33 | import hu.bme.mit.inf.dslreasoner.workspace.FileSystemWorkspace | ||
34 | import java.util.List | ||
35 | import modes3.Modes3Factory | ||
36 | import modes3.Modes3Package | ||
37 | import modes3.queries.Modes3Queries | ||
38 | import org.eclipse.emf.ecore.EClass | ||
39 | import org.eclipse.emf.ecore.EObject | ||
40 | import org.eclipse.emf.ecore.resource.Resource | ||
41 | import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl | ||
42 | import org.eclipse.viatra.query.patternlanguage.emf.EMFPatternLanguageStandaloneSetup | ||
43 | import org.eclipse.viatra.query.runtime.api.ViatraQueryEngineOptions | ||
44 | import org.eclipse.viatra.query.runtime.localsearch.matcher.integration.LocalSearchEMFBackendFactory | ||
45 | import org.eclipse.viatra.query.runtime.rete.matcher.ReteBackendFactory | ||
46 | import org.eclipse.xtend.lib.annotations.FinalFieldsConstructor | ||
47 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.RelationDefinition | ||
48 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.BinaryElementRelationLink | ||
49 | |||
50 | @FinalFieldsConstructor | ||
51 | class Modes3ModelGenerator { | ||
52 | val MonitoringQuery monitoringQuery | ||
53 | val int modelSize | ||
54 | |||
55 | val ecore2Logic = new Ecore2Logic | ||
56 | val instanceModel2Logic = new InstanceModel2Logic | ||
57 | val viatra2Logic = new Viatra2Logic(ecore2Logic) | ||
58 | val solver = new ViatraReasoner | ||
59 | extension val LogicProblemBuilder = new LogicProblemBuilder | ||
60 | |||
61 | def generate() { | ||
62 | val metamodel = createMetamodelDescriptor() | ||
63 | val metamodelLogic = ecore2Logic.transformMetamodel(metamodel, new Ecore2LogicConfiguration) | ||
64 | val segment = ecore2Logic.TypeofEClass(metamodelLogic.trace, Modes3Package.eINSTANCE.segment) | ||
65 | val connectedTo = ecore2Logic.relationOfReference(metamodelLogic.trace, | ||
66 | Modes3Package.eINSTANCE.segment_ConnectedTo) | ||
67 | val connectedToIndicator = (metamodelLogic.trace. | ||
68 | referenceMapperTrace as EReferenceMapper_RelationsOverTypes_Trace).indicators.get( | ||
69 | Modes3Package.eINSTANCE.segment_ConnectedTo) | ||
70 | val inverseAssertion = Assertion( | ||
71 | '''oppositeReference «connectedTo.name» «connectedTo.name»''', | ||
72 | Forall[ | ||
73 | val src = addVar('''src''', segment) | ||
74 | val trg = addVar('''trg''', segment) | ||
75 | connectedToIndicator.call(src, trg) <=> connectedToIndicator.call(trg, src) | ||
76 | ] | ||
77 | ) | ||
78 | metamodelLogic.output.assertions += inverseAssertion | ||
79 | val inverseAnnotation = Ecore2logicannotationsFactory.eINSTANCE.createInverseRelationAssertion => [ | ||
80 | target = inverseAssertion | ||
81 | inverseA = connectedTo | ||
82 | inverseB = connectedTo | ||
83 | ] | ||
84 | metamodelLogic.output.annotations += inverseAnnotation | ||
85 | val initialModel = loadInitialModel() | ||
86 | val initialModelLogic = instanceModel2Logic.transform(metamodelLogic, initialModel) | ||
87 | val queries = loadQueries | ||
88 | val logic = viatra2Logic.transformQueries(queries, initialModelLogic, new Viatra2LogicConfiguration) | ||
89 | val config = new ViatraReasonerConfiguration => [ | ||
90 | runtimeLimit = 3600 | ||
91 | typeScopes => [ | ||
92 | minNewElements = modelSize | ||
93 | maxNewElements = modelSize | ||
94 | minNewElementsByType => [ | ||
95 | put(ecore2Logic.TypeofEClass(metamodelLogic.trace, Modes3Package.eINSTANCE.turnout), 1) | ||
96 | ] | ||
97 | maxNewElementsByType => [ | ||
98 | put(ecore2Logic.TypeofEClass(metamodelLogic.trace, Modes3Package.eINSTANCE.train), 5) | ||
99 | ] | ||
100 | ] | ||
101 | solutionScope.numberOfRequiredSolutions = 1 | ||
102 | nameNewElements = false | ||
103 | typeInferenceMethod = TypeInferenceMethod.PreliminaryAnalysis | ||
104 | stateCoderStrategy = StateCoderStrategy::Neighbourhood | ||
105 | scopePropagatorStrategy = new ScopePropagatorStrategy.Polyhedral( | ||
106 | PolyhedralScopePropagatorConstraints.Relational, PolyhedralScopePropagatorSolver.Clp) | ||
107 | // unitPropagationPatternGenerators += new Modes3UnitPropagationGenerator(ecore2Logic, metamodelLogic.trace) | ||
108 | debugConfiguration.partialInterpretatioVisualiser = null | ||
109 | ] | ||
110 | val workspace = new FileSystemWorkspace("output/", "") | ||
111 | val solution = solver.solve(logic.output, config, workspace) | ||
112 | if (solution instanceof ModelResult) { | ||
113 | println("Saving generated solutions") | ||
114 | val representations = solution.representation | ||
115 | for (representationIndex : 0 ..< representations.size) { | ||
116 | val representation = representations.get(representationIndex) | ||
117 | val representationNumber = representationIndex + 1 | ||
118 | if (representation instanceof PartialInterpretation) { | ||
119 | workspace.writeModel(representation, '''solution«representationNumber».partialinterpretation''') | ||
120 | val partialInterpretation2GML = new PartialInterpretation2Gml | ||
121 | val gml = partialInterpretation2GML.transform(representation) | ||
122 | workspace.writeText('''solution«representationNumber».gml''', gml) | ||
123 | if (representation.newElements.size < 160) { | ||
124 | if (representation instanceof PartialInterpretation) { | ||
125 | representation.problem.types.forEach[println(name)] | ||
126 | val rootType = (representation.problem.types.findFirst [ | ||
127 | name == "Modes3ModelRoot class DefinedPart" | ||
128 | ] as TypeDefinition) | ||
129 | val rootIntepretation = representation.partialtypeinterpratation.filter( | ||
130 | PartialComplexTypeInterpretation).findFirst [ | ||
131 | interpretationOf.name == "Modes3ModelRoot class" | ||
132 | ] | ||
133 | rootIntepretation.elements.removeAll(rootType.elements) | ||
134 | representation.problem.elements.removeAll(rootType.elements) | ||
135 | for (relationInterpretation : representation.partialrelationinterpretation) { | ||
136 | relationInterpretation.relationlinks.removeIf [ link | | ||
137 | if (link instanceof BinaryElementRelationLink) { | ||
138 | rootType.elements.contains(link.param1) || rootType.elements.contains(link.param2) | ||
139 | } else { | ||
140 | false | ||
141 | } | ||
142 | ] | ||
143 | } | ||
144 | rootType.elements.clear | ||
145 | } | ||
146 | val visualiser = new GraphvizVisualiser | ||
147 | val visualisation = visualiser.visualiseConcretization(representation) | ||
148 | visualisation.writeToFile(workspace, '''solution«representationNumber».png''') | ||
149 | } | ||
150 | } else { | ||
151 | workspace.writeText('''solution«representationNumber».txt''', representation.toString) | ||
152 | } | ||
153 | } | ||
154 | } else { | ||
155 | println("Failed to solver problem") | ||
156 | val partial = logic.output | ||
157 | workspace.writeModel(partial, "solution.partialinterpretation") | ||
158 | } | ||
159 | } | ||
160 | |||
161 | static def createMetamodelDescriptor() { | ||
162 | val eClasses = ImmutableList.copyOf(Modes3Package.eINSTANCE.EClassifiers.filter(EClass)) | ||
163 | new EcoreMetamodelDescriptor( | ||
164 | eClasses, | ||
165 | emptySet, | ||
166 | false, | ||
167 | emptyList, | ||
168 | emptyList, | ||
169 | ImmutableList.copyOf(eClasses.flatMap[EReferences]), | ||
170 | emptyList | ||
171 | ) | ||
172 | } | ||
173 | |||
174 | static def List<EObject> loadInitialModel() { | ||
175 | #[Modes3Factory.eINSTANCE.createModes3ModelRoot] | ||
176 | } | ||
177 | |||
178 | def loadQueries() { | ||
179 | val patternsBuilder = ImmutableList.builder | ||
180 | patternsBuilder.addAll(Modes3Queries.instance.specifications) | ||
181 | val patterns = patternsBuilder.build | ||
182 | val validationPatterns = ImmutableSet.copyOf(patterns.filter [ pattern | | ||
183 | pattern.allAnnotations.exists[name == "Constraint"] | ||
184 | ]) | ||
185 | new ViatraQuerySetDescriptor( | ||
186 | patterns, | ||
187 | validationPatterns, | ||
188 | emptyMap | ||
189 | ) | ||
190 | } | ||
191 | |||
192 | def static init() { | ||
193 | EMFPatternLanguageStandaloneSetup.doSetup | ||
194 | ViatraQueryEngineOptions.setSystemDefaultBackends(ReteBackendFactory.INSTANCE, ReteBackendFactory.INSTANCE, | ||
195 | LocalSearchEMFBackendFactory.INSTANCE) | ||
196 | LogiclanguagePackage.eINSTANCE.class | ||
197 | LogicproblemPackage.eINSTANCE.class | ||
198 | PartialinterpretationPackage.eINSTANCE.class | ||
199 | Ecore2logicannotationsPackage.eINSTANCE.class | ||
200 | Viatra2LogicAnnotationsPackage.eINSTANCE.class | ||
201 | Resource.Factory.Registry.INSTANCE.extensionToFactoryMap.put("ecore", new XMIResourceFactoryImpl) | ||
202 | Resource.Factory.Registry.INSTANCE.extensionToFactoryMap.put("logicproblem", new XMIResourceFactoryImpl) | ||
203 | Resource.Factory.Registry.INSTANCE.extensionToFactoryMap.put("partialinterpretation", | ||
204 | new XMIResourceFactoryImpl) | ||
205 | } | ||
206 | |||
207 | def static void main(String[] args) { | ||
208 | if (args.length != 2) { | ||
209 | System.err.println("Usage: <query> <model size>") | ||
210 | } | ||
211 | val monitoringQuery = MonitoringQuery.valueOf(args.get(0)) | ||
212 | val modelSize = Integer.parseInt(args.get(1)) | ||
213 | init() | ||
214 | val generator = new Modes3ModelGenerator(monitoringQuery, modelSize) | ||
215 | generator.generate() | ||
216 | } | ||
217 | |||
218 | private static enum MonitoringQuery { | ||
219 | closeTrains, | ||
220 | misalignedTurnout | ||
221 | } | ||
222 | } | ||
diff --git a/Domains/ca.mcgill.rtgmrt.example.modes3/src/modes3/run/Modes3UnitPropagationGenerator.xtend b/Domains/ca.mcgill.rtgmrt.example.modes3/src/modes3/run/Modes3UnitPropagationGenerator.xtend new file mode 100644 index 00000000..61bd2814 --- /dev/null +++ b/Domains/ca.mcgill.rtgmrt.example.modes3/src/modes3/run/Modes3UnitPropagationGenerator.xtend | |||
@@ -0,0 +1,205 @@ | |||
1 | package modes3.run | ||
2 | |||
3 | import hu.bme.mit.inf.dslreasoner.ecore2logic.Ecore2Logic | ||
4 | import hu.bme.mit.inf.dslreasoner.ecore2logic.Ecore2Logic_Trace | ||
5 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Relation | ||
6 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Type | ||
7 | import hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.Modality | ||
8 | import hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.patterns.PatternGenerator | ||
9 | import hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.patterns.UnitPropagationPatternGenerator | ||
10 | import java.util.Map | ||
11 | import modes3.Modes3Package | ||
12 | import modes3.queries.ExtraInputOfTurnout | ||
13 | import modes3.queries.Output | ||
14 | import modes3.queries.TurnoutOutput | ||
15 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PQuery | ||
16 | import org.eclipse.xtend2.lib.StringConcatenationClient | ||
17 | |||
18 | class Modes3UnitPropagationGenerator implements UnitPropagationPatternGenerator { | ||
19 | static val MUST_NOT_CONNECTED_TO = "mustNotConnectedTo" | ||
20 | static val MUST_NOT_CONNECTED_TO_HELPER = "mustNotConnectedTo_helper" | ||
21 | static val MUST_NOT_TURNOUT_OUTPUT = "mustNotTurnoutOutput" | ||
22 | static val MUST_NOT_STRAIGHT = "mustNotStraight" | ||
23 | static val MUST_NOT_DIVERGENT = "mustNotDivergent" | ||
24 | |||
25 | val Type segmentType | ||
26 | val Type turnoutType | ||
27 | val Relation connectedToRelation | ||
28 | val Relation straightRelation | ||
29 | val Relation divergentRelation | ||
30 | |||
31 | new(extension Ecore2Logic ecore2Logic, Ecore2Logic_Trace ecore2LogicTrace) { | ||
32 | extension val Modes3Package = Modes3Package.eINSTANCE | ||
33 | segmentType = ecore2LogicTrace.TypeofEClass(segment) | ||
34 | turnoutType = ecore2LogicTrace.TypeofEClass(turnout) | ||
35 | connectedToRelation = ecore2LogicTrace.relationOfReference(segment_ConnectedTo) | ||
36 | straightRelation = ecore2LogicTrace.relationOfReference(turnout_Straight) | ||
37 | divergentRelation = ecore2LogicTrace.relationOfReference(turnout_Divergent) | ||
38 | } | ||
39 | |||
40 | override getMustPatterns() { | ||
41 | emptyMap | ||
42 | } | ||
43 | |||
44 | override getMustNotPatterns() { | ||
45 | #{ | ||
46 | connectedToRelation -> MUST_NOT_CONNECTED_TO, | ||
47 | straightRelation -> MUST_NOT_STRAIGHT, | ||
48 | divergentRelation -> MUST_NOT_DIVERGENT | ||
49 | } | ||
50 | } | ||
51 | |||
52 | override getAdditionalPatterns(extension PatternGenerator generator, Map<String, PQuery> fqnToPQuery) { | ||
53 | val StringConcatenationClient parameters = ''' | ||
54 | problem: LogicProblem, interpretation: PartialInterpretation, | ||
55 | source: DefinedElement, target: DefinedElement | ||
56 | ''' | ||
57 | |||
58 | val StringConcatenationClient commonParameterConstraints = ''' | ||
59 | find interpretation(problem, interpretation); | ||
60 | find mustExist(problem, interpretation, source); | ||
61 | find mustExist(problem, interpretation, target); | ||
62 | ''' | ||
63 | |||
64 | ''' | ||
65 | pattern «MUST_NOT_CONNECTED_TO_HELPER»(«parameters») { | ||
66 | // connectedToReflexive unit propagation | ||
67 | «commonParameterConstraints» | ||
68 | «typeIndexer.referInstanceOf(segmentType, Modality.MUST, "source")» | ||
69 | «typeIndexer.referInstanceOf(segmentType, Modality.MUST, "target")» | ||
70 | source == target; | ||
71 | } or { | ||
72 | // tooManyInputsOfSegment unit propagation | ||
73 | «commonParameterConstraints» | ||
74 | «typeIndexer.referInstanceOf(segmentType, Modality.MUST, "source")» | ||
75 | «typeIndexer.referInstanceOf(segmentType, Modality.MUST, "target")» | ||
76 | «typeIndexer.referInstanceOf(segmentType, Modality.MUST, "input1")» | ||
77 | «typeIndexer.referInstanceOf(segmentType, Modality.MUST, "input2")» | ||
78 | neg «typeIndexer.referInstanceOf(turnoutType, Modality.MAY, "source")» | ||
79 | «relationDefinitionIndexer.referPattern(fqnToPQuery.get(Output.instance.fullyQualifiedName), #["input1", "source"], Modality.MUST, true, false)» | ||
80 | «relationDefinitionIndexer.referPattern(fqnToPQuery.get(Output.instance.fullyQualifiedName), #["input2", "source"], Modality.MUST, true, false)» | ||
81 | input1 != input2; | ||
82 | input1 != target; | ||
83 | input2 != target; | ||
84 | } or { | ||
85 | // turnoutConnectedToBothOutputs unit propagation 1 | ||
86 | «commonParameterConstraints» | ||
87 | «typeIndexer.referInstanceOf(turnoutType, Modality.MUST, "source")» | ||
88 | «typeIndexer.referInstanceOf(segmentType, Modality.MUST, "target")» | ||
89 | «typeIndexer.referInstanceOf(segmentType, Modality.MUST, "divergent")» | ||
90 | «referRelation(straightRelation, "source", "target", Modality.MUST, fqnToPQuery)» | ||
91 | «referRelation(divergentRelation, "source", "divergent", Modality.MUST, fqnToPQuery)» | ||
92 | «referRelation(connectedToRelation, "source", "divergent", Modality.MUST, fqnToPQuery)» | ||
93 | } or { | ||
94 | // turnoutConnectedToBothOutputs unit propagation 2 | ||
95 | «commonParameterConstraints» | ||
96 | «typeIndexer.referInstanceOf(turnoutType, Modality.MUST, "source")» | ||
97 | «typeIndexer.referInstanceOf(segmentType, Modality.MUST, "target")» | ||
98 | «typeIndexer.referInstanceOf(segmentType, Modality.MUST, "straight")» | ||
99 | «referRelation(straightRelation, "source", "straight", Modality.MUST, fqnToPQuery)» | ||
100 | «referRelation(divergentRelation, "source", "target", Modality.MUST, fqnToPQuery)» | ||
101 | «referRelation(connectedToRelation, "source", "straight", Modality.MUST, fqnToPQuery)» | ||
102 | } or { | ||
103 | // tooManyExtraInputsOfTurnout unit propagation | ||
104 | «commonParameterConstraints» | ||
105 | «typeIndexer.referInstanceOf(turnoutType, Modality.MUST, "source")» | ||
106 | «typeIndexer.referInstanceOf(segmentType, Modality.MUST, "target")» | ||
107 | «typeIndexer.referInstanceOf(segmentType, Modality.MUST, "extraInput")» | ||
108 | «relationDefinitionIndexer.referPattern(fqnToPQuery.get(TurnoutOutput.instance.fullyQualifiedName), #["source", "target"], Modality.MAY, false, false)» | ||
109 | «relationDefinitionIndexer.referPattern(fqnToPQuery.get(ExtraInputOfTurnout.instance.fullyQualifiedName), #["source", "extraInput"], Modality.MUST, true, false)» | ||
110 | target != extraInput; | ||
111 | } | ||
112 | |||
113 | pattern «MUST_NOT_CONNECTED_TO»(«parameters») { | ||
114 | find «MUST_NOT_CONNECTED_TO_HELPER»(problem, interpretation, source, target); | ||
115 | } or { | ||
116 | find «MUST_NOT_CONNECTED_TO_HELPER»(problem, interpretation, target, source); | ||
117 | } | ||
118 | |||
119 | pattern «MUST_NOT_TURNOUT_OUTPUT»(«parameters») { | ||
120 | // outputReflexive unit propagation | ||
121 | «commonParameterConstraints» | ||
122 | «typeIndexer.referInstanceOf(turnoutType, Modality.MUST, "source")» | ||
123 | «typeIndexer.referInstanceOf(turnoutType, Modality.MUST, "target")» | ||
124 | source == target; | ||
125 | } or { | ||
126 | // tooManyInputsOfSegment unit propagation | ||
127 | «commonParameterConstraints» | ||
128 | «typeIndexer.referInstanceOf(turnoutType, Modality.MUST, "source")» | ||
129 | «typeIndexer.referInstanceOf(segmentType, Modality.MUST, "target")» | ||
130 | «typeIndexer.referInstanceOf(segmentType, Modality.MUST, "input1")» | ||
131 | «typeIndexer.referInstanceOf(segmentType, Modality.MUST, "input2")» | ||
132 | neg «typeIndexer.referInstanceOf(turnoutType, Modality.MAY, "target")» | ||
133 | «relationDefinitionIndexer.referPattern(fqnToPQuery.get(Output.instance.fullyQualifiedName), #["input1", "target"], Modality.MUST, true, false)» | ||
134 | «relationDefinitionIndexer.referPattern(fqnToPQuery.get(Output.instance.fullyQualifiedName), #["input2", "target"], Modality.MUST, true, false)» | ||
135 | input1 != input2; | ||
136 | input1 != source; | ||
137 | input2 != source; | ||
138 | } | ||
139 | |||
140 | pattern «MUST_NOT_STRAIGHT»(«parameters») { | ||
141 | find «MUST_NOT_TURNOUT_OUTPUT»(problem, interpretation, source, target); | ||
142 | } or { | ||
143 | // turnoutOutputsAreSame unit propagation | ||
144 | «commonParameterConstraints» | ||
145 | «typeIndexer.referInstanceOf(turnoutType, Modality.MUST, "source")» | ||
146 | «typeIndexer.referInstanceOf(segmentType, Modality.MUST, "target")» | ||
147 | «referRelation(divergentRelation, "source", "target", Modality.MUST, fqnToPQuery)» | ||
148 | } or { | ||
149 | // turnoutConnectedToBothOutputs unit propagation | ||
150 | «commonParameterConstraints» | ||
151 | «typeIndexer.referInstanceOf(turnoutType, Modality.MUST, "source")» | ||
152 | «typeIndexer.referInstanceOf(segmentType, Modality.MUST, "target")» | ||
153 | «typeIndexer.referInstanceOf(turnoutType, Modality.MUST, "divergent")» | ||
154 | «referRelation(connectedToRelation, "source", "target", Modality.MUST, fqnToPQuery)» | ||
155 | «referRelation(divergentRelation, "source", "divergent", Modality.MUST, fqnToPQuery)» | ||
156 | «referRelation(connectedToRelation, "source", "divergent", Modality.MUST, fqnToPQuery)» | ||
157 | } or { | ||
158 | // tooManyExtraInputsOfTurnout unit propagation | ||
159 | «commonParameterConstraints» | ||
160 | «typeIndexer.referInstanceOf(turnoutType, Modality.MUST, "source")» | ||
161 | «typeIndexer.referInstanceOf(segmentType, Modality.MUST, "target")» | ||
162 | «typeIndexer.referInstanceOf(segmentType, Modality.MUST, "extraInput")» | ||
163 | «typeIndexer.referInstanceOf(segmentType, Modality.MUST, "potentialExtraInput")» | ||
164 | «relationDefinitionIndexer.referPattern(fqnToPQuery.get(ExtraInputOfTurnout.instance.fullyQualifiedName), #["source", "extraInput"], Modality.MUST, true, false)» | ||
165 | «referRelation(connectedToRelation, "source", "potentialExtraInput", Modality.MUST, fqnToPQuery)» | ||
166 | neg «referRelation(divergentRelation, "source", "potentialExtraInput", Modality.MAY, fqnToPQuery)» | ||
167 | extraInput != potentialExtraInput; | ||
168 | extraInput != target; | ||
169 | potentialExtraInput != target; | ||
170 | } | ||
171 | |||
172 | pattern «MUST_NOT_DIVERGENT»(«parameters») { | ||
173 | find «MUST_NOT_TURNOUT_OUTPUT»(problem, interpretation, source, target); | ||
174 | } or { | ||
175 | // turnoutOutputsAreSame unit propagation | ||
176 | «commonParameterConstraints» | ||
177 | «typeIndexer.referInstanceOf(turnoutType, Modality.MUST, "source")» | ||
178 | «typeIndexer.referInstanceOf(segmentType, Modality.MUST, "target")» | ||
179 | «referRelation(straightRelation, "source", "target", Modality.MUST, fqnToPQuery)» | ||
180 | } or { | ||
181 | // turnoutConnectedToBothOutputs unit propagation | ||
182 | «commonParameterConstraints» | ||
183 | «typeIndexer.referInstanceOf(turnoutType, Modality.MUST, "source")» | ||
184 | «typeIndexer.referInstanceOf(segmentType, Modality.MUST, "target")» | ||
185 | «typeIndexer.referInstanceOf(turnoutType, Modality.MUST, "straight")» | ||
186 | «referRelation(connectedToRelation, "source", "target", Modality.MUST, fqnToPQuery)» | ||
187 | «referRelation(straightRelation, "source", "straight", Modality.MUST, fqnToPQuery)» | ||
188 | «referRelation(connectedToRelation, "source", "straight", Modality.MUST, fqnToPQuery)» | ||
189 | } or { | ||
190 | // tooManyExtraInputsOfTurnout unit propagation | ||
191 | «commonParameterConstraints» | ||
192 | «typeIndexer.referInstanceOf(turnoutType, Modality.MUST, "source")» | ||
193 | «typeIndexer.referInstanceOf(segmentType, Modality.MUST, "target")» | ||
194 | «typeIndexer.referInstanceOf(segmentType, Modality.MUST, "extraInput")» | ||
195 | «typeIndexer.referInstanceOf(segmentType, Modality.MUST, "potentialExtraInput")» | ||
196 | «relationDefinitionIndexer.referPattern(fqnToPQuery.get(ExtraInputOfTurnout.instance.fullyQualifiedName), #["source", "extraInput"], Modality.MUST, true, false)» | ||
197 | «referRelation(connectedToRelation, "source", "potentialExtraInput", Modality.MUST, fqnToPQuery)» | ||
198 | neg «referRelation(straightRelation, "source", "potentialExtraInput", Modality.MAY, fqnToPQuery)» | ||
199 | extraInput != potentialExtraInput; | ||
200 | extraInput != target; | ||
201 | potentialExtraInput != target; | ||
202 | } | ||
203 | ''' | ||
204 | } | ||
205 | } | ||
diff --git a/Domains/ca.mcgill.rtgmrt.example.modes3/vql-gen/modes3/queries/.gitignore b/Domains/ca.mcgill.rtgmrt.example.modes3/vql-gen/modes3/queries/.gitignore new file mode 100644 index 00000000..e3a0ad7e --- /dev/null +++ b/Domains/ca.mcgill.rtgmrt.example.modes3/vql-gen/modes3/queries/.gitignore | |||
@@ -0,0 +1,26 @@ | |||
1 | /.ConnectedToReflexive.java._trace | ||
2 | /.Modes3Queries.java._trace | ||
3 | /.StraightReflexive.java._trace | ||
4 | /.DivergentReflexive.java._trace | ||
5 | /.TurnoutOutputsAreSame.java._trace | ||
6 | /.Adjacent.java._trace | ||
7 | /.Output.java._trace | ||
8 | /.OutputReflexive.java._trace | ||
9 | /.TooManyAdjacentSegmentsOfSegment.java._trace | ||
10 | /.Turnout.java._trace | ||
11 | /.ConnectedTo.java._trace | ||
12 | /.TurnoutNotConnectedToOutput.java._trace | ||
13 | /.DisjointNetwork.java._trace | ||
14 | /.Reachable.java._trace | ||
15 | /.Unreachable.java._trace | ||
16 | /.TurnoutInSegments.java._trace | ||
17 | /.ConnectedToNotSymmetric.java._trace | ||
18 | /.TurnoutConnectedToBothOutputs.java._trace | ||
19 | /.TooManyAdjacentTurnouts.java._trace | ||
20 | /.NoAdjacentSegmentOfSegment.java._trace | ||
21 | /.TurnoutOutput.java._trace | ||
22 | /.NoInputOfSegment.java._trace | ||
23 | /.TooManyInputsOfSegment.java._trace | ||
24 | /.ExtraInputOfTurnout.java._trace | ||
25 | /.NoExtraInputOfTurnout.java._trace | ||
26 | /.TooManyExtraInputsOfTurnout.java._trace | ||
diff --git a/Domains/ca.mcgill.rtgmrt.example.modes3/vql-gen/modes3/queries/Adjacent.java b/Domains/ca.mcgill.rtgmrt.example.modes3/vql-gen/modes3/queries/Adjacent.java new file mode 100644 index 00000000..e87f9c18 --- /dev/null +++ b/Domains/ca.mcgill.rtgmrt.example.modes3/vql-gen/modes3/queries/Adjacent.java | |||
@@ -0,0 +1,719 @@ | |||
1 | /** | ||
2 | * Generated from platform:/resource/ca.mcgill.rtgmrt.example.modes3/src/modes3/queries/Modes3Queries.vql | ||
3 | */ | ||
4 | package modes3.queries; | ||
5 | |||
6 | import java.util.Arrays; | ||
7 | import java.util.Collection; | ||
8 | import java.util.LinkedHashSet; | ||
9 | import java.util.List; | ||
10 | import java.util.Objects; | ||
11 | import java.util.Optional; | ||
12 | import java.util.Set; | ||
13 | import java.util.function.Consumer; | ||
14 | import java.util.stream.Collectors; | ||
15 | import java.util.stream.Stream; | ||
16 | import modes3.Segment; | ||
17 | import modes3.queries.Output; | ||
18 | import modes3.queries.TurnoutOutput; | ||
19 | import org.apache.log4j.Logger; | ||
20 | import org.eclipse.emf.ecore.EClass; | ||
21 | import org.eclipse.viatra.query.runtime.api.IPatternMatch; | ||
22 | import org.eclipse.viatra.query.runtime.api.IQuerySpecification; | ||
23 | import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; | ||
24 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
25 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; | ||
26 | import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; | ||
27 | import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; | ||
28 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
29 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
30 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
31 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
32 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
33 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.PositivePatternCall; | ||
34 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
35 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
36 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
37 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
38 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; | ||
39 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | ||
40 | import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; | ||
41 | |||
42 | /** | ||
43 | * A pattern-specific query specification that can instantiate Matcher in a type-safe way. | ||
44 | * | ||
45 | * <p>Original source: | ||
46 | * <code><pre> | ||
47 | * pattern adjacent(S1 : Segment, S2 : Segment) { | ||
48 | * find output(S1, S2); | ||
49 | * } or { | ||
50 | * find turnoutOutput(S2, S1); | ||
51 | * } | ||
52 | * </pre></code> | ||
53 | * | ||
54 | * @see Matcher | ||
55 | * @see Match | ||
56 | * | ||
57 | */ | ||
58 | @SuppressWarnings("all") | ||
59 | public final class Adjacent extends BaseGeneratedEMFQuerySpecification<Adjacent.Matcher> { | ||
60 | /** | ||
61 | * Pattern-specific match representation of the modes3.queries.adjacent 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 Segment fS1; | ||
74 | |||
75 | private Segment fS2; | ||
76 | |||
77 | private static List<String> parameterNames = makeImmutableList("S1", "S2"); | ||
78 | |||
79 | private Match(final Segment pS1, final Segment pS2) { | ||
80 | this.fS1 = pS1; | ||
81 | this.fS2 = pS2; | ||
82 | } | ||
83 | |||
84 | @Override | ||
85 | public Object get(final String parameterName) { | ||
86 | switch(parameterName) { | ||
87 | case "S1": return this.fS1; | ||
88 | case "S2": return this.fS2; | ||
89 | default: return null; | ||
90 | } | ||
91 | } | ||
92 | |||
93 | @Override | ||
94 | public Object get(final int index) { | ||
95 | switch(index) { | ||
96 | case 0: return this.fS1; | ||
97 | case 1: return this.fS2; | ||
98 | default: return null; | ||
99 | } | ||
100 | } | ||
101 | |||
102 | public Segment getS1() { | ||
103 | return this.fS1; | ||
104 | } | ||
105 | |||
106 | public Segment getS2() { | ||
107 | return this.fS2; | ||
108 | } | ||
109 | |||
110 | @Override | ||
111 | public boolean set(final String parameterName, final Object newValue) { | ||
112 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
113 | if ("S1".equals(parameterName) ) { | ||
114 | this.fS1 = (Segment) newValue; | ||
115 | return true; | ||
116 | } | ||
117 | if ("S2".equals(parameterName) ) { | ||
118 | this.fS2 = (Segment) newValue; | ||
119 | return true; | ||
120 | } | ||
121 | return false; | ||
122 | } | ||
123 | |||
124 | public void setS1(final Segment pS1) { | ||
125 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
126 | this.fS1 = pS1; | ||
127 | } | ||
128 | |||
129 | public void setS2(final Segment pS2) { | ||
130 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
131 | this.fS2 = pS2; | ||
132 | } | ||
133 | |||
134 | @Override | ||
135 | public String patternName() { | ||
136 | return "modes3.queries.adjacent"; | ||
137 | } | ||
138 | |||
139 | @Override | ||
140 | public List<String> parameterNames() { | ||
141 | return Adjacent.Match.parameterNames; | ||
142 | } | ||
143 | |||
144 | @Override | ||
145 | public Object[] toArray() { | ||
146 | return new Object[]{fS1, fS2}; | ||
147 | } | ||
148 | |||
149 | @Override | ||
150 | public Adjacent.Match toImmutable() { | ||
151 | return isMutable() ? newMatch(fS1, fS2) : this; | ||
152 | } | ||
153 | |||
154 | @Override | ||
155 | public String prettyPrint() { | ||
156 | StringBuilder result = new StringBuilder(); | ||
157 | result.append("\"S1\"=" + prettyPrintValue(fS1) + ", "); | ||
158 | result.append("\"S2\"=" + prettyPrintValue(fS2)); | ||
159 | return result.toString(); | ||
160 | } | ||
161 | |||
162 | @Override | ||
163 | public int hashCode() { | ||
164 | return Objects.hash(fS1, fS2); | ||
165 | } | ||
166 | |||
167 | @Override | ||
168 | public boolean equals(final Object obj) { | ||
169 | if (this == obj) | ||
170 | return true; | ||
171 | if (obj == null) { | ||
172 | return false; | ||
173 | } | ||
174 | if ((obj instanceof Adjacent.Match)) { | ||
175 | Adjacent.Match other = (Adjacent.Match) obj; | ||
176 | return Objects.equals(fS1, other.fS1) && Objects.equals(fS2, other.fS2); | ||
177 | } else { | ||
178 | // this should be infrequent | ||
179 | if (!(obj instanceof IPatternMatch)) { | ||
180 | return false; | ||
181 | } | ||
182 | IPatternMatch otherSig = (IPatternMatch) obj; | ||
183 | return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray()); | ||
184 | } | ||
185 | } | ||
186 | |||
187 | @Override | ||
188 | public Adjacent specification() { | ||
189 | return Adjacent.instance(); | ||
190 | } | ||
191 | |||
192 | /** | ||
193 | * Returns an empty, mutable match. | ||
194 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
195 | * | ||
196 | * @return the empty match. | ||
197 | * | ||
198 | */ | ||
199 | public static Adjacent.Match newEmptyMatch() { | ||
200 | return new Mutable(null, null); | ||
201 | } | ||
202 | |||
203 | /** | ||
204 | * Returns a mutable (partial) match. | ||
205 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
206 | * | ||
207 | * @param pS1 the fixed value of pattern parameter S1, or null if not bound. | ||
208 | * @param pS2 the fixed value of pattern parameter S2, or null if not bound. | ||
209 | * @return the new, mutable (partial) match object. | ||
210 | * | ||
211 | */ | ||
212 | public static Adjacent.Match newMutableMatch(final Segment pS1, final Segment pS2) { | ||
213 | return new Mutable(pS1, pS2); | ||
214 | } | ||
215 | |||
216 | /** | ||
217 | * Returns a new (partial) match. | ||
218 | * This can be used e.g. to call the matcher with a partial match. | ||
219 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
220 | * @param pS1 the fixed value of pattern parameter S1, or null if not bound. | ||
221 | * @param pS2 the fixed value of pattern parameter S2, or null if not bound. | ||
222 | * @return the (partial) match object. | ||
223 | * | ||
224 | */ | ||
225 | public static Adjacent.Match newMatch(final Segment pS1, final Segment pS2) { | ||
226 | return new Immutable(pS1, pS2); | ||
227 | } | ||
228 | |||
229 | private static final class Mutable extends Adjacent.Match { | ||
230 | Mutable(final Segment pS1, final Segment pS2) { | ||
231 | super(pS1, pS2); | ||
232 | } | ||
233 | |||
234 | @Override | ||
235 | public boolean isMutable() { | ||
236 | return true; | ||
237 | } | ||
238 | } | ||
239 | |||
240 | private static final class Immutable extends Adjacent.Match { | ||
241 | Immutable(final Segment pS1, final Segment pS2) { | ||
242 | super(pS1, pS2); | ||
243 | } | ||
244 | |||
245 | @Override | ||
246 | public boolean isMutable() { | ||
247 | return false; | ||
248 | } | ||
249 | } | ||
250 | } | ||
251 | |||
252 | /** | ||
253 | * Generated pattern matcher API of the modes3.queries.adjacent pattern, | ||
254 | * providing pattern-specific query methods. | ||
255 | * | ||
256 | * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)}, | ||
257 | * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}. | ||
258 | * | ||
259 | * <p>Matches of the pattern will be represented as {@link Match}. | ||
260 | * | ||
261 | * <p>Original source: | ||
262 | * <code><pre> | ||
263 | * pattern adjacent(S1 : Segment, S2 : Segment) { | ||
264 | * find output(S1, S2); | ||
265 | * } or { | ||
266 | * find turnoutOutput(S2, S1); | ||
267 | * } | ||
268 | * </pre></code> | ||
269 | * | ||
270 | * @see Match | ||
271 | * @see Adjacent | ||
272 | * | ||
273 | */ | ||
274 | public static class Matcher extends BaseMatcher<Adjacent.Match> { | ||
275 | /** | ||
276 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
277 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
278 | * | ||
279 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
280 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
281 | * | ||
282 | */ | ||
283 | public static Adjacent.Matcher on(final ViatraQueryEngine engine) { | ||
284 | // check if matcher already exists | ||
285 | Matcher matcher = engine.getExistingMatcher(querySpecification()); | ||
286 | if (matcher == null) { | ||
287 | matcher = (Matcher)engine.getMatcher(querySpecification()); | ||
288 | } | ||
289 | return matcher; | ||
290 | } | ||
291 | |||
292 | /** | ||
293 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
294 | * @return an initialized matcher | ||
295 | * @noreference This method is for internal matcher initialization by the framework, do not call it manually. | ||
296 | * | ||
297 | */ | ||
298 | public static Adjacent.Matcher create() { | ||
299 | return new Matcher(); | ||
300 | } | ||
301 | |||
302 | private static final int POSITION_S1 = 0; | ||
303 | |||
304 | private static final int POSITION_S2 = 1; | ||
305 | |||
306 | private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(Adjacent.Matcher.class); | ||
307 | |||
308 | /** | ||
309 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
310 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
311 | * | ||
312 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
313 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
314 | * | ||
315 | */ | ||
316 | private Matcher() { | ||
317 | super(querySpecification()); | ||
318 | } | ||
319 | |||
320 | /** | ||
321 | * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters. | ||
322 | * @param pS1 the fixed value of pattern parameter S1, or null if not bound. | ||
323 | * @param pS2 the fixed value of pattern parameter S2, or null if not bound. | ||
324 | * @return matches represented as a Match object. | ||
325 | * | ||
326 | */ | ||
327 | public Collection<Adjacent.Match> getAllMatches(final Segment pS1, final Segment pS2) { | ||
328 | return rawStreamAllMatches(new Object[]{pS1, pS2}).collect(Collectors.toSet()); | ||
329 | } | ||
330 | |||
331 | /** | ||
332 | * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters. | ||
333 | * </p> | ||
334 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
335 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
336 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
337 | * @param pS1 the fixed value of pattern parameter S1, or null if not bound. | ||
338 | * @param pS2 the fixed value of pattern parameter S2, or null if not bound. | ||
339 | * @return a stream of matches represented as a Match object. | ||
340 | * | ||
341 | */ | ||
342 | public Stream<Adjacent.Match> streamAllMatches(final Segment pS1, final Segment pS2) { | ||
343 | return rawStreamAllMatches(new Object[]{pS1, pS2}); | ||
344 | } | ||
345 | |||
346 | /** | ||
347 | * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
348 | * Neither determinism nor randomness of selection is guaranteed. | ||
349 | * @param pS1 the fixed value of pattern parameter S1, or null if not bound. | ||
350 | * @param pS2 the fixed value of pattern parameter S2, or null if not bound. | ||
351 | * @return a match represented as a Match object, or null if no match is found. | ||
352 | * | ||
353 | */ | ||
354 | public Optional<Adjacent.Match> getOneArbitraryMatch(final Segment pS1, final Segment pS2) { | ||
355 | return rawGetOneArbitraryMatch(new Object[]{pS1, pS2}); | ||
356 | } | ||
357 | |||
358 | /** | ||
359 | * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match, | ||
360 | * under any possible substitution of the unspecified parameters (if any). | ||
361 | * @param pS1 the fixed value of pattern parameter S1, or null if not bound. | ||
362 | * @param pS2 the fixed value of pattern parameter S2, or null if not bound. | ||
363 | * @return true if the input is a valid (partial) match of the pattern. | ||
364 | * | ||
365 | */ | ||
366 | public boolean hasMatch(final Segment pS1, final Segment pS2) { | ||
367 | return rawHasMatch(new Object[]{pS1, pS2}); | ||
368 | } | ||
369 | |||
370 | /** | ||
371 | * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. | ||
372 | * @param pS1 the fixed value of pattern parameter S1, or null if not bound. | ||
373 | * @param pS2 the fixed value of pattern parameter S2, or null if not bound. | ||
374 | * @return the number of pattern matches found. | ||
375 | * | ||
376 | */ | ||
377 | public int countMatches(final Segment pS1, final Segment pS2) { | ||
378 | return rawCountMatches(new Object[]{pS1, pS2}); | ||
379 | } | ||
380 | |||
381 | /** | ||
382 | * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
383 | * Neither determinism nor randomness of selection is guaranteed. | ||
384 | * @param pS1 the fixed value of pattern parameter S1, or null if not bound. | ||
385 | * @param pS2 the fixed value of pattern parameter S2, or null if not bound. | ||
386 | * @param processor the action that will process the selected match. | ||
387 | * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked | ||
388 | * | ||
389 | */ | ||
390 | public boolean forOneArbitraryMatch(final Segment pS1, final Segment pS2, final Consumer<? super Adjacent.Match> processor) { | ||
391 | return rawForOneArbitraryMatch(new Object[]{pS1, pS2}, processor); | ||
392 | } | ||
393 | |||
394 | /** | ||
395 | * Returns a new (partial) match. | ||
396 | * This can be used e.g. to call the matcher with a partial match. | ||
397 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
398 | * @param pS1 the fixed value of pattern parameter S1, or null if not bound. | ||
399 | * @param pS2 the fixed value of pattern parameter S2, or null if not bound. | ||
400 | * @return the (partial) match object. | ||
401 | * | ||
402 | */ | ||
403 | public Adjacent.Match newMatch(final Segment pS1, final Segment pS2) { | ||
404 | return Adjacent.Match.newMatch(pS1, pS2); | ||
405 | } | ||
406 | |||
407 | /** | ||
408 | * Retrieve the set of values that occur in matches for S1. | ||
409 | * @return the Set of all values or empty set if there are no matches | ||
410 | * | ||
411 | */ | ||
412 | protected Stream<Segment> rawStreamAllValuesOfS1(final Object[] parameters) { | ||
413 | return rawStreamAllValues(POSITION_S1, parameters).map(Segment.class::cast); | ||
414 | } | ||
415 | |||
416 | /** | ||
417 | * Retrieve the set of values that occur in matches for S1. | ||
418 | * @return the Set of all values or empty set if there are no matches | ||
419 | * | ||
420 | */ | ||
421 | public Set<Segment> getAllValuesOfS1() { | ||
422 | return rawStreamAllValuesOfS1(emptyArray()).collect(Collectors.toSet()); | ||
423 | } | ||
424 | |||
425 | /** | ||
426 | * Retrieve the set of values that occur in matches for S1. | ||
427 | * @return the Set of all values or empty set if there are no matches | ||
428 | * | ||
429 | */ | ||
430 | public Stream<Segment> streamAllValuesOfS1() { | ||
431 | return rawStreamAllValuesOfS1(emptyArray()); | ||
432 | } | ||
433 | |||
434 | /** | ||
435 | * Retrieve the set of values that occur in matches for S1. | ||
436 | * </p> | ||
437 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
438 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
439 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
440 | * | ||
441 | * @return the Stream of all values or empty set if there are no matches | ||
442 | * | ||
443 | */ | ||
444 | public Stream<Segment> streamAllValuesOfS1(final Adjacent.Match partialMatch) { | ||
445 | return rawStreamAllValuesOfS1(partialMatch.toArray()); | ||
446 | } | ||
447 | |||
448 | /** | ||
449 | * Retrieve the set of values that occur in matches for S1. | ||
450 | * </p> | ||
451 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
452 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
453 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
454 | * | ||
455 | * @return the Stream of all values or empty set if there are no matches | ||
456 | * | ||
457 | */ | ||
458 | public Stream<Segment> streamAllValuesOfS1(final Segment pS2) { | ||
459 | return rawStreamAllValuesOfS1(new Object[]{null, pS2}); | ||
460 | } | ||
461 | |||
462 | /** | ||
463 | * Retrieve the set of values that occur in matches for S1. | ||
464 | * @return the Set of all values or empty set if there are no matches | ||
465 | * | ||
466 | */ | ||
467 | public Set<Segment> getAllValuesOfS1(final Adjacent.Match partialMatch) { | ||
468 | return rawStreamAllValuesOfS1(partialMatch.toArray()).collect(Collectors.toSet()); | ||
469 | } | ||
470 | |||
471 | /** | ||
472 | * Retrieve the set of values that occur in matches for S1. | ||
473 | * @return the Set of all values or empty set if there are no matches | ||
474 | * | ||
475 | */ | ||
476 | public Set<Segment> getAllValuesOfS1(final Segment pS2) { | ||
477 | return rawStreamAllValuesOfS1(new Object[]{null, pS2}).collect(Collectors.toSet()); | ||
478 | } | ||
479 | |||
480 | /** | ||
481 | * Retrieve the set of values that occur in matches for S2. | ||
482 | * @return the Set of all values or empty set if there are no matches | ||
483 | * | ||
484 | */ | ||
485 | protected Stream<Segment> rawStreamAllValuesOfS2(final Object[] parameters) { | ||
486 | return rawStreamAllValues(POSITION_S2, parameters).map(Segment.class::cast); | ||
487 | } | ||
488 | |||
489 | /** | ||
490 | * Retrieve the set of values that occur in matches for S2. | ||
491 | * @return the Set of all values or empty set if there are no matches | ||
492 | * | ||
493 | */ | ||
494 | public Set<Segment> getAllValuesOfS2() { | ||
495 | return rawStreamAllValuesOfS2(emptyArray()).collect(Collectors.toSet()); | ||
496 | } | ||
497 | |||
498 | /** | ||
499 | * Retrieve the set of values that occur in matches for S2. | ||
500 | * @return the Set of all values or empty set if there are no matches | ||
501 | * | ||
502 | */ | ||
503 | public Stream<Segment> streamAllValuesOfS2() { | ||
504 | return rawStreamAllValuesOfS2(emptyArray()); | ||
505 | } | ||
506 | |||
507 | /** | ||
508 | * Retrieve the set of values that occur in matches for S2. | ||
509 | * </p> | ||
510 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
511 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
512 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
513 | * | ||
514 | * @return the Stream of all values or empty set if there are no matches | ||
515 | * | ||
516 | */ | ||
517 | public Stream<Segment> streamAllValuesOfS2(final Adjacent.Match partialMatch) { | ||
518 | return rawStreamAllValuesOfS2(partialMatch.toArray()); | ||
519 | } | ||
520 | |||
521 | /** | ||
522 | * Retrieve the set of values that occur in matches for S2. | ||
523 | * </p> | ||
524 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
525 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
526 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
527 | * | ||
528 | * @return the Stream of all values or empty set if there are no matches | ||
529 | * | ||
530 | */ | ||
531 | public Stream<Segment> streamAllValuesOfS2(final Segment pS1) { | ||
532 | return rawStreamAllValuesOfS2(new Object[]{pS1, null}); | ||
533 | } | ||
534 | |||
535 | /** | ||
536 | * Retrieve the set of values that occur in matches for S2. | ||
537 | * @return the Set of all values or empty set if there are no matches | ||
538 | * | ||
539 | */ | ||
540 | public Set<Segment> getAllValuesOfS2(final Adjacent.Match partialMatch) { | ||
541 | return rawStreamAllValuesOfS2(partialMatch.toArray()).collect(Collectors.toSet()); | ||
542 | } | ||
543 | |||
544 | /** | ||
545 | * Retrieve the set of values that occur in matches for S2. | ||
546 | * @return the Set of all values or empty set if there are no matches | ||
547 | * | ||
548 | */ | ||
549 | public Set<Segment> getAllValuesOfS2(final Segment pS1) { | ||
550 | return rawStreamAllValuesOfS2(new Object[]{pS1, null}).collect(Collectors.toSet()); | ||
551 | } | ||
552 | |||
553 | @Override | ||
554 | protected Adjacent.Match tupleToMatch(final Tuple t) { | ||
555 | try { | ||
556 | return Adjacent.Match.newMatch((Segment) t.get(POSITION_S1), (Segment) t.get(POSITION_S2)); | ||
557 | } catch(ClassCastException e) { | ||
558 | LOGGER.error("Element(s) in tuple not properly typed!",e); | ||
559 | return null; | ||
560 | } | ||
561 | } | ||
562 | |||
563 | @Override | ||
564 | protected Adjacent.Match arrayToMatch(final Object[] match) { | ||
565 | try { | ||
566 | return Adjacent.Match.newMatch((Segment) match[POSITION_S1], (Segment) match[POSITION_S2]); | ||
567 | } catch(ClassCastException e) { | ||
568 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
569 | return null; | ||
570 | } | ||
571 | } | ||
572 | |||
573 | @Override | ||
574 | protected Adjacent.Match arrayToMatchMutable(final Object[] match) { | ||
575 | try { | ||
576 | return Adjacent.Match.newMutableMatch((Segment) match[POSITION_S1], (Segment) match[POSITION_S2]); | ||
577 | } catch(ClassCastException e) { | ||
578 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
579 | return null; | ||
580 | } | ||
581 | } | ||
582 | |||
583 | /** | ||
584 | * @return the singleton instance of the query specification of this pattern | ||
585 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
586 | * | ||
587 | */ | ||
588 | public static IQuerySpecification<Adjacent.Matcher> querySpecification() { | ||
589 | return Adjacent.instance(); | ||
590 | } | ||
591 | } | ||
592 | |||
593 | private Adjacent() { | ||
594 | super(GeneratedPQuery.INSTANCE); | ||
595 | } | ||
596 | |||
597 | /** | ||
598 | * @return the singleton instance of the query specification | ||
599 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
600 | * | ||
601 | */ | ||
602 | public static Adjacent instance() { | ||
603 | try{ | ||
604 | return LazyHolder.INSTANCE; | ||
605 | } catch (ExceptionInInitializerError err) { | ||
606 | throw processInitializerError(err); | ||
607 | } | ||
608 | } | ||
609 | |||
610 | @Override | ||
611 | protected Adjacent.Matcher instantiate(final ViatraQueryEngine engine) { | ||
612 | return Adjacent.Matcher.on(engine); | ||
613 | } | ||
614 | |||
615 | @Override | ||
616 | public Adjacent.Matcher instantiate() { | ||
617 | return Adjacent.Matcher.create(); | ||
618 | } | ||
619 | |||
620 | @Override | ||
621 | public Adjacent.Match newEmptyMatch() { | ||
622 | return Adjacent.Match.newEmptyMatch(); | ||
623 | } | ||
624 | |||
625 | @Override | ||
626 | public Adjacent.Match newMatch(final Object... parameters) { | ||
627 | return Adjacent.Match.newMatch((modes3.Segment) parameters[0], (modes3.Segment) parameters[1]); | ||
628 | } | ||
629 | |||
630 | /** | ||
631 | * Inner class allowing the singleton instance of {@link Adjacent} to be created | ||
632 | * <b>not</b> at the class load time of the outer class, | ||
633 | * but rather at the first call to {@link Adjacent#instance()}. | ||
634 | * | ||
635 | * <p> This workaround is required e.g. to support recursion. | ||
636 | * | ||
637 | */ | ||
638 | private static class LazyHolder { | ||
639 | private static final Adjacent INSTANCE = new Adjacent(); | ||
640 | |||
641 | /** | ||
642 | * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned. | ||
643 | * This initialization order is required to support indirect recursion. | ||
644 | * | ||
645 | * <p> The static initializer is defined using a helper field to work around limitations of the code generator. | ||
646 | * | ||
647 | */ | ||
648 | private static final Object STATIC_INITIALIZER = ensureInitialized(); | ||
649 | |||
650 | public static Object ensureInitialized() { | ||
651 | INSTANCE.ensureInitializedInternal(); | ||
652 | return null; | ||
653 | } | ||
654 | } | ||
655 | |||
656 | private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { | ||
657 | private static final Adjacent.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
658 | |||
659 | private final PParameter parameter_S1 = new PParameter("S1", "modes3.Segment", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.ece.mcgill.ca/wcet/modes3", "Segment")), PParameterDirection.INOUT); | ||
660 | |||
661 | private final PParameter parameter_S2 = new PParameter("S2", "modes3.Segment", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.ece.mcgill.ca/wcet/modes3", "Segment")), PParameterDirection.INOUT); | ||
662 | |||
663 | private final List<PParameter> parameters = Arrays.asList(parameter_S1, parameter_S2); | ||
664 | |||
665 | private GeneratedPQuery() { | ||
666 | super(PVisibility.PUBLIC); | ||
667 | } | ||
668 | |||
669 | @Override | ||
670 | public String getFullyQualifiedName() { | ||
671 | return "modes3.queries.adjacent"; | ||
672 | } | ||
673 | |||
674 | @Override | ||
675 | public List<String> getParameterNames() { | ||
676 | return Arrays.asList("S1","S2"); | ||
677 | } | ||
678 | |||
679 | @Override | ||
680 | public List<PParameter> getParameters() { | ||
681 | return parameters; | ||
682 | } | ||
683 | |||
684 | @Override | ||
685 | public Set<PBody> doGetContainedBodies() { | ||
686 | setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); | ||
687 | Set<PBody> bodies = new LinkedHashSet<>(); | ||
688 | { | ||
689 | PBody body = new PBody(this); | ||
690 | PVariable var_S1 = body.getOrCreateVariableByName("S1"); | ||
691 | PVariable var_S2 = body.getOrCreateVariableByName("S2"); | ||
692 | new TypeConstraint(body, Tuples.flatTupleOf(var_S1), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Segment"))); | ||
693 | new TypeConstraint(body, Tuples.flatTupleOf(var_S2), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Segment"))); | ||
694 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
695 | new ExportedParameter(body, var_S1, parameter_S1), | ||
696 | new ExportedParameter(body, var_S2, parameter_S2) | ||
697 | )); | ||
698 | // find output(S1, S2) | ||
699 | new PositivePatternCall(body, Tuples.flatTupleOf(var_S1, var_S2), Output.instance().getInternalQueryRepresentation()); | ||
700 | bodies.add(body); | ||
701 | } | ||
702 | { | ||
703 | PBody body = new PBody(this); | ||
704 | PVariable var_S1 = body.getOrCreateVariableByName("S1"); | ||
705 | PVariable var_S2 = body.getOrCreateVariableByName("S2"); | ||
706 | new TypeConstraint(body, Tuples.flatTupleOf(var_S1), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Segment"))); | ||
707 | new TypeConstraint(body, Tuples.flatTupleOf(var_S2), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Segment"))); | ||
708 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
709 | new ExportedParameter(body, var_S1, parameter_S1), | ||
710 | new ExportedParameter(body, var_S2, parameter_S2) | ||
711 | )); | ||
712 | // find turnoutOutput(S2, S1) | ||
713 | new PositivePatternCall(body, Tuples.flatTupleOf(var_S2, var_S1), TurnoutOutput.instance().getInternalQueryRepresentation()); | ||
714 | bodies.add(body); | ||
715 | } | ||
716 | return bodies; | ||
717 | } | ||
718 | } | ||
719 | } | ||
diff --git a/Domains/ca.mcgill.rtgmrt.example.modes3/vql-gen/modes3/queries/ConnectedTo.java b/Domains/ca.mcgill.rtgmrt.example.modes3/vql-gen/modes3/queries/ConnectedTo.java new file mode 100644 index 00000000..a0f14958 --- /dev/null +++ b/Domains/ca.mcgill.rtgmrt.example.modes3/vql-gen/modes3/queries/ConnectedTo.java | |||
@@ -0,0 +1,704 @@ | |||
1 | /** | ||
2 | * Generated from platform:/resource/ca.mcgill.rtgmrt.example.modes3/src/modes3/queries/Modes3Queries.vql | ||
3 | */ | ||
4 | package modes3.queries; | ||
5 | |||
6 | import java.util.Arrays; | ||
7 | import java.util.Collection; | ||
8 | import java.util.LinkedHashSet; | ||
9 | import java.util.List; | ||
10 | import java.util.Objects; | ||
11 | import java.util.Optional; | ||
12 | import java.util.Set; | ||
13 | import java.util.function.Consumer; | ||
14 | import java.util.stream.Collectors; | ||
15 | import java.util.stream.Stream; | ||
16 | import modes3.Segment; | ||
17 | import org.apache.log4j.Logger; | ||
18 | import org.eclipse.emf.ecore.EClass; | ||
19 | import org.eclipse.viatra.query.runtime.api.IPatternMatch; | ||
20 | import org.eclipse.viatra.query.runtime.api.IQuerySpecification; | ||
21 | import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; | ||
22 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
23 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; | ||
24 | import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; | ||
25 | import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; | ||
26 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
27 | import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey; | ||
28 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
29 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
30 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
31 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; | ||
32 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
33 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
34 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
35 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
36 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
37 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; | ||
38 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | ||
39 | import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; | ||
40 | |||
41 | /** | ||
42 | * A pattern-specific query specification that can instantiate Matcher in a type-safe way. | ||
43 | * | ||
44 | * <p>Original source: | ||
45 | * <code><pre> | ||
46 | * pattern connectedTo(S1 : Segment, S2 : Segment) { | ||
47 | * Segment.connectedTo(S1, S2); | ||
48 | * } | ||
49 | * </pre></code> | ||
50 | * | ||
51 | * @see Matcher | ||
52 | * @see Match | ||
53 | * | ||
54 | */ | ||
55 | @SuppressWarnings("all") | ||
56 | public final class ConnectedTo extends BaseGeneratedEMFQuerySpecification<ConnectedTo.Matcher> { | ||
57 | /** | ||
58 | * Pattern-specific match representation of the modes3.queries.connectedTo pattern, | ||
59 | * to be used in conjunction with {@link Matcher}. | ||
60 | * | ||
61 | * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned. | ||
62 | * Each instance is a (possibly partial) substitution of pattern parameters, | ||
63 | * usable to represent a match of the pattern in the result of a query, | ||
64 | * or to specify the bound (fixed) input parameters when issuing a query. | ||
65 | * | ||
66 | * @see Matcher | ||
67 | * | ||
68 | */ | ||
69 | public static abstract class Match extends BasePatternMatch { | ||
70 | private Segment fS1; | ||
71 | |||
72 | private Segment fS2; | ||
73 | |||
74 | private static List<String> parameterNames = makeImmutableList("S1", "S2"); | ||
75 | |||
76 | private Match(final Segment pS1, final Segment pS2) { | ||
77 | this.fS1 = pS1; | ||
78 | this.fS2 = pS2; | ||
79 | } | ||
80 | |||
81 | @Override | ||
82 | public Object get(final String parameterName) { | ||
83 | switch(parameterName) { | ||
84 | case "S1": return this.fS1; | ||
85 | case "S2": return this.fS2; | ||
86 | default: return null; | ||
87 | } | ||
88 | } | ||
89 | |||
90 | @Override | ||
91 | public Object get(final int index) { | ||
92 | switch(index) { | ||
93 | case 0: return this.fS1; | ||
94 | case 1: return this.fS2; | ||
95 | default: return null; | ||
96 | } | ||
97 | } | ||
98 | |||
99 | public Segment getS1() { | ||
100 | return this.fS1; | ||
101 | } | ||
102 | |||
103 | public Segment getS2() { | ||
104 | return this.fS2; | ||
105 | } | ||
106 | |||
107 | @Override | ||
108 | public boolean set(final String parameterName, final Object newValue) { | ||
109 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
110 | if ("S1".equals(parameterName) ) { | ||
111 | this.fS1 = (Segment) newValue; | ||
112 | return true; | ||
113 | } | ||
114 | if ("S2".equals(parameterName) ) { | ||
115 | this.fS2 = (Segment) newValue; | ||
116 | return true; | ||
117 | } | ||
118 | return false; | ||
119 | } | ||
120 | |||
121 | public void setS1(final Segment pS1) { | ||
122 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
123 | this.fS1 = pS1; | ||
124 | } | ||
125 | |||
126 | public void setS2(final Segment pS2) { | ||
127 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
128 | this.fS2 = pS2; | ||
129 | } | ||
130 | |||
131 | @Override | ||
132 | public String patternName() { | ||
133 | return "modes3.queries.connectedTo"; | ||
134 | } | ||
135 | |||
136 | @Override | ||
137 | public List<String> parameterNames() { | ||
138 | return ConnectedTo.Match.parameterNames; | ||
139 | } | ||
140 | |||
141 | @Override | ||
142 | public Object[] toArray() { | ||
143 | return new Object[]{fS1, fS2}; | ||
144 | } | ||
145 | |||
146 | @Override | ||
147 | public ConnectedTo.Match toImmutable() { | ||
148 | return isMutable() ? newMatch(fS1, fS2) : this; | ||
149 | } | ||
150 | |||
151 | @Override | ||
152 | public String prettyPrint() { | ||
153 | StringBuilder result = new StringBuilder(); | ||
154 | result.append("\"S1\"=" + prettyPrintValue(fS1) + ", "); | ||
155 | result.append("\"S2\"=" + prettyPrintValue(fS2)); | ||
156 | return result.toString(); | ||
157 | } | ||
158 | |||
159 | @Override | ||
160 | public int hashCode() { | ||
161 | return Objects.hash(fS1, fS2); | ||
162 | } | ||
163 | |||
164 | @Override | ||
165 | public boolean equals(final Object obj) { | ||
166 | if (this == obj) | ||
167 | return true; | ||
168 | if (obj == null) { | ||
169 | return false; | ||
170 | } | ||
171 | if ((obj instanceof ConnectedTo.Match)) { | ||
172 | ConnectedTo.Match other = (ConnectedTo.Match) obj; | ||
173 | return Objects.equals(fS1, other.fS1) && Objects.equals(fS2, other.fS2); | ||
174 | } else { | ||
175 | // this should be infrequent | ||
176 | if (!(obj instanceof IPatternMatch)) { | ||
177 | return false; | ||
178 | } | ||
179 | IPatternMatch otherSig = (IPatternMatch) obj; | ||
180 | return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray()); | ||
181 | } | ||
182 | } | ||
183 | |||
184 | @Override | ||
185 | public ConnectedTo specification() { | ||
186 | return ConnectedTo.instance(); | ||
187 | } | ||
188 | |||
189 | /** | ||
190 | * Returns an empty, mutable match. | ||
191 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
192 | * | ||
193 | * @return the empty match. | ||
194 | * | ||
195 | */ | ||
196 | public static ConnectedTo.Match newEmptyMatch() { | ||
197 | return new Mutable(null, null); | ||
198 | } | ||
199 | |||
200 | /** | ||
201 | * Returns a mutable (partial) match. | ||
202 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
203 | * | ||
204 | * @param pS1 the fixed value of pattern parameter S1, or null if not bound. | ||
205 | * @param pS2 the fixed value of pattern parameter S2, or null if not bound. | ||
206 | * @return the new, mutable (partial) match object. | ||
207 | * | ||
208 | */ | ||
209 | public static ConnectedTo.Match newMutableMatch(final Segment pS1, final Segment pS2) { | ||
210 | return new Mutable(pS1, pS2); | ||
211 | } | ||
212 | |||
213 | /** | ||
214 | * Returns a new (partial) match. | ||
215 | * This can be used e.g. to call the matcher with a partial match. | ||
216 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
217 | * @param pS1 the fixed value of pattern parameter S1, or null if not bound. | ||
218 | * @param pS2 the fixed value of pattern parameter S2, or null if not bound. | ||
219 | * @return the (partial) match object. | ||
220 | * | ||
221 | */ | ||
222 | public static ConnectedTo.Match newMatch(final Segment pS1, final Segment pS2) { | ||
223 | return new Immutable(pS1, pS2); | ||
224 | } | ||
225 | |||
226 | private static final class Mutable extends ConnectedTo.Match { | ||
227 | Mutable(final Segment pS1, final Segment pS2) { | ||
228 | super(pS1, pS2); | ||
229 | } | ||
230 | |||
231 | @Override | ||
232 | public boolean isMutable() { | ||
233 | return true; | ||
234 | } | ||
235 | } | ||
236 | |||
237 | private static final class Immutable extends ConnectedTo.Match { | ||
238 | Immutable(final Segment pS1, final Segment pS2) { | ||
239 | super(pS1, pS2); | ||
240 | } | ||
241 | |||
242 | @Override | ||
243 | public boolean isMutable() { | ||
244 | return false; | ||
245 | } | ||
246 | } | ||
247 | } | ||
248 | |||
249 | /** | ||
250 | * Generated pattern matcher API of the modes3.queries.connectedTo pattern, | ||
251 | * providing pattern-specific query methods. | ||
252 | * | ||
253 | * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)}, | ||
254 | * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}. | ||
255 | * | ||
256 | * <p>Matches of the pattern will be represented as {@link Match}. | ||
257 | * | ||
258 | * <p>Original source: | ||
259 | * <code><pre> | ||
260 | * pattern connectedTo(S1 : Segment, S2 : Segment) { | ||
261 | * Segment.connectedTo(S1, S2); | ||
262 | * } | ||
263 | * </pre></code> | ||
264 | * | ||
265 | * @see Match | ||
266 | * @see ConnectedTo | ||
267 | * | ||
268 | */ | ||
269 | public static class Matcher extends BaseMatcher<ConnectedTo.Match> { | ||
270 | /** | ||
271 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
272 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
273 | * | ||
274 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
275 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
276 | * | ||
277 | */ | ||
278 | public static ConnectedTo.Matcher on(final ViatraQueryEngine engine) { | ||
279 | // check if matcher already exists | ||
280 | Matcher matcher = engine.getExistingMatcher(querySpecification()); | ||
281 | if (matcher == null) { | ||
282 | matcher = (Matcher)engine.getMatcher(querySpecification()); | ||
283 | } | ||
284 | return matcher; | ||
285 | } | ||
286 | |||
287 | /** | ||
288 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
289 | * @return an initialized matcher | ||
290 | * @noreference This method is for internal matcher initialization by the framework, do not call it manually. | ||
291 | * | ||
292 | */ | ||
293 | public static ConnectedTo.Matcher create() { | ||
294 | return new Matcher(); | ||
295 | } | ||
296 | |||
297 | private static final int POSITION_S1 = 0; | ||
298 | |||
299 | private static final int POSITION_S2 = 1; | ||
300 | |||
301 | private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(ConnectedTo.Matcher.class); | ||
302 | |||
303 | /** | ||
304 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
305 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
306 | * | ||
307 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
308 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
309 | * | ||
310 | */ | ||
311 | private Matcher() { | ||
312 | super(querySpecification()); | ||
313 | } | ||
314 | |||
315 | /** | ||
316 | * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters. | ||
317 | * @param pS1 the fixed value of pattern parameter S1, or null if not bound. | ||
318 | * @param pS2 the fixed value of pattern parameter S2, or null if not bound. | ||
319 | * @return matches represented as a Match object. | ||
320 | * | ||
321 | */ | ||
322 | public Collection<ConnectedTo.Match> getAllMatches(final Segment pS1, final Segment pS2) { | ||
323 | return rawStreamAllMatches(new Object[]{pS1, pS2}).collect(Collectors.toSet()); | ||
324 | } | ||
325 | |||
326 | /** | ||
327 | * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters. | ||
328 | * </p> | ||
329 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
330 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
331 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
332 | * @param pS1 the fixed value of pattern parameter S1, or null if not bound. | ||
333 | * @param pS2 the fixed value of pattern parameter S2, or null if not bound. | ||
334 | * @return a stream of matches represented as a Match object. | ||
335 | * | ||
336 | */ | ||
337 | public Stream<ConnectedTo.Match> streamAllMatches(final Segment pS1, final Segment pS2) { | ||
338 | return rawStreamAllMatches(new Object[]{pS1, pS2}); | ||
339 | } | ||
340 | |||
341 | /** | ||
342 | * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
343 | * Neither determinism nor randomness of selection is guaranteed. | ||
344 | * @param pS1 the fixed value of pattern parameter S1, or null if not bound. | ||
345 | * @param pS2 the fixed value of pattern parameter S2, or null if not bound. | ||
346 | * @return a match represented as a Match object, or null if no match is found. | ||
347 | * | ||
348 | */ | ||
349 | public Optional<ConnectedTo.Match> getOneArbitraryMatch(final Segment pS1, final Segment pS2) { | ||
350 | return rawGetOneArbitraryMatch(new Object[]{pS1, pS2}); | ||
351 | } | ||
352 | |||
353 | /** | ||
354 | * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match, | ||
355 | * under any possible substitution of the unspecified parameters (if any). | ||
356 | * @param pS1 the fixed value of pattern parameter S1, or null if not bound. | ||
357 | * @param pS2 the fixed value of pattern parameter S2, or null if not bound. | ||
358 | * @return true if the input is a valid (partial) match of the pattern. | ||
359 | * | ||
360 | */ | ||
361 | public boolean hasMatch(final Segment pS1, final Segment pS2) { | ||
362 | return rawHasMatch(new Object[]{pS1, pS2}); | ||
363 | } | ||
364 | |||
365 | /** | ||
366 | * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. | ||
367 | * @param pS1 the fixed value of pattern parameter S1, or null if not bound. | ||
368 | * @param pS2 the fixed value of pattern parameter S2, or null if not bound. | ||
369 | * @return the number of pattern matches found. | ||
370 | * | ||
371 | */ | ||
372 | public int countMatches(final Segment pS1, final Segment pS2) { | ||
373 | return rawCountMatches(new Object[]{pS1, pS2}); | ||
374 | } | ||
375 | |||
376 | /** | ||
377 | * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
378 | * Neither determinism nor randomness of selection is guaranteed. | ||
379 | * @param pS1 the fixed value of pattern parameter S1, or null if not bound. | ||
380 | * @param pS2 the fixed value of pattern parameter S2, or null if not bound. | ||
381 | * @param processor the action that will process the selected match. | ||
382 | * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked | ||
383 | * | ||
384 | */ | ||
385 | public boolean forOneArbitraryMatch(final Segment pS1, final Segment pS2, final Consumer<? super ConnectedTo.Match> processor) { | ||
386 | return rawForOneArbitraryMatch(new Object[]{pS1, pS2}, processor); | ||
387 | } | ||
388 | |||
389 | /** | ||
390 | * Returns a new (partial) match. | ||
391 | * This can be used e.g. to call the matcher with a partial match. | ||
392 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
393 | * @param pS1 the fixed value of pattern parameter S1, or null if not bound. | ||
394 | * @param pS2 the fixed value of pattern parameter S2, or null if not bound. | ||
395 | * @return the (partial) match object. | ||
396 | * | ||
397 | */ | ||
398 | public ConnectedTo.Match newMatch(final Segment pS1, final Segment pS2) { | ||
399 | return ConnectedTo.Match.newMatch(pS1, pS2); | ||
400 | } | ||
401 | |||
402 | /** | ||
403 | * Retrieve the set of values that occur in matches for S1. | ||
404 | * @return the Set of all values or empty set if there are no matches | ||
405 | * | ||
406 | */ | ||
407 | protected Stream<Segment> rawStreamAllValuesOfS1(final Object[] parameters) { | ||
408 | return rawStreamAllValues(POSITION_S1, parameters).map(Segment.class::cast); | ||
409 | } | ||
410 | |||
411 | /** | ||
412 | * Retrieve the set of values that occur in matches for S1. | ||
413 | * @return the Set of all values or empty set if there are no matches | ||
414 | * | ||
415 | */ | ||
416 | public Set<Segment> getAllValuesOfS1() { | ||
417 | return rawStreamAllValuesOfS1(emptyArray()).collect(Collectors.toSet()); | ||
418 | } | ||
419 | |||
420 | /** | ||
421 | * Retrieve the set of values that occur in matches for S1. | ||
422 | * @return the Set of all values or empty set if there are no matches | ||
423 | * | ||
424 | */ | ||
425 | public Stream<Segment> streamAllValuesOfS1() { | ||
426 | return rawStreamAllValuesOfS1(emptyArray()); | ||
427 | } | ||
428 | |||
429 | /** | ||
430 | * Retrieve the set of values that occur in matches for S1. | ||
431 | * </p> | ||
432 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
433 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
434 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
435 | * | ||
436 | * @return the Stream of all values or empty set if there are no matches | ||
437 | * | ||
438 | */ | ||
439 | public Stream<Segment> streamAllValuesOfS1(final ConnectedTo.Match partialMatch) { | ||
440 | return rawStreamAllValuesOfS1(partialMatch.toArray()); | ||
441 | } | ||
442 | |||
443 | /** | ||
444 | * Retrieve the set of values that occur in matches for S1. | ||
445 | * </p> | ||
446 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
447 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
448 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
449 | * | ||
450 | * @return the Stream of all values or empty set if there are no matches | ||
451 | * | ||
452 | */ | ||
453 | public Stream<Segment> streamAllValuesOfS1(final Segment pS2) { | ||
454 | return rawStreamAllValuesOfS1(new Object[]{null, pS2}); | ||
455 | } | ||
456 | |||
457 | /** | ||
458 | * Retrieve the set of values that occur in matches for S1. | ||
459 | * @return the Set of all values or empty set if there are no matches | ||
460 | * | ||
461 | */ | ||
462 | public Set<Segment> getAllValuesOfS1(final ConnectedTo.Match partialMatch) { | ||
463 | return rawStreamAllValuesOfS1(partialMatch.toArray()).collect(Collectors.toSet()); | ||
464 | } | ||
465 | |||
466 | /** | ||
467 | * Retrieve the set of values that occur in matches for S1. | ||
468 | * @return the Set of all values or empty set if there are no matches | ||
469 | * | ||
470 | */ | ||
471 | public Set<Segment> getAllValuesOfS1(final Segment pS2) { | ||
472 | return rawStreamAllValuesOfS1(new Object[]{null, pS2}).collect(Collectors.toSet()); | ||
473 | } | ||
474 | |||
475 | /** | ||
476 | * Retrieve the set of values that occur in matches for S2. | ||
477 | * @return the Set of all values or empty set if there are no matches | ||
478 | * | ||
479 | */ | ||
480 | protected Stream<Segment> rawStreamAllValuesOfS2(final Object[] parameters) { | ||
481 | return rawStreamAllValues(POSITION_S2, parameters).map(Segment.class::cast); | ||
482 | } | ||
483 | |||
484 | /** | ||
485 | * Retrieve the set of values that occur in matches for S2. | ||
486 | * @return the Set of all values or empty set if there are no matches | ||
487 | * | ||
488 | */ | ||
489 | public Set<Segment> getAllValuesOfS2() { | ||
490 | return rawStreamAllValuesOfS2(emptyArray()).collect(Collectors.toSet()); | ||
491 | } | ||
492 | |||
493 | /** | ||
494 | * Retrieve the set of values that occur in matches for S2. | ||
495 | * @return the Set of all values or empty set if there are no matches | ||
496 | * | ||
497 | */ | ||
498 | public Stream<Segment> streamAllValuesOfS2() { | ||
499 | return rawStreamAllValuesOfS2(emptyArray()); | ||
500 | } | ||
501 | |||
502 | /** | ||
503 | * Retrieve the set of values that occur in matches for S2. | ||
504 | * </p> | ||
505 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
506 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
507 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
508 | * | ||
509 | * @return the Stream of all values or empty set if there are no matches | ||
510 | * | ||
511 | */ | ||
512 | public Stream<Segment> streamAllValuesOfS2(final ConnectedTo.Match partialMatch) { | ||
513 | return rawStreamAllValuesOfS2(partialMatch.toArray()); | ||
514 | } | ||
515 | |||
516 | /** | ||
517 | * Retrieve the set of values that occur in matches for S2. | ||
518 | * </p> | ||
519 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
520 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
521 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
522 | * | ||
523 | * @return the Stream of all values or empty set if there are no matches | ||
524 | * | ||
525 | */ | ||
526 | public Stream<Segment> streamAllValuesOfS2(final Segment pS1) { | ||
527 | return rawStreamAllValuesOfS2(new Object[]{pS1, null}); | ||
528 | } | ||
529 | |||
530 | /** | ||
531 | * Retrieve the set of values that occur in matches for S2. | ||
532 | * @return the Set of all values or empty set if there are no matches | ||
533 | * | ||
534 | */ | ||
535 | public Set<Segment> getAllValuesOfS2(final ConnectedTo.Match partialMatch) { | ||
536 | return rawStreamAllValuesOfS2(partialMatch.toArray()).collect(Collectors.toSet()); | ||
537 | } | ||
538 | |||
539 | /** | ||
540 | * Retrieve the set of values that occur in matches for S2. | ||
541 | * @return the Set of all values or empty set if there are no matches | ||
542 | * | ||
543 | */ | ||
544 | public Set<Segment> getAllValuesOfS2(final Segment pS1) { | ||
545 | return rawStreamAllValuesOfS2(new Object[]{pS1, null}).collect(Collectors.toSet()); | ||
546 | } | ||
547 | |||
548 | @Override | ||
549 | protected ConnectedTo.Match tupleToMatch(final Tuple t) { | ||
550 | try { | ||
551 | return ConnectedTo.Match.newMatch((Segment) t.get(POSITION_S1), (Segment) t.get(POSITION_S2)); | ||
552 | } catch(ClassCastException e) { | ||
553 | LOGGER.error("Element(s) in tuple not properly typed!",e); | ||
554 | return null; | ||
555 | } | ||
556 | } | ||
557 | |||
558 | @Override | ||
559 | protected ConnectedTo.Match arrayToMatch(final Object[] match) { | ||
560 | try { | ||
561 | return ConnectedTo.Match.newMatch((Segment) match[POSITION_S1], (Segment) match[POSITION_S2]); | ||
562 | } catch(ClassCastException e) { | ||
563 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
564 | return null; | ||
565 | } | ||
566 | } | ||
567 | |||
568 | @Override | ||
569 | protected ConnectedTo.Match arrayToMatchMutable(final Object[] match) { | ||
570 | try { | ||
571 | return ConnectedTo.Match.newMutableMatch((Segment) match[POSITION_S1], (Segment) match[POSITION_S2]); | ||
572 | } catch(ClassCastException e) { | ||
573 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
574 | return null; | ||
575 | } | ||
576 | } | ||
577 | |||
578 | /** | ||
579 | * @return the singleton instance of the query specification of this pattern | ||
580 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
581 | * | ||
582 | */ | ||
583 | public static IQuerySpecification<ConnectedTo.Matcher> querySpecification() { | ||
584 | return ConnectedTo.instance(); | ||
585 | } | ||
586 | } | ||
587 | |||
588 | private ConnectedTo() { | ||
589 | super(GeneratedPQuery.INSTANCE); | ||
590 | } | ||
591 | |||
592 | /** | ||
593 | * @return the singleton instance of the query specification | ||
594 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
595 | * | ||
596 | */ | ||
597 | public static ConnectedTo instance() { | ||
598 | try{ | ||
599 | return LazyHolder.INSTANCE; | ||
600 | } catch (ExceptionInInitializerError err) { | ||
601 | throw processInitializerError(err); | ||
602 | } | ||
603 | } | ||
604 | |||
605 | @Override | ||
606 | protected ConnectedTo.Matcher instantiate(final ViatraQueryEngine engine) { | ||
607 | return ConnectedTo.Matcher.on(engine); | ||
608 | } | ||
609 | |||
610 | @Override | ||
611 | public ConnectedTo.Matcher instantiate() { | ||
612 | return ConnectedTo.Matcher.create(); | ||
613 | } | ||
614 | |||
615 | @Override | ||
616 | public ConnectedTo.Match newEmptyMatch() { | ||
617 | return ConnectedTo.Match.newEmptyMatch(); | ||
618 | } | ||
619 | |||
620 | @Override | ||
621 | public ConnectedTo.Match newMatch(final Object... parameters) { | ||
622 | return ConnectedTo.Match.newMatch((modes3.Segment) parameters[0], (modes3.Segment) parameters[1]); | ||
623 | } | ||
624 | |||
625 | /** | ||
626 | * Inner class allowing the singleton instance of {@link ConnectedTo} to be created | ||
627 | * <b>not</b> at the class load time of the outer class, | ||
628 | * but rather at the first call to {@link ConnectedTo#instance()}. | ||
629 | * | ||
630 | * <p> This workaround is required e.g. to support recursion. | ||
631 | * | ||
632 | */ | ||
633 | private static class LazyHolder { | ||
634 | private static final ConnectedTo INSTANCE = new ConnectedTo(); | ||
635 | |||
636 | /** | ||
637 | * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned. | ||
638 | * This initialization order is required to support indirect recursion. | ||
639 | * | ||
640 | * <p> The static initializer is defined using a helper field to work around limitations of the code generator. | ||
641 | * | ||
642 | */ | ||
643 | private static final Object STATIC_INITIALIZER = ensureInitialized(); | ||
644 | |||
645 | public static Object ensureInitialized() { | ||
646 | INSTANCE.ensureInitializedInternal(); | ||
647 | return null; | ||
648 | } | ||
649 | } | ||
650 | |||
651 | private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { | ||
652 | private static final ConnectedTo.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
653 | |||
654 | private final PParameter parameter_S1 = new PParameter("S1", "modes3.Segment", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.ece.mcgill.ca/wcet/modes3", "Segment")), PParameterDirection.INOUT); | ||
655 | |||
656 | private final PParameter parameter_S2 = new PParameter("S2", "modes3.Segment", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.ece.mcgill.ca/wcet/modes3", "Segment")), PParameterDirection.INOUT); | ||
657 | |||
658 | private final List<PParameter> parameters = Arrays.asList(parameter_S1, parameter_S2); | ||
659 | |||
660 | private GeneratedPQuery() { | ||
661 | super(PVisibility.PUBLIC); | ||
662 | } | ||
663 | |||
664 | @Override | ||
665 | public String getFullyQualifiedName() { | ||
666 | return "modes3.queries.connectedTo"; | ||
667 | } | ||
668 | |||
669 | @Override | ||
670 | public List<String> getParameterNames() { | ||
671 | return Arrays.asList("S1","S2"); | ||
672 | } | ||
673 | |||
674 | @Override | ||
675 | public List<PParameter> getParameters() { | ||
676 | return parameters; | ||
677 | } | ||
678 | |||
679 | @Override | ||
680 | public Set<PBody> doGetContainedBodies() { | ||
681 | setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); | ||
682 | Set<PBody> bodies = new LinkedHashSet<>(); | ||
683 | { | ||
684 | PBody body = new PBody(this); | ||
685 | PVariable var_S1 = body.getOrCreateVariableByName("S1"); | ||
686 | PVariable var_S2 = body.getOrCreateVariableByName("S2"); | ||
687 | new TypeConstraint(body, Tuples.flatTupleOf(var_S1), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Segment"))); | ||
688 | new TypeConstraint(body, Tuples.flatTupleOf(var_S2), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Segment"))); | ||
689 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
690 | new ExportedParameter(body, var_S1, parameter_S1), | ||
691 | new ExportedParameter(body, var_S2, parameter_S2) | ||
692 | )); | ||
693 | // Segment.connectedTo(S1, S2) | ||
694 | new TypeConstraint(body, Tuples.flatTupleOf(var_S1), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Segment"))); | ||
695 | PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); | ||
696 | new TypeConstraint(body, Tuples.flatTupleOf(var_S1, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Segment", "connectedTo"))); | ||
697 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Segment"))); | ||
698 | new Equality(body, var__virtual_0_, var_S2); | ||
699 | bodies.add(body); | ||
700 | } | ||
701 | return bodies; | ||
702 | } | ||
703 | } | ||
704 | } | ||
diff --git a/Domains/ca.mcgill.rtgmrt.example.modes3/vql-gen/modes3/queries/ConnectedToNotSymmetric.java b/Domains/ca.mcgill.rtgmrt.example.modes3/vql-gen/modes3/queries/ConnectedToNotSymmetric.java new file mode 100644 index 00000000..91b74c7e --- /dev/null +++ b/Domains/ca.mcgill.rtgmrt.example.modes3/vql-gen/modes3/queries/ConnectedToNotSymmetric.java | |||
@@ -0,0 +1,724 @@ | |||
1 | /** | ||
2 | * Generated from platform:/resource/ca.mcgill.rtgmrt.example.modes3/src/modes3/queries/Modes3Queries.vql | ||
3 | */ | ||
4 | package modes3.queries; | ||
5 | |||
6 | import java.util.Arrays; | ||
7 | import java.util.Collection; | ||
8 | import java.util.LinkedHashSet; | ||
9 | import java.util.List; | ||
10 | import java.util.Objects; | ||
11 | import java.util.Optional; | ||
12 | import java.util.Set; | ||
13 | import java.util.function.Consumer; | ||
14 | import java.util.stream.Collectors; | ||
15 | import java.util.stream.Stream; | ||
16 | import modes3.Segment; | ||
17 | import modes3.queries.ConnectedTo; | ||
18 | import org.apache.log4j.Logger; | ||
19 | import org.eclipse.emf.ecore.EClass; | ||
20 | import org.eclipse.viatra.query.runtime.api.IPatternMatch; | ||
21 | import org.eclipse.viatra.query.runtime.api.IQuerySpecification; | ||
22 | import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; | ||
23 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
24 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; | ||
25 | import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; | ||
26 | import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; | ||
27 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
28 | import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey; | ||
29 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
30 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
31 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
32 | import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.PAnnotation; | ||
33 | import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.ParameterReference; | ||
34 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; | ||
35 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
36 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.NegativePatternCall; | ||
37 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
38 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
39 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
40 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
41 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; | ||
42 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | ||
43 | import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; | ||
44 | |||
45 | /** | ||
46 | * A pattern-specific query specification that can instantiate Matcher in a type-safe way. | ||
47 | * | ||
48 | * <p>Original source: | ||
49 | * <code><pre> | ||
50 | * {@literal @}Constraint(message = "connectedToNotSymmetric", severity = "error", key = { S1, S2 }) | ||
51 | * pattern connectedToNotSymmetric(S1 : Segment, S2 : Segment) { | ||
52 | * Segment.connectedTo(S1, S2); | ||
53 | * neg find connectedTo(S2, S1); | ||
54 | * } | ||
55 | * </pre></code> | ||
56 | * | ||
57 | * @see Matcher | ||
58 | * @see Match | ||
59 | * | ||
60 | */ | ||
61 | @SuppressWarnings("all") | ||
62 | public final class ConnectedToNotSymmetric extends BaseGeneratedEMFQuerySpecification<ConnectedToNotSymmetric.Matcher> { | ||
63 | /** | ||
64 | * Pattern-specific match representation of the modes3.queries.connectedToNotSymmetric pattern, | ||
65 | * to be used in conjunction with {@link Matcher}. | ||
66 | * | ||
67 | * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned. | ||
68 | * Each instance is a (possibly partial) substitution of pattern parameters, | ||
69 | * usable to represent a match of the pattern in the result of a query, | ||
70 | * or to specify the bound (fixed) input parameters when issuing a query. | ||
71 | * | ||
72 | * @see Matcher | ||
73 | * | ||
74 | */ | ||
75 | public static abstract class Match extends BasePatternMatch { | ||
76 | private Segment fS1; | ||
77 | |||
78 | private Segment fS2; | ||
79 | |||
80 | private static List<String> parameterNames = makeImmutableList("S1", "S2"); | ||
81 | |||
82 | private Match(final Segment pS1, final Segment pS2) { | ||
83 | this.fS1 = pS1; | ||
84 | this.fS2 = pS2; | ||
85 | } | ||
86 | |||
87 | @Override | ||
88 | public Object get(final String parameterName) { | ||
89 | switch(parameterName) { | ||
90 | case "S1": return this.fS1; | ||
91 | case "S2": return this.fS2; | ||
92 | default: return null; | ||
93 | } | ||
94 | } | ||
95 | |||
96 | @Override | ||
97 | public Object get(final int index) { | ||
98 | switch(index) { | ||
99 | case 0: return this.fS1; | ||
100 | case 1: return this.fS2; | ||
101 | default: return null; | ||
102 | } | ||
103 | } | ||
104 | |||
105 | public Segment getS1() { | ||
106 | return this.fS1; | ||
107 | } | ||
108 | |||
109 | public Segment getS2() { | ||
110 | return this.fS2; | ||
111 | } | ||
112 | |||
113 | @Override | ||
114 | public boolean set(final String parameterName, final Object newValue) { | ||
115 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
116 | if ("S1".equals(parameterName) ) { | ||
117 | this.fS1 = (Segment) newValue; | ||
118 | return true; | ||
119 | } | ||
120 | if ("S2".equals(parameterName) ) { | ||
121 | this.fS2 = (Segment) newValue; | ||
122 | return true; | ||
123 | } | ||
124 | return false; | ||
125 | } | ||
126 | |||
127 | public void setS1(final Segment pS1) { | ||
128 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
129 | this.fS1 = pS1; | ||
130 | } | ||
131 | |||
132 | public void setS2(final Segment pS2) { | ||
133 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
134 | this.fS2 = pS2; | ||
135 | } | ||
136 | |||
137 | @Override | ||
138 | public String patternName() { | ||
139 | return "modes3.queries.connectedToNotSymmetric"; | ||
140 | } | ||
141 | |||
142 | @Override | ||
143 | public List<String> parameterNames() { | ||
144 | return ConnectedToNotSymmetric.Match.parameterNames; | ||
145 | } | ||
146 | |||
147 | @Override | ||
148 | public Object[] toArray() { | ||
149 | return new Object[]{fS1, fS2}; | ||
150 | } | ||
151 | |||
152 | @Override | ||
153 | public ConnectedToNotSymmetric.Match toImmutable() { | ||
154 | return isMutable() ? newMatch(fS1, fS2) : this; | ||
155 | } | ||
156 | |||
157 | @Override | ||
158 | public String prettyPrint() { | ||
159 | StringBuilder result = new StringBuilder(); | ||
160 | result.append("\"S1\"=" + prettyPrintValue(fS1) + ", "); | ||
161 | result.append("\"S2\"=" + prettyPrintValue(fS2)); | ||
162 | return result.toString(); | ||
163 | } | ||
164 | |||
165 | @Override | ||
166 | public int hashCode() { | ||
167 | return Objects.hash(fS1, fS2); | ||
168 | } | ||
169 | |||
170 | @Override | ||
171 | public boolean equals(final Object obj) { | ||
172 | if (this == obj) | ||
173 | return true; | ||
174 | if (obj == null) { | ||
175 | return false; | ||
176 | } | ||
177 | if ((obj instanceof ConnectedToNotSymmetric.Match)) { | ||
178 | ConnectedToNotSymmetric.Match other = (ConnectedToNotSymmetric.Match) obj; | ||
179 | return Objects.equals(fS1, other.fS1) && Objects.equals(fS2, other.fS2); | ||
180 | } else { | ||
181 | // this should be infrequent | ||
182 | if (!(obj instanceof IPatternMatch)) { | ||
183 | return false; | ||
184 | } | ||
185 | IPatternMatch otherSig = (IPatternMatch) obj; | ||
186 | return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray()); | ||
187 | } | ||
188 | } | ||
189 | |||
190 | @Override | ||
191 | public ConnectedToNotSymmetric specification() { | ||
192 | return ConnectedToNotSymmetric.instance(); | ||
193 | } | ||
194 | |||
195 | /** | ||
196 | * Returns an empty, mutable match. | ||
197 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
198 | * | ||
199 | * @return the empty match. | ||
200 | * | ||
201 | */ | ||
202 | public static ConnectedToNotSymmetric.Match newEmptyMatch() { | ||
203 | return new Mutable(null, null); | ||
204 | } | ||
205 | |||
206 | /** | ||
207 | * Returns a mutable (partial) match. | ||
208 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
209 | * | ||
210 | * @param pS1 the fixed value of pattern parameter S1, or null if not bound. | ||
211 | * @param pS2 the fixed value of pattern parameter S2, or null if not bound. | ||
212 | * @return the new, mutable (partial) match object. | ||
213 | * | ||
214 | */ | ||
215 | public static ConnectedToNotSymmetric.Match newMutableMatch(final Segment pS1, final Segment pS2) { | ||
216 | return new Mutable(pS1, pS2); | ||
217 | } | ||
218 | |||
219 | /** | ||
220 | * Returns a new (partial) match. | ||
221 | * This can be used e.g. to call the matcher with a partial match. | ||
222 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
223 | * @param pS1 the fixed value of pattern parameter S1, or null if not bound. | ||
224 | * @param pS2 the fixed value of pattern parameter S2, or null if not bound. | ||
225 | * @return the (partial) match object. | ||
226 | * | ||
227 | */ | ||
228 | public static ConnectedToNotSymmetric.Match newMatch(final Segment pS1, final Segment pS2) { | ||
229 | return new Immutable(pS1, pS2); | ||
230 | } | ||
231 | |||
232 | private static final class Mutable extends ConnectedToNotSymmetric.Match { | ||
233 | Mutable(final Segment pS1, final Segment pS2) { | ||
234 | super(pS1, pS2); | ||
235 | } | ||
236 | |||
237 | @Override | ||
238 | public boolean isMutable() { | ||
239 | return true; | ||
240 | } | ||
241 | } | ||
242 | |||
243 | private static final class Immutable extends ConnectedToNotSymmetric.Match { | ||
244 | Immutable(final Segment pS1, final Segment pS2) { | ||
245 | super(pS1, pS2); | ||
246 | } | ||
247 | |||
248 | @Override | ||
249 | public boolean isMutable() { | ||
250 | return false; | ||
251 | } | ||
252 | } | ||
253 | } | ||
254 | |||
255 | /** | ||
256 | * Generated pattern matcher API of the modes3.queries.connectedToNotSymmetric pattern, | ||
257 | * providing pattern-specific query methods. | ||
258 | * | ||
259 | * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)}, | ||
260 | * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}. | ||
261 | * | ||
262 | * <p>Matches of the pattern will be represented as {@link Match}. | ||
263 | * | ||
264 | * <p>Original source: | ||
265 | * <code><pre> | ||
266 | * {@literal @}Constraint(message = "connectedToNotSymmetric", severity = "error", key = { S1, S2 }) | ||
267 | * pattern connectedToNotSymmetric(S1 : Segment, S2 : Segment) { | ||
268 | * Segment.connectedTo(S1, S2); | ||
269 | * neg find connectedTo(S2, S1); | ||
270 | * } | ||
271 | * </pre></code> | ||
272 | * | ||
273 | * @see Match | ||
274 | * @see ConnectedToNotSymmetric | ||
275 | * | ||
276 | */ | ||
277 | public static class Matcher extends BaseMatcher<ConnectedToNotSymmetric.Match> { | ||
278 | /** | ||
279 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
280 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
281 | * | ||
282 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
283 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
284 | * | ||
285 | */ | ||
286 | public static ConnectedToNotSymmetric.Matcher on(final ViatraQueryEngine engine) { | ||
287 | // check if matcher already exists | ||
288 | Matcher matcher = engine.getExistingMatcher(querySpecification()); | ||
289 | if (matcher == null) { | ||
290 | matcher = (Matcher)engine.getMatcher(querySpecification()); | ||
291 | } | ||
292 | return matcher; | ||
293 | } | ||
294 | |||
295 | /** | ||
296 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
297 | * @return an initialized matcher | ||
298 | * @noreference This method is for internal matcher initialization by the framework, do not call it manually. | ||
299 | * | ||
300 | */ | ||
301 | public static ConnectedToNotSymmetric.Matcher create() { | ||
302 | return new Matcher(); | ||
303 | } | ||
304 | |||
305 | private static final int POSITION_S1 = 0; | ||
306 | |||
307 | private static final int POSITION_S2 = 1; | ||
308 | |||
309 | private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(ConnectedToNotSymmetric.Matcher.class); | ||
310 | |||
311 | /** | ||
312 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
313 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
314 | * | ||
315 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
316 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
317 | * | ||
318 | */ | ||
319 | private Matcher() { | ||
320 | super(querySpecification()); | ||
321 | } | ||
322 | |||
323 | /** | ||
324 | * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters. | ||
325 | * @param pS1 the fixed value of pattern parameter S1, or null if not bound. | ||
326 | * @param pS2 the fixed value of pattern parameter S2, or null if not bound. | ||
327 | * @return matches represented as a Match object. | ||
328 | * | ||
329 | */ | ||
330 | public Collection<ConnectedToNotSymmetric.Match> getAllMatches(final Segment pS1, final Segment pS2) { | ||
331 | return rawStreamAllMatches(new Object[]{pS1, pS2}).collect(Collectors.toSet()); | ||
332 | } | ||
333 | |||
334 | /** | ||
335 | * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters. | ||
336 | * </p> | ||
337 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
338 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
339 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
340 | * @param pS1 the fixed value of pattern parameter S1, or null if not bound. | ||
341 | * @param pS2 the fixed value of pattern parameter S2, or null if not bound. | ||
342 | * @return a stream of matches represented as a Match object. | ||
343 | * | ||
344 | */ | ||
345 | public Stream<ConnectedToNotSymmetric.Match> streamAllMatches(final Segment pS1, final Segment pS2) { | ||
346 | return rawStreamAllMatches(new Object[]{pS1, pS2}); | ||
347 | } | ||
348 | |||
349 | /** | ||
350 | * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
351 | * Neither determinism nor randomness of selection is guaranteed. | ||
352 | * @param pS1 the fixed value of pattern parameter S1, or null if not bound. | ||
353 | * @param pS2 the fixed value of pattern parameter S2, or null if not bound. | ||
354 | * @return a match represented as a Match object, or null if no match is found. | ||
355 | * | ||
356 | */ | ||
357 | public Optional<ConnectedToNotSymmetric.Match> getOneArbitraryMatch(final Segment pS1, final Segment pS2) { | ||
358 | return rawGetOneArbitraryMatch(new Object[]{pS1, pS2}); | ||
359 | } | ||
360 | |||
361 | /** | ||
362 | * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match, | ||
363 | * under any possible substitution of the unspecified parameters (if any). | ||
364 | * @param pS1 the fixed value of pattern parameter S1, or null if not bound. | ||
365 | * @param pS2 the fixed value of pattern parameter S2, or null if not bound. | ||
366 | * @return true if the input is a valid (partial) match of the pattern. | ||
367 | * | ||
368 | */ | ||
369 | public boolean hasMatch(final Segment pS1, final Segment pS2) { | ||
370 | return rawHasMatch(new Object[]{pS1, pS2}); | ||
371 | } | ||
372 | |||
373 | /** | ||
374 | * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. | ||
375 | * @param pS1 the fixed value of pattern parameter S1, or null if not bound. | ||
376 | * @param pS2 the fixed value of pattern parameter S2, or null if not bound. | ||
377 | * @return the number of pattern matches found. | ||
378 | * | ||
379 | */ | ||
380 | public int countMatches(final Segment pS1, final Segment pS2) { | ||
381 | return rawCountMatches(new Object[]{pS1, pS2}); | ||
382 | } | ||
383 | |||
384 | /** | ||
385 | * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
386 | * Neither determinism nor randomness of selection is guaranteed. | ||
387 | * @param pS1 the fixed value of pattern parameter S1, or null if not bound. | ||
388 | * @param pS2 the fixed value of pattern parameter S2, or null if not bound. | ||
389 | * @param processor the action that will process the selected match. | ||
390 | * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked | ||
391 | * | ||
392 | */ | ||
393 | public boolean forOneArbitraryMatch(final Segment pS1, final Segment pS2, final Consumer<? super ConnectedToNotSymmetric.Match> processor) { | ||
394 | return rawForOneArbitraryMatch(new Object[]{pS1, pS2}, processor); | ||
395 | } | ||
396 | |||
397 | /** | ||
398 | * Returns a new (partial) match. | ||
399 | * This can be used e.g. to call the matcher with a partial match. | ||
400 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
401 | * @param pS1 the fixed value of pattern parameter S1, or null if not bound. | ||
402 | * @param pS2 the fixed value of pattern parameter S2, or null if not bound. | ||
403 | * @return the (partial) match object. | ||
404 | * | ||
405 | */ | ||
406 | public ConnectedToNotSymmetric.Match newMatch(final Segment pS1, final Segment pS2) { | ||
407 | return ConnectedToNotSymmetric.Match.newMatch(pS1, pS2); | ||
408 | } | ||
409 | |||
410 | /** | ||
411 | * Retrieve the set of values that occur in matches for S1. | ||
412 | * @return the Set of all values or empty set if there are no matches | ||
413 | * | ||
414 | */ | ||
415 | protected Stream<Segment> rawStreamAllValuesOfS1(final Object[] parameters) { | ||
416 | return rawStreamAllValues(POSITION_S1, parameters).map(Segment.class::cast); | ||
417 | } | ||
418 | |||
419 | /** | ||
420 | * Retrieve the set of values that occur in matches for S1. | ||
421 | * @return the Set of all values or empty set if there are no matches | ||
422 | * | ||
423 | */ | ||
424 | public Set<Segment> getAllValuesOfS1() { | ||
425 | return rawStreamAllValuesOfS1(emptyArray()).collect(Collectors.toSet()); | ||
426 | } | ||
427 | |||
428 | /** | ||
429 | * Retrieve the set of values that occur in matches for S1. | ||
430 | * @return the Set of all values or empty set if there are no matches | ||
431 | * | ||
432 | */ | ||
433 | public Stream<Segment> streamAllValuesOfS1() { | ||
434 | return rawStreamAllValuesOfS1(emptyArray()); | ||
435 | } | ||
436 | |||
437 | /** | ||
438 | * Retrieve the set of values that occur in matches for S1. | ||
439 | * </p> | ||
440 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
441 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
442 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
443 | * | ||
444 | * @return the Stream of all values or empty set if there are no matches | ||
445 | * | ||
446 | */ | ||
447 | public Stream<Segment> streamAllValuesOfS1(final ConnectedToNotSymmetric.Match partialMatch) { | ||
448 | return rawStreamAllValuesOfS1(partialMatch.toArray()); | ||
449 | } | ||
450 | |||
451 | /** | ||
452 | * Retrieve the set of values that occur in matches for S1. | ||
453 | * </p> | ||
454 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
455 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
456 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
457 | * | ||
458 | * @return the Stream of all values or empty set if there are no matches | ||
459 | * | ||
460 | */ | ||
461 | public Stream<Segment> streamAllValuesOfS1(final Segment pS2) { | ||
462 | return rawStreamAllValuesOfS1(new Object[]{null, pS2}); | ||
463 | } | ||
464 | |||
465 | /** | ||
466 | * Retrieve the set of values that occur in matches for S1. | ||
467 | * @return the Set of all values or empty set if there are no matches | ||
468 | * | ||
469 | */ | ||
470 | public Set<Segment> getAllValuesOfS1(final ConnectedToNotSymmetric.Match partialMatch) { | ||
471 | return rawStreamAllValuesOfS1(partialMatch.toArray()).collect(Collectors.toSet()); | ||
472 | } | ||
473 | |||
474 | /** | ||
475 | * Retrieve the set of values that occur in matches for S1. | ||
476 | * @return the Set of all values or empty set if there are no matches | ||
477 | * | ||
478 | */ | ||
479 | public Set<Segment> getAllValuesOfS1(final Segment pS2) { | ||
480 | return rawStreamAllValuesOfS1(new Object[]{null, pS2}).collect(Collectors.toSet()); | ||
481 | } | ||
482 | |||
483 | /** | ||
484 | * Retrieve the set of values that occur in matches for S2. | ||
485 | * @return the Set of all values or empty set if there are no matches | ||
486 | * | ||
487 | */ | ||
488 | protected Stream<Segment> rawStreamAllValuesOfS2(final Object[] parameters) { | ||
489 | return rawStreamAllValues(POSITION_S2, parameters).map(Segment.class::cast); | ||
490 | } | ||
491 | |||
492 | /** | ||
493 | * Retrieve the set of values that occur in matches for S2. | ||
494 | * @return the Set of all values or empty set if there are no matches | ||
495 | * | ||
496 | */ | ||
497 | public Set<Segment> getAllValuesOfS2() { | ||
498 | return rawStreamAllValuesOfS2(emptyArray()).collect(Collectors.toSet()); | ||
499 | } | ||
500 | |||
501 | /** | ||
502 | * Retrieve the set of values that occur in matches for S2. | ||
503 | * @return the Set of all values or empty set if there are no matches | ||
504 | * | ||
505 | */ | ||
506 | public Stream<Segment> streamAllValuesOfS2() { | ||
507 | return rawStreamAllValuesOfS2(emptyArray()); | ||
508 | } | ||
509 | |||
510 | /** | ||
511 | * Retrieve the set of values that occur in matches for S2. | ||
512 | * </p> | ||
513 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
514 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
515 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
516 | * | ||
517 | * @return the Stream of all values or empty set if there are no matches | ||
518 | * | ||
519 | */ | ||
520 | public Stream<Segment> streamAllValuesOfS2(final ConnectedToNotSymmetric.Match partialMatch) { | ||
521 | return rawStreamAllValuesOfS2(partialMatch.toArray()); | ||
522 | } | ||
523 | |||
524 | /** | ||
525 | * Retrieve the set of values that occur in matches for S2. | ||
526 | * </p> | ||
527 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
528 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
529 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
530 | * | ||
531 | * @return the Stream of all values or empty set if there are no matches | ||
532 | * | ||
533 | */ | ||
534 | public Stream<Segment> streamAllValuesOfS2(final Segment pS1) { | ||
535 | return rawStreamAllValuesOfS2(new Object[]{pS1, null}); | ||
536 | } | ||
537 | |||
538 | /** | ||
539 | * Retrieve the set of values that occur in matches for S2. | ||
540 | * @return the Set of all values or empty set if there are no matches | ||
541 | * | ||
542 | */ | ||
543 | public Set<Segment> getAllValuesOfS2(final ConnectedToNotSymmetric.Match partialMatch) { | ||
544 | return rawStreamAllValuesOfS2(partialMatch.toArray()).collect(Collectors.toSet()); | ||
545 | } | ||
546 | |||
547 | /** | ||
548 | * Retrieve the set of values that occur in matches for S2. | ||
549 | * @return the Set of all values or empty set if there are no matches | ||
550 | * | ||
551 | */ | ||
552 | public Set<Segment> getAllValuesOfS2(final Segment pS1) { | ||
553 | return rawStreamAllValuesOfS2(new Object[]{pS1, null}).collect(Collectors.toSet()); | ||
554 | } | ||
555 | |||
556 | @Override | ||
557 | protected ConnectedToNotSymmetric.Match tupleToMatch(final Tuple t) { | ||
558 | try { | ||
559 | return ConnectedToNotSymmetric.Match.newMatch((Segment) t.get(POSITION_S1), (Segment) t.get(POSITION_S2)); | ||
560 | } catch(ClassCastException e) { | ||
561 | LOGGER.error("Element(s) in tuple not properly typed!",e); | ||
562 | return null; | ||
563 | } | ||
564 | } | ||
565 | |||
566 | @Override | ||
567 | protected ConnectedToNotSymmetric.Match arrayToMatch(final Object[] match) { | ||
568 | try { | ||
569 | return ConnectedToNotSymmetric.Match.newMatch((Segment) match[POSITION_S1], (Segment) match[POSITION_S2]); | ||
570 | } catch(ClassCastException e) { | ||
571 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
572 | return null; | ||
573 | } | ||
574 | } | ||
575 | |||
576 | @Override | ||
577 | protected ConnectedToNotSymmetric.Match arrayToMatchMutable(final Object[] match) { | ||
578 | try { | ||
579 | return ConnectedToNotSymmetric.Match.newMutableMatch((Segment) match[POSITION_S1], (Segment) match[POSITION_S2]); | ||
580 | } catch(ClassCastException e) { | ||
581 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
582 | return null; | ||
583 | } | ||
584 | } | ||
585 | |||
586 | /** | ||
587 | * @return the singleton instance of the query specification of this pattern | ||
588 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
589 | * | ||
590 | */ | ||
591 | public static IQuerySpecification<ConnectedToNotSymmetric.Matcher> querySpecification() { | ||
592 | return ConnectedToNotSymmetric.instance(); | ||
593 | } | ||
594 | } | ||
595 | |||
596 | private ConnectedToNotSymmetric() { | ||
597 | super(GeneratedPQuery.INSTANCE); | ||
598 | } | ||
599 | |||
600 | /** | ||
601 | * @return the singleton instance of the query specification | ||
602 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
603 | * | ||
604 | */ | ||
605 | public static ConnectedToNotSymmetric instance() { | ||
606 | try{ | ||
607 | return LazyHolder.INSTANCE; | ||
608 | } catch (ExceptionInInitializerError err) { | ||
609 | throw processInitializerError(err); | ||
610 | } | ||
611 | } | ||
612 | |||
613 | @Override | ||
614 | protected ConnectedToNotSymmetric.Matcher instantiate(final ViatraQueryEngine engine) { | ||
615 | return ConnectedToNotSymmetric.Matcher.on(engine); | ||
616 | } | ||
617 | |||
618 | @Override | ||
619 | public ConnectedToNotSymmetric.Matcher instantiate() { | ||
620 | return ConnectedToNotSymmetric.Matcher.create(); | ||
621 | } | ||
622 | |||
623 | @Override | ||
624 | public ConnectedToNotSymmetric.Match newEmptyMatch() { | ||
625 | return ConnectedToNotSymmetric.Match.newEmptyMatch(); | ||
626 | } | ||
627 | |||
628 | @Override | ||
629 | public ConnectedToNotSymmetric.Match newMatch(final Object... parameters) { | ||
630 | return ConnectedToNotSymmetric.Match.newMatch((modes3.Segment) parameters[0], (modes3.Segment) parameters[1]); | ||
631 | } | ||
632 | |||
633 | /** | ||
634 | * Inner class allowing the singleton instance of {@link ConnectedToNotSymmetric} to be created | ||
635 | * <b>not</b> at the class load time of the outer class, | ||
636 | * but rather at the first call to {@link ConnectedToNotSymmetric#instance()}. | ||
637 | * | ||
638 | * <p> This workaround is required e.g. to support recursion. | ||
639 | * | ||
640 | */ | ||
641 | private static class LazyHolder { | ||
642 | private static final ConnectedToNotSymmetric INSTANCE = new ConnectedToNotSymmetric(); | ||
643 | |||
644 | /** | ||
645 | * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned. | ||
646 | * This initialization order is required to support indirect recursion. | ||
647 | * | ||
648 | * <p> The static initializer is defined using a helper field to work around limitations of the code generator. | ||
649 | * | ||
650 | */ | ||
651 | private static final Object STATIC_INITIALIZER = ensureInitialized(); | ||
652 | |||
653 | public static Object ensureInitialized() { | ||
654 | INSTANCE.ensureInitializedInternal(); | ||
655 | return null; | ||
656 | } | ||
657 | } | ||
658 | |||
659 | private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { | ||
660 | private static final ConnectedToNotSymmetric.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
661 | |||
662 | private final PParameter parameter_S1 = new PParameter("S1", "modes3.Segment", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.ece.mcgill.ca/wcet/modes3", "Segment")), PParameterDirection.INOUT); | ||
663 | |||
664 | private final PParameter parameter_S2 = new PParameter("S2", "modes3.Segment", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.ece.mcgill.ca/wcet/modes3", "Segment")), PParameterDirection.INOUT); | ||
665 | |||
666 | private final List<PParameter> parameters = Arrays.asList(parameter_S1, parameter_S2); | ||
667 | |||
668 | private GeneratedPQuery() { | ||
669 | super(PVisibility.PUBLIC); | ||
670 | } | ||
671 | |||
672 | @Override | ||
673 | public String getFullyQualifiedName() { | ||
674 | return "modes3.queries.connectedToNotSymmetric"; | ||
675 | } | ||
676 | |||
677 | @Override | ||
678 | public List<String> getParameterNames() { | ||
679 | return Arrays.asList("S1","S2"); | ||
680 | } | ||
681 | |||
682 | @Override | ||
683 | public List<PParameter> getParameters() { | ||
684 | return parameters; | ||
685 | } | ||
686 | |||
687 | @Override | ||
688 | public Set<PBody> doGetContainedBodies() { | ||
689 | setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); | ||
690 | Set<PBody> bodies = new LinkedHashSet<>(); | ||
691 | { | ||
692 | PBody body = new PBody(this); | ||
693 | PVariable var_S1 = body.getOrCreateVariableByName("S1"); | ||
694 | PVariable var_S2 = body.getOrCreateVariableByName("S2"); | ||
695 | new TypeConstraint(body, Tuples.flatTupleOf(var_S1), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Segment"))); | ||
696 | new TypeConstraint(body, Tuples.flatTupleOf(var_S2), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Segment"))); | ||
697 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
698 | new ExportedParameter(body, var_S1, parameter_S1), | ||
699 | new ExportedParameter(body, var_S2, parameter_S2) | ||
700 | )); | ||
701 | // Segment.connectedTo(S1, S2) | ||
702 | new TypeConstraint(body, Tuples.flatTupleOf(var_S1), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Segment"))); | ||
703 | PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); | ||
704 | new TypeConstraint(body, Tuples.flatTupleOf(var_S1, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Segment", "connectedTo"))); | ||
705 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Segment"))); | ||
706 | new Equality(body, var__virtual_0_, var_S2); | ||
707 | // neg find connectedTo(S2, S1) | ||
708 | new NegativePatternCall(body, Tuples.flatTupleOf(var_S2, var_S1), ConnectedTo.instance().getInternalQueryRepresentation()); | ||
709 | bodies.add(body); | ||
710 | } | ||
711 | { | ||
712 | PAnnotation annotation = new PAnnotation("Constraint"); | ||
713 | annotation.addAttribute("message", "connectedToNotSymmetric"); | ||
714 | annotation.addAttribute("severity", "error"); | ||
715 | annotation.addAttribute("key", Arrays.asList(new Object[] { | ||
716 | new ParameterReference("S1"), | ||
717 | new ParameterReference("S2") | ||
718 | })); | ||
719 | addAnnotation(annotation); | ||
720 | } | ||
721 | return bodies; | ||
722 | } | ||
723 | } | ||
724 | } | ||
diff --git a/Domains/ca.mcgill.rtgmrt.example.modes3/vql-gen/modes3/queries/ConnectedToReflexive.java b/Domains/ca.mcgill.rtgmrt.example.modes3/vql-gen/modes3/queries/ConnectedToReflexive.java new file mode 100644 index 00000000..948fec73 --- /dev/null +++ b/Domains/ca.mcgill.rtgmrt.example.modes3/vql-gen/modes3/queries/ConnectedToReflexive.java | |||
@@ -0,0 +1,563 @@ | |||
1 | /** | ||
2 | * Generated from platform:/resource/ca.mcgill.rtgmrt.example.modes3/src/modes3/queries/Modes3Queries.vql | ||
3 | */ | ||
4 | package modes3.queries; | ||
5 | |||
6 | import java.util.Arrays; | ||
7 | import java.util.Collection; | ||
8 | import java.util.LinkedHashSet; | ||
9 | import java.util.List; | ||
10 | import java.util.Objects; | ||
11 | import java.util.Optional; | ||
12 | import java.util.Set; | ||
13 | import java.util.function.Consumer; | ||
14 | import java.util.stream.Collectors; | ||
15 | import java.util.stream.Stream; | ||
16 | import modes3.Segment; | ||
17 | import org.apache.log4j.Logger; | ||
18 | import org.eclipse.emf.ecore.EClass; | ||
19 | import org.eclipse.viatra.query.runtime.api.IPatternMatch; | ||
20 | import org.eclipse.viatra.query.runtime.api.IQuerySpecification; | ||
21 | import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; | ||
22 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
23 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; | ||
24 | import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; | ||
25 | import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; | ||
26 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
27 | import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey; | ||
28 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
29 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
30 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
31 | import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.PAnnotation; | ||
32 | import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.ParameterReference; | ||
33 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; | ||
34 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
35 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
36 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
37 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
38 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
39 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; | ||
40 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | ||
41 | import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; | ||
42 | |||
43 | /** | ||
44 | * A pattern-specific query specification that can instantiate Matcher in a type-safe way. | ||
45 | * | ||
46 | * <p>Original source: | ||
47 | * <code><pre> | ||
48 | * {@literal @}Constraint(message = "connectedToReflexive", severity = "error", key = { S }) | ||
49 | * pattern connectedToReflexive(S : Segment) { | ||
50 | * Segment.connectedTo(S, S); | ||
51 | * } | ||
52 | * </pre></code> | ||
53 | * | ||
54 | * @see Matcher | ||
55 | * @see Match | ||
56 | * | ||
57 | */ | ||
58 | @SuppressWarnings("all") | ||
59 | public final class ConnectedToReflexive extends BaseGeneratedEMFQuerySpecification<ConnectedToReflexive.Matcher> { | ||
60 | /** | ||
61 | * Pattern-specific match representation of the modes3.queries.connectedToReflexive 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 Segment fS; | ||
74 | |||
75 | private static List<String> parameterNames = makeImmutableList("S"); | ||
76 | |||
77 | private Match(final Segment pS) { | ||
78 | this.fS = pS; | ||
79 | } | ||
80 | |||
81 | @Override | ||
82 | public Object get(final String parameterName) { | ||
83 | switch(parameterName) { | ||
84 | case "S": return this.fS; | ||
85 | default: return null; | ||
86 | } | ||
87 | } | ||
88 | |||
89 | @Override | ||
90 | public Object get(final int index) { | ||
91 | switch(index) { | ||
92 | case 0: return this.fS; | ||
93 | default: return null; | ||
94 | } | ||
95 | } | ||
96 | |||
97 | public Segment getS() { | ||
98 | return this.fS; | ||
99 | } | ||
100 | |||
101 | @Override | ||
102 | public boolean set(final String parameterName, final Object newValue) { | ||
103 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
104 | if ("S".equals(parameterName) ) { | ||
105 | this.fS = (Segment) newValue; | ||
106 | return true; | ||
107 | } | ||
108 | return false; | ||
109 | } | ||
110 | |||
111 | public void setS(final Segment pS) { | ||
112 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
113 | this.fS = pS; | ||
114 | } | ||
115 | |||
116 | @Override | ||
117 | public String patternName() { | ||
118 | return "modes3.queries.connectedToReflexive"; | ||
119 | } | ||
120 | |||
121 | @Override | ||
122 | public List<String> parameterNames() { | ||
123 | return ConnectedToReflexive.Match.parameterNames; | ||
124 | } | ||
125 | |||
126 | @Override | ||
127 | public Object[] toArray() { | ||
128 | return new Object[]{fS}; | ||
129 | } | ||
130 | |||
131 | @Override | ||
132 | public ConnectedToReflexive.Match toImmutable() { | ||
133 | return isMutable() ? newMatch(fS) : this; | ||
134 | } | ||
135 | |||
136 | @Override | ||
137 | public String prettyPrint() { | ||
138 | StringBuilder result = new StringBuilder(); | ||
139 | result.append("\"S\"=" + prettyPrintValue(fS)); | ||
140 | return result.toString(); | ||
141 | } | ||
142 | |||
143 | @Override | ||
144 | public int hashCode() { | ||
145 | return Objects.hash(fS); | ||
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 ConnectedToReflexive.Match)) { | ||
156 | ConnectedToReflexive.Match other = (ConnectedToReflexive.Match) obj; | ||
157 | return Objects.equals(fS, other.fS); | ||
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 ConnectedToReflexive specification() { | ||
170 | return ConnectedToReflexive.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 ConnectedToReflexive.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 pS the fixed value of pattern parameter S, or null if not bound. | ||
189 | * @return the new, mutable (partial) match object. | ||
190 | * | ||
191 | */ | ||
192 | public static ConnectedToReflexive.Match newMutableMatch(final Segment pS) { | ||
193 | return new Mutable(pS); | ||
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 pS the fixed value of pattern parameter S, or null if not bound. | ||
201 | * @return the (partial) match object. | ||
202 | * | ||
203 | */ | ||
204 | public static ConnectedToReflexive.Match newMatch(final Segment pS) { | ||
205 | return new Immutable(pS); | ||
206 | } | ||
207 | |||
208 | private static final class Mutable extends ConnectedToReflexive.Match { | ||
209 | Mutable(final Segment pS) { | ||
210 | super(pS); | ||
211 | } | ||
212 | |||
213 | @Override | ||
214 | public boolean isMutable() { | ||
215 | return true; | ||
216 | } | ||
217 | } | ||
218 | |||
219 | private static final class Immutable extends ConnectedToReflexive.Match { | ||
220 | Immutable(final Segment pS) { | ||
221 | super(pS); | ||
222 | } | ||
223 | |||
224 | @Override | ||
225 | public boolean isMutable() { | ||
226 | return false; | ||
227 | } | ||
228 | } | ||
229 | } | ||
230 | |||
231 | /** | ||
232 | * Generated pattern matcher API of the modes3.queries.connectedToReflexive 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 | * {@literal @}Constraint(message = "connectedToReflexive", severity = "error", key = { S }) | ||
243 | * pattern connectedToReflexive(S : Segment) { | ||
244 | * Segment.connectedTo(S, S); | ||
245 | * } | ||
246 | * </pre></code> | ||
247 | * | ||
248 | * @see Match | ||
249 | * @see ConnectedToReflexive | ||
250 | * | ||
251 | */ | ||
252 | public static class Matcher extends BaseMatcher<ConnectedToReflexive.Match> { | ||
253 | /** | ||
254 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
255 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
256 | * | ||
257 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
258 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
259 | * | ||
260 | */ | ||
261 | public static ConnectedToReflexive.Matcher on(final ViatraQueryEngine engine) { | ||
262 | // check if matcher already exists | ||
263 | Matcher matcher = engine.getExistingMatcher(querySpecification()); | ||
264 | if (matcher == null) { | ||
265 | matcher = (Matcher)engine.getMatcher(querySpecification()); | ||
266 | } | ||
267 | return matcher; | ||
268 | } | ||
269 | |||
270 | /** | ||
271 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
272 | * @return an initialized matcher | ||
273 | * @noreference This method is for internal matcher initialization by the framework, do not call it manually. | ||
274 | * | ||
275 | */ | ||
276 | public static ConnectedToReflexive.Matcher create() { | ||
277 | return new Matcher(); | ||
278 | } | ||
279 | |||
280 | private static final int POSITION_S = 0; | ||
281 | |||
282 | private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(ConnectedToReflexive.Matcher.class); | ||
283 | |||
284 | /** | ||
285 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
286 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
287 | * | ||
288 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
289 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
290 | * | ||
291 | */ | ||
292 | private Matcher() { | ||
293 | super(querySpecification()); | ||
294 | } | ||
295 | |||
296 | /** | ||
297 | * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters. | ||
298 | * @param pS the fixed value of pattern parameter S, or null if not bound. | ||
299 | * @return matches represented as a Match object. | ||
300 | * | ||
301 | */ | ||
302 | public Collection<ConnectedToReflexive.Match> getAllMatches(final Segment pS) { | ||
303 | return rawStreamAllMatches(new Object[]{pS}).collect(Collectors.toSet()); | ||
304 | } | ||
305 | |||
306 | /** | ||
307 | * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters. | ||
308 | * </p> | ||
309 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
310 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
311 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
312 | * @param pS the fixed value of pattern parameter S, or null if not bound. | ||
313 | * @return a stream of matches represented as a Match object. | ||
314 | * | ||
315 | */ | ||
316 | public Stream<ConnectedToReflexive.Match> streamAllMatches(final Segment pS) { | ||
317 | return rawStreamAllMatches(new Object[]{pS}); | ||
318 | } | ||
319 | |||
320 | /** | ||
321 | * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
322 | * Neither determinism nor randomness of selection is guaranteed. | ||
323 | * @param pS the fixed value of pattern parameter S, or null if not bound. | ||
324 | * @return a match represented as a Match object, or null if no match is found. | ||
325 | * | ||
326 | */ | ||
327 | public Optional<ConnectedToReflexive.Match> getOneArbitraryMatch(final Segment pS) { | ||
328 | return rawGetOneArbitraryMatch(new Object[]{pS}); | ||
329 | } | ||
330 | |||
331 | /** | ||
332 | * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match, | ||
333 | * under any possible substitution of the unspecified parameters (if any). | ||
334 | * @param pS the fixed value of pattern parameter S, or null if not bound. | ||
335 | * @return true if the input is a valid (partial) match of the pattern. | ||
336 | * | ||
337 | */ | ||
338 | public boolean hasMatch(final Segment pS) { | ||
339 | return rawHasMatch(new Object[]{pS}); | ||
340 | } | ||
341 | |||
342 | /** | ||
343 | * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. | ||
344 | * @param pS the fixed value of pattern parameter S, or null if not bound. | ||
345 | * @return the number of pattern matches found. | ||
346 | * | ||
347 | */ | ||
348 | public int countMatches(final Segment pS) { | ||
349 | return rawCountMatches(new Object[]{pS}); | ||
350 | } | ||
351 | |||
352 | /** | ||
353 | * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
354 | * Neither determinism nor randomness of selection is guaranteed. | ||
355 | * @param pS the fixed value of pattern parameter S, or null if not bound. | ||
356 | * @param processor the action that will process the selected match. | ||
357 | * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked | ||
358 | * | ||
359 | */ | ||
360 | public boolean forOneArbitraryMatch(final Segment pS, final Consumer<? super ConnectedToReflexive.Match> processor) { | ||
361 | return rawForOneArbitraryMatch(new Object[]{pS}, processor); | ||
362 | } | ||
363 | |||
364 | /** | ||
365 | * Returns a new (partial) match. | ||
366 | * This can be used e.g. to call the matcher with a partial match. | ||
367 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
368 | * @param pS the fixed value of pattern parameter S, or null if not bound. | ||
369 | * @return the (partial) match object. | ||
370 | * | ||
371 | */ | ||
372 | public ConnectedToReflexive.Match newMatch(final Segment pS) { | ||
373 | return ConnectedToReflexive.Match.newMatch(pS); | ||
374 | } | ||
375 | |||
376 | /** | ||
377 | * Retrieve the set of values that occur in matches for S. | ||
378 | * @return the Set of all values or empty set if there are no matches | ||
379 | * | ||
380 | */ | ||
381 | protected Stream<Segment> rawStreamAllValuesOfS(final Object[] parameters) { | ||
382 | return rawStreamAllValues(POSITION_S, parameters).map(Segment.class::cast); | ||
383 | } | ||
384 | |||
385 | /** | ||
386 | * Retrieve the set of values that occur in matches for S. | ||
387 | * @return the Set of all values or empty set if there are no matches | ||
388 | * | ||
389 | */ | ||
390 | public Set<Segment> getAllValuesOfS() { | ||
391 | return rawStreamAllValuesOfS(emptyArray()).collect(Collectors.toSet()); | ||
392 | } | ||
393 | |||
394 | /** | ||
395 | * Retrieve the set of values that occur in matches for S. | ||
396 | * @return the Set of all values or empty set if there are no matches | ||
397 | * | ||
398 | */ | ||
399 | public Stream<Segment> streamAllValuesOfS() { | ||
400 | return rawStreamAllValuesOfS(emptyArray()); | ||
401 | } | ||
402 | |||
403 | @Override | ||
404 | protected ConnectedToReflexive.Match tupleToMatch(final Tuple t) { | ||
405 | try { | ||
406 | return ConnectedToReflexive.Match.newMatch((Segment) t.get(POSITION_S)); | ||
407 | } catch(ClassCastException e) { | ||
408 | LOGGER.error("Element(s) in tuple not properly typed!",e); | ||
409 | return null; | ||
410 | } | ||
411 | } | ||
412 | |||
413 | @Override | ||
414 | protected ConnectedToReflexive.Match arrayToMatch(final Object[] match) { | ||
415 | try { | ||
416 | return ConnectedToReflexive.Match.newMatch((Segment) match[POSITION_S]); | ||
417 | } catch(ClassCastException e) { | ||
418 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
419 | return null; | ||
420 | } | ||
421 | } | ||
422 | |||
423 | @Override | ||
424 | protected ConnectedToReflexive.Match arrayToMatchMutable(final Object[] match) { | ||
425 | try { | ||
426 | return ConnectedToReflexive.Match.newMutableMatch((Segment) match[POSITION_S]); | ||
427 | } catch(ClassCastException e) { | ||
428 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
429 | return null; | ||
430 | } | ||
431 | } | ||
432 | |||
433 | /** | ||
434 | * @return the singleton instance of the query specification of this pattern | ||
435 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
436 | * | ||
437 | */ | ||
438 | public static IQuerySpecification<ConnectedToReflexive.Matcher> querySpecification() { | ||
439 | return ConnectedToReflexive.instance(); | ||
440 | } | ||
441 | } | ||
442 | |||
443 | private ConnectedToReflexive() { | ||
444 | super(GeneratedPQuery.INSTANCE); | ||
445 | } | ||
446 | |||
447 | /** | ||
448 | * @return the singleton instance of the query specification | ||
449 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
450 | * | ||
451 | */ | ||
452 | public static ConnectedToReflexive instance() { | ||
453 | try{ | ||
454 | return LazyHolder.INSTANCE; | ||
455 | } catch (ExceptionInInitializerError err) { | ||
456 | throw processInitializerError(err); | ||
457 | } | ||
458 | } | ||
459 | |||
460 | @Override | ||
461 | protected ConnectedToReflexive.Matcher instantiate(final ViatraQueryEngine engine) { | ||
462 | return ConnectedToReflexive.Matcher.on(engine); | ||
463 | } | ||
464 | |||
465 | @Override | ||
466 | public ConnectedToReflexive.Matcher instantiate() { | ||
467 | return ConnectedToReflexive.Matcher.create(); | ||
468 | } | ||
469 | |||
470 | @Override | ||
471 | public ConnectedToReflexive.Match newEmptyMatch() { | ||
472 | return ConnectedToReflexive.Match.newEmptyMatch(); | ||
473 | } | ||
474 | |||
475 | @Override | ||
476 | public ConnectedToReflexive.Match newMatch(final Object... parameters) { | ||
477 | return ConnectedToReflexive.Match.newMatch((modes3.Segment) parameters[0]); | ||
478 | } | ||
479 | |||
480 | /** | ||
481 | * Inner class allowing the singleton instance of {@link ConnectedToReflexive} to be created | ||
482 | * <b>not</b> at the class load time of the outer class, | ||
483 | * but rather at the first call to {@link ConnectedToReflexive#instance()}. | ||
484 | * | ||
485 | * <p> This workaround is required e.g. to support recursion. | ||
486 | * | ||
487 | */ | ||
488 | private static class LazyHolder { | ||
489 | private static final ConnectedToReflexive INSTANCE = new ConnectedToReflexive(); | ||
490 | |||
491 | /** | ||
492 | * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned. | ||
493 | * This initialization order is required to support indirect recursion. | ||
494 | * | ||
495 | * <p> The static initializer is defined using a helper field to work around limitations of the code generator. | ||
496 | * | ||
497 | */ | ||
498 | private static final Object STATIC_INITIALIZER = ensureInitialized(); | ||
499 | |||
500 | public static Object ensureInitialized() { | ||
501 | INSTANCE.ensureInitializedInternal(); | ||
502 | return null; | ||
503 | } | ||
504 | } | ||
505 | |||
506 | private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { | ||
507 | private static final ConnectedToReflexive.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
508 | |||
509 | private final PParameter parameter_S = new PParameter("S", "modes3.Segment", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.ece.mcgill.ca/wcet/modes3", "Segment")), PParameterDirection.INOUT); | ||
510 | |||
511 | private final List<PParameter> parameters = Arrays.asList(parameter_S); | ||
512 | |||
513 | private GeneratedPQuery() { | ||
514 | super(PVisibility.PUBLIC); | ||
515 | } | ||
516 | |||
517 | @Override | ||
518 | public String getFullyQualifiedName() { | ||
519 | return "modes3.queries.connectedToReflexive"; | ||
520 | } | ||
521 | |||
522 | @Override | ||
523 | public List<String> getParameterNames() { | ||
524 | return Arrays.asList("S"); | ||
525 | } | ||
526 | |||
527 | @Override | ||
528 | public List<PParameter> getParameters() { | ||
529 | return parameters; | ||
530 | } | ||
531 | |||
532 | @Override | ||
533 | public Set<PBody> doGetContainedBodies() { | ||
534 | setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); | ||
535 | Set<PBody> bodies = new LinkedHashSet<>(); | ||
536 | { | ||
537 | PBody body = new PBody(this); | ||
538 | PVariable var_S = body.getOrCreateVariableByName("S"); | ||
539 | new TypeConstraint(body, Tuples.flatTupleOf(var_S), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Segment"))); | ||
540 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
541 | new ExportedParameter(body, var_S, parameter_S) | ||
542 | )); | ||
543 | // Segment.connectedTo(S, S) | ||
544 | new TypeConstraint(body, Tuples.flatTupleOf(var_S), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Segment"))); | ||
545 | PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); | ||
546 | new TypeConstraint(body, Tuples.flatTupleOf(var_S, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Segment", "connectedTo"))); | ||
547 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Segment"))); | ||
548 | new Equality(body, var__virtual_0_, var_S); | ||
549 | bodies.add(body); | ||
550 | } | ||
551 | { | ||
552 | PAnnotation annotation = new PAnnotation("Constraint"); | ||
553 | annotation.addAttribute("message", "connectedToReflexive"); | ||
554 | annotation.addAttribute("severity", "error"); | ||
555 | annotation.addAttribute("key", Arrays.asList(new Object[] { | ||
556 | new ParameterReference("S") | ||
557 | })); | ||
558 | addAnnotation(annotation); | ||
559 | } | ||
560 | return bodies; | ||
561 | } | ||
562 | } | ||
563 | } | ||
diff --git a/Domains/ca.mcgill.rtgmrt.example.modes3/vql-gen/modes3/queries/ExtraInputOfTurnout.java b/Domains/ca.mcgill.rtgmrt.example.modes3/vql-gen/modes3/queries/ExtraInputOfTurnout.java new file mode 100644 index 00000000..62e2a54d --- /dev/null +++ b/Domains/ca.mcgill.rtgmrt.example.modes3/vql-gen/modes3/queries/ExtraInputOfTurnout.java | |||
@@ -0,0 +1,730 @@ | |||
1 | /** | ||
2 | * Generated from platform:/resource/ca.mcgill.rtgmrt.example.modes3/src/modes3/queries/Modes3Queries.vql | ||
3 | */ | ||
4 | package modes3.queries; | ||
5 | |||
6 | import java.util.Arrays; | ||
7 | import java.util.Collection; | ||
8 | import java.util.LinkedHashSet; | ||
9 | import java.util.List; | ||
10 | import java.util.Objects; | ||
11 | import java.util.Optional; | ||
12 | import java.util.Set; | ||
13 | import java.util.function.Consumer; | ||
14 | import java.util.stream.Collectors; | ||
15 | import java.util.stream.Stream; | ||
16 | import modes3.Segment; | ||
17 | import modes3.Turnout; | ||
18 | import modes3.queries.Output; | ||
19 | import org.apache.log4j.Logger; | ||
20 | import org.eclipse.emf.ecore.EClass; | ||
21 | import org.eclipse.viatra.query.runtime.api.IPatternMatch; | ||
22 | import org.eclipse.viatra.query.runtime.api.IQuerySpecification; | ||
23 | import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; | ||
24 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
25 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; | ||
26 | import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; | ||
27 | import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; | ||
28 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
29 | import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey; | ||
30 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
31 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
32 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
33 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; | ||
34 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
35 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Inequality; | ||
36 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.PositivePatternCall; | ||
37 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
38 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
39 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
40 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
41 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; | ||
42 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | ||
43 | import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; | ||
44 | |||
45 | /** | ||
46 | * A pattern-specific query specification that can instantiate Matcher in a type-safe way. | ||
47 | * | ||
48 | * <p>Original source: | ||
49 | * <code><pre> | ||
50 | * pattern extraInputOfTurnout(T : Turnout, S : Segment) { | ||
51 | * Turnout.straight(T, Straight); | ||
52 | * Turnout.divergent(T, Divergent); | ||
53 | * find output(S, T); | ||
54 | * S != Straight; | ||
55 | * S != Divergent; | ||
56 | * } | ||
57 | * </pre></code> | ||
58 | * | ||
59 | * @see Matcher | ||
60 | * @see Match | ||
61 | * | ||
62 | */ | ||
63 | @SuppressWarnings("all") | ||
64 | public final class ExtraInputOfTurnout extends BaseGeneratedEMFQuerySpecification<ExtraInputOfTurnout.Matcher> { | ||
65 | /** | ||
66 | * Pattern-specific match representation of the modes3.queries.extraInputOfTurnout pattern, | ||
67 | * to be used in conjunction with {@link Matcher}. | ||
68 | * | ||
69 | * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned. | ||
70 | * Each instance is a (possibly partial) substitution of pattern parameters, | ||
71 | * usable to represent a match of the pattern in the result of a query, | ||
72 | * or to specify the bound (fixed) input parameters when issuing a query. | ||
73 | * | ||
74 | * @see Matcher | ||
75 | * | ||
76 | */ | ||
77 | public static abstract class Match extends BasePatternMatch { | ||
78 | private Turnout fT; | ||
79 | |||
80 | private Segment fS; | ||
81 | |||
82 | private static List<String> parameterNames = makeImmutableList("T", "S"); | ||
83 | |||
84 | private Match(final Turnout pT, final Segment pS) { | ||
85 | this.fT = pT; | ||
86 | this.fS = pS; | ||
87 | } | ||
88 | |||
89 | @Override | ||
90 | public Object get(final String parameterName) { | ||
91 | switch(parameterName) { | ||
92 | case "T": return this.fT; | ||
93 | case "S": return this.fS; | ||
94 | default: return null; | ||
95 | } | ||
96 | } | ||
97 | |||
98 | @Override | ||
99 | public Object get(final int index) { | ||
100 | switch(index) { | ||
101 | case 0: return this.fT; | ||
102 | case 1: return this.fS; | ||
103 | default: return null; | ||
104 | } | ||
105 | } | ||
106 | |||
107 | public Turnout getT() { | ||
108 | return this.fT; | ||
109 | } | ||
110 | |||
111 | public Segment getS() { | ||
112 | return this.fS; | ||
113 | } | ||
114 | |||
115 | @Override | ||
116 | public boolean set(final String parameterName, final Object newValue) { | ||
117 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
118 | if ("T".equals(parameterName) ) { | ||
119 | this.fT = (Turnout) newValue; | ||
120 | return true; | ||
121 | } | ||
122 | if ("S".equals(parameterName) ) { | ||
123 | this.fS = (Segment) newValue; | ||
124 | return true; | ||
125 | } | ||
126 | return false; | ||
127 | } | ||
128 | |||
129 | public void setT(final Turnout pT) { | ||
130 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
131 | this.fT = pT; | ||
132 | } | ||
133 | |||
134 | public void setS(final Segment pS) { | ||
135 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
136 | this.fS = pS; | ||
137 | } | ||
138 | |||
139 | @Override | ||
140 | public String patternName() { | ||
141 | return "modes3.queries.extraInputOfTurnout"; | ||
142 | } | ||
143 | |||
144 | @Override | ||
145 | public List<String> parameterNames() { | ||
146 | return ExtraInputOfTurnout.Match.parameterNames; | ||
147 | } | ||
148 | |||
149 | @Override | ||
150 | public Object[] toArray() { | ||
151 | return new Object[]{fT, fS}; | ||
152 | } | ||
153 | |||
154 | @Override | ||
155 | public ExtraInputOfTurnout.Match toImmutable() { | ||
156 | return isMutable() ? newMatch(fT, fS) : this; | ||
157 | } | ||
158 | |||
159 | @Override | ||
160 | public String prettyPrint() { | ||
161 | StringBuilder result = new StringBuilder(); | ||
162 | result.append("\"T\"=" + prettyPrintValue(fT) + ", "); | ||
163 | result.append("\"S\"=" + prettyPrintValue(fS)); | ||
164 | return result.toString(); | ||
165 | } | ||
166 | |||
167 | @Override | ||
168 | public int hashCode() { | ||
169 | return Objects.hash(fT, fS); | ||
170 | } | ||
171 | |||
172 | @Override | ||
173 | public boolean equals(final Object obj) { | ||
174 | if (this == obj) | ||
175 | return true; | ||
176 | if (obj == null) { | ||
177 | return false; | ||
178 | } | ||
179 | if ((obj instanceof ExtraInputOfTurnout.Match)) { | ||
180 | ExtraInputOfTurnout.Match other = (ExtraInputOfTurnout.Match) obj; | ||
181 | return Objects.equals(fT, other.fT) && Objects.equals(fS, other.fS); | ||
182 | } else { | ||
183 | // this should be infrequent | ||
184 | if (!(obj instanceof IPatternMatch)) { | ||
185 | return false; | ||
186 | } | ||
187 | IPatternMatch otherSig = (IPatternMatch) obj; | ||
188 | return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray()); | ||
189 | } | ||
190 | } | ||
191 | |||
192 | @Override | ||
193 | public ExtraInputOfTurnout specification() { | ||
194 | return ExtraInputOfTurnout.instance(); | ||
195 | } | ||
196 | |||
197 | /** | ||
198 | * Returns an empty, mutable match. | ||
199 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
200 | * | ||
201 | * @return the empty match. | ||
202 | * | ||
203 | */ | ||
204 | public static ExtraInputOfTurnout.Match newEmptyMatch() { | ||
205 | return new Mutable(null, null); | ||
206 | } | ||
207 | |||
208 | /** | ||
209 | * Returns a mutable (partial) match. | ||
210 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
211 | * | ||
212 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
213 | * @param pS the fixed value of pattern parameter S, or null if not bound. | ||
214 | * @return the new, mutable (partial) match object. | ||
215 | * | ||
216 | */ | ||
217 | public static ExtraInputOfTurnout.Match newMutableMatch(final Turnout pT, final Segment pS) { | ||
218 | return new Mutable(pT, pS); | ||
219 | } | ||
220 | |||
221 | /** | ||
222 | * Returns a new (partial) match. | ||
223 | * This can be used e.g. to call the matcher with a partial match. | ||
224 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
225 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
226 | * @param pS the fixed value of pattern parameter S, or null if not bound. | ||
227 | * @return the (partial) match object. | ||
228 | * | ||
229 | */ | ||
230 | public static ExtraInputOfTurnout.Match newMatch(final Turnout pT, final Segment pS) { | ||
231 | return new Immutable(pT, pS); | ||
232 | } | ||
233 | |||
234 | private static final class Mutable extends ExtraInputOfTurnout.Match { | ||
235 | Mutable(final Turnout pT, final Segment pS) { | ||
236 | super(pT, pS); | ||
237 | } | ||
238 | |||
239 | @Override | ||
240 | public boolean isMutable() { | ||
241 | return true; | ||
242 | } | ||
243 | } | ||
244 | |||
245 | private static final class Immutable extends ExtraInputOfTurnout.Match { | ||
246 | Immutable(final Turnout pT, final Segment pS) { | ||
247 | super(pT, pS); | ||
248 | } | ||
249 | |||
250 | @Override | ||
251 | public boolean isMutable() { | ||
252 | return false; | ||
253 | } | ||
254 | } | ||
255 | } | ||
256 | |||
257 | /** | ||
258 | * Generated pattern matcher API of the modes3.queries.extraInputOfTurnout pattern, | ||
259 | * providing pattern-specific query methods. | ||
260 | * | ||
261 | * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)}, | ||
262 | * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}. | ||
263 | * | ||
264 | * <p>Matches of the pattern will be represented as {@link Match}. | ||
265 | * | ||
266 | * <p>Original source: | ||
267 | * <code><pre> | ||
268 | * pattern extraInputOfTurnout(T : Turnout, S : Segment) { | ||
269 | * Turnout.straight(T, Straight); | ||
270 | * Turnout.divergent(T, Divergent); | ||
271 | * find output(S, T); | ||
272 | * S != Straight; | ||
273 | * S != Divergent; | ||
274 | * } | ||
275 | * </pre></code> | ||
276 | * | ||
277 | * @see Match | ||
278 | * @see ExtraInputOfTurnout | ||
279 | * | ||
280 | */ | ||
281 | public static class Matcher extends BaseMatcher<ExtraInputOfTurnout.Match> { | ||
282 | /** | ||
283 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
284 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
285 | * | ||
286 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
287 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
288 | * | ||
289 | */ | ||
290 | public static ExtraInputOfTurnout.Matcher on(final ViatraQueryEngine engine) { | ||
291 | // check if matcher already exists | ||
292 | Matcher matcher = engine.getExistingMatcher(querySpecification()); | ||
293 | if (matcher == null) { | ||
294 | matcher = (Matcher)engine.getMatcher(querySpecification()); | ||
295 | } | ||
296 | return matcher; | ||
297 | } | ||
298 | |||
299 | /** | ||
300 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
301 | * @return an initialized matcher | ||
302 | * @noreference This method is for internal matcher initialization by the framework, do not call it manually. | ||
303 | * | ||
304 | */ | ||
305 | public static ExtraInputOfTurnout.Matcher create() { | ||
306 | return new Matcher(); | ||
307 | } | ||
308 | |||
309 | private static final int POSITION_T = 0; | ||
310 | |||
311 | private static final int POSITION_S = 1; | ||
312 | |||
313 | private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(ExtraInputOfTurnout.Matcher.class); | ||
314 | |||
315 | /** | ||
316 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
317 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
318 | * | ||
319 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
320 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
321 | * | ||
322 | */ | ||
323 | private Matcher() { | ||
324 | super(querySpecification()); | ||
325 | } | ||
326 | |||
327 | /** | ||
328 | * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters. | ||
329 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
330 | * @param pS the fixed value of pattern parameter S, or null if not bound. | ||
331 | * @return matches represented as a Match object. | ||
332 | * | ||
333 | */ | ||
334 | public Collection<ExtraInputOfTurnout.Match> getAllMatches(final Turnout pT, final Segment pS) { | ||
335 | return rawStreamAllMatches(new Object[]{pT, pS}).collect(Collectors.toSet()); | ||
336 | } | ||
337 | |||
338 | /** | ||
339 | * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters. | ||
340 | * </p> | ||
341 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
342 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
343 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
344 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
345 | * @param pS the fixed value of pattern parameter S, or null if not bound. | ||
346 | * @return a stream of matches represented as a Match object. | ||
347 | * | ||
348 | */ | ||
349 | public Stream<ExtraInputOfTurnout.Match> streamAllMatches(final Turnout pT, final Segment pS) { | ||
350 | return rawStreamAllMatches(new Object[]{pT, pS}); | ||
351 | } | ||
352 | |||
353 | /** | ||
354 | * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
355 | * Neither determinism nor randomness of selection is guaranteed. | ||
356 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
357 | * @param pS the fixed value of pattern parameter S, or null if not bound. | ||
358 | * @return a match represented as a Match object, or null if no match is found. | ||
359 | * | ||
360 | */ | ||
361 | public Optional<ExtraInputOfTurnout.Match> getOneArbitraryMatch(final Turnout pT, final Segment pS) { | ||
362 | return rawGetOneArbitraryMatch(new Object[]{pT, pS}); | ||
363 | } | ||
364 | |||
365 | /** | ||
366 | * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match, | ||
367 | * under any possible substitution of the unspecified parameters (if any). | ||
368 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
369 | * @param pS the fixed value of pattern parameter S, or null if not bound. | ||
370 | * @return true if the input is a valid (partial) match of the pattern. | ||
371 | * | ||
372 | */ | ||
373 | public boolean hasMatch(final Turnout pT, final Segment pS) { | ||
374 | return rawHasMatch(new Object[]{pT, pS}); | ||
375 | } | ||
376 | |||
377 | /** | ||
378 | * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. | ||
379 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
380 | * @param pS the fixed value of pattern parameter S, or null if not bound. | ||
381 | * @return the number of pattern matches found. | ||
382 | * | ||
383 | */ | ||
384 | public int countMatches(final Turnout pT, final Segment pS) { | ||
385 | return rawCountMatches(new Object[]{pT, pS}); | ||
386 | } | ||
387 | |||
388 | /** | ||
389 | * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
390 | * Neither determinism nor randomness of selection is guaranteed. | ||
391 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
392 | * @param pS the fixed value of pattern parameter S, or null if not bound. | ||
393 | * @param processor the action that will process the selected match. | ||
394 | * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked | ||
395 | * | ||
396 | */ | ||
397 | public boolean forOneArbitraryMatch(final Turnout pT, final Segment pS, final Consumer<? super ExtraInputOfTurnout.Match> processor) { | ||
398 | return rawForOneArbitraryMatch(new Object[]{pT, pS}, processor); | ||
399 | } | ||
400 | |||
401 | /** | ||
402 | * Returns a new (partial) match. | ||
403 | * This can be used e.g. to call the matcher with a partial match. | ||
404 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
405 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
406 | * @param pS the fixed value of pattern parameter S, or null if not bound. | ||
407 | * @return the (partial) match object. | ||
408 | * | ||
409 | */ | ||
410 | public ExtraInputOfTurnout.Match newMatch(final Turnout pT, final Segment pS) { | ||
411 | return ExtraInputOfTurnout.Match.newMatch(pT, pS); | ||
412 | } | ||
413 | |||
414 | /** | ||
415 | * Retrieve the set of values that occur in matches for T. | ||
416 | * @return the Set of all values or empty set if there are no matches | ||
417 | * | ||
418 | */ | ||
419 | protected Stream<Turnout> rawStreamAllValuesOfT(final Object[] parameters) { | ||
420 | return rawStreamAllValues(POSITION_T, parameters).map(Turnout.class::cast); | ||
421 | } | ||
422 | |||
423 | /** | ||
424 | * Retrieve the set of values that occur in matches for T. | ||
425 | * @return the Set of all values or empty set if there are no matches | ||
426 | * | ||
427 | */ | ||
428 | public Set<Turnout> getAllValuesOfT() { | ||
429 | return rawStreamAllValuesOfT(emptyArray()).collect(Collectors.toSet()); | ||
430 | } | ||
431 | |||
432 | /** | ||
433 | * Retrieve the set of values that occur in matches for T. | ||
434 | * @return the Set of all values or empty set if there are no matches | ||
435 | * | ||
436 | */ | ||
437 | public Stream<Turnout> streamAllValuesOfT() { | ||
438 | return rawStreamAllValuesOfT(emptyArray()); | ||
439 | } | ||
440 | |||
441 | /** | ||
442 | * Retrieve the set of values that occur in matches for T. | ||
443 | * </p> | ||
444 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
445 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
446 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
447 | * | ||
448 | * @return the Stream of all values or empty set if there are no matches | ||
449 | * | ||
450 | */ | ||
451 | public Stream<Turnout> streamAllValuesOfT(final ExtraInputOfTurnout.Match partialMatch) { | ||
452 | return rawStreamAllValuesOfT(partialMatch.toArray()); | ||
453 | } | ||
454 | |||
455 | /** | ||
456 | * Retrieve the set of values that occur in matches for T. | ||
457 | * </p> | ||
458 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
459 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
460 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
461 | * | ||
462 | * @return the Stream of all values or empty set if there are no matches | ||
463 | * | ||
464 | */ | ||
465 | public Stream<Turnout> streamAllValuesOfT(final Segment pS) { | ||
466 | return rawStreamAllValuesOfT(new Object[]{null, pS}); | ||
467 | } | ||
468 | |||
469 | /** | ||
470 | * Retrieve the set of values that occur in matches for T. | ||
471 | * @return the Set of all values or empty set if there are no matches | ||
472 | * | ||
473 | */ | ||
474 | public Set<Turnout> getAllValuesOfT(final ExtraInputOfTurnout.Match partialMatch) { | ||
475 | return rawStreamAllValuesOfT(partialMatch.toArray()).collect(Collectors.toSet()); | ||
476 | } | ||
477 | |||
478 | /** | ||
479 | * Retrieve the set of values that occur in matches for T. | ||
480 | * @return the Set of all values or empty set if there are no matches | ||
481 | * | ||
482 | */ | ||
483 | public Set<Turnout> getAllValuesOfT(final Segment pS) { | ||
484 | return rawStreamAllValuesOfT(new Object[]{null, pS}).collect(Collectors.toSet()); | ||
485 | } | ||
486 | |||
487 | /** | ||
488 | * Retrieve the set of values that occur in matches for S. | ||
489 | * @return the Set of all values or empty set if there are no matches | ||
490 | * | ||
491 | */ | ||
492 | protected Stream<Segment> rawStreamAllValuesOfS(final Object[] parameters) { | ||
493 | return rawStreamAllValues(POSITION_S, parameters).map(Segment.class::cast); | ||
494 | } | ||
495 | |||
496 | /** | ||
497 | * Retrieve the set of values that occur in matches for S. | ||
498 | * @return the Set of all values or empty set if there are no matches | ||
499 | * | ||
500 | */ | ||
501 | public Set<Segment> getAllValuesOfS() { | ||
502 | return rawStreamAllValuesOfS(emptyArray()).collect(Collectors.toSet()); | ||
503 | } | ||
504 | |||
505 | /** | ||
506 | * Retrieve the set of values that occur in matches for S. | ||
507 | * @return the Set of all values or empty set if there are no matches | ||
508 | * | ||
509 | */ | ||
510 | public Stream<Segment> streamAllValuesOfS() { | ||
511 | return rawStreamAllValuesOfS(emptyArray()); | ||
512 | } | ||
513 | |||
514 | /** | ||
515 | * Retrieve the set of values that occur in matches for S. | ||
516 | * </p> | ||
517 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
518 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
519 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
520 | * | ||
521 | * @return the Stream of all values or empty set if there are no matches | ||
522 | * | ||
523 | */ | ||
524 | public Stream<Segment> streamAllValuesOfS(final ExtraInputOfTurnout.Match partialMatch) { | ||
525 | return rawStreamAllValuesOfS(partialMatch.toArray()); | ||
526 | } | ||
527 | |||
528 | /** | ||
529 | * Retrieve the set of values that occur in matches for S. | ||
530 | * </p> | ||
531 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
532 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
533 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
534 | * | ||
535 | * @return the Stream of all values or empty set if there are no matches | ||
536 | * | ||
537 | */ | ||
538 | public Stream<Segment> streamAllValuesOfS(final Turnout pT) { | ||
539 | return rawStreamAllValuesOfS(new Object[]{pT, null}); | ||
540 | } | ||
541 | |||
542 | /** | ||
543 | * Retrieve the set of values that occur in matches for S. | ||
544 | * @return the Set of all values or empty set if there are no matches | ||
545 | * | ||
546 | */ | ||
547 | public Set<Segment> getAllValuesOfS(final ExtraInputOfTurnout.Match partialMatch) { | ||
548 | return rawStreamAllValuesOfS(partialMatch.toArray()).collect(Collectors.toSet()); | ||
549 | } | ||
550 | |||
551 | /** | ||
552 | * Retrieve the set of values that occur in matches for S. | ||
553 | * @return the Set of all values or empty set if there are no matches | ||
554 | * | ||
555 | */ | ||
556 | public Set<Segment> getAllValuesOfS(final Turnout pT) { | ||
557 | return rawStreamAllValuesOfS(new Object[]{pT, null}).collect(Collectors.toSet()); | ||
558 | } | ||
559 | |||
560 | @Override | ||
561 | protected ExtraInputOfTurnout.Match tupleToMatch(final Tuple t) { | ||
562 | try { | ||
563 | return ExtraInputOfTurnout.Match.newMatch((Turnout) t.get(POSITION_T), (Segment) t.get(POSITION_S)); | ||
564 | } catch(ClassCastException e) { | ||
565 | LOGGER.error("Element(s) in tuple not properly typed!",e); | ||
566 | return null; | ||
567 | } | ||
568 | } | ||
569 | |||
570 | @Override | ||
571 | protected ExtraInputOfTurnout.Match arrayToMatch(final Object[] match) { | ||
572 | try { | ||
573 | return ExtraInputOfTurnout.Match.newMatch((Turnout) match[POSITION_T], (Segment) match[POSITION_S]); | ||
574 | } catch(ClassCastException e) { | ||
575 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
576 | return null; | ||
577 | } | ||
578 | } | ||
579 | |||
580 | @Override | ||
581 | protected ExtraInputOfTurnout.Match arrayToMatchMutable(final Object[] match) { | ||
582 | try { | ||
583 | return ExtraInputOfTurnout.Match.newMutableMatch((Turnout) match[POSITION_T], (Segment) match[POSITION_S]); | ||
584 | } catch(ClassCastException e) { | ||
585 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
586 | return null; | ||
587 | } | ||
588 | } | ||
589 | |||
590 | /** | ||
591 | * @return the singleton instance of the query specification of this pattern | ||
592 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
593 | * | ||
594 | */ | ||
595 | public static IQuerySpecification<ExtraInputOfTurnout.Matcher> querySpecification() { | ||
596 | return ExtraInputOfTurnout.instance(); | ||
597 | } | ||
598 | } | ||
599 | |||
600 | private ExtraInputOfTurnout() { | ||
601 | super(GeneratedPQuery.INSTANCE); | ||
602 | } | ||
603 | |||
604 | /** | ||
605 | * @return the singleton instance of the query specification | ||
606 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
607 | * | ||
608 | */ | ||
609 | public static ExtraInputOfTurnout instance() { | ||
610 | try{ | ||
611 | return LazyHolder.INSTANCE; | ||
612 | } catch (ExceptionInInitializerError err) { | ||
613 | throw processInitializerError(err); | ||
614 | } | ||
615 | } | ||
616 | |||
617 | @Override | ||
618 | protected ExtraInputOfTurnout.Matcher instantiate(final ViatraQueryEngine engine) { | ||
619 | return ExtraInputOfTurnout.Matcher.on(engine); | ||
620 | } | ||
621 | |||
622 | @Override | ||
623 | public ExtraInputOfTurnout.Matcher instantiate() { | ||
624 | return ExtraInputOfTurnout.Matcher.create(); | ||
625 | } | ||
626 | |||
627 | @Override | ||
628 | public ExtraInputOfTurnout.Match newEmptyMatch() { | ||
629 | return ExtraInputOfTurnout.Match.newEmptyMatch(); | ||
630 | } | ||
631 | |||
632 | @Override | ||
633 | public ExtraInputOfTurnout.Match newMatch(final Object... parameters) { | ||
634 | return ExtraInputOfTurnout.Match.newMatch((modes3.Turnout) parameters[0], (modes3.Segment) parameters[1]); | ||
635 | } | ||
636 | |||
637 | /** | ||
638 | * Inner class allowing the singleton instance of {@link ExtraInputOfTurnout} to be created | ||
639 | * <b>not</b> at the class load time of the outer class, | ||
640 | * but rather at the first call to {@link ExtraInputOfTurnout#instance()}. | ||
641 | * | ||
642 | * <p> This workaround is required e.g. to support recursion. | ||
643 | * | ||
644 | */ | ||
645 | private static class LazyHolder { | ||
646 | private static final ExtraInputOfTurnout INSTANCE = new ExtraInputOfTurnout(); | ||
647 | |||
648 | /** | ||
649 | * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned. | ||
650 | * This initialization order is required to support indirect recursion. | ||
651 | * | ||
652 | * <p> The static initializer is defined using a helper field to work around limitations of the code generator. | ||
653 | * | ||
654 | */ | ||
655 | private static final Object STATIC_INITIALIZER = ensureInitialized(); | ||
656 | |||
657 | public static Object ensureInitialized() { | ||
658 | INSTANCE.ensureInitializedInternal(); | ||
659 | return null; | ||
660 | } | ||
661 | } | ||
662 | |||
663 | private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { | ||
664 | private static final ExtraInputOfTurnout.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
665 | |||
666 | private final PParameter parameter_T = new PParameter("T", "modes3.Turnout", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.ece.mcgill.ca/wcet/modes3", "Turnout")), PParameterDirection.INOUT); | ||
667 | |||
668 | private final PParameter parameter_S = new PParameter("S", "modes3.Segment", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.ece.mcgill.ca/wcet/modes3", "Segment")), PParameterDirection.INOUT); | ||
669 | |||
670 | private final List<PParameter> parameters = Arrays.asList(parameter_T, parameter_S); | ||
671 | |||
672 | private GeneratedPQuery() { | ||
673 | super(PVisibility.PUBLIC); | ||
674 | } | ||
675 | |||
676 | @Override | ||
677 | public String getFullyQualifiedName() { | ||
678 | return "modes3.queries.extraInputOfTurnout"; | ||
679 | } | ||
680 | |||
681 | @Override | ||
682 | public List<String> getParameterNames() { | ||
683 | return Arrays.asList("T","S"); | ||
684 | } | ||
685 | |||
686 | @Override | ||
687 | public List<PParameter> getParameters() { | ||
688 | return parameters; | ||
689 | } | ||
690 | |||
691 | @Override | ||
692 | public Set<PBody> doGetContainedBodies() { | ||
693 | setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); | ||
694 | Set<PBody> bodies = new LinkedHashSet<>(); | ||
695 | { | ||
696 | PBody body = new PBody(this); | ||
697 | PVariable var_T = body.getOrCreateVariableByName("T"); | ||
698 | PVariable var_S = body.getOrCreateVariableByName("S"); | ||
699 | PVariable var_Straight = body.getOrCreateVariableByName("Straight"); | ||
700 | PVariable var_Divergent = body.getOrCreateVariableByName("Divergent"); | ||
701 | new TypeConstraint(body, Tuples.flatTupleOf(var_T), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Turnout"))); | ||
702 | new TypeConstraint(body, Tuples.flatTupleOf(var_S), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Segment"))); | ||
703 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
704 | new ExportedParameter(body, var_T, parameter_T), | ||
705 | new ExportedParameter(body, var_S, parameter_S) | ||
706 | )); | ||
707 | // Turnout.straight(T, Straight) | ||
708 | new TypeConstraint(body, Tuples.flatTupleOf(var_T), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Turnout"))); | ||
709 | PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); | ||
710 | new TypeConstraint(body, Tuples.flatTupleOf(var_T, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Turnout", "straight"))); | ||
711 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Segment"))); | ||
712 | new Equality(body, var__virtual_0_, var_Straight); | ||
713 | // Turnout.divergent(T, Divergent) | ||
714 | new TypeConstraint(body, Tuples.flatTupleOf(var_T), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Turnout"))); | ||
715 | PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}"); | ||
716 | new TypeConstraint(body, Tuples.flatTupleOf(var_T, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Turnout", "divergent"))); | ||
717 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Segment"))); | ||
718 | new Equality(body, var__virtual_1_, var_Divergent); | ||
719 | // find output(S, T) | ||
720 | new PositivePatternCall(body, Tuples.flatTupleOf(var_S, var_T), Output.instance().getInternalQueryRepresentation()); | ||
721 | // S != Straight | ||
722 | new Inequality(body, var_S, var_Straight); | ||
723 | // S != Divergent | ||
724 | new Inequality(body, var_S, var_Divergent); | ||
725 | bodies.add(body); | ||
726 | } | ||
727 | return bodies; | ||
728 | } | ||
729 | } | ||
730 | } | ||
diff --git a/Domains/ca.mcgill.rtgmrt.example.modes3/vql-gen/modes3/queries/Modes3Queries.java b/Domains/ca.mcgill.rtgmrt.example.modes3/vql-gen/modes3/queries/Modes3Queries.java new file mode 100644 index 00000000..01ec77a1 --- /dev/null +++ b/Domains/ca.mcgill.rtgmrt.example.modes3/vql-gen/modes3/queries/Modes3Queries.java | |||
@@ -0,0 +1,229 @@ | |||
1 | /** | ||
2 | * Generated from platform:/resource/ca.mcgill.rtgmrt.example.modes3/src/modes3/queries/Modes3Queries.vql | ||
3 | */ | ||
4 | package modes3.queries; | ||
5 | |||
6 | import modes3.queries.Adjacent; | ||
7 | import modes3.queries.ConnectedTo; | ||
8 | import modes3.queries.ConnectedToNotSymmetric; | ||
9 | import modes3.queries.ConnectedToReflexive; | ||
10 | import modes3.queries.ExtraInputOfTurnout; | ||
11 | import modes3.queries.NoExtraInputOfTurnout; | ||
12 | import modes3.queries.Output; | ||
13 | import modes3.queries.OutputReflexive; | ||
14 | import modes3.queries.Reachable; | ||
15 | import modes3.queries.TooManyExtraInputsOfTurnout; | ||
16 | import modes3.queries.TooManyInputsOfSegment; | ||
17 | import modes3.queries.Turnout; | ||
18 | import modes3.queries.TurnoutConnectedToBothOutputs; | ||
19 | import modes3.queries.TurnoutInSegments; | ||
20 | import modes3.queries.TurnoutOutput; | ||
21 | import modes3.queries.TurnoutOutputsAreSame; | ||
22 | import modes3.queries.Unreachable; | ||
23 | import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; | ||
24 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedPatternGroup; | ||
25 | |||
26 | /** | ||
27 | * A pattern group formed of all public patterns defined in Modes3Queries.vql. | ||
28 | * | ||
29 | * <p>Use the static instance as any {@link interface org.eclipse.viatra.query.runtime.api.IQueryGroup}, to conveniently prepare | ||
30 | * a VIATRA Query engine for matching all patterns originally defined in file Modes3Queries.vql, | ||
31 | * in order to achieve better performance than one-by-one on-demand matcher initialization. | ||
32 | * | ||
33 | * <p> From package modes3.queries, the group contains the definition of the following patterns: <ul> | ||
34 | * <li>turnoutInSegments</li> | ||
35 | * <li>connectedTo</li> | ||
36 | * <li>connectedToNotSymmetric</li> | ||
37 | * <li>connectedToReflexive</li> | ||
38 | * <li>turnoutOutput</li> | ||
39 | * <li>outputReflexive</li> | ||
40 | * <li>turnoutOutputsAreSame</li> | ||
41 | * <li>turnout</li> | ||
42 | * <li>output</li> | ||
43 | * <li>tooManyInputsOfSegment</li> | ||
44 | * <li>turnoutConnectedToBothOutputs</li> | ||
45 | * <li>extraInputOfTurnout</li> | ||
46 | * <li>noExtraInputOfTurnout</li> | ||
47 | * <li>tooManyExtraInputsOfTurnout</li> | ||
48 | * <li>adjacent</li> | ||
49 | * <li>reachable</li> | ||
50 | * <li>unreachable</li> | ||
51 | * </ul> | ||
52 | * | ||
53 | * @see IQueryGroup | ||
54 | * | ||
55 | */ | ||
56 | @SuppressWarnings("all") | ||
57 | public final class Modes3Queries extends BaseGeneratedPatternGroup { | ||
58 | /** | ||
59 | * Access the pattern group. | ||
60 | * | ||
61 | * @return the singleton instance of the group | ||
62 | * @throws ViatraQueryRuntimeException if there was an error loading the generated code of pattern specifications | ||
63 | * | ||
64 | */ | ||
65 | public static Modes3Queries instance() { | ||
66 | if (INSTANCE == null) { | ||
67 | INSTANCE = new Modes3Queries(); | ||
68 | } | ||
69 | return INSTANCE; | ||
70 | } | ||
71 | |||
72 | private static Modes3Queries INSTANCE; | ||
73 | |||
74 | private Modes3Queries() { | ||
75 | querySpecifications.add(TurnoutInSegments.instance()); | ||
76 | querySpecifications.add(ConnectedTo.instance()); | ||
77 | querySpecifications.add(ConnectedToNotSymmetric.instance()); | ||
78 | querySpecifications.add(ConnectedToReflexive.instance()); | ||
79 | querySpecifications.add(TurnoutOutput.instance()); | ||
80 | querySpecifications.add(OutputReflexive.instance()); | ||
81 | querySpecifications.add(TurnoutOutputsAreSame.instance()); | ||
82 | querySpecifications.add(Turnout.instance()); | ||
83 | querySpecifications.add(Output.instance()); | ||
84 | querySpecifications.add(TooManyInputsOfSegment.instance()); | ||
85 | querySpecifications.add(TurnoutConnectedToBothOutputs.instance()); | ||
86 | querySpecifications.add(ExtraInputOfTurnout.instance()); | ||
87 | querySpecifications.add(NoExtraInputOfTurnout.instance()); | ||
88 | querySpecifications.add(TooManyExtraInputsOfTurnout.instance()); | ||
89 | querySpecifications.add(Adjacent.instance()); | ||
90 | querySpecifications.add(Reachable.instance()); | ||
91 | querySpecifications.add(Unreachable.instance()); | ||
92 | } | ||
93 | |||
94 | public TurnoutInSegments getTurnoutInSegments() { | ||
95 | return TurnoutInSegments.instance(); | ||
96 | } | ||
97 | |||
98 | public TurnoutInSegments.Matcher getTurnoutInSegments(final ViatraQueryEngine engine) { | ||
99 | return TurnoutInSegments.Matcher.on(engine); | ||
100 | } | ||
101 | |||
102 | public ConnectedTo getConnectedTo() { | ||
103 | return ConnectedTo.instance(); | ||
104 | } | ||
105 | |||
106 | public ConnectedTo.Matcher getConnectedTo(final ViatraQueryEngine engine) { | ||
107 | return ConnectedTo.Matcher.on(engine); | ||
108 | } | ||
109 | |||
110 | public ConnectedToNotSymmetric getConnectedToNotSymmetric() { | ||
111 | return ConnectedToNotSymmetric.instance(); | ||
112 | } | ||
113 | |||
114 | public ConnectedToNotSymmetric.Matcher getConnectedToNotSymmetric(final ViatraQueryEngine engine) { | ||
115 | return ConnectedToNotSymmetric.Matcher.on(engine); | ||
116 | } | ||
117 | |||
118 | public ConnectedToReflexive getConnectedToReflexive() { | ||
119 | return ConnectedToReflexive.instance(); | ||
120 | } | ||
121 | |||
122 | public ConnectedToReflexive.Matcher getConnectedToReflexive(final ViatraQueryEngine engine) { | ||
123 | return ConnectedToReflexive.Matcher.on(engine); | ||
124 | } | ||
125 | |||
126 | public TurnoutOutput getTurnoutOutput() { | ||
127 | return TurnoutOutput.instance(); | ||
128 | } | ||
129 | |||
130 | public TurnoutOutput.Matcher getTurnoutOutput(final ViatraQueryEngine engine) { | ||
131 | return TurnoutOutput.Matcher.on(engine); | ||
132 | } | ||
133 | |||
134 | public OutputReflexive getOutputReflexive() { | ||
135 | return OutputReflexive.instance(); | ||
136 | } | ||
137 | |||
138 | public OutputReflexive.Matcher getOutputReflexive(final ViatraQueryEngine engine) { | ||
139 | return OutputReflexive.Matcher.on(engine); | ||
140 | } | ||
141 | |||
142 | public TurnoutOutputsAreSame getTurnoutOutputsAreSame() { | ||
143 | return TurnoutOutputsAreSame.instance(); | ||
144 | } | ||
145 | |||
146 | public TurnoutOutputsAreSame.Matcher getTurnoutOutputsAreSame(final ViatraQueryEngine engine) { | ||
147 | return TurnoutOutputsAreSame.Matcher.on(engine); | ||
148 | } | ||
149 | |||
150 | public Turnout getTurnout() { | ||
151 | return Turnout.instance(); | ||
152 | } | ||
153 | |||
154 | public Turnout.Matcher getTurnout(final ViatraQueryEngine engine) { | ||
155 | return Turnout.Matcher.on(engine); | ||
156 | } | ||
157 | |||
158 | public Output getOutput() { | ||
159 | return Output.instance(); | ||
160 | } | ||
161 | |||
162 | public Output.Matcher getOutput(final ViatraQueryEngine engine) { | ||
163 | return Output.Matcher.on(engine); | ||
164 | } | ||
165 | |||
166 | public TooManyInputsOfSegment getTooManyInputsOfSegment() { | ||
167 | return TooManyInputsOfSegment.instance(); | ||
168 | } | ||
169 | |||
170 | public TooManyInputsOfSegment.Matcher getTooManyInputsOfSegment(final ViatraQueryEngine engine) { | ||
171 | return TooManyInputsOfSegment.Matcher.on(engine); | ||
172 | } | ||
173 | |||
174 | public TurnoutConnectedToBothOutputs getTurnoutConnectedToBothOutputs() { | ||
175 | return TurnoutConnectedToBothOutputs.instance(); | ||
176 | } | ||
177 | |||
178 | public TurnoutConnectedToBothOutputs.Matcher getTurnoutConnectedToBothOutputs(final ViatraQueryEngine engine) { | ||
179 | return TurnoutConnectedToBothOutputs.Matcher.on(engine); | ||
180 | } | ||
181 | |||
182 | public ExtraInputOfTurnout getExtraInputOfTurnout() { | ||
183 | return ExtraInputOfTurnout.instance(); | ||
184 | } | ||
185 | |||
186 | public ExtraInputOfTurnout.Matcher getExtraInputOfTurnout(final ViatraQueryEngine engine) { | ||
187 | return ExtraInputOfTurnout.Matcher.on(engine); | ||
188 | } | ||
189 | |||
190 | public NoExtraInputOfTurnout getNoExtraInputOfTurnout() { | ||
191 | return NoExtraInputOfTurnout.instance(); | ||
192 | } | ||
193 | |||
194 | public NoExtraInputOfTurnout.Matcher getNoExtraInputOfTurnout(final ViatraQueryEngine engine) { | ||
195 | return NoExtraInputOfTurnout.Matcher.on(engine); | ||
196 | } | ||
197 | |||
198 | public TooManyExtraInputsOfTurnout getTooManyExtraInputsOfTurnout() { | ||
199 | return TooManyExtraInputsOfTurnout.instance(); | ||
200 | } | ||
201 | |||
202 | public TooManyExtraInputsOfTurnout.Matcher getTooManyExtraInputsOfTurnout(final ViatraQueryEngine engine) { | ||
203 | return TooManyExtraInputsOfTurnout.Matcher.on(engine); | ||
204 | } | ||
205 | |||
206 | public Adjacent getAdjacent() { | ||
207 | return Adjacent.instance(); | ||
208 | } | ||
209 | |||
210 | public Adjacent.Matcher getAdjacent(final ViatraQueryEngine engine) { | ||
211 | return Adjacent.Matcher.on(engine); | ||
212 | } | ||
213 | |||
214 | public Reachable getReachable() { | ||
215 | return Reachable.instance(); | ||
216 | } | ||
217 | |||
218 | public Reachable.Matcher getReachable(final ViatraQueryEngine engine) { | ||
219 | return Reachable.Matcher.on(engine); | ||
220 | } | ||
221 | |||
222 | public Unreachable getUnreachable() { | ||
223 | return Unreachable.instance(); | ||
224 | } | ||
225 | |||
226 | public Unreachable.Matcher getUnreachable(final ViatraQueryEngine engine) { | ||
227 | return Unreachable.Matcher.on(engine); | ||
228 | } | ||
229 | } | ||
diff --git a/Domains/ca.mcgill.rtgmrt.example.modes3/vql-gen/modes3/queries/NoExtraInputOfTurnout.java b/Domains/ca.mcgill.rtgmrt.example.modes3/vql-gen/modes3/queries/NoExtraInputOfTurnout.java new file mode 100644 index 00000000..621d736f --- /dev/null +++ b/Domains/ca.mcgill.rtgmrt.example.modes3/vql-gen/modes3/queries/NoExtraInputOfTurnout.java | |||
@@ -0,0 +1,560 @@ | |||
1 | /** | ||
2 | * Generated from platform:/resource/ca.mcgill.rtgmrt.example.modes3/src/modes3/queries/Modes3Queries.vql | ||
3 | */ | ||
4 | package modes3.queries; | ||
5 | |||
6 | import java.util.Arrays; | ||
7 | import java.util.Collection; | ||
8 | import java.util.LinkedHashSet; | ||
9 | import java.util.List; | ||
10 | import java.util.Objects; | ||
11 | import java.util.Optional; | ||
12 | import java.util.Set; | ||
13 | import java.util.function.Consumer; | ||
14 | import java.util.stream.Collectors; | ||
15 | import java.util.stream.Stream; | ||
16 | import modes3.Turnout; | ||
17 | import modes3.queries.ExtraInputOfTurnout; | ||
18 | import org.apache.log4j.Logger; | ||
19 | import org.eclipse.emf.ecore.EClass; | ||
20 | import org.eclipse.viatra.query.runtime.api.IPatternMatch; | ||
21 | import org.eclipse.viatra.query.runtime.api.IQuerySpecification; | ||
22 | import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; | ||
23 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
24 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; | ||
25 | import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; | ||
26 | import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; | ||
27 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
28 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
29 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
30 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
31 | import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.PAnnotation; | ||
32 | import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.ParameterReference; | ||
33 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
34 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.NegativePatternCall; | ||
35 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
36 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
37 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
38 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
39 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; | ||
40 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | ||
41 | import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; | ||
42 | |||
43 | /** | ||
44 | * A pattern-specific query specification that can instantiate Matcher in a type-safe way. | ||
45 | * | ||
46 | * <p>Original source: | ||
47 | * <code><pre> | ||
48 | * {@literal @}Constraint(message = "noExtraInputOfTurnout", severity = "error", key = { T }) | ||
49 | * pattern noExtraInputOfTurnout(T : Turnout) { | ||
50 | * neg find extraInputOfTurnout(T, _); | ||
51 | * } | ||
52 | * </pre></code> | ||
53 | * | ||
54 | * @see Matcher | ||
55 | * @see Match | ||
56 | * | ||
57 | */ | ||
58 | @SuppressWarnings("all") | ||
59 | public final class NoExtraInputOfTurnout extends BaseGeneratedEMFQuerySpecification<NoExtraInputOfTurnout.Matcher> { | ||
60 | /** | ||
61 | * Pattern-specific match representation of the modes3.queries.noExtraInputOfTurnout 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 Turnout fT; | ||
74 | |||
75 | private static List<String> parameterNames = makeImmutableList("T"); | ||
76 | |||
77 | private Match(final Turnout pT) { | ||
78 | this.fT = pT; | ||
79 | } | ||
80 | |||
81 | @Override | ||
82 | public Object get(final String parameterName) { | ||
83 | switch(parameterName) { | ||
84 | case "T": return this.fT; | ||
85 | default: return null; | ||
86 | } | ||
87 | } | ||
88 | |||
89 | @Override | ||
90 | public Object get(final int index) { | ||
91 | switch(index) { | ||
92 | case 0: return this.fT; | ||
93 | default: return null; | ||
94 | } | ||
95 | } | ||
96 | |||
97 | public Turnout getT() { | ||
98 | return this.fT; | ||
99 | } | ||
100 | |||
101 | @Override | ||
102 | public boolean set(final String parameterName, final Object newValue) { | ||
103 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
104 | if ("T".equals(parameterName) ) { | ||
105 | this.fT = (Turnout) newValue; | ||
106 | return true; | ||
107 | } | ||
108 | return false; | ||
109 | } | ||
110 | |||
111 | public void setT(final Turnout pT) { | ||
112 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
113 | this.fT = pT; | ||
114 | } | ||
115 | |||
116 | @Override | ||
117 | public String patternName() { | ||
118 | return "modes3.queries.noExtraInputOfTurnout"; | ||
119 | } | ||
120 | |||
121 | @Override | ||
122 | public List<String> parameterNames() { | ||
123 | return NoExtraInputOfTurnout.Match.parameterNames; | ||
124 | } | ||
125 | |||
126 | @Override | ||
127 | public Object[] toArray() { | ||
128 | return new Object[]{fT}; | ||
129 | } | ||
130 | |||
131 | @Override | ||
132 | public NoExtraInputOfTurnout.Match toImmutable() { | ||
133 | return isMutable() ? newMatch(fT) : this; | ||
134 | } | ||
135 | |||
136 | @Override | ||
137 | public String prettyPrint() { | ||
138 | StringBuilder result = new StringBuilder(); | ||
139 | result.append("\"T\"=" + prettyPrintValue(fT)); | ||
140 | return result.toString(); | ||
141 | } | ||
142 | |||
143 | @Override | ||
144 | public int hashCode() { | ||
145 | return Objects.hash(fT); | ||
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 NoExtraInputOfTurnout.Match)) { | ||
156 | NoExtraInputOfTurnout.Match other = (NoExtraInputOfTurnout.Match) obj; | ||
157 | return Objects.equals(fT, other.fT); | ||
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 NoExtraInputOfTurnout specification() { | ||
170 | return NoExtraInputOfTurnout.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 NoExtraInputOfTurnout.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 pT the fixed value of pattern parameter T, or null if not bound. | ||
189 | * @return the new, mutable (partial) match object. | ||
190 | * | ||
191 | */ | ||
192 | public static NoExtraInputOfTurnout.Match newMutableMatch(final Turnout pT) { | ||
193 | return new Mutable(pT); | ||
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 pT the fixed value of pattern parameter T, or null if not bound. | ||
201 | * @return the (partial) match object. | ||
202 | * | ||
203 | */ | ||
204 | public static NoExtraInputOfTurnout.Match newMatch(final Turnout pT) { | ||
205 | return new Immutable(pT); | ||
206 | } | ||
207 | |||
208 | private static final class Mutable extends NoExtraInputOfTurnout.Match { | ||
209 | Mutable(final Turnout pT) { | ||
210 | super(pT); | ||
211 | } | ||
212 | |||
213 | @Override | ||
214 | public boolean isMutable() { | ||
215 | return true; | ||
216 | } | ||
217 | } | ||
218 | |||
219 | private static final class Immutable extends NoExtraInputOfTurnout.Match { | ||
220 | Immutable(final Turnout pT) { | ||
221 | super(pT); | ||
222 | } | ||
223 | |||
224 | @Override | ||
225 | public boolean isMutable() { | ||
226 | return false; | ||
227 | } | ||
228 | } | ||
229 | } | ||
230 | |||
231 | /** | ||
232 | * Generated pattern matcher API of the modes3.queries.noExtraInputOfTurnout 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 | * {@literal @}Constraint(message = "noExtraInputOfTurnout", severity = "error", key = { T }) | ||
243 | * pattern noExtraInputOfTurnout(T : Turnout) { | ||
244 | * neg find extraInputOfTurnout(T, _); | ||
245 | * } | ||
246 | * </pre></code> | ||
247 | * | ||
248 | * @see Match | ||
249 | * @see NoExtraInputOfTurnout | ||
250 | * | ||
251 | */ | ||
252 | public static class Matcher extends BaseMatcher<NoExtraInputOfTurnout.Match> { | ||
253 | /** | ||
254 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
255 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
256 | * | ||
257 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
258 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
259 | * | ||
260 | */ | ||
261 | public static NoExtraInputOfTurnout.Matcher on(final ViatraQueryEngine engine) { | ||
262 | // check if matcher already exists | ||
263 | Matcher matcher = engine.getExistingMatcher(querySpecification()); | ||
264 | if (matcher == null) { | ||
265 | matcher = (Matcher)engine.getMatcher(querySpecification()); | ||
266 | } | ||
267 | return matcher; | ||
268 | } | ||
269 | |||
270 | /** | ||
271 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
272 | * @return an initialized matcher | ||
273 | * @noreference This method is for internal matcher initialization by the framework, do not call it manually. | ||
274 | * | ||
275 | */ | ||
276 | public static NoExtraInputOfTurnout.Matcher create() { | ||
277 | return new Matcher(); | ||
278 | } | ||
279 | |||
280 | private static final int POSITION_T = 0; | ||
281 | |||
282 | private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(NoExtraInputOfTurnout.Matcher.class); | ||
283 | |||
284 | /** | ||
285 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
286 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
287 | * | ||
288 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
289 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
290 | * | ||
291 | */ | ||
292 | private Matcher() { | ||
293 | super(querySpecification()); | ||
294 | } | ||
295 | |||
296 | /** | ||
297 | * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters. | ||
298 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
299 | * @return matches represented as a Match object. | ||
300 | * | ||
301 | */ | ||
302 | public Collection<NoExtraInputOfTurnout.Match> getAllMatches(final Turnout pT) { | ||
303 | return rawStreamAllMatches(new Object[]{pT}).collect(Collectors.toSet()); | ||
304 | } | ||
305 | |||
306 | /** | ||
307 | * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters. | ||
308 | * </p> | ||
309 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
310 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
311 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
312 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
313 | * @return a stream of matches represented as a Match object. | ||
314 | * | ||
315 | */ | ||
316 | public Stream<NoExtraInputOfTurnout.Match> streamAllMatches(final Turnout pT) { | ||
317 | return rawStreamAllMatches(new Object[]{pT}); | ||
318 | } | ||
319 | |||
320 | /** | ||
321 | * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
322 | * Neither determinism nor randomness of selection is guaranteed. | ||
323 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
324 | * @return a match represented as a Match object, or null if no match is found. | ||
325 | * | ||
326 | */ | ||
327 | public Optional<NoExtraInputOfTurnout.Match> getOneArbitraryMatch(final Turnout pT) { | ||
328 | return rawGetOneArbitraryMatch(new Object[]{pT}); | ||
329 | } | ||
330 | |||
331 | /** | ||
332 | * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match, | ||
333 | * under any possible substitution of the unspecified parameters (if any). | ||
334 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
335 | * @return true if the input is a valid (partial) match of the pattern. | ||
336 | * | ||
337 | */ | ||
338 | public boolean hasMatch(final Turnout pT) { | ||
339 | return rawHasMatch(new Object[]{pT}); | ||
340 | } | ||
341 | |||
342 | /** | ||
343 | * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. | ||
344 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
345 | * @return the number of pattern matches found. | ||
346 | * | ||
347 | */ | ||
348 | public int countMatches(final Turnout pT) { | ||
349 | return rawCountMatches(new Object[]{pT}); | ||
350 | } | ||
351 | |||
352 | /** | ||
353 | * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
354 | * Neither determinism nor randomness of selection is guaranteed. | ||
355 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
356 | * @param processor the action that will process the selected match. | ||
357 | * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked | ||
358 | * | ||
359 | */ | ||
360 | public boolean forOneArbitraryMatch(final Turnout pT, final Consumer<? super NoExtraInputOfTurnout.Match> processor) { | ||
361 | return rawForOneArbitraryMatch(new Object[]{pT}, processor); | ||
362 | } | ||
363 | |||
364 | /** | ||
365 | * Returns a new (partial) match. | ||
366 | * This can be used e.g. to call the matcher with a partial match. | ||
367 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
368 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
369 | * @return the (partial) match object. | ||
370 | * | ||
371 | */ | ||
372 | public NoExtraInputOfTurnout.Match newMatch(final Turnout pT) { | ||
373 | return NoExtraInputOfTurnout.Match.newMatch(pT); | ||
374 | } | ||
375 | |||
376 | /** | ||
377 | * Retrieve the set of values that occur in matches for T. | ||
378 | * @return the Set of all values or empty set if there are no matches | ||
379 | * | ||
380 | */ | ||
381 | protected Stream<Turnout> rawStreamAllValuesOfT(final Object[] parameters) { | ||
382 | return rawStreamAllValues(POSITION_T, parameters).map(Turnout.class::cast); | ||
383 | } | ||
384 | |||
385 | /** | ||
386 | * Retrieve the set of values that occur in matches for T. | ||
387 | * @return the Set of all values or empty set if there are no matches | ||
388 | * | ||
389 | */ | ||
390 | public Set<Turnout> getAllValuesOfT() { | ||
391 | return rawStreamAllValuesOfT(emptyArray()).collect(Collectors.toSet()); | ||
392 | } | ||
393 | |||
394 | /** | ||
395 | * Retrieve the set of values that occur in matches for T. | ||
396 | * @return the Set of all values or empty set if there are no matches | ||
397 | * | ||
398 | */ | ||
399 | public Stream<Turnout> streamAllValuesOfT() { | ||
400 | return rawStreamAllValuesOfT(emptyArray()); | ||
401 | } | ||
402 | |||
403 | @Override | ||
404 | protected NoExtraInputOfTurnout.Match tupleToMatch(final Tuple t) { | ||
405 | try { | ||
406 | return NoExtraInputOfTurnout.Match.newMatch((Turnout) t.get(POSITION_T)); | ||
407 | } catch(ClassCastException e) { | ||
408 | LOGGER.error("Element(s) in tuple not properly typed!",e); | ||
409 | return null; | ||
410 | } | ||
411 | } | ||
412 | |||
413 | @Override | ||
414 | protected NoExtraInputOfTurnout.Match arrayToMatch(final Object[] match) { | ||
415 | try { | ||
416 | return NoExtraInputOfTurnout.Match.newMatch((Turnout) match[POSITION_T]); | ||
417 | } catch(ClassCastException e) { | ||
418 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
419 | return null; | ||
420 | } | ||
421 | } | ||
422 | |||
423 | @Override | ||
424 | protected NoExtraInputOfTurnout.Match arrayToMatchMutable(final Object[] match) { | ||
425 | try { | ||
426 | return NoExtraInputOfTurnout.Match.newMutableMatch((Turnout) match[POSITION_T]); | ||
427 | } catch(ClassCastException e) { | ||
428 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
429 | return null; | ||
430 | } | ||
431 | } | ||
432 | |||
433 | /** | ||
434 | * @return the singleton instance of the query specification of this pattern | ||
435 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
436 | * | ||
437 | */ | ||
438 | public static IQuerySpecification<NoExtraInputOfTurnout.Matcher> querySpecification() { | ||
439 | return NoExtraInputOfTurnout.instance(); | ||
440 | } | ||
441 | } | ||
442 | |||
443 | private NoExtraInputOfTurnout() { | ||
444 | super(GeneratedPQuery.INSTANCE); | ||
445 | } | ||
446 | |||
447 | /** | ||
448 | * @return the singleton instance of the query specification | ||
449 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
450 | * | ||
451 | */ | ||
452 | public static NoExtraInputOfTurnout instance() { | ||
453 | try{ | ||
454 | return LazyHolder.INSTANCE; | ||
455 | } catch (ExceptionInInitializerError err) { | ||
456 | throw processInitializerError(err); | ||
457 | } | ||
458 | } | ||
459 | |||
460 | @Override | ||
461 | protected NoExtraInputOfTurnout.Matcher instantiate(final ViatraQueryEngine engine) { | ||
462 | return NoExtraInputOfTurnout.Matcher.on(engine); | ||
463 | } | ||
464 | |||
465 | @Override | ||
466 | public NoExtraInputOfTurnout.Matcher instantiate() { | ||
467 | return NoExtraInputOfTurnout.Matcher.create(); | ||
468 | } | ||
469 | |||
470 | @Override | ||
471 | public NoExtraInputOfTurnout.Match newEmptyMatch() { | ||
472 | return NoExtraInputOfTurnout.Match.newEmptyMatch(); | ||
473 | } | ||
474 | |||
475 | @Override | ||
476 | public NoExtraInputOfTurnout.Match newMatch(final Object... parameters) { | ||
477 | return NoExtraInputOfTurnout.Match.newMatch((modes3.Turnout) parameters[0]); | ||
478 | } | ||
479 | |||
480 | /** | ||
481 | * Inner class allowing the singleton instance of {@link NoExtraInputOfTurnout} to be created | ||
482 | * <b>not</b> at the class load time of the outer class, | ||
483 | * but rather at the first call to {@link NoExtraInputOfTurnout#instance()}. | ||
484 | * | ||
485 | * <p> This workaround is required e.g. to support recursion. | ||
486 | * | ||
487 | */ | ||
488 | private static class LazyHolder { | ||
489 | private static final NoExtraInputOfTurnout INSTANCE = new NoExtraInputOfTurnout(); | ||
490 | |||
491 | /** | ||
492 | * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned. | ||
493 | * This initialization order is required to support indirect recursion. | ||
494 | * | ||
495 | * <p> The static initializer is defined using a helper field to work around limitations of the code generator. | ||
496 | * | ||
497 | */ | ||
498 | private static final Object STATIC_INITIALIZER = ensureInitialized(); | ||
499 | |||
500 | public static Object ensureInitialized() { | ||
501 | INSTANCE.ensureInitializedInternal(); | ||
502 | return null; | ||
503 | } | ||
504 | } | ||
505 | |||
506 | private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { | ||
507 | private static final NoExtraInputOfTurnout.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
508 | |||
509 | private final PParameter parameter_T = new PParameter("T", "modes3.Turnout", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.ece.mcgill.ca/wcet/modes3", "Turnout")), PParameterDirection.INOUT); | ||
510 | |||
511 | private final List<PParameter> parameters = Arrays.asList(parameter_T); | ||
512 | |||
513 | private GeneratedPQuery() { | ||
514 | super(PVisibility.PUBLIC); | ||
515 | } | ||
516 | |||
517 | @Override | ||
518 | public String getFullyQualifiedName() { | ||
519 | return "modes3.queries.noExtraInputOfTurnout"; | ||
520 | } | ||
521 | |||
522 | @Override | ||
523 | public List<String> getParameterNames() { | ||
524 | return Arrays.asList("T"); | ||
525 | } | ||
526 | |||
527 | @Override | ||
528 | public List<PParameter> getParameters() { | ||
529 | return parameters; | ||
530 | } | ||
531 | |||
532 | @Override | ||
533 | public Set<PBody> doGetContainedBodies() { | ||
534 | setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); | ||
535 | Set<PBody> bodies = new LinkedHashSet<>(); | ||
536 | { | ||
537 | PBody body = new PBody(this); | ||
538 | PVariable var_T = body.getOrCreateVariableByName("T"); | ||
539 | PVariable var___0_ = body.getOrCreateVariableByName("_<0>"); | ||
540 | new TypeConstraint(body, Tuples.flatTupleOf(var_T), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Turnout"))); | ||
541 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
542 | new ExportedParameter(body, var_T, parameter_T) | ||
543 | )); | ||
544 | // neg find extraInputOfTurnout(T, _) | ||
545 | new NegativePatternCall(body, Tuples.flatTupleOf(var_T, var___0_), ExtraInputOfTurnout.instance().getInternalQueryRepresentation()); | ||
546 | bodies.add(body); | ||
547 | } | ||
548 | { | ||
549 | PAnnotation annotation = new PAnnotation("Constraint"); | ||
550 | annotation.addAttribute("message", "noExtraInputOfTurnout"); | ||
551 | annotation.addAttribute("severity", "error"); | ||
552 | annotation.addAttribute("key", Arrays.asList(new Object[] { | ||
553 | new ParameterReference("T") | ||
554 | })); | ||
555 | addAnnotation(annotation); | ||
556 | } | ||
557 | return bodies; | ||
558 | } | ||
559 | } | ||
560 | } | ||
diff --git a/Domains/ca.mcgill.rtgmrt.example.modes3/vql-gen/modes3/queries/Output.java b/Domains/ca.mcgill.rtgmrt.example.modes3/vql-gen/modes3/queries/Output.java new file mode 100644 index 00000000..615b33af --- /dev/null +++ b/Domains/ca.mcgill.rtgmrt.example.modes3/vql-gen/modes3/queries/Output.java | |||
@@ -0,0 +1,724 @@ | |||
1 | /** | ||
2 | * Generated from platform:/resource/ca.mcgill.rtgmrt.example.modes3/src/modes3/queries/Modes3Queries.vql | ||
3 | */ | ||
4 | package modes3.queries; | ||
5 | |||
6 | import java.util.Arrays; | ||
7 | import java.util.Collection; | ||
8 | import java.util.LinkedHashSet; | ||
9 | import java.util.List; | ||
10 | import java.util.Objects; | ||
11 | import java.util.Optional; | ||
12 | import java.util.Set; | ||
13 | import java.util.function.Consumer; | ||
14 | import java.util.stream.Collectors; | ||
15 | import java.util.stream.Stream; | ||
16 | import modes3.Segment; | ||
17 | import modes3.queries.TurnoutOutput; | ||
18 | import org.apache.log4j.Logger; | ||
19 | import org.eclipse.emf.ecore.EClass; | ||
20 | import org.eclipse.viatra.query.runtime.api.IPatternMatch; | ||
21 | import org.eclipse.viatra.query.runtime.api.IQuerySpecification; | ||
22 | import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; | ||
23 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
24 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; | ||
25 | import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; | ||
26 | import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; | ||
27 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
28 | import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey; | ||
29 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
30 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
31 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
32 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; | ||
33 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
34 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.PositivePatternCall; | ||
35 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
36 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
37 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
38 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
39 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; | ||
40 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | ||
41 | import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; | ||
42 | |||
43 | /** | ||
44 | * A pattern-specific query specification that can instantiate Matcher in a type-safe way. | ||
45 | * | ||
46 | * <p>Original source: | ||
47 | * <code><pre> | ||
48 | * pattern output(S1 : Segment, S2 : Segment) { | ||
49 | * Segment.connectedTo(S1, S2); | ||
50 | * } or { | ||
51 | * find turnoutOutput(S1, S2); | ||
52 | * } | ||
53 | * </pre></code> | ||
54 | * | ||
55 | * @see Matcher | ||
56 | * @see Match | ||
57 | * | ||
58 | */ | ||
59 | @SuppressWarnings("all") | ||
60 | public final class Output extends BaseGeneratedEMFQuerySpecification<Output.Matcher> { | ||
61 | /** | ||
62 | * Pattern-specific match representation of the modes3.queries.output pattern, | ||
63 | * to be used in conjunction with {@link Matcher}. | ||
64 | * | ||
65 | * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned. | ||
66 | * Each instance is a (possibly partial) substitution of pattern parameters, | ||
67 | * usable to represent a match of the pattern in the result of a query, | ||
68 | * or to specify the bound (fixed) input parameters when issuing a query. | ||
69 | * | ||
70 | * @see Matcher | ||
71 | * | ||
72 | */ | ||
73 | public static abstract class Match extends BasePatternMatch { | ||
74 | private Segment fS1; | ||
75 | |||
76 | private Segment fS2; | ||
77 | |||
78 | private static List<String> parameterNames = makeImmutableList("S1", "S2"); | ||
79 | |||
80 | private Match(final Segment pS1, final Segment pS2) { | ||
81 | this.fS1 = pS1; | ||
82 | this.fS2 = pS2; | ||
83 | } | ||
84 | |||
85 | @Override | ||
86 | public Object get(final String parameterName) { | ||
87 | switch(parameterName) { | ||
88 | case "S1": return this.fS1; | ||
89 | case "S2": return this.fS2; | ||
90 | default: return null; | ||
91 | } | ||
92 | } | ||
93 | |||
94 | @Override | ||
95 | public Object get(final int index) { | ||
96 | switch(index) { | ||
97 | case 0: return this.fS1; | ||
98 | case 1: return this.fS2; | ||
99 | default: return null; | ||
100 | } | ||
101 | } | ||
102 | |||
103 | public Segment getS1() { | ||
104 | return this.fS1; | ||
105 | } | ||
106 | |||
107 | public Segment getS2() { | ||
108 | return this.fS2; | ||
109 | } | ||
110 | |||
111 | @Override | ||
112 | public boolean set(final String parameterName, final Object newValue) { | ||
113 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
114 | if ("S1".equals(parameterName) ) { | ||
115 | this.fS1 = (Segment) newValue; | ||
116 | return true; | ||
117 | } | ||
118 | if ("S2".equals(parameterName) ) { | ||
119 | this.fS2 = (Segment) newValue; | ||
120 | return true; | ||
121 | } | ||
122 | return false; | ||
123 | } | ||
124 | |||
125 | public void setS1(final Segment pS1) { | ||
126 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
127 | this.fS1 = pS1; | ||
128 | } | ||
129 | |||
130 | public void setS2(final Segment pS2) { | ||
131 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
132 | this.fS2 = pS2; | ||
133 | } | ||
134 | |||
135 | @Override | ||
136 | public String patternName() { | ||
137 | return "modes3.queries.output"; | ||
138 | } | ||
139 | |||
140 | @Override | ||
141 | public List<String> parameterNames() { | ||
142 | return Output.Match.parameterNames; | ||
143 | } | ||
144 | |||
145 | @Override | ||
146 | public Object[] toArray() { | ||
147 | return new Object[]{fS1, fS2}; | ||
148 | } | ||
149 | |||
150 | @Override | ||
151 | public Output.Match toImmutable() { | ||
152 | return isMutable() ? newMatch(fS1, fS2) : this; | ||
153 | } | ||
154 | |||
155 | @Override | ||
156 | public String prettyPrint() { | ||
157 | StringBuilder result = new StringBuilder(); | ||
158 | result.append("\"S1\"=" + prettyPrintValue(fS1) + ", "); | ||
159 | result.append("\"S2\"=" + prettyPrintValue(fS2)); | ||
160 | return result.toString(); | ||
161 | } | ||
162 | |||
163 | @Override | ||
164 | public int hashCode() { | ||
165 | return Objects.hash(fS1, fS2); | ||
166 | } | ||
167 | |||
168 | @Override | ||
169 | public boolean equals(final Object obj) { | ||
170 | if (this == obj) | ||
171 | return true; | ||
172 | if (obj == null) { | ||
173 | return false; | ||
174 | } | ||
175 | if ((obj instanceof Output.Match)) { | ||
176 | Output.Match other = (Output.Match) obj; | ||
177 | return Objects.equals(fS1, other.fS1) && Objects.equals(fS2, other.fS2); | ||
178 | } else { | ||
179 | // this should be infrequent | ||
180 | if (!(obj instanceof IPatternMatch)) { | ||
181 | return false; | ||
182 | } | ||
183 | IPatternMatch otherSig = (IPatternMatch) obj; | ||
184 | return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray()); | ||
185 | } | ||
186 | } | ||
187 | |||
188 | @Override | ||
189 | public Output specification() { | ||
190 | return Output.instance(); | ||
191 | } | ||
192 | |||
193 | /** | ||
194 | * Returns an empty, mutable match. | ||
195 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
196 | * | ||
197 | * @return the empty match. | ||
198 | * | ||
199 | */ | ||
200 | public static Output.Match newEmptyMatch() { | ||
201 | return new Mutable(null, null); | ||
202 | } | ||
203 | |||
204 | /** | ||
205 | * Returns a mutable (partial) match. | ||
206 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
207 | * | ||
208 | * @param pS1 the fixed value of pattern parameter S1, or null if not bound. | ||
209 | * @param pS2 the fixed value of pattern parameter S2, or null if not bound. | ||
210 | * @return the new, mutable (partial) match object. | ||
211 | * | ||
212 | */ | ||
213 | public static Output.Match newMutableMatch(final Segment pS1, final Segment pS2) { | ||
214 | return new Mutable(pS1, pS2); | ||
215 | } | ||
216 | |||
217 | /** | ||
218 | * Returns a new (partial) match. | ||
219 | * This can be used e.g. to call the matcher with a partial match. | ||
220 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
221 | * @param pS1 the fixed value of pattern parameter S1, or null if not bound. | ||
222 | * @param pS2 the fixed value of pattern parameter S2, or null if not bound. | ||
223 | * @return the (partial) match object. | ||
224 | * | ||
225 | */ | ||
226 | public static Output.Match newMatch(final Segment pS1, final Segment pS2) { | ||
227 | return new Immutable(pS1, pS2); | ||
228 | } | ||
229 | |||
230 | private static final class Mutable extends Output.Match { | ||
231 | Mutable(final Segment pS1, final Segment pS2) { | ||
232 | super(pS1, pS2); | ||
233 | } | ||
234 | |||
235 | @Override | ||
236 | public boolean isMutable() { | ||
237 | return true; | ||
238 | } | ||
239 | } | ||
240 | |||
241 | private static final class Immutable extends Output.Match { | ||
242 | Immutable(final Segment pS1, final Segment pS2) { | ||
243 | super(pS1, pS2); | ||
244 | } | ||
245 | |||
246 | @Override | ||
247 | public boolean isMutable() { | ||
248 | return false; | ||
249 | } | ||
250 | } | ||
251 | } | ||
252 | |||
253 | /** | ||
254 | * Generated pattern matcher API of the modes3.queries.output pattern, | ||
255 | * providing pattern-specific query methods. | ||
256 | * | ||
257 | * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)}, | ||
258 | * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}. | ||
259 | * | ||
260 | * <p>Matches of the pattern will be represented as {@link Match}. | ||
261 | * | ||
262 | * <p>Original source: | ||
263 | * <code><pre> | ||
264 | * pattern output(S1 : Segment, S2 : Segment) { | ||
265 | * Segment.connectedTo(S1, S2); | ||
266 | * } or { | ||
267 | * find turnoutOutput(S1, S2); | ||
268 | * } | ||
269 | * </pre></code> | ||
270 | * | ||
271 | * @see Match | ||
272 | * @see Output | ||
273 | * | ||
274 | */ | ||
275 | public static class Matcher extends BaseMatcher<Output.Match> { | ||
276 | /** | ||
277 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
278 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
279 | * | ||
280 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
281 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
282 | * | ||
283 | */ | ||
284 | public static Output.Matcher on(final ViatraQueryEngine engine) { | ||
285 | // check if matcher already exists | ||
286 | Matcher matcher = engine.getExistingMatcher(querySpecification()); | ||
287 | if (matcher == null) { | ||
288 | matcher = (Matcher)engine.getMatcher(querySpecification()); | ||
289 | } | ||
290 | return matcher; | ||
291 | } | ||
292 | |||
293 | /** | ||
294 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
295 | * @return an initialized matcher | ||
296 | * @noreference This method is for internal matcher initialization by the framework, do not call it manually. | ||
297 | * | ||
298 | */ | ||
299 | public static Output.Matcher create() { | ||
300 | return new Matcher(); | ||
301 | } | ||
302 | |||
303 | private static final int POSITION_S1 = 0; | ||
304 | |||
305 | private static final int POSITION_S2 = 1; | ||
306 | |||
307 | private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(Output.Matcher.class); | ||
308 | |||
309 | /** | ||
310 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
311 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
312 | * | ||
313 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
314 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
315 | * | ||
316 | */ | ||
317 | private Matcher() { | ||
318 | super(querySpecification()); | ||
319 | } | ||
320 | |||
321 | /** | ||
322 | * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters. | ||
323 | * @param pS1 the fixed value of pattern parameter S1, or null if not bound. | ||
324 | * @param pS2 the fixed value of pattern parameter S2, or null if not bound. | ||
325 | * @return matches represented as a Match object. | ||
326 | * | ||
327 | */ | ||
328 | public Collection<Output.Match> getAllMatches(final Segment pS1, final Segment pS2) { | ||
329 | return rawStreamAllMatches(new Object[]{pS1, pS2}).collect(Collectors.toSet()); | ||
330 | } | ||
331 | |||
332 | /** | ||
333 | * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters. | ||
334 | * </p> | ||
335 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
336 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
337 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
338 | * @param pS1 the fixed value of pattern parameter S1, or null if not bound. | ||
339 | * @param pS2 the fixed value of pattern parameter S2, or null if not bound. | ||
340 | * @return a stream of matches represented as a Match object. | ||
341 | * | ||
342 | */ | ||
343 | public Stream<Output.Match> streamAllMatches(final Segment pS1, final Segment pS2) { | ||
344 | return rawStreamAllMatches(new Object[]{pS1, pS2}); | ||
345 | } | ||
346 | |||
347 | /** | ||
348 | * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
349 | * Neither determinism nor randomness of selection is guaranteed. | ||
350 | * @param pS1 the fixed value of pattern parameter S1, or null if not bound. | ||
351 | * @param pS2 the fixed value of pattern parameter S2, or null if not bound. | ||
352 | * @return a match represented as a Match object, or null if no match is found. | ||
353 | * | ||
354 | */ | ||
355 | public Optional<Output.Match> getOneArbitraryMatch(final Segment pS1, final Segment pS2) { | ||
356 | return rawGetOneArbitraryMatch(new Object[]{pS1, pS2}); | ||
357 | } | ||
358 | |||
359 | /** | ||
360 | * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match, | ||
361 | * under any possible substitution of the unspecified parameters (if any). | ||
362 | * @param pS1 the fixed value of pattern parameter S1, or null if not bound. | ||
363 | * @param pS2 the fixed value of pattern parameter S2, or null if not bound. | ||
364 | * @return true if the input is a valid (partial) match of the pattern. | ||
365 | * | ||
366 | */ | ||
367 | public boolean hasMatch(final Segment pS1, final Segment pS2) { | ||
368 | return rawHasMatch(new Object[]{pS1, pS2}); | ||
369 | } | ||
370 | |||
371 | /** | ||
372 | * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. | ||
373 | * @param pS1 the fixed value of pattern parameter S1, or null if not bound. | ||
374 | * @param pS2 the fixed value of pattern parameter S2, or null if not bound. | ||
375 | * @return the number of pattern matches found. | ||
376 | * | ||
377 | */ | ||
378 | public int countMatches(final Segment pS1, final Segment pS2) { | ||
379 | return rawCountMatches(new Object[]{pS1, pS2}); | ||
380 | } | ||
381 | |||
382 | /** | ||
383 | * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
384 | * Neither determinism nor randomness of selection is guaranteed. | ||
385 | * @param pS1 the fixed value of pattern parameter S1, or null if not bound. | ||
386 | * @param pS2 the fixed value of pattern parameter S2, or null if not bound. | ||
387 | * @param processor the action that will process the selected match. | ||
388 | * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked | ||
389 | * | ||
390 | */ | ||
391 | public boolean forOneArbitraryMatch(final Segment pS1, final Segment pS2, final Consumer<? super Output.Match> processor) { | ||
392 | return rawForOneArbitraryMatch(new Object[]{pS1, pS2}, processor); | ||
393 | } | ||
394 | |||
395 | /** | ||
396 | * Returns a new (partial) match. | ||
397 | * This can be used e.g. to call the matcher with a partial match. | ||
398 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
399 | * @param pS1 the fixed value of pattern parameter S1, or null if not bound. | ||
400 | * @param pS2 the fixed value of pattern parameter S2, or null if not bound. | ||
401 | * @return the (partial) match object. | ||
402 | * | ||
403 | */ | ||
404 | public Output.Match newMatch(final Segment pS1, final Segment pS2) { | ||
405 | return Output.Match.newMatch(pS1, pS2); | ||
406 | } | ||
407 | |||
408 | /** | ||
409 | * Retrieve the set of values that occur in matches for S1. | ||
410 | * @return the Set of all values or empty set if there are no matches | ||
411 | * | ||
412 | */ | ||
413 | protected Stream<Segment> rawStreamAllValuesOfS1(final Object[] parameters) { | ||
414 | return rawStreamAllValues(POSITION_S1, parameters).map(Segment.class::cast); | ||
415 | } | ||
416 | |||
417 | /** | ||
418 | * Retrieve the set of values that occur in matches for S1. | ||
419 | * @return the Set of all values or empty set if there are no matches | ||
420 | * | ||
421 | */ | ||
422 | public Set<Segment> getAllValuesOfS1() { | ||
423 | return rawStreamAllValuesOfS1(emptyArray()).collect(Collectors.toSet()); | ||
424 | } | ||
425 | |||
426 | /** | ||
427 | * Retrieve the set of values that occur in matches for S1. | ||
428 | * @return the Set of all values or empty set if there are no matches | ||
429 | * | ||
430 | */ | ||
431 | public Stream<Segment> streamAllValuesOfS1() { | ||
432 | return rawStreamAllValuesOfS1(emptyArray()); | ||
433 | } | ||
434 | |||
435 | /** | ||
436 | * Retrieve the set of values that occur in matches for S1. | ||
437 | * </p> | ||
438 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
439 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
440 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
441 | * | ||
442 | * @return the Stream of all values or empty set if there are no matches | ||
443 | * | ||
444 | */ | ||
445 | public Stream<Segment> streamAllValuesOfS1(final Output.Match partialMatch) { | ||
446 | return rawStreamAllValuesOfS1(partialMatch.toArray()); | ||
447 | } | ||
448 | |||
449 | /** | ||
450 | * Retrieve the set of values that occur in matches for S1. | ||
451 | * </p> | ||
452 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
453 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
454 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
455 | * | ||
456 | * @return the Stream of all values or empty set if there are no matches | ||
457 | * | ||
458 | */ | ||
459 | public Stream<Segment> streamAllValuesOfS1(final Segment pS2) { | ||
460 | return rawStreamAllValuesOfS1(new Object[]{null, pS2}); | ||
461 | } | ||
462 | |||
463 | /** | ||
464 | * Retrieve the set of values that occur in matches for S1. | ||
465 | * @return the Set of all values or empty set if there are no matches | ||
466 | * | ||
467 | */ | ||
468 | public Set<Segment> getAllValuesOfS1(final Output.Match partialMatch) { | ||
469 | return rawStreamAllValuesOfS1(partialMatch.toArray()).collect(Collectors.toSet()); | ||
470 | } | ||
471 | |||
472 | /** | ||
473 | * Retrieve the set of values that occur in matches for S1. | ||
474 | * @return the Set of all values or empty set if there are no matches | ||
475 | * | ||
476 | */ | ||
477 | public Set<Segment> getAllValuesOfS1(final Segment pS2) { | ||
478 | return rawStreamAllValuesOfS1(new Object[]{null, pS2}).collect(Collectors.toSet()); | ||
479 | } | ||
480 | |||
481 | /** | ||
482 | * Retrieve the set of values that occur in matches for S2. | ||
483 | * @return the Set of all values or empty set if there are no matches | ||
484 | * | ||
485 | */ | ||
486 | protected Stream<Segment> rawStreamAllValuesOfS2(final Object[] parameters) { | ||
487 | return rawStreamAllValues(POSITION_S2, parameters).map(Segment.class::cast); | ||
488 | } | ||
489 | |||
490 | /** | ||
491 | * Retrieve the set of values that occur in matches for S2. | ||
492 | * @return the Set of all values or empty set if there are no matches | ||
493 | * | ||
494 | */ | ||
495 | public Set<Segment> getAllValuesOfS2() { | ||
496 | return rawStreamAllValuesOfS2(emptyArray()).collect(Collectors.toSet()); | ||
497 | } | ||
498 | |||
499 | /** | ||
500 | * Retrieve the set of values that occur in matches for S2. | ||
501 | * @return the Set of all values or empty set if there are no matches | ||
502 | * | ||
503 | */ | ||
504 | public Stream<Segment> streamAllValuesOfS2() { | ||
505 | return rawStreamAllValuesOfS2(emptyArray()); | ||
506 | } | ||
507 | |||
508 | /** | ||
509 | * Retrieve the set of values that occur in matches for S2. | ||
510 | * </p> | ||
511 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
512 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
513 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
514 | * | ||
515 | * @return the Stream of all values or empty set if there are no matches | ||
516 | * | ||
517 | */ | ||
518 | public Stream<Segment> streamAllValuesOfS2(final Output.Match partialMatch) { | ||
519 | return rawStreamAllValuesOfS2(partialMatch.toArray()); | ||
520 | } | ||
521 | |||
522 | /** | ||
523 | * Retrieve the set of values that occur in matches for S2. | ||
524 | * </p> | ||
525 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
526 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
527 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
528 | * | ||
529 | * @return the Stream of all values or empty set if there are no matches | ||
530 | * | ||
531 | */ | ||
532 | public Stream<Segment> streamAllValuesOfS2(final Segment pS1) { | ||
533 | return rawStreamAllValuesOfS2(new Object[]{pS1, null}); | ||
534 | } | ||
535 | |||
536 | /** | ||
537 | * Retrieve the set of values that occur in matches for S2. | ||
538 | * @return the Set of all values or empty set if there are no matches | ||
539 | * | ||
540 | */ | ||
541 | public Set<Segment> getAllValuesOfS2(final Output.Match partialMatch) { | ||
542 | return rawStreamAllValuesOfS2(partialMatch.toArray()).collect(Collectors.toSet()); | ||
543 | } | ||
544 | |||
545 | /** | ||
546 | * Retrieve the set of values that occur in matches for S2. | ||
547 | * @return the Set of all values or empty set if there are no matches | ||
548 | * | ||
549 | */ | ||
550 | public Set<Segment> getAllValuesOfS2(final Segment pS1) { | ||
551 | return rawStreamAllValuesOfS2(new Object[]{pS1, null}).collect(Collectors.toSet()); | ||
552 | } | ||
553 | |||
554 | @Override | ||
555 | protected Output.Match tupleToMatch(final Tuple t) { | ||
556 | try { | ||
557 | return Output.Match.newMatch((Segment) t.get(POSITION_S1), (Segment) t.get(POSITION_S2)); | ||
558 | } catch(ClassCastException e) { | ||
559 | LOGGER.error("Element(s) in tuple not properly typed!",e); | ||
560 | return null; | ||
561 | } | ||
562 | } | ||
563 | |||
564 | @Override | ||
565 | protected Output.Match arrayToMatch(final Object[] match) { | ||
566 | try { | ||
567 | return Output.Match.newMatch((Segment) match[POSITION_S1], (Segment) match[POSITION_S2]); | ||
568 | } catch(ClassCastException e) { | ||
569 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
570 | return null; | ||
571 | } | ||
572 | } | ||
573 | |||
574 | @Override | ||
575 | protected Output.Match arrayToMatchMutable(final Object[] match) { | ||
576 | try { | ||
577 | return Output.Match.newMutableMatch((Segment) match[POSITION_S1], (Segment) match[POSITION_S2]); | ||
578 | } catch(ClassCastException e) { | ||
579 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
580 | return null; | ||
581 | } | ||
582 | } | ||
583 | |||
584 | /** | ||
585 | * @return the singleton instance of the query specification of this pattern | ||
586 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
587 | * | ||
588 | */ | ||
589 | public static IQuerySpecification<Output.Matcher> querySpecification() { | ||
590 | return Output.instance(); | ||
591 | } | ||
592 | } | ||
593 | |||
594 | private Output() { | ||
595 | super(GeneratedPQuery.INSTANCE); | ||
596 | } | ||
597 | |||
598 | /** | ||
599 | * @return the singleton instance of the query specification | ||
600 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
601 | * | ||
602 | */ | ||
603 | public static Output instance() { | ||
604 | try{ | ||
605 | return LazyHolder.INSTANCE; | ||
606 | } catch (ExceptionInInitializerError err) { | ||
607 | throw processInitializerError(err); | ||
608 | } | ||
609 | } | ||
610 | |||
611 | @Override | ||
612 | protected Output.Matcher instantiate(final ViatraQueryEngine engine) { | ||
613 | return Output.Matcher.on(engine); | ||
614 | } | ||
615 | |||
616 | @Override | ||
617 | public Output.Matcher instantiate() { | ||
618 | return Output.Matcher.create(); | ||
619 | } | ||
620 | |||
621 | @Override | ||
622 | public Output.Match newEmptyMatch() { | ||
623 | return Output.Match.newEmptyMatch(); | ||
624 | } | ||
625 | |||
626 | @Override | ||
627 | public Output.Match newMatch(final Object... parameters) { | ||
628 | return Output.Match.newMatch((modes3.Segment) parameters[0], (modes3.Segment) parameters[1]); | ||
629 | } | ||
630 | |||
631 | /** | ||
632 | * Inner class allowing the singleton instance of {@link Output} to be created | ||
633 | * <b>not</b> at the class load time of the outer class, | ||
634 | * but rather at the first call to {@link Output#instance()}. | ||
635 | * | ||
636 | * <p> This workaround is required e.g. to support recursion. | ||
637 | * | ||
638 | */ | ||
639 | private static class LazyHolder { | ||
640 | private static final Output INSTANCE = new Output(); | ||
641 | |||
642 | /** | ||
643 | * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned. | ||
644 | * This initialization order is required to support indirect recursion. | ||
645 | * | ||
646 | * <p> The static initializer is defined using a helper field to work around limitations of the code generator. | ||
647 | * | ||
648 | */ | ||
649 | private static final Object STATIC_INITIALIZER = ensureInitialized(); | ||
650 | |||
651 | public static Object ensureInitialized() { | ||
652 | INSTANCE.ensureInitializedInternal(); | ||
653 | return null; | ||
654 | } | ||
655 | } | ||
656 | |||
657 | private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { | ||
658 | private static final Output.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
659 | |||
660 | private final PParameter parameter_S1 = new PParameter("S1", "modes3.Segment", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.ece.mcgill.ca/wcet/modes3", "Segment")), PParameterDirection.INOUT); | ||
661 | |||
662 | private final PParameter parameter_S2 = new PParameter("S2", "modes3.Segment", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.ece.mcgill.ca/wcet/modes3", "Segment")), PParameterDirection.INOUT); | ||
663 | |||
664 | private final List<PParameter> parameters = Arrays.asList(parameter_S1, parameter_S2); | ||
665 | |||
666 | private GeneratedPQuery() { | ||
667 | super(PVisibility.PUBLIC); | ||
668 | } | ||
669 | |||
670 | @Override | ||
671 | public String getFullyQualifiedName() { | ||
672 | return "modes3.queries.output"; | ||
673 | } | ||
674 | |||
675 | @Override | ||
676 | public List<String> getParameterNames() { | ||
677 | return Arrays.asList("S1","S2"); | ||
678 | } | ||
679 | |||
680 | @Override | ||
681 | public List<PParameter> getParameters() { | ||
682 | return parameters; | ||
683 | } | ||
684 | |||
685 | @Override | ||
686 | public Set<PBody> doGetContainedBodies() { | ||
687 | setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); | ||
688 | Set<PBody> bodies = new LinkedHashSet<>(); | ||
689 | { | ||
690 | PBody body = new PBody(this); | ||
691 | PVariable var_S1 = body.getOrCreateVariableByName("S1"); | ||
692 | PVariable var_S2 = body.getOrCreateVariableByName("S2"); | ||
693 | new TypeConstraint(body, Tuples.flatTupleOf(var_S1), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Segment"))); | ||
694 | new TypeConstraint(body, Tuples.flatTupleOf(var_S2), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Segment"))); | ||
695 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
696 | new ExportedParameter(body, var_S1, parameter_S1), | ||
697 | new ExportedParameter(body, var_S2, parameter_S2) | ||
698 | )); | ||
699 | // Segment.connectedTo(S1, S2) | ||
700 | new TypeConstraint(body, Tuples.flatTupleOf(var_S1), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Segment"))); | ||
701 | PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); | ||
702 | new TypeConstraint(body, Tuples.flatTupleOf(var_S1, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Segment", "connectedTo"))); | ||
703 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Segment"))); | ||
704 | new Equality(body, var__virtual_0_, var_S2); | ||
705 | bodies.add(body); | ||
706 | } | ||
707 | { | ||
708 | PBody body = new PBody(this); | ||
709 | PVariable var_S1 = body.getOrCreateVariableByName("S1"); | ||
710 | PVariable var_S2 = body.getOrCreateVariableByName("S2"); | ||
711 | new TypeConstraint(body, Tuples.flatTupleOf(var_S1), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Segment"))); | ||
712 | new TypeConstraint(body, Tuples.flatTupleOf(var_S2), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Segment"))); | ||
713 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
714 | new ExportedParameter(body, var_S1, parameter_S1), | ||
715 | new ExportedParameter(body, var_S2, parameter_S2) | ||
716 | )); | ||
717 | // find turnoutOutput(S1, S2) | ||
718 | new PositivePatternCall(body, Tuples.flatTupleOf(var_S1, var_S2), TurnoutOutput.instance().getInternalQueryRepresentation()); | ||
719 | bodies.add(body); | ||
720 | } | ||
721 | return bodies; | ||
722 | } | ||
723 | } | ||
724 | } | ||
diff --git a/Domains/ca.mcgill.rtgmrt.example.modes3/vql-gen/modes3/queries/OutputReflexive.java b/Domains/ca.mcgill.rtgmrt.example.modes3/vql-gen/modes3/queries/OutputReflexive.java new file mode 100644 index 00000000..3d90ede5 --- /dev/null +++ b/Domains/ca.mcgill.rtgmrt.example.modes3/vql-gen/modes3/queries/OutputReflexive.java | |||
@@ -0,0 +1,559 @@ | |||
1 | /** | ||
2 | * Generated from platform:/resource/ca.mcgill.rtgmrt.example.modes3/src/modes3/queries/Modes3Queries.vql | ||
3 | */ | ||
4 | package modes3.queries; | ||
5 | |||
6 | import java.util.Arrays; | ||
7 | import java.util.Collection; | ||
8 | import java.util.LinkedHashSet; | ||
9 | import java.util.List; | ||
10 | import java.util.Objects; | ||
11 | import java.util.Optional; | ||
12 | import java.util.Set; | ||
13 | import java.util.function.Consumer; | ||
14 | import java.util.stream.Collectors; | ||
15 | import java.util.stream.Stream; | ||
16 | import modes3.Turnout; | ||
17 | import modes3.queries.TurnoutOutput; | ||
18 | import org.apache.log4j.Logger; | ||
19 | import org.eclipse.emf.ecore.EClass; | ||
20 | import org.eclipse.viatra.query.runtime.api.IPatternMatch; | ||
21 | import org.eclipse.viatra.query.runtime.api.IQuerySpecification; | ||
22 | import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; | ||
23 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
24 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; | ||
25 | import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; | ||
26 | import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; | ||
27 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
28 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
29 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
30 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
31 | import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.PAnnotation; | ||
32 | import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.ParameterReference; | ||
33 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
34 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.PositivePatternCall; | ||
35 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
36 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
37 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
38 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
39 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; | ||
40 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | ||
41 | import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; | ||
42 | |||
43 | /** | ||
44 | * A pattern-specific query specification that can instantiate Matcher in a type-safe way. | ||
45 | * | ||
46 | * <p>Original source: | ||
47 | * <code><pre> | ||
48 | * {@literal @}Constraint(message = "outputReflexive", severity = "error", key = { T }) | ||
49 | * pattern outputReflexive(T : Turnout) { | ||
50 | * find turnoutOutput(T, T); | ||
51 | * } | ||
52 | * </pre></code> | ||
53 | * | ||
54 | * @see Matcher | ||
55 | * @see Match | ||
56 | * | ||
57 | */ | ||
58 | @SuppressWarnings("all") | ||
59 | public final class OutputReflexive extends BaseGeneratedEMFQuerySpecification<OutputReflexive.Matcher> { | ||
60 | /** | ||
61 | * Pattern-specific match representation of the modes3.queries.outputReflexive 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 Turnout fT; | ||
74 | |||
75 | private static List<String> parameterNames = makeImmutableList("T"); | ||
76 | |||
77 | private Match(final Turnout pT) { | ||
78 | this.fT = pT; | ||
79 | } | ||
80 | |||
81 | @Override | ||
82 | public Object get(final String parameterName) { | ||
83 | switch(parameterName) { | ||
84 | case "T": return this.fT; | ||
85 | default: return null; | ||
86 | } | ||
87 | } | ||
88 | |||
89 | @Override | ||
90 | public Object get(final int index) { | ||
91 | switch(index) { | ||
92 | case 0: return this.fT; | ||
93 | default: return null; | ||
94 | } | ||
95 | } | ||
96 | |||
97 | public Turnout getT() { | ||
98 | return this.fT; | ||
99 | } | ||
100 | |||
101 | @Override | ||
102 | public boolean set(final String parameterName, final Object newValue) { | ||
103 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
104 | if ("T".equals(parameterName) ) { | ||
105 | this.fT = (Turnout) newValue; | ||
106 | return true; | ||
107 | } | ||
108 | return false; | ||
109 | } | ||
110 | |||
111 | public void setT(final Turnout pT) { | ||
112 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
113 | this.fT = pT; | ||
114 | } | ||
115 | |||
116 | @Override | ||
117 | public String patternName() { | ||
118 | return "modes3.queries.outputReflexive"; | ||
119 | } | ||
120 | |||
121 | @Override | ||
122 | public List<String> parameterNames() { | ||
123 | return OutputReflexive.Match.parameterNames; | ||
124 | } | ||
125 | |||
126 | @Override | ||
127 | public Object[] toArray() { | ||
128 | return new Object[]{fT}; | ||
129 | } | ||
130 | |||
131 | @Override | ||
132 | public OutputReflexive.Match toImmutable() { | ||
133 | return isMutable() ? newMatch(fT) : this; | ||
134 | } | ||
135 | |||
136 | @Override | ||
137 | public String prettyPrint() { | ||
138 | StringBuilder result = new StringBuilder(); | ||
139 | result.append("\"T\"=" + prettyPrintValue(fT)); | ||
140 | return result.toString(); | ||
141 | } | ||
142 | |||
143 | @Override | ||
144 | public int hashCode() { | ||
145 | return Objects.hash(fT); | ||
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 OutputReflexive.Match)) { | ||
156 | OutputReflexive.Match other = (OutputReflexive.Match) obj; | ||
157 | return Objects.equals(fT, other.fT); | ||
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 OutputReflexive specification() { | ||
170 | return OutputReflexive.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 OutputReflexive.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 pT the fixed value of pattern parameter T, or null if not bound. | ||
189 | * @return the new, mutable (partial) match object. | ||
190 | * | ||
191 | */ | ||
192 | public static OutputReflexive.Match newMutableMatch(final Turnout pT) { | ||
193 | return new Mutable(pT); | ||
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 pT the fixed value of pattern parameter T, or null if not bound. | ||
201 | * @return the (partial) match object. | ||
202 | * | ||
203 | */ | ||
204 | public static OutputReflexive.Match newMatch(final Turnout pT) { | ||
205 | return new Immutable(pT); | ||
206 | } | ||
207 | |||
208 | private static final class Mutable extends OutputReflexive.Match { | ||
209 | Mutable(final Turnout pT) { | ||
210 | super(pT); | ||
211 | } | ||
212 | |||
213 | @Override | ||
214 | public boolean isMutable() { | ||
215 | return true; | ||
216 | } | ||
217 | } | ||
218 | |||
219 | private static final class Immutable extends OutputReflexive.Match { | ||
220 | Immutable(final Turnout pT) { | ||
221 | super(pT); | ||
222 | } | ||
223 | |||
224 | @Override | ||
225 | public boolean isMutable() { | ||
226 | return false; | ||
227 | } | ||
228 | } | ||
229 | } | ||
230 | |||
231 | /** | ||
232 | * Generated pattern matcher API of the modes3.queries.outputReflexive 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 | * {@literal @}Constraint(message = "outputReflexive", severity = "error", key = { T }) | ||
243 | * pattern outputReflexive(T : Turnout) { | ||
244 | * find turnoutOutput(T, T); | ||
245 | * } | ||
246 | * </pre></code> | ||
247 | * | ||
248 | * @see Match | ||
249 | * @see OutputReflexive | ||
250 | * | ||
251 | */ | ||
252 | public static class Matcher extends BaseMatcher<OutputReflexive.Match> { | ||
253 | /** | ||
254 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
255 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
256 | * | ||
257 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
258 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
259 | * | ||
260 | */ | ||
261 | public static OutputReflexive.Matcher on(final ViatraQueryEngine engine) { | ||
262 | // check if matcher already exists | ||
263 | Matcher matcher = engine.getExistingMatcher(querySpecification()); | ||
264 | if (matcher == null) { | ||
265 | matcher = (Matcher)engine.getMatcher(querySpecification()); | ||
266 | } | ||
267 | return matcher; | ||
268 | } | ||
269 | |||
270 | /** | ||
271 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
272 | * @return an initialized matcher | ||
273 | * @noreference This method is for internal matcher initialization by the framework, do not call it manually. | ||
274 | * | ||
275 | */ | ||
276 | public static OutputReflexive.Matcher create() { | ||
277 | return new Matcher(); | ||
278 | } | ||
279 | |||
280 | private static final int POSITION_T = 0; | ||
281 | |||
282 | private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(OutputReflexive.Matcher.class); | ||
283 | |||
284 | /** | ||
285 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
286 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
287 | * | ||
288 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
289 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
290 | * | ||
291 | */ | ||
292 | private Matcher() { | ||
293 | super(querySpecification()); | ||
294 | } | ||
295 | |||
296 | /** | ||
297 | * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters. | ||
298 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
299 | * @return matches represented as a Match object. | ||
300 | * | ||
301 | */ | ||
302 | public Collection<OutputReflexive.Match> getAllMatches(final Turnout pT) { | ||
303 | return rawStreamAllMatches(new Object[]{pT}).collect(Collectors.toSet()); | ||
304 | } | ||
305 | |||
306 | /** | ||
307 | * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters. | ||
308 | * </p> | ||
309 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
310 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
311 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
312 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
313 | * @return a stream of matches represented as a Match object. | ||
314 | * | ||
315 | */ | ||
316 | public Stream<OutputReflexive.Match> streamAllMatches(final Turnout pT) { | ||
317 | return rawStreamAllMatches(new Object[]{pT}); | ||
318 | } | ||
319 | |||
320 | /** | ||
321 | * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
322 | * Neither determinism nor randomness of selection is guaranteed. | ||
323 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
324 | * @return a match represented as a Match object, or null if no match is found. | ||
325 | * | ||
326 | */ | ||
327 | public Optional<OutputReflexive.Match> getOneArbitraryMatch(final Turnout pT) { | ||
328 | return rawGetOneArbitraryMatch(new Object[]{pT}); | ||
329 | } | ||
330 | |||
331 | /** | ||
332 | * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match, | ||
333 | * under any possible substitution of the unspecified parameters (if any). | ||
334 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
335 | * @return true if the input is a valid (partial) match of the pattern. | ||
336 | * | ||
337 | */ | ||
338 | public boolean hasMatch(final Turnout pT) { | ||
339 | return rawHasMatch(new Object[]{pT}); | ||
340 | } | ||
341 | |||
342 | /** | ||
343 | * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. | ||
344 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
345 | * @return the number of pattern matches found. | ||
346 | * | ||
347 | */ | ||
348 | public int countMatches(final Turnout pT) { | ||
349 | return rawCountMatches(new Object[]{pT}); | ||
350 | } | ||
351 | |||
352 | /** | ||
353 | * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
354 | * Neither determinism nor randomness of selection is guaranteed. | ||
355 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
356 | * @param processor the action that will process the selected match. | ||
357 | * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked | ||
358 | * | ||
359 | */ | ||
360 | public boolean forOneArbitraryMatch(final Turnout pT, final Consumer<? super OutputReflexive.Match> processor) { | ||
361 | return rawForOneArbitraryMatch(new Object[]{pT}, processor); | ||
362 | } | ||
363 | |||
364 | /** | ||
365 | * Returns a new (partial) match. | ||
366 | * This can be used e.g. to call the matcher with a partial match. | ||
367 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
368 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
369 | * @return the (partial) match object. | ||
370 | * | ||
371 | */ | ||
372 | public OutputReflexive.Match newMatch(final Turnout pT) { | ||
373 | return OutputReflexive.Match.newMatch(pT); | ||
374 | } | ||
375 | |||
376 | /** | ||
377 | * Retrieve the set of values that occur in matches for T. | ||
378 | * @return the Set of all values or empty set if there are no matches | ||
379 | * | ||
380 | */ | ||
381 | protected Stream<Turnout> rawStreamAllValuesOfT(final Object[] parameters) { | ||
382 | return rawStreamAllValues(POSITION_T, parameters).map(Turnout.class::cast); | ||
383 | } | ||
384 | |||
385 | /** | ||
386 | * Retrieve the set of values that occur in matches for T. | ||
387 | * @return the Set of all values or empty set if there are no matches | ||
388 | * | ||
389 | */ | ||
390 | public Set<Turnout> getAllValuesOfT() { | ||
391 | return rawStreamAllValuesOfT(emptyArray()).collect(Collectors.toSet()); | ||
392 | } | ||
393 | |||
394 | /** | ||
395 | * Retrieve the set of values that occur in matches for T. | ||
396 | * @return the Set of all values or empty set if there are no matches | ||
397 | * | ||
398 | */ | ||
399 | public Stream<Turnout> streamAllValuesOfT() { | ||
400 | return rawStreamAllValuesOfT(emptyArray()); | ||
401 | } | ||
402 | |||
403 | @Override | ||
404 | protected OutputReflexive.Match tupleToMatch(final Tuple t) { | ||
405 | try { | ||
406 | return OutputReflexive.Match.newMatch((Turnout) t.get(POSITION_T)); | ||
407 | } catch(ClassCastException e) { | ||
408 | LOGGER.error("Element(s) in tuple not properly typed!",e); | ||
409 | return null; | ||
410 | } | ||
411 | } | ||
412 | |||
413 | @Override | ||
414 | protected OutputReflexive.Match arrayToMatch(final Object[] match) { | ||
415 | try { | ||
416 | return OutputReflexive.Match.newMatch((Turnout) match[POSITION_T]); | ||
417 | } catch(ClassCastException e) { | ||
418 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
419 | return null; | ||
420 | } | ||
421 | } | ||
422 | |||
423 | @Override | ||
424 | protected OutputReflexive.Match arrayToMatchMutable(final Object[] match) { | ||
425 | try { | ||
426 | return OutputReflexive.Match.newMutableMatch((Turnout) match[POSITION_T]); | ||
427 | } catch(ClassCastException e) { | ||
428 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
429 | return null; | ||
430 | } | ||
431 | } | ||
432 | |||
433 | /** | ||
434 | * @return the singleton instance of the query specification of this pattern | ||
435 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
436 | * | ||
437 | */ | ||
438 | public static IQuerySpecification<OutputReflexive.Matcher> querySpecification() { | ||
439 | return OutputReflexive.instance(); | ||
440 | } | ||
441 | } | ||
442 | |||
443 | private OutputReflexive() { | ||
444 | super(GeneratedPQuery.INSTANCE); | ||
445 | } | ||
446 | |||
447 | /** | ||
448 | * @return the singleton instance of the query specification | ||
449 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
450 | * | ||
451 | */ | ||
452 | public static OutputReflexive instance() { | ||
453 | try{ | ||
454 | return LazyHolder.INSTANCE; | ||
455 | } catch (ExceptionInInitializerError err) { | ||
456 | throw processInitializerError(err); | ||
457 | } | ||
458 | } | ||
459 | |||
460 | @Override | ||
461 | protected OutputReflexive.Matcher instantiate(final ViatraQueryEngine engine) { | ||
462 | return OutputReflexive.Matcher.on(engine); | ||
463 | } | ||
464 | |||
465 | @Override | ||
466 | public OutputReflexive.Matcher instantiate() { | ||
467 | return OutputReflexive.Matcher.create(); | ||
468 | } | ||
469 | |||
470 | @Override | ||
471 | public OutputReflexive.Match newEmptyMatch() { | ||
472 | return OutputReflexive.Match.newEmptyMatch(); | ||
473 | } | ||
474 | |||
475 | @Override | ||
476 | public OutputReflexive.Match newMatch(final Object... parameters) { | ||
477 | return OutputReflexive.Match.newMatch((modes3.Turnout) parameters[0]); | ||
478 | } | ||
479 | |||
480 | /** | ||
481 | * Inner class allowing the singleton instance of {@link OutputReflexive} to be created | ||
482 | * <b>not</b> at the class load time of the outer class, | ||
483 | * but rather at the first call to {@link OutputReflexive#instance()}. | ||
484 | * | ||
485 | * <p> This workaround is required e.g. to support recursion. | ||
486 | * | ||
487 | */ | ||
488 | private static class LazyHolder { | ||
489 | private static final OutputReflexive INSTANCE = new OutputReflexive(); | ||
490 | |||
491 | /** | ||
492 | * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned. | ||
493 | * This initialization order is required to support indirect recursion. | ||
494 | * | ||
495 | * <p> The static initializer is defined using a helper field to work around limitations of the code generator. | ||
496 | * | ||
497 | */ | ||
498 | private static final Object STATIC_INITIALIZER = ensureInitialized(); | ||
499 | |||
500 | public static Object ensureInitialized() { | ||
501 | INSTANCE.ensureInitializedInternal(); | ||
502 | return null; | ||
503 | } | ||
504 | } | ||
505 | |||
506 | private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { | ||
507 | private static final OutputReflexive.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
508 | |||
509 | private final PParameter parameter_T = new PParameter("T", "modes3.Turnout", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.ece.mcgill.ca/wcet/modes3", "Turnout")), PParameterDirection.INOUT); | ||
510 | |||
511 | private final List<PParameter> parameters = Arrays.asList(parameter_T); | ||
512 | |||
513 | private GeneratedPQuery() { | ||
514 | super(PVisibility.PUBLIC); | ||
515 | } | ||
516 | |||
517 | @Override | ||
518 | public String getFullyQualifiedName() { | ||
519 | return "modes3.queries.outputReflexive"; | ||
520 | } | ||
521 | |||
522 | @Override | ||
523 | public List<String> getParameterNames() { | ||
524 | return Arrays.asList("T"); | ||
525 | } | ||
526 | |||
527 | @Override | ||
528 | public List<PParameter> getParameters() { | ||
529 | return parameters; | ||
530 | } | ||
531 | |||
532 | @Override | ||
533 | public Set<PBody> doGetContainedBodies() { | ||
534 | setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); | ||
535 | Set<PBody> bodies = new LinkedHashSet<>(); | ||
536 | { | ||
537 | PBody body = new PBody(this); | ||
538 | PVariable var_T = body.getOrCreateVariableByName("T"); | ||
539 | new TypeConstraint(body, Tuples.flatTupleOf(var_T), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Turnout"))); | ||
540 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
541 | new ExportedParameter(body, var_T, parameter_T) | ||
542 | )); | ||
543 | // find turnoutOutput(T, T) | ||
544 | new PositivePatternCall(body, Tuples.flatTupleOf(var_T, var_T), TurnoutOutput.instance().getInternalQueryRepresentation()); | ||
545 | bodies.add(body); | ||
546 | } | ||
547 | { | ||
548 | PAnnotation annotation = new PAnnotation("Constraint"); | ||
549 | annotation.addAttribute("message", "outputReflexive"); | ||
550 | annotation.addAttribute("severity", "error"); | ||
551 | annotation.addAttribute("key", Arrays.asList(new Object[] { | ||
552 | new ParameterReference("T") | ||
553 | })); | ||
554 | addAnnotation(annotation); | ||
555 | } | ||
556 | return bodies; | ||
557 | } | ||
558 | } | ||
559 | } | ||
diff --git a/Domains/ca.mcgill.rtgmrt.example.modes3/vql-gen/modes3/queries/Reachable.java b/Domains/ca.mcgill.rtgmrt.example.modes3/vql-gen/modes3/queries/Reachable.java new file mode 100644 index 00000000..93d43c21 --- /dev/null +++ b/Domains/ca.mcgill.rtgmrt.example.modes3/vql-gen/modes3/queries/Reachable.java | |||
@@ -0,0 +1,719 @@ | |||
1 | /** | ||
2 | * Generated from platform:/resource/ca.mcgill.rtgmrt.example.modes3/src/modes3/queries/Modes3Queries.vql | ||
3 | */ | ||
4 | package modes3.queries; | ||
5 | |||
6 | import java.util.Arrays; | ||
7 | import java.util.Collection; | ||
8 | import java.util.LinkedHashSet; | ||
9 | import java.util.List; | ||
10 | import java.util.Objects; | ||
11 | import java.util.Optional; | ||
12 | import java.util.Set; | ||
13 | import java.util.function.Consumer; | ||
14 | import java.util.stream.Collectors; | ||
15 | import java.util.stream.Stream; | ||
16 | import modes3.Segment; | ||
17 | import modes3.queries.Adjacent; | ||
18 | import org.apache.log4j.Logger; | ||
19 | import org.eclipse.emf.ecore.EClass; | ||
20 | import org.eclipse.viatra.query.runtime.api.IPatternMatch; | ||
21 | import org.eclipse.viatra.query.runtime.api.IQuerySpecification; | ||
22 | import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; | ||
23 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
24 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; | ||
25 | import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; | ||
26 | import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; | ||
27 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
28 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
29 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
30 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
31 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; | ||
32 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
33 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.BinaryTransitiveClosure; | ||
34 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
35 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
36 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
37 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
38 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; | ||
39 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | ||
40 | import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; | ||
41 | |||
42 | /** | ||
43 | * A pattern-specific query specification that can instantiate Matcher in a type-safe way. | ||
44 | * | ||
45 | * <p>Original source: | ||
46 | * <code><pre> | ||
47 | * pattern reachable(S1 : Segment, S2 : Segment) { | ||
48 | * S1 == S2; | ||
49 | * } or { | ||
50 | * find adjacent+(S1, S2); | ||
51 | * } | ||
52 | * </pre></code> | ||
53 | * | ||
54 | * @see Matcher | ||
55 | * @see Match | ||
56 | * | ||
57 | */ | ||
58 | @SuppressWarnings("all") | ||
59 | public final class Reachable extends BaseGeneratedEMFQuerySpecification<Reachable.Matcher> { | ||
60 | /** | ||
61 | * Pattern-specific match representation of the modes3.queries.reachable 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 Segment fS1; | ||
74 | |||
75 | private Segment fS2; | ||
76 | |||
77 | private static List<String> parameterNames = makeImmutableList("S1", "S2"); | ||
78 | |||
79 | private Match(final Segment pS1, final Segment pS2) { | ||
80 | this.fS1 = pS1; | ||
81 | this.fS2 = pS2; | ||
82 | } | ||
83 | |||
84 | @Override | ||
85 | public Object get(final String parameterName) { | ||
86 | switch(parameterName) { | ||
87 | case "S1": return this.fS1; | ||
88 | case "S2": return this.fS2; | ||
89 | default: return null; | ||
90 | } | ||
91 | } | ||
92 | |||
93 | @Override | ||
94 | public Object get(final int index) { | ||
95 | switch(index) { | ||
96 | case 0: return this.fS1; | ||
97 | case 1: return this.fS2; | ||
98 | default: return null; | ||
99 | } | ||
100 | } | ||
101 | |||
102 | public Segment getS1() { | ||
103 | return this.fS1; | ||
104 | } | ||
105 | |||
106 | public Segment getS2() { | ||
107 | return this.fS2; | ||
108 | } | ||
109 | |||
110 | @Override | ||
111 | public boolean set(final String parameterName, final Object newValue) { | ||
112 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
113 | if ("S1".equals(parameterName) ) { | ||
114 | this.fS1 = (Segment) newValue; | ||
115 | return true; | ||
116 | } | ||
117 | if ("S2".equals(parameterName) ) { | ||
118 | this.fS2 = (Segment) newValue; | ||
119 | return true; | ||
120 | } | ||
121 | return false; | ||
122 | } | ||
123 | |||
124 | public void setS1(final Segment pS1) { | ||
125 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
126 | this.fS1 = pS1; | ||
127 | } | ||
128 | |||
129 | public void setS2(final Segment pS2) { | ||
130 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
131 | this.fS2 = pS2; | ||
132 | } | ||
133 | |||
134 | @Override | ||
135 | public String patternName() { | ||
136 | return "modes3.queries.reachable"; | ||
137 | } | ||
138 | |||
139 | @Override | ||
140 | public List<String> parameterNames() { | ||
141 | return Reachable.Match.parameterNames; | ||
142 | } | ||
143 | |||
144 | @Override | ||
145 | public Object[] toArray() { | ||
146 | return new Object[]{fS1, fS2}; | ||
147 | } | ||
148 | |||
149 | @Override | ||
150 | public Reachable.Match toImmutable() { | ||
151 | return isMutable() ? newMatch(fS1, fS2) : this; | ||
152 | } | ||
153 | |||
154 | @Override | ||
155 | public String prettyPrint() { | ||
156 | StringBuilder result = new StringBuilder(); | ||
157 | result.append("\"S1\"=" + prettyPrintValue(fS1) + ", "); | ||
158 | result.append("\"S2\"=" + prettyPrintValue(fS2)); | ||
159 | return result.toString(); | ||
160 | } | ||
161 | |||
162 | @Override | ||
163 | public int hashCode() { | ||
164 | return Objects.hash(fS1, fS2); | ||
165 | } | ||
166 | |||
167 | @Override | ||
168 | public boolean equals(final Object obj) { | ||
169 | if (this == obj) | ||
170 | return true; | ||
171 | if (obj == null) { | ||
172 | return false; | ||
173 | } | ||
174 | if ((obj instanceof Reachable.Match)) { | ||
175 | Reachable.Match other = (Reachable.Match) obj; | ||
176 | return Objects.equals(fS1, other.fS1) && Objects.equals(fS2, other.fS2); | ||
177 | } else { | ||
178 | // this should be infrequent | ||
179 | if (!(obj instanceof IPatternMatch)) { | ||
180 | return false; | ||
181 | } | ||
182 | IPatternMatch otherSig = (IPatternMatch) obj; | ||
183 | return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray()); | ||
184 | } | ||
185 | } | ||
186 | |||
187 | @Override | ||
188 | public Reachable specification() { | ||
189 | return Reachable.instance(); | ||
190 | } | ||
191 | |||
192 | /** | ||
193 | * Returns an empty, mutable match. | ||
194 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
195 | * | ||
196 | * @return the empty match. | ||
197 | * | ||
198 | */ | ||
199 | public static Reachable.Match newEmptyMatch() { | ||
200 | return new Mutable(null, null); | ||
201 | } | ||
202 | |||
203 | /** | ||
204 | * Returns a mutable (partial) match. | ||
205 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
206 | * | ||
207 | * @param pS1 the fixed value of pattern parameter S1, or null if not bound. | ||
208 | * @param pS2 the fixed value of pattern parameter S2, or null if not bound. | ||
209 | * @return the new, mutable (partial) match object. | ||
210 | * | ||
211 | */ | ||
212 | public static Reachable.Match newMutableMatch(final Segment pS1, final Segment pS2) { | ||
213 | return new Mutable(pS1, pS2); | ||
214 | } | ||
215 | |||
216 | /** | ||
217 | * Returns a new (partial) match. | ||
218 | * This can be used e.g. to call the matcher with a partial match. | ||
219 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
220 | * @param pS1 the fixed value of pattern parameter S1, or null if not bound. | ||
221 | * @param pS2 the fixed value of pattern parameter S2, or null if not bound. | ||
222 | * @return the (partial) match object. | ||
223 | * | ||
224 | */ | ||
225 | public static Reachable.Match newMatch(final Segment pS1, final Segment pS2) { | ||
226 | return new Immutable(pS1, pS2); | ||
227 | } | ||
228 | |||
229 | private static final class Mutable extends Reachable.Match { | ||
230 | Mutable(final Segment pS1, final Segment pS2) { | ||
231 | super(pS1, pS2); | ||
232 | } | ||
233 | |||
234 | @Override | ||
235 | public boolean isMutable() { | ||
236 | return true; | ||
237 | } | ||
238 | } | ||
239 | |||
240 | private static final class Immutable extends Reachable.Match { | ||
241 | Immutable(final Segment pS1, final Segment pS2) { | ||
242 | super(pS1, pS2); | ||
243 | } | ||
244 | |||
245 | @Override | ||
246 | public boolean isMutable() { | ||
247 | return false; | ||
248 | } | ||
249 | } | ||
250 | } | ||
251 | |||
252 | /** | ||
253 | * Generated pattern matcher API of the modes3.queries.reachable pattern, | ||
254 | * providing pattern-specific query methods. | ||
255 | * | ||
256 | * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)}, | ||
257 | * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}. | ||
258 | * | ||
259 | * <p>Matches of the pattern will be represented as {@link Match}. | ||
260 | * | ||
261 | * <p>Original source: | ||
262 | * <code><pre> | ||
263 | * pattern reachable(S1 : Segment, S2 : Segment) { | ||
264 | * S1 == S2; | ||
265 | * } or { | ||
266 | * find adjacent+(S1, S2); | ||
267 | * } | ||
268 | * </pre></code> | ||
269 | * | ||
270 | * @see Match | ||
271 | * @see Reachable | ||
272 | * | ||
273 | */ | ||
274 | public static class Matcher extends BaseMatcher<Reachable.Match> { | ||
275 | /** | ||
276 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
277 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
278 | * | ||
279 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
280 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
281 | * | ||
282 | */ | ||
283 | public static Reachable.Matcher on(final ViatraQueryEngine engine) { | ||
284 | // check if matcher already exists | ||
285 | Matcher matcher = engine.getExistingMatcher(querySpecification()); | ||
286 | if (matcher == null) { | ||
287 | matcher = (Matcher)engine.getMatcher(querySpecification()); | ||
288 | } | ||
289 | return matcher; | ||
290 | } | ||
291 | |||
292 | /** | ||
293 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
294 | * @return an initialized matcher | ||
295 | * @noreference This method is for internal matcher initialization by the framework, do not call it manually. | ||
296 | * | ||
297 | */ | ||
298 | public static Reachable.Matcher create() { | ||
299 | return new Matcher(); | ||
300 | } | ||
301 | |||
302 | private static final int POSITION_S1 = 0; | ||
303 | |||
304 | private static final int POSITION_S2 = 1; | ||
305 | |||
306 | private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(Reachable.Matcher.class); | ||
307 | |||
308 | /** | ||
309 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
310 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
311 | * | ||
312 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
313 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
314 | * | ||
315 | */ | ||
316 | private Matcher() { | ||
317 | super(querySpecification()); | ||
318 | } | ||
319 | |||
320 | /** | ||
321 | * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters. | ||
322 | * @param pS1 the fixed value of pattern parameter S1, or null if not bound. | ||
323 | * @param pS2 the fixed value of pattern parameter S2, or null if not bound. | ||
324 | * @return matches represented as a Match object. | ||
325 | * | ||
326 | */ | ||
327 | public Collection<Reachable.Match> getAllMatches(final Segment pS1, final Segment pS2) { | ||
328 | return rawStreamAllMatches(new Object[]{pS1, pS2}).collect(Collectors.toSet()); | ||
329 | } | ||
330 | |||
331 | /** | ||
332 | * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters. | ||
333 | * </p> | ||
334 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
335 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
336 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
337 | * @param pS1 the fixed value of pattern parameter S1, or null if not bound. | ||
338 | * @param pS2 the fixed value of pattern parameter S2, or null if not bound. | ||
339 | * @return a stream of matches represented as a Match object. | ||
340 | * | ||
341 | */ | ||
342 | public Stream<Reachable.Match> streamAllMatches(final Segment pS1, final Segment pS2) { | ||
343 | return rawStreamAllMatches(new Object[]{pS1, pS2}); | ||
344 | } | ||
345 | |||
346 | /** | ||
347 | * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
348 | * Neither determinism nor randomness of selection is guaranteed. | ||
349 | * @param pS1 the fixed value of pattern parameter S1, or null if not bound. | ||
350 | * @param pS2 the fixed value of pattern parameter S2, or null if not bound. | ||
351 | * @return a match represented as a Match object, or null if no match is found. | ||
352 | * | ||
353 | */ | ||
354 | public Optional<Reachable.Match> getOneArbitraryMatch(final Segment pS1, final Segment pS2) { | ||
355 | return rawGetOneArbitraryMatch(new Object[]{pS1, pS2}); | ||
356 | } | ||
357 | |||
358 | /** | ||
359 | * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match, | ||
360 | * under any possible substitution of the unspecified parameters (if any). | ||
361 | * @param pS1 the fixed value of pattern parameter S1, or null if not bound. | ||
362 | * @param pS2 the fixed value of pattern parameter S2, or null if not bound. | ||
363 | * @return true if the input is a valid (partial) match of the pattern. | ||
364 | * | ||
365 | */ | ||
366 | public boolean hasMatch(final Segment pS1, final Segment pS2) { | ||
367 | return rawHasMatch(new Object[]{pS1, pS2}); | ||
368 | } | ||
369 | |||
370 | /** | ||
371 | * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. | ||
372 | * @param pS1 the fixed value of pattern parameter S1, or null if not bound. | ||
373 | * @param pS2 the fixed value of pattern parameter S2, or null if not bound. | ||
374 | * @return the number of pattern matches found. | ||
375 | * | ||
376 | */ | ||
377 | public int countMatches(final Segment pS1, final Segment pS2) { | ||
378 | return rawCountMatches(new Object[]{pS1, pS2}); | ||
379 | } | ||
380 | |||
381 | /** | ||
382 | * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
383 | * Neither determinism nor randomness of selection is guaranteed. | ||
384 | * @param pS1 the fixed value of pattern parameter S1, or null if not bound. | ||
385 | * @param pS2 the fixed value of pattern parameter S2, or null if not bound. | ||
386 | * @param processor the action that will process the selected match. | ||
387 | * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked | ||
388 | * | ||
389 | */ | ||
390 | public boolean forOneArbitraryMatch(final Segment pS1, final Segment pS2, final Consumer<? super Reachable.Match> processor) { | ||
391 | return rawForOneArbitraryMatch(new Object[]{pS1, pS2}, processor); | ||
392 | } | ||
393 | |||
394 | /** | ||
395 | * Returns a new (partial) match. | ||
396 | * This can be used e.g. to call the matcher with a partial match. | ||
397 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
398 | * @param pS1 the fixed value of pattern parameter S1, or null if not bound. | ||
399 | * @param pS2 the fixed value of pattern parameter S2, or null if not bound. | ||
400 | * @return the (partial) match object. | ||
401 | * | ||
402 | */ | ||
403 | public Reachable.Match newMatch(final Segment pS1, final Segment pS2) { | ||
404 | return Reachable.Match.newMatch(pS1, pS2); | ||
405 | } | ||
406 | |||
407 | /** | ||
408 | * Retrieve the set of values that occur in matches for S1. | ||
409 | * @return the Set of all values or empty set if there are no matches | ||
410 | * | ||
411 | */ | ||
412 | protected Stream<Segment> rawStreamAllValuesOfS1(final Object[] parameters) { | ||
413 | return rawStreamAllValues(POSITION_S1, parameters).map(Segment.class::cast); | ||
414 | } | ||
415 | |||
416 | /** | ||
417 | * Retrieve the set of values that occur in matches for S1. | ||
418 | * @return the Set of all values or empty set if there are no matches | ||
419 | * | ||
420 | */ | ||
421 | public Set<Segment> getAllValuesOfS1() { | ||
422 | return rawStreamAllValuesOfS1(emptyArray()).collect(Collectors.toSet()); | ||
423 | } | ||
424 | |||
425 | /** | ||
426 | * Retrieve the set of values that occur in matches for S1. | ||
427 | * @return the Set of all values or empty set if there are no matches | ||
428 | * | ||
429 | */ | ||
430 | public Stream<Segment> streamAllValuesOfS1() { | ||
431 | return rawStreamAllValuesOfS1(emptyArray()); | ||
432 | } | ||
433 | |||
434 | /** | ||
435 | * Retrieve the set of values that occur in matches for S1. | ||
436 | * </p> | ||
437 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
438 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
439 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
440 | * | ||
441 | * @return the Stream of all values or empty set if there are no matches | ||
442 | * | ||
443 | */ | ||
444 | public Stream<Segment> streamAllValuesOfS1(final Reachable.Match partialMatch) { | ||
445 | return rawStreamAllValuesOfS1(partialMatch.toArray()); | ||
446 | } | ||
447 | |||
448 | /** | ||
449 | * Retrieve the set of values that occur in matches for S1. | ||
450 | * </p> | ||
451 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
452 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
453 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
454 | * | ||
455 | * @return the Stream of all values or empty set if there are no matches | ||
456 | * | ||
457 | */ | ||
458 | public Stream<Segment> streamAllValuesOfS1(final Segment pS2) { | ||
459 | return rawStreamAllValuesOfS1(new Object[]{null, pS2}); | ||
460 | } | ||
461 | |||
462 | /** | ||
463 | * Retrieve the set of values that occur in matches for S1. | ||
464 | * @return the Set of all values or empty set if there are no matches | ||
465 | * | ||
466 | */ | ||
467 | public Set<Segment> getAllValuesOfS1(final Reachable.Match partialMatch) { | ||
468 | return rawStreamAllValuesOfS1(partialMatch.toArray()).collect(Collectors.toSet()); | ||
469 | } | ||
470 | |||
471 | /** | ||
472 | * Retrieve the set of values that occur in matches for S1. | ||
473 | * @return the Set of all values or empty set if there are no matches | ||
474 | * | ||
475 | */ | ||
476 | public Set<Segment> getAllValuesOfS1(final Segment pS2) { | ||
477 | return rawStreamAllValuesOfS1(new Object[]{null, pS2}).collect(Collectors.toSet()); | ||
478 | } | ||
479 | |||
480 | /** | ||
481 | * Retrieve the set of values that occur in matches for S2. | ||
482 | * @return the Set of all values or empty set if there are no matches | ||
483 | * | ||
484 | */ | ||
485 | protected Stream<Segment> rawStreamAllValuesOfS2(final Object[] parameters) { | ||
486 | return rawStreamAllValues(POSITION_S2, parameters).map(Segment.class::cast); | ||
487 | } | ||
488 | |||
489 | /** | ||
490 | * Retrieve the set of values that occur in matches for S2. | ||
491 | * @return the Set of all values or empty set if there are no matches | ||
492 | * | ||
493 | */ | ||
494 | public Set<Segment> getAllValuesOfS2() { | ||
495 | return rawStreamAllValuesOfS2(emptyArray()).collect(Collectors.toSet()); | ||
496 | } | ||
497 | |||
498 | /** | ||
499 | * Retrieve the set of values that occur in matches for S2. | ||
500 | * @return the Set of all values or empty set if there are no matches | ||
501 | * | ||
502 | */ | ||
503 | public Stream<Segment> streamAllValuesOfS2() { | ||
504 | return rawStreamAllValuesOfS2(emptyArray()); | ||
505 | } | ||
506 | |||
507 | /** | ||
508 | * Retrieve the set of values that occur in matches for S2. | ||
509 | * </p> | ||
510 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
511 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
512 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
513 | * | ||
514 | * @return the Stream of all values or empty set if there are no matches | ||
515 | * | ||
516 | */ | ||
517 | public Stream<Segment> streamAllValuesOfS2(final Reachable.Match partialMatch) { | ||
518 | return rawStreamAllValuesOfS2(partialMatch.toArray()); | ||
519 | } | ||
520 | |||
521 | /** | ||
522 | * Retrieve the set of values that occur in matches for S2. | ||
523 | * </p> | ||
524 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
525 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
526 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
527 | * | ||
528 | * @return the Stream of all values or empty set if there are no matches | ||
529 | * | ||
530 | */ | ||
531 | public Stream<Segment> streamAllValuesOfS2(final Segment pS1) { | ||
532 | return rawStreamAllValuesOfS2(new Object[]{pS1, null}); | ||
533 | } | ||
534 | |||
535 | /** | ||
536 | * Retrieve the set of values that occur in matches for S2. | ||
537 | * @return the Set of all values or empty set if there are no matches | ||
538 | * | ||
539 | */ | ||
540 | public Set<Segment> getAllValuesOfS2(final Reachable.Match partialMatch) { | ||
541 | return rawStreamAllValuesOfS2(partialMatch.toArray()).collect(Collectors.toSet()); | ||
542 | } | ||
543 | |||
544 | /** | ||
545 | * Retrieve the set of values that occur in matches for S2. | ||
546 | * @return the Set of all values or empty set if there are no matches | ||
547 | * | ||
548 | */ | ||
549 | public Set<Segment> getAllValuesOfS2(final Segment pS1) { | ||
550 | return rawStreamAllValuesOfS2(new Object[]{pS1, null}).collect(Collectors.toSet()); | ||
551 | } | ||
552 | |||
553 | @Override | ||
554 | protected Reachable.Match tupleToMatch(final Tuple t) { | ||
555 | try { | ||
556 | return Reachable.Match.newMatch((Segment) t.get(POSITION_S1), (Segment) t.get(POSITION_S2)); | ||
557 | } catch(ClassCastException e) { | ||
558 | LOGGER.error("Element(s) in tuple not properly typed!",e); | ||
559 | return null; | ||
560 | } | ||
561 | } | ||
562 | |||
563 | @Override | ||
564 | protected Reachable.Match arrayToMatch(final Object[] match) { | ||
565 | try { | ||
566 | return Reachable.Match.newMatch((Segment) match[POSITION_S1], (Segment) match[POSITION_S2]); | ||
567 | } catch(ClassCastException e) { | ||
568 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
569 | return null; | ||
570 | } | ||
571 | } | ||
572 | |||
573 | @Override | ||
574 | protected Reachable.Match arrayToMatchMutable(final Object[] match) { | ||
575 | try { | ||
576 | return Reachable.Match.newMutableMatch((Segment) match[POSITION_S1], (Segment) match[POSITION_S2]); | ||
577 | } catch(ClassCastException e) { | ||
578 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
579 | return null; | ||
580 | } | ||
581 | } | ||
582 | |||
583 | /** | ||
584 | * @return the singleton instance of the query specification of this pattern | ||
585 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
586 | * | ||
587 | */ | ||
588 | public static IQuerySpecification<Reachable.Matcher> querySpecification() { | ||
589 | return Reachable.instance(); | ||
590 | } | ||
591 | } | ||
592 | |||
593 | private Reachable() { | ||
594 | super(GeneratedPQuery.INSTANCE); | ||
595 | } | ||
596 | |||
597 | /** | ||
598 | * @return the singleton instance of the query specification | ||
599 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
600 | * | ||
601 | */ | ||
602 | public static Reachable instance() { | ||
603 | try{ | ||
604 | return LazyHolder.INSTANCE; | ||
605 | } catch (ExceptionInInitializerError err) { | ||
606 | throw processInitializerError(err); | ||
607 | } | ||
608 | } | ||
609 | |||
610 | @Override | ||
611 | protected Reachable.Matcher instantiate(final ViatraQueryEngine engine) { | ||
612 | return Reachable.Matcher.on(engine); | ||
613 | } | ||
614 | |||
615 | @Override | ||
616 | public Reachable.Matcher instantiate() { | ||
617 | return Reachable.Matcher.create(); | ||
618 | } | ||
619 | |||
620 | @Override | ||
621 | public Reachable.Match newEmptyMatch() { | ||
622 | return Reachable.Match.newEmptyMatch(); | ||
623 | } | ||
624 | |||
625 | @Override | ||
626 | public Reachable.Match newMatch(final Object... parameters) { | ||
627 | return Reachable.Match.newMatch((modes3.Segment) parameters[0], (modes3.Segment) parameters[1]); | ||
628 | } | ||
629 | |||
630 | /** | ||
631 | * Inner class allowing the singleton instance of {@link Reachable} to be created | ||
632 | * <b>not</b> at the class load time of the outer class, | ||
633 | * but rather at the first call to {@link Reachable#instance()}. | ||
634 | * | ||
635 | * <p> This workaround is required e.g. to support recursion. | ||
636 | * | ||
637 | */ | ||
638 | private static class LazyHolder { | ||
639 | private static final Reachable INSTANCE = new Reachable(); | ||
640 | |||
641 | /** | ||
642 | * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned. | ||
643 | * This initialization order is required to support indirect recursion. | ||
644 | * | ||
645 | * <p> The static initializer is defined using a helper field to work around limitations of the code generator. | ||
646 | * | ||
647 | */ | ||
648 | private static final Object STATIC_INITIALIZER = ensureInitialized(); | ||
649 | |||
650 | public static Object ensureInitialized() { | ||
651 | INSTANCE.ensureInitializedInternal(); | ||
652 | return null; | ||
653 | } | ||
654 | } | ||
655 | |||
656 | private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { | ||
657 | private static final Reachable.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
658 | |||
659 | private final PParameter parameter_S1 = new PParameter("S1", "modes3.Segment", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.ece.mcgill.ca/wcet/modes3", "Segment")), PParameterDirection.INOUT); | ||
660 | |||
661 | private final PParameter parameter_S2 = new PParameter("S2", "modes3.Segment", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.ece.mcgill.ca/wcet/modes3", "Segment")), PParameterDirection.INOUT); | ||
662 | |||
663 | private final List<PParameter> parameters = Arrays.asList(parameter_S1, parameter_S2); | ||
664 | |||
665 | private GeneratedPQuery() { | ||
666 | super(PVisibility.PUBLIC); | ||
667 | } | ||
668 | |||
669 | @Override | ||
670 | public String getFullyQualifiedName() { | ||
671 | return "modes3.queries.reachable"; | ||
672 | } | ||
673 | |||
674 | @Override | ||
675 | public List<String> getParameterNames() { | ||
676 | return Arrays.asList("S1","S2"); | ||
677 | } | ||
678 | |||
679 | @Override | ||
680 | public List<PParameter> getParameters() { | ||
681 | return parameters; | ||
682 | } | ||
683 | |||
684 | @Override | ||
685 | public Set<PBody> doGetContainedBodies() { | ||
686 | setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); | ||
687 | Set<PBody> bodies = new LinkedHashSet<>(); | ||
688 | { | ||
689 | PBody body = new PBody(this); | ||
690 | PVariable var_S1 = body.getOrCreateVariableByName("S1"); | ||
691 | PVariable var_S2 = body.getOrCreateVariableByName("S2"); | ||
692 | new TypeConstraint(body, Tuples.flatTupleOf(var_S1), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Segment"))); | ||
693 | new TypeConstraint(body, Tuples.flatTupleOf(var_S2), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Segment"))); | ||
694 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
695 | new ExportedParameter(body, var_S1, parameter_S1), | ||
696 | new ExportedParameter(body, var_S2, parameter_S2) | ||
697 | )); | ||
698 | // S1 == S2 | ||
699 | new Equality(body, var_S1, var_S2); | ||
700 | bodies.add(body); | ||
701 | } | ||
702 | { | ||
703 | PBody body = new PBody(this); | ||
704 | PVariable var_S1 = body.getOrCreateVariableByName("S1"); | ||
705 | PVariable var_S2 = body.getOrCreateVariableByName("S2"); | ||
706 | new TypeConstraint(body, Tuples.flatTupleOf(var_S1), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Segment"))); | ||
707 | new TypeConstraint(body, Tuples.flatTupleOf(var_S2), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Segment"))); | ||
708 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
709 | new ExportedParameter(body, var_S1, parameter_S1), | ||
710 | new ExportedParameter(body, var_S2, parameter_S2) | ||
711 | )); | ||
712 | // find adjacent+(S1, S2) | ||
713 | new BinaryTransitiveClosure(body, Tuples.flatTupleOf(var_S1, var_S2), Adjacent.instance().getInternalQueryRepresentation()); | ||
714 | bodies.add(body); | ||
715 | } | ||
716 | return bodies; | ||
717 | } | ||
718 | } | ||
719 | } | ||
diff --git a/Domains/ca.mcgill.rtgmrt.example.modes3/vql-gen/modes3/queries/TooManyExtraInputsOfTurnout.java b/Domains/ca.mcgill.rtgmrt.example.modes3/vql-gen/modes3/queries/TooManyExtraInputsOfTurnout.java new file mode 100644 index 00000000..9f417795 --- /dev/null +++ b/Domains/ca.mcgill.rtgmrt.example.modes3/vql-gen/modes3/queries/TooManyExtraInputsOfTurnout.java | |||
@@ -0,0 +1,570 @@ | |||
1 | /** | ||
2 | * Generated from platform:/resource/ca.mcgill.rtgmrt.example.modes3/src/modes3/queries/Modes3Queries.vql | ||
3 | */ | ||
4 | package modes3.queries; | ||
5 | |||
6 | import java.util.Arrays; | ||
7 | import java.util.Collection; | ||
8 | import java.util.LinkedHashSet; | ||
9 | import java.util.List; | ||
10 | import java.util.Objects; | ||
11 | import java.util.Optional; | ||
12 | import java.util.Set; | ||
13 | import java.util.function.Consumer; | ||
14 | import java.util.stream.Collectors; | ||
15 | import java.util.stream.Stream; | ||
16 | import modes3.Turnout; | ||
17 | import modes3.queries.ExtraInputOfTurnout; | ||
18 | import org.apache.log4j.Logger; | ||
19 | import org.eclipse.emf.ecore.EClass; | ||
20 | import org.eclipse.viatra.query.runtime.api.IPatternMatch; | ||
21 | import org.eclipse.viatra.query.runtime.api.IQuerySpecification; | ||
22 | import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; | ||
23 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
24 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; | ||
25 | import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; | ||
26 | import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; | ||
27 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
28 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
29 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
30 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
31 | import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.PAnnotation; | ||
32 | import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.ParameterReference; | ||
33 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
34 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Inequality; | ||
35 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.PositivePatternCall; | ||
36 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
37 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
38 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
39 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
40 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; | ||
41 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | ||
42 | import 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 | * {@literal @}Constraint(message = "tooManyExtraInputsOfTurnout", severity = "error", key = { T }) | ||
50 | * pattern tooManyExtraInputsOfTurnout(T : Turnout) { | ||
51 | * find extraInputOfTurnout(T, I1); | ||
52 | * find extraInputOfTurnout(T, I2); | ||
53 | * I1 != I2; | ||
54 | * } | ||
55 | * </pre></code> | ||
56 | * | ||
57 | * @see Matcher | ||
58 | * @see Match | ||
59 | * | ||
60 | */ | ||
61 | @SuppressWarnings("all") | ||
62 | public final class TooManyExtraInputsOfTurnout extends BaseGeneratedEMFQuerySpecification<TooManyExtraInputsOfTurnout.Matcher> { | ||
63 | /** | ||
64 | * Pattern-specific match representation of the modes3.queries.tooManyExtraInputsOfTurnout pattern, | ||
65 | * to be used in conjunction with {@link Matcher}. | ||
66 | * | ||
67 | * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned. | ||
68 | * Each instance is a (possibly partial) substitution of pattern parameters, | ||
69 | * usable to represent a match of the pattern in the result of a query, | ||
70 | * or to specify the bound (fixed) input parameters when issuing a query. | ||
71 | * | ||
72 | * @see Matcher | ||
73 | * | ||
74 | */ | ||
75 | public static abstract class Match extends BasePatternMatch { | ||
76 | private Turnout fT; | ||
77 | |||
78 | private static List<String> parameterNames = makeImmutableList("T"); | ||
79 | |||
80 | private Match(final Turnout pT) { | ||
81 | this.fT = pT; | ||
82 | } | ||
83 | |||
84 | @Override | ||
85 | public Object get(final String parameterName) { | ||
86 | switch(parameterName) { | ||
87 | case "T": return this.fT; | ||
88 | default: return null; | ||
89 | } | ||
90 | } | ||
91 | |||
92 | @Override | ||
93 | public Object get(final int index) { | ||
94 | switch(index) { | ||
95 | case 0: return this.fT; | ||
96 | default: return null; | ||
97 | } | ||
98 | } | ||
99 | |||
100 | public Turnout getT() { | ||
101 | return this.fT; | ||
102 | } | ||
103 | |||
104 | @Override | ||
105 | public boolean set(final String parameterName, final Object newValue) { | ||
106 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
107 | if ("T".equals(parameterName) ) { | ||
108 | this.fT = (Turnout) newValue; | ||
109 | return true; | ||
110 | } | ||
111 | return false; | ||
112 | } | ||
113 | |||
114 | public void setT(final Turnout pT) { | ||
115 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
116 | this.fT = pT; | ||
117 | } | ||
118 | |||
119 | @Override | ||
120 | public String patternName() { | ||
121 | return "modes3.queries.tooManyExtraInputsOfTurnout"; | ||
122 | } | ||
123 | |||
124 | @Override | ||
125 | public List<String> parameterNames() { | ||
126 | return TooManyExtraInputsOfTurnout.Match.parameterNames; | ||
127 | } | ||
128 | |||
129 | @Override | ||
130 | public Object[] toArray() { | ||
131 | return new Object[]{fT}; | ||
132 | } | ||
133 | |||
134 | @Override | ||
135 | public TooManyExtraInputsOfTurnout.Match toImmutable() { | ||
136 | return isMutable() ? newMatch(fT) : this; | ||
137 | } | ||
138 | |||
139 | @Override | ||
140 | public String prettyPrint() { | ||
141 | StringBuilder result = new StringBuilder(); | ||
142 | result.append("\"T\"=" + prettyPrintValue(fT)); | ||
143 | return result.toString(); | ||
144 | } | ||
145 | |||
146 | @Override | ||
147 | public int hashCode() { | ||
148 | return Objects.hash(fT); | ||
149 | } | ||
150 | |||
151 | @Override | ||
152 | public boolean equals(final Object obj) { | ||
153 | if (this == obj) | ||
154 | return true; | ||
155 | if (obj == null) { | ||
156 | return false; | ||
157 | } | ||
158 | if ((obj instanceof TooManyExtraInputsOfTurnout.Match)) { | ||
159 | TooManyExtraInputsOfTurnout.Match other = (TooManyExtraInputsOfTurnout.Match) obj; | ||
160 | return Objects.equals(fT, other.fT); | ||
161 | } else { | ||
162 | // this should be infrequent | ||
163 | if (!(obj instanceof IPatternMatch)) { | ||
164 | return false; | ||
165 | } | ||
166 | IPatternMatch otherSig = (IPatternMatch) obj; | ||
167 | return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray()); | ||
168 | } | ||
169 | } | ||
170 | |||
171 | @Override | ||
172 | public TooManyExtraInputsOfTurnout specification() { | ||
173 | return TooManyExtraInputsOfTurnout.instance(); | ||
174 | } | ||
175 | |||
176 | /** | ||
177 | * Returns an empty, mutable match. | ||
178 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
179 | * | ||
180 | * @return the empty match. | ||
181 | * | ||
182 | */ | ||
183 | public static TooManyExtraInputsOfTurnout.Match newEmptyMatch() { | ||
184 | return new Mutable(null); | ||
185 | } | ||
186 | |||
187 | /** | ||
188 | * Returns a mutable (partial) match. | ||
189 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
190 | * | ||
191 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
192 | * @return the new, mutable (partial) match object. | ||
193 | * | ||
194 | */ | ||
195 | public static TooManyExtraInputsOfTurnout.Match newMutableMatch(final Turnout pT) { | ||
196 | return new Mutable(pT); | ||
197 | } | ||
198 | |||
199 | /** | ||
200 | * Returns a new (partial) match. | ||
201 | * This can be used e.g. to call the matcher with a partial match. | ||
202 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
203 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
204 | * @return the (partial) match object. | ||
205 | * | ||
206 | */ | ||
207 | public static TooManyExtraInputsOfTurnout.Match newMatch(final Turnout pT) { | ||
208 | return new Immutable(pT); | ||
209 | } | ||
210 | |||
211 | private static final class Mutable extends TooManyExtraInputsOfTurnout.Match { | ||
212 | Mutable(final Turnout pT) { | ||
213 | super(pT); | ||
214 | } | ||
215 | |||
216 | @Override | ||
217 | public boolean isMutable() { | ||
218 | return true; | ||
219 | } | ||
220 | } | ||
221 | |||
222 | private static final class Immutable extends TooManyExtraInputsOfTurnout.Match { | ||
223 | Immutable(final Turnout pT) { | ||
224 | super(pT); | ||
225 | } | ||
226 | |||
227 | @Override | ||
228 | public boolean isMutable() { | ||
229 | return false; | ||
230 | } | ||
231 | } | ||
232 | } | ||
233 | |||
234 | /** | ||
235 | * Generated pattern matcher API of the modes3.queries.tooManyExtraInputsOfTurnout pattern, | ||
236 | * providing pattern-specific query methods. | ||
237 | * | ||
238 | * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)}, | ||
239 | * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}. | ||
240 | * | ||
241 | * <p>Matches of the pattern will be represented as {@link Match}. | ||
242 | * | ||
243 | * <p>Original source: | ||
244 | * <code><pre> | ||
245 | * {@literal @}Constraint(message = "tooManyExtraInputsOfTurnout", severity = "error", key = { T }) | ||
246 | * pattern tooManyExtraInputsOfTurnout(T : Turnout) { | ||
247 | * find extraInputOfTurnout(T, I1); | ||
248 | * find extraInputOfTurnout(T, I2); | ||
249 | * I1 != I2; | ||
250 | * } | ||
251 | * </pre></code> | ||
252 | * | ||
253 | * @see Match | ||
254 | * @see TooManyExtraInputsOfTurnout | ||
255 | * | ||
256 | */ | ||
257 | public static class Matcher extends BaseMatcher<TooManyExtraInputsOfTurnout.Match> { | ||
258 | /** | ||
259 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
260 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
261 | * | ||
262 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
263 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
264 | * | ||
265 | */ | ||
266 | public static TooManyExtraInputsOfTurnout.Matcher on(final ViatraQueryEngine engine) { | ||
267 | // check if matcher already exists | ||
268 | Matcher matcher = engine.getExistingMatcher(querySpecification()); | ||
269 | if (matcher == null) { | ||
270 | matcher = (Matcher)engine.getMatcher(querySpecification()); | ||
271 | } | ||
272 | return matcher; | ||
273 | } | ||
274 | |||
275 | /** | ||
276 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
277 | * @return an initialized matcher | ||
278 | * @noreference This method is for internal matcher initialization by the framework, do not call it manually. | ||
279 | * | ||
280 | */ | ||
281 | public static TooManyExtraInputsOfTurnout.Matcher create() { | ||
282 | return new Matcher(); | ||
283 | } | ||
284 | |||
285 | private static final int POSITION_T = 0; | ||
286 | |||
287 | private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(TooManyExtraInputsOfTurnout.Matcher.class); | ||
288 | |||
289 | /** | ||
290 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
291 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
292 | * | ||
293 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
294 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
295 | * | ||
296 | */ | ||
297 | private Matcher() { | ||
298 | super(querySpecification()); | ||
299 | } | ||
300 | |||
301 | /** | ||
302 | * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters. | ||
303 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
304 | * @return matches represented as a Match object. | ||
305 | * | ||
306 | */ | ||
307 | public Collection<TooManyExtraInputsOfTurnout.Match> getAllMatches(final Turnout pT) { | ||
308 | return rawStreamAllMatches(new Object[]{pT}).collect(Collectors.toSet()); | ||
309 | } | ||
310 | |||
311 | /** | ||
312 | * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters. | ||
313 | * </p> | ||
314 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
315 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
316 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
317 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
318 | * @return a stream of matches represented as a Match object. | ||
319 | * | ||
320 | */ | ||
321 | public Stream<TooManyExtraInputsOfTurnout.Match> streamAllMatches(final Turnout pT) { | ||
322 | return rawStreamAllMatches(new Object[]{pT}); | ||
323 | } | ||
324 | |||
325 | /** | ||
326 | * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
327 | * Neither determinism nor randomness of selection is guaranteed. | ||
328 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
329 | * @return a match represented as a Match object, or null if no match is found. | ||
330 | * | ||
331 | */ | ||
332 | public Optional<TooManyExtraInputsOfTurnout.Match> getOneArbitraryMatch(final Turnout pT) { | ||
333 | return rawGetOneArbitraryMatch(new Object[]{pT}); | ||
334 | } | ||
335 | |||
336 | /** | ||
337 | * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match, | ||
338 | * under any possible substitution of the unspecified parameters (if any). | ||
339 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
340 | * @return true if the input is a valid (partial) match of the pattern. | ||
341 | * | ||
342 | */ | ||
343 | public boolean hasMatch(final Turnout pT) { | ||
344 | return rawHasMatch(new Object[]{pT}); | ||
345 | } | ||
346 | |||
347 | /** | ||
348 | * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. | ||
349 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
350 | * @return the number of pattern matches found. | ||
351 | * | ||
352 | */ | ||
353 | public int countMatches(final Turnout pT) { | ||
354 | return rawCountMatches(new Object[]{pT}); | ||
355 | } | ||
356 | |||
357 | /** | ||
358 | * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
359 | * Neither determinism nor randomness of selection is guaranteed. | ||
360 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
361 | * @param processor the action that will process the selected match. | ||
362 | * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked | ||
363 | * | ||
364 | */ | ||
365 | public boolean forOneArbitraryMatch(final Turnout pT, final Consumer<? super TooManyExtraInputsOfTurnout.Match> processor) { | ||
366 | return rawForOneArbitraryMatch(new Object[]{pT}, processor); | ||
367 | } | ||
368 | |||
369 | /** | ||
370 | * Returns a new (partial) match. | ||
371 | * This can be used e.g. to call the matcher with a partial match. | ||
372 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
373 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
374 | * @return the (partial) match object. | ||
375 | * | ||
376 | */ | ||
377 | public TooManyExtraInputsOfTurnout.Match newMatch(final Turnout pT) { | ||
378 | return TooManyExtraInputsOfTurnout.Match.newMatch(pT); | ||
379 | } | ||
380 | |||
381 | /** | ||
382 | * Retrieve the set of values that occur in matches for T. | ||
383 | * @return the Set of all values or empty set if there are no matches | ||
384 | * | ||
385 | */ | ||
386 | protected Stream<Turnout> rawStreamAllValuesOfT(final Object[] parameters) { | ||
387 | return rawStreamAllValues(POSITION_T, parameters).map(Turnout.class::cast); | ||
388 | } | ||
389 | |||
390 | /** | ||
391 | * Retrieve the set of values that occur in matches for T. | ||
392 | * @return the Set of all values or empty set if there are no matches | ||
393 | * | ||
394 | */ | ||
395 | public Set<Turnout> getAllValuesOfT() { | ||
396 | return rawStreamAllValuesOfT(emptyArray()).collect(Collectors.toSet()); | ||
397 | } | ||
398 | |||
399 | /** | ||
400 | * Retrieve the set of values that occur in matches for T. | ||
401 | * @return the Set of all values or empty set if there are no matches | ||
402 | * | ||
403 | */ | ||
404 | public Stream<Turnout> streamAllValuesOfT() { | ||
405 | return rawStreamAllValuesOfT(emptyArray()); | ||
406 | } | ||
407 | |||
408 | @Override | ||
409 | protected TooManyExtraInputsOfTurnout.Match tupleToMatch(final Tuple t) { | ||
410 | try { | ||
411 | return TooManyExtraInputsOfTurnout.Match.newMatch((Turnout) t.get(POSITION_T)); | ||
412 | } catch(ClassCastException e) { | ||
413 | LOGGER.error("Element(s) in tuple not properly typed!",e); | ||
414 | return null; | ||
415 | } | ||
416 | } | ||
417 | |||
418 | @Override | ||
419 | protected TooManyExtraInputsOfTurnout.Match arrayToMatch(final Object[] match) { | ||
420 | try { | ||
421 | return TooManyExtraInputsOfTurnout.Match.newMatch((Turnout) match[POSITION_T]); | ||
422 | } catch(ClassCastException e) { | ||
423 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
424 | return null; | ||
425 | } | ||
426 | } | ||
427 | |||
428 | @Override | ||
429 | protected TooManyExtraInputsOfTurnout.Match arrayToMatchMutable(final Object[] match) { | ||
430 | try { | ||
431 | return TooManyExtraInputsOfTurnout.Match.newMutableMatch((Turnout) match[POSITION_T]); | ||
432 | } catch(ClassCastException e) { | ||
433 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
434 | return null; | ||
435 | } | ||
436 | } | ||
437 | |||
438 | /** | ||
439 | * @return the singleton instance of the query specification of this pattern | ||
440 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
441 | * | ||
442 | */ | ||
443 | public static IQuerySpecification<TooManyExtraInputsOfTurnout.Matcher> querySpecification() { | ||
444 | return TooManyExtraInputsOfTurnout.instance(); | ||
445 | } | ||
446 | } | ||
447 | |||
448 | private TooManyExtraInputsOfTurnout() { | ||
449 | super(GeneratedPQuery.INSTANCE); | ||
450 | } | ||
451 | |||
452 | /** | ||
453 | * @return the singleton instance of the query specification | ||
454 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
455 | * | ||
456 | */ | ||
457 | public static TooManyExtraInputsOfTurnout instance() { | ||
458 | try{ | ||
459 | return LazyHolder.INSTANCE; | ||
460 | } catch (ExceptionInInitializerError err) { | ||
461 | throw processInitializerError(err); | ||
462 | } | ||
463 | } | ||
464 | |||
465 | @Override | ||
466 | protected TooManyExtraInputsOfTurnout.Matcher instantiate(final ViatraQueryEngine engine) { | ||
467 | return TooManyExtraInputsOfTurnout.Matcher.on(engine); | ||
468 | } | ||
469 | |||
470 | @Override | ||
471 | public TooManyExtraInputsOfTurnout.Matcher instantiate() { | ||
472 | return TooManyExtraInputsOfTurnout.Matcher.create(); | ||
473 | } | ||
474 | |||
475 | @Override | ||
476 | public TooManyExtraInputsOfTurnout.Match newEmptyMatch() { | ||
477 | return TooManyExtraInputsOfTurnout.Match.newEmptyMatch(); | ||
478 | } | ||
479 | |||
480 | @Override | ||
481 | public TooManyExtraInputsOfTurnout.Match newMatch(final Object... parameters) { | ||
482 | return TooManyExtraInputsOfTurnout.Match.newMatch((modes3.Turnout) parameters[0]); | ||
483 | } | ||
484 | |||
485 | /** | ||
486 | * Inner class allowing the singleton instance of {@link TooManyExtraInputsOfTurnout} to be created | ||
487 | * <b>not</b> at the class load time of the outer class, | ||
488 | * but rather at the first call to {@link TooManyExtraInputsOfTurnout#instance()}. | ||
489 | * | ||
490 | * <p> This workaround is required e.g. to support recursion. | ||
491 | * | ||
492 | */ | ||
493 | private static class LazyHolder { | ||
494 | private static final TooManyExtraInputsOfTurnout INSTANCE = new TooManyExtraInputsOfTurnout(); | ||
495 | |||
496 | /** | ||
497 | * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned. | ||
498 | * This initialization order is required to support indirect recursion. | ||
499 | * | ||
500 | * <p> The static initializer is defined using a helper field to work around limitations of the code generator. | ||
501 | * | ||
502 | */ | ||
503 | private static final Object STATIC_INITIALIZER = ensureInitialized(); | ||
504 | |||
505 | public static Object ensureInitialized() { | ||
506 | INSTANCE.ensureInitializedInternal(); | ||
507 | return null; | ||
508 | } | ||
509 | } | ||
510 | |||
511 | private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { | ||
512 | private static final TooManyExtraInputsOfTurnout.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
513 | |||
514 | private final PParameter parameter_T = new PParameter("T", "modes3.Turnout", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.ece.mcgill.ca/wcet/modes3", "Turnout")), PParameterDirection.INOUT); | ||
515 | |||
516 | private final List<PParameter> parameters = Arrays.asList(parameter_T); | ||
517 | |||
518 | private GeneratedPQuery() { | ||
519 | super(PVisibility.PUBLIC); | ||
520 | } | ||
521 | |||
522 | @Override | ||
523 | public String getFullyQualifiedName() { | ||
524 | return "modes3.queries.tooManyExtraInputsOfTurnout"; | ||
525 | } | ||
526 | |||
527 | @Override | ||
528 | public List<String> getParameterNames() { | ||
529 | return Arrays.asList("T"); | ||
530 | } | ||
531 | |||
532 | @Override | ||
533 | public List<PParameter> getParameters() { | ||
534 | return parameters; | ||
535 | } | ||
536 | |||
537 | @Override | ||
538 | public Set<PBody> doGetContainedBodies() { | ||
539 | setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); | ||
540 | Set<PBody> bodies = new LinkedHashSet<>(); | ||
541 | { | ||
542 | PBody body = new PBody(this); | ||
543 | PVariable var_T = body.getOrCreateVariableByName("T"); | ||
544 | PVariable var_I1 = body.getOrCreateVariableByName("I1"); | ||
545 | PVariable var_I2 = body.getOrCreateVariableByName("I2"); | ||
546 | new TypeConstraint(body, Tuples.flatTupleOf(var_T), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Turnout"))); | ||
547 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
548 | new ExportedParameter(body, var_T, parameter_T) | ||
549 | )); | ||
550 | // find extraInputOfTurnout(T, I1) | ||
551 | new PositivePatternCall(body, Tuples.flatTupleOf(var_T, var_I1), ExtraInputOfTurnout.instance().getInternalQueryRepresentation()); | ||
552 | // find extraInputOfTurnout(T, I2) | ||
553 | new PositivePatternCall(body, Tuples.flatTupleOf(var_T, var_I2), ExtraInputOfTurnout.instance().getInternalQueryRepresentation()); | ||
554 | // I1 != I2 | ||
555 | new Inequality(body, var_I1, var_I2); | ||
556 | bodies.add(body); | ||
557 | } | ||
558 | { | ||
559 | PAnnotation annotation = new PAnnotation("Constraint"); | ||
560 | annotation.addAttribute("message", "tooManyExtraInputsOfTurnout"); | ||
561 | annotation.addAttribute("severity", "error"); | ||
562 | annotation.addAttribute("key", Arrays.asList(new Object[] { | ||
563 | new ParameterReference("T") | ||
564 | })); | ||
565 | addAnnotation(annotation); | ||
566 | } | ||
567 | return bodies; | ||
568 | } | ||
569 | } | ||
570 | } | ||
diff --git a/Domains/ca.mcgill.rtgmrt.example.modes3/vql-gen/modes3/queries/TooManyInputsOfSegment.java b/Domains/ca.mcgill.rtgmrt.example.modes3/vql-gen/modes3/queries/TooManyInputsOfSegment.java new file mode 100644 index 00000000..e5e8827c --- /dev/null +++ b/Domains/ca.mcgill.rtgmrt.example.modes3/vql-gen/modes3/queries/TooManyInputsOfSegment.java | |||
@@ -0,0 +1,601 @@ | |||
1 | /** | ||
2 | * Generated from platform:/resource/ca.mcgill.rtgmrt.example.modes3/src/modes3/queries/Modes3Queries.vql | ||
3 | */ | ||
4 | package modes3.queries; | ||
5 | |||
6 | import java.util.Arrays; | ||
7 | import java.util.Collection; | ||
8 | import java.util.LinkedHashSet; | ||
9 | import java.util.List; | ||
10 | import java.util.Objects; | ||
11 | import java.util.Optional; | ||
12 | import java.util.Set; | ||
13 | import java.util.function.Consumer; | ||
14 | import java.util.stream.Collectors; | ||
15 | import java.util.stream.Stream; | ||
16 | import modes3.Segment; | ||
17 | import modes3.queries.Output; | ||
18 | import modes3.queries.Turnout; | ||
19 | import org.apache.log4j.Logger; | ||
20 | import org.eclipse.emf.ecore.EClass; | ||
21 | import org.eclipse.viatra.query.runtime.api.IPatternMatch; | ||
22 | import org.eclipse.viatra.query.runtime.api.IQuerySpecification; | ||
23 | import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; | ||
24 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
25 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; | ||
26 | import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; | ||
27 | import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; | ||
28 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
29 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
30 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
31 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
32 | import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.PAnnotation; | ||
33 | import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.ParameterReference; | ||
34 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
35 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Inequality; | ||
36 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.NegativePatternCall; | ||
37 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.PositivePatternCall; | ||
38 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
39 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
40 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
41 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
42 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; | ||
43 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | ||
44 | import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; | ||
45 | |||
46 | /** | ||
47 | * A pattern-specific query specification that can instantiate Matcher in a type-safe way. | ||
48 | * | ||
49 | * <p>Original source: | ||
50 | * <code><pre> | ||
51 | * //{@literal @}Constraint(message = "noInputOfSegment", severity = "error", key = { S }) | ||
52 | * //pattern noInputOfSegment(S : Segment) { | ||
53 | * // neg find turnout(S); | ||
54 | * // neg find output(_, S); | ||
55 | * //} | ||
56 | * | ||
57 | * {@literal @}Constraint(message = "tooManyInputsOfSegment", severity = "error", key = { S }) | ||
58 | * pattern tooManyInputsOfSegment(S : Segment) { | ||
59 | * neg find turnout(S); | ||
60 | * find output(I1, S); | ||
61 | * find output(I2, S); | ||
62 | * find output(I3, S); | ||
63 | * I1 != I2; | ||
64 | * I1 != I3; | ||
65 | * I2 != I3; | ||
66 | * } | ||
67 | * </pre></code> | ||
68 | * | ||
69 | * @see Matcher | ||
70 | * @see Match | ||
71 | * | ||
72 | */ | ||
73 | @SuppressWarnings("all") | ||
74 | public final class TooManyInputsOfSegment extends BaseGeneratedEMFQuerySpecification<TooManyInputsOfSegment.Matcher> { | ||
75 | /** | ||
76 | * Pattern-specific match representation of the modes3.queries.tooManyInputsOfSegment 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 Segment fS; | ||
89 | |||
90 | private static List<String> parameterNames = makeImmutableList("S"); | ||
91 | |||
92 | private Match(final Segment pS) { | ||
93 | this.fS = pS; | ||
94 | } | ||
95 | |||
96 | @Override | ||
97 | public Object get(final String parameterName) { | ||
98 | switch(parameterName) { | ||
99 | case "S": return this.fS; | ||
100 | default: return null; | ||
101 | } | ||
102 | } | ||
103 | |||
104 | @Override | ||
105 | public Object get(final int index) { | ||
106 | switch(index) { | ||
107 | case 0: return this.fS; | ||
108 | default: return null; | ||
109 | } | ||
110 | } | ||
111 | |||
112 | public Segment getS() { | ||
113 | return this.fS; | ||
114 | } | ||
115 | |||
116 | @Override | ||
117 | public boolean set(final String parameterName, final Object newValue) { | ||
118 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
119 | if ("S".equals(parameterName) ) { | ||
120 | this.fS = (Segment) newValue; | ||
121 | return true; | ||
122 | } | ||
123 | return false; | ||
124 | } | ||
125 | |||
126 | public void setS(final Segment pS) { | ||
127 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
128 | this.fS = pS; | ||
129 | } | ||
130 | |||
131 | @Override | ||
132 | public String patternName() { | ||
133 | return "modes3.queries.tooManyInputsOfSegment"; | ||
134 | } | ||
135 | |||
136 | @Override | ||
137 | public List<String> parameterNames() { | ||
138 | return TooManyInputsOfSegment.Match.parameterNames; | ||
139 | } | ||
140 | |||
141 | @Override | ||
142 | public Object[] toArray() { | ||
143 | return new Object[]{fS}; | ||
144 | } | ||
145 | |||
146 | @Override | ||
147 | public TooManyInputsOfSegment.Match toImmutable() { | ||
148 | return isMutable() ? newMatch(fS) : this; | ||
149 | } | ||
150 | |||
151 | @Override | ||
152 | public String prettyPrint() { | ||
153 | StringBuilder result = new StringBuilder(); | ||
154 | result.append("\"S\"=" + prettyPrintValue(fS)); | ||
155 | return result.toString(); | ||
156 | } | ||
157 | |||
158 | @Override | ||
159 | public int hashCode() { | ||
160 | return Objects.hash(fS); | ||
161 | } | ||
162 | |||
163 | @Override | ||
164 | public boolean equals(final Object obj) { | ||
165 | if (this == obj) | ||
166 | return true; | ||
167 | if (obj == null) { | ||
168 | return false; | ||
169 | } | ||
170 | if ((obj instanceof TooManyInputsOfSegment.Match)) { | ||
171 | TooManyInputsOfSegment.Match other = (TooManyInputsOfSegment.Match) obj; | ||
172 | return Objects.equals(fS, other.fS); | ||
173 | } else { | ||
174 | // this should be infrequent | ||
175 | if (!(obj instanceof IPatternMatch)) { | ||
176 | return false; | ||
177 | } | ||
178 | IPatternMatch otherSig = (IPatternMatch) obj; | ||
179 | return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray()); | ||
180 | } | ||
181 | } | ||
182 | |||
183 | @Override | ||
184 | public TooManyInputsOfSegment specification() { | ||
185 | return TooManyInputsOfSegment.instance(); | ||
186 | } | ||
187 | |||
188 | /** | ||
189 | * Returns an empty, mutable match. | ||
190 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
191 | * | ||
192 | * @return the empty match. | ||
193 | * | ||
194 | */ | ||
195 | public static TooManyInputsOfSegment.Match newEmptyMatch() { | ||
196 | return new Mutable(null); | ||
197 | } | ||
198 | |||
199 | /** | ||
200 | * Returns a mutable (partial) match. | ||
201 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
202 | * | ||
203 | * @param pS the fixed value of pattern parameter S, or null if not bound. | ||
204 | * @return the new, mutable (partial) match object. | ||
205 | * | ||
206 | */ | ||
207 | public static TooManyInputsOfSegment.Match newMutableMatch(final Segment pS) { | ||
208 | return new Mutable(pS); | ||
209 | } | ||
210 | |||
211 | /** | ||
212 | * Returns a new (partial) match. | ||
213 | * This can be used e.g. to call the matcher with a partial match. | ||
214 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
215 | * @param pS the fixed value of pattern parameter S, or null if not bound. | ||
216 | * @return the (partial) match object. | ||
217 | * | ||
218 | */ | ||
219 | public static TooManyInputsOfSegment.Match newMatch(final Segment pS) { | ||
220 | return new Immutable(pS); | ||
221 | } | ||
222 | |||
223 | private static final class Mutable extends TooManyInputsOfSegment.Match { | ||
224 | Mutable(final Segment pS) { | ||
225 | super(pS); | ||
226 | } | ||
227 | |||
228 | @Override | ||
229 | public boolean isMutable() { | ||
230 | return true; | ||
231 | } | ||
232 | } | ||
233 | |||
234 | private static final class Immutable extends TooManyInputsOfSegment.Match { | ||
235 | Immutable(final Segment pS) { | ||
236 | super(pS); | ||
237 | } | ||
238 | |||
239 | @Override | ||
240 | public boolean isMutable() { | ||
241 | return false; | ||
242 | } | ||
243 | } | ||
244 | } | ||
245 | |||
246 | /** | ||
247 | * Generated pattern matcher API of the modes3.queries.tooManyInputsOfSegment pattern, | ||
248 | * providing pattern-specific query methods. | ||
249 | * | ||
250 | * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)}, | ||
251 | * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}. | ||
252 | * | ||
253 | * <p>Matches of the pattern will be represented as {@link Match}. | ||
254 | * | ||
255 | * <p>Original source: | ||
256 | * <code><pre> | ||
257 | * //{@literal @}Constraint(message = "noInputOfSegment", severity = "error", key = { S }) | ||
258 | * //pattern noInputOfSegment(S : Segment) { | ||
259 | * // neg find turnout(S); | ||
260 | * // neg find output(_, S); | ||
261 | * //} | ||
262 | * | ||
263 | * {@literal @}Constraint(message = "tooManyInputsOfSegment", severity = "error", key = { S }) | ||
264 | * pattern tooManyInputsOfSegment(S : Segment) { | ||
265 | * neg find turnout(S); | ||
266 | * find output(I1, S); | ||
267 | * find output(I2, S); | ||
268 | * find output(I3, S); | ||
269 | * I1 != I2; | ||
270 | * I1 != I3; | ||
271 | * I2 != I3; | ||
272 | * } | ||
273 | * </pre></code> | ||
274 | * | ||
275 | * @see Match | ||
276 | * @see TooManyInputsOfSegment | ||
277 | * | ||
278 | */ | ||
279 | public static class Matcher extends BaseMatcher<TooManyInputsOfSegment.Match> { | ||
280 | /** | ||
281 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
282 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
283 | * | ||
284 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
285 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
286 | * | ||
287 | */ | ||
288 | public static TooManyInputsOfSegment.Matcher on(final ViatraQueryEngine engine) { | ||
289 | // check if matcher already exists | ||
290 | Matcher matcher = engine.getExistingMatcher(querySpecification()); | ||
291 | if (matcher == null) { | ||
292 | matcher = (Matcher)engine.getMatcher(querySpecification()); | ||
293 | } | ||
294 | return matcher; | ||
295 | } | ||
296 | |||
297 | /** | ||
298 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
299 | * @return an initialized matcher | ||
300 | * @noreference This method is for internal matcher initialization by the framework, do not call it manually. | ||
301 | * | ||
302 | */ | ||
303 | public static TooManyInputsOfSegment.Matcher create() { | ||
304 | return new Matcher(); | ||
305 | } | ||
306 | |||
307 | private static final int POSITION_S = 0; | ||
308 | |||
309 | private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(TooManyInputsOfSegment.Matcher.class); | ||
310 | |||
311 | /** | ||
312 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
313 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
314 | * | ||
315 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
316 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
317 | * | ||
318 | */ | ||
319 | private Matcher() { | ||
320 | super(querySpecification()); | ||
321 | } | ||
322 | |||
323 | /** | ||
324 | * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters. | ||
325 | * @param pS the fixed value of pattern parameter S, or null if not bound. | ||
326 | * @return matches represented as a Match object. | ||
327 | * | ||
328 | */ | ||
329 | public Collection<TooManyInputsOfSegment.Match> getAllMatches(final Segment pS) { | ||
330 | return rawStreamAllMatches(new Object[]{pS}).collect(Collectors.toSet()); | ||
331 | } | ||
332 | |||
333 | /** | ||
334 | * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters. | ||
335 | * </p> | ||
336 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
337 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
338 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
339 | * @param pS the fixed value of pattern parameter S, or null if not bound. | ||
340 | * @return a stream of matches represented as a Match object. | ||
341 | * | ||
342 | */ | ||
343 | public Stream<TooManyInputsOfSegment.Match> streamAllMatches(final Segment pS) { | ||
344 | return rawStreamAllMatches(new Object[]{pS}); | ||
345 | } | ||
346 | |||
347 | /** | ||
348 | * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
349 | * Neither determinism nor randomness of selection is guaranteed. | ||
350 | * @param pS the fixed value of pattern parameter S, or null if not bound. | ||
351 | * @return a match represented as a Match object, or null if no match is found. | ||
352 | * | ||
353 | */ | ||
354 | public Optional<TooManyInputsOfSegment.Match> getOneArbitraryMatch(final Segment pS) { | ||
355 | return rawGetOneArbitraryMatch(new Object[]{pS}); | ||
356 | } | ||
357 | |||
358 | /** | ||
359 | * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match, | ||
360 | * under any possible substitution of the unspecified parameters (if any). | ||
361 | * @param pS the fixed value of pattern parameter S, or null if not bound. | ||
362 | * @return true if the input is a valid (partial) match of the pattern. | ||
363 | * | ||
364 | */ | ||
365 | public boolean hasMatch(final Segment pS) { | ||
366 | return rawHasMatch(new Object[]{pS}); | ||
367 | } | ||
368 | |||
369 | /** | ||
370 | * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. | ||
371 | * @param pS the fixed value of pattern parameter S, or null if not bound. | ||
372 | * @return the number of pattern matches found. | ||
373 | * | ||
374 | */ | ||
375 | public int countMatches(final Segment pS) { | ||
376 | return rawCountMatches(new Object[]{pS}); | ||
377 | } | ||
378 | |||
379 | /** | ||
380 | * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
381 | * Neither determinism nor randomness of selection is guaranteed. | ||
382 | * @param pS the fixed value of pattern parameter S, or null if not bound. | ||
383 | * @param processor the action that will process the selected match. | ||
384 | * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked | ||
385 | * | ||
386 | */ | ||
387 | public boolean forOneArbitraryMatch(final Segment pS, final Consumer<? super TooManyInputsOfSegment.Match> processor) { | ||
388 | return rawForOneArbitraryMatch(new Object[]{pS}, processor); | ||
389 | } | ||
390 | |||
391 | /** | ||
392 | * Returns a new (partial) match. | ||
393 | * This can be used e.g. to call the matcher with a partial match. | ||
394 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
395 | * @param pS the fixed value of pattern parameter S, or null if not bound. | ||
396 | * @return the (partial) match object. | ||
397 | * | ||
398 | */ | ||
399 | public TooManyInputsOfSegment.Match newMatch(final Segment pS) { | ||
400 | return TooManyInputsOfSegment.Match.newMatch(pS); | ||
401 | } | ||
402 | |||
403 | /** | ||
404 | * Retrieve the set of values that occur in matches for S. | ||
405 | * @return the Set of all values or empty set if there are no matches | ||
406 | * | ||
407 | */ | ||
408 | protected Stream<Segment> rawStreamAllValuesOfS(final Object[] parameters) { | ||
409 | return rawStreamAllValues(POSITION_S, parameters).map(Segment.class::cast); | ||
410 | } | ||
411 | |||
412 | /** | ||
413 | * Retrieve the set of values that occur in matches for S. | ||
414 | * @return the Set of all values or empty set if there are no matches | ||
415 | * | ||
416 | */ | ||
417 | public Set<Segment> getAllValuesOfS() { | ||
418 | return rawStreamAllValuesOfS(emptyArray()).collect(Collectors.toSet()); | ||
419 | } | ||
420 | |||
421 | /** | ||
422 | * Retrieve the set of values that occur in matches for S. | ||
423 | * @return the Set of all values or empty set if there are no matches | ||
424 | * | ||
425 | */ | ||
426 | public Stream<Segment> streamAllValuesOfS() { | ||
427 | return rawStreamAllValuesOfS(emptyArray()); | ||
428 | } | ||
429 | |||
430 | @Override | ||
431 | protected TooManyInputsOfSegment.Match tupleToMatch(final Tuple t) { | ||
432 | try { | ||
433 | return TooManyInputsOfSegment.Match.newMatch((Segment) t.get(POSITION_S)); | ||
434 | } catch(ClassCastException e) { | ||
435 | LOGGER.error("Element(s) in tuple not properly typed!",e); | ||
436 | return null; | ||
437 | } | ||
438 | } | ||
439 | |||
440 | @Override | ||
441 | protected TooManyInputsOfSegment.Match arrayToMatch(final Object[] match) { | ||
442 | try { | ||
443 | return TooManyInputsOfSegment.Match.newMatch((Segment) match[POSITION_S]); | ||
444 | } catch(ClassCastException e) { | ||
445 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
446 | return null; | ||
447 | } | ||
448 | } | ||
449 | |||
450 | @Override | ||
451 | protected TooManyInputsOfSegment.Match arrayToMatchMutable(final Object[] match) { | ||
452 | try { | ||
453 | return TooManyInputsOfSegment.Match.newMutableMatch((Segment) match[POSITION_S]); | ||
454 | } catch(ClassCastException e) { | ||
455 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
456 | return null; | ||
457 | } | ||
458 | } | ||
459 | |||
460 | /** | ||
461 | * @return the singleton instance of the query specification of this pattern | ||
462 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
463 | * | ||
464 | */ | ||
465 | public static IQuerySpecification<TooManyInputsOfSegment.Matcher> querySpecification() { | ||
466 | return TooManyInputsOfSegment.instance(); | ||
467 | } | ||
468 | } | ||
469 | |||
470 | private TooManyInputsOfSegment() { | ||
471 | super(GeneratedPQuery.INSTANCE); | ||
472 | } | ||
473 | |||
474 | /** | ||
475 | * @return the singleton instance of the query specification | ||
476 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
477 | * | ||
478 | */ | ||
479 | public static TooManyInputsOfSegment instance() { | ||
480 | try{ | ||
481 | return LazyHolder.INSTANCE; | ||
482 | } catch (ExceptionInInitializerError err) { | ||
483 | throw processInitializerError(err); | ||
484 | } | ||
485 | } | ||
486 | |||
487 | @Override | ||
488 | protected TooManyInputsOfSegment.Matcher instantiate(final ViatraQueryEngine engine) { | ||
489 | return TooManyInputsOfSegment.Matcher.on(engine); | ||
490 | } | ||
491 | |||
492 | @Override | ||
493 | public TooManyInputsOfSegment.Matcher instantiate() { | ||
494 | return TooManyInputsOfSegment.Matcher.create(); | ||
495 | } | ||
496 | |||
497 | @Override | ||
498 | public TooManyInputsOfSegment.Match newEmptyMatch() { | ||
499 | return TooManyInputsOfSegment.Match.newEmptyMatch(); | ||
500 | } | ||
501 | |||
502 | @Override | ||
503 | public TooManyInputsOfSegment.Match newMatch(final Object... parameters) { | ||
504 | return TooManyInputsOfSegment.Match.newMatch((modes3.Segment) parameters[0]); | ||
505 | } | ||
506 | |||
507 | /** | ||
508 | * Inner class allowing the singleton instance of {@link TooManyInputsOfSegment} to be created | ||
509 | * <b>not</b> at the class load time of the outer class, | ||
510 | * but rather at the first call to {@link TooManyInputsOfSegment#instance()}. | ||
511 | * | ||
512 | * <p> This workaround is required e.g. to support recursion. | ||
513 | * | ||
514 | */ | ||
515 | private static class LazyHolder { | ||
516 | private static final TooManyInputsOfSegment INSTANCE = new TooManyInputsOfSegment(); | ||
517 | |||
518 | /** | ||
519 | * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned. | ||
520 | * This initialization order is required to support indirect recursion. | ||
521 | * | ||
522 | * <p> The static initializer is defined using a helper field to work around limitations of the code generator. | ||
523 | * | ||
524 | */ | ||
525 | private static final Object STATIC_INITIALIZER = ensureInitialized(); | ||
526 | |||
527 | public static Object ensureInitialized() { | ||
528 | INSTANCE.ensureInitializedInternal(); | ||
529 | return null; | ||
530 | } | ||
531 | } | ||
532 | |||
533 | private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { | ||
534 | private static final TooManyInputsOfSegment.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
535 | |||
536 | private final PParameter parameter_S = new PParameter("S", "modes3.Segment", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.ece.mcgill.ca/wcet/modes3", "Segment")), PParameterDirection.INOUT); | ||
537 | |||
538 | private final List<PParameter> parameters = Arrays.asList(parameter_S); | ||
539 | |||
540 | private GeneratedPQuery() { | ||
541 | super(PVisibility.PUBLIC); | ||
542 | } | ||
543 | |||
544 | @Override | ||
545 | public String getFullyQualifiedName() { | ||
546 | return "modes3.queries.tooManyInputsOfSegment"; | ||
547 | } | ||
548 | |||
549 | @Override | ||
550 | public List<String> getParameterNames() { | ||
551 | return Arrays.asList("S"); | ||
552 | } | ||
553 | |||
554 | @Override | ||
555 | public List<PParameter> getParameters() { | ||
556 | return parameters; | ||
557 | } | ||
558 | |||
559 | @Override | ||
560 | public Set<PBody> doGetContainedBodies() { | ||
561 | setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); | ||
562 | Set<PBody> bodies = new LinkedHashSet<>(); | ||
563 | { | ||
564 | PBody body = new PBody(this); | ||
565 | PVariable var_S = body.getOrCreateVariableByName("S"); | ||
566 | PVariable var_I1 = body.getOrCreateVariableByName("I1"); | ||
567 | PVariable var_I2 = body.getOrCreateVariableByName("I2"); | ||
568 | PVariable var_I3 = body.getOrCreateVariableByName("I3"); | ||
569 | new TypeConstraint(body, Tuples.flatTupleOf(var_S), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Segment"))); | ||
570 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
571 | new ExportedParameter(body, var_S, parameter_S) | ||
572 | )); | ||
573 | // neg find turnout(S) | ||
574 | new NegativePatternCall(body, Tuples.flatTupleOf(var_S), Turnout.instance().getInternalQueryRepresentation()); | ||
575 | // find output(I1, S) | ||
576 | new PositivePatternCall(body, Tuples.flatTupleOf(var_I1, var_S), Output.instance().getInternalQueryRepresentation()); | ||
577 | // find output(I2, S) | ||
578 | new PositivePatternCall(body, Tuples.flatTupleOf(var_I2, var_S), Output.instance().getInternalQueryRepresentation()); | ||
579 | // find output(I3, S) | ||
580 | new PositivePatternCall(body, Tuples.flatTupleOf(var_I3, var_S), Output.instance().getInternalQueryRepresentation()); | ||
581 | // I1 != I2 | ||
582 | new Inequality(body, var_I1, var_I2); | ||
583 | // I1 != I3 | ||
584 | new Inequality(body, var_I1, var_I3); | ||
585 | // I2 != I3 | ||
586 | new Inequality(body, var_I2, var_I3); | ||
587 | bodies.add(body); | ||
588 | } | ||
589 | { | ||
590 | PAnnotation annotation = new PAnnotation("Constraint"); | ||
591 | annotation.addAttribute("message", "tooManyInputsOfSegment"); | ||
592 | annotation.addAttribute("severity", "error"); | ||
593 | annotation.addAttribute("key", Arrays.asList(new Object[] { | ||
594 | new ParameterReference("S") | ||
595 | })); | ||
596 | addAnnotation(annotation); | ||
597 | } | ||
598 | return bodies; | ||
599 | } | ||
600 | } | ||
601 | } | ||
diff --git a/Domains/ca.mcgill.rtgmrt.example.modes3/vql-gen/modes3/queries/Turnout.java b/Domains/ca.mcgill.rtgmrt.example.modes3/vql-gen/modes3/queries/Turnout.java new file mode 100644 index 00000000..34c7631c --- /dev/null +++ b/Domains/ca.mcgill.rtgmrt.example.modes3/vql-gen/modes3/queries/Turnout.java | |||
@@ -0,0 +1,543 @@ | |||
1 | /** | ||
2 | * Generated from platform:/resource/ca.mcgill.rtgmrt.example.modes3/src/modes3/queries/Modes3Queries.vql | ||
3 | */ | ||
4 | package modes3.queries; | ||
5 | |||
6 | import java.util.Arrays; | ||
7 | import java.util.Collection; | ||
8 | import java.util.LinkedHashSet; | ||
9 | import java.util.List; | ||
10 | import java.util.Objects; | ||
11 | import java.util.Optional; | ||
12 | import java.util.Set; | ||
13 | import java.util.function.Consumer; | ||
14 | import java.util.stream.Collectors; | ||
15 | import java.util.stream.Stream; | ||
16 | import org.apache.log4j.Logger; | ||
17 | import org.eclipse.emf.ecore.EClass; | ||
18 | import org.eclipse.viatra.query.runtime.api.IPatternMatch; | ||
19 | import org.eclipse.viatra.query.runtime.api.IQuerySpecification; | ||
20 | import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; | ||
21 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
22 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; | ||
23 | import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; | ||
24 | import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; | ||
25 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
26 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
27 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
28 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
29 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
30 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
31 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
32 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
33 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
34 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; | ||
35 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | ||
36 | import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; | ||
37 | |||
38 | /** | ||
39 | * A pattern-specific query specification that can instantiate Matcher in a type-safe way. | ||
40 | * | ||
41 | * <p>Original source: | ||
42 | * <code><pre> | ||
43 | * pattern turnout(T : Turnout) { | ||
44 | * Turnout(T); | ||
45 | * } | ||
46 | * </pre></code> | ||
47 | * | ||
48 | * @see Matcher | ||
49 | * @see Match | ||
50 | * | ||
51 | */ | ||
52 | @SuppressWarnings("all") | ||
53 | public final class Turnout extends BaseGeneratedEMFQuerySpecification<Turnout.Matcher> { | ||
54 | /** | ||
55 | * Pattern-specific match representation of the modes3.queries.turnout pattern, | ||
56 | * to be used in conjunction with {@link Matcher}. | ||
57 | * | ||
58 | * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned. | ||
59 | * Each instance is a (possibly partial) substitution of pattern parameters, | ||
60 | * usable to represent a match of the pattern in the result of a query, | ||
61 | * or to specify the bound (fixed) input parameters when issuing a query. | ||
62 | * | ||
63 | * @see Matcher | ||
64 | * | ||
65 | */ | ||
66 | public static abstract class Match extends BasePatternMatch { | ||
67 | private modes3.Turnout fT; | ||
68 | |||
69 | private static List<String> parameterNames = makeImmutableList("T"); | ||
70 | |||
71 | private Match(final modes3.Turnout pT) { | ||
72 | this.fT = pT; | ||
73 | } | ||
74 | |||
75 | @Override | ||
76 | public Object get(final String parameterName) { | ||
77 | switch(parameterName) { | ||
78 | case "T": return this.fT; | ||
79 | default: return null; | ||
80 | } | ||
81 | } | ||
82 | |||
83 | @Override | ||
84 | public Object get(final int index) { | ||
85 | switch(index) { | ||
86 | case 0: return this.fT; | ||
87 | default: return null; | ||
88 | } | ||
89 | } | ||
90 | |||
91 | public modes3.Turnout getT() { | ||
92 | return this.fT; | ||
93 | } | ||
94 | |||
95 | @Override | ||
96 | public boolean set(final String parameterName, final Object newValue) { | ||
97 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
98 | if ("T".equals(parameterName) ) { | ||
99 | this.fT = (modes3.Turnout) newValue; | ||
100 | return true; | ||
101 | } | ||
102 | return false; | ||
103 | } | ||
104 | |||
105 | public void setT(final modes3.Turnout pT) { | ||
106 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
107 | this.fT = pT; | ||
108 | } | ||
109 | |||
110 | @Override | ||
111 | public String patternName() { | ||
112 | return "modes3.queries.turnout"; | ||
113 | } | ||
114 | |||
115 | @Override | ||
116 | public List<String> parameterNames() { | ||
117 | return Turnout.Match.parameterNames; | ||
118 | } | ||
119 | |||
120 | @Override | ||
121 | public Object[] toArray() { | ||
122 | return new Object[]{fT}; | ||
123 | } | ||
124 | |||
125 | @Override | ||
126 | public Turnout.Match toImmutable() { | ||
127 | return isMutable() ? newMatch(fT) : this; | ||
128 | } | ||
129 | |||
130 | @Override | ||
131 | public String prettyPrint() { | ||
132 | StringBuilder result = new StringBuilder(); | ||
133 | result.append("\"T\"=" + prettyPrintValue(fT)); | ||
134 | return result.toString(); | ||
135 | } | ||
136 | |||
137 | @Override | ||
138 | public int hashCode() { | ||
139 | return Objects.hash(fT); | ||
140 | } | ||
141 | |||
142 | @Override | ||
143 | public boolean equals(final Object obj) { | ||
144 | if (this == obj) | ||
145 | return true; | ||
146 | if (obj == null) { | ||
147 | return false; | ||
148 | } | ||
149 | if ((obj instanceof Turnout.Match)) { | ||
150 | Turnout.Match other = (Turnout.Match) obj; | ||
151 | return Objects.equals(fT, other.fT); | ||
152 | } else { | ||
153 | // this should be infrequent | ||
154 | if (!(obj instanceof IPatternMatch)) { | ||
155 | return false; | ||
156 | } | ||
157 | IPatternMatch otherSig = (IPatternMatch) obj; | ||
158 | return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray()); | ||
159 | } | ||
160 | } | ||
161 | |||
162 | @Override | ||
163 | public Turnout specification() { | ||
164 | return Turnout.instance(); | ||
165 | } | ||
166 | |||
167 | /** | ||
168 | * Returns an empty, mutable match. | ||
169 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
170 | * | ||
171 | * @return the empty match. | ||
172 | * | ||
173 | */ | ||
174 | public static Turnout.Match newEmptyMatch() { | ||
175 | return new Mutable(null); | ||
176 | } | ||
177 | |||
178 | /** | ||
179 | * Returns a mutable (partial) match. | ||
180 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
181 | * | ||
182 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
183 | * @return the new, mutable (partial) match object. | ||
184 | * | ||
185 | */ | ||
186 | public static Turnout.Match newMutableMatch(final modes3.Turnout pT) { | ||
187 | return new Mutable(pT); | ||
188 | } | ||
189 | |||
190 | /** | ||
191 | * Returns a new (partial) match. | ||
192 | * This can be used e.g. to call the matcher with a partial match. | ||
193 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
194 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
195 | * @return the (partial) match object. | ||
196 | * | ||
197 | */ | ||
198 | public static Turnout.Match newMatch(final modes3.Turnout pT) { | ||
199 | return new Immutable(pT); | ||
200 | } | ||
201 | |||
202 | private static final class Mutable extends Turnout.Match { | ||
203 | Mutable(final modes3.Turnout pT) { | ||
204 | super(pT); | ||
205 | } | ||
206 | |||
207 | @Override | ||
208 | public boolean isMutable() { | ||
209 | return true; | ||
210 | } | ||
211 | } | ||
212 | |||
213 | private static final class Immutable extends Turnout.Match { | ||
214 | Immutable(final modes3.Turnout pT) { | ||
215 | super(pT); | ||
216 | } | ||
217 | |||
218 | @Override | ||
219 | public boolean isMutable() { | ||
220 | return false; | ||
221 | } | ||
222 | } | ||
223 | } | ||
224 | |||
225 | /** | ||
226 | * Generated pattern matcher API of the modes3.queries.turnout pattern, | ||
227 | * providing pattern-specific query methods. | ||
228 | * | ||
229 | * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)}, | ||
230 | * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}. | ||
231 | * | ||
232 | * <p>Matches of the pattern will be represented as {@link Match}. | ||
233 | * | ||
234 | * <p>Original source: | ||
235 | * <code><pre> | ||
236 | * pattern turnout(T : Turnout) { | ||
237 | * Turnout(T); | ||
238 | * } | ||
239 | * </pre></code> | ||
240 | * | ||
241 | * @see Match | ||
242 | * @see Turnout | ||
243 | * | ||
244 | */ | ||
245 | public static class Matcher extends BaseMatcher<Turnout.Match> { | ||
246 | /** | ||
247 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
248 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
249 | * | ||
250 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
251 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
252 | * | ||
253 | */ | ||
254 | public static Turnout.Matcher on(final ViatraQueryEngine engine) { | ||
255 | // check if matcher already exists | ||
256 | Matcher matcher = engine.getExistingMatcher(querySpecification()); | ||
257 | if (matcher == null) { | ||
258 | matcher = (Matcher)engine.getMatcher(querySpecification()); | ||
259 | } | ||
260 | return matcher; | ||
261 | } | ||
262 | |||
263 | /** | ||
264 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
265 | * @return an initialized matcher | ||
266 | * @noreference This method is for internal matcher initialization by the framework, do not call it manually. | ||
267 | * | ||
268 | */ | ||
269 | public static Turnout.Matcher create() { | ||
270 | return new Matcher(); | ||
271 | } | ||
272 | |||
273 | private static final int POSITION_T = 0; | ||
274 | |||
275 | private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(Turnout.Matcher.class); | ||
276 | |||
277 | /** | ||
278 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
279 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
280 | * | ||
281 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
282 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
283 | * | ||
284 | */ | ||
285 | private Matcher() { | ||
286 | super(querySpecification()); | ||
287 | } | ||
288 | |||
289 | /** | ||
290 | * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters. | ||
291 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
292 | * @return matches represented as a Match object. | ||
293 | * | ||
294 | */ | ||
295 | public Collection<Turnout.Match> getAllMatches(final modes3.Turnout pT) { | ||
296 | return rawStreamAllMatches(new Object[]{pT}).collect(Collectors.toSet()); | ||
297 | } | ||
298 | |||
299 | /** | ||
300 | * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters. | ||
301 | * </p> | ||
302 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
303 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
304 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
305 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
306 | * @return a stream of matches represented as a Match object. | ||
307 | * | ||
308 | */ | ||
309 | public Stream<Turnout.Match> streamAllMatches(final modes3.Turnout pT) { | ||
310 | return rawStreamAllMatches(new Object[]{pT}); | ||
311 | } | ||
312 | |||
313 | /** | ||
314 | * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
315 | * Neither determinism nor randomness of selection is guaranteed. | ||
316 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
317 | * @return a match represented as a Match object, or null if no match is found. | ||
318 | * | ||
319 | */ | ||
320 | public Optional<Turnout.Match> getOneArbitraryMatch(final modes3.Turnout pT) { | ||
321 | return rawGetOneArbitraryMatch(new Object[]{pT}); | ||
322 | } | ||
323 | |||
324 | /** | ||
325 | * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match, | ||
326 | * under any possible substitution of the unspecified parameters (if any). | ||
327 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
328 | * @return true if the input is a valid (partial) match of the pattern. | ||
329 | * | ||
330 | */ | ||
331 | public boolean hasMatch(final modes3.Turnout pT) { | ||
332 | return rawHasMatch(new Object[]{pT}); | ||
333 | } | ||
334 | |||
335 | /** | ||
336 | * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. | ||
337 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
338 | * @return the number of pattern matches found. | ||
339 | * | ||
340 | */ | ||
341 | public int countMatches(final modes3.Turnout pT) { | ||
342 | return rawCountMatches(new Object[]{pT}); | ||
343 | } | ||
344 | |||
345 | /** | ||
346 | * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
347 | * Neither determinism nor randomness of selection is guaranteed. | ||
348 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
349 | * @param processor the action that will process the selected match. | ||
350 | * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked | ||
351 | * | ||
352 | */ | ||
353 | public boolean forOneArbitraryMatch(final modes3.Turnout pT, final Consumer<? super Turnout.Match> processor) { | ||
354 | return rawForOneArbitraryMatch(new Object[]{pT}, processor); | ||
355 | } | ||
356 | |||
357 | /** | ||
358 | * Returns a new (partial) match. | ||
359 | * This can be used e.g. to call the matcher with a partial match. | ||
360 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
361 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
362 | * @return the (partial) match object. | ||
363 | * | ||
364 | */ | ||
365 | public Turnout.Match newMatch(final modes3.Turnout pT) { | ||
366 | return Turnout.Match.newMatch(pT); | ||
367 | } | ||
368 | |||
369 | /** | ||
370 | * Retrieve the set of values that occur in matches for T. | ||
371 | * @return the Set of all values or empty set if there are no matches | ||
372 | * | ||
373 | */ | ||
374 | protected Stream<modes3.Turnout> rawStreamAllValuesOfT(final Object[] parameters) { | ||
375 | return rawStreamAllValues(POSITION_T, parameters).map(modes3.Turnout.class::cast); | ||
376 | } | ||
377 | |||
378 | /** | ||
379 | * Retrieve the set of values that occur in matches for T. | ||
380 | * @return the Set of all values or empty set if there are no matches | ||
381 | * | ||
382 | */ | ||
383 | public Set<modes3.Turnout> getAllValuesOfT() { | ||
384 | return rawStreamAllValuesOfT(emptyArray()).collect(Collectors.toSet()); | ||
385 | } | ||
386 | |||
387 | /** | ||
388 | * Retrieve the set of values that occur in matches for T. | ||
389 | * @return the Set of all values or empty set if there are no matches | ||
390 | * | ||
391 | */ | ||
392 | public Stream<modes3.Turnout> streamAllValuesOfT() { | ||
393 | return rawStreamAllValuesOfT(emptyArray()); | ||
394 | } | ||
395 | |||
396 | @Override | ||
397 | protected Turnout.Match tupleToMatch(final Tuple t) { | ||
398 | try { | ||
399 | return Turnout.Match.newMatch((modes3.Turnout) t.get(POSITION_T)); | ||
400 | } catch(ClassCastException e) { | ||
401 | LOGGER.error("Element(s) in tuple not properly typed!",e); | ||
402 | return null; | ||
403 | } | ||
404 | } | ||
405 | |||
406 | @Override | ||
407 | protected Turnout.Match arrayToMatch(final Object[] match) { | ||
408 | try { | ||
409 | return Turnout.Match.newMatch((modes3.Turnout) match[POSITION_T]); | ||
410 | } catch(ClassCastException e) { | ||
411 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
412 | return null; | ||
413 | } | ||
414 | } | ||
415 | |||
416 | @Override | ||
417 | protected Turnout.Match arrayToMatchMutable(final Object[] match) { | ||
418 | try { | ||
419 | return Turnout.Match.newMutableMatch((modes3.Turnout) match[POSITION_T]); | ||
420 | } catch(ClassCastException e) { | ||
421 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
422 | return null; | ||
423 | } | ||
424 | } | ||
425 | |||
426 | /** | ||
427 | * @return the singleton instance of the query specification of this pattern | ||
428 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
429 | * | ||
430 | */ | ||
431 | public static IQuerySpecification<Turnout.Matcher> querySpecification() { | ||
432 | return Turnout.instance(); | ||
433 | } | ||
434 | } | ||
435 | |||
436 | private Turnout() { | ||
437 | super(GeneratedPQuery.INSTANCE); | ||
438 | } | ||
439 | |||
440 | /** | ||
441 | * @return the singleton instance of the query specification | ||
442 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
443 | * | ||
444 | */ | ||
445 | public static Turnout instance() { | ||
446 | try{ | ||
447 | return LazyHolder.INSTANCE; | ||
448 | } catch (ExceptionInInitializerError err) { | ||
449 | throw processInitializerError(err); | ||
450 | } | ||
451 | } | ||
452 | |||
453 | @Override | ||
454 | protected Turnout.Matcher instantiate(final ViatraQueryEngine engine) { | ||
455 | return Turnout.Matcher.on(engine); | ||
456 | } | ||
457 | |||
458 | @Override | ||
459 | public Turnout.Matcher instantiate() { | ||
460 | return Turnout.Matcher.create(); | ||
461 | } | ||
462 | |||
463 | @Override | ||
464 | public Turnout.Match newEmptyMatch() { | ||
465 | return Turnout.Match.newEmptyMatch(); | ||
466 | } | ||
467 | |||
468 | @Override | ||
469 | public Turnout.Match newMatch(final Object... parameters) { | ||
470 | return Turnout.Match.newMatch((modes3.Turnout) parameters[0]); | ||
471 | } | ||
472 | |||
473 | /** | ||
474 | * Inner class allowing the singleton instance of {@link Turnout} to be created | ||
475 | * <b>not</b> at the class load time of the outer class, | ||
476 | * but rather at the first call to {@link Turnout#instance()}. | ||
477 | * | ||
478 | * <p> This workaround is required e.g. to support recursion. | ||
479 | * | ||
480 | */ | ||
481 | private static class LazyHolder { | ||
482 | private static final Turnout INSTANCE = new Turnout(); | ||
483 | |||
484 | /** | ||
485 | * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned. | ||
486 | * This initialization order is required to support indirect recursion. | ||
487 | * | ||
488 | * <p> The static initializer is defined using a helper field to work around limitations of the code generator. | ||
489 | * | ||
490 | */ | ||
491 | private static final Object STATIC_INITIALIZER = ensureInitialized(); | ||
492 | |||
493 | public static Object ensureInitialized() { | ||
494 | INSTANCE.ensureInitializedInternal(); | ||
495 | return null; | ||
496 | } | ||
497 | } | ||
498 | |||
499 | private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { | ||
500 | private static final Turnout.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
501 | |||
502 | private final PParameter parameter_T = new PParameter("T", "modes3.Turnout", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.ece.mcgill.ca/wcet/modes3", "Turnout")), PParameterDirection.INOUT); | ||
503 | |||
504 | private final List<PParameter> parameters = Arrays.asList(parameter_T); | ||
505 | |||
506 | private GeneratedPQuery() { | ||
507 | super(PVisibility.PUBLIC); | ||
508 | } | ||
509 | |||
510 | @Override | ||
511 | public String getFullyQualifiedName() { | ||
512 | return "modes3.queries.turnout"; | ||
513 | } | ||
514 | |||
515 | @Override | ||
516 | public List<String> getParameterNames() { | ||
517 | return Arrays.asList("T"); | ||
518 | } | ||
519 | |||
520 | @Override | ||
521 | public List<PParameter> getParameters() { | ||
522 | return parameters; | ||
523 | } | ||
524 | |||
525 | @Override | ||
526 | public Set<PBody> doGetContainedBodies() { | ||
527 | setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); | ||
528 | Set<PBody> bodies = new LinkedHashSet<>(); | ||
529 | { | ||
530 | PBody body = new PBody(this); | ||
531 | PVariable var_T = body.getOrCreateVariableByName("T"); | ||
532 | new TypeConstraint(body, Tuples.flatTupleOf(var_T), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Turnout"))); | ||
533 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
534 | new ExportedParameter(body, var_T, parameter_T) | ||
535 | )); | ||
536 | // Turnout(T) | ||
537 | new TypeConstraint(body, Tuples.flatTupleOf(var_T), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Turnout"))); | ||
538 | bodies.add(body); | ||
539 | } | ||
540 | return bodies; | ||
541 | } | ||
542 | } | ||
543 | } | ||
diff --git a/Domains/ca.mcgill.rtgmrt.example.modes3/vql-gen/modes3/queries/TurnoutConnectedToBothOutputs.java b/Domains/ca.mcgill.rtgmrt.example.modes3/vql-gen/modes3/queries/TurnoutConnectedToBothOutputs.java new file mode 100644 index 00000000..674bb275 --- /dev/null +++ b/Domains/ca.mcgill.rtgmrt.example.modes3/vql-gen/modes3/queries/TurnoutConnectedToBothOutputs.java | |||
@@ -0,0 +1,589 @@ | |||
1 | /** | ||
2 | * Generated from platform:/resource/ca.mcgill.rtgmrt.example.modes3/src/modes3/queries/Modes3Queries.vql | ||
3 | */ | ||
4 | package modes3.queries; | ||
5 | |||
6 | import java.util.Arrays; | ||
7 | import java.util.Collection; | ||
8 | import java.util.LinkedHashSet; | ||
9 | import java.util.List; | ||
10 | import java.util.Objects; | ||
11 | import java.util.Optional; | ||
12 | import java.util.Set; | ||
13 | import java.util.function.Consumer; | ||
14 | import java.util.stream.Collectors; | ||
15 | import java.util.stream.Stream; | ||
16 | import modes3.Turnout; | ||
17 | import org.apache.log4j.Logger; | ||
18 | import org.eclipse.emf.ecore.EClass; | ||
19 | import org.eclipse.viatra.query.runtime.api.IPatternMatch; | ||
20 | import org.eclipse.viatra.query.runtime.api.IQuerySpecification; | ||
21 | import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; | ||
22 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
23 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; | ||
24 | import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; | ||
25 | import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; | ||
26 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
27 | import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey; | ||
28 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
29 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
30 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
31 | import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.PAnnotation; | ||
32 | import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.ParameterReference; | ||
33 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; | ||
34 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
35 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
36 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
37 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
38 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
39 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; | ||
40 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | ||
41 | import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; | ||
42 | |||
43 | /** | ||
44 | * A pattern-specific query specification that can instantiate Matcher in a type-safe way. | ||
45 | * | ||
46 | * <p>Original source: | ||
47 | * <code><pre> | ||
48 | * {@literal @}Constraint(message = "turnoutConnectedToBothOutputs", severity = "error", key = { T }) | ||
49 | * pattern turnoutConnectedToBothOutputs(T : Turnout) { | ||
50 | * Turnout.straight(T, Straight); | ||
51 | * Turnout.divergent(T, Divergent); | ||
52 | * Segment.connectedTo(T, Straight); | ||
53 | * Segment.connectedTo(T, Divergent); | ||
54 | * } | ||
55 | * </pre></code> | ||
56 | * | ||
57 | * @see Matcher | ||
58 | * @see Match | ||
59 | * | ||
60 | */ | ||
61 | @SuppressWarnings("all") | ||
62 | public final class TurnoutConnectedToBothOutputs extends BaseGeneratedEMFQuerySpecification<TurnoutConnectedToBothOutputs.Matcher> { | ||
63 | /** | ||
64 | * Pattern-specific match representation of the modes3.queries.turnoutConnectedToBothOutputs pattern, | ||
65 | * to be used in conjunction with {@link Matcher}. | ||
66 | * | ||
67 | * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned. | ||
68 | * Each instance is a (possibly partial) substitution of pattern parameters, | ||
69 | * usable to represent a match of the pattern in the result of a query, | ||
70 | * or to specify the bound (fixed) input parameters when issuing a query. | ||
71 | * | ||
72 | * @see Matcher | ||
73 | * | ||
74 | */ | ||
75 | public static abstract class Match extends BasePatternMatch { | ||
76 | private Turnout fT; | ||
77 | |||
78 | private static List<String> parameterNames = makeImmutableList("T"); | ||
79 | |||
80 | private Match(final Turnout pT) { | ||
81 | this.fT = pT; | ||
82 | } | ||
83 | |||
84 | @Override | ||
85 | public Object get(final String parameterName) { | ||
86 | switch(parameterName) { | ||
87 | case "T": return this.fT; | ||
88 | default: return null; | ||
89 | } | ||
90 | } | ||
91 | |||
92 | @Override | ||
93 | public Object get(final int index) { | ||
94 | switch(index) { | ||
95 | case 0: return this.fT; | ||
96 | default: return null; | ||
97 | } | ||
98 | } | ||
99 | |||
100 | public Turnout getT() { | ||
101 | return this.fT; | ||
102 | } | ||
103 | |||
104 | @Override | ||
105 | public boolean set(final String parameterName, final Object newValue) { | ||
106 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
107 | if ("T".equals(parameterName) ) { | ||
108 | this.fT = (Turnout) newValue; | ||
109 | return true; | ||
110 | } | ||
111 | return false; | ||
112 | } | ||
113 | |||
114 | public void setT(final Turnout pT) { | ||
115 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
116 | this.fT = pT; | ||
117 | } | ||
118 | |||
119 | @Override | ||
120 | public String patternName() { | ||
121 | return "modes3.queries.turnoutConnectedToBothOutputs"; | ||
122 | } | ||
123 | |||
124 | @Override | ||
125 | public List<String> parameterNames() { | ||
126 | return TurnoutConnectedToBothOutputs.Match.parameterNames; | ||
127 | } | ||
128 | |||
129 | @Override | ||
130 | public Object[] toArray() { | ||
131 | return new Object[]{fT}; | ||
132 | } | ||
133 | |||
134 | @Override | ||
135 | public TurnoutConnectedToBothOutputs.Match toImmutable() { | ||
136 | return isMutable() ? newMatch(fT) : this; | ||
137 | } | ||
138 | |||
139 | @Override | ||
140 | public String prettyPrint() { | ||
141 | StringBuilder result = new StringBuilder(); | ||
142 | result.append("\"T\"=" + prettyPrintValue(fT)); | ||
143 | return result.toString(); | ||
144 | } | ||
145 | |||
146 | @Override | ||
147 | public int hashCode() { | ||
148 | return Objects.hash(fT); | ||
149 | } | ||
150 | |||
151 | @Override | ||
152 | public boolean equals(final Object obj) { | ||
153 | if (this == obj) | ||
154 | return true; | ||
155 | if (obj == null) { | ||
156 | return false; | ||
157 | } | ||
158 | if ((obj instanceof TurnoutConnectedToBothOutputs.Match)) { | ||
159 | TurnoutConnectedToBothOutputs.Match other = (TurnoutConnectedToBothOutputs.Match) obj; | ||
160 | return Objects.equals(fT, other.fT); | ||
161 | } else { | ||
162 | // this should be infrequent | ||
163 | if (!(obj instanceof IPatternMatch)) { | ||
164 | return false; | ||
165 | } | ||
166 | IPatternMatch otherSig = (IPatternMatch) obj; | ||
167 | return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray()); | ||
168 | } | ||
169 | } | ||
170 | |||
171 | @Override | ||
172 | public TurnoutConnectedToBothOutputs specification() { | ||
173 | return TurnoutConnectedToBothOutputs.instance(); | ||
174 | } | ||
175 | |||
176 | /** | ||
177 | * Returns an empty, mutable match. | ||
178 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
179 | * | ||
180 | * @return the empty match. | ||
181 | * | ||
182 | */ | ||
183 | public static TurnoutConnectedToBothOutputs.Match newEmptyMatch() { | ||
184 | return new Mutable(null); | ||
185 | } | ||
186 | |||
187 | /** | ||
188 | * Returns a mutable (partial) match. | ||
189 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
190 | * | ||
191 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
192 | * @return the new, mutable (partial) match object. | ||
193 | * | ||
194 | */ | ||
195 | public static TurnoutConnectedToBothOutputs.Match newMutableMatch(final Turnout pT) { | ||
196 | return new Mutable(pT); | ||
197 | } | ||
198 | |||
199 | /** | ||
200 | * Returns a new (partial) match. | ||
201 | * This can be used e.g. to call the matcher with a partial match. | ||
202 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
203 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
204 | * @return the (partial) match object. | ||
205 | * | ||
206 | */ | ||
207 | public static TurnoutConnectedToBothOutputs.Match newMatch(final Turnout pT) { | ||
208 | return new Immutable(pT); | ||
209 | } | ||
210 | |||
211 | private static final class Mutable extends TurnoutConnectedToBothOutputs.Match { | ||
212 | Mutable(final Turnout pT) { | ||
213 | super(pT); | ||
214 | } | ||
215 | |||
216 | @Override | ||
217 | public boolean isMutable() { | ||
218 | return true; | ||
219 | } | ||
220 | } | ||
221 | |||
222 | private static final class Immutable extends TurnoutConnectedToBothOutputs.Match { | ||
223 | Immutable(final Turnout pT) { | ||
224 | super(pT); | ||
225 | } | ||
226 | |||
227 | @Override | ||
228 | public boolean isMutable() { | ||
229 | return false; | ||
230 | } | ||
231 | } | ||
232 | } | ||
233 | |||
234 | /** | ||
235 | * Generated pattern matcher API of the modes3.queries.turnoutConnectedToBothOutputs pattern, | ||
236 | * providing pattern-specific query methods. | ||
237 | * | ||
238 | * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)}, | ||
239 | * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}. | ||
240 | * | ||
241 | * <p>Matches of the pattern will be represented as {@link Match}. | ||
242 | * | ||
243 | * <p>Original source: | ||
244 | * <code><pre> | ||
245 | * {@literal @}Constraint(message = "turnoutConnectedToBothOutputs", severity = "error", key = { T }) | ||
246 | * pattern turnoutConnectedToBothOutputs(T : Turnout) { | ||
247 | * Turnout.straight(T, Straight); | ||
248 | * Turnout.divergent(T, Divergent); | ||
249 | * Segment.connectedTo(T, Straight); | ||
250 | * Segment.connectedTo(T, Divergent); | ||
251 | * } | ||
252 | * </pre></code> | ||
253 | * | ||
254 | * @see Match | ||
255 | * @see TurnoutConnectedToBothOutputs | ||
256 | * | ||
257 | */ | ||
258 | public static class Matcher extends BaseMatcher<TurnoutConnectedToBothOutputs.Match> { | ||
259 | /** | ||
260 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
261 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
262 | * | ||
263 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
264 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
265 | * | ||
266 | */ | ||
267 | public static TurnoutConnectedToBothOutputs.Matcher on(final ViatraQueryEngine engine) { | ||
268 | // check if matcher already exists | ||
269 | Matcher matcher = engine.getExistingMatcher(querySpecification()); | ||
270 | if (matcher == null) { | ||
271 | matcher = (Matcher)engine.getMatcher(querySpecification()); | ||
272 | } | ||
273 | return matcher; | ||
274 | } | ||
275 | |||
276 | /** | ||
277 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
278 | * @return an initialized matcher | ||
279 | * @noreference This method is for internal matcher initialization by the framework, do not call it manually. | ||
280 | * | ||
281 | */ | ||
282 | public static TurnoutConnectedToBothOutputs.Matcher create() { | ||
283 | return new Matcher(); | ||
284 | } | ||
285 | |||
286 | private static final int POSITION_T = 0; | ||
287 | |||
288 | private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(TurnoutConnectedToBothOutputs.Matcher.class); | ||
289 | |||
290 | /** | ||
291 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
292 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
293 | * | ||
294 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
295 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
296 | * | ||
297 | */ | ||
298 | private Matcher() { | ||
299 | super(querySpecification()); | ||
300 | } | ||
301 | |||
302 | /** | ||
303 | * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters. | ||
304 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
305 | * @return matches represented as a Match object. | ||
306 | * | ||
307 | */ | ||
308 | public Collection<TurnoutConnectedToBothOutputs.Match> getAllMatches(final Turnout pT) { | ||
309 | return rawStreamAllMatches(new Object[]{pT}).collect(Collectors.toSet()); | ||
310 | } | ||
311 | |||
312 | /** | ||
313 | * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters. | ||
314 | * </p> | ||
315 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
316 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
317 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
318 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
319 | * @return a stream of matches represented as a Match object. | ||
320 | * | ||
321 | */ | ||
322 | public Stream<TurnoutConnectedToBothOutputs.Match> streamAllMatches(final Turnout pT) { | ||
323 | return rawStreamAllMatches(new Object[]{pT}); | ||
324 | } | ||
325 | |||
326 | /** | ||
327 | * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
328 | * Neither determinism nor randomness of selection is guaranteed. | ||
329 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
330 | * @return a match represented as a Match object, or null if no match is found. | ||
331 | * | ||
332 | */ | ||
333 | public Optional<TurnoutConnectedToBothOutputs.Match> getOneArbitraryMatch(final Turnout pT) { | ||
334 | return rawGetOneArbitraryMatch(new Object[]{pT}); | ||
335 | } | ||
336 | |||
337 | /** | ||
338 | * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match, | ||
339 | * under any possible substitution of the unspecified parameters (if any). | ||
340 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
341 | * @return true if the input is a valid (partial) match of the pattern. | ||
342 | * | ||
343 | */ | ||
344 | public boolean hasMatch(final Turnout pT) { | ||
345 | return rawHasMatch(new Object[]{pT}); | ||
346 | } | ||
347 | |||
348 | /** | ||
349 | * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. | ||
350 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
351 | * @return the number of pattern matches found. | ||
352 | * | ||
353 | */ | ||
354 | public int countMatches(final Turnout pT) { | ||
355 | return rawCountMatches(new Object[]{pT}); | ||
356 | } | ||
357 | |||
358 | /** | ||
359 | * Executes the given processor on 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 pT the fixed value of pattern parameter T, or null if not bound. | ||
362 | * @param processor the action that will process the selected match. | ||
363 | * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked | ||
364 | * | ||
365 | */ | ||
366 | public boolean forOneArbitraryMatch(final Turnout pT, final Consumer<? super TurnoutConnectedToBothOutputs.Match> processor) { | ||
367 | return rawForOneArbitraryMatch(new Object[]{pT}, processor); | ||
368 | } | ||
369 | |||
370 | /** | ||
371 | * Returns a new (partial) match. | ||
372 | * This can be used e.g. to call the matcher with a partial match. | ||
373 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
374 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
375 | * @return the (partial) match object. | ||
376 | * | ||
377 | */ | ||
378 | public TurnoutConnectedToBothOutputs.Match newMatch(final Turnout pT) { | ||
379 | return TurnoutConnectedToBothOutputs.Match.newMatch(pT); | ||
380 | } | ||
381 | |||
382 | /** | ||
383 | * Retrieve the set of values that occur in matches for T. | ||
384 | * @return the Set of all values or empty set if there are no matches | ||
385 | * | ||
386 | */ | ||
387 | protected Stream<Turnout> rawStreamAllValuesOfT(final Object[] parameters) { | ||
388 | return rawStreamAllValues(POSITION_T, parameters).map(Turnout.class::cast); | ||
389 | } | ||
390 | |||
391 | /** | ||
392 | * Retrieve the set of values that occur in matches for T. | ||
393 | * @return the Set of all values or empty set if there are no matches | ||
394 | * | ||
395 | */ | ||
396 | public Set<Turnout> getAllValuesOfT() { | ||
397 | return rawStreamAllValuesOfT(emptyArray()).collect(Collectors.toSet()); | ||
398 | } | ||
399 | |||
400 | /** | ||
401 | * Retrieve the set of values that occur in matches for T. | ||
402 | * @return the Set of all values or empty set if there are no matches | ||
403 | * | ||
404 | */ | ||
405 | public Stream<Turnout> streamAllValuesOfT() { | ||
406 | return rawStreamAllValuesOfT(emptyArray()); | ||
407 | } | ||
408 | |||
409 | @Override | ||
410 | protected TurnoutConnectedToBothOutputs.Match tupleToMatch(final Tuple t) { | ||
411 | try { | ||
412 | return TurnoutConnectedToBothOutputs.Match.newMatch((Turnout) t.get(POSITION_T)); | ||
413 | } catch(ClassCastException e) { | ||
414 | LOGGER.error("Element(s) in tuple not properly typed!",e); | ||
415 | return null; | ||
416 | } | ||
417 | } | ||
418 | |||
419 | @Override | ||
420 | protected TurnoutConnectedToBothOutputs.Match arrayToMatch(final Object[] match) { | ||
421 | try { | ||
422 | return TurnoutConnectedToBothOutputs.Match.newMatch((Turnout) match[POSITION_T]); | ||
423 | } catch(ClassCastException e) { | ||
424 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
425 | return null; | ||
426 | } | ||
427 | } | ||
428 | |||
429 | @Override | ||
430 | protected TurnoutConnectedToBothOutputs.Match arrayToMatchMutable(final Object[] match) { | ||
431 | try { | ||
432 | return TurnoutConnectedToBothOutputs.Match.newMutableMatch((Turnout) match[POSITION_T]); | ||
433 | } catch(ClassCastException e) { | ||
434 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
435 | return null; | ||
436 | } | ||
437 | } | ||
438 | |||
439 | /** | ||
440 | * @return the singleton instance of the query specification of this pattern | ||
441 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
442 | * | ||
443 | */ | ||
444 | public static IQuerySpecification<TurnoutConnectedToBothOutputs.Matcher> querySpecification() { | ||
445 | return TurnoutConnectedToBothOutputs.instance(); | ||
446 | } | ||
447 | } | ||
448 | |||
449 | private TurnoutConnectedToBothOutputs() { | ||
450 | super(GeneratedPQuery.INSTANCE); | ||
451 | } | ||
452 | |||
453 | /** | ||
454 | * @return the singleton instance of the query specification | ||
455 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
456 | * | ||
457 | */ | ||
458 | public static TurnoutConnectedToBothOutputs instance() { | ||
459 | try{ | ||
460 | return LazyHolder.INSTANCE; | ||
461 | } catch (ExceptionInInitializerError err) { | ||
462 | throw processInitializerError(err); | ||
463 | } | ||
464 | } | ||
465 | |||
466 | @Override | ||
467 | protected TurnoutConnectedToBothOutputs.Matcher instantiate(final ViatraQueryEngine engine) { | ||
468 | return TurnoutConnectedToBothOutputs.Matcher.on(engine); | ||
469 | } | ||
470 | |||
471 | @Override | ||
472 | public TurnoutConnectedToBothOutputs.Matcher instantiate() { | ||
473 | return TurnoutConnectedToBothOutputs.Matcher.create(); | ||
474 | } | ||
475 | |||
476 | @Override | ||
477 | public TurnoutConnectedToBothOutputs.Match newEmptyMatch() { | ||
478 | return TurnoutConnectedToBothOutputs.Match.newEmptyMatch(); | ||
479 | } | ||
480 | |||
481 | @Override | ||
482 | public TurnoutConnectedToBothOutputs.Match newMatch(final Object... parameters) { | ||
483 | return TurnoutConnectedToBothOutputs.Match.newMatch((modes3.Turnout) parameters[0]); | ||
484 | } | ||
485 | |||
486 | /** | ||
487 | * Inner class allowing the singleton instance of {@link TurnoutConnectedToBothOutputs} to be created | ||
488 | * <b>not</b> at the class load time of the outer class, | ||
489 | * but rather at the first call to {@link TurnoutConnectedToBothOutputs#instance()}. | ||
490 | * | ||
491 | * <p> This workaround is required e.g. to support recursion. | ||
492 | * | ||
493 | */ | ||
494 | private static class LazyHolder { | ||
495 | private static final TurnoutConnectedToBothOutputs INSTANCE = new TurnoutConnectedToBothOutputs(); | ||
496 | |||
497 | /** | ||
498 | * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned. | ||
499 | * This initialization order is required to support indirect recursion. | ||
500 | * | ||
501 | * <p> The static initializer is defined using a helper field to work around limitations of the code generator. | ||
502 | * | ||
503 | */ | ||
504 | private static final Object STATIC_INITIALIZER = ensureInitialized(); | ||
505 | |||
506 | public static Object ensureInitialized() { | ||
507 | INSTANCE.ensureInitializedInternal(); | ||
508 | return null; | ||
509 | } | ||
510 | } | ||
511 | |||
512 | private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { | ||
513 | private static final TurnoutConnectedToBothOutputs.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
514 | |||
515 | private final PParameter parameter_T = new PParameter("T", "modes3.Turnout", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.ece.mcgill.ca/wcet/modes3", "Turnout")), PParameterDirection.INOUT); | ||
516 | |||
517 | private final List<PParameter> parameters = Arrays.asList(parameter_T); | ||
518 | |||
519 | private GeneratedPQuery() { | ||
520 | super(PVisibility.PUBLIC); | ||
521 | } | ||
522 | |||
523 | @Override | ||
524 | public String getFullyQualifiedName() { | ||
525 | return "modes3.queries.turnoutConnectedToBothOutputs"; | ||
526 | } | ||
527 | |||
528 | @Override | ||
529 | public List<String> getParameterNames() { | ||
530 | return Arrays.asList("T"); | ||
531 | } | ||
532 | |||
533 | @Override | ||
534 | public List<PParameter> getParameters() { | ||
535 | return parameters; | ||
536 | } | ||
537 | |||
538 | @Override | ||
539 | public Set<PBody> doGetContainedBodies() { | ||
540 | setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); | ||
541 | Set<PBody> bodies = new LinkedHashSet<>(); | ||
542 | { | ||
543 | PBody body = new PBody(this); | ||
544 | PVariable var_T = body.getOrCreateVariableByName("T"); | ||
545 | PVariable var_Straight = body.getOrCreateVariableByName("Straight"); | ||
546 | PVariable var_Divergent = body.getOrCreateVariableByName("Divergent"); | ||
547 | new TypeConstraint(body, Tuples.flatTupleOf(var_T), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Turnout"))); | ||
548 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
549 | new ExportedParameter(body, var_T, parameter_T) | ||
550 | )); | ||
551 | // Turnout.straight(T, Straight) | ||
552 | new TypeConstraint(body, Tuples.flatTupleOf(var_T), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Turnout"))); | ||
553 | PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); | ||
554 | new TypeConstraint(body, Tuples.flatTupleOf(var_T, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Turnout", "straight"))); | ||
555 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Segment"))); | ||
556 | new Equality(body, var__virtual_0_, var_Straight); | ||
557 | // Turnout.divergent(T, Divergent) | ||
558 | new TypeConstraint(body, Tuples.flatTupleOf(var_T), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Turnout"))); | ||
559 | PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}"); | ||
560 | new TypeConstraint(body, Tuples.flatTupleOf(var_T, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Turnout", "divergent"))); | ||
561 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Segment"))); | ||
562 | new Equality(body, var__virtual_1_, var_Divergent); | ||
563 | // Segment.connectedTo(T, Straight) | ||
564 | new TypeConstraint(body, Tuples.flatTupleOf(var_T), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Segment"))); | ||
565 | PVariable var__virtual_2_ = body.getOrCreateVariableByName(".virtual{2}"); | ||
566 | new TypeConstraint(body, Tuples.flatTupleOf(var_T, var__virtual_2_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Segment", "connectedTo"))); | ||
567 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_2_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Segment"))); | ||
568 | new Equality(body, var__virtual_2_, var_Straight); | ||
569 | // Segment.connectedTo(T, Divergent) | ||
570 | new TypeConstraint(body, Tuples.flatTupleOf(var_T), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Segment"))); | ||
571 | PVariable var__virtual_3_ = body.getOrCreateVariableByName(".virtual{3}"); | ||
572 | new TypeConstraint(body, Tuples.flatTupleOf(var_T, var__virtual_3_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Segment", "connectedTo"))); | ||
573 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_3_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Segment"))); | ||
574 | new Equality(body, var__virtual_3_, var_Divergent); | ||
575 | bodies.add(body); | ||
576 | } | ||
577 | { | ||
578 | PAnnotation annotation = new PAnnotation("Constraint"); | ||
579 | annotation.addAttribute("message", "turnoutConnectedToBothOutputs"); | ||
580 | annotation.addAttribute("severity", "error"); | ||
581 | annotation.addAttribute("key", Arrays.asList(new Object[] { | ||
582 | new ParameterReference("T") | ||
583 | })); | ||
584 | addAnnotation(annotation); | ||
585 | } | ||
586 | return bodies; | ||
587 | } | ||
588 | } | ||
589 | } | ||
diff --git a/Domains/ca.mcgill.rtgmrt.example.modes3/vql-gen/modes3/queries/TurnoutInSegments.java b/Domains/ca.mcgill.rtgmrt.example.modes3/vql-gen/modes3/queries/TurnoutInSegments.java new file mode 100644 index 00000000..9c9a5d18 --- /dev/null +++ b/Domains/ca.mcgill.rtgmrt.example.modes3/vql-gen/modes3/queries/TurnoutInSegments.java | |||
@@ -0,0 +1,564 @@ | |||
1 | /** | ||
2 | * Generated from platform:/resource/ca.mcgill.rtgmrt.example.modes3/src/modes3/queries/Modes3Queries.vql | ||
3 | */ | ||
4 | package modes3.queries; | ||
5 | |||
6 | import java.util.Arrays; | ||
7 | import java.util.Collection; | ||
8 | import java.util.LinkedHashSet; | ||
9 | import java.util.List; | ||
10 | import java.util.Objects; | ||
11 | import java.util.Optional; | ||
12 | import java.util.Set; | ||
13 | import java.util.function.Consumer; | ||
14 | import java.util.stream.Collectors; | ||
15 | import java.util.stream.Stream; | ||
16 | import modes3.Turnout; | ||
17 | import org.apache.log4j.Logger; | ||
18 | import org.eclipse.emf.ecore.EClass; | ||
19 | import org.eclipse.viatra.query.runtime.api.IPatternMatch; | ||
20 | import org.eclipse.viatra.query.runtime.api.IQuerySpecification; | ||
21 | import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; | ||
22 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
23 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; | ||
24 | import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; | ||
25 | import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; | ||
26 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
27 | import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey; | ||
28 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
29 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
30 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
31 | import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.PAnnotation; | ||
32 | import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.ParameterReference; | ||
33 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; | ||
34 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
35 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
36 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
37 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
38 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
39 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; | ||
40 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | ||
41 | import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; | ||
42 | |||
43 | /** | ||
44 | * A pattern-specific query specification that can instantiate Matcher in a type-safe way. | ||
45 | * | ||
46 | * <p>Original source: | ||
47 | * <code><pre> | ||
48 | * {@literal @}Constraint(message = "turnoutInSegments", severity = "error", key = { T }) | ||
49 | * pattern turnoutInSegments(T : Turnout) { | ||
50 | * Modes3ModelRoot.segments(_, T); | ||
51 | * } | ||
52 | * </pre></code> | ||
53 | * | ||
54 | * @see Matcher | ||
55 | * @see Match | ||
56 | * | ||
57 | */ | ||
58 | @SuppressWarnings("all") | ||
59 | public final class TurnoutInSegments extends BaseGeneratedEMFQuerySpecification<TurnoutInSegments.Matcher> { | ||
60 | /** | ||
61 | * Pattern-specific match representation of the modes3.queries.turnoutInSegments 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 Turnout fT; | ||
74 | |||
75 | private static List<String> parameterNames = makeImmutableList("T"); | ||
76 | |||
77 | private Match(final Turnout pT) { | ||
78 | this.fT = pT; | ||
79 | } | ||
80 | |||
81 | @Override | ||
82 | public Object get(final String parameterName) { | ||
83 | switch(parameterName) { | ||
84 | case "T": return this.fT; | ||
85 | default: return null; | ||
86 | } | ||
87 | } | ||
88 | |||
89 | @Override | ||
90 | public Object get(final int index) { | ||
91 | switch(index) { | ||
92 | case 0: return this.fT; | ||
93 | default: return null; | ||
94 | } | ||
95 | } | ||
96 | |||
97 | public Turnout getT() { | ||
98 | return this.fT; | ||
99 | } | ||
100 | |||
101 | @Override | ||
102 | public boolean set(final String parameterName, final Object newValue) { | ||
103 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
104 | if ("T".equals(parameterName) ) { | ||
105 | this.fT = (Turnout) newValue; | ||
106 | return true; | ||
107 | } | ||
108 | return false; | ||
109 | } | ||
110 | |||
111 | public void setT(final Turnout pT) { | ||
112 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
113 | this.fT = pT; | ||
114 | } | ||
115 | |||
116 | @Override | ||
117 | public String patternName() { | ||
118 | return "modes3.queries.turnoutInSegments"; | ||
119 | } | ||
120 | |||
121 | @Override | ||
122 | public List<String> parameterNames() { | ||
123 | return TurnoutInSegments.Match.parameterNames; | ||
124 | } | ||
125 | |||
126 | @Override | ||
127 | public Object[] toArray() { | ||
128 | return new Object[]{fT}; | ||
129 | } | ||
130 | |||
131 | @Override | ||
132 | public TurnoutInSegments.Match toImmutable() { | ||
133 | return isMutable() ? newMatch(fT) : this; | ||
134 | } | ||
135 | |||
136 | @Override | ||
137 | public String prettyPrint() { | ||
138 | StringBuilder result = new StringBuilder(); | ||
139 | result.append("\"T\"=" + prettyPrintValue(fT)); | ||
140 | return result.toString(); | ||
141 | } | ||
142 | |||
143 | @Override | ||
144 | public int hashCode() { | ||
145 | return Objects.hash(fT); | ||
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 TurnoutInSegments.Match)) { | ||
156 | TurnoutInSegments.Match other = (TurnoutInSegments.Match) obj; | ||
157 | return Objects.equals(fT, other.fT); | ||
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 TurnoutInSegments specification() { | ||
170 | return TurnoutInSegments.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 TurnoutInSegments.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 pT the fixed value of pattern parameter T, or null if not bound. | ||
189 | * @return the new, mutable (partial) match object. | ||
190 | * | ||
191 | */ | ||
192 | public static TurnoutInSegments.Match newMutableMatch(final Turnout pT) { | ||
193 | return new Mutable(pT); | ||
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 pT the fixed value of pattern parameter T, or null if not bound. | ||
201 | * @return the (partial) match object. | ||
202 | * | ||
203 | */ | ||
204 | public static TurnoutInSegments.Match newMatch(final Turnout pT) { | ||
205 | return new Immutable(pT); | ||
206 | } | ||
207 | |||
208 | private static final class Mutable extends TurnoutInSegments.Match { | ||
209 | Mutable(final Turnout pT) { | ||
210 | super(pT); | ||
211 | } | ||
212 | |||
213 | @Override | ||
214 | public boolean isMutable() { | ||
215 | return true; | ||
216 | } | ||
217 | } | ||
218 | |||
219 | private static final class Immutable extends TurnoutInSegments.Match { | ||
220 | Immutable(final Turnout pT) { | ||
221 | super(pT); | ||
222 | } | ||
223 | |||
224 | @Override | ||
225 | public boolean isMutable() { | ||
226 | return false; | ||
227 | } | ||
228 | } | ||
229 | } | ||
230 | |||
231 | /** | ||
232 | * Generated pattern matcher API of the modes3.queries.turnoutInSegments 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 | * {@literal @}Constraint(message = "turnoutInSegments", severity = "error", key = { T }) | ||
243 | * pattern turnoutInSegments(T : Turnout) { | ||
244 | * Modes3ModelRoot.segments(_, T); | ||
245 | * } | ||
246 | * </pre></code> | ||
247 | * | ||
248 | * @see Match | ||
249 | * @see TurnoutInSegments | ||
250 | * | ||
251 | */ | ||
252 | public static class Matcher extends BaseMatcher<TurnoutInSegments.Match> { | ||
253 | /** | ||
254 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
255 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
256 | * | ||
257 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
258 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
259 | * | ||
260 | */ | ||
261 | public static TurnoutInSegments.Matcher on(final ViatraQueryEngine engine) { | ||
262 | // check if matcher already exists | ||
263 | Matcher matcher = engine.getExistingMatcher(querySpecification()); | ||
264 | if (matcher == null) { | ||
265 | matcher = (Matcher)engine.getMatcher(querySpecification()); | ||
266 | } | ||
267 | return matcher; | ||
268 | } | ||
269 | |||
270 | /** | ||
271 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
272 | * @return an initialized matcher | ||
273 | * @noreference This method is for internal matcher initialization by the framework, do not call it manually. | ||
274 | * | ||
275 | */ | ||
276 | public static TurnoutInSegments.Matcher create() { | ||
277 | return new Matcher(); | ||
278 | } | ||
279 | |||
280 | private static final int POSITION_T = 0; | ||
281 | |||
282 | private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(TurnoutInSegments.Matcher.class); | ||
283 | |||
284 | /** | ||
285 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
286 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
287 | * | ||
288 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
289 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
290 | * | ||
291 | */ | ||
292 | private Matcher() { | ||
293 | super(querySpecification()); | ||
294 | } | ||
295 | |||
296 | /** | ||
297 | * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters. | ||
298 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
299 | * @return matches represented as a Match object. | ||
300 | * | ||
301 | */ | ||
302 | public Collection<TurnoutInSegments.Match> getAllMatches(final Turnout pT) { | ||
303 | return rawStreamAllMatches(new Object[]{pT}).collect(Collectors.toSet()); | ||
304 | } | ||
305 | |||
306 | /** | ||
307 | * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters. | ||
308 | * </p> | ||
309 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
310 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
311 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
312 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
313 | * @return a stream of matches represented as a Match object. | ||
314 | * | ||
315 | */ | ||
316 | public Stream<TurnoutInSegments.Match> streamAllMatches(final Turnout pT) { | ||
317 | return rawStreamAllMatches(new Object[]{pT}); | ||
318 | } | ||
319 | |||
320 | /** | ||
321 | * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
322 | * Neither determinism nor randomness of selection is guaranteed. | ||
323 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
324 | * @return a match represented as a Match object, or null if no match is found. | ||
325 | * | ||
326 | */ | ||
327 | public Optional<TurnoutInSegments.Match> getOneArbitraryMatch(final Turnout pT) { | ||
328 | return rawGetOneArbitraryMatch(new Object[]{pT}); | ||
329 | } | ||
330 | |||
331 | /** | ||
332 | * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match, | ||
333 | * under any possible substitution of the unspecified parameters (if any). | ||
334 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
335 | * @return true if the input is a valid (partial) match of the pattern. | ||
336 | * | ||
337 | */ | ||
338 | public boolean hasMatch(final Turnout pT) { | ||
339 | return rawHasMatch(new Object[]{pT}); | ||
340 | } | ||
341 | |||
342 | /** | ||
343 | * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. | ||
344 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
345 | * @return the number of pattern matches found. | ||
346 | * | ||
347 | */ | ||
348 | public int countMatches(final Turnout pT) { | ||
349 | return rawCountMatches(new Object[]{pT}); | ||
350 | } | ||
351 | |||
352 | /** | ||
353 | * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
354 | * Neither determinism nor randomness of selection is guaranteed. | ||
355 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
356 | * @param processor the action that will process the selected match. | ||
357 | * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked | ||
358 | * | ||
359 | */ | ||
360 | public boolean forOneArbitraryMatch(final Turnout pT, final Consumer<? super TurnoutInSegments.Match> processor) { | ||
361 | return rawForOneArbitraryMatch(new Object[]{pT}, processor); | ||
362 | } | ||
363 | |||
364 | /** | ||
365 | * Returns a new (partial) match. | ||
366 | * This can be used e.g. to call the matcher with a partial match. | ||
367 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
368 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
369 | * @return the (partial) match object. | ||
370 | * | ||
371 | */ | ||
372 | public TurnoutInSegments.Match newMatch(final Turnout pT) { | ||
373 | return TurnoutInSegments.Match.newMatch(pT); | ||
374 | } | ||
375 | |||
376 | /** | ||
377 | * Retrieve the set of values that occur in matches for T. | ||
378 | * @return the Set of all values or empty set if there are no matches | ||
379 | * | ||
380 | */ | ||
381 | protected Stream<Turnout> rawStreamAllValuesOfT(final Object[] parameters) { | ||
382 | return rawStreamAllValues(POSITION_T, parameters).map(Turnout.class::cast); | ||
383 | } | ||
384 | |||
385 | /** | ||
386 | * Retrieve the set of values that occur in matches for T. | ||
387 | * @return the Set of all values or empty set if there are no matches | ||
388 | * | ||
389 | */ | ||
390 | public Set<Turnout> getAllValuesOfT() { | ||
391 | return rawStreamAllValuesOfT(emptyArray()).collect(Collectors.toSet()); | ||
392 | } | ||
393 | |||
394 | /** | ||
395 | * Retrieve the set of values that occur in matches for T. | ||
396 | * @return the Set of all values or empty set if there are no matches | ||
397 | * | ||
398 | */ | ||
399 | public Stream<Turnout> streamAllValuesOfT() { | ||
400 | return rawStreamAllValuesOfT(emptyArray()); | ||
401 | } | ||
402 | |||
403 | @Override | ||
404 | protected TurnoutInSegments.Match tupleToMatch(final Tuple t) { | ||
405 | try { | ||
406 | return TurnoutInSegments.Match.newMatch((Turnout) t.get(POSITION_T)); | ||
407 | } catch(ClassCastException e) { | ||
408 | LOGGER.error("Element(s) in tuple not properly typed!",e); | ||
409 | return null; | ||
410 | } | ||
411 | } | ||
412 | |||
413 | @Override | ||
414 | protected TurnoutInSegments.Match arrayToMatch(final Object[] match) { | ||
415 | try { | ||
416 | return TurnoutInSegments.Match.newMatch((Turnout) match[POSITION_T]); | ||
417 | } catch(ClassCastException e) { | ||
418 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
419 | return null; | ||
420 | } | ||
421 | } | ||
422 | |||
423 | @Override | ||
424 | protected TurnoutInSegments.Match arrayToMatchMutable(final Object[] match) { | ||
425 | try { | ||
426 | return TurnoutInSegments.Match.newMutableMatch((Turnout) match[POSITION_T]); | ||
427 | } catch(ClassCastException e) { | ||
428 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
429 | return null; | ||
430 | } | ||
431 | } | ||
432 | |||
433 | /** | ||
434 | * @return the singleton instance of the query specification of this pattern | ||
435 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
436 | * | ||
437 | */ | ||
438 | public static IQuerySpecification<TurnoutInSegments.Matcher> querySpecification() { | ||
439 | return TurnoutInSegments.instance(); | ||
440 | } | ||
441 | } | ||
442 | |||
443 | private TurnoutInSegments() { | ||
444 | super(GeneratedPQuery.INSTANCE); | ||
445 | } | ||
446 | |||
447 | /** | ||
448 | * @return the singleton instance of the query specification | ||
449 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
450 | * | ||
451 | */ | ||
452 | public static TurnoutInSegments instance() { | ||
453 | try{ | ||
454 | return LazyHolder.INSTANCE; | ||
455 | } catch (ExceptionInInitializerError err) { | ||
456 | throw processInitializerError(err); | ||
457 | } | ||
458 | } | ||
459 | |||
460 | @Override | ||
461 | protected TurnoutInSegments.Matcher instantiate(final ViatraQueryEngine engine) { | ||
462 | return TurnoutInSegments.Matcher.on(engine); | ||
463 | } | ||
464 | |||
465 | @Override | ||
466 | public TurnoutInSegments.Matcher instantiate() { | ||
467 | return TurnoutInSegments.Matcher.create(); | ||
468 | } | ||
469 | |||
470 | @Override | ||
471 | public TurnoutInSegments.Match newEmptyMatch() { | ||
472 | return TurnoutInSegments.Match.newEmptyMatch(); | ||
473 | } | ||
474 | |||
475 | @Override | ||
476 | public TurnoutInSegments.Match newMatch(final Object... parameters) { | ||
477 | return TurnoutInSegments.Match.newMatch((modes3.Turnout) parameters[0]); | ||
478 | } | ||
479 | |||
480 | /** | ||
481 | * Inner class allowing the singleton instance of {@link TurnoutInSegments} to be created | ||
482 | * <b>not</b> at the class load time of the outer class, | ||
483 | * but rather at the first call to {@link TurnoutInSegments#instance()}. | ||
484 | * | ||
485 | * <p> This workaround is required e.g. to support recursion. | ||
486 | * | ||
487 | */ | ||
488 | private static class LazyHolder { | ||
489 | private static final TurnoutInSegments INSTANCE = new TurnoutInSegments(); | ||
490 | |||
491 | /** | ||
492 | * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned. | ||
493 | * This initialization order is required to support indirect recursion. | ||
494 | * | ||
495 | * <p> The static initializer is defined using a helper field to work around limitations of the code generator. | ||
496 | * | ||
497 | */ | ||
498 | private static final Object STATIC_INITIALIZER = ensureInitialized(); | ||
499 | |||
500 | public static Object ensureInitialized() { | ||
501 | INSTANCE.ensureInitializedInternal(); | ||
502 | return null; | ||
503 | } | ||
504 | } | ||
505 | |||
506 | private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { | ||
507 | private static final TurnoutInSegments.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
508 | |||
509 | private final PParameter parameter_T = new PParameter("T", "modes3.Turnout", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.ece.mcgill.ca/wcet/modes3", "Turnout")), PParameterDirection.INOUT); | ||
510 | |||
511 | private final List<PParameter> parameters = Arrays.asList(parameter_T); | ||
512 | |||
513 | private GeneratedPQuery() { | ||
514 | super(PVisibility.PUBLIC); | ||
515 | } | ||
516 | |||
517 | @Override | ||
518 | public String getFullyQualifiedName() { | ||
519 | return "modes3.queries.turnoutInSegments"; | ||
520 | } | ||
521 | |||
522 | @Override | ||
523 | public List<String> getParameterNames() { | ||
524 | return Arrays.asList("T"); | ||
525 | } | ||
526 | |||
527 | @Override | ||
528 | public List<PParameter> getParameters() { | ||
529 | return parameters; | ||
530 | } | ||
531 | |||
532 | @Override | ||
533 | public Set<PBody> doGetContainedBodies() { | ||
534 | setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); | ||
535 | Set<PBody> bodies = new LinkedHashSet<>(); | ||
536 | { | ||
537 | PBody body = new PBody(this); | ||
538 | PVariable var_T = body.getOrCreateVariableByName("T"); | ||
539 | PVariable var___0_ = body.getOrCreateVariableByName("_<0>"); | ||
540 | new TypeConstraint(body, Tuples.flatTupleOf(var_T), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Turnout"))); | ||
541 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
542 | new ExportedParameter(body, var_T, parameter_T) | ||
543 | )); | ||
544 | // Modes3ModelRoot.segments(_, T) | ||
545 | new TypeConstraint(body, Tuples.flatTupleOf(var___0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Modes3ModelRoot"))); | ||
546 | PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); | ||
547 | new TypeConstraint(body, Tuples.flatTupleOf(var___0_, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Modes3ModelRoot", "segments"))); | ||
548 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Segment"))); | ||
549 | new Equality(body, var__virtual_0_, var_T); | ||
550 | bodies.add(body); | ||
551 | } | ||
552 | { | ||
553 | PAnnotation annotation = new PAnnotation("Constraint"); | ||
554 | annotation.addAttribute("message", "turnoutInSegments"); | ||
555 | annotation.addAttribute("severity", "error"); | ||
556 | annotation.addAttribute("key", Arrays.asList(new Object[] { | ||
557 | new ParameterReference("T") | ||
558 | })); | ||
559 | addAnnotation(annotation); | ||
560 | } | ||
561 | return bodies; | ||
562 | } | ||
563 | } | ||
564 | } | ||
diff --git a/Domains/ca.mcgill.rtgmrt.example.modes3/vql-gen/modes3/queries/TurnoutOutput.java b/Domains/ca.mcgill.rtgmrt.example.modes3/vql-gen/modes3/queries/TurnoutOutput.java new file mode 100644 index 00000000..87cccfde --- /dev/null +++ b/Domains/ca.mcgill.rtgmrt.example.modes3/vql-gen/modes3/queries/TurnoutOutput.java | |||
@@ -0,0 +1,727 @@ | |||
1 | /** | ||
2 | * Generated from platform:/resource/ca.mcgill.rtgmrt.example.modes3/src/modes3/queries/Modes3Queries.vql | ||
3 | */ | ||
4 | package modes3.queries; | ||
5 | |||
6 | import java.util.Arrays; | ||
7 | import java.util.Collection; | ||
8 | import java.util.LinkedHashSet; | ||
9 | import java.util.List; | ||
10 | import java.util.Objects; | ||
11 | import java.util.Optional; | ||
12 | import java.util.Set; | ||
13 | import java.util.function.Consumer; | ||
14 | import java.util.stream.Collectors; | ||
15 | import java.util.stream.Stream; | ||
16 | import modes3.Segment; | ||
17 | import modes3.Turnout; | ||
18 | import org.apache.log4j.Logger; | ||
19 | import org.eclipse.emf.ecore.EClass; | ||
20 | import org.eclipse.viatra.query.runtime.api.IPatternMatch; | ||
21 | import org.eclipse.viatra.query.runtime.api.IQuerySpecification; | ||
22 | import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; | ||
23 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
24 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; | ||
25 | import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; | ||
26 | import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; | ||
27 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
28 | import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey; | ||
29 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
30 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
31 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
32 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; | ||
33 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
34 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
35 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
36 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
37 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
38 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; | ||
39 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | ||
40 | import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; | ||
41 | |||
42 | /** | ||
43 | * A pattern-specific query specification that can instantiate Matcher in a type-safe way. | ||
44 | * | ||
45 | * <p>Original source: | ||
46 | * <code><pre> | ||
47 | * pattern turnoutOutput(T : Turnout, S : Segment) { | ||
48 | * Turnout.straight(T, S); | ||
49 | * } or { | ||
50 | * Turnout.divergent(T, S); | ||
51 | * } | ||
52 | * </pre></code> | ||
53 | * | ||
54 | * @see Matcher | ||
55 | * @see Match | ||
56 | * | ||
57 | */ | ||
58 | @SuppressWarnings("all") | ||
59 | public final class TurnoutOutput extends BaseGeneratedEMFQuerySpecification<TurnoutOutput.Matcher> { | ||
60 | /** | ||
61 | * Pattern-specific match representation of the modes3.queries.turnoutOutput 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 Turnout fT; | ||
74 | |||
75 | private Segment fS; | ||
76 | |||
77 | private static List<String> parameterNames = makeImmutableList("T", "S"); | ||
78 | |||
79 | private Match(final Turnout pT, final Segment pS) { | ||
80 | this.fT = pT; | ||
81 | this.fS = pS; | ||
82 | } | ||
83 | |||
84 | @Override | ||
85 | public Object get(final String parameterName) { | ||
86 | switch(parameterName) { | ||
87 | case "T": return this.fT; | ||
88 | case "S": return this.fS; | ||
89 | default: return null; | ||
90 | } | ||
91 | } | ||
92 | |||
93 | @Override | ||
94 | public Object get(final int index) { | ||
95 | switch(index) { | ||
96 | case 0: return this.fT; | ||
97 | case 1: return this.fS; | ||
98 | default: return null; | ||
99 | } | ||
100 | } | ||
101 | |||
102 | public Turnout getT() { | ||
103 | return this.fT; | ||
104 | } | ||
105 | |||
106 | public Segment getS() { | ||
107 | return this.fS; | ||
108 | } | ||
109 | |||
110 | @Override | ||
111 | public boolean set(final String parameterName, final Object newValue) { | ||
112 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
113 | if ("T".equals(parameterName) ) { | ||
114 | this.fT = (Turnout) newValue; | ||
115 | return true; | ||
116 | } | ||
117 | if ("S".equals(parameterName) ) { | ||
118 | this.fS = (Segment) newValue; | ||
119 | return true; | ||
120 | } | ||
121 | return false; | ||
122 | } | ||
123 | |||
124 | public void setT(final Turnout pT) { | ||
125 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
126 | this.fT = pT; | ||
127 | } | ||
128 | |||
129 | public void setS(final Segment pS) { | ||
130 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
131 | this.fS = pS; | ||
132 | } | ||
133 | |||
134 | @Override | ||
135 | public String patternName() { | ||
136 | return "modes3.queries.turnoutOutput"; | ||
137 | } | ||
138 | |||
139 | @Override | ||
140 | public List<String> parameterNames() { | ||
141 | return TurnoutOutput.Match.parameterNames; | ||
142 | } | ||
143 | |||
144 | @Override | ||
145 | public Object[] toArray() { | ||
146 | return new Object[]{fT, fS}; | ||
147 | } | ||
148 | |||
149 | @Override | ||
150 | public TurnoutOutput.Match toImmutable() { | ||
151 | return isMutable() ? newMatch(fT, fS) : this; | ||
152 | } | ||
153 | |||
154 | @Override | ||
155 | public String prettyPrint() { | ||
156 | StringBuilder result = new StringBuilder(); | ||
157 | result.append("\"T\"=" + prettyPrintValue(fT) + ", "); | ||
158 | result.append("\"S\"=" + prettyPrintValue(fS)); | ||
159 | return result.toString(); | ||
160 | } | ||
161 | |||
162 | @Override | ||
163 | public int hashCode() { | ||
164 | return Objects.hash(fT, fS); | ||
165 | } | ||
166 | |||
167 | @Override | ||
168 | public boolean equals(final Object obj) { | ||
169 | if (this == obj) | ||
170 | return true; | ||
171 | if (obj == null) { | ||
172 | return false; | ||
173 | } | ||
174 | if ((obj instanceof TurnoutOutput.Match)) { | ||
175 | TurnoutOutput.Match other = (TurnoutOutput.Match) obj; | ||
176 | return Objects.equals(fT, other.fT) && Objects.equals(fS, other.fS); | ||
177 | } else { | ||
178 | // this should be infrequent | ||
179 | if (!(obj instanceof IPatternMatch)) { | ||
180 | return false; | ||
181 | } | ||
182 | IPatternMatch otherSig = (IPatternMatch) obj; | ||
183 | return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray()); | ||
184 | } | ||
185 | } | ||
186 | |||
187 | @Override | ||
188 | public TurnoutOutput specification() { | ||
189 | return TurnoutOutput.instance(); | ||
190 | } | ||
191 | |||
192 | /** | ||
193 | * Returns an empty, mutable match. | ||
194 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
195 | * | ||
196 | * @return the empty match. | ||
197 | * | ||
198 | */ | ||
199 | public static TurnoutOutput.Match newEmptyMatch() { | ||
200 | return new Mutable(null, null); | ||
201 | } | ||
202 | |||
203 | /** | ||
204 | * Returns a mutable (partial) match. | ||
205 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
206 | * | ||
207 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
208 | * @param pS the fixed value of pattern parameter S, or null if not bound. | ||
209 | * @return the new, mutable (partial) match object. | ||
210 | * | ||
211 | */ | ||
212 | public static TurnoutOutput.Match newMutableMatch(final Turnout pT, final Segment pS) { | ||
213 | return new Mutable(pT, pS); | ||
214 | } | ||
215 | |||
216 | /** | ||
217 | * Returns a new (partial) match. | ||
218 | * This can be used e.g. to call the matcher with a partial match. | ||
219 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
220 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
221 | * @param pS the fixed value of pattern parameter S, or null if not bound. | ||
222 | * @return the (partial) match object. | ||
223 | * | ||
224 | */ | ||
225 | public static TurnoutOutput.Match newMatch(final Turnout pT, final Segment pS) { | ||
226 | return new Immutable(pT, pS); | ||
227 | } | ||
228 | |||
229 | private static final class Mutable extends TurnoutOutput.Match { | ||
230 | Mutable(final Turnout pT, final Segment pS) { | ||
231 | super(pT, pS); | ||
232 | } | ||
233 | |||
234 | @Override | ||
235 | public boolean isMutable() { | ||
236 | return true; | ||
237 | } | ||
238 | } | ||
239 | |||
240 | private static final class Immutable extends TurnoutOutput.Match { | ||
241 | Immutable(final Turnout pT, final Segment pS) { | ||
242 | super(pT, pS); | ||
243 | } | ||
244 | |||
245 | @Override | ||
246 | public boolean isMutable() { | ||
247 | return false; | ||
248 | } | ||
249 | } | ||
250 | } | ||
251 | |||
252 | /** | ||
253 | * Generated pattern matcher API of the modes3.queries.turnoutOutput pattern, | ||
254 | * providing pattern-specific query methods. | ||
255 | * | ||
256 | * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)}, | ||
257 | * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}. | ||
258 | * | ||
259 | * <p>Matches of the pattern will be represented as {@link Match}. | ||
260 | * | ||
261 | * <p>Original source: | ||
262 | * <code><pre> | ||
263 | * pattern turnoutOutput(T : Turnout, S : Segment) { | ||
264 | * Turnout.straight(T, S); | ||
265 | * } or { | ||
266 | * Turnout.divergent(T, S); | ||
267 | * } | ||
268 | * </pre></code> | ||
269 | * | ||
270 | * @see Match | ||
271 | * @see TurnoutOutput | ||
272 | * | ||
273 | */ | ||
274 | public static class Matcher extends BaseMatcher<TurnoutOutput.Match> { | ||
275 | /** | ||
276 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
277 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
278 | * | ||
279 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
280 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
281 | * | ||
282 | */ | ||
283 | public static TurnoutOutput.Matcher on(final ViatraQueryEngine engine) { | ||
284 | // check if matcher already exists | ||
285 | Matcher matcher = engine.getExistingMatcher(querySpecification()); | ||
286 | if (matcher == null) { | ||
287 | matcher = (Matcher)engine.getMatcher(querySpecification()); | ||
288 | } | ||
289 | return matcher; | ||
290 | } | ||
291 | |||
292 | /** | ||
293 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
294 | * @return an initialized matcher | ||
295 | * @noreference This method is for internal matcher initialization by the framework, do not call it manually. | ||
296 | * | ||
297 | */ | ||
298 | public static TurnoutOutput.Matcher create() { | ||
299 | return new Matcher(); | ||
300 | } | ||
301 | |||
302 | private static final int POSITION_T = 0; | ||
303 | |||
304 | private static final int POSITION_S = 1; | ||
305 | |||
306 | private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(TurnoutOutput.Matcher.class); | ||
307 | |||
308 | /** | ||
309 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
310 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
311 | * | ||
312 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
313 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
314 | * | ||
315 | */ | ||
316 | private Matcher() { | ||
317 | super(querySpecification()); | ||
318 | } | ||
319 | |||
320 | /** | ||
321 | * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters. | ||
322 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
323 | * @param pS the fixed value of pattern parameter S, or null if not bound. | ||
324 | * @return matches represented as a Match object. | ||
325 | * | ||
326 | */ | ||
327 | public Collection<TurnoutOutput.Match> getAllMatches(final Turnout pT, final Segment pS) { | ||
328 | return rawStreamAllMatches(new Object[]{pT, pS}).collect(Collectors.toSet()); | ||
329 | } | ||
330 | |||
331 | /** | ||
332 | * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters. | ||
333 | * </p> | ||
334 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
335 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
336 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
337 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
338 | * @param pS the fixed value of pattern parameter S, or null if not bound. | ||
339 | * @return a stream of matches represented as a Match object. | ||
340 | * | ||
341 | */ | ||
342 | public Stream<TurnoutOutput.Match> streamAllMatches(final Turnout pT, final Segment pS) { | ||
343 | return rawStreamAllMatches(new Object[]{pT, pS}); | ||
344 | } | ||
345 | |||
346 | /** | ||
347 | * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
348 | * Neither determinism nor randomness of selection is guaranteed. | ||
349 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
350 | * @param pS the fixed value of pattern parameter S, or null if not bound. | ||
351 | * @return a match represented as a Match object, or null if no match is found. | ||
352 | * | ||
353 | */ | ||
354 | public Optional<TurnoutOutput.Match> getOneArbitraryMatch(final Turnout pT, final Segment pS) { | ||
355 | return rawGetOneArbitraryMatch(new Object[]{pT, pS}); | ||
356 | } | ||
357 | |||
358 | /** | ||
359 | * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match, | ||
360 | * under any possible substitution of the unspecified parameters (if any). | ||
361 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
362 | * @param pS the fixed value of pattern parameter S, or null if not bound. | ||
363 | * @return true if the input is a valid (partial) match of the pattern. | ||
364 | * | ||
365 | */ | ||
366 | public boolean hasMatch(final Turnout pT, final Segment pS) { | ||
367 | return rawHasMatch(new Object[]{pT, pS}); | ||
368 | } | ||
369 | |||
370 | /** | ||
371 | * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. | ||
372 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
373 | * @param pS the fixed value of pattern parameter S, or null if not bound. | ||
374 | * @return the number of pattern matches found. | ||
375 | * | ||
376 | */ | ||
377 | public int countMatches(final Turnout pT, final Segment pS) { | ||
378 | return rawCountMatches(new Object[]{pT, pS}); | ||
379 | } | ||
380 | |||
381 | /** | ||
382 | * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
383 | * Neither determinism nor randomness of selection is guaranteed. | ||
384 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
385 | * @param pS the fixed value of pattern parameter S, or null if not bound. | ||
386 | * @param processor the action that will process the selected match. | ||
387 | * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked | ||
388 | * | ||
389 | */ | ||
390 | public boolean forOneArbitraryMatch(final Turnout pT, final Segment pS, final Consumer<? super TurnoutOutput.Match> processor) { | ||
391 | return rawForOneArbitraryMatch(new Object[]{pT, pS}, processor); | ||
392 | } | ||
393 | |||
394 | /** | ||
395 | * Returns a new (partial) match. | ||
396 | * This can be used e.g. to call the matcher with a partial match. | ||
397 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
398 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
399 | * @param pS the fixed value of pattern parameter S, or null if not bound. | ||
400 | * @return the (partial) match object. | ||
401 | * | ||
402 | */ | ||
403 | public TurnoutOutput.Match newMatch(final Turnout pT, final Segment pS) { | ||
404 | return TurnoutOutput.Match.newMatch(pT, pS); | ||
405 | } | ||
406 | |||
407 | /** | ||
408 | * Retrieve the set of values that occur in matches for T. | ||
409 | * @return the Set of all values or empty set if there are no matches | ||
410 | * | ||
411 | */ | ||
412 | protected Stream<Turnout> rawStreamAllValuesOfT(final Object[] parameters) { | ||
413 | return rawStreamAllValues(POSITION_T, parameters).map(Turnout.class::cast); | ||
414 | } | ||
415 | |||
416 | /** | ||
417 | * Retrieve the set of values that occur in matches for T. | ||
418 | * @return the Set of all values or empty set if there are no matches | ||
419 | * | ||
420 | */ | ||
421 | public Set<Turnout> getAllValuesOfT() { | ||
422 | return rawStreamAllValuesOfT(emptyArray()).collect(Collectors.toSet()); | ||
423 | } | ||
424 | |||
425 | /** | ||
426 | * Retrieve the set of values that occur in matches for T. | ||
427 | * @return the Set of all values or empty set if there are no matches | ||
428 | * | ||
429 | */ | ||
430 | public Stream<Turnout> streamAllValuesOfT() { | ||
431 | return rawStreamAllValuesOfT(emptyArray()); | ||
432 | } | ||
433 | |||
434 | /** | ||
435 | * Retrieve the set of values that occur in matches for T. | ||
436 | * </p> | ||
437 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
438 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
439 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
440 | * | ||
441 | * @return the Stream of all values or empty set if there are no matches | ||
442 | * | ||
443 | */ | ||
444 | public Stream<Turnout> streamAllValuesOfT(final TurnoutOutput.Match partialMatch) { | ||
445 | return rawStreamAllValuesOfT(partialMatch.toArray()); | ||
446 | } | ||
447 | |||
448 | /** | ||
449 | * Retrieve the set of values that occur in matches for T. | ||
450 | * </p> | ||
451 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
452 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
453 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
454 | * | ||
455 | * @return the Stream of all values or empty set if there are no matches | ||
456 | * | ||
457 | */ | ||
458 | public Stream<Turnout> streamAllValuesOfT(final Segment pS) { | ||
459 | return rawStreamAllValuesOfT(new Object[]{null, pS}); | ||
460 | } | ||
461 | |||
462 | /** | ||
463 | * Retrieve the set of values that occur in matches for T. | ||
464 | * @return the Set of all values or empty set if there are no matches | ||
465 | * | ||
466 | */ | ||
467 | public Set<Turnout> getAllValuesOfT(final TurnoutOutput.Match partialMatch) { | ||
468 | return rawStreamAllValuesOfT(partialMatch.toArray()).collect(Collectors.toSet()); | ||
469 | } | ||
470 | |||
471 | /** | ||
472 | * Retrieve the set of values that occur in matches for T. | ||
473 | * @return the Set of all values or empty set if there are no matches | ||
474 | * | ||
475 | */ | ||
476 | public Set<Turnout> getAllValuesOfT(final Segment pS) { | ||
477 | return rawStreamAllValuesOfT(new Object[]{null, pS}).collect(Collectors.toSet()); | ||
478 | } | ||
479 | |||
480 | /** | ||
481 | * Retrieve the set of values that occur in matches for S. | ||
482 | * @return the Set of all values or empty set if there are no matches | ||
483 | * | ||
484 | */ | ||
485 | protected Stream<Segment> rawStreamAllValuesOfS(final Object[] parameters) { | ||
486 | return rawStreamAllValues(POSITION_S, parameters).map(Segment.class::cast); | ||
487 | } | ||
488 | |||
489 | /** | ||
490 | * Retrieve the set of values that occur in matches for S. | ||
491 | * @return the Set of all values or empty set if there are no matches | ||
492 | * | ||
493 | */ | ||
494 | public Set<Segment> getAllValuesOfS() { | ||
495 | return rawStreamAllValuesOfS(emptyArray()).collect(Collectors.toSet()); | ||
496 | } | ||
497 | |||
498 | /** | ||
499 | * Retrieve the set of values that occur in matches for S. | ||
500 | * @return the Set of all values or empty set if there are no matches | ||
501 | * | ||
502 | */ | ||
503 | public Stream<Segment> streamAllValuesOfS() { | ||
504 | return rawStreamAllValuesOfS(emptyArray()); | ||
505 | } | ||
506 | |||
507 | /** | ||
508 | * Retrieve the set of values that occur in matches for S. | ||
509 | * </p> | ||
510 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
511 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
512 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
513 | * | ||
514 | * @return the Stream of all values or empty set if there are no matches | ||
515 | * | ||
516 | */ | ||
517 | public Stream<Segment> streamAllValuesOfS(final TurnoutOutput.Match partialMatch) { | ||
518 | return rawStreamAllValuesOfS(partialMatch.toArray()); | ||
519 | } | ||
520 | |||
521 | /** | ||
522 | * Retrieve the set of values that occur in matches for S. | ||
523 | * </p> | ||
524 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
525 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
526 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
527 | * | ||
528 | * @return the Stream of all values or empty set if there are no matches | ||
529 | * | ||
530 | */ | ||
531 | public Stream<Segment> streamAllValuesOfS(final Turnout pT) { | ||
532 | return rawStreamAllValuesOfS(new Object[]{pT, null}); | ||
533 | } | ||
534 | |||
535 | /** | ||
536 | * Retrieve the set of values that occur in matches for S. | ||
537 | * @return the Set of all values or empty set if there are no matches | ||
538 | * | ||
539 | */ | ||
540 | public Set<Segment> getAllValuesOfS(final TurnoutOutput.Match partialMatch) { | ||
541 | return rawStreamAllValuesOfS(partialMatch.toArray()).collect(Collectors.toSet()); | ||
542 | } | ||
543 | |||
544 | /** | ||
545 | * Retrieve the set of values that occur in matches for S. | ||
546 | * @return the Set of all values or empty set if there are no matches | ||
547 | * | ||
548 | */ | ||
549 | public Set<Segment> getAllValuesOfS(final Turnout pT) { | ||
550 | return rawStreamAllValuesOfS(new Object[]{pT, null}).collect(Collectors.toSet()); | ||
551 | } | ||
552 | |||
553 | @Override | ||
554 | protected TurnoutOutput.Match tupleToMatch(final Tuple t) { | ||
555 | try { | ||
556 | return TurnoutOutput.Match.newMatch((Turnout) t.get(POSITION_T), (Segment) t.get(POSITION_S)); | ||
557 | } catch(ClassCastException e) { | ||
558 | LOGGER.error("Element(s) in tuple not properly typed!",e); | ||
559 | return null; | ||
560 | } | ||
561 | } | ||
562 | |||
563 | @Override | ||
564 | protected TurnoutOutput.Match arrayToMatch(final Object[] match) { | ||
565 | try { | ||
566 | return TurnoutOutput.Match.newMatch((Turnout) match[POSITION_T], (Segment) match[POSITION_S]); | ||
567 | } catch(ClassCastException e) { | ||
568 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
569 | return null; | ||
570 | } | ||
571 | } | ||
572 | |||
573 | @Override | ||
574 | protected TurnoutOutput.Match arrayToMatchMutable(final Object[] match) { | ||
575 | try { | ||
576 | return TurnoutOutput.Match.newMutableMatch((Turnout) match[POSITION_T], (Segment) match[POSITION_S]); | ||
577 | } catch(ClassCastException e) { | ||
578 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
579 | return null; | ||
580 | } | ||
581 | } | ||
582 | |||
583 | /** | ||
584 | * @return the singleton instance of the query specification of this pattern | ||
585 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
586 | * | ||
587 | */ | ||
588 | public static IQuerySpecification<TurnoutOutput.Matcher> querySpecification() { | ||
589 | return TurnoutOutput.instance(); | ||
590 | } | ||
591 | } | ||
592 | |||
593 | private TurnoutOutput() { | ||
594 | super(GeneratedPQuery.INSTANCE); | ||
595 | } | ||
596 | |||
597 | /** | ||
598 | * @return the singleton instance of the query specification | ||
599 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
600 | * | ||
601 | */ | ||
602 | public static TurnoutOutput instance() { | ||
603 | try{ | ||
604 | return LazyHolder.INSTANCE; | ||
605 | } catch (ExceptionInInitializerError err) { | ||
606 | throw processInitializerError(err); | ||
607 | } | ||
608 | } | ||
609 | |||
610 | @Override | ||
611 | protected TurnoutOutput.Matcher instantiate(final ViatraQueryEngine engine) { | ||
612 | return TurnoutOutput.Matcher.on(engine); | ||
613 | } | ||
614 | |||
615 | @Override | ||
616 | public TurnoutOutput.Matcher instantiate() { | ||
617 | return TurnoutOutput.Matcher.create(); | ||
618 | } | ||
619 | |||
620 | @Override | ||
621 | public TurnoutOutput.Match newEmptyMatch() { | ||
622 | return TurnoutOutput.Match.newEmptyMatch(); | ||
623 | } | ||
624 | |||
625 | @Override | ||
626 | public TurnoutOutput.Match newMatch(final Object... parameters) { | ||
627 | return TurnoutOutput.Match.newMatch((modes3.Turnout) parameters[0], (modes3.Segment) parameters[1]); | ||
628 | } | ||
629 | |||
630 | /** | ||
631 | * Inner class allowing the singleton instance of {@link TurnoutOutput} to be created | ||
632 | * <b>not</b> at the class load time of the outer class, | ||
633 | * but rather at the first call to {@link TurnoutOutput#instance()}. | ||
634 | * | ||
635 | * <p> This workaround is required e.g. to support recursion. | ||
636 | * | ||
637 | */ | ||
638 | private static class LazyHolder { | ||
639 | private static final TurnoutOutput INSTANCE = new TurnoutOutput(); | ||
640 | |||
641 | /** | ||
642 | * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned. | ||
643 | * This initialization order is required to support indirect recursion. | ||
644 | * | ||
645 | * <p> The static initializer is defined using a helper field to work around limitations of the code generator. | ||
646 | * | ||
647 | */ | ||
648 | private static final Object STATIC_INITIALIZER = ensureInitialized(); | ||
649 | |||
650 | public static Object ensureInitialized() { | ||
651 | INSTANCE.ensureInitializedInternal(); | ||
652 | return null; | ||
653 | } | ||
654 | } | ||
655 | |||
656 | private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { | ||
657 | private static final TurnoutOutput.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
658 | |||
659 | private final PParameter parameter_T = new PParameter("T", "modes3.Turnout", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.ece.mcgill.ca/wcet/modes3", "Turnout")), PParameterDirection.INOUT); | ||
660 | |||
661 | private final PParameter parameter_S = new PParameter("S", "modes3.Segment", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.ece.mcgill.ca/wcet/modes3", "Segment")), PParameterDirection.INOUT); | ||
662 | |||
663 | private final List<PParameter> parameters = Arrays.asList(parameter_T, parameter_S); | ||
664 | |||
665 | private GeneratedPQuery() { | ||
666 | super(PVisibility.PUBLIC); | ||
667 | } | ||
668 | |||
669 | @Override | ||
670 | public String getFullyQualifiedName() { | ||
671 | return "modes3.queries.turnoutOutput"; | ||
672 | } | ||
673 | |||
674 | @Override | ||
675 | public List<String> getParameterNames() { | ||
676 | return Arrays.asList("T","S"); | ||
677 | } | ||
678 | |||
679 | @Override | ||
680 | public List<PParameter> getParameters() { | ||
681 | return parameters; | ||
682 | } | ||
683 | |||
684 | @Override | ||
685 | public Set<PBody> doGetContainedBodies() { | ||
686 | setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); | ||
687 | Set<PBody> bodies = new LinkedHashSet<>(); | ||
688 | { | ||
689 | PBody body = new PBody(this); | ||
690 | PVariable var_T = body.getOrCreateVariableByName("T"); | ||
691 | PVariable var_S = body.getOrCreateVariableByName("S"); | ||
692 | new TypeConstraint(body, Tuples.flatTupleOf(var_T), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Turnout"))); | ||
693 | new TypeConstraint(body, Tuples.flatTupleOf(var_S), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Segment"))); | ||
694 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
695 | new ExportedParameter(body, var_T, parameter_T), | ||
696 | new ExportedParameter(body, var_S, parameter_S) | ||
697 | )); | ||
698 | // Turnout.straight(T, S) | ||
699 | new TypeConstraint(body, Tuples.flatTupleOf(var_T), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Turnout"))); | ||
700 | PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); | ||
701 | new TypeConstraint(body, Tuples.flatTupleOf(var_T, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Turnout", "straight"))); | ||
702 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Segment"))); | ||
703 | new Equality(body, var__virtual_0_, var_S); | ||
704 | bodies.add(body); | ||
705 | } | ||
706 | { | ||
707 | PBody body = new PBody(this); | ||
708 | PVariable var_T = body.getOrCreateVariableByName("T"); | ||
709 | PVariable var_S = body.getOrCreateVariableByName("S"); | ||
710 | new TypeConstraint(body, Tuples.flatTupleOf(var_T), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Turnout"))); | ||
711 | new TypeConstraint(body, Tuples.flatTupleOf(var_S), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Segment"))); | ||
712 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
713 | new ExportedParameter(body, var_T, parameter_T), | ||
714 | new ExportedParameter(body, var_S, parameter_S) | ||
715 | )); | ||
716 | // Turnout.divergent(T, S) | ||
717 | new TypeConstraint(body, Tuples.flatTupleOf(var_T), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Turnout"))); | ||
718 | PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); | ||
719 | new TypeConstraint(body, Tuples.flatTupleOf(var_T, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Turnout", "divergent"))); | ||
720 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Segment"))); | ||
721 | new Equality(body, var__virtual_0_, var_S); | ||
722 | bodies.add(body); | ||
723 | } | ||
724 | return bodies; | ||
725 | } | ||
726 | } | ||
727 | } | ||
diff --git a/Domains/ca.mcgill.rtgmrt.example.modes3/vql-gen/modes3/queries/TurnoutOutputsAreSame.java b/Domains/ca.mcgill.rtgmrt.example.modes3/vql-gen/modes3/queries/TurnoutOutputsAreSame.java new file mode 100644 index 00000000..ba59d45c --- /dev/null +++ b/Domains/ca.mcgill.rtgmrt.example.modes3/vql-gen/modes3/queries/TurnoutOutputsAreSame.java | |||
@@ -0,0 +1,572 @@ | |||
1 | /** | ||
2 | * Generated from platform:/resource/ca.mcgill.rtgmrt.example.modes3/src/modes3/queries/Modes3Queries.vql | ||
3 | */ | ||
4 | package modes3.queries; | ||
5 | |||
6 | import java.util.Arrays; | ||
7 | import java.util.Collection; | ||
8 | import java.util.LinkedHashSet; | ||
9 | import java.util.List; | ||
10 | import java.util.Objects; | ||
11 | import java.util.Optional; | ||
12 | import java.util.Set; | ||
13 | import java.util.function.Consumer; | ||
14 | import java.util.stream.Collectors; | ||
15 | import java.util.stream.Stream; | ||
16 | import modes3.Turnout; | ||
17 | import org.apache.log4j.Logger; | ||
18 | import org.eclipse.emf.ecore.EClass; | ||
19 | import org.eclipse.viatra.query.runtime.api.IPatternMatch; | ||
20 | import org.eclipse.viatra.query.runtime.api.IQuerySpecification; | ||
21 | import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; | ||
22 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
23 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; | ||
24 | import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; | ||
25 | import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; | ||
26 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
27 | import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey; | ||
28 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
29 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
30 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
31 | import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.PAnnotation; | ||
32 | import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.ParameterReference; | ||
33 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; | ||
34 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
35 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
36 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
37 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
38 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
39 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; | ||
40 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | ||
41 | import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; | ||
42 | |||
43 | /** | ||
44 | * A pattern-specific query specification that can instantiate Matcher in a type-safe way. | ||
45 | * | ||
46 | * <p>Original source: | ||
47 | * <code><pre> | ||
48 | * {@literal @}Constraint(message = "turnoutOutputsAreSame", severity = "error", key = { T }) | ||
49 | * pattern turnoutOutputsAreSame(T : Turnout) { | ||
50 | * Turnout.straight(T, S); | ||
51 | * Turnout.divergent(T, S); | ||
52 | * } | ||
53 | * </pre></code> | ||
54 | * | ||
55 | * @see Matcher | ||
56 | * @see Match | ||
57 | * | ||
58 | */ | ||
59 | @SuppressWarnings("all") | ||
60 | public final class TurnoutOutputsAreSame extends BaseGeneratedEMFQuerySpecification<TurnoutOutputsAreSame.Matcher> { | ||
61 | /** | ||
62 | * Pattern-specific match representation of the modes3.queries.turnoutOutputsAreSame pattern, | ||
63 | * to be used in conjunction with {@link Matcher}. | ||
64 | * | ||
65 | * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned. | ||
66 | * Each instance is a (possibly partial) substitution of pattern parameters, | ||
67 | * usable to represent a match of the pattern in the result of a query, | ||
68 | * or to specify the bound (fixed) input parameters when issuing a query. | ||
69 | * | ||
70 | * @see Matcher | ||
71 | * | ||
72 | */ | ||
73 | public static abstract class Match extends BasePatternMatch { | ||
74 | private Turnout fT; | ||
75 | |||
76 | private static List<String> parameterNames = makeImmutableList("T"); | ||
77 | |||
78 | private Match(final Turnout pT) { | ||
79 | this.fT = pT; | ||
80 | } | ||
81 | |||
82 | @Override | ||
83 | public Object get(final String parameterName) { | ||
84 | switch(parameterName) { | ||
85 | case "T": return this.fT; | ||
86 | default: return null; | ||
87 | } | ||
88 | } | ||
89 | |||
90 | @Override | ||
91 | public Object get(final int index) { | ||
92 | switch(index) { | ||
93 | case 0: return this.fT; | ||
94 | default: return null; | ||
95 | } | ||
96 | } | ||
97 | |||
98 | public Turnout getT() { | ||
99 | return this.fT; | ||
100 | } | ||
101 | |||
102 | @Override | ||
103 | public boolean set(final String parameterName, final Object newValue) { | ||
104 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
105 | if ("T".equals(parameterName) ) { | ||
106 | this.fT = (Turnout) newValue; | ||
107 | return true; | ||
108 | } | ||
109 | return false; | ||
110 | } | ||
111 | |||
112 | public void setT(final Turnout pT) { | ||
113 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
114 | this.fT = pT; | ||
115 | } | ||
116 | |||
117 | @Override | ||
118 | public String patternName() { | ||
119 | return "modes3.queries.turnoutOutputsAreSame"; | ||
120 | } | ||
121 | |||
122 | @Override | ||
123 | public List<String> parameterNames() { | ||
124 | return TurnoutOutputsAreSame.Match.parameterNames; | ||
125 | } | ||
126 | |||
127 | @Override | ||
128 | public Object[] toArray() { | ||
129 | return new Object[]{fT}; | ||
130 | } | ||
131 | |||
132 | @Override | ||
133 | public TurnoutOutputsAreSame.Match toImmutable() { | ||
134 | return isMutable() ? newMatch(fT) : this; | ||
135 | } | ||
136 | |||
137 | @Override | ||
138 | public String prettyPrint() { | ||
139 | StringBuilder result = new StringBuilder(); | ||
140 | result.append("\"T\"=" + prettyPrintValue(fT)); | ||
141 | return result.toString(); | ||
142 | } | ||
143 | |||
144 | @Override | ||
145 | public int hashCode() { | ||
146 | return Objects.hash(fT); | ||
147 | } | ||
148 | |||
149 | @Override | ||
150 | public boolean equals(final Object obj) { | ||
151 | if (this == obj) | ||
152 | return true; | ||
153 | if (obj == null) { | ||
154 | return false; | ||
155 | } | ||
156 | if ((obj instanceof TurnoutOutputsAreSame.Match)) { | ||
157 | TurnoutOutputsAreSame.Match other = (TurnoutOutputsAreSame.Match) obj; | ||
158 | return Objects.equals(fT, other.fT); | ||
159 | } else { | ||
160 | // this should be infrequent | ||
161 | if (!(obj instanceof IPatternMatch)) { | ||
162 | return false; | ||
163 | } | ||
164 | IPatternMatch otherSig = (IPatternMatch) obj; | ||
165 | return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray()); | ||
166 | } | ||
167 | } | ||
168 | |||
169 | @Override | ||
170 | public TurnoutOutputsAreSame specification() { | ||
171 | return TurnoutOutputsAreSame.instance(); | ||
172 | } | ||
173 | |||
174 | /** | ||
175 | * Returns an empty, mutable match. | ||
176 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
177 | * | ||
178 | * @return the empty match. | ||
179 | * | ||
180 | */ | ||
181 | public static TurnoutOutputsAreSame.Match newEmptyMatch() { | ||
182 | return new Mutable(null); | ||
183 | } | ||
184 | |||
185 | /** | ||
186 | * Returns a mutable (partial) match. | ||
187 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
188 | * | ||
189 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
190 | * @return the new, mutable (partial) match object. | ||
191 | * | ||
192 | */ | ||
193 | public static TurnoutOutputsAreSame.Match newMutableMatch(final Turnout pT) { | ||
194 | return new Mutable(pT); | ||
195 | } | ||
196 | |||
197 | /** | ||
198 | * Returns a new (partial) match. | ||
199 | * This can be used e.g. to call the matcher with a partial match. | ||
200 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
201 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
202 | * @return the (partial) match object. | ||
203 | * | ||
204 | */ | ||
205 | public static TurnoutOutputsAreSame.Match newMatch(final Turnout pT) { | ||
206 | return new Immutable(pT); | ||
207 | } | ||
208 | |||
209 | private static final class Mutable extends TurnoutOutputsAreSame.Match { | ||
210 | Mutable(final Turnout pT) { | ||
211 | super(pT); | ||
212 | } | ||
213 | |||
214 | @Override | ||
215 | public boolean isMutable() { | ||
216 | return true; | ||
217 | } | ||
218 | } | ||
219 | |||
220 | private static final class Immutable extends TurnoutOutputsAreSame.Match { | ||
221 | Immutable(final Turnout pT) { | ||
222 | super(pT); | ||
223 | } | ||
224 | |||
225 | @Override | ||
226 | public boolean isMutable() { | ||
227 | return false; | ||
228 | } | ||
229 | } | ||
230 | } | ||
231 | |||
232 | /** | ||
233 | * Generated pattern matcher API of the modes3.queries.turnoutOutputsAreSame pattern, | ||
234 | * providing pattern-specific query methods. | ||
235 | * | ||
236 | * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)}, | ||
237 | * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}. | ||
238 | * | ||
239 | * <p>Matches of the pattern will be represented as {@link Match}. | ||
240 | * | ||
241 | * <p>Original source: | ||
242 | * <code><pre> | ||
243 | * {@literal @}Constraint(message = "turnoutOutputsAreSame", severity = "error", key = { T }) | ||
244 | * pattern turnoutOutputsAreSame(T : Turnout) { | ||
245 | * Turnout.straight(T, S); | ||
246 | * Turnout.divergent(T, S); | ||
247 | * } | ||
248 | * </pre></code> | ||
249 | * | ||
250 | * @see Match | ||
251 | * @see TurnoutOutputsAreSame | ||
252 | * | ||
253 | */ | ||
254 | public static class Matcher extends BaseMatcher<TurnoutOutputsAreSame.Match> { | ||
255 | /** | ||
256 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
257 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
258 | * | ||
259 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
260 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
261 | * | ||
262 | */ | ||
263 | public static TurnoutOutputsAreSame.Matcher on(final ViatraQueryEngine engine) { | ||
264 | // check if matcher already exists | ||
265 | Matcher matcher = engine.getExistingMatcher(querySpecification()); | ||
266 | if (matcher == null) { | ||
267 | matcher = (Matcher)engine.getMatcher(querySpecification()); | ||
268 | } | ||
269 | return matcher; | ||
270 | } | ||
271 | |||
272 | /** | ||
273 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
274 | * @return an initialized matcher | ||
275 | * @noreference This method is for internal matcher initialization by the framework, do not call it manually. | ||
276 | * | ||
277 | */ | ||
278 | public static TurnoutOutputsAreSame.Matcher create() { | ||
279 | return new Matcher(); | ||
280 | } | ||
281 | |||
282 | private static final int POSITION_T = 0; | ||
283 | |||
284 | private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(TurnoutOutputsAreSame.Matcher.class); | ||
285 | |||
286 | /** | ||
287 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
288 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
289 | * | ||
290 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
291 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
292 | * | ||
293 | */ | ||
294 | private Matcher() { | ||
295 | super(querySpecification()); | ||
296 | } | ||
297 | |||
298 | /** | ||
299 | * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters. | ||
300 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
301 | * @return matches represented as a Match object. | ||
302 | * | ||
303 | */ | ||
304 | public Collection<TurnoutOutputsAreSame.Match> getAllMatches(final Turnout pT) { | ||
305 | return rawStreamAllMatches(new Object[]{pT}).collect(Collectors.toSet()); | ||
306 | } | ||
307 | |||
308 | /** | ||
309 | * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters. | ||
310 | * </p> | ||
311 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
312 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
313 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
314 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
315 | * @return a stream of matches represented as a Match object. | ||
316 | * | ||
317 | */ | ||
318 | public Stream<TurnoutOutputsAreSame.Match> streamAllMatches(final Turnout pT) { | ||
319 | return rawStreamAllMatches(new Object[]{pT}); | ||
320 | } | ||
321 | |||
322 | /** | ||
323 | * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
324 | * Neither determinism nor randomness of selection is guaranteed. | ||
325 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
326 | * @return a match represented as a Match object, or null if no match is found. | ||
327 | * | ||
328 | */ | ||
329 | public Optional<TurnoutOutputsAreSame.Match> getOneArbitraryMatch(final Turnout pT) { | ||
330 | return rawGetOneArbitraryMatch(new Object[]{pT}); | ||
331 | } | ||
332 | |||
333 | /** | ||
334 | * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match, | ||
335 | * under any possible substitution of the unspecified parameters (if any). | ||
336 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
337 | * @return true if the input is a valid (partial) match of the pattern. | ||
338 | * | ||
339 | */ | ||
340 | public boolean hasMatch(final Turnout pT) { | ||
341 | return rawHasMatch(new Object[]{pT}); | ||
342 | } | ||
343 | |||
344 | /** | ||
345 | * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. | ||
346 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
347 | * @return the number of pattern matches found. | ||
348 | * | ||
349 | */ | ||
350 | public int countMatches(final Turnout pT) { | ||
351 | return rawCountMatches(new Object[]{pT}); | ||
352 | } | ||
353 | |||
354 | /** | ||
355 | * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
356 | * Neither determinism nor randomness of selection is guaranteed. | ||
357 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
358 | * @param processor the action that will process the selected match. | ||
359 | * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked | ||
360 | * | ||
361 | */ | ||
362 | public boolean forOneArbitraryMatch(final Turnout pT, final Consumer<? super TurnoutOutputsAreSame.Match> processor) { | ||
363 | return rawForOneArbitraryMatch(new Object[]{pT}, processor); | ||
364 | } | ||
365 | |||
366 | /** | ||
367 | * Returns a new (partial) match. | ||
368 | * This can be used e.g. to call the matcher with a partial match. | ||
369 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
370 | * @param pT the fixed value of pattern parameter T, or null if not bound. | ||
371 | * @return the (partial) match object. | ||
372 | * | ||
373 | */ | ||
374 | public TurnoutOutputsAreSame.Match newMatch(final Turnout pT) { | ||
375 | return TurnoutOutputsAreSame.Match.newMatch(pT); | ||
376 | } | ||
377 | |||
378 | /** | ||
379 | * Retrieve the set of values that occur in matches for T. | ||
380 | * @return the Set of all values or empty set if there are no matches | ||
381 | * | ||
382 | */ | ||
383 | protected Stream<Turnout> rawStreamAllValuesOfT(final Object[] parameters) { | ||
384 | return rawStreamAllValues(POSITION_T, parameters).map(Turnout.class::cast); | ||
385 | } | ||
386 | |||
387 | /** | ||
388 | * Retrieve the set of values that occur in matches for T. | ||
389 | * @return the Set of all values or empty set if there are no matches | ||
390 | * | ||
391 | */ | ||
392 | public Set<Turnout> getAllValuesOfT() { | ||
393 | return rawStreamAllValuesOfT(emptyArray()).collect(Collectors.toSet()); | ||
394 | } | ||
395 | |||
396 | /** | ||
397 | * Retrieve the set of values that occur in matches for T. | ||
398 | * @return the Set of all values or empty set if there are no matches | ||
399 | * | ||
400 | */ | ||
401 | public Stream<Turnout> streamAllValuesOfT() { | ||
402 | return rawStreamAllValuesOfT(emptyArray()); | ||
403 | } | ||
404 | |||
405 | @Override | ||
406 | protected TurnoutOutputsAreSame.Match tupleToMatch(final Tuple t) { | ||
407 | try { | ||
408 | return TurnoutOutputsAreSame.Match.newMatch((Turnout) t.get(POSITION_T)); | ||
409 | } catch(ClassCastException e) { | ||
410 | LOGGER.error("Element(s) in tuple not properly typed!",e); | ||
411 | return null; | ||
412 | } | ||
413 | } | ||
414 | |||
415 | @Override | ||
416 | protected TurnoutOutputsAreSame.Match arrayToMatch(final Object[] match) { | ||
417 | try { | ||
418 | return TurnoutOutputsAreSame.Match.newMatch((Turnout) match[POSITION_T]); | ||
419 | } catch(ClassCastException e) { | ||
420 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
421 | return null; | ||
422 | } | ||
423 | } | ||
424 | |||
425 | @Override | ||
426 | protected TurnoutOutputsAreSame.Match arrayToMatchMutable(final Object[] match) { | ||
427 | try { | ||
428 | return TurnoutOutputsAreSame.Match.newMutableMatch((Turnout) match[POSITION_T]); | ||
429 | } catch(ClassCastException e) { | ||
430 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
431 | return null; | ||
432 | } | ||
433 | } | ||
434 | |||
435 | /** | ||
436 | * @return the singleton instance of the query specification of this pattern | ||
437 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
438 | * | ||
439 | */ | ||
440 | public static IQuerySpecification<TurnoutOutputsAreSame.Matcher> querySpecification() { | ||
441 | return TurnoutOutputsAreSame.instance(); | ||
442 | } | ||
443 | } | ||
444 | |||
445 | private TurnoutOutputsAreSame() { | ||
446 | super(GeneratedPQuery.INSTANCE); | ||
447 | } | ||
448 | |||
449 | /** | ||
450 | * @return the singleton instance of the query specification | ||
451 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
452 | * | ||
453 | */ | ||
454 | public static TurnoutOutputsAreSame instance() { | ||
455 | try{ | ||
456 | return LazyHolder.INSTANCE; | ||
457 | } catch (ExceptionInInitializerError err) { | ||
458 | throw processInitializerError(err); | ||
459 | } | ||
460 | } | ||
461 | |||
462 | @Override | ||
463 | protected TurnoutOutputsAreSame.Matcher instantiate(final ViatraQueryEngine engine) { | ||
464 | return TurnoutOutputsAreSame.Matcher.on(engine); | ||
465 | } | ||
466 | |||
467 | @Override | ||
468 | public TurnoutOutputsAreSame.Matcher instantiate() { | ||
469 | return TurnoutOutputsAreSame.Matcher.create(); | ||
470 | } | ||
471 | |||
472 | @Override | ||
473 | public TurnoutOutputsAreSame.Match newEmptyMatch() { | ||
474 | return TurnoutOutputsAreSame.Match.newEmptyMatch(); | ||
475 | } | ||
476 | |||
477 | @Override | ||
478 | public TurnoutOutputsAreSame.Match newMatch(final Object... parameters) { | ||
479 | return TurnoutOutputsAreSame.Match.newMatch((modes3.Turnout) parameters[0]); | ||
480 | } | ||
481 | |||
482 | /** | ||
483 | * Inner class allowing the singleton instance of {@link TurnoutOutputsAreSame} to be created | ||
484 | * <b>not</b> at the class load time of the outer class, | ||
485 | * but rather at the first call to {@link TurnoutOutputsAreSame#instance()}. | ||
486 | * | ||
487 | * <p> This workaround is required e.g. to support recursion. | ||
488 | * | ||
489 | */ | ||
490 | private static class LazyHolder { | ||
491 | private static final TurnoutOutputsAreSame INSTANCE = new TurnoutOutputsAreSame(); | ||
492 | |||
493 | /** | ||
494 | * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned. | ||
495 | * This initialization order is required to support indirect recursion. | ||
496 | * | ||
497 | * <p> The static initializer is defined using a helper field to work around limitations of the code generator. | ||
498 | * | ||
499 | */ | ||
500 | private static final Object STATIC_INITIALIZER = ensureInitialized(); | ||
501 | |||
502 | public static Object ensureInitialized() { | ||
503 | INSTANCE.ensureInitializedInternal(); | ||
504 | return null; | ||
505 | } | ||
506 | } | ||
507 | |||
508 | private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { | ||
509 | private static final TurnoutOutputsAreSame.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
510 | |||
511 | private final PParameter parameter_T = new PParameter("T", "modes3.Turnout", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.ece.mcgill.ca/wcet/modes3", "Turnout")), PParameterDirection.INOUT); | ||
512 | |||
513 | private final List<PParameter> parameters = Arrays.asList(parameter_T); | ||
514 | |||
515 | private GeneratedPQuery() { | ||
516 | super(PVisibility.PUBLIC); | ||
517 | } | ||
518 | |||
519 | @Override | ||
520 | public String getFullyQualifiedName() { | ||
521 | return "modes3.queries.turnoutOutputsAreSame"; | ||
522 | } | ||
523 | |||
524 | @Override | ||
525 | public List<String> getParameterNames() { | ||
526 | return Arrays.asList("T"); | ||
527 | } | ||
528 | |||
529 | @Override | ||
530 | public List<PParameter> getParameters() { | ||
531 | return parameters; | ||
532 | } | ||
533 | |||
534 | @Override | ||
535 | public Set<PBody> doGetContainedBodies() { | ||
536 | setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); | ||
537 | Set<PBody> bodies = new LinkedHashSet<>(); | ||
538 | { | ||
539 | PBody body = new PBody(this); | ||
540 | PVariable var_T = body.getOrCreateVariableByName("T"); | ||
541 | PVariable var_S = body.getOrCreateVariableByName("S"); | ||
542 | new TypeConstraint(body, Tuples.flatTupleOf(var_T), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Turnout"))); | ||
543 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
544 | new ExportedParameter(body, var_T, parameter_T) | ||
545 | )); | ||
546 | // Turnout.straight(T, S) | ||
547 | new TypeConstraint(body, Tuples.flatTupleOf(var_T), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Turnout"))); | ||
548 | PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); | ||
549 | new TypeConstraint(body, Tuples.flatTupleOf(var_T, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Turnout", "straight"))); | ||
550 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Segment"))); | ||
551 | new Equality(body, var__virtual_0_, var_S); | ||
552 | // Turnout.divergent(T, S) | ||
553 | new TypeConstraint(body, Tuples.flatTupleOf(var_T), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Turnout"))); | ||
554 | PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}"); | ||
555 | new TypeConstraint(body, Tuples.flatTupleOf(var_T, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Turnout", "divergent"))); | ||
556 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Segment"))); | ||
557 | new Equality(body, var__virtual_1_, var_S); | ||
558 | bodies.add(body); | ||
559 | } | ||
560 | { | ||
561 | PAnnotation annotation = new PAnnotation("Constraint"); | ||
562 | annotation.addAttribute("message", "turnoutOutputsAreSame"); | ||
563 | annotation.addAttribute("severity", "error"); | ||
564 | annotation.addAttribute("key", Arrays.asList(new Object[] { | ||
565 | new ParameterReference("T") | ||
566 | })); | ||
567 | addAnnotation(annotation); | ||
568 | } | ||
569 | return bodies; | ||
570 | } | ||
571 | } | ||
572 | } | ||
diff --git a/Domains/ca.mcgill.rtgmrt.example.modes3/vql-gen/modes3/queries/Unreachable.java b/Domains/ca.mcgill.rtgmrt.example.modes3/vql-gen/modes3/queries/Unreachable.java new file mode 100644 index 00000000..a1b76f83 --- /dev/null +++ b/Domains/ca.mcgill.rtgmrt.example.modes3/vql-gen/modes3/queries/Unreachable.java | |||
@@ -0,0 +1,714 @@ | |||
1 | /** | ||
2 | * Generated from platform:/resource/ca.mcgill.rtgmrt.example.modes3/src/modes3/queries/Modes3Queries.vql | ||
3 | */ | ||
4 | package modes3.queries; | ||
5 | |||
6 | import java.util.Arrays; | ||
7 | import java.util.Collection; | ||
8 | import java.util.LinkedHashSet; | ||
9 | import java.util.List; | ||
10 | import java.util.Objects; | ||
11 | import java.util.Optional; | ||
12 | import java.util.Set; | ||
13 | import java.util.function.Consumer; | ||
14 | import java.util.stream.Collectors; | ||
15 | import java.util.stream.Stream; | ||
16 | import modes3.Segment; | ||
17 | import modes3.queries.Reachable; | ||
18 | import org.apache.log4j.Logger; | ||
19 | import org.eclipse.emf.ecore.EClass; | ||
20 | import org.eclipse.viatra.query.runtime.api.IPatternMatch; | ||
21 | import org.eclipse.viatra.query.runtime.api.IQuerySpecification; | ||
22 | import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; | ||
23 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
24 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; | ||
25 | import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; | ||
26 | import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; | ||
27 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
28 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
29 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
30 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
31 | import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.PAnnotation; | ||
32 | import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.ParameterReference; | ||
33 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
34 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.NegativePatternCall; | ||
35 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
36 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
37 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
38 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
39 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; | ||
40 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | ||
41 | import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; | ||
42 | |||
43 | /** | ||
44 | * A pattern-specific query specification that can instantiate Matcher in a type-safe way. | ||
45 | * | ||
46 | * <p>Original source: | ||
47 | * <code><pre> | ||
48 | * {@literal @}Constraint(message = "unreachable", severity = "error", key = { S1, S2 }) | ||
49 | * pattern unreachable(S1 : Segment, S2 : Segment) { | ||
50 | * neg find reachable(S1, S2); | ||
51 | * } | ||
52 | * </pre></code> | ||
53 | * | ||
54 | * @see Matcher | ||
55 | * @see Match | ||
56 | * | ||
57 | */ | ||
58 | @SuppressWarnings("all") | ||
59 | public final class Unreachable extends BaseGeneratedEMFQuerySpecification<Unreachable.Matcher> { | ||
60 | /** | ||
61 | * Pattern-specific match representation of the modes3.queries.unreachable 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 Segment fS1; | ||
74 | |||
75 | private Segment fS2; | ||
76 | |||
77 | private static List<String> parameterNames = makeImmutableList("S1", "S2"); | ||
78 | |||
79 | private Match(final Segment pS1, final Segment pS2) { | ||
80 | this.fS1 = pS1; | ||
81 | this.fS2 = pS2; | ||
82 | } | ||
83 | |||
84 | @Override | ||
85 | public Object get(final String parameterName) { | ||
86 | switch(parameterName) { | ||
87 | case "S1": return this.fS1; | ||
88 | case "S2": return this.fS2; | ||
89 | default: return null; | ||
90 | } | ||
91 | } | ||
92 | |||
93 | @Override | ||
94 | public Object get(final int index) { | ||
95 | switch(index) { | ||
96 | case 0: return this.fS1; | ||
97 | case 1: return this.fS2; | ||
98 | default: return null; | ||
99 | } | ||
100 | } | ||
101 | |||
102 | public Segment getS1() { | ||
103 | return this.fS1; | ||
104 | } | ||
105 | |||
106 | public Segment getS2() { | ||
107 | return this.fS2; | ||
108 | } | ||
109 | |||
110 | @Override | ||
111 | public boolean set(final String parameterName, final Object newValue) { | ||
112 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
113 | if ("S1".equals(parameterName) ) { | ||
114 | this.fS1 = (Segment) newValue; | ||
115 | return true; | ||
116 | } | ||
117 | if ("S2".equals(parameterName) ) { | ||
118 | this.fS2 = (Segment) newValue; | ||
119 | return true; | ||
120 | } | ||
121 | return false; | ||
122 | } | ||
123 | |||
124 | public void setS1(final Segment pS1) { | ||
125 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
126 | this.fS1 = pS1; | ||
127 | } | ||
128 | |||
129 | public void setS2(final Segment pS2) { | ||
130 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
131 | this.fS2 = pS2; | ||
132 | } | ||
133 | |||
134 | @Override | ||
135 | public String patternName() { | ||
136 | return "modes3.queries.unreachable"; | ||
137 | } | ||
138 | |||
139 | @Override | ||
140 | public List<String> parameterNames() { | ||
141 | return Unreachable.Match.parameterNames; | ||
142 | } | ||
143 | |||
144 | @Override | ||
145 | public Object[] toArray() { | ||
146 | return new Object[]{fS1, fS2}; | ||
147 | } | ||
148 | |||
149 | @Override | ||
150 | public Unreachable.Match toImmutable() { | ||
151 | return isMutable() ? newMatch(fS1, fS2) : this; | ||
152 | } | ||
153 | |||
154 | @Override | ||
155 | public String prettyPrint() { | ||
156 | StringBuilder result = new StringBuilder(); | ||
157 | result.append("\"S1\"=" + prettyPrintValue(fS1) + ", "); | ||
158 | result.append("\"S2\"=" + prettyPrintValue(fS2)); | ||
159 | return result.toString(); | ||
160 | } | ||
161 | |||
162 | @Override | ||
163 | public int hashCode() { | ||
164 | return Objects.hash(fS1, fS2); | ||
165 | } | ||
166 | |||
167 | @Override | ||
168 | public boolean equals(final Object obj) { | ||
169 | if (this == obj) | ||
170 | return true; | ||
171 | if (obj == null) { | ||
172 | return false; | ||
173 | } | ||
174 | if ((obj instanceof Unreachable.Match)) { | ||
175 | Unreachable.Match other = (Unreachable.Match) obj; | ||
176 | return Objects.equals(fS1, other.fS1) && Objects.equals(fS2, other.fS2); | ||
177 | } else { | ||
178 | // this should be infrequent | ||
179 | if (!(obj instanceof IPatternMatch)) { | ||
180 | return false; | ||
181 | } | ||
182 | IPatternMatch otherSig = (IPatternMatch) obj; | ||
183 | return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray()); | ||
184 | } | ||
185 | } | ||
186 | |||
187 | @Override | ||
188 | public Unreachable specification() { | ||
189 | return Unreachable.instance(); | ||
190 | } | ||
191 | |||
192 | /** | ||
193 | * Returns an empty, mutable match. | ||
194 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
195 | * | ||
196 | * @return the empty match. | ||
197 | * | ||
198 | */ | ||
199 | public static Unreachable.Match newEmptyMatch() { | ||
200 | return new Mutable(null, null); | ||
201 | } | ||
202 | |||
203 | /** | ||
204 | * Returns a mutable (partial) match. | ||
205 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
206 | * | ||
207 | * @param pS1 the fixed value of pattern parameter S1, or null if not bound. | ||
208 | * @param pS2 the fixed value of pattern parameter S2, or null if not bound. | ||
209 | * @return the new, mutable (partial) match object. | ||
210 | * | ||
211 | */ | ||
212 | public static Unreachable.Match newMutableMatch(final Segment pS1, final Segment pS2) { | ||
213 | return new Mutable(pS1, pS2); | ||
214 | } | ||
215 | |||
216 | /** | ||
217 | * Returns a new (partial) match. | ||
218 | * This can be used e.g. to call the matcher with a partial match. | ||
219 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
220 | * @param pS1 the fixed value of pattern parameter S1, or null if not bound. | ||
221 | * @param pS2 the fixed value of pattern parameter S2, or null if not bound. | ||
222 | * @return the (partial) match object. | ||
223 | * | ||
224 | */ | ||
225 | public static Unreachable.Match newMatch(final Segment pS1, final Segment pS2) { | ||
226 | return new Immutable(pS1, pS2); | ||
227 | } | ||
228 | |||
229 | private static final class Mutable extends Unreachable.Match { | ||
230 | Mutable(final Segment pS1, final Segment pS2) { | ||
231 | super(pS1, pS2); | ||
232 | } | ||
233 | |||
234 | @Override | ||
235 | public boolean isMutable() { | ||
236 | return true; | ||
237 | } | ||
238 | } | ||
239 | |||
240 | private static final class Immutable extends Unreachable.Match { | ||
241 | Immutable(final Segment pS1, final Segment pS2) { | ||
242 | super(pS1, pS2); | ||
243 | } | ||
244 | |||
245 | @Override | ||
246 | public boolean isMutable() { | ||
247 | return false; | ||
248 | } | ||
249 | } | ||
250 | } | ||
251 | |||
252 | /** | ||
253 | * Generated pattern matcher API of the modes3.queries.unreachable pattern, | ||
254 | * providing pattern-specific query methods. | ||
255 | * | ||
256 | * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)}, | ||
257 | * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}. | ||
258 | * | ||
259 | * <p>Matches of the pattern will be represented as {@link Match}. | ||
260 | * | ||
261 | * <p>Original source: | ||
262 | * <code><pre> | ||
263 | * {@literal @}Constraint(message = "unreachable", severity = "error", key = { S1, S2 }) | ||
264 | * pattern unreachable(S1 : Segment, S2 : Segment) { | ||
265 | * neg find reachable(S1, S2); | ||
266 | * } | ||
267 | * </pre></code> | ||
268 | * | ||
269 | * @see Match | ||
270 | * @see Unreachable | ||
271 | * | ||
272 | */ | ||
273 | public static class Matcher extends BaseMatcher<Unreachable.Match> { | ||
274 | /** | ||
275 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
276 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
277 | * | ||
278 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
279 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
280 | * | ||
281 | */ | ||
282 | public static Unreachable.Matcher on(final ViatraQueryEngine engine) { | ||
283 | // check if matcher already exists | ||
284 | Matcher matcher = engine.getExistingMatcher(querySpecification()); | ||
285 | if (matcher == null) { | ||
286 | matcher = (Matcher)engine.getMatcher(querySpecification()); | ||
287 | } | ||
288 | return matcher; | ||
289 | } | ||
290 | |||
291 | /** | ||
292 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
293 | * @return an initialized matcher | ||
294 | * @noreference This method is for internal matcher initialization by the framework, do not call it manually. | ||
295 | * | ||
296 | */ | ||
297 | public static Unreachable.Matcher create() { | ||
298 | return new Matcher(); | ||
299 | } | ||
300 | |||
301 | private static final int POSITION_S1 = 0; | ||
302 | |||
303 | private static final int POSITION_S2 = 1; | ||
304 | |||
305 | private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(Unreachable.Matcher.class); | ||
306 | |||
307 | /** | ||
308 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
309 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
310 | * | ||
311 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
312 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
313 | * | ||
314 | */ | ||
315 | private Matcher() { | ||
316 | super(querySpecification()); | ||
317 | } | ||
318 | |||
319 | /** | ||
320 | * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters. | ||
321 | * @param pS1 the fixed value of pattern parameter S1, or null if not bound. | ||
322 | * @param pS2 the fixed value of pattern parameter S2, or null if not bound. | ||
323 | * @return matches represented as a Match object. | ||
324 | * | ||
325 | */ | ||
326 | public Collection<Unreachable.Match> getAllMatches(final Segment pS1, final Segment pS2) { | ||
327 | return rawStreamAllMatches(new Object[]{pS1, pS2}).collect(Collectors.toSet()); | ||
328 | } | ||
329 | |||
330 | /** | ||
331 | * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters. | ||
332 | * </p> | ||
333 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
334 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
335 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
336 | * @param pS1 the fixed value of pattern parameter S1, or null if not bound. | ||
337 | * @param pS2 the fixed value of pattern parameter S2, or null if not bound. | ||
338 | * @return a stream of matches represented as a Match object. | ||
339 | * | ||
340 | */ | ||
341 | public Stream<Unreachable.Match> streamAllMatches(final Segment pS1, final Segment pS2) { | ||
342 | return rawStreamAllMatches(new Object[]{pS1, pS2}); | ||
343 | } | ||
344 | |||
345 | /** | ||
346 | * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
347 | * Neither determinism nor randomness of selection is guaranteed. | ||
348 | * @param pS1 the fixed value of pattern parameter S1, or null if not bound. | ||
349 | * @param pS2 the fixed value of pattern parameter S2, or null if not bound. | ||
350 | * @return a match represented as a Match object, or null if no match is found. | ||
351 | * | ||
352 | */ | ||
353 | public Optional<Unreachable.Match> getOneArbitraryMatch(final Segment pS1, final Segment pS2) { | ||
354 | return rawGetOneArbitraryMatch(new Object[]{pS1, pS2}); | ||
355 | } | ||
356 | |||
357 | /** | ||
358 | * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match, | ||
359 | * under any possible substitution of the unspecified parameters (if any). | ||
360 | * @param pS1 the fixed value of pattern parameter S1, or null if not bound. | ||
361 | * @param pS2 the fixed value of pattern parameter S2, or null if not bound. | ||
362 | * @return true if the input is a valid (partial) match of the pattern. | ||
363 | * | ||
364 | */ | ||
365 | public boolean hasMatch(final Segment pS1, final Segment pS2) { | ||
366 | return rawHasMatch(new Object[]{pS1, pS2}); | ||
367 | } | ||
368 | |||
369 | /** | ||
370 | * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. | ||
371 | * @param pS1 the fixed value of pattern parameter S1, or null if not bound. | ||
372 | * @param pS2 the fixed value of pattern parameter S2, or null if not bound. | ||
373 | * @return the number of pattern matches found. | ||
374 | * | ||
375 | */ | ||
376 | public int countMatches(final Segment pS1, final Segment pS2) { | ||
377 | return rawCountMatches(new Object[]{pS1, pS2}); | ||
378 | } | ||
379 | |||
380 | /** | ||
381 | * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
382 | * Neither determinism nor randomness of selection is guaranteed. | ||
383 | * @param pS1 the fixed value of pattern parameter S1, or null if not bound. | ||
384 | * @param pS2 the fixed value of pattern parameter S2, or null if not bound. | ||
385 | * @param processor the action that will process the selected match. | ||
386 | * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked | ||
387 | * | ||
388 | */ | ||
389 | public boolean forOneArbitraryMatch(final Segment pS1, final Segment pS2, final Consumer<? super Unreachable.Match> processor) { | ||
390 | return rawForOneArbitraryMatch(new Object[]{pS1, pS2}, processor); | ||
391 | } | ||
392 | |||
393 | /** | ||
394 | * Returns a new (partial) match. | ||
395 | * This can be used e.g. to call the matcher with a partial match. | ||
396 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
397 | * @param pS1 the fixed value of pattern parameter S1, or null if not bound. | ||
398 | * @param pS2 the fixed value of pattern parameter S2, or null if not bound. | ||
399 | * @return the (partial) match object. | ||
400 | * | ||
401 | */ | ||
402 | public Unreachable.Match newMatch(final Segment pS1, final Segment pS2) { | ||
403 | return Unreachable.Match.newMatch(pS1, pS2); | ||
404 | } | ||
405 | |||
406 | /** | ||
407 | * Retrieve the set of values that occur in matches for S1. | ||
408 | * @return the Set of all values or empty set if there are no matches | ||
409 | * | ||
410 | */ | ||
411 | protected Stream<Segment> rawStreamAllValuesOfS1(final Object[] parameters) { | ||
412 | return rawStreamAllValues(POSITION_S1, parameters).map(Segment.class::cast); | ||
413 | } | ||
414 | |||
415 | /** | ||
416 | * Retrieve the set of values that occur in matches for S1. | ||
417 | * @return the Set of all values or empty set if there are no matches | ||
418 | * | ||
419 | */ | ||
420 | public Set<Segment> getAllValuesOfS1() { | ||
421 | return rawStreamAllValuesOfS1(emptyArray()).collect(Collectors.toSet()); | ||
422 | } | ||
423 | |||
424 | /** | ||
425 | * Retrieve the set of values that occur in matches for S1. | ||
426 | * @return the Set of all values or empty set if there are no matches | ||
427 | * | ||
428 | */ | ||
429 | public Stream<Segment> streamAllValuesOfS1() { | ||
430 | return rawStreamAllValuesOfS1(emptyArray()); | ||
431 | } | ||
432 | |||
433 | /** | ||
434 | * Retrieve the set of values that occur in matches for S1. | ||
435 | * </p> | ||
436 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
437 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
438 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
439 | * | ||
440 | * @return the Stream of all values or empty set if there are no matches | ||
441 | * | ||
442 | */ | ||
443 | public Stream<Segment> streamAllValuesOfS1(final Unreachable.Match partialMatch) { | ||
444 | return rawStreamAllValuesOfS1(partialMatch.toArray()); | ||
445 | } | ||
446 | |||
447 | /** | ||
448 | * Retrieve the set of values that occur in matches for S1. | ||
449 | * </p> | ||
450 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
451 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
452 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
453 | * | ||
454 | * @return the Stream of all values or empty set if there are no matches | ||
455 | * | ||
456 | */ | ||
457 | public Stream<Segment> streamAllValuesOfS1(final Segment pS2) { | ||
458 | return rawStreamAllValuesOfS1(new Object[]{null, pS2}); | ||
459 | } | ||
460 | |||
461 | /** | ||
462 | * Retrieve the set of values that occur in matches for S1. | ||
463 | * @return the Set of all values or empty set if there are no matches | ||
464 | * | ||
465 | */ | ||
466 | public Set<Segment> getAllValuesOfS1(final Unreachable.Match partialMatch) { | ||
467 | return rawStreamAllValuesOfS1(partialMatch.toArray()).collect(Collectors.toSet()); | ||
468 | } | ||
469 | |||
470 | /** | ||
471 | * Retrieve the set of values that occur in matches for S1. | ||
472 | * @return the Set of all values or empty set if there are no matches | ||
473 | * | ||
474 | */ | ||
475 | public Set<Segment> getAllValuesOfS1(final Segment pS2) { | ||
476 | return rawStreamAllValuesOfS1(new Object[]{null, pS2}).collect(Collectors.toSet()); | ||
477 | } | ||
478 | |||
479 | /** | ||
480 | * Retrieve the set of values that occur in matches for S2. | ||
481 | * @return the Set of all values or empty set if there are no matches | ||
482 | * | ||
483 | */ | ||
484 | protected Stream<Segment> rawStreamAllValuesOfS2(final Object[] parameters) { | ||
485 | return rawStreamAllValues(POSITION_S2, parameters).map(Segment.class::cast); | ||
486 | } | ||
487 | |||
488 | /** | ||
489 | * Retrieve the set of values that occur in matches for S2. | ||
490 | * @return the Set of all values or empty set if there are no matches | ||
491 | * | ||
492 | */ | ||
493 | public Set<Segment> getAllValuesOfS2() { | ||
494 | return rawStreamAllValuesOfS2(emptyArray()).collect(Collectors.toSet()); | ||
495 | } | ||
496 | |||
497 | /** | ||
498 | * Retrieve the set of values that occur in matches for S2. | ||
499 | * @return the Set of all values or empty set if there are no matches | ||
500 | * | ||
501 | */ | ||
502 | public Stream<Segment> streamAllValuesOfS2() { | ||
503 | return rawStreamAllValuesOfS2(emptyArray()); | ||
504 | } | ||
505 | |||
506 | /** | ||
507 | * Retrieve the set of values that occur in matches for S2. | ||
508 | * </p> | ||
509 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
510 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
511 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
512 | * | ||
513 | * @return the Stream of all values or empty set if there are no matches | ||
514 | * | ||
515 | */ | ||
516 | public Stream<Segment> streamAllValuesOfS2(final Unreachable.Match partialMatch) { | ||
517 | return rawStreamAllValuesOfS2(partialMatch.toArray()); | ||
518 | } | ||
519 | |||
520 | /** | ||
521 | * Retrieve the set of values that occur in matches for S2. | ||
522 | * </p> | ||
523 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
524 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
525 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
526 | * | ||
527 | * @return the Stream of all values or empty set if there are no matches | ||
528 | * | ||
529 | */ | ||
530 | public Stream<Segment> streamAllValuesOfS2(final Segment pS1) { | ||
531 | return rawStreamAllValuesOfS2(new Object[]{pS1, null}); | ||
532 | } | ||
533 | |||
534 | /** | ||
535 | * Retrieve the set of values that occur in matches for S2. | ||
536 | * @return the Set of all values or empty set if there are no matches | ||
537 | * | ||
538 | */ | ||
539 | public Set<Segment> getAllValuesOfS2(final Unreachable.Match partialMatch) { | ||
540 | return rawStreamAllValuesOfS2(partialMatch.toArray()).collect(Collectors.toSet()); | ||
541 | } | ||
542 | |||
543 | /** | ||
544 | * Retrieve the set of values that occur in matches for S2. | ||
545 | * @return the Set of all values or empty set if there are no matches | ||
546 | * | ||
547 | */ | ||
548 | public Set<Segment> getAllValuesOfS2(final Segment pS1) { | ||
549 | return rawStreamAllValuesOfS2(new Object[]{pS1, null}).collect(Collectors.toSet()); | ||
550 | } | ||
551 | |||
552 | @Override | ||
553 | protected Unreachable.Match tupleToMatch(final Tuple t) { | ||
554 | try { | ||
555 | return Unreachable.Match.newMatch((Segment) t.get(POSITION_S1), (Segment) t.get(POSITION_S2)); | ||
556 | } catch(ClassCastException e) { | ||
557 | LOGGER.error("Element(s) in tuple not properly typed!",e); | ||
558 | return null; | ||
559 | } | ||
560 | } | ||
561 | |||
562 | @Override | ||
563 | protected Unreachable.Match arrayToMatch(final Object[] match) { | ||
564 | try { | ||
565 | return Unreachable.Match.newMatch((Segment) match[POSITION_S1], (Segment) match[POSITION_S2]); | ||
566 | } catch(ClassCastException e) { | ||
567 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
568 | return null; | ||
569 | } | ||
570 | } | ||
571 | |||
572 | @Override | ||
573 | protected Unreachable.Match arrayToMatchMutable(final Object[] match) { | ||
574 | try { | ||
575 | return Unreachable.Match.newMutableMatch((Segment) match[POSITION_S1], (Segment) match[POSITION_S2]); | ||
576 | } catch(ClassCastException e) { | ||
577 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
578 | return null; | ||
579 | } | ||
580 | } | ||
581 | |||
582 | /** | ||
583 | * @return the singleton instance of the query specification of this pattern | ||
584 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
585 | * | ||
586 | */ | ||
587 | public static IQuerySpecification<Unreachable.Matcher> querySpecification() { | ||
588 | return Unreachable.instance(); | ||
589 | } | ||
590 | } | ||
591 | |||
592 | private Unreachable() { | ||
593 | super(GeneratedPQuery.INSTANCE); | ||
594 | } | ||
595 | |||
596 | /** | ||
597 | * @return the singleton instance of the query specification | ||
598 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
599 | * | ||
600 | */ | ||
601 | public static Unreachable instance() { | ||
602 | try{ | ||
603 | return LazyHolder.INSTANCE; | ||
604 | } catch (ExceptionInInitializerError err) { | ||
605 | throw processInitializerError(err); | ||
606 | } | ||
607 | } | ||
608 | |||
609 | @Override | ||
610 | protected Unreachable.Matcher instantiate(final ViatraQueryEngine engine) { | ||
611 | return Unreachable.Matcher.on(engine); | ||
612 | } | ||
613 | |||
614 | @Override | ||
615 | public Unreachable.Matcher instantiate() { | ||
616 | return Unreachable.Matcher.create(); | ||
617 | } | ||
618 | |||
619 | @Override | ||
620 | public Unreachable.Match newEmptyMatch() { | ||
621 | return Unreachable.Match.newEmptyMatch(); | ||
622 | } | ||
623 | |||
624 | @Override | ||
625 | public Unreachable.Match newMatch(final Object... parameters) { | ||
626 | return Unreachable.Match.newMatch((modes3.Segment) parameters[0], (modes3.Segment) parameters[1]); | ||
627 | } | ||
628 | |||
629 | /** | ||
630 | * Inner class allowing the singleton instance of {@link Unreachable} to be created | ||
631 | * <b>not</b> at the class load time of the outer class, | ||
632 | * but rather at the first call to {@link Unreachable#instance()}. | ||
633 | * | ||
634 | * <p> This workaround is required e.g. to support recursion. | ||
635 | * | ||
636 | */ | ||
637 | private static class LazyHolder { | ||
638 | private static final Unreachable INSTANCE = new Unreachable(); | ||
639 | |||
640 | /** | ||
641 | * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned. | ||
642 | * This initialization order is required to support indirect recursion. | ||
643 | * | ||
644 | * <p> The static initializer is defined using a helper field to work around limitations of the code generator. | ||
645 | * | ||
646 | */ | ||
647 | private static final Object STATIC_INITIALIZER = ensureInitialized(); | ||
648 | |||
649 | public static Object ensureInitialized() { | ||
650 | INSTANCE.ensureInitializedInternal(); | ||
651 | return null; | ||
652 | } | ||
653 | } | ||
654 | |||
655 | private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { | ||
656 | private static final Unreachable.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
657 | |||
658 | private final PParameter parameter_S1 = new PParameter("S1", "modes3.Segment", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.ece.mcgill.ca/wcet/modes3", "Segment")), PParameterDirection.INOUT); | ||
659 | |||
660 | private final PParameter parameter_S2 = new PParameter("S2", "modes3.Segment", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.ece.mcgill.ca/wcet/modes3", "Segment")), PParameterDirection.INOUT); | ||
661 | |||
662 | private final List<PParameter> parameters = Arrays.asList(parameter_S1, parameter_S2); | ||
663 | |||
664 | private GeneratedPQuery() { | ||
665 | super(PVisibility.PUBLIC); | ||
666 | } | ||
667 | |||
668 | @Override | ||
669 | public String getFullyQualifiedName() { | ||
670 | return "modes3.queries.unreachable"; | ||
671 | } | ||
672 | |||
673 | @Override | ||
674 | public List<String> getParameterNames() { | ||
675 | return Arrays.asList("S1","S2"); | ||
676 | } | ||
677 | |||
678 | @Override | ||
679 | public List<PParameter> getParameters() { | ||
680 | return parameters; | ||
681 | } | ||
682 | |||
683 | @Override | ||
684 | public Set<PBody> doGetContainedBodies() { | ||
685 | setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); | ||
686 | Set<PBody> bodies = new LinkedHashSet<>(); | ||
687 | { | ||
688 | PBody body = new PBody(this); | ||
689 | PVariable var_S1 = body.getOrCreateVariableByName("S1"); | ||
690 | PVariable var_S2 = body.getOrCreateVariableByName("S2"); | ||
691 | new TypeConstraint(body, Tuples.flatTupleOf(var_S1), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Segment"))); | ||
692 | new TypeConstraint(body, Tuples.flatTupleOf(var_S2), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.ece.mcgill.ca/wcet/modes3", "Segment"))); | ||
693 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
694 | new ExportedParameter(body, var_S1, parameter_S1), | ||
695 | new ExportedParameter(body, var_S2, parameter_S2) | ||
696 | )); | ||
697 | // neg find reachable(S1, S2) | ||
698 | new NegativePatternCall(body, Tuples.flatTupleOf(var_S1, var_S2), Reachable.instance().getInternalQueryRepresentation()); | ||
699 | bodies.add(body); | ||
700 | } | ||
701 | { | ||
702 | PAnnotation annotation = new PAnnotation("Constraint"); | ||
703 | annotation.addAttribute("message", "unreachable"); | ||
704 | annotation.addAttribute("severity", "error"); | ||
705 | annotation.addAttribute("key", Arrays.asList(new Object[] { | ||
706 | new ParameterReference("S1"), | ||
707 | new ParameterReference("S2") | ||
708 | })); | ||
709 | addAnnotation(annotation); | ||
710 | } | ||
711 | return bodies; | ||
712 | } | ||
713 | } | ||
714 | } | ||
diff --git a/Domains/ca.mcgill.rtgmrt.example.modes3/xtend-gen/modes3/run/.Modes3ModelGenerator.xtendbin b/Domains/ca.mcgill.rtgmrt.example.modes3/xtend-gen/modes3/run/.Modes3ModelGenerator.xtendbin new file mode 100644 index 00000000..4f542a67 --- /dev/null +++ b/Domains/ca.mcgill.rtgmrt.example.modes3/xtend-gen/modes3/run/.Modes3ModelGenerator.xtendbin | |||
Binary files differ | |||
diff --git a/Domains/ca.mcgill.rtgmrt.example.modes3/xtend-gen/modes3/run/.Modes3UnitPropagationGenerator.xtendbin b/Domains/ca.mcgill.rtgmrt.example.modes3/xtend-gen/modes3/run/.Modes3UnitPropagationGenerator.xtendbin new file mode 100644 index 00000000..28e763b9 --- /dev/null +++ b/Domains/ca.mcgill.rtgmrt.example.modes3/xtend-gen/modes3/run/.Modes3UnitPropagationGenerator.xtendbin | |||
Binary files differ | |||
diff --git a/Domains/ca.mcgill.rtgmrt.example.modes3/xtend-gen/modes3/run/.gitignore b/Domains/ca.mcgill.rtgmrt.example.modes3/xtend-gen/modes3/run/.gitignore new file mode 100644 index 00000000..53dcf60f --- /dev/null +++ b/Domains/ca.mcgill.rtgmrt.example.modes3/xtend-gen/modes3/run/.gitignore | |||
@@ -0,0 +1,2 @@ | |||
1 | /.Modes3ModelGenerator.java._trace | ||
2 | /.Modes3UnitPropagationGenerator.java._trace | ||
diff --git a/Domains/ca.mcgill.rtgmrt.example.modes3/xtend-gen/modes3/run/Modes3ModelGenerator.java b/Domains/ca.mcgill.rtgmrt.example.modes3/xtend-gen/modes3/run/Modes3ModelGenerator.java new file mode 100644 index 00000000..c7364257 --- /dev/null +++ b/Domains/ca.mcgill.rtgmrt.example.modes3/xtend-gen/modes3/run/Modes3ModelGenerator.java | |||
@@ -0,0 +1,381 @@ | |||
1 | package modes3.run; | ||
2 | |||
3 | import com.google.common.base.Objects; | ||
4 | import com.google.common.collect.ImmutableList; | ||
5 | import com.google.common.collect.ImmutableSet; | ||
6 | import com.google.common.collect.Iterables; | ||
7 | import hu.bme.mit.inf.dslreasoner.ecore2logic.EReferenceMapper_RelationsOverTypes_Trace; | ||
8 | import hu.bme.mit.inf.dslreasoner.ecore2logic.Ecore2Logic; | ||
9 | import hu.bme.mit.inf.dslreasoner.ecore2logic.Ecore2LogicConfiguration; | ||
10 | import hu.bme.mit.inf.dslreasoner.ecore2logic.Ecore2Logic_Trace; | ||
11 | import hu.bme.mit.inf.dslreasoner.ecore2logic.EcoreMetamodelDescriptor; | ||
12 | import hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.Ecore2logicannotationsFactory; | ||
13 | import hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.Ecore2logicannotationsPackage; | ||
14 | import hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.InverseRelationAssertion; | ||
15 | import hu.bme.mit.inf.dslreasoner.logic.model.builder.LogicProblemBuilder; | ||
16 | import hu.bme.mit.inf.dslreasoner.logic.model.builder.TracedOutput; | ||
17 | import hu.bme.mit.inf.dslreasoner.logic.model.builder.TypeScopes; | ||
18 | import hu.bme.mit.inf.dslreasoner.logic.model.builder.VariableContext; | ||
19 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Assertion; | ||
20 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Iff; | ||
21 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.LogiclanguagePackage; | ||
22 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.RelationDeclaration; | ||
23 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.SymbolicValue; | ||
24 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.TermDescription; | ||
25 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Type; | ||
26 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.TypeDefinition; | ||
27 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Variable; | ||
28 | import hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.Annotation; | ||
29 | import hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.LogicProblem; | ||
30 | import hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.LogicproblemPackage; | ||
31 | import hu.bme.mit.inf.dslreasoner.logic.model.logicresult.LogicResult; | ||
32 | import hu.bme.mit.inf.dslreasoner.logic.model.logicresult.ModelResult; | ||
33 | import hu.bme.mit.inf.dslreasoner.viatra2logic.Viatra2Logic; | ||
34 | import hu.bme.mit.inf.dslreasoner.viatra2logic.Viatra2LogicConfiguration; | ||
35 | import hu.bme.mit.inf.dslreasoner.viatra2logic.Viatra2LogicTrace; | ||
36 | import hu.bme.mit.inf.dslreasoner.viatra2logic.ViatraQuerySetDescriptor; | ||
37 | import hu.bme.mit.inf.dslreasoner.viatra2logic.viatra2logicannotations.Viatra2LogicAnnotationsPackage; | ||
38 | import hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.TypeInferenceMethod; | ||
39 | import hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.cardinality.PolyhedralScopePropagatorConstraints; | ||
40 | import hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.cardinality.PolyhedralScopePropagatorSolver; | ||
41 | import hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.cardinality.ScopePropagatorStrategy; | ||
42 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretation2logic.InstanceModel2Logic; | ||
43 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.BinaryElementRelationLink; | ||
44 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.PartialComplexTypeInterpretation; | ||
45 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.PartialInterpretation; | ||
46 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.PartialRelationInterpretation; | ||
47 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.PartialinterpretationPackage; | ||
48 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.RelationLink; | ||
49 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.visualisation.PartialInterpretation2Gml; | ||
50 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.visualisation.PartialInterpretationVisualisation; | ||
51 | import hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner.StateCoderStrategy; | ||
52 | import hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner.ViatraReasoner; | ||
53 | import hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner.ViatraReasonerConfiguration; | ||
54 | import hu.bme.mit.inf.dslreasoner.visualisation.pi2graphviz.GraphvizVisualiser; | ||
55 | import hu.bme.mit.inf.dslreasoner.workspace.FileSystemWorkspace; | ||
56 | import java.util.Collections; | ||
57 | import java.util.List; | ||
58 | import java.util.Map; | ||
59 | import java.util.Set; | ||
60 | import java.util.function.Consumer; | ||
61 | import java.util.function.Predicate; | ||
62 | import modes3.Modes3Factory; | ||
63 | import modes3.Modes3ModelRoot; | ||
64 | import modes3.Modes3Package; | ||
65 | import modes3.queries.Modes3Queries; | ||
66 | import org.eclipse.emf.common.util.EList; | ||
67 | import org.eclipse.emf.common.util.URI; | ||
68 | import org.eclipse.emf.ecore.EAttribute; | ||
69 | import org.eclipse.emf.ecore.EClass; | ||
70 | import org.eclipse.emf.ecore.EEnum; | ||
71 | import org.eclipse.emf.ecore.EEnumLiteral; | ||
72 | import org.eclipse.emf.ecore.EObject; | ||
73 | import org.eclipse.emf.ecore.EReference; | ||
74 | import org.eclipse.emf.ecore.EStructuralFeature; | ||
75 | import org.eclipse.emf.ecore.resource.Resource; | ||
76 | import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl; | ||
77 | import org.eclipse.viatra.query.patternlanguage.emf.EMFPatternLanguageStandaloneSetup; | ||
78 | import org.eclipse.viatra.query.runtime.api.IQuerySpecification; | ||
79 | import org.eclipse.viatra.query.runtime.api.ViatraQueryEngineOptions; | ||
80 | import org.eclipse.viatra.query.runtime.localsearch.matcher.integration.LocalSearchEMFBackendFactory; | ||
81 | import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.PAnnotation; | ||
82 | import org.eclipse.viatra.query.runtime.rete.matcher.ReteBackendFactory; | ||
83 | import org.eclipse.xtend.lib.annotations.FinalFieldsConstructor; | ||
84 | import org.eclipse.xtend2.lib.StringConcatenation; | ||
85 | import org.eclipse.xtext.xbase.lib.CollectionLiterals; | ||
86 | import org.eclipse.xtext.xbase.lib.Exceptions; | ||
87 | import org.eclipse.xtext.xbase.lib.ExclusiveRange; | ||
88 | import org.eclipse.xtext.xbase.lib.Extension; | ||
89 | import org.eclipse.xtext.xbase.lib.Functions.Function1; | ||
90 | import org.eclipse.xtext.xbase.lib.InputOutput; | ||
91 | import org.eclipse.xtext.xbase.lib.IterableExtensions; | ||
92 | import org.eclipse.xtext.xbase.lib.ObjectExtensions; | ||
93 | import org.eclipse.xtext.xbase.lib.Procedures.Procedure1; | ||
94 | |||
95 | @FinalFieldsConstructor | ||
96 | @SuppressWarnings("all") | ||
97 | public class Modes3ModelGenerator { | ||
98 | private enum MonitoringQuery { | ||
99 | closeTrains, | ||
100 | |||
101 | misalignedTurnout; | ||
102 | } | ||
103 | |||
104 | private final Modes3ModelGenerator.MonitoringQuery monitoringQuery; | ||
105 | |||
106 | private final int modelSize; | ||
107 | |||
108 | private final Ecore2Logic ecore2Logic = new Ecore2Logic(); | ||
109 | |||
110 | private final InstanceModel2Logic instanceModel2Logic = new InstanceModel2Logic(); | ||
111 | |||
112 | private final Viatra2Logic viatra2Logic = new Viatra2Logic(this.ecore2Logic); | ||
113 | |||
114 | private final ViatraReasoner solver = new ViatraReasoner(); | ||
115 | |||
116 | @Extension | ||
117 | private final LogicProblemBuilder _logicProblemBuilder = new LogicProblemBuilder(); | ||
118 | |||
119 | public URI generate() { | ||
120 | try { | ||
121 | URI _xblockexpression = null; | ||
122 | { | ||
123 | final EcoreMetamodelDescriptor metamodel = Modes3ModelGenerator.createMetamodelDescriptor(); | ||
124 | Ecore2LogicConfiguration _ecore2LogicConfiguration = new Ecore2LogicConfiguration(); | ||
125 | final TracedOutput<LogicProblem, Ecore2Logic_Trace> metamodelLogic = this.ecore2Logic.transformMetamodel(metamodel, _ecore2LogicConfiguration); | ||
126 | final Type segment = this.ecore2Logic.TypeofEClass(metamodelLogic.getTrace(), Modes3Package.eINSTANCE.getSegment()); | ||
127 | final RelationDeclaration connectedTo = this.ecore2Logic.relationOfReference(metamodelLogic.getTrace(), | ||
128 | Modes3Package.eINSTANCE.getSegment_ConnectedTo()); | ||
129 | final RelationDeclaration connectedToIndicator = ((EReferenceMapper_RelationsOverTypes_Trace) metamodelLogic.getTrace().referenceMapperTrace).indicators.get( | ||
130 | Modes3Package.eINSTANCE.getSegment_ConnectedTo()); | ||
131 | StringConcatenation _builder = new StringConcatenation(); | ||
132 | _builder.append("oppositeReference "); | ||
133 | String _name = connectedTo.getName(); | ||
134 | _builder.append(_name); | ||
135 | _builder.append(" "); | ||
136 | String _name_1 = connectedTo.getName(); | ||
137 | _builder.append(_name_1); | ||
138 | final Function1<VariableContext, TermDescription> _function = (VariableContext it) -> { | ||
139 | Iff _xblockexpression_1 = null; | ||
140 | { | ||
141 | StringConcatenation _builder_1 = new StringConcatenation(); | ||
142 | _builder_1.append("src"); | ||
143 | final Variable src = it.addVar(_builder_1, segment); | ||
144 | StringConcatenation _builder_2 = new StringConcatenation(); | ||
145 | _builder_2.append("trg"); | ||
146 | final Variable trg = it.addVar(_builder_2, segment); | ||
147 | SymbolicValue _call = this._logicProblemBuilder.call(connectedToIndicator, src, trg); | ||
148 | SymbolicValue _call_1 = this._logicProblemBuilder.call(connectedToIndicator, trg, src); | ||
149 | _xblockexpression_1 = this._logicProblemBuilder.operator_spaceship(_call, _call_1); | ||
150 | } | ||
151 | return _xblockexpression_1; | ||
152 | }; | ||
153 | final Assertion inverseAssertion = this._logicProblemBuilder.Assertion(_builder, | ||
154 | this._logicProblemBuilder.Forall(_function)); | ||
155 | EList<Assertion> _assertions = metamodelLogic.getOutput().getAssertions(); | ||
156 | _assertions.add(inverseAssertion); | ||
157 | InverseRelationAssertion _createInverseRelationAssertion = Ecore2logicannotationsFactory.eINSTANCE.createInverseRelationAssertion(); | ||
158 | final Procedure1<InverseRelationAssertion> _function_1 = (InverseRelationAssertion it) -> { | ||
159 | it.setTarget(inverseAssertion); | ||
160 | it.setInverseA(connectedTo); | ||
161 | it.setInverseB(connectedTo); | ||
162 | }; | ||
163 | final InverseRelationAssertion inverseAnnotation = ObjectExtensions.<InverseRelationAssertion>operator_doubleArrow(_createInverseRelationAssertion, _function_1); | ||
164 | EList<Annotation> _annotations = metamodelLogic.getOutput().getAnnotations(); | ||
165 | _annotations.add(inverseAnnotation); | ||
166 | final List<EObject> initialModel = Modes3ModelGenerator.loadInitialModel(); | ||
167 | final TracedOutput<LogicProblem, Ecore2Logic_Trace> initialModelLogic = this.instanceModel2Logic.transform(metamodelLogic, initialModel); | ||
168 | final ViatraQuerySetDescriptor queries = this.loadQueries(); | ||
169 | Viatra2LogicConfiguration _viatra2LogicConfiguration = new Viatra2LogicConfiguration(); | ||
170 | final TracedOutput<LogicProblem, Viatra2LogicTrace> logic = this.viatra2Logic.transformQueries(queries, initialModelLogic, _viatra2LogicConfiguration); | ||
171 | ViatraReasonerConfiguration _viatraReasonerConfiguration = new ViatraReasonerConfiguration(); | ||
172 | final Procedure1<ViatraReasonerConfiguration> _function_2 = (ViatraReasonerConfiguration it) -> { | ||
173 | it.runtimeLimit = 3600; | ||
174 | final Procedure1<TypeScopes> _function_3 = (TypeScopes it_1) -> { | ||
175 | it_1.minNewElements = this.modelSize; | ||
176 | it_1.maxNewElements = this.modelSize; | ||
177 | final Procedure1<Map<Type, Integer>> _function_4 = (Map<Type, Integer> it_2) -> { | ||
178 | it_2.put(this.ecore2Logic.TypeofEClass(metamodelLogic.getTrace(), Modes3Package.eINSTANCE.getTurnout()), Integer.valueOf(1)); | ||
179 | }; | ||
180 | ObjectExtensions.<Map<Type, Integer>>operator_doubleArrow( | ||
181 | it_1.minNewElementsByType, _function_4); | ||
182 | final Procedure1<Map<Type, Integer>> _function_5 = (Map<Type, Integer> it_2) -> { | ||
183 | it_2.put(this.ecore2Logic.TypeofEClass(metamodelLogic.getTrace(), Modes3Package.eINSTANCE.getTrain()), Integer.valueOf(5)); | ||
184 | }; | ||
185 | ObjectExtensions.<Map<Type, Integer>>operator_doubleArrow( | ||
186 | it_1.maxNewElementsByType, _function_5); | ||
187 | }; | ||
188 | ObjectExtensions.<TypeScopes>operator_doubleArrow( | ||
189 | it.typeScopes, _function_3); | ||
190 | it.solutionScope.numberOfRequiredSolutions = 1; | ||
191 | it.nameNewElements = false; | ||
192 | it.typeInferenceMethod = TypeInferenceMethod.PreliminaryAnalysis; | ||
193 | it.stateCoderStrategy = StateCoderStrategy.Neighbourhood; | ||
194 | ScopePropagatorStrategy.Polyhedral _polyhedral = new ScopePropagatorStrategy.Polyhedral( | ||
195 | PolyhedralScopePropagatorConstraints.Relational, PolyhedralScopePropagatorSolver.Clp); | ||
196 | it.scopePropagatorStrategy = _polyhedral; | ||
197 | it.debugConfiguration.partialInterpretatioVisualiser = null; | ||
198 | }; | ||
199 | final ViatraReasonerConfiguration config = ObjectExtensions.<ViatraReasonerConfiguration>operator_doubleArrow(_viatraReasonerConfiguration, _function_2); | ||
200 | final FileSystemWorkspace workspace = new FileSystemWorkspace("output/", ""); | ||
201 | final LogicResult solution = this.solver.solve(logic.getOutput(), config, workspace); | ||
202 | URI _xifexpression = null; | ||
203 | if ((solution instanceof ModelResult)) { | ||
204 | InputOutput.<String>println("Saving generated solutions"); | ||
205 | final EList<Object> representations = ((ModelResult)solution).getRepresentation(); | ||
206 | int _size = representations.size(); | ||
207 | ExclusiveRange _doubleDotLessThan = new ExclusiveRange(0, _size, true); | ||
208 | for (final Integer representationIndex : _doubleDotLessThan) { | ||
209 | { | ||
210 | final Object representation = representations.get((representationIndex).intValue()); | ||
211 | final int representationNumber = ((representationIndex).intValue() + 1); | ||
212 | if ((representation instanceof PartialInterpretation)) { | ||
213 | StringConcatenation _builder_1 = new StringConcatenation(); | ||
214 | _builder_1.append("solution"); | ||
215 | _builder_1.append(representationNumber); | ||
216 | _builder_1.append(".partialinterpretation"); | ||
217 | workspace.writeModel(((EObject)representation), _builder_1.toString()); | ||
218 | final PartialInterpretation2Gml partialInterpretation2GML = new PartialInterpretation2Gml(); | ||
219 | final String gml = partialInterpretation2GML.transform(((PartialInterpretation)representation)); | ||
220 | StringConcatenation _builder_2 = new StringConcatenation(); | ||
221 | _builder_2.append("solution"); | ||
222 | _builder_2.append(representationNumber); | ||
223 | _builder_2.append(".gml"); | ||
224 | workspace.writeText(_builder_2.toString(), gml); | ||
225 | int _size_1 = ((PartialInterpretation)representation).getNewElements().size(); | ||
226 | boolean _lessThan = (_size_1 < 160); | ||
227 | if (_lessThan) { | ||
228 | if ((representation instanceof PartialInterpretation)) { | ||
229 | final Consumer<Type> _function_3 = (Type it) -> { | ||
230 | InputOutput.<String>println(it.getName()); | ||
231 | }; | ||
232 | ((PartialInterpretation)representation).getProblem().getTypes().forEach(_function_3); | ||
233 | final Function1<Type, Boolean> _function_4 = (Type it) -> { | ||
234 | String _name_2 = it.getName(); | ||
235 | return Boolean.valueOf(Objects.equal(_name_2, "Modes3ModelRoot class DefinedPart")); | ||
236 | }; | ||
237 | Type _findFirst = IterableExtensions.<Type>findFirst(((PartialInterpretation)representation).getProblem().getTypes(), _function_4); | ||
238 | final TypeDefinition rootType = ((TypeDefinition) _findFirst); | ||
239 | final Function1<PartialComplexTypeInterpretation, Boolean> _function_5 = (PartialComplexTypeInterpretation it) -> { | ||
240 | String _name_2 = it.getInterpretationOf().getName(); | ||
241 | return Boolean.valueOf(Objects.equal(_name_2, "Modes3ModelRoot class")); | ||
242 | }; | ||
243 | final PartialComplexTypeInterpretation rootIntepretation = IterableExtensions.<PartialComplexTypeInterpretation>findFirst(Iterables.<PartialComplexTypeInterpretation>filter(((PartialInterpretation)representation).getPartialtypeinterpratation(), | ||
244 | PartialComplexTypeInterpretation.class), _function_5); | ||
245 | rootIntepretation.getElements().removeAll(rootType.getElements()); | ||
246 | ((PartialInterpretation)representation).getProblem().getElements().removeAll(rootType.getElements()); | ||
247 | EList<PartialRelationInterpretation> _partialrelationinterpretation = ((PartialInterpretation)representation).getPartialrelationinterpretation(); | ||
248 | for (final PartialRelationInterpretation relationInterpretation : _partialrelationinterpretation) { | ||
249 | final Predicate<RelationLink> _function_6 = (RelationLink link) -> { | ||
250 | boolean _xifexpression_1 = false; | ||
251 | if ((link instanceof BinaryElementRelationLink)) { | ||
252 | _xifexpression_1 = (rootType.getElements().contains(((BinaryElementRelationLink)link).getParam1()) || rootType.getElements().contains(((BinaryElementRelationLink)link).getParam2())); | ||
253 | } else { | ||
254 | _xifexpression_1 = false; | ||
255 | } | ||
256 | return _xifexpression_1; | ||
257 | }; | ||
258 | relationInterpretation.getRelationlinks().removeIf(_function_6); | ||
259 | } | ||
260 | rootType.getElements().clear(); | ||
261 | } | ||
262 | final GraphvizVisualiser visualiser = new GraphvizVisualiser(); | ||
263 | final PartialInterpretationVisualisation visualisation = visualiser.visualiseConcretization(((PartialInterpretation)representation)); | ||
264 | StringConcatenation _builder_3 = new StringConcatenation(); | ||
265 | _builder_3.append("solution"); | ||
266 | _builder_3.append(representationNumber); | ||
267 | _builder_3.append(".png"); | ||
268 | visualisation.writeToFile(workspace, _builder_3.toString()); | ||
269 | } | ||
270 | } else { | ||
271 | StringConcatenation _builder_4 = new StringConcatenation(); | ||
272 | _builder_4.append("solution"); | ||
273 | _builder_4.append(representationNumber); | ||
274 | _builder_4.append(".txt"); | ||
275 | workspace.writeText(_builder_4.toString(), representation.toString()); | ||
276 | } | ||
277 | } | ||
278 | } | ||
279 | } else { | ||
280 | URI _xblockexpression_1 = null; | ||
281 | { | ||
282 | InputOutput.<String>println("Failed to solver problem"); | ||
283 | final LogicProblem partial = logic.getOutput(); | ||
284 | _xblockexpression_1 = workspace.writeModel(partial, "solution.partialinterpretation"); | ||
285 | } | ||
286 | _xifexpression = _xblockexpression_1; | ||
287 | } | ||
288 | _xblockexpression = _xifexpression; | ||
289 | } | ||
290 | return _xblockexpression; | ||
291 | } catch (Throwable _e) { | ||
292 | throw Exceptions.sneakyThrow(_e); | ||
293 | } | ||
294 | } | ||
295 | |||
296 | public static EcoreMetamodelDescriptor createMetamodelDescriptor() { | ||
297 | EcoreMetamodelDescriptor _xblockexpression = null; | ||
298 | { | ||
299 | final ImmutableList<EClass> eClasses = ImmutableList.<EClass>copyOf(Iterables.<EClass>filter(Modes3Package.eINSTANCE.getEClassifiers(), EClass.class)); | ||
300 | Set<EClass> _emptySet = CollectionLiterals.<EClass>emptySet(); | ||
301 | List<EEnum> _emptyList = CollectionLiterals.<EEnum>emptyList(); | ||
302 | List<EEnumLiteral> _emptyList_1 = CollectionLiterals.<EEnumLiteral>emptyList(); | ||
303 | final Function1<EClass, EList<EReference>> _function = (EClass it) -> { | ||
304 | return it.getEReferences(); | ||
305 | }; | ||
306 | ImmutableList<EReference> _copyOf = ImmutableList.<EReference>copyOf(IterableExtensions.<EClass, EReference>flatMap(eClasses, _function)); | ||
307 | List<EAttribute> _emptyList_2 = CollectionLiterals.<EAttribute>emptyList(); | ||
308 | _xblockexpression = new EcoreMetamodelDescriptor(eClasses, _emptySet, | ||
309 | false, _emptyList, _emptyList_1, _copyOf, _emptyList_2); | ||
310 | } | ||
311 | return _xblockexpression; | ||
312 | } | ||
313 | |||
314 | public static List<EObject> loadInitialModel() { | ||
315 | Modes3ModelRoot _createModes3ModelRoot = Modes3Factory.eINSTANCE.createModes3ModelRoot(); | ||
316 | return Collections.<EObject>unmodifiableList(CollectionLiterals.<EObject>newArrayList(_createModes3ModelRoot)); | ||
317 | } | ||
318 | |||
319 | public ViatraQuerySetDescriptor loadQueries() { | ||
320 | ViatraQuerySetDescriptor _xblockexpression = null; | ||
321 | { | ||
322 | final ImmutableList.Builder<IQuerySpecification<?>> patternsBuilder = ImmutableList.<IQuerySpecification<?>>builder(); | ||
323 | patternsBuilder.addAll(Modes3Queries.instance().getSpecifications()); | ||
324 | final ImmutableList<IQuerySpecification<?>> patterns = patternsBuilder.build(); | ||
325 | final Function1<IQuerySpecification<?>, Boolean> _function = (IQuerySpecification<?> pattern) -> { | ||
326 | final Function1<PAnnotation, Boolean> _function_1 = (PAnnotation it) -> { | ||
327 | String _name = it.getName(); | ||
328 | return Boolean.valueOf(Objects.equal(_name, "Constraint")); | ||
329 | }; | ||
330 | return Boolean.valueOf(IterableExtensions.<PAnnotation>exists(pattern.getAllAnnotations(), _function_1)); | ||
331 | }; | ||
332 | final ImmutableSet<IQuerySpecification<?>> validationPatterns = ImmutableSet.<IQuerySpecification<?>>copyOf(IterableExtensions.<IQuerySpecification<?>>filter(patterns, _function)); | ||
333 | Map<IQuerySpecification<?>, EStructuralFeature> _emptyMap = CollectionLiterals.<IQuerySpecification<?>, EStructuralFeature>emptyMap(); | ||
334 | _xblockexpression = new ViatraQuerySetDescriptor(patterns, validationPatterns, _emptyMap); | ||
335 | } | ||
336 | return _xblockexpression; | ||
337 | } | ||
338 | |||
339 | public static Object init() { | ||
340 | Object _xblockexpression = null; | ||
341 | { | ||
342 | EMFPatternLanguageStandaloneSetup.doSetup(); | ||
343 | ViatraQueryEngineOptions.setSystemDefaultBackends(ReteBackendFactory.INSTANCE, ReteBackendFactory.INSTANCE, | ||
344 | LocalSearchEMFBackendFactory.INSTANCE); | ||
345 | LogiclanguagePackage.eINSTANCE.getClass(); | ||
346 | LogicproblemPackage.eINSTANCE.getClass(); | ||
347 | PartialinterpretationPackage.eINSTANCE.getClass(); | ||
348 | Ecore2logicannotationsPackage.eINSTANCE.getClass(); | ||
349 | Viatra2LogicAnnotationsPackage.eINSTANCE.getClass(); | ||
350 | Map<String, Object> _extensionToFactoryMap = Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap(); | ||
351 | XMIResourceFactoryImpl _xMIResourceFactoryImpl = new XMIResourceFactoryImpl(); | ||
352 | _extensionToFactoryMap.put("ecore", _xMIResourceFactoryImpl); | ||
353 | Map<String, Object> _extensionToFactoryMap_1 = Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap(); | ||
354 | XMIResourceFactoryImpl _xMIResourceFactoryImpl_1 = new XMIResourceFactoryImpl(); | ||
355 | _extensionToFactoryMap_1.put("logicproblem", _xMIResourceFactoryImpl_1); | ||
356 | Map<String, Object> _extensionToFactoryMap_2 = Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap(); | ||
357 | XMIResourceFactoryImpl _xMIResourceFactoryImpl_2 = new XMIResourceFactoryImpl(); | ||
358 | _xblockexpression = _extensionToFactoryMap_2.put("partialinterpretation", _xMIResourceFactoryImpl_2); | ||
359 | } | ||
360 | return _xblockexpression; | ||
361 | } | ||
362 | |||
363 | public static void main(final String[] args) { | ||
364 | int _length = args.length; | ||
365 | boolean _notEquals = (_length != 2); | ||
366 | if (_notEquals) { | ||
367 | System.err.println("Usage: <query> <model size>"); | ||
368 | } | ||
369 | final Modes3ModelGenerator.MonitoringQuery monitoringQuery = Modes3ModelGenerator.MonitoringQuery.valueOf(args[0]); | ||
370 | final int modelSize = Integer.parseInt(args[1]); | ||
371 | Modes3ModelGenerator.init(); | ||
372 | final Modes3ModelGenerator generator = new Modes3ModelGenerator(monitoringQuery, modelSize); | ||
373 | generator.generate(); | ||
374 | } | ||
375 | |||
376 | public Modes3ModelGenerator(final Modes3ModelGenerator.MonitoringQuery monitoringQuery, final int modelSize) { | ||
377 | super(); | ||
378 | this.monitoringQuery = monitoringQuery; | ||
379 | this.modelSize = modelSize; | ||
380 | } | ||
381 | } | ||
diff --git a/Domains/ca.mcgill.rtgmrt.example.modes3/xtend-gen/modes3/run/Modes3UnitPropagationGenerator.java b/Domains/ca.mcgill.rtgmrt.example.modes3/xtend-gen/modes3/run/Modes3UnitPropagationGenerator.java new file mode 100644 index 00000000..91adaaaa --- /dev/null +++ b/Domains/ca.mcgill.rtgmrt.example.modes3/xtend-gen/modes3/run/Modes3UnitPropagationGenerator.java | |||
@@ -0,0 +1,585 @@ | |||
1 | package modes3.run; | ||
2 | |||
3 | import hu.bme.mit.inf.dslreasoner.ecore2logic.Ecore2Logic; | ||
4 | import hu.bme.mit.inf.dslreasoner.ecore2logic.Ecore2Logic_Trace; | ||
5 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Relation; | ||
6 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Type; | ||
7 | import hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.Modality; | ||
8 | import hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.patterns.PatternGenerator; | ||
9 | import hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.patterns.UnitPropagationPatternGenerator; | ||
10 | import java.util.Collections; | ||
11 | import java.util.Map; | ||
12 | import modes3.Modes3Package; | ||
13 | import modes3.queries.ExtraInputOfTurnout; | ||
14 | import modes3.queries.Output; | ||
15 | import modes3.queries.TurnoutOutput; | ||
16 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PQuery; | ||
17 | import org.eclipse.xtend2.lib.StringConcatenationClient; | ||
18 | import org.eclipse.xtext.xbase.lib.CollectionLiterals; | ||
19 | import org.eclipse.xtext.xbase.lib.Extension; | ||
20 | import org.eclipse.xtext.xbase.lib.Pair; | ||
21 | |||
22 | @SuppressWarnings("all") | ||
23 | public class Modes3UnitPropagationGenerator implements UnitPropagationPatternGenerator { | ||
24 | private static final String MUST_NOT_CONNECTED_TO = "mustNotConnectedTo"; | ||
25 | |||
26 | private static final String MUST_NOT_CONNECTED_TO_HELPER = "mustNotConnectedTo_helper"; | ||
27 | |||
28 | private static final String MUST_NOT_TURNOUT_OUTPUT = "mustNotTurnoutOutput"; | ||
29 | |||
30 | private static final String MUST_NOT_STRAIGHT = "mustNotStraight"; | ||
31 | |||
32 | private static final String MUST_NOT_DIVERGENT = "mustNotDivergent"; | ||
33 | |||
34 | private final Type segmentType; | ||
35 | |||
36 | private final Type turnoutType; | ||
37 | |||
38 | private final Relation connectedToRelation; | ||
39 | |||
40 | private final Relation straightRelation; | ||
41 | |||
42 | private final Relation divergentRelation; | ||
43 | |||
44 | public Modes3UnitPropagationGenerator(@Extension final Ecore2Logic ecore2Logic, final Ecore2Logic_Trace ecore2LogicTrace) { | ||
45 | @Extension | ||
46 | final Modes3Package Modes3Package = modes3.Modes3Package.eINSTANCE; | ||
47 | this.segmentType = ecore2Logic.TypeofEClass(ecore2LogicTrace, Modes3Package.getSegment()); | ||
48 | this.turnoutType = ecore2Logic.TypeofEClass(ecore2LogicTrace, Modes3Package.getTurnout()); | ||
49 | this.connectedToRelation = ecore2Logic.relationOfReference(ecore2LogicTrace, Modes3Package.getSegment_ConnectedTo()); | ||
50 | this.straightRelation = ecore2Logic.relationOfReference(ecore2LogicTrace, Modes3Package.getTurnout_Straight()); | ||
51 | this.divergentRelation = ecore2Logic.relationOfReference(ecore2LogicTrace, Modes3Package.getTurnout_Divergent()); | ||
52 | } | ||
53 | |||
54 | @Override | ||
55 | public Map<Relation, String> getMustPatterns() { | ||
56 | return CollectionLiterals.<Relation, String>emptyMap(); | ||
57 | } | ||
58 | |||
59 | @Override | ||
60 | public Map<Relation, String> getMustNotPatterns() { | ||
61 | Pair<Relation, String> _mappedTo = Pair.<Relation, String>of(this.connectedToRelation, Modes3UnitPropagationGenerator.MUST_NOT_CONNECTED_TO); | ||
62 | Pair<Relation, String> _mappedTo_1 = Pair.<Relation, String>of(this.straightRelation, Modes3UnitPropagationGenerator.MUST_NOT_STRAIGHT); | ||
63 | Pair<Relation, String> _mappedTo_2 = Pair.<Relation, String>of(this.divergentRelation, Modes3UnitPropagationGenerator.MUST_NOT_DIVERGENT); | ||
64 | return Collections.<Relation, String>unmodifiableMap(CollectionLiterals.<Relation, String>newHashMap(_mappedTo, _mappedTo_1, _mappedTo_2)); | ||
65 | } | ||
66 | |||
67 | @Override | ||
68 | public StringConcatenationClient getAdditionalPatterns(@Extension final PatternGenerator generator, final Map<String, PQuery> fqnToPQuery) { | ||
69 | StringConcatenationClient _xblockexpression = null; | ||
70 | { | ||
71 | StringConcatenationClient _client = new StringConcatenationClient() { | ||
72 | @Override | ||
73 | protected void appendTo(StringConcatenationClient.TargetStringConcatenation _builder) { | ||
74 | _builder.append("problem: LogicProblem, interpretation: PartialInterpretation,"); | ||
75 | _builder.newLine(); | ||
76 | _builder.append("source: DefinedElement, target: DefinedElement"); | ||
77 | _builder.newLine(); | ||
78 | } | ||
79 | }; | ||
80 | final StringConcatenationClient parameters = _client; | ||
81 | StringConcatenationClient _client_1 = new StringConcatenationClient() { | ||
82 | @Override | ||
83 | protected void appendTo(StringConcatenationClient.TargetStringConcatenation _builder) { | ||
84 | _builder.append("find interpretation(problem, interpretation);"); | ||
85 | _builder.newLine(); | ||
86 | _builder.append("find mustExist(problem, interpretation, source);"); | ||
87 | _builder.newLine(); | ||
88 | _builder.append("find mustExist(problem, interpretation, target);"); | ||
89 | _builder.newLine(); | ||
90 | } | ||
91 | }; | ||
92 | final StringConcatenationClient commonParameterConstraints = _client_1; | ||
93 | StringConcatenationClient _client_2 = new StringConcatenationClient() { | ||
94 | @Override | ||
95 | protected void appendTo(StringConcatenationClient.TargetStringConcatenation _builder) { | ||
96 | _builder.append("pattern "); | ||
97 | _builder.append(Modes3UnitPropagationGenerator.MUST_NOT_CONNECTED_TO_HELPER); | ||
98 | _builder.append("("); | ||
99 | _builder.append(parameters); | ||
100 | _builder.append(") {"); | ||
101 | _builder.newLineIfNotEmpty(); | ||
102 | _builder.append("\t"); | ||
103 | _builder.append("// connectedToReflexive unit propagation"); | ||
104 | _builder.newLine(); | ||
105 | _builder.append("\t"); | ||
106 | _builder.append(commonParameterConstraints, "\t"); | ||
107 | _builder.newLineIfNotEmpty(); | ||
108 | _builder.append("\t"); | ||
109 | CharSequence _referInstanceOf = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.segmentType, Modality.MUST, "source"); | ||
110 | _builder.append(_referInstanceOf, "\t"); | ||
111 | _builder.newLineIfNotEmpty(); | ||
112 | _builder.append("\t"); | ||
113 | CharSequence _referInstanceOf_1 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.segmentType, Modality.MUST, "target"); | ||
114 | _builder.append(_referInstanceOf_1, "\t"); | ||
115 | _builder.newLineIfNotEmpty(); | ||
116 | _builder.append("\t"); | ||
117 | _builder.append("source == target;"); | ||
118 | _builder.newLine(); | ||
119 | _builder.append("} or {"); | ||
120 | _builder.newLine(); | ||
121 | _builder.append("\t"); | ||
122 | _builder.append("// tooManyInputsOfSegment unit propagation"); | ||
123 | _builder.newLine(); | ||
124 | _builder.append("\t"); | ||
125 | _builder.append(commonParameterConstraints, "\t"); | ||
126 | _builder.newLineIfNotEmpty(); | ||
127 | _builder.append("\t"); | ||
128 | CharSequence _referInstanceOf_2 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.segmentType, Modality.MUST, "source"); | ||
129 | _builder.append(_referInstanceOf_2, "\t"); | ||
130 | _builder.newLineIfNotEmpty(); | ||
131 | _builder.append("\t"); | ||
132 | CharSequence _referInstanceOf_3 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.segmentType, Modality.MUST, "target"); | ||
133 | _builder.append(_referInstanceOf_3, "\t"); | ||
134 | _builder.newLineIfNotEmpty(); | ||
135 | _builder.append("\t"); | ||
136 | CharSequence _referInstanceOf_4 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.segmentType, Modality.MUST, "input1"); | ||
137 | _builder.append(_referInstanceOf_4, "\t"); | ||
138 | _builder.newLineIfNotEmpty(); | ||
139 | _builder.append("\t"); | ||
140 | CharSequence _referInstanceOf_5 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.segmentType, Modality.MUST, "input2"); | ||
141 | _builder.append(_referInstanceOf_5, "\t"); | ||
142 | _builder.newLineIfNotEmpty(); | ||
143 | _builder.append("\t"); | ||
144 | _builder.append("neg "); | ||
145 | CharSequence _referInstanceOf_6 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.turnoutType, Modality.MAY, "source"); | ||
146 | _builder.append(_referInstanceOf_6, "\t"); | ||
147 | _builder.newLineIfNotEmpty(); | ||
148 | _builder.append("\t"); | ||
149 | CharSequence _referPattern = generator.getRelationDefinitionIndexer().referPattern(fqnToPQuery.get(Output.instance().getFullyQualifiedName()), new String[] { "input1", "source" }, Modality.MUST, true, false); | ||
150 | _builder.append(_referPattern, "\t"); | ||
151 | _builder.newLineIfNotEmpty(); | ||
152 | _builder.append("\t"); | ||
153 | CharSequence _referPattern_1 = generator.getRelationDefinitionIndexer().referPattern(fqnToPQuery.get(Output.instance().getFullyQualifiedName()), new String[] { "input2", "source" }, Modality.MUST, true, false); | ||
154 | _builder.append(_referPattern_1, "\t"); | ||
155 | _builder.newLineIfNotEmpty(); | ||
156 | _builder.append("\t"); | ||
157 | _builder.append("input1 != input2;"); | ||
158 | _builder.newLine(); | ||
159 | _builder.append("\t"); | ||
160 | _builder.append("input1 != target;"); | ||
161 | _builder.newLine(); | ||
162 | _builder.append("\t"); | ||
163 | _builder.append("input2 != target;"); | ||
164 | _builder.newLine(); | ||
165 | _builder.append("} or {"); | ||
166 | _builder.newLine(); | ||
167 | _builder.append("\t"); | ||
168 | _builder.append("// turnoutConnectedToBothOutputs unit propagation 1"); | ||
169 | _builder.newLine(); | ||
170 | _builder.append("\t"); | ||
171 | _builder.append(commonParameterConstraints, "\t"); | ||
172 | _builder.newLineIfNotEmpty(); | ||
173 | _builder.append("\t"); | ||
174 | CharSequence _referInstanceOf_7 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.turnoutType, Modality.MUST, "source"); | ||
175 | _builder.append(_referInstanceOf_7, "\t"); | ||
176 | _builder.newLineIfNotEmpty(); | ||
177 | _builder.append("\t"); | ||
178 | CharSequence _referInstanceOf_8 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.segmentType, Modality.MUST, "target"); | ||
179 | _builder.append(_referInstanceOf_8, "\t"); | ||
180 | _builder.newLineIfNotEmpty(); | ||
181 | _builder.append("\t"); | ||
182 | CharSequence _referInstanceOf_9 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.segmentType, Modality.MUST, "divergent"); | ||
183 | _builder.append(_referInstanceOf_9, "\t"); | ||
184 | _builder.newLineIfNotEmpty(); | ||
185 | _builder.append("\t"); | ||
186 | CharSequence _referRelation = generator.referRelation(Modes3UnitPropagationGenerator.this.straightRelation, "source", "target", Modality.MUST, fqnToPQuery); | ||
187 | _builder.append(_referRelation, "\t"); | ||
188 | _builder.newLineIfNotEmpty(); | ||
189 | _builder.append("\t"); | ||
190 | CharSequence _referRelation_1 = generator.referRelation(Modes3UnitPropagationGenerator.this.divergentRelation, "source", "divergent", Modality.MUST, fqnToPQuery); | ||
191 | _builder.append(_referRelation_1, "\t"); | ||
192 | _builder.newLineIfNotEmpty(); | ||
193 | _builder.append("\t"); | ||
194 | CharSequence _referRelation_2 = generator.referRelation(Modes3UnitPropagationGenerator.this.connectedToRelation, "source", "divergent", Modality.MUST, fqnToPQuery); | ||
195 | _builder.append(_referRelation_2, "\t"); | ||
196 | _builder.newLineIfNotEmpty(); | ||
197 | _builder.append("} or {"); | ||
198 | _builder.newLine(); | ||
199 | _builder.append("\t"); | ||
200 | _builder.append("// turnoutConnectedToBothOutputs unit propagation 2"); | ||
201 | _builder.newLine(); | ||
202 | _builder.append("\t"); | ||
203 | _builder.append(commonParameterConstraints, "\t"); | ||
204 | _builder.newLineIfNotEmpty(); | ||
205 | _builder.append("\t"); | ||
206 | CharSequence _referInstanceOf_10 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.turnoutType, Modality.MUST, "source"); | ||
207 | _builder.append(_referInstanceOf_10, "\t"); | ||
208 | _builder.newLineIfNotEmpty(); | ||
209 | _builder.append("\t"); | ||
210 | CharSequence _referInstanceOf_11 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.segmentType, Modality.MUST, "target"); | ||
211 | _builder.append(_referInstanceOf_11, "\t"); | ||
212 | _builder.newLineIfNotEmpty(); | ||
213 | _builder.append("\t"); | ||
214 | CharSequence _referInstanceOf_12 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.segmentType, Modality.MUST, "straight"); | ||
215 | _builder.append(_referInstanceOf_12, "\t"); | ||
216 | _builder.newLineIfNotEmpty(); | ||
217 | _builder.append("\t"); | ||
218 | CharSequence _referRelation_3 = generator.referRelation(Modes3UnitPropagationGenerator.this.straightRelation, "source", "straight", Modality.MUST, fqnToPQuery); | ||
219 | _builder.append(_referRelation_3, "\t"); | ||
220 | _builder.newLineIfNotEmpty(); | ||
221 | _builder.append("\t"); | ||
222 | CharSequence _referRelation_4 = generator.referRelation(Modes3UnitPropagationGenerator.this.divergentRelation, "source", "target", Modality.MUST, fqnToPQuery); | ||
223 | _builder.append(_referRelation_4, "\t"); | ||
224 | _builder.newLineIfNotEmpty(); | ||
225 | _builder.append("\t"); | ||
226 | CharSequence _referRelation_5 = generator.referRelation(Modes3UnitPropagationGenerator.this.connectedToRelation, "source", "straight", Modality.MUST, fqnToPQuery); | ||
227 | _builder.append(_referRelation_5, "\t"); | ||
228 | _builder.newLineIfNotEmpty(); | ||
229 | _builder.append("} or {"); | ||
230 | _builder.newLine(); | ||
231 | _builder.append("\t"); | ||
232 | _builder.append("// tooManyExtraInputsOfTurnout unit propagation"); | ||
233 | _builder.newLine(); | ||
234 | _builder.append("\t"); | ||
235 | _builder.append(commonParameterConstraints, "\t"); | ||
236 | _builder.newLineIfNotEmpty(); | ||
237 | _builder.append("\t"); | ||
238 | CharSequence _referInstanceOf_13 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.turnoutType, Modality.MUST, "source"); | ||
239 | _builder.append(_referInstanceOf_13, "\t"); | ||
240 | _builder.newLineIfNotEmpty(); | ||
241 | _builder.append("\t"); | ||
242 | CharSequence _referInstanceOf_14 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.segmentType, Modality.MUST, "target"); | ||
243 | _builder.append(_referInstanceOf_14, "\t"); | ||
244 | _builder.newLineIfNotEmpty(); | ||
245 | _builder.append("\t"); | ||
246 | CharSequence _referInstanceOf_15 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.segmentType, Modality.MUST, "extraInput"); | ||
247 | _builder.append(_referInstanceOf_15, "\t"); | ||
248 | _builder.newLineIfNotEmpty(); | ||
249 | _builder.append("\t"); | ||
250 | CharSequence _referPattern_2 = generator.getRelationDefinitionIndexer().referPattern(fqnToPQuery.get(TurnoutOutput.instance().getFullyQualifiedName()), new String[] { "source", "target" }, Modality.MAY, false, false); | ||
251 | _builder.append(_referPattern_2, "\t"); | ||
252 | _builder.newLineIfNotEmpty(); | ||
253 | _builder.append("\t"); | ||
254 | CharSequence _referPattern_3 = generator.getRelationDefinitionIndexer().referPattern(fqnToPQuery.get(ExtraInputOfTurnout.instance().getFullyQualifiedName()), new String[] { "source", "extraInput" }, Modality.MUST, true, false); | ||
255 | _builder.append(_referPattern_3, "\t"); | ||
256 | _builder.newLineIfNotEmpty(); | ||
257 | _builder.append("\t"); | ||
258 | _builder.append("target != extraInput;"); | ||
259 | _builder.newLine(); | ||
260 | _builder.append("}"); | ||
261 | _builder.newLine(); | ||
262 | _builder.newLine(); | ||
263 | _builder.append("pattern "); | ||
264 | _builder.append(Modes3UnitPropagationGenerator.MUST_NOT_CONNECTED_TO); | ||
265 | _builder.append("("); | ||
266 | _builder.append(parameters); | ||
267 | _builder.append(") {"); | ||
268 | _builder.newLineIfNotEmpty(); | ||
269 | _builder.append("\t"); | ||
270 | _builder.append("find "); | ||
271 | _builder.append(Modes3UnitPropagationGenerator.MUST_NOT_CONNECTED_TO_HELPER, "\t"); | ||
272 | _builder.append("(problem, interpretation, source, target);"); | ||
273 | _builder.newLineIfNotEmpty(); | ||
274 | _builder.append("} or {"); | ||
275 | _builder.newLine(); | ||
276 | _builder.append("\t"); | ||
277 | _builder.append("find "); | ||
278 | _builder.append(Modes3UnitPropagationGenerator.MUST_NOT_CONNECTED_TO_HELPER, "\t"); | ||
279 | _builder.append("(problem, interpretation, target, source);"); | ||
280 | _builder.newLineIfNotEmpty(); | ||
281 | _builder.append("}"); | ||
282 | _builder.newLine(); | ||
283 | _builder.newLine(); | ||
284 | _builder.append("pattern "); | ||
285 | _builder.append(Modes3UnitPropagationGenerator.MUST_NOT_TURNOUT_OUTPUT); | ||
286 | _builder.append("("); | ||
287 | _builder.append(parameters); | ||
288 | _builder.append(") {"); | ||
289 | _builder.newLineIfNotEmpty(); | ||
290 | _builder.append("\t"); | ||
291 | _builder.append("// outputReflexive unit propagation"); | ||
292 | _builder.newLine(); | ||
293 | _builder.append("\t"); | ||
294 | _builder.append(commonParameterConstraints, "\t"); | ||
295 | _builder.newLineIfNotEmpty(); | ||
296 | _builder.append("\t"); | ||
297 | CharSequence _referInstanceOf_16 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.turnoutType, Modality.MUST, "source"); | ||
298 | _builder.append(_referInstanceOf_16, "\t"); | ||
299 | _builder.newLineIfNotEmpty(); | ||
300 | _builder.append("\t"); | ||
301 | CharSequence _referInstanceOf_17 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.turnoutType, Modality.MUST, "target"); | ||
302 | _builder.append(_referInstanceOf_17, "\t"); | ||
303 | _builder.newLineIfNotEmpty(); | ||
304 | _builder.append("\t"); | ||
305 | _builder.append("source == target;"); | ||
306 | _builder.newLine(); | ||
307 | _builder.append("} or {"); | ||
308 | _builder.newLine(); | ||
309 | _builder.append("\t"); | ||
310 | _builder.append("// tooManyInputsOfSegment unit propagation"); | ||
311 | _builder.newLine(); | ||
312 | _builder.append("\t"); | ||
313 | _builder.append(commonParameterConstraints, "\t"); | ||
314 | _builder.newLineIfNotEmpty(); | ||
315 | _builder.append("\t"); | ||
316 | CharSequence _referInstanceOf_18 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.turnoutType, Modality.MUST, "source"); | ||
317 | _builder.append(_referInstanceOf_18, "\t"); | ||
318 | _builder.newLineIfNotEmpty(); | ||
319 | _builder.append("\t"); | ||
320 | CharSequence _referInstanceOf_19 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.segmentType, Modality.MUST, "target"); | ||
321 | _builder.append(_referInstanceOf_19, "\t"); | ||
322 | _builder.newLineIfNotEmpty(); | ||
323 | _builder.append("\t"); | ||
324 | CharSequence _referInstanceOf_20 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.segmentType, Modality.MUST, "input1"); | ||
325 | _builder.append(_referInstanceOf_20, "\t"); | ||
326 | _builder.newLineIfNotEmpty(); | ||
327 | _builder.append("\t"); | ||
328 | CharSequence _referInstanceOf_21 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.segmentType, Modality.MUST, "input2"); | ||
329 | _builder.append(_referInstanceOf_21, "\t"); | ||
330 | _builder.newLineIfNotEmpty(); | ||
331 | _builder.append("\t"); | ||
332 | _builder.append("neg "); | ||
333 | CharSequence _referInstanceOf_22 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.turnoutType, Modality.MAY, "target"); | ||
334 | _builder.append(_referInstanceOf_22, "\t"); | ||
335 | _builder.newLineIfNotEmpty(); | ||
336 | _builder.append("\t"); | ||
337 | CharSequence _referPattern_4 = generator.getRelationDefinitionIndexer().referPattern(fqnToPQuery.get(Output.instance().getFullyQualifiedName()), new String[] { "input1", "target" }, Modality.MUST, true, false); | ||
338 | _builder.append(_referPattern_4, "\t"); | ||
339 | _builder.newLineIfNotEmpty(); | ||
340 | _builder.append("\t"); | ||
341 | CharSequence _referPattern_5 = generator.getRelationDefinitionIndexer().referPattern(fqnToPQuery.get(Output.instance().getFullyQualifiedName()), new String[] { "input2", "target" }, Modality.MUST, true, false); | ||
342 | _builder.append(_referPattern_5, "\t"); | ||
343 | _builder.newLineIfNotEmpty(); | ||
344 | _builder.append("\t"); | ||
345 | _builder.append("input1 != input2;"); | ||
346 | _builder.newLine(); | ||
347 | _builder.append("\t"); | ||
348 | _builder.append("input1 != source;"); | ||
349 | _builder.newLine(); | ||
350 | _builder.append("\t"); | ||
351 | _builder.append("input2 != source;"); | ||
352 | _builder.newLine(); | ||
353 | _builder.append("}"); | ||
354 | _builder.newLine(); | ||
355 | _builder.newLine(); | ||
356 | _builder.append("pattern "); | ||
357 | _builder.append(Modes3UnitPropagationGenerator.MUST_NOT_STRAIGHT); | ||
358 | _builder.append("("); | ||
359 | _builder.append(parameters); | ||
360 | _builder.append(") {"); | ||
361 | _builder.newLineIfNotEmpty(); | ||
362 | _builder.append("\t"); | ||
363 | _builder.append("find "); | ||
364 | _builder.append(Modes3UnitPropagationGenerator.MUST_NOT_TURNOUT_OUTPUT, "\t"); | ||
365 | _builder.append("(problem, interpretation, source, target);"); | ||
366 | _builder.newLineIfNotEmpty(); | ||
367 | _builder.append("} or {"); | ||
368 | _builder.newLine(); | ||
369 | _builder.append("\t"); | ||
370 | _builder.append("// turnoutOutputsAreSame unit propagation"); | ||
371 | _builder.newLine(); | ||
372 | _builder.append("\t"); | ||
373 | _builder.append(commonParameterConstraints, "\t"); | ||
374 | _builder.newLineIfNotEmpty(); | ||
375 | _builder.append("\t"); | ||
376 | CharSequence _referInstanceOf_23 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.turnoutType, Modality.MUST, "source"); | ||
377 | _builder.append(_referInstanceOf_23, "\t"); | ||
378 | _builder.newLineIfNotEmpty(); | ||
379 | _builder.append("\t"); | ||
380 | CharSequence _referInstanceOf_24 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.segmentType, Modality.MUST, "target"); | ||
381 | _builder.append(_referInstanceOf_24, "\t"); | ||
382 | _builder.newLineIfNotEmpty(); | ||
383 | _builder.append("\t"); | ||
384 | CharSequence _referRelation_6 = generator.referRelation(Modes3UnitPropagationGenerator.this.divergentRelation, "source", "target", Modality.MUST, fqnToPQuery); | ||
385 | _builder.append(_referRelation_6, "\t"); | ||
386 | _builder.newLineIfNotEmpty(); | ||
387 | _builder.append("} or {"); | ||
388 | _builder.newLine(); | ||
389 | _builder.append("\t"); | ||
390 | _builder.append("// turnoutConnectedToBothOutputs unit propagation"); | ||
391 | _builder.newLine(); | ||
392 | _builder.append("\t"); | ||
393 | _builder.append(commonParameterConstraints, "\t"); | ||
394 | _builder.newLineIfNotEmpty(); | ||
395 | _builder.append("\t"); | ||
396 | CharSequence _referInstanceOf_25 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.turnoutType, Modality.MUST, "source"); | ||
397 | _builder.append(_referInstanceOf_25, "\t"); | ||
398 | _builder.newLineIfNotEmpty(); | ||
399 | _builder.append("\t"); | ||
400 | CharSequence _referInstanceOf_26 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.segmentType, Modality.MUST, "target"); | ||
401 | _builder.append(_referInstanceOf_26, "\t"); | ||
402 | _builder.newLineIfNotEmpty(); | ||
403 | _builder.append("\t"); | ||
404 | CharSequence _referInstanceOf_27 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.turnoutType, Modality.MUST, "divergent"); | ||
405 | _builder.append(_referInstanceOf_27, "\t"); | ||
406 | _builder.newLineIfNotEmpty(); | ||
407 | _builder.append("\t"); | ||
408 | CharSequence _referRelation_7 = generator.referRelation(Modes3UnitPropagationGenerator.this.connectedToRelation, "source", "target", Modality.MUST, fqnToPQuery); | ||
409 | _builder.append(_referRelation_7, "\t"); | ||
410 | _builder.newLineIfNotEmpty(); | ||
411 | _builder.append("\t"); | ||
412 | CharSequence _referRelation_8 = generator.referRelation(Modes3UnitPropagationGenerator.this.divergentRelation, "source", "divergent", Modality.MUST, fqnToPQuery); | ||
413 | _builder.append(_referRelation_8, "\t"); | ||
414 | _builder.newLineIfNotEmpty(); | ||
415 | _builder.append("\t"); | ||
416 | CharSequence _referRelation_9 = generator.referRelation(Modes3UnitPropagationGenerator.this.connectedToRelation, "source", "divergent", Modality.MUST, fqnToPQuery); | ||
417 | _builder.append(_referRelation_9, "\t"); | ||
418 | _builder.newLineIfNotEmpty(); | ||
419 | _builder.append("} or {"); | ||
420 | _builder.newLine(); | ||
421 | _builder.append("\t"); | ||
422 | _builder.append("// tooManyExtraInputsOfTurnout unit propagation"); | ||
423 | _builder.newLine(); | ||
424 | _builder.append("\t"); | ||
425 | _builder.append(commonParameterConstraints, "\t"); | ||
426 | _builder.newLineIfNotEmpty(); | ||
427 | _builder.append("\t"); | ||
428 | CharSequence _referInstanceOf_28 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.turnoutType, Modality.MUST, "source"); | ||
429 | _builder.append(_referInstanceOf_28, "\t"); | ||
430 | _builder.newLineIfNotEmpty(); | ||
431 | _builder.append("\t"); | ||
432 | CharSequence _referInstanceOf_29 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.segmentType, Modality.MUST, "target"); | ||
433 | _builder.append(_referInstanceOf_29, "\t"); | ||
434 | _builder.newLineIfNotEmpty(); | ||
435 | _builder.append("\t"); | ||
436 | CharSequence _referInstanceOf_30 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.segmentType, Modality.MUST, "extraInput"); | ||
437 | _builder.append(_referInstanceOf_30, "\t"); | ||
438 | _builder.newLineIfNotEmpty(); | ||
439 | _builder.append("\t"); | ||
440 | CharSequence _referInstanceOf_31 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.segmentType, Modality.MUST, "potentialExtraInput"); | ||
441 | _builder.append(_referInstanceOf_31, "\t"); | ||
442 | _builder.newLineIfNotEmpty(); | ||
443 | _builder.append("\t"); | ||
444 | CharSequence _referPattern_6 = generator.getRelationDefinitionIndexer().referPattern(fqnToPQuery.get(ExtraInputOfTurnout.instance().getFullyQualifiedName()), new String[] { "source", "extraInput" }, Modality.MUST, true, false); | ||
445 | _builder.append(_referPattern_6, "\t"); | ||
446 | _builder.newLineIfNotEmpty(); | ||
447 | _builder.append("\t"); | ||
448 | CharSequence _referRelation_10 = generator.referRelation(Modes3UnitPropagationGenerator.this.connectedToRelation, "source", "potentialExtraInput", Modality.MUST, fqnToPQuery); | ||
449 | _builder.append(_referRelation_10, "\t"); | ||
450 | _builder.newLineIfNotEmpty(); | ||
451 | _builder.append("\t"); | ||
452 | _builder.append("neg "); | ||
453 | CharSequence _referRelation_11 = generator.referRelation(Modes3UnitPropagationGenerator.this.divergentRelation, "source", "potentialExtraInput", Modality.MAY, fqnToPQuery); | ||
454 | _builder.append(_referRelation_11, "\t"); | ||
455 | _builder.newLineIfNotEmpty(); | ||
456 | _builder.append("\t"); | ||
457 | _builder.append("extraInput != potentialExtraInput;"); | ||
458 | _builder.newLine(); | ||
459 | _builder.append("\t"); | ||
460 | _builder.append("extraInput != target;"); | ||
461 | _builder.newLine(); | ||
462 | _builder.append("\t"); | ||
463 | _builder.append("potentialExtraInput != target;"); | ||
464 | _builder.newLine(); | ||
465 | _builder.append("}"); | ||
466 | _builder.newLine(); | ||
467 | _builder.newLine(); | ||
468 | _builder.append("pattern "); | ||
469 | _builder.append(Modes3UnitPropagationGenerator.MUST_NOT_DIVERGENT); | ||
470 | _builder.append("("); | ||
471 | _builder.append(parameters); | ||
472 | _builder.append(") {"); | ||
473 | _builder.newLineIfNotEmpty(); | ||
474 | _builder.append("\t"); | ||
475 | _builder.append("find "); | ||
476 | _builder.append(Modes3UnitPropagationGenerator.MUST_NOT_TURNOUT_OUTPUT, "\t"); | ||
477 | _builder.append("(problem, interpretation, source, target);"); | ||
478 | _builder.newLineIfNotEmpty(); | ||
479 | _builder.append("} or {"); | ||
480 | _builder.newLine(); | ||
481 | _builder.append("\t"); | ||
482 | _builder.append("// turnoutOutputsAreSame unit propagation"); | ||
483 | _builder.newLine(); | ||
484 | _builder.append("\t"); | ||
485 | _builder.append(commonParameterConstraints, "\t"); | ||
486 | _builder.newLineIfNotEmpty(); | ||
487 | _builder.append("\t"); | ||
488 | CharSequence _referInstanceOf_32 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.turnoutType, Modality.MUST, "source"); | ||
489 | _builder.append(_referInstanceOf_32, "\t"); | ||
490 | _builder.newLineIfNotEmpty(); | ||
491 | _builder.append("\t"); | ||
492 | CharSequence _referInstanceOf_33 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.segmentType, Modality.MUST, "target"); | ||
493 | _builder.append(_referInstanceOf_33, "\t"); | ||
494 | _builder.newLineIfNotEmpty(); | ||
495 | _builder.append("\t"); | ||
496 | CharSequence _referRelation_12 = generator.referRelation(Modes3UnitPropagationGenerator.this.straightRelation, "source", "target", Modality.MUST, fqnToPQuery); | ||
497 | _builder.append(_referRelation_12, "\t"); | ||
498 | _builder.newLineIfNotEmpty(); | ||
499 | _builder.append("} or {"); | ||
500 | _builder.newLine(); | ||
501 | _builder.append("\t"); | ||
502 | _builder.append("// turnoutConnectedToBothOutputs unit propagation"); | ||
503 | _builder.newLine(); | ||
504 | _builder.append("\t"); | ||
505 | _builder.append(commonParameterConstraints, "\t"); | ||
506 | _builder.newLineIfNotEmpty(); | ||
507 | _builder.append("\t"); | ||
508 | CharSequence _referInstanceOf_34 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.turnoutType, Modality.MUST, "source"); | ||
509 | _builder.append(_referInstanceOf_34, "\t"); | ||
510 | _builder.newLineIfNotEmpty(); | ||
511 | _builder.append("\t"); | ||
512 | CharSequence _referInstanceOf_35 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.segmentType, Modality.MUST, "target"); | ||
513 | _builder.append(_referInstanceOf_35, "\t"); | ||
514 | _builder.newLineIfNotEmpty(); | ||
515 | _builder.append("\t"); | ||
516 | CharSequence _referInstanceOf_36 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.turnoutType, Modality.MUST, "straight"); | ||
517 | _builder.append(_referInstanceOf_36, "\t"); | ||
518 | _builder.newLineIfNotEmpty(); | ||
519 | _builder.append("\t"); | ||
520 | CharSequence _referRelation_13 = generator.referRelation(Modes3UnitPropagationGenerator.this.connectedToRelation, "source", "target", Modality.MUST, fqnToPQuery); | ||
521 | _builder.append(_referRelation_13, "\t"); | ||
522 | _builder.newLineIfNotEmpty(); | ||
523 | _builder.append("\t"); | ||
524 | CharSequence _referRelation_14 = generator.referRelation(Modes3UnitPropagationGenerator.this.straightRelation, "source", "straight", Modality.MUST, fqnToPQuery); | ||
525 | _builder.append(_referRelation_14, "\t"); | ||
526 | _builder.newLineIfNotEmpty(); | ||
527 | _builder.append("\t"); | ||
528 | CharSequence _referRelation_15 = generator.referRelation(Modes3UnitPropagationGenerator.this.connectedToRelation, "source", "straight", Modality.MUST, fqnToPQuery); | ||
529 | _builder.append(_referRelation_15, "\t"); | ||
530 | _builder.newLineIfNotEmpty(); | ||
531 | _builder.append("} or {"); | ||
532 | _builder.newLine(); | ||
533 | _builder.append("\t"); | ||
534 | _builder.append("// tooManyExtraInputsOfTurnout unit propagation"); | ||
535 | _builder.newLine(); | ||
536 | _builder.append("\t"); | ||
537 | _builder.append(commonParameterConstraints, "\t"); | ||
538 | _builder.newLineIfNotEmpty(); | ||
539 | _builder.append("\t"); | ||
540 | CharSequence _referInstanceOf_37 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.turnoutType, Modality.MUST, "source"); | ||
541 | _builder.append(_referInstanceOf_37, "\t"); | ||
542 | _builder.newLineIfNotEmpty(); | ||
543 | _builder.append("\t"); | ||
544 | CharSequence _referInstanceOf_38 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.segmentType, Modality.MUST, "target"); | ||
545 | _builder.append(_referInstanceOf_38, "\t"); | ||
546 | _builder.newLineIfNotEmpty(); | ||
547 | _builder.append("\t"); | ||
548 | CharSequence _referInstanceOf_39 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.segmentType, Modality.MUST, "extraInput"); | ||
549 | _builder.append(_referInstanceOf_39, "\t"); | ||
550 | _builder.newLineIfNotEmpty(); | ||
551 | _builder.append("\t"); | ||
552 | CharSequence _referInstanceOf_40 = generator.getTypeIndexer().referInstanceOf(Modes3UnitPropagationGenerator.this.segmentType, Modality.MUST, "potentialExtraInput"); | ||
553 | _builder.append(_referInstanceOf_40, "\t"); | ||
554 | _builder.newLineIfNotEmpty(); | ||
555 | _builder.append("\t"); | ||
556 | CharSequence _referPattern_7 = generator.getRelationDefinitionIndexer().referPattern(fqnToPQuery.get(ExtraInputOfTurnout.instance().getFullyQualifiedName()), new String[] { "source", "extraInput" }, Modality.MUST, true, false); | ||
557 | _builder.append(_referPattern_7, "\t"); | ||
558 | _builder.newLineIfNotEmpty(); | ||
559 | _builder.append("\t"); | ||
560 | CharSequence _referRelation_16 = generator.referRelation(Modes3UnitPropagationGenerator.this.connectedToRelation, "source", "potentialExtraInput", Modality.MUST, fqnToPQuery); | ||
561 | _builder.append(_referRelation_16, "\t"); | ||
562 | _builder.newLineIfNotEmpty(); | ||
563 | _builder.append("\t"); | ||
564 | _builder.append("neg "); | ||
565 | CharSequence _referRelation_17 = generator.referRelation(Modes3UnitPropagationGenerator.this.straightRelation, "source", "potentialExtraInput", Modality.MAY, fqnToPQuery); | ||
566 | _builder.append(_referRelation_17, "\t"); | ||
567 | _builder.newLineIfNotEmpty(); | ||
568 | _builder.append("\t"); | ||
569 | _builder.append("extraInput != potentialExtraInput;"); | ||
570 | _builder.newLine(); | ||
571 | _builder.append("\t"); | ||
572 | _builder.append("extraInput != target;"); | ||
573 | _builder.newLine(); | ||
574 | _builder.append("\t"); | ||
575 | _builder.append("potentialExtraInput != target;"); | ||
576 | _builder.newLine(); | ||
577 | _builder.append("}"); | ||
578 | _builder.newLine(); | ||
579 | } | ||
580 | }; | ||
581 | _xblockexpression = _client_2; | ||
582 | } | ||
583 | return _xblockexpression; | ||
584 | } | ||
585 | } | ||
diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/ModelGenerationMethodProvider.xtend b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/ModelGenerationMethodProvider.xtend index 56beacfa..431ae386 100644 --- a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/ModelGenerationMethodProvider.xtend +++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/ModelGenerationMethodProvider.xtend | |||
@@ -17,6 +17,7 @@ import hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.cardinality.Z3Polyhe | |||
17 | import hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.patterns.GeneratedPatterns | 17 | import hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.patterns.GeneratedPatterns |
18 | import hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.patterns.ModalPatternQueries | 18 | import hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.patterns.ModalPatternQueries |
19 | import hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.patterns.PatternProvider | 19 | import hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.patterns.PatternProvider |
20 | import hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.patterns.UnitPropagationPatternGenerator | ||
20 | import hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.rules.GoalConstraintProvider | 21 | import hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.rules.GoalConstraintProvider |
21 | import hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.rules.RefinementRuleProvider | 22 | import hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.rules.RefinementRuleProvider |
22 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.PartialInterpretation | 23 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.PartialInterpretation |
@@ -116,6 +117,7 @@ class ModelGenerationMethodProvider { | |||
116 | boolean calculateObjectCreationCosts, | 117 | boolean calculateObjectCreationCosts, |
117 | ScopePropagatorStrategy scopePropagatorStrategy, | 118 | ScopePropagatorStrategy scopePropagatorStrategy, |
118 | Collection<LinearTypeConstraintHint> hints, | 119 | Collection<LinearTypeConstraintHint> hints, |
120 | Collection<UnitPropagationPatternGenerator> unitPropagationPatternGenerators, | ||
119 | DocumentationLevel debugLevel | 121 | DocumentationLevel debugLevel |
120 | ) { | 122 | ) { |
121 | val statistics = new ModelGenerationStatistics | 123 | val statistics = new ModelGenerationStatistics |
@@ -126,7 +128,8 @@ class ModelGenerationMethodProvider { | |||
126 | 128 | ||
127 | val relationConstraints = relationConstraintCalculator.calculateRelationConstraints(logicProblem) | 129 | val relationConstraints = relationConstraintCalculator.calculateRelationConstraints(logicProblem) |
128 | val queries = patternProvider.generateQueries(logicProblem, emptySolution, statistics, existingQueries, | 130 | val queries = patternProvider.generateQueries(logicProblem, emptySolution, statistics, existingQueries, |
129 | workspace, typeInferenceMethod, scopePropagatorStrategy, relationConstraints, hints, writeFiles) | 131 | workspace, typeInferenceMethod, scopePropagatorStrategy, relationConstraints, hints, |
132 | unitPropagationPatternGenerators, writeFiles) | ||
130 | 133 | ||
131 | val scopePropagator = createScopePropagator(scopePropagatorStrategy, emptySolution, hints, queries, statistics) | 134 | val scopePropagator = createScopePropagator(scopePropagatorStrategy, emptySolution, hints, queries, statistics) |
132 | scopePropagator.propagateAllScopeConstraints | 135 | scopePropagator.propagateAllScopeConstraints |
diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/PatternGenerator.xtend b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/PatternGenerator.xtend index 80bc3844..a3efcf76 100644 --- a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/PatternGenerator.xtend +++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/PatternGenerator.xtend | |||
@@ -25,12 +25,13 @@ import java.util.HashMap | |||
25 | import java.util.Map | 25 | import java.util.Map |
26 | import org.eclipse.emf.ecore.EAttribute | 26 | import org.eclipse.emf.ecore.EAttribute |
27 | import org.eclipse.emf.ecore.EReference | 27 | import org.eclipse.emf.ecore.EReference |
28 | import org.eclipse.viatra.query.runtime.matchers.psystem.PConstraint | ||
28 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PQuery | 29 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PQuery |
29 | import org.eclipse.xtend.lib.annotations.Accessors | 30 | import org.eclipse.xtend.lib.annotations.Accessors |
31 | import org.eclipse.xtend.lib.annotations.Data | ||
32 | import org.eclipse.xtend2.lib.StringConcatenationClient | ||
30 | 33 | ||
31 | import static extension hu.bme.mit.inf.dslreasoner.util.CollectionsUtil.* | 34 | import static extension hu.bme.mit.inf.dslreasoner.util.CollectionsUtil.* |
32 | import org.eclipse.xtend.lib.annotations.Data | ||
33 | import org.eclipse.viatra.query.runtime.matchers.psystem.PConstraint | ||
34 | 35 | ||
35 | @Data class PatternGeneratorResult { | 36 | @Data class PatternGeneratorResult { |
36 | CharSequence patternText | 37 | CharSequence patternText |
@@ -38,6 +39,14 @@ import org.eclipse.viatra.query.runtime.matchers.psystem.PConstraint | |||
38 | HashMap<PConstraint,String> constraint2CurrentPreconditionName | 39 | HashMap<PConstraint,String> constraint2CurrentPreconditionName |
39 | } | 40 | } |
40 | 41 | ||
42 | interface UnitPropagationPatternGenerator { | ||
43 | def Map<Relation, String> getMustPatterns() | ||
44 | |||
45 | def Map<Relation, String> getMustNotPatterns() | ||
46 | |||
47 | def StringConcatenationClient getAdditionalPatterns(PatternGenerator generator, Map<String, PQuery> fqn2PQuery) | ||
48 | } | ||
49 | |||
41 | class PatternGenerator { | 50 | class PatternGenerator { |
42 | @Accessors(PUBLIC_GETTER) val TypeIndexer typeIndexer // = new TypeIndexer(this) | 51 | @Accessors(PUBLIC_GETTER) val TypeIndexer typeIndexer // = new TypeIndexer(this) |
43 | @Accessors(PUBLIC_GETTER) val RelationDeclarationIndexer relationDeclarationIndexer = new RelationDeclarationIndexer( | 52 | @Accessors(PUBLIC_GETTER) val RelationDeclarationIndexer relationDeclarationIndexer = new RelationDeclarationIndexer( |
@@ -157,7 +166,8 @@ class PatternGenerator { | |||
157 | Map<String, PQuery> fqn2PQuery, | 166 | Map<String, PQuery> fqn2PQuery, |
158 | TypeAnalysisResult typeAnalysisResult, | 167 | TypeAnalysisResult typeAnalysisResult, |
159 | RelationConstraints constraints, | 168 | RelationConstraints constraints, |
160 | Collection<LinearTypeConstraintHint> hints | 169 | Collection<LinearTypeConstraintHint> hints, |
170 | Collection<UnitPropagationPatternGenerator> unitPropagationPatternGenerators | ||
161 | ) { | 171 | ) { |
162 | val first = | 172 | val first = |
163 | ''' | 173 | ''' |
@@ -313,7 +323,7 @@ class PatternGenerator { | |||
313 | ////////// | 323 | ////////// |
314 | // 1.2 Relation Declaration Indexers | 324 | // 1.2 Relation Declaration Indexers |
315 | ////////// | 325 | ////////// |
316 | «relationDeclarationIndexer.generateRelationIndexers(problem,problem.relations.filter(RelationDeclaration),fqn2PQuery)» | 326 | «relationDeclarationIndexer.generateRelationIndexers(problem,problem.relations.filter(RelationDeclaration),unitPropagationPatternGenerators,fqn2PQuery)» |
317 | 327 | ||
318 | ////////// | 328 | ////////// |
319 | // 1.3 Relation Definition Indexers | 329 | // 1.3 Relation Definition Indexers |
@@ -367,6 +377,9 @@ class PatternGenerator { | |||
367 | «FOR hint : hints» | 377 | «FOR hint : hints» |
368 | «hint.getAdditionalPatterns(this)» | 378 | «hint.getAdditionalPatterns(this)» |
369 | «ENDFOR» | 379 | «ENDFOR» |
380 | «FOR generator : unitPropagationPatternGenerators» | ||
381 | «generator.getAdditionalPatterns(this, fqn2PQuery)» | ||
382 | «ENDFOR» | ||
370 | 383 | ||
371 | ////////// | 384 | ////////// |
372 | // 6 Unit Propagations | 385 | // 6 Unit Propagations |
diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/PatternProvider.xtend b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/PatternProvider.xtend index d57705ce..21fd1989 100644 --- a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/PatternProvider.xtend +++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/PatternProvider.xtend | |||
@@ -36,9 +36,9 @@ import static extension hu.bme.mit.inf.dslreasoner.util.CollectionsUtil.* | |||
36 | public Map<Relation, IQuerySpecification<? extends ViatraQueryMatcher<? extends IPatternMatch>>> unfinishedWFQueries | 36 | public Map<Relation, IQuerySpecification<? extends ViatraQueryMatcher<? extends IPatternMatch>>> unfinishedWFQueries |
37 | public Map<RelationMultiplicityConstraint, UnifinishedMultiplicityQueries> multiplicityConstraintQueries | 37 | public Map<RelationMultiplicityConstraint, UnifinishedMultiplicityQueries> multiplicityConstraintQueries |
38 | public IQuerySpecification<? extends ViatraQueryMatcher<? extends IPatternMatch>> hasElementInContainmentQuery | 38 | public IQuerySpecification<? extends ViatraQueryMatcher<? extends IPatternMatch>> hasElementInContainmentQuery |
39 | public Map<ObjectCreationPrecondition, IQuerySpecification<? extends ViatraQueryMatcher<? extends IPatternMatch>>> refineObjectQueries | 39 | public Map<ObjectCreationPrecondition, IQuerySpecification<? extends ViatraQueryMatcher<? extends IPatternMatch>>> refineObjectQueries |
40 | public Map<? extends Type, IQuerySpecification<? extends ViatraQueryMatcher<? extends IPatternMatch>>> refineTypeQueries | 40 | public Map<? extends Type, IQuerySpecification<? extends ViatraQueryMatcher<? extends IPatternMatch>>> refineTypeQueries |
41 | public Map<Pair<RelationDeclaration, Relation>, IQuerySpecification<? extends ViatraQueryMatcher<? extends IPatternMatch>>> refinerelationQueries | 41 | public Map<Pair<RelationDeclaration, Relation>, IQuerySpecification<? extends ViatraQueryMatcher<? extends IPatternMatch>>> refinerelationQueries |
42 | public Map<PConstraint, IQuerySpecification<? extends ViatraQueryMatcher<? extends IPatternMatch>>> mustUnitPropagationPreconditionPatterns | 42 | public Map<PConstraint, IQuerySpecification<? extends ViatraQueryMatcher<? extends IPatternMatch>>> mustUnitPropagationPreconditionPatterns |
43 | public Map<PConstraint, IQuerySpecification<? extends ViatraQueryMatcher<? extends IPatternMatch>>> currentUnitPropagationPreconditionPatterns | 43 | public Map<PConstraint, IQuerySpecification<? extends ViatraQueryMatcher<? extends IPatternMatch>>> currentUnitPropagationPreconditionPatterns |
44 | public Map<RelationDefinition, ModalPatternQueries> modalRelationQueries | 44 | public Map<RelationDefinition, ModalPatternQueries> modalRelationQueries |
@@ -56,7 +56,7 @@ class ModalPatternQueries { | |||
56 | class UnifinishedMultiplicityQueries { | 56 | class UnifinishedMultiplicityQueries { |
57 | val IQuerySpecification<? extends ViatraQueryMatcher<? extends IPatternMatch>> existingMultiplicityQuery | 57 | val IQuerySpecification<? extends ViatraQueryMatcher<? extends IPatternMatch>> existingMultiplicityQuery |
58 | val IQuerySpecification<? extends ViatraQueryMatcher<? extends IPatternMatch>> existingInverseMultiplicityQuery | 58 | val IQuerySpecification<? extends ViatraQueryMatcher<? extends IPatternMatch>> existingInverseMultiplicityQuery |
59 | 59 | ||
60 | def Set<IQuerySpecification<? extends ViatraQueryMatcher<? extends IPatternMatch>>> getAllQueries() { | 60 | def Set<IQuerySpecification<? extends ViatraQueryMatcher<? extends IPatternMatch>>> getAllQueries() { |
61 | val builder = ImmutableSet.builder | 61 | val builder = ImmutableSet.builder |
62 | if (existingMultiplicityQuery !== null) { | 62 | if (existingMultiplicityQuery !== null) { |
@@ -75,8 +75,9 @@ class PatternProvider { | |||
75 | 75 | ||
76 | def generateQueries(LogicProblem problem, PartialInterpretation emptySolution, ModelGenerationStatistics statistics, | 76 | def generateQueries(LogicProblem problem, PartialInterpretation emptySolution, ModelGenerationStatistics statistics, |
77 | Set<PQuery> existingQueries, ReasonerWorkspace workspace, TypeInferenceMethod typeInferenceMethod, | 77 | Set<PQuery> existingQueries, ReasonerWorkspace workspace, TypeInferenceMethod typeInferenceMethod, |
78 | ScopePropagatorStrategy scopePropagatorStrategy, RelationConstraints relationConstraints, | 78 | ScopePropagatorStrategy scopePropagatorStrategy, RelationConstraints relationConstraints, |
79 | Collection<LinearTypeConstraintHint> hints, boolean writeToFile) { | 79 | Collection<LinearTypeConstraintHint> hints, |
80 | Collection<UnitPropagationPatternGenerator> unitPropagationPatternGenerators, boolean writeToFile) { | ||
80 | val fqn2Query = existingQueries.toMap[it.fullyQualifiedName] | 81 | val fqn2Query = existingQueries.toMap[it.fullyQualifiedName] |
81 | val PatternGenerator patternGenerator = new PatternGenerator(typeInferenceMethod, scopePropagatorStrategy) | 82 | val PatternGenerator patternGenerator = new PatternGenerator(typeInferenceMethod, scopePropagatorStrategy) |
82 | val typeAnalysisResult = if (patternGenerator.requiresTypeAnalysis) { | 83 | val typeAnalysisResult = if (patternGenerator.requiresTypeAnalysis) { |
@@ -89,15 +90,15 @@ class PatternProvider { | |||
89 | null | 90 | null |
90 | } | 91 | } |
91 | val patternGeneratorResult = patternGenerator.transformBaseProperties(problem, emptySolution, fqn2Query, | 92 | val patternGeneratorResult = patternGenerator.transformBaseProperties(problem, emptySolution, fqn2Query, |
92 | typeAnalysisResult, relationConstraints, hints) | 93 | typeAnalysisResult, relationConstraints, hints, unitPropagationPatternGenerators) |
93 | if (writeToFile) { | 94 | if (writeToFile) { |
94 | workspace.writeText('''generated3valued.vql_deactivated''', patternGeneratorResult.patternText) | 95 | workspace.writeText('''generated3valued.vql_deactivated''', patternGeneratorResult.patternText) |
95 | } | 96 | } |
96 | val ParseUtil parseUtil = new ParseUtil | 97 | val ParseUtil parseUtil = new ParseUtil |
97 | val generatedQueries = parseUtil.parse(patternGeneratorResult.patternText) | 98 | val generatedQueries = parseUtil.parse(patternGeneratorResult.patternText) |
98 | val runtimeQueries = calclulateRuntimeQueries(patternGenerator, problem, emptySolution, typeAnalysisResult, | 99 | val runtimeQueries = calclulateRuntimeQueries(patternGenerator, problem, emptySolution, typeAnalysisResult, |
99 | patternGeneratorResult.constraint2MustPreconditionName, patternGeneratorResult.constraint2CurrentPreconditionName, | 100 | patternGeneratorResult.constraint2MustPreconditionName, |
100 | relationConstraints, generatedQueries) | 101 | patternGeneratorResult.constraint2CurrentPreconditionName, relationConstraints, generatedQueries) |
101 | return runtimeQueries | 102 | return runtimeQueries |
102 | } | 103 | } |
103 | 104 | ||
@@ -111,12 +112,13 @@ class PatternProvider { | |||
111 | RelationConstraints relationConstraints, | 112 | RelationConstraints relationConstraints, |
112 | Map<String, IQuerySpecification<? extends ViatraQueryMatcher<? extends IPatternMatch>>> queries | 113 | Map<String, IQuerySpecification<? extends ViatraQueryMatcher<? extends IPatternMatch>>> queries |
113 | ) { | 114 | ) { |
114 | val Map<Relation, IQuerySpecification<? extends ViatraQueryMatcher<? extends IPatternMatch>>> | 115 | val Map<Relation, IQuerySpecification<? extends ViatraQueryMatcher<? extends IPatternMatch>>> invalidWFQueries = patternGenerator. |
115 | invalidWFQueries = patternGenerator.invalidIndexer.getInvalidateByWfQueryNames(problem).mapValues[it.lookup(queries)] | 116 | invalidIndexer.getInvalidateByWfQueryNames(problem).mapValues[it.lookup(queries)] |
116 | val Map<Relation, IQuerySpecification<? extends ViatraQueryMatcher<? extends IPatternMatch>>> | 117 | val Map<Relation, IQuerySpecification<? extends ViatraQueryMatcher<? extends IPatternMatch>>> unfinishedWFQueries = patternGenerator. |
117 | unfinishedWFQueries = patternGenerator.unfinishedIndexer.getUnfinishedWFQueryNames(problem).mapValues[it.lookup(queries)] | 118 | unfinishedIndexer.getUnfinishedWFQueryNames(problem).mapValues[it.lookup(queries)] |
118 | 119 | ||
119 | val unfinishedMultiplicities = patternGenerator.unfinishedIndexer.getUnfinishedMultiplicityQueries(relationConstraints.multiplicityConstraints) | 120 | val unfinishedMultiplicities = patternGenerator.unfinishedIndexer.getUnfinishedMultiplicityQueries( |
121 | relationConstraints.multiplicityConstraints) | ||
120 | val multiplicityConstraintQueries = unfinishedMultiplicities.mapValues [ | 122 | val multiplicityConstraintQueries = unfinishedMultiplicities.mapValues [ |
121 | new UnifinishedMultiplicityQueries(existingMultiplicityQueryName?.lookup(queries), | 123 | new UnifinishedMultiplicityQueries(existingMultiplicityQueryName?.lookup(queries), |
122 | existingInverseMultiplicityQueryName?.lookup(queries)) | 124 | existingInverseMultiplicityQueryName?.lookup(queries)) |
@@ -124,16 +126,20 @@ class PatternProvider { | |||
124 | val hasElementInContainmentQuery = patternGenerator.typeRefinementGenerator.hasElementInContainmentName.lookup( | 126 | val hasElementInContainmentQuery = patternGenerator.typeRefinementGenerator.hasElementInContainmentName.lookup( |
125 | queries) | 127 | queries) |
126 | 128 | ||
127 | val Map<ObjectCreationPrecondition, IQuerySpecification<? extends ViatraQueryMatcher<? extends IPatternMatch>>> | 129 | val Map<ObjectCreationPrecondition, IQuerySpecification<? extends ViatraQueryMatcher<? extends IPatternMatch>>> refineObjectsQueries = patternGenerator. |
128 | refineObjectsQueries = patternGenerator.typeRefinementGenerator.getRefineObjectQueryNames(problem,emptySolution,typeAnalysisResult).mapValues[it.lookup(queries)] | 130 | typeRefinementGenerator.getRefineObjectQueryNames(problem, emptySolution, typeAnalysisResult).mapValues [ |
129 | val Map<? extends Type, IQuerySpecification<? extends ViatraQueryMatcher<? extends IPatternMatch>>> | 131 | it.lookup(queries) |
130 | refineTypeQueries = patternGenerator.typeRefinementGenerator.getRefineTypeQueryNames(problem,emptySolution,typeAnalysisResult).mapValues[it.lookup(queries)] | 132 | ] |
131 | val Map<Pair<RelationDeclaration, Relation>, IQuerySpecification<? extends ViatraQueryMatcher<? extends IPatternMatch>>> | 133 | val Map<? extends Type, IQuerySpecification<? extends ViatraQueryMatcher<? extends IPatternMatch>>> refineTypeQueries = patternGenerator. |
132 | refineRelationQueries = patternGenerator.relationRefinementGenerator.getRefineRelationQueries(problem).mapValues[it.lookup(queries)] | 134 | typeRefinementGenerator.getRefineTypeQueryNames(problem, emptySolution, typeAnalysisResult).mapValues [ |
133 | val Map<PConstraint, IQuerySpecification<? extends ViatraQueryMatcher<? extends IPatternMatch>>> | 135 | it.lookup(queries) |
134 | mustUnitPropagationPreconditionPatterns = mustUnitPropagationTrace.mapValues[it.lookup(queries)] | 136 | ] |
135 | val Map<PConstraint, IQuerySpecification<? extends ViatraQueryMatcher<? extends IPatternMatch>>> | 137 | val Map<Pair<RelationDeclaration, Relation>, IQuerySpecification<? extends ViatraQueryMatcher<? extends IPatternMatch>>> refineRelationQueries = patternGenerator. |
136 | currentUnitPropagationPreconditionPatterns = currentUnitPropagationTrace.mapValues[it.lookup(queries)] | 138 | relationRefinementGenerator.getRefineRelationQueries(problem).mapValues[it.lookup(queries)] |
139 | val Map<PConstraint, IQuerySpecification<? extends ViatraQueryMatcher<? extends IPatternMatch>>> mustUnitPropagationPreconditionPatterns = mustUnitPropagationTrace. | ||
140 | mapValues[it.lookup(queries)] | ||
141 | val Map<PConstraint, IQuerySpecification<? extends ViatraQueryMatcher<? extends IPatternMatch>>> currentUnitPropagationPreconditionPatterns = currentUnitPropagationTrace. | ||
142 | mapValues[it.lookup(queries)] | ||
137 | 143 | ||
138 | val modalRelationQueries = problem.relations.filter(RelationDefinition).toMap([it], [ relationDefinition | | 144 | val modalRelationQueries = problem.relations.filter(RelationDefinition).toMap([it], [ relationDefinition | |
139 | val indexer = patternGenerator.relationDefinitionIndexer | 145 | val indexer = patternGenerator.relationDefinitionIndexer |
@@ -143,7 +149,7 @@ class PatternProvider { | |||
143 | indexer.relationDefinitionName(relationDefinition, Modality.CURRENT).lookup(queries) | 149 | indexer.relationDefinitionName(relationDefinition, Modality.CURRENT).lookup(queries) |
144 | ) | 150 | ) |
145 | ]) | 151 | ]) |
146 | 152 | ||
147 | return new GeneratedPatterns( | 153 | return new GeneratedPatterns( |
148 | invalidWFQueries, | 154 | invalidWFQueries, |
149 | unfinishedWFQueries, | 155 | unfinishedWFQueries, |
diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/RelationDeclarationIndexer.xtend b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/RelationDeclarationIndexer.xtend index b4403979..29d3eb61 100644 --- a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/RelationDeclarationIndexer.xtend +++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/patterns/RelationDeclarationIndexer.xtend | |||
@@ -1,10 +1,13 @@ | |||
1 | package hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.patterns | 1 | package hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.patterns |
2 | 2 | ||
3 | import com.google.common.collect.ImmutableMap | ||
4 | import com.google.common.collect.ImmutableSet | ||
3 | import hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.UpperMultiplicityAssertion | 5 | import hu.bme.mit.inf.dslreasoner.ecore2logic.ecore2logicannotations.UpperMultiplicityAssertion |
4 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Relation | 6 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Relation |
5 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.RelationDeclaration | 7 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.RelationDeclaration |
6 | import hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.LogicProblem | 8 | import hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.LogicProblem |
7 | import hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.Modality | 9 | import hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.Modality |
10 | import java.util.Collection | ||
8 | import java.util.HashMap | 11 | import java.util.HashMap |
9 | import java.util.List | 12 | import java.util.List |
10 | import java.util.Map | 13 | import java.util.Map |
@@ -14,41 +17,40 @@ import static extension hu.bme.mit.inf.dslreasoner.util.CollectionsUtil.* | |||
14 | 17 | ||
15 | class RelationDeclarationIndexer { | 18 | class RelationDeclarationIndexer { |
16 | val PatternGenerator base; | 19 | val PatternGenerator base; |
17 | 20 | ||
18 | new(PatternGenerator base) { | 21 | new(PatternGenerator base) { |
19 | this.base = base | 22 | this.base = base |
20 | } | 23 | } |
21 | 24 | ||
22 | def generateRelationIndexers(LogicProblem problem, Iterable<RelationDeclaration> relations, Map<String,PQuery> fqn2PQuery) { | 25 | def generateRelationIndexers(LogicProblem problem, Iterable<RelationDeclaration> relations, |
26 | Iterable<UnitPropagationPatternGenerator> unitPropagationPatternGenerators, Map<String, PQuery> fqn2PQuery) { | ||
23 | val upperMultiplicities = new HashMap | 27 | val upperMultiplicities = new HashMap |
24 | problem.annotations.filter(UpperMultiplicityAssertion).forEach[ | 28 | problem.annotations.filter(UpperMultiplicityAssertion).forEach [ |
25 | upperMultiplicities.put(it.relation,it.upper) | 29 | upperMultiplicities.put(it.relation, it.upper) |
26 | ] | 30 | ] |
27 | 31 | val mustNotRelations = ImmutableMap.copyOf(unitPropagationPatternGenerators.flatMap[mustNotPatterns.entrySet]. | |
32 | groupBy[key].mapValues[ImmutableSet.copyOf(map[value])]) | ||
33 | |||
28 | return ''' | 34 | return ''' |
29 | «FOR relation : relations» | 35 | «FOR relation : relations» |
30 | «IF base.isDerived(relation)» | 36 | «IF base.isDerived(relation)» |
31 | «generateDerivedMustRelation(problem,relation,base.getDerivedDefinition(relation).patternFullyQualifiedName.lookup(fqn2PQuery))» | 37 | «generateDerivedMustRelation(problem,relation,base.getDerivedDefinition(relation).patternFullyQualifiedName.lookup(fqn2PQuery))» |
32 | «generateDerivedMayRelation(problem,relation,base.getDerivedDefinition(relation).patternFullyQualifiedName.lookup(fqn2PQuery))» | 38 | «generateDerivedMayRelation(problem,relation,base.getDerivedDefinition(relation).patternFullyQualifiedName.lookup(fqn2PQuery))» |
33 | «ELSE» | 39 | «ELSE» |
34 | «generateMustRelation(problem,relation)» | 40 | «generateMustRelation(problem, relation)» |
35 | «generateMayRelation(problem,relation,upperMultiplicities,base.getContainments(problem),base.getInverseRelations(problem),fqn2PQuery)» | 41 | «generateMayRelation(problem, relation, upperMultiplicities, base.getContainments(problem), base.getInverseRelations(problem), mustNotRelations.get(relation) ?: emptySet, fqn2PQuery)» |
36 | «ENDIF» | 42 | «ENDIF» |
37 | «ENDFOR» | 43 | «ENDFOR» |
38 | ''' | 44 | ''' |
39 | } | 45 | } |
40 | 46 | ||
41 | def private patternName(RelationDeclaration r, Modality modality) { | 47 | def private patternName(RelationDeclaration r, Modality modality) { |
42 | '''«modality.name.toLowerCase»InRelation«base.canonizeName(r.name)»''' | 48 | '''«modality.name.toLowerCase»InRelation«base.canonizeName(r.name)»''' |
43 | } | 49 | } |
44 | 50 | ||
45 | def referRelation( | 51 | def referRelation(RelationDeclaration referred, String sourceVariable, String targetVariable, |
46 | RelationDeclaration referred, | 52 | Modality modality) '''find «referred.patternName(modality)»(problem,interpretation,«sourceVariable»,«targetVariable»);''' |
47 | String sourceVariable, | 53 | |
48 | String targetVariable, | ||
49 | Modality modality) | ||
50 | '''find «referred.patternName(modality)»(problem,interpretation,«sourceVariable»,«targetVariable»);''' | ||
51 | |||
52 | def generateMustRelation(LogicProblem problem, RelationDeclaration relation) ''' | 54 | def generateMustRelation(LogicProblem problem, RelationDeclaration relation) ''' |
53 | /** | 55 | /** |
54 | * Matcher for detecting tuples t where []«relation.name»(source,target) | 56 | * Matcher for detecting tuples t where []«relation.name»(source,target) |
@@ -65,59 +67,64 @@ class RelationDeclarationIndexer { | |||
65 | BinaryElementRelationLink.param2(link,target); | 67 | BinaryElementRelationLink.param2(link,target); |
66 | } | 68 | } |
67 | ''' | 69 | ''' |
70 | |||
68 | def generateMayRelation(LogicProblem problem, RelationDeclaration relation, | 71 | def generateMayRelation(LogicProblem problem, RelationDeclaration relation, |
69 | Map<Relation, Integer> upperMultiplicities, | 72 | Map<Relation, Integer> upperMultiplicities, List<Relation> containments, |
70 | List<Relation> containments, | 73 | HashMap<Relation, Relation> inverseRelations, Collection<String> mustNotRelations, |
71 | HashMap<Relation, Relation> inverseRelations, | 74 | Map<String, PQuery> fqn2PQuery) { |
72 | Map<String,PQuery> fqn2PQuery) | ||
73 | { | ||
74 | return ''' | 75 | return ''' |
75 | /** | 76 | /** |
76 | * Matcher for detecting tuples t where <>«relation.name»(source,target) | 77 | * Matcher for detecting tuples t where <>«relation.name»(source,target) |
77 | */ | 78 | */ |
78 | private pattern «relation.patternName(Modality.MAY)»( | 79 | private pattern «relation.patternName(Modality.MAY)»( |
79 | problem:LogicProblem, interpretation:PartialInterpretation, | 80 | problem:LogicProblem, interpretation:PartialInterpretation, |
80 | source: DefinedElement, target:DefinedElement) | 81 | source: DefinedElement, target:DefinedElement) |
81 | { | 82 | { |
82 | find interpretation(problem,interpretation); | 83 | find interpretation(problem,interpretation); |
83 | // The two endpoint of the link have to exist | 84 | // The two endpoint of the link have to exist |
84 | find mayExist(problem, interpretation, source); | 85 | find mayExist(problem, interpretation, source); |
85 | find mayExist(problem, interpretation, target); | 86 | find mayExist(problem, interpretation, target); |
86 | // Type consistency | 87 | // Type consistency |
87 | «base.typeIndexer.referInstanceOfByReference(relation.parameters.get(0),Modality.MAY,"source")» | 88 | «base.typeIndexer.referInstanceOfByReference(relation.parameters.get(0),Modality.MAY,"source")» |
88 | «base.typeIndexer.referInstanceOfByReference(relation.parameters.get(1),Modality.MAY,"target")» | 89 | «base.typeIndexer.referInstanceOfByReference(relation.parameters.get(1),Modality.MAY,"target")» |
89 | «IF upperMultiplicities.containsKey(relation)» | 90 | «IF upperMultiplicities.containsKey(relation)» |
90 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | 91 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, |
91 | // the upper bound of the multiplicity should be considered. | 92 | // the upper bound of the multiplicity should be considered. |
92 | numberOfExistingReferences == count «referRelation(relation,"source","_",Modality.MUST)» | 93 | numberOfExistingReferences == count «referRelation(relation,"source","_",Modality.MUST)» |
93 | numberOfExistingReferences != «upperMultiplicities.get(relation)»; | 94 | numberOfExistingReferences != «upperMultiplicities.get(relation)»; |
94 | «ENDIF» | 95 | «ENDIF» |
95 | «IF inverseRelations.containsKey(relation) && upperMultiplicities.containsKey(inverseRelations.get(relation))» | 96 | «IF inverseRelations.containsKey(relation) && upperMultiplicities.containsKey(inverseRelations.get(relation))» |
96 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | 97 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, |
97 | // the upper bound of the opposite reference multiplicity should be considered. | 98 | // the upper bound of the opposite reference multiplicity should be considered. |
98 | numberOfExistingOppositeReferences == count «base.referRelation(inverseRelations.get(relation),"target","_",Modality.MUST,fqn2PQuery)» | 99 | numberOfExistingOppositeReferences == count «base.referRelation(inverseRelations.get(relation),"target","_",Modality.MUST,fqn2PQuery)» |
99 | numberOfExistingOppositeReferences != «upperMultiplicities.get(inverseRelations.get(relation))»; | 100 | numberOfExistingOppositeReferences != «upperMultiplicities.get(inverseRelations.get(relation))»; |
100 | «ENDIF» | 101 | «ENDIF» |
101 | «IF containments.contains(relation)» | 102 | «IF containments.contains(relation)» |
102 | // The reference is containment, then a new reference cannot be create if: | 103 | // The reference is containment, then a new reference cannot be create if: |
103 | // 1. Multiple parents | 104 | // 1. Multiple parents |
104 | neg «base.containmentIndexer.referMustContaint("_","target")» | 105 | neg «base.containmentIndexer.referMustContaint("_","target")» |
105 | // 2. Circle in the containment hierarchy | 106 | // 2. Circle in the containment hierarchy |
106 | neg «base.containmentIndexer.referTransitiveMustContains("target","source")» | 107 | neg «base.containmentIndexer.referTransitiveMustContains("target","source")» |
107 | «ENDIF» | 108 | «ENDIF» |
108 | «IF inverseRelations.containsKey(relation) && containments.contains(inverseRelations.get(relation))» | 109 | «IF inverseRelations.containsKey(relation) && containments.contains(inverseRelations.get(relation))» |
109 | // The eOpposite of the reference is containment, then a referene cannot be created if | 110 | // The eOpposite of the reference is containment, then a referene cannot be created if |
110 | // 1. Multiple parents | 111 | // 1. Multiple parents |
111 | neg «base.containmentIndexer.referMustContaint("source","_")» | 112 | neg «base.containmentIndexer.referMustContaint("source","_")» |
112 | // 2. Circle in the containment hierarchy | 113 | // 2. Circle in the containment hierarchy |
113 | neg «base.containmentIndexer.referTransitiveMustContains("source","target")» | 114 | neg «base.containmentIndexer.referTransitiveMustContains("source","target")» |
114 | «ENDIF» | 115 | «ENDIF» |
115 | } or { | 116 | «IF mustNotRelations.empty» |
116 | «relation.referRelation("source","target",Modality.MUST)» | 117 | // ![] unit propagation relations |
117 | } | 118 | «FOR mustNotRelation : mustNotRelations» |
118 | ''' | 119 | neg find «mustNotRelation»(problem, interpretation, source, target); |
120 | «ENDFOR» | ||
121 | «ENDIF» | ||
122 | } or { | ||
123 | «relation.referRelation("source","target",Modality.MUST)» | ||
124 | } | ||
125 | ''' | ||
119 | } | 126 | } |
120 | 127 | ||
121 | def generateDerivedMustRelation(LogicProblem problem, RelationDeclaration relation, PQuery definition) ''' | 128 | def generateDerivedMustRelation(LogicProblem problem, RelationDeclaration relation, PQuery definition) ''' |
122 | /** | 129 | /** |
123 | * Matcher for detecting tuples t where []«relation.name»(source,target) | 130 | * Matcher for detecting tuples t where []«relation.name»(source,target) |
@@ -129,6 +136,7 @@ class RelationDeclarationIndexer { | |||
129 | «base.relationDefinitionIndexer.referPattern(definition,#["source","target"],Modality::MUST,true,false)» | 136 | «base.relationDefinitionIndexer.referPattern(definition,#["source","target"],Modality::MUST,true,false)» |
130 | } | 137 | } |
131 | ''' | 138 | ''' |
139 | |||
132 | def generateDerivedMayRelation(LogicProblem problem, RelationDeclaration relation, PQuery definition) ''' | 140 | def generateDerivedMayRelation(LogicProblem problem, RelationDeclaration relation, PQuery definition) ''' |
133 | /** | 141 | /** |
134 | * Matcher for detecting tuples t where []«relation.name»(source,target) | 142 | * Matcher for detecting tuples t where []«relation.name»(source,target) |
@@ -140,4 +148,4 @@ class RelationDeclarationIndexer { | |||
140 | «base.relationDefinitionIndexer.referPattern(definition,#["source","target"],Modality::MAY,true,false)» | 148 | «base.relationDefinitionIndexer.referPattern(definition,#["source","target"],Modality::MAY,true,false)» |
141 | } | 149 | } |
142 | ''' | 150 | ''' |
143 | } \ No newline at end of file | 151 | } |
diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/ViatraReasoner.xtend b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/ViatraReasoner.xtend index c333feca..67d25208 100644 --- a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/ViatraReasoner.xtend +++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/ViatraReasoner.xtend | |||
@@ -91,6 +91,7 @@ class ViatraReasoner extends LogicReasoner { | |||
91 | viatraConfig.calculateObjectCreationCosts, | 91 | viatraConfig.calculateObjectCreationCosts, |
92 | viatraConfig.scopePropagatorStrategy, | 92 | viatraConfig.scopePropagatorStrategy, |
93 | viatraConfig.hints, | 93 | viatraConfig.hints, |
94 | viatraConfig.unitPropagationPatternGenerators, | ||
94 | viatraConfig.documentationLevel | 95 | viatraConfig.documentationLevel |
95 | ) | 96 | ) |
96 | 97 | ||
diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/ViatraReasonerConfiguration.xtend b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/ViatraReasonerConfiguration.xtend index 0173124c..a2ed6016 100644 --- a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/ViatraReasonerConfiguration.xtend +++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/ViatraReasonerConfiguration.xtend | |||
@@ -6,9 +6,11 @@ import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.RelationDeclaration | |||
6 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.TypeDeclaration | 6 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.TypeDeclaration |
7 | import hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.ModelGenerationMethod | 7 | import hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.ModelGenerationMethod |
8 | import hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.TypeInferenceMethod | 8 | import hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.TypeInferenceMethod |
9 | import hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.cardinality.LinearTypeConstraintHint | ||
9 | import hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.cardinality.PolyhedralScopePropagatorConstraints | 10 | import hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.cardinality.PolyhedralScopePropagatorConstraints |
10 | import hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.cardinality.PolyhedralScopePropagatorSolver | 11 | import hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.cardinality.PolyhedralScopePropagatorSolver |
11 | import hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.cardinality.ScopePropagatorStrategy | 12 | import hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.cardinality.ScopePropagatorStrategy |
13 | import hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.patterns.UnitPropagationPatternGenerator | ||
12 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.visualisation.PartialInterpretationVisualiser | 14 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.visualisation.PartialInterpretationVisualiser |
13 | import hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner.optimization.ObjectiveKind | 15 | import hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner.optimization.ObjectiveKind |
14 | import hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner.optimization.ObjectiveThreshold | 16 | import hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner.optimization.ObjectiveThreshold |
@@ -16,7 +18,6 @@ import java.util.LinkedList | |||
16 | import java.util.List | 18 | import java.util.List |
17 | import java.util.Set | 19 | import java.util.Set |
18 | import org.eclipse.xtext.xbase.lib.Functions.Function1 | 20 | import org.eclipse.xtext.xbase.lib.Functions.Function1 |
19 | import hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.cardinality.LinearTypeConstraintHint | ||
20 | 21 | ||
21 | enum StateCoderStrategy { | 22 | enum StateCoderStrategy { |
22 | Neighbourhood, | 23 | Neighbourhood, |
@@ -77,6 +78,8 @@ class ViatraReasonerConfiguration extends LogicSolverConfiguration { | |||
77 | public var List<LinearTypeConstraintHint> hints = newArrayList | 78 | public var List<LinearTypeConstraintHint> hints = newArrayList |
78 | 79 | ||
79 | public var List<CostObjectiveConfiguration> costObjectives = newArrayList | 80 | public var List<CostObjectiveConfiguration> costObjectives = newArrayList |
81 | |||
82 | public var List<UnitPropagationPatternGenerator> unitPropagationPatternGenerators = newArrayList | ||
80 | } | 83 | } |
81 | 84 | ||
82 | class DiversityDescriptor { | 85 | class DiversityDescriptor { |