diff options
Diffstat (limited to 'Solvers/Alloy-Solver/hu.bme.mit.inf.dslreasoner.alloy.language')
20 files changed, 1162 insertions, 0 deletions
diff --git a/Solvers/Alloy-Solver/hu.bme.mit.inf.dslreasoner.alloy.language/.classpath b/Solvers/Alloy-Solver/hu.bme.mit.inf.dslreasoner.alloy.language/.classpath new file mode 100644 index 00000000..5c568755 --- /dev/null +++ b/Solvers/Alloy-Solver/hu.bme.mit.inf.dslreasoner.alloy.language/.classpath | |||
@@ -0,0 +1,9 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8"?> | ||
2 | <classpath> | ||
3 | <classpathentry kind="src" path="src"/> | ||
4 | <classpathentry kind="src" path="src-gen"/> | ||
5 | <classpathentry kind="src" path="xtend-gen"/> | ||
6 | <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> | ||
7 | <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> | ||
8 | <classpathentry kind="output" path="bin"/> | ||
9 | </classpath> | ||
diff --git a/Solvers/Alloy-Solver/hu.bme.mit.inf.dslreasoner.alloy.language/.gitignore b/Solvers/Alloy-Solver/hu.bme.mit.inf.dslreasoner.alloy.language/.gitignore new file mode 100644 index 00000000..8ae4e44d --- /dev/null +++ b/Solvers/Alloy-Solver/hu.bme.mit.inf.dslreasoner.alloy.language/.gitignore | |||
@@ -0,0 +1,4 @@ | |||
1 | /bin/ | ||
2 | /src-gen/ | ||
3 | /vql-gen/ | ||
4 | /xtend-gen/ | ||
diff --git a/Solvers/Alloy-Solver/hu.bme.mit.inf.dslreasoner.alloy.language/.launch/Generate Language Infrastructure (hu.bme.mit.inf.dslreasoner.alloy.language).launch b/Solvers/Alloy-Solver/hu.bme.mit.inf.dslreasoner.alloy.language/.launch/Generate Language Infrastructure (hu.bme.mit.inf.dslreasoner.alloy.language).launch new file mode 100644 index 00000000..77031bf1 --- /dev/null +++ b/Solvers/Alloy-Solver/hu.bme.mit.inf.dslreasoner.alloy.language/.launch/Generate Language Infrastructure (hu.bme.mit.inf.dslreasoner.alloy.language).launch | |||
@@ -0,0 +1,18 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
2 | <launchConfiguration type="org.eclipse.emf.mwe2.launch.Mwe2LaunchConfigurationType"> | ||
3 | <stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${working_set:<?xml version="1.0" encoding="UTF-8"?> <launchConfigurationWorkingSet factoryID="org.eclipse.ui.internal.WorkingSetFactory" id="1299248699643_13" label="working set" name="working set"> <item factoryID="org.eclipse.ui.internal.model.ResourceFactory" path="/hu.bme.mit.inf.dslreasoner.alloy.language" type="4"/> <item factoryID="org.eclipse.ui.internal.model.ResourceFactory" path="/hu.bme.mit.inf.dslreasoner.alloy.language.generator" type="4"/> <item factoryID="org.eclipse.ui.internal.model.ResourceFactory" path="/hu.bme.mit.inf.dslreasoner.alloy.language.tests" type="4"/> <item factoryID="org.eclipse.ui.internal.model.ResourceFactory" path="/hu.bme.mit.inf.dslreasoner.alloy.language.ui" type="4"/> </launchConfigurationWorkingSet>}"/> | ||
4 | <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"> | ||
5 | <listEntry value="/hu.bme.mit.inf.dslreasoner.alloy.language"/> | ||
6 | </listAttribute> | ||
7 | <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"> | ||
8 | <listEntry value="4"/> | ||
9 | </listAttribute> | ||
10 | <listAttribute key="org.eclipse.debug.ui.favoriteGroups"> | ||
11 | <listEntry value="org.eclipse.debug.ui.launchGroup.debug"/> | ||
12 | <listEntry value="org.eclipse.debug.ui.launchGroup.run"/> | ||
13 | </listAttribute> | ||
14 | <stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher"/> | ||
15 | <stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="src/hu/bme/mit/inf/dslreasoner/GenerateAlloyLanguage.mwe2"/> | ||
16 | <stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="hu.bme.mit.inf.dslreasoner.alloy.language"/> | ||
17 | <stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx512m"/> | ||
18 | </launchConfiguration> | ||
diff --git a/Solvers/Alloy-Solver/hu.bme.mit.inf.dslreasoner.alloy.language/.project b/Solvers/Alloy-Solver/hu.bme.mit.inf.dslreasoner.alloy.language/.project new file mode 100644 index 00000000..d33a2394 --- /dev/null +++ b/Solvers/Alloy-Solver/hu.bme.mit.inf.dslreasoner.alloy.language/.project | |||
@@ -0,0 +1,34 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8"?> | ||
2 | <projectDescription> | ||
3 | <name>hu.bme.mit.inf.dslreasoner.alloy.language</name> | ||
4 | <comment></comment> | ||
5 | <projects> | ||
6 | </projects> | ||
7 | <buildSpec> | ||
8 | <buildCommand> | ||
9 | <name>org.eclipse.jdt.core.javabuilder</name> | ||
10 | <arguments> | ||
11 | </arguments> | ||
12 | </buildCommand> | ||
13 | <buildCommand> | ||
14 | <name>org.eclipse.pde.ManifestBuilder</name> | ||
15 | <arguments> | ||
16 | </arguments> | ||
17 | </buildCommand> | ||
18 | <buildCommand> | ||
19 | <name>org.eclipse.pde.SchemaBuilder</name> | ||
20 | <arguments> | ||
21 | </arguments> | ||
22 | </buildCommand> | ||
23 | <buildCommand> | ||
24 | <name>org.eclipse.xtext.ui.shared.xtextBuilder</name> | ||
25 | <arguments> | ||
26 | </arguments> | ||
27 | </buildCommand> | ||
28 | </buildSpec> | ||
29 | <natures> | ||
30 | <nature>org.eclipse.jdt.core.javanature</nature> | ||
31 | <nature>org.eclipse.pde.PluginNature</nature> | ||
32 | <nature>org.eclipse.xtext.ui.shared.xtextNature</nature> | ||
33 | </natures> | ||
34 | </projectDescription> | ||
diff --git a/Solvers/Alloy-Solver/hu.bme.mit.inf.dslreasoner.alloy.language/.settings/org.eclipse.core.resources.prefs b/Solvers/Alloy-Solver/hu.bme.mit.inf.dslreasoner.alloy.language/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 00000000..4824b802 --- /dev/null +++ b/Solvers/Alloy-Solver/hu.bme.mit.inf.dslreasoner.alloy.language/.settings/org.eclipse.core.resources.prefs | |||
@@ -0,0 +1,2 @@ | |||
1 | eclipse.preferences.version=1 | ||
2 | encoding/<project>=UTF-8 | ||
diff --git a/Solvers/Alloy-Solver/hu.bme.mit.inf.dslreasoner.alloy.language/.settings/org.eclipse.jdt.core.prefs b/Solvers/Alloy-Solver/hu.bme.mit.inf.dslreasoner.alloy.language/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..ace45cee --- /dev/null +++ b/Solvers/Alloy-Solver/hu.bme.mit.inf.dslreasoner.alloy.language/.settings/org.eclipse.jdt.core.prefs | |||
@@ -0,0 +1,12 @@ | |||
1 | eclipse.preferences.version=1 | ||
2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled | ||
3 | org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate | ||
4 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 | ||
5 | org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve | ||
6 | org.eclipse.jdt.core.compiler.compliance=1.8 | ||
7 | org.eclipse.jdt.core.compiler.debug.lineNumber=generate | ||
8 | org.eclipse.jdt.core.compiler.debug.localVariable=generate | ||
9 | org.eclipse.jdt.core.compiler.debug.sourceFile=generate | ||
10 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error | ||
11 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error | ||
12 | org.eclipse.jdt.core.compiler.source=1.8 | ||
diff --git a/Solvers/Alloy-Solver/hu.bme.mit.inf.dslreasoner.alloy.language/META-INF/MANIFEST.MF b/Solvers/Alloy-Solver/hu.bme.mit.inf.dslreasoner.alloy.language/META-INF/MANIFEST.MF new file mode 100644 index 00000000..1de8b744 --- /dev/null +++ b/Solvers/Alloy-Solver/hu.bme.mit.inf.dslreasoner.alloy.language/META-INF/MANIFEST.MF | |||
@@ -0,0 +1,37 @@ | |||
1 | Manifest-Version: 1.0 | ||
2 | Bundle-ManifestVersion: 2 | ||
3 | Bundle-Name: hu.bme.mit.inf.dslreasoner.alloy.language | ||
4 | Bundle-Vendor: My Company | ||
5 | Bundle-Version: 1.0.0.qualifier | ||
6 | Bundle-SymbolicName: hu.bme.mit.inf.dslreasoner.alloy.language; singleton:=true | ||
7 | Bundle-ActivationPolicy: lazy | ||
8 | Require-Bundle: org.eclipse.xtext;visibility:=reexport, | ||
9 | org.eclipse.xtext.xbase;resolution:=optional;visibility:=reexport, | ||
10 | org.eclipse.xtext.generator;resolution:=optional, | ||
11 | org.apache.commons.logging;bundle-version="1.0.4";resolution:=optional, | ||
12 | org.eclipse.emf.codegen.ecore;resolution:=optional, | ||
13 | org.eclipse.emf.mwe.utils;resolution:=optional, | ||
14 | org.eclipse.emf.mwe2.launch;resolution:=optional, | ||
15 | org.eclipse.xtext.util, | ||
16 | org.eclipse.emf.ecore, | ||
17 | org.eclipse.emf.common, | ||
18 | org.eclipse.xtext.xbase.lib, | ||
19 | org.antlr.runtime, | ||
20 | org.eclipse.xtext.common.types, | ||
21 | org.objectweb.asm;bundle-version="[5.0.1,6.0.0)";resolution:=optional, | ||
22 | org.eclipse.equinox.common;bundle-version="3.7.0" | ||
23 | Import-Package: org.apache.log4j | ||
24 | Bundle-RequiredExecutionEnvironment: JavaSE-1.7 | ||
25 | Export-Package: hu.bme.mit.inf.dslreasoner, | ||
26 | hu.bme.mit.inf.dslreasoner.services, | ||
27 | hu.bme.mit.inf.dslreasoner.alloyLanguage, | ||
28 | hu.bme.mit.inf.dslreasoner.alloyLanguage.impl, | ||
29 | hu.bme.mit.inf.dslreasoner.alloyLanguage.util, | ||
30 | hu.bme.mit.inf.dslreasoner.serializer, | ||
31 | hu.bme.mit.inf.dslreasoner.parser.antlr, | ||
32 | hu.bme.mit.inf.dslreasoner.parser.antlr.internal, | ||
33 | hu.bme.mit.inf.dslreasoner.validation, | ||
34 | hu.bme.mit.inf.dslreasoner.scoping, | ||
35 | hu.bme.mit.inf.dslreasoner.generator, | ||
36 | hu.bme.mit.inf.dslreasoner.formatting | ||
37 | |||
diff --git a/Solvers/Alloy-Solver/hu.bme.mit.inf.dslreasoner.alloy.language/build.properties b/Solvers/Alloy-Solver/hu.bme.mit.inf.dslreasoner.alloy.language/build.properties new file mode 100644 index 00000000..07a42688 --- /dev/null +++ b/Solvers/Alloy-Solver/hu.bme.mit.inf.dslreasoner.alloy.language/build.properties | |||
@@ -0,0 +1,7 @@ | |||
1 | source.. = src/,\ | ||
2 | src-gen/,\ | ||
3 | xtend-gen/ | ||
4 | bin.includes = model/,\ | ||
5 | META-INF/,\ | ||
6 | .,\ | ||
7 | plugin.xml \ No newline at end of file | ||
diff --git a/Solvers/Alloy-Solver/hu.bme.mit.inf.dslreasoner.alloy.language/model/generated/AlloyLanguage.ecore b/Solvers/Alloy-Solver/hu.bme.mit.inf.dslreasoner.alloy.language/model/generated/AlloyLanguage.ecore new file mode 100644 index 00000000..a825966e --- /dev/null +++ b/Solvers/Alloy-Solver/hu.bme.mit.inf.dslreasoner.alloy.language/model/generated/AlloyLanguage.ecore | |||
@@ -0,0 +1,267 @@ | |||
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="alloyLanguage" nsURI="http://www.bme.hu/mit/inf/dslreasoner/AlloyLanguage" | ||
4 | nsPrefix="alloyLanguage"> | ||
5 | <eClassifiers xsi:type="ecore:EClass" name="ALSDocument"> | ||
6 | <eStructuralFeatures xsi:type="ecore:EReference" name="enumDeclarations" upperBound="-1" | ||
7 | eType="#//ALSEnumDeclaration" containment="true"/> | ||
8 | <eStructuralFeatures xsi:type="ecore:EReference" name="signatureBodies" upperBound="-1" | ||
9 | eType="#//ALSSignatureBody" containment="true"/> | ||
10 | <eStructuralFeatures xsi:type="ecore:EReference" name="functionDefinitions" upperBound="-1" | ||
11 | eType="#//ALSFunctionDefinition" containment="true"/> | ||
12 | <eStructuralFeatures xsi:type="ecore:EReference" name="relationDefinitions" upperBound="-1" | ||
13 | eType="#//ALSRelationDefinition" containment="true"/> | ||
14 | <eStructuralFeatures xsi:type="ecore:EReference" name="factDeclarations" upperBound="-1" | ||
15 | eType="#//ALSFactDeclaration" containment="true"/> | ||
16 | <eStructuralFeatures xsi:type="ecore:EReference" name="runCommand" eType="#//ALSRunCommand" | ||
17 | containment="true"/> | ||
18 | </eClassifiers> | ||
19 | <eClassifiers xsi:type="ecore:EEnum" name="ALSMultiplicity"> | ||
20 | <eLiterals name="all" literal="all"/> | ||
21 | <eLiterals name="no" value="1" literal="no"/> | ||
22 | <eLiterals name="some" value="2" literal="some"/> | ||
23 | <eLiterals name="lone" value="3" literal="lone"/> | ||
24 | <eLiterals name="one" value="4" literal="one"/> | ||
25 | <eLiterals name="set" value="5" literal="set"/> | ||
26 | </eClassifiers> | ||
27 | <eClassifiers xsi:type="ecore:EClass" name="ALSRelationDeclaration"> | ||
28 | <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/> | ||
29 | </eClassifiers> | ||
30 | <eClassifiers xsi:type="ecore:EClass" name="ALSTypeDeclaration" eSuperTypes="#//ALSRelationDeclaration"/> | ||
31 | <eClassifiers xsi:type="ecore:EClass" name="ALSEnumDeclaration" eSuperTypes="#//ALSTypeDeclaration"> | ||
32 | <eStructuralFeatures xsi:type="ecore:EReference" name="literal" upperBound="-1" | ||
33 | eType="#//ALSEnumLiteral" containment="true"/> | ||
34 | </eClassifiers> | ||
35 | <eClassifiers xsi:type="ecore:EClass" name="ALSEnumLiteral" eSuperTypes="#//ALSRelationDeclaration"/> | ||
36 | <eClassifiers xsi:type="ecore:EClass" name="ALSSignatureDeclaration" eSuperTypes="#//ALSTypeDeclaration"/> | ||
37 | <eClassifiers xsi:type="ecore:EClass" name="ALSSignatureBody"> | ||
38 | <eStructuralFeatures xsi:type="ecore:EAttribute" name="multiplicity" eType="#//ALSMultiplicity"/> | ||
39 | <eStructuralFeatures xsi:type="ecore:EAttribute" name="abstract" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/> | ||
40 | <eStructuralFeatures xsi:type="ecore:EReference" name="declarations" upperBound="-1" | ||
41 | eType="#//ALSSignatureDeclaration" containment="true"/> | ||
42 | <eStructuralFeatures xsi:type="ecore:EReference" name="supertype" eType="#//ALSSignatureDeclaration"/> | ||
43 | <eStructuralFeatures xsi:type="ecore:EReference" name="superset" unique="false" | ||
44 | upperBound="-1" eType="#//ALSSignatureDeclaration"/> | ||
45 | <eStructuralFeatures xsi:type="ecore:EReference" name="fields" upperBound="-1" | ||
46 | eType="#//ALSFieldDeclaration" containment="true"/> | ||
47 | </eClassifiers> | ||
48 | <eClassifiers xsi:type="ecore:EClass" name="ALSFieldDeclaration" eSuperTypes="#//ALSRelationDeclaration"> | ||
49 | <eStructuralFeatures xsi:type="ecore:EAttribute" name="multiplicity" eType="#//ALSMultiplicity"/> | ||
50 | <eStructuralFeatures xsi:type="ecore:EReference" name="type" eType="#//ALSTerm" | ||
51 | containment="true"/> | ||
52 | </eClassifiers> | ||
53 | <eClassifiers xsi:type="ecore:EClass" name="ALSDefinition"> | ||
54 | <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/> | ||
55 | <eStructuralFeatures xsi:type="ecore:EReference" name="variables" upperBound="-1" | ||
56 | eType="#//ALSVariableDeclaration" containment="true"/> | ||
57 | <eStructuralFeatures xsi:type="ecore:EReference" name="value" eType="#//ALSTerm" | ||
58 | containment="true"/> | ||
59 | </eClassifiers> | ||
60 | <eClassifiers xsi:type="ecore:EClass" name="ALSFunctionDefinition" eSuperTypes="#//ALSDefinition"> | ||
61 | <eStructuralFeatures xsi:type="ecore:EReference" name="type" eType="#//ALSTerm" | ||
62 | containment="true"/> | ||
63 | </eClassifiers> | ||
64 | <eClassifiers xsi:type="ecore:EClass" name="ALSRelationDefinition" eSuperTypes="#//ALSDefinition"/> | ||
65 | <eClassifiers xsi:type="ecore:EClass" name="ALSFactDeclaration"> | ||
66 | <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/> | ||
67 | <eStructuralFeatures xsi:type="ecore:EReference" name="term" eType="#//ALSTerm" | ||
68 | containment="true"/> | ||
69 | </eClassifiers> | ||
70 | <eClassifiers xsi:type="ecore:EClass" name="ALSTerm"/> | ||
71 | <eClassifiers xsi:type="ecore:EEnum" name="ALSNumericOperator"> | ||
72 | <eLiterals name="plus" literal="plus"/> | ||
73 | <eLiterals name="sub" value="1" literal="sub"/> | ||
74 | <eLiterals name="mul" value="2" literal="mul"/> | ||
75 | <eLiterals name="rem" value="3" literal="rem"/> | ||
76 | <eLiterals name="div" value="4" literal="div"/> | ||
77 | </eClassifiers> | ||
78 | <eClassifiers xsi:type="ecore:EClass" name="ALSVariableDeclaration" eSuperTypes="#//ALSRelationDeclaration"> | ||
79 | <eStructuralFeatures xsi:type="ecore:EReference" name="range" eType="#//ALSTerm" | ||
80 | containment="true"/> | ||
81 | </eClassifiers> | ||
82 | <eClassifiers xsi:type="ecore:EClass" name="ALSRunCommand"> | ||
83 | <eStructuralFeatures xsi:type="ecore:EReference" name="typeScopes" upperBound="-1" | ||
84 | eType="#//ALSTypeScope" containment="true"/> | ||
85 | </eClassifiers> | ||
86 | <eClassifiers xsi:type="ecore:EClass" name="ALSTypeScope"> | ||
87 | <eStructuralFeatures xsi:type="ecore:EAttribute" name="number" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/> | ||
88 | </eClassifiers> | ||
89 | <eClassifiers xsi:type="ecore:EClass" name="ALSSigScope" eSuperTypes="#//ALSTypeScope"> | ||
90 | <eStructuralFeatures xsi:type="ecore:EAttribute" name="exactly" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/> | ||
91 | <eStructuralFeatures xsi:type="ecore:EReference" name="type" eType="#//ALSSignatureDeclaration"/> | ||
92 | </eClassifiers> | ||
93 | <eClassifiers xsi:type="ecore:EClass" name="ALSIntScope" eSuperTypes="#//ALSTypeScope"/> | ||
94 | <eClassifiers xsi:type="ecore:EClass" name="ALSQuantifiedEx" eSuperTypes="#//ALSTerm"> | ||
95 | <eStructuralFeatures xsi:type="ecore:EAttribute" name="type" eType="#//ALSMultiplicity"/> | ||
96 | <eStructuralFeatures xsi:type="ecore:EAttribute" name="disj" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/> | ||
97 | <eStructuralFeatures xsi:type="ecore:EReference" name="variables" upperBound="-1" | ||
98 | eType="#//ALSVariableDeclaration" containment="true"/> | ||
99 | <eStructuralFeatures xsi:type="ecore:EReference" name="expression" eType="#//ALSTerm" | ||
100 | containment="true"/> | ||
101 | </eClassifiers> | ||
102 | <eClassifiers xsi:type="ecore:EClass" name="ALSOr" eSuperTypes="#//ALSTerm"> | ||
103 | <eStructuralFeatures xsi:type="ecore:EReference" name="leftOperand" eType="#//ALSTerm" | ||
104 | containment="true"/> | ||
105 | <eStructuralFeatures xsi:type="ecore:EReference" name="rightOperand" eType="#//ALSTerm" | ||
106 | containment="true"/> | ||
107 | </eClassifiers> | ||
108 | <eClassifiers xsi:type="ecore:EClass" name="ALSIff" eSuperTypes="#//ALSTerm"> | ||
109 | <eStructuralFeatures xsi:type="ecore:EReference" name="leftOperand" eType="#//ALSTerm" | ||
110 | containment="true"/> | ||
111 | <eStructuralFeatures xsi:type="ecore:EReference" name="rightOperand" eType="#//ALSTerm" | ||
112 | containment="true"/> | ||
113 | </eClassifiers> | ||
114 | <eClassifiers xsi:type="ecore:EClass" name="ALSImpl" eSuperTypes="#//ALSTerm"> | ||
115 | <eStructuralFeatures xsi:type="ecore:EReference" name="leftOperand" eType="#//ALSTerm" | ||
116 | containment="true"/> | ||
117 | <eStructuralFeatures xsi:type="ecore:EReference" name="rightOperand" eType="#//ALSTerm" | ||
118 | containment="true"/> | ||
119 | <eStructuralFeatures xsi:type="ecore:EReference" name="elseOperand" eType="#//ALSTerm" | ||
120 | containment="true"/> | ||
121 | </eClassifiers> | ||
122 | <eClassifiers xsi:type="ecore:EClass" name="ALSAnd" eSuperTypes="#//ALSTerm"> | ||
123 | <eStructuralFeatures xsi:type="ecore:EReference" name="leftOperand" eType="#//ALSTerm" | ||
124 | containment="true"/> | ||
125 | <eStructuralFeatures xsi:type="ecore:EReference" name="rightOperand" eType="#//ALSTerm" | ||
126 | containment="true"/> | ||
127 | </eClassifiers> | ||
128 | <eClassifiers xsi:type="ecore:EClass" name="ALSEquals" eSuperTypes="#//ALSTerm"> | ||
129 | <eStructuralFeatures xsi:type="ecore:EReference" name="leftOperand" eType="#//ALSTerm" | ||
130 | containment="true"/> | ||
131 | <eStructuralFeatures xsi:type="ecore:EReference" name="rightOperand" eType="#//ALSTerm" | ||
132 | containment="true"/> | ||
133 | </eClassifiers> | ||
134 | <eClassifiers xsi:type="ecore:EClass" name="ALSNotEquals" eSuperTypes="#//ALSTerm"> | ||
135 | <eStructuralFeatures xsi:type="ecore:EReference" name="leftOperand" eType="#//ALSTerm" | ||
136 | containment="true"/> | ||
137 | <eStructuralFeatures xsi:type="ecore:EReference" name="rightOperand" eType="#//ALSTerm" | ||
138 | containment="true"/> | ||
139 | </eClassifiers> | ||
140 | <eClassifiers xsi:type="ecore:EClass" name="ALSSubset" eSuperTypes="#//ALSTerm"> | ||
141 | <eStructuralFeatures xsi:type="ecore:EReference" name="leftOperand" eType="#//ALSTerm" | ||
142 | containment="true"/> | ||
143 | <eStructuralFeatures xsi:type="ecore:EReference" name="rightOperand" eType="#//ALSTerm" | ||
144 | containment="true"/> | ||
145 | </eClassifiers> | ||
146 | <eClassifiers xsi:type="ecore:EClass" name="ALSLess" eSuperTypes="#//ALSTerm"> | ||
147 | <eStructuralFeatures xsi:type="ecore:EReference" name="leftOperand" eType="#//ALSTerm" | ||
148 | containment="true"/> | ||
149 | <eStructuralFeatures xsi:type="ecore:EReference" name="rightOperand" eType="#//ALSTerm" | ||
150 | containment="true"/> | ||
151 | </eClassifiers> | ||
152 | <eClassifiers xsi:type="ecore:EClass" name="ALSLeq" eSuperTypes="#//ALSTerm"> | ||
153 | <eStructuralFeatures xsi:type="ecore:EReference" name="leftOperand" eType="#//ALSTerm" | ||
154 | containment="true"/> | ||
155 | <eStructuralFeatures xsi:type="ecore:EReference" name="rightOperand" eType="#//ALSTerm" | ||
156 | containment="true"/> | ||
157 | </eClassifiers> | ||
158 | <eClassifiers xsi:type="ecore:EClass" name="ALSMore" eSuperTypes="#//ALSTerm"> | ||
159 | <eStructuralFeatures xsi:type="ecore:EReference" name="leftOperand" eType="#//ALSTerm" | ||
160 | containment="true"/> | ||
161 | <eStructuralFeatures xsi:type="ecore:EReference" name="rightOperand" eType="#//ALSTerm" | ||
162 | containment="true"/> | ||
163 | </eClassifiers> | ||
164 | <eClassifiers xsi:type="ecore:EClass" name="ALSMeq" eSuperTypes="#//ALSTerm"> | ||
165 | <eStructuralFeatures xsi:type="ecore:EReference" name="leftOperand" eType="#//ALSTerm" | ||
166 | containment="true"/> | ||
167 | <eStructuralFeatures xsi:type="ecore:EReference" name="rightOperand" eType="#//ALSTerm" | ||
168 | containment="true"/> | ||
169 | </eClassifiers> | ||
170 | <eClassifiers xsi:type="ecore:EClass" name="ALSOverride" eSuperTypes="#//ALSTerm"> | ||
171 | <eStructuralFeatures xsi:type="ecore:EReference" name="leftOperand" eType="#//ALSTerm" | ||
172 | containment="true"/> | ||
173 | <eStructuralFeatures xsi:type="ecore:EReference" name="rightOperand" eType="#//ALSTerm" | ||
174 | containment="true"/> | ||
175 | </eClassifiers> | ||
176 | <eClassifiers xsi:type="ecore:EClass" name="ALSRangeRestrictionRight" eSuperTypes="#//ALSTerm"> | ||
177 | <eStructuralFeatures xsi:type="ecore:EReference" name="relation" eType="#//ALSTerm" | ||
178 | containment="true"/> | ||
179 | <eStructuralFeatures xsi:type="ecore:EReference" name="filter" eType="#//ALSTerm" | ||
180 | containment="true"/> | ||
181 | </eClassifiers> | ||
182 | <eClassifiers xsi:type="ecore:EClass" name="ALSRangeRestrictionLeft" eSuperTypes="#//ALSTerm"> | ||
183 | <eStructuralFeatures xsi:type="ecore:EReference" name="filter" eType="#//ALSTerm" | ||
184 | containment="true"/> | ||
185 | <eStructuralFeatures xsi:type="ecore:EReference" name="relation" eType="#//ALSTerm" | ||
186 | containment="true"/> | ||
187 | </eClassifiers> | ||
188 | <eClassifiers xsi:type="ecore:EClass" name="ALSJoin" eSuperTypes="#//ALSTerm"> | ||
189 | <eStructuralFeatures xsi:type="ecore:EReference" name="leftOperand" eType="#//ALSTerm" | ||
190 | containment="true"/> | ||
191 | <eStructuralFeatures xsi:type="ecore:EReference" name="rightOperand" eType="#//ALSTerm" | ||
192 | containment="true"/> | ||
193 | </eClassifiers> | ||
194 | <eClassifiers xsi:type="ecore:EClass" name="ALSMinus" eSuperTypes="#//ALSTerm"> | ||
195 | <eStructuralFeatures xsi:type="ecore:EReference" name="leftOperand" eType="#//ALSTerm" | ||
196 | containment="true"/> | ||
197 | <eStructuralFeatures xsi:type="ecore:EReference" name="rightOperand" eType="#//ALSTerm" | ||
198 | containment="true"/> | ||
199 | </eClassifiers> | ||
200 | <eClassifiers xsi:type="ecore:EClass" name="ALSPlus" eSuperTypes="#//ALSTerm"> | ||
201 | <eStructuralFeatures xsi:type="ecore:EReference" name="leftOperand" eType="#//ALSTerm" | ||
202 | containment="true"/> | ||
203 | <eStructuralFeatures xsi:type="ecore:EReference" name="rightOperand" eType="#//ALSTerm" | ||
204 | containment="true"/> | ||
205 | </eClassifiers> | ||
206 | <eClassifiers xsi:type="ecore:EClass" name="ALSIntersection" eSuperTypes="#//ALSTerm"> | ||
207 | <eStructuralFeatures xsi:type="ecore:EReference" name="leftOperand" eType="#//ALSTerm" | ||
208 | containment="true"/> | ||
209 | <eStructuralFeatures xsi:type="ecore:EReference" name="rightOperand" eType="#//ALSTerm" | ||
210 | containment="true"/> | ||
211 | </eClassifiers> | ||
212 | <eClassifiers xsi:type="ecore:EClass" name="ALSDirectProduct" eSuperTypes="#//ALSTerm"> | ||
213 | <eStructuralFeatures xsi:type="ecore:EReference" name="leftOperand" eType="#//ALSTerm" | ||
214 | containment="true"/> | ||
215 | <eStructuralFeatures xsi:type="ecore:EAttribute" name="leftMultiplicit" eType="#//ALSMultiplicity"/> | ||
216 | <eStructuralFeatures xsi:type="ecore:EAttribute" name="rightMultiplicit" eType="#//ALSMultiplicity"/> | ||
217 | <eStructuralFeatures xsi:type="ecore:EReference" name="rightOperand" eType="#//ALSTerm" | ||
218 | containment="true"/> | ||
219 | </eClassifiers> | ||
220 | <eClassifiers xsi:type="ecore:EClass" name="ALSNot" eSuperTypes="#//ALSTerm"> | ||
221 | <eStructuralFeatures xsi:type="ecore:EReference" name="operand" eType="#//ALSTerm" | ||
222 | containment="true"/> | ||
223 | </eClassifiers> | ||
224 | <eClassifiers xsi:type="ecore:EClass" name="ALSInverseRelation" eSuperTypes="#//ALSTerm"> | ||
225 | <eStructuralFeatures xsi:type="ecore:EReference" name="operand" eType="#//ALSTerm" | ||
226 | containment="true"/> | ||
227 | </eClassifiers> | ||
228 | <eClassifiers xsi:type="ecore:EClass" name="AlSTransitiveClosure" eSuperTypes="#//ALSTerm"> | ||
229 | <eStructuralFeatures xsi:type="ecore:EReference" name="operand" eType="#//ALSTerm" | ||
230 | containment="true"/> | ||
231 | </eClassifiers> | ||
232 | <eClassifiers xsi:type="ecore:EClass" name="ALSReflectiveTransitiveClosure" eSuperTypes="#//ALSTerm"> | ||
233 | <eStructuralFeatures xsi:type="ecore:EReference" name="operand" eType="#//ALSTerm" | ||
234 | containment="true"/> | ||
235 | </eClassifiers> | ||
236 | <eClassifiers xsi:type="ecore:EClass" name="ALSCardinality" eSuperTypes="#//ALSTerm"> | ||
237 | <eStructuralFeatures xsi:type="ecore:EReference" name="operand" eType="#//ALSTerm" | ||
238 | containment="true"/> | ||
239 | </eClassifiers> | ||
240 | <eClassifiers xsi:type="ecore:EClass" name="ALSUnaryMinus" eSuperTypes="#//ALSTerm"> | ||
241 | <eStructuralFeatures xsi:type="ecore:EReference" name="operand" eType="#//ALSTerm" | ||
242 | containment="true"/> | ||
243 | </eClassifiers> | ||
244 | <eClassifiers xsi:type="ecore:EClass" name="ALSSum" eSuperTypes="#//ALSTerm"> | ||
245 | <eStructuralFeatures xsi:type="ecore:EReference" name="variables" upperBound="-1" | ||
246 | eType="#//ALSVariableDeclaration" containment="true"/> | ||
247 | <eStructuralFeatures xsi:type="ecore:EReference" name="expression" eType="#//ALSTerm" | ||
248 | containment="true"/> | ||
249 | </eClassifiers> | ||
250 | <eClassifiers xsi:type="ecore:EClass" name="ALSFunctionCall" eSuperTypes="#//ALSTerm"> | ||
251 | <eStructuralFeatures xsi:type="ecore:EReference" name="referredDefinition" eType="#//ALSDefinition"/> | ||
252 | <eStructuralFeatures xsi:type="ecore:EAttribute" name="referredNumericOperator" | ||
253 | eType="#//ALSNumericOperator"/> | ||
254 | <eStructuralFeatures xsi:type="ecore:EReference" name="params" upperBound="-1" | ||
255 | eType="#//ALSTerm" containment="true"/> | ||
256 | </eClassifiers> | ||
257 | <eClassifiers xsi:type="ecore:EClass" name="ALSNone" eSuperTypes="#//ALSTerm"/> | ||
258 | <eClassifiers xsi:type="ecore:EClass" name="ALSIden" eSuperTypes="#//ALSTerm"/> | ||
259 | <eClassifiers xsi:type="ecore:EClass" name="ALSUniv" eSuperTypes="#//ALSTerm"/> | ||
260 | <eClassifiers xsi:type="ecore:EClass" name="ALSInt" eSuperTypes="#//ALSTerm"/> | ||
261 | <eClassifiers xsi:type="ecore:EClass" name="ALSReference" eSuperTypes="#//ALSTerm"> | ||
262 | <eStructuralFeatures xsi:type="ecore:EReference" name="referred" eType="#//ALSRelationDeclaration"/> | ||
263 | </eClassifiers> | ||
264 | <eClassifiers xsi:type="ecore:EClass" name="ALSNumberLiteral" eSuperTypes="#//ALSTerm"> | ||
265 | <eStructuralFeatures xsi:type="ecore:EAttribute" name="value" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/> | ||
266 | </eClassifiers> | ||
267 | </ecore:EPackage> | ||
diff --git a/Solvers/Alloy-Solver/hu.bme.mit.inf.dslreasoner.alloy.language/model/generated/AlloyLanguage.genmodel b/Solvers/Alloy-Solver/hu.bme.mit.inf.dslreasoner.alloy.language/model/generated/AlloyLanguage.genmodel new file mode 100644 index 00000000..dd1d46d2 --- /dev/null +++ b/Solvers/Alloy-Solver/hu.bme.mit.inf.dslreasoner.alloy.language/model/generated/AlloyLanguage.genmodel | |||
@@ -0,0 +1,206 @@ | |||
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="/hu.bme.mit.inf.dslreasoner.alloy.language/src-gen" | ||
4 | editDirectory="/hu.bme.mit.inf.dslreasoner.alloy.language.edit/src" editorDirectory="/hu.bme.mit.inf.dslreasoner.alloy.language.editor/src" | ||
5 | modelPluginID="hu.bme.mit.inf.dslreasoner.alloy.language" forceOverwrite="true" | ||
6 | modelName="AlloyLanguage" updateClasspath="false" rootExtendsClass="org.eclipse.emf.ecore.impl.MinimalEObjectImpl$Container" | ||
7 | complianceLevel="6.0" copyrightFields="false" editPluginID="hu.bme.mit.inf.dslreasoner.alloy.language.edit" | ||
8 | editorPluginID="hu.bme.mit.inf.dslreasoner.alloy.language.editor" runtimeVersion="2.11"> | ||
9 | <genPackages prefix="AlloyLanguage" basePackage="hu.bme.mit.inf.dslreasoner" disposableProviderFactory="true" | ||
10 | fileExtensions="als" ecorePackage="AlloyLanguage.ecore#/"> | ||
11 | <genEnums typeSafeEnumCompatible="false" ecoreEnum="AlloyLanguage.ecore#//ALSMultiplicity"> | ||
12 | <genEnumLiterals ecoreEnumLiteral="AlloyLanguage.ecore#//ALSMultiplicity/all"/> | ||
13 | <genEnumLiterals ecoreEnumLiteral="AlloyLanguage.ecore#//ALSMultiplicity/no"/> | ||
14 | <genEnumLiterals ecoreEnumLiteral="AlloyLanguage.ecore#//ALSMultiplicity/some"/> | ||
15 | <genEnumLiterals ecoreEnumLiteral="AlloyLanguage.ecore#//ALSMultiplicity/lone"/> | ||
16 | <genEnumLiterals ecoreEnumLiteral="AlloyLanguage.ecore#//ALSMultiplicity/one"/> | ||
17 | <genEnumLiterals ecoreEnumLiteral="AlloyLanguage.ecore#//ALSMultiplicity/set"/> | ||
18 | </genEnums> | ||
19 | <genEnums typeSafeEnumCompatible="false" ecoreEnum="AlloyLanguage.ecore#//ALSNumericOperator"> | ||
20 | <genEnumLiterals ecoreEnumLiteral="AlloyLanguage.ecore#//ALSNumericOperator/plus"/> | ||
21 | <genEnumLiterals ecoreEnumLiteral="AlloyLanguage.ecore#//ALSNumericOperator/sub"/> | ||
22 | <genEnumLiterals ecoreEnumLiteral="AlloyLanguage.ecore#//ALSNumericOperator/mul"/> | ||
23 | <genEnumLiterals ecoreEnumLiteral="AlloyLanguage.ecore#//ALSNumericOperator/rem"/> | ||
24 | <genEnumLiterals ecoreEnumLiteral="AlloyLanguage.ecore#//ALSNumericOperator/div"/> | ||
25 | </genEnums> | ||
26 | <genClasses ecoreClass="AlloyLanguage.ecore#//ALSDocument"> | ||
27 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference AlloyLanguage.ecore#//ALSDocument/enumDeclarations"/> | ||
28 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference AlloyLanguage.ecore#//ALSDocument/signatureBodies"/> | ||
29 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference AlloyLanguage.ecore#//ALSDocument/functionDefinitions"/> | ||
30 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference AlloyLanguage.ecore#//ALSDocument/relationDefinitions"/> | ||
31 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference AlloyLanguage.ecore#//ALSDocument/factDeclarations"/> | ||
32 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference AlloyLanguage.ecore#//ALSDocument/runCommand"/> | ||
33 | </genClasses> | ||
34 | <genClasses ecoreClass="AlloyLanguage.ecore#//ALSRelationDeclaration"> | ||
35 | <genFeatures createChild="false" ecoreFeature="ecore:EAttribute AlloyLanguage.ecore#//ALSRelationDeclaration/name"/> | ||
36 | </genClasses> | ||
37 | <genClasses ecoreClass="AlloyLanguage.ecore#//ALSTypeDeclaration"/> | ||
38 | <genClasses ecoreClass="AlloyLanguage.ecore#//ALSEnumDeclaration"> | ||
39 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference AlloyLanguage.ecore#//ALSEnumDeclaration/literal"/> | ||
40 | </genClasses> | ||
41 | <genClasses ecoreClass="AlloyLanguage.ecore#//ALSEnumLiteral"/> | ||
42 | <genClasses ecoreClass="AlloyLanguage.ecore#//ALSSignatureDeclaration"/> | ||
43 | <genClasses ecoreClass="AlloyLanguage.ecore#//ALSSignatureBody"> | ||
44 | <genFeatures createChild="false" ecoreFeature="ecore:EAttribute AlloyLanguage.ecore#//ALSSignatureBody/multiplicity"/> | ||
45 | <genFeatures createChild="false" ecoreFeature="ecore:EAttribute AlloyLanguage.ecore#//ALSSignatureBody/abstract"/> | ||
46 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference AlloyLanguage.ecore#//ALSSignatureBody/declarations"/> | ||
47 | <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference AlloyLanguage.ecore#//ALSSignatureBody/supertype"/> | ||
48 | <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference AlloyLanguage.ecore#//ALSSignatureBody/superset"/> | ||
49 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference AlloyLanguage.ecore#//ALSSignatureBody/fields"/> | ||
50 | </genClasses> | ||
51 | <genClasses ecoreClass="AlloyLanguage.ecore#//ALSFieldDeclaration"> | ||
52 | <genFeatures createChild="false" ecoreFeature="ecore:EAttribute AlloyLanguage.ecore#//ALSFieldDeclaration/multiplicity"/> | ||
53 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference AlloyLanguage.ecore#//ALSFieldDeclaration/type"/> | ||
54 | </genClasses> | ||
55 | <genClasses ecoreClass="AlloyLanguage.ecore#//ALSDefinition"> | ||
56 | <genFeatures createChild="false" ecoreFeature="ecore:EAttribute AlloyLanguage.ecore#//ALSDefinition/name"/> | ||
57 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference AlloyLanguage.ecore#//ALSDefinition/variables"/> | ||
58 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference AlloyLanguage.ecore#//ALSDefinition/value"/> | ||
59 | </genClasses> | ||
60 | <genClasses ecoreClass="AlloyLanguage.ecore#//ALSFunctionDefinition"> | ||
61 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference AlloyLanguage.ecore#//ALSFunctionDefinition/type"/> | ||
62 | </genClasses> | ||
63 | <genClasses ecoreClass="AlloyLanguage.ecore#//ALSRelationDefinition"/> | ||
64 | <genClasses ecoreClass="AlloyLanguage.ecore#//ALSFactDeclaration"> | ||
65 | <genFeatures createChild="false" ecoreFeature="ecore:EAttribute AlloyLanguage.ecore#//ALSFactDeclaration/name"/> | ||
66 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference AlloyLanguage.ecore#//ALSFactDeclaration/term"/> | ||
67 | </genClasses> | ||
68 | <genClasses ecoreClass="AlloyLanguage.ecore#//ALSTerm"/> | ||
69 | <genClasses ecoreClass="AlloyLanguage.ecore#//ALSVariableDeclaration"> | ||
70 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference AlloyLanguage.ecore#//ALSVariableDeclaration/range"/> | ||
71 | </genClasses> | ||
72 | <genClasses ecoreClass="AlloyLanguage.ecore#//ALSRunCommand"> | ||
73 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference AlloyLanguage.ecore#//ALSRunCommand/typeScopes"/> | ||
74 | </genClasses> | ||
75 | <genClasses ecoreClass="AlloyLanguage.ecore#//ALSTypeScope"> | ||
76 | <genFeatures createChild="false" ecoreFeature="ecore:EAttribute AlloyLanguage.ecore#//ALSTypeScope/number"/> | ||
77 | </genClasses> | ||
78 | <genClasses ecoreClass="AlloyLanguage.ecore#//ALSSigScope"> | ||
79 | <genFeatures createChild="false" ecoreFeature="ecore:EAttribute AlloyLanguage.ecore#//ALSSigScope/exactly"/> | ||
80 | <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference AlloyLanguage.ecore#//ALSSigScope/type"/> | ||
81 | </genClasses> | ||
82 | <genClasses ecoreClass="AlloyLanguage.ecore#//ALSIntScope"/> | ||
83 | <genClasses ecoreClass="AlloyLanguage.ecore#//ALSQuantifiedEx"> | ||
84 | <genFeatures createChild="false" ecoreFeature="ecore:EAttribute AlloyLanguage.ecore#//ALSQuantifiedEx/type"/> | ||
85 | <genFeatures createChild="false" ecoreFeature="ecore:EAttribute AlloyLanguage.ecore#//ALSQuantifiedEx/disj"/> | ||
86 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference AlloyLanguage.ecore#//ALSQuantifiedEx/variables"/> | ||
87 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference AlloyLanguage.ecore#//ALSQuantifiedEx/expression"/> | ||
88 | </genClasses> | ||
89 | <genClasses ecoreClass="AlloyLanguage.ecore#//ALSOr"> | ||
90 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference AlloyLanguage.ecore#//ALSOr/leftOperand"/> | ||
91 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference AlloyLanguage.ecore#//ALSOr/rightOperand"/> | ||
92 | </genClasses> | ||
93 | <genClasses ecoreClass="AlloyLanguage.ecore#//ALSIff"> | ||
94 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference AlloyLanguage.ecore#//ALSIff/leftOperand"/> | ||
95 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference AlloyLanguage.ecore#//ALSIff/rightOperand"/> | ||
96 | </genClasses> | ||
97 | <genClasses ecoreClass="AlloyLanguage.ecore#//ALSImpl"> | ||
98 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference AlloyLanguage.ecore#//ALSImpl/leftOperand"/> | ||
99 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference AlloyLanguage.ecore#//ALSImpl/rightOperand"/> | ||
100 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference AlloyLanguage.ecore#//ALSImpl/elseOperand"/> | ||
101 | </genClasses> | ||
102 | <genClasses ecoreClass="AlloyLanguage.ecore#//ALSAnd"> | ||
103 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference AlloyLanguage.ecore#//ALSAnd/leftOperand"/> | ||
104 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference AlloyLanguage.ecore#//ALSAnd/rightOperand"/> | ||
105 | </genClasses> | ||
106 | <genClasses ecoreClass="AlloyLanguage.ecore#//ALSEquals"> | ||
107 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference AlloyLanguage.ecore#//ALSEquals/leftOperand"/> | ||
108 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference AlloyLanguage.ecore#//ALSEquals/rightOperand"/> | ||
109 | </genClasses> | ||
110 | <genClasses ecoreClass="AlloyLanguage.ecore#//ALSNotEquals"> | ||
111 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference AlloyLanguage.ecore#//ALSNotEquals/leftOperand"/> | ||
112 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference AlloyLanguage.ecore#//ALSNotEquals/rightOperand"/> | ||
113 | </genClasses> | ||
114 | <genClasses ecoreClass="AlloyLanguage.ecore#//ALSSubset"> | ||
115 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference AlloyLanguage.ecore#//ALSSubset/leftOperand"/> | ||
116 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference AlloyLanguage.ecore#//ALSSubset/rightOperand"/> | ||
117 | </genClasses> | ||
118 | <genClasses ecoreClass="AlloyLanguage.ecore#//ALSLess"> | ||
119 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference AlloyLanguage.ecore#//ALSLess/leftOperand"/> | ||
120 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference AlloyLanguage.ecore#//ALSLess/rightOperand"/> | ||
121 | </genClasses> | ||
122 | <genClasses ecoreClass="AlloyLanguage.ecore#//ALSLeq"> | ||
123 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference AlloyLanguage.ecore#//ALSLeq/leftOperand"/> | ||
124 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference AlloyLanguage.ecore#//ALSLeq/rightOperand"/> | ||
125 | </genClasses> | ||
126 | <genClasses ecoreClass="AlloyLanguage.ecore#//ALSMore"> | ||
127 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference AlloyLanguage.ecore#//ALSMore/leftOperand"/> | ||
128 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference AlloyLanguage.ecore#//ALSMore/rightOperand"/> | ||
129 | </genClasses> | ||
130 | <genClasses ecoreClass="AlloyLanguage.ecore#//ALSMeq"> | ||
131 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference AlloyLanguage.ecore#//ALSMeq/leftOperand"/> | ||
132 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference AlloyLanguage.ecore#//ALSMeq/rightOperand"/> | ||
133 | </genClasses> | ||
134 | <genClasses ecoreClass="AlloyLanguage.ecore#//ALSOverride"> | ||
135 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference AlloyLanguage.ecore#//ALSOverride/leftOperand"/> | ||
136 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference AlloyLanguage.ecore#//ALSOverride/rightOperand"/> | ||
137 | </genClasses> | ||
138 | <genClasses ecoreClass="AlloyLanguage.ecore#//ALSRangeRestrictionRight"> | ||
139 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference AlloyLanguage.ecore#//ALSRangeRestrictionRight/relation"/> | ||
140 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference AlloyLanguage.ecore#//ALSRangeRestrictionRight/filter"/> | ||
141 | </genClasses> | ||
142 | <genClasses ecoreClass="AlloyLanguage.ecore#//ALSRangeRestrictionLeft"> | ||
143 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference AlloyLanguage.ecore#//ALSRangeRestrictionLeft/filter"/> | ||
144 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference AlloyLanguage.ecore#//ALSRangeRestrictionLeft/relation"/> | ||
145 | </genClasses> | ||
146 | <genClasses ecoreClass="AlloyLanguage.ecore#//ALSJoin"> | ||
147 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference AlloyLanguage.ecore#//ALSJoin/leftOperand"/> | ||
148 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference AlloyLanguage.ecore#//ALSJoin/rightOperand"/> | ||
149 | </genClasses> | ||
150 | <genClasses ecoreClass="AlloyLanguage.ecore#//ALSMinus"> | ||
151 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference AlloyLanguage.ecore#//ALSMinus/leftOperand"/> | ||
152 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference AlloyLanguage.ecore#//ALSMinus/rightOperand"/> | ||
153 | </genClasses> | ||
154 | <genClasses ecoreClass="AlloyLanguage.ecore#//ALSPlus"> | ||
155 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference AlloyLanguage.ecore#//ALSPlus/leftOperand"/> | ||
156 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference AlloyLanguage.ecore#//ALSPlus/rightOperand"/> | ||
157 | </genClasses> | ||
158 | <genClasses ecoreClass="AlloyLanguage.ecore#//ALSIntersection"> | ||
159 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference AlloyLanguage.ecore#//ALSIntersection/leftOperand"/> | ||
160 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference AlloyLanguage.ecore#//ALSIntersection/rightOperand"/> | ||
161 | </genClasses> | ||
162 | <genClasses ecoreClass="AlloyLanguage.ecore#//ALSDirectProduct"> | ||
163 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference AlloyLanguage.ecore#//ALSDirectProduct/leftOperand"/> | ||
164 | <genFeatures createChild="false" ecoreFeature="ecore:EAttribute AlloyLanguage.ecore#//ALSDirectProduct/leftMultiplicit"/> | ||
165 | <genFeatures createChild="false" ecoreFeature="ecore:EAttribute AlloyLanguage.ecore#//ALSDirectProduct/rightMultiplicit"/> | ||
166 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference AlloyLanguage.ecore#//ALSDirectProduct/rightOperand"/> | ||
167 | </genClasses> | ||
168 | <genClasses ecoreClass="AlloyLanguage.ecore#//ALSNot"> | ||
169 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference AlloyLanguage.ecore#//ALSNot/operand"/> | ||
170 | </genClasses> | ||
171 | <genClasses ecoreClass="AlloyLanguage.ecore#//ALSInverseRelation"> | ||
172 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference AlloyLanguage.ecore#//ALSInverseRelation/operand"/> | ||
173 | </genClasses> | ||
174 | <genClasses ecoreClass="AlloyLanguage.ecore#//AlSTransitiveClosure"> | ||
175 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference AlloyLanguage.ecore#//AlSTransitiveClosure/operand"/> | ||
176 | </genClasses> | ||
177 | <genClasses ecoreClass="AlloyLanguage.ecore#//ALSReflectiveTransitiveClosure"> | ||
178 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference AlloyLanguage.ecore#//ALSReflectiveTransitiveClosure/operand"/> | ||
179 | </genClasses> | ||
180 | <genClasses ecoreClass="AlloyLanguage.ecore#//ALSCardinality"> | ||
181 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference AlloyLanguage.ecore#//ALSCardinality/operand"/> | ||
182 | </genClasses> | ||
183 | <genClasses ecoreClass="AlloyLanguage.ecore#//ALSUnaryMinus"> | ||
184 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference AlloyLanguage.ecore#//ALSUnaryMinus/operand"/> | ||
185 | </genClasses> | ||
186 | <genClasses ecoreClass="AlloyLanguage.ecore#//ALSSum"> | ||
187 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference AlloyLanguage.ecore#//ALSSum/variables"/> | ||
188 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference AlloyLanguage.ecore#//ALSSum/expression"/> | ||
189 | </genClasses> | ||
190 | <genClasses ecoreClass="AlloyLanguage.ecore#//ALSFunctionCall"> | ||
191 | <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference AlloyLanguage.ecore#//ALSFunctionCall/referredDefinition"/> | ||
192 | <genFeatures createChild="false" ecoreFeature="ecore:EAttribute AlloyLanguage.ecore#//ALSFunctionCall/referredNumericOperator"/> | ||
193 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference AlloyLanguage.ecore#//ALSFunctionCall/params"/> | ||
194 | </genClasses> | ||
195 | <genClasses ecoreClass="AlloyLanguage.ecore#//ALSNone"/> | ||
196 | <genClasses ecoreClass="AlloyLanguage.ecore#//ALSIden"/> | ||
197 | <genClasses ecoreClass="AlloyLanguage.ecore#//ALSUniv"/> | ||
198 | <genClasses ecoreClass="AlloyLanguage.ecore#//ALSInt"/> | ||
199 | <genClasses ecoreClass="AlloyLanguage.ecore#//ALSReference"> | ||
200 | <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference AlloyLanguage.ecore#//ALSReference/referred"/> | ||
201 | </genClasses> | ||
202 | <genClasses ecoreClass="AlloyLanguage.ecore#//ALSNumberLiteral"> | ||
203 | <genFeatures createChild="false" ecoreFeature="ecore:EAttribute AlloyLanguage.ecore#//ALSNumberLiteral/value"/> | ||
204 | </genClasses> | ||
205 | </genPackages> | ||
206 | </genmodel:GenModel> | ||
diff --git a/Solvers/Alloy-Solver/hu.bme.mit.inf.dslreasoner.alloy.language/plugin.xml b/Solvers/Alloy-Solver/hu.bme.mit.inf.dslreasoner.alloy.language/plugin.xml new file mode 100644 index 00000000..7567279d --- /dev/null +++ b/Solvers/Alloy-Solver/hu.bme.mit.inf.dslreasoner.alloy.language/plugin.xml | |||
@@ -0,0 +1,16 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8"?> | ||
2 | <?eclipse version="3.0"?> | ||
3 | |||
4 | <plugin> | ||
5 | |||
6 | <extension point="org.eclipse.emf.ecore.generated_package"> | ||
7 | <package | ||
8 | uri = "http://www.bme.hu/mit/inf/dslreasoner/AlloyLanguage" | ||
9 | class = "hu.bme.mit.inf.dslreasoner.alloyLanguage.AlloyLanguagePackage" | ||
10 | genModel = "model/generated/AlloyLanguage.genmodel" /> | ||
11 | |||
12 | </extension> | ||
13 | |||
14 | |||
15 | |||
16 | </plugin> | ||
diff --git a/Solvers/Alloy-Solver/hu.bme.mit.inf.dslreasoner.alloy.language/plugin.xml_gen b/Solvers/Alloy-Solver/hu.bme.mit.inf.dslreasoner.alloy.language/plugin.xml_gen new file mode 100644 index 00000000..7567279d --- /dev/null +++ b/Solvers/Alloy-Solver/hu.bme.mit.inf.dslreasoner.alloy.language/plugin.xml_gen | |||
@@ -0,0 +1,16 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8"?> | ||
2 | <?eclipse version="3.0"?> | ||
3 | |||
4 | <plugin> | ||
5 | |||
6 | <extension point="org.eclipse.emf.ecore.generated_package"> | ||
7 | <package | ||
8 | uri = "http://www.bme.hu/mit/inf/dslreasoner/AlloyLanguage" | ||
9 | class = "hu.bme.mit.inf.dslreasoner.alloyLanguage.AlloyLanguagePackage" | ||
10 | genModel = "model/generated/AlloyLanguage.genmodel" /> | ||
11 | |||
12 | </extension> | ||
13 | |||
14 | |||
15 | |||
16 | </plugin> | ||
diff --git a/Solvers/Alloy-Solver/hu.bme.mit.inf.dslreasoner.alloy.language/src/hu/bme/mit/inf/dslreasoner/AlloyLanguage.xtext b/Solvers/Alloy-Solver/hu.bme.mit.inf.dslreasoner.alloy.language/src/hu/bme/mit/inf/dslreasoner/AlloyLanguage.xtext new file mode 100644 index 00000000..6d5fcf58 --- /dev/null +++ b/Solvers/Alloy-Solver/hu.bme.mit.inf.dslreasoner.alloy.language/src/hu/bme/mit/inf/dslreasoner/AlloyLanguage.xtext | |||
@@ -0,0 +1,149 @@ | |||
1 | grammar hu.bme.mit.inf.dslreasoner.AlloyLanguage with org.eclipse.xtext.common.Terminals | ||
2 | |||
3 | generate alloyLanguage "http://www.bme.hu/mit/inf/dslreasoner/AlloyLanguage" | ||
4 | |||
5 | ALSDocument: | ||
6 | ( enumDeclarations += ALSEnumDeclaration | | ||
7 | signatureBodies += ALSSignatureBody | | ||
8 | functionDefinitions += ALSFunctionDefinition | | ||
9 | relationDefinitions += ALSRelationDefinition | | ||
10 | factDeclarations += ALSFactDeclaration)+ | ||
11 | runCommand = ALSRunCommand | ||
12 | ; | ||
13 | |||
14 | ////////////////////////////////// | ||
15 | // ALS terminals | ||
16 | ////////////////////////////////// | ||
17 | |||
18 | terminal ID: ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'_'|"'"|'"'|'0'..'9')*; | ||
19 | ALSID: ID; | ||
20 | |||
21 | enum ALSMultiplicity: all | no | some | lone | one | set; | ||
22 | |||
23 | |||
24 | ////////////////////////////////// | ||
25 | // ALS types | ||
26 | ////////////////////////////////// | ||
27 | |||
28 | ALSRelationDeclaration: ALSTypeDeclaration | ALSEnumLiteral | ALSFieldDeclaration | ALSVariableDeclaration; | ||
29 | |||
30 | ALSTypeDeclaration: | ||
31 | ALSEnumDeclaration | ALSSignatureDeclaration | ||
32 | ; | ||
33 | |||
34 | ALSEnumDeclaration: | ||
35 | 'enum' name=ALSID '{' | ||
36 | literal+=ALSEnumLiteral ("," literal+=ALSEnumLiteral)* | ||
37 | '}'; | ||
38 | ALSEnumLiteral: name = ALSID; | ||
39 | |||
40 | ALSSignatureDeclaration: name = ALSID; | ||
41 | |||
42 | ALSSignatureBody: | ||
43 | ((multiplicity = ALSMultiplicity?) & (abstract ?= 'abstract')?) | ||
44 | 'sig' | ||
45 | declarations += ALSSignatureDeclaration (',' declarations += ALSSignatureDeclaration)* | ||
46 | (('extends' supertype = [ALSSignatureDeclaration]) | ||
47 | | | ||
48 | ('in' superset += [ALSSignatureDeclaration] ('+' superset += [ALSSignatureDeclaration])*) )? | ||
49 | '{' (fields+=ALSFieldDeclaration ("," fields+=ALSFieldDeclaration)*)? '}' | ||
50 | ; | ||
51 | |||
52 | ALSFieldDeclaration: | ||
53 | name = ALSID ':' (multiplicity = ALSMultiplicity)? type = ALSTerm | ||
54 | ; | ||
55 | |||
56 | ALSDefinition : ALSFunctionDefinition | ALSRelationDefinition; | ||
57 | |||
58 | ALSFunctionDefinition: | ||
59 | "fun" name = ALSID "[" variables+=ALSVariableDeclaration (',' variables+=ALSVariableDeclaration)* "]" ":" type = ALSTerm | ||
60 | "{" value = ALSTerm "}" | ||
61 | ; | ||
62 | ALSRelationDefinition: | ||
63 | "pred" name = ALSID "[" variables+=ALSVariableDeclaration (',' variables+=ALSVariableDeclaration)* "]" | ||
64 | "{" value = ALSTerm "}" | ||
65 | ; | ||
66 | |||
67 | ALSFactDeclaration: {ALSFactDeclaration} 'fact' (name=ALSID)? '{' (term = ALSTerm) '}' ; | ||
68 | |||
69 | ////////////////////////////////// | ||
70 | // ALS terms | ||
71 | ////////////////////////////////// | ||
72 | ALSTerm: ALSQuantified; | ||
73 | |||
74 | ALSQuantified returns ALSTerm: ({ALSQuantifiedEx} type = ALSMultiplicity | ||
75 | (disj?='disj')? variables+=ALSVariableDeclaration (',' variables+=ALSVariableDeclaration)* '{' expression = ALSTerm '}') | ALSOr; | ||
76 | |||
77 | ALSOr returns ALSTerm: ALSIff ({ALSOr.leftOperand = current} ( "||" | "or" ) rightOperand = ALSIff)?; | ||
78 | ALSIff returns ALSTerm: ALSImpl ({ALSIff.leftOperand = current} ("<=>" | "iff") rightOperand = ALSImpl)?; | ||
79 | ALSImpl returns ALSTerm: ALSAnd ({ALSImpl.leftOperand = current} ("=>" | "implies") rightOperand = ALSAnd ('else' elseOperand = ALSAnd)?)?; | ||
80 | ALSAnd returns ALSTerm: ALSComparison ({ALSAnd.leftOperand = current} ( "&&" | "and" ) rightOperand = ALSComparison)?; | ||
81 | |||
82 | ALSComparison returns ALSTerm: | ||
83 | ALSOverride | ||
84 | (({ALSEquals.leftOperand = current} "=" | | ||
85 | {ALSNotEquals.leftOperand = current} "!=" | | ||
86 | {ALSSubset.leftOperand = current} "in" | | ||
87 | {ALSLess.leftOperand = current} ">" | | ||
88 | {ALSLeq.leftOperand = current} ">=" | | ||
89 | {ALSMore.leftOperand = current} "<" | | ||
90 | {ALSMeq.leftOperand = current} "<=") | ||
91 | rightOperand = ALSOverride)?; | ||
92 | |||
93 | ALSOverride returns ALSTerm: ALSRangeRestrictionRight ({ALSOverride.leftOperand = current} '++' rightOperand = ALSRangeRestrictionRight)?; | ||
94 | |||
95 | ALSRangeRestrictionRight returns ALSTerm: ALSRangeRestrictionLeft ({ALSRangeRestrictionRight.relation = current} ':>' filter = ALSRangeRestrictionLeft)?; | ||
96 | ALSRangeRestrictionLeft returns ALSTerm: ALSJoin ({ALSRangeRestrictionLeft.filter = current} '<:' relation = ALSJoin)?; | ||
97 | ALSJoin returns ALSTerm: ALSMinus ({ALSJoin.leftOperand = current} '.' rightOperand = ALSMinus )*; | ||
98 | |||
99 | ALSMinus returns ALSTerm: ALSPlus ({ALSMinus.leftOperand = current} '-' rightOperand = ALSPlus)*; | ||
100 | ALSPlus returns ALSTerm: ALSIntersection ({ALSPlus.leftOperand = current} '+' rightOperand = ALSIntersection)*; | ||
101 | ALSIntersection returns ALSTerm: ALSDirectProduct ({ALSIntersection.leftOperand = current} '&' rightOperand = ALSDirectProduct)*; | ||
102 | //ALSMultiply returns ALSTerm: ALSDirectProduct ({ALSMultiply.leftOperand = current} '*' rightOperand = ALSDirectProduct)*; | ||
103 | |||
104 | ALSDirectProduct returns ALSTerm: | ||
105 | ALSPreficed | ||
106 | ({ALSDirectProduct.leftOperand = current} (leftMultiplicit = ALSMultiplicity)? | ||
107 | '->' | ||
108 | (rightMultiplicit = ALSMultiplicity)? | ||
109 | rightOperand = ALSPreficed)? | ||
110 | ; | ||
111 | |||
112 | ALSPreficed returns ALSTerm: | ||
113 | {ALSNot}=>("!"|'not') operand = ALSBasicRelationTerm | | ||
114 | {ALSInverseRelation}=>"~" operand = ALSBasicRelationTerm | | ||
115 | {AlSTransitiveClosure} "^" operand = ALSBasicRelationTerm | | ||
116 | {ALSReflectiveTransitiveClosure} "*" operand = ALSBasicRelationTerm | | ||
117 | {ALSCardinality} '#' operand = ALSBasicRelationTerm | | ||
118 | {ALSUnaryMinus} =>'-' operand = ALSBasicRelationTerm | | ||
119 | {ALSSum} 'sum' variables+=ALSVariableDeclaration (',' variables+=ALSVariableDeclaration)* '{' expression = ALSTerm '}' | | ||
120 | // {ALSQuantifiedEx} type = ALSMultiplicity | ||
121 | // (disj?='disj')? variables+=ALSVariableDeclaration (',' variables+=ALSVariableDeclaration)* '{' expression = ALSTerm '}' | | ||
122 | {ALSFunctionCall} (referredDefinition=[ALSDefinition]|referredNumericOperator=ALSNumericOperator) '['params+=ALSTerm (',' params+=ALSTerm)*']' | | ||
123 | ALSBasicRelationTerm; | ||
124 | |||
125 | enum ALSNumericOperator: plus|sub|mul|rem|div; | ||
126 | |||
127 | //ALSVariable: name = ALSID; | ||
128 | ALSVariableDeclaration: name=ALSID ':' range = ALSTerm; | ||
129 | |||
130 | ALSBasicRelationTerm returns ALSTerm: | ||
131 | {ALSNone} 'none'| | ||
132 | {ALSIden} 'iden'| | ||
133 | {ALSUniv} 'univ'| | ||
134 | {ALSInt} 'Int' | | ||
135 | {ALSReference} referred = [ALSRelationDeclaration] | | ||
136 | {ALSNumberLiteral} value = INT| | ||
137 | '(' ALSTerm ')' | ||
138 | ; | ||
139 | |||
140 | ////////////////////////////////// | ||
141 | // ALS Commands and scopes | ||
142 | ////////////////////////////////// | ||
143 | ALSRunCommand: | ||
144 | {ALSRunCommand} 'run' '{' '}' ('for' typeScopes+=ALSTypeScope (',' typeScopes+=ALSTypeScope)*)?; | ||
145 | |||
146 | ALSTypeScope: ALSSigScope | ALSIntScope; | ||
147 | |||
148 | ALSSigScope: (exactly?='exactly')? number = INT type = [ALSSignatureDeclaration]; | ||
149 | ALSIntScope: number = INT 'Int'; \ No newline at end of file | ||
diff --git a/Solvers/Alloy-Solver/hu.bme.mit.inf.dslreasoner.alloy.language/src/hu/bme/mit/inf/dslreasoner/AlloyLanguageRuntimeModule.java b/Solvers/Alloy-Solver/hu.bme.mit.inf.dslreasoner.alloy.language/src/hu/bme/mit/inf/dslreasoner/AlloyLanguageRuntimeModule.java new file mode 100644 index 00000000..b78c88c2 --- /dev/null +++ b/Solvers/Alloy-Solver/hu.bme.mit.inf.dslreasoner.alloy.language/src/hu/bme/mit/inf/dslreasoner/AlloyLanguageRuntimeModule.java | |||
@@ -0,0 +1,11 @@ | |||
1 | /* | ||
2 | * generated by Xtext | ||
3 | */ | ||
4 | package hu.bme.mit.inf.dslreasoner; | ||
5 | |||
6 | /** | ||
7 | * Use this class to register components to be used at runtime / without the Equinox extension registry. | ||
8 | */ | ||
9 | public class AlloyLanguageRuntimeModule extends hu.bme.mit.inf.dslreasoner.AbstractAlloyLanguageRuntimeModule { | ||
10 | |||
11 | } | ||
diff --git a/Solvers/Alloy-Solver/hu.bme.mit.inf.dslreasoner.alloy.language/src/hu/bme/mit/inf/dslreasoner/AlloyLanguageStandaloneSetup.java b/Solvers/Alloy-Solver/hu.bme.mit.inf.dslreasoner.alloy.language/src/hu/bme/mit/inf/dslreasoner/AlloyLanguageStandaloneSetup.java new file mode 100644 index 00000000..bb1447eb --- /dev/null +++ b/Solvers/Alloy-Solver/hu.bme.mit.inf.dslreasoner.alloy.language/src/hu/bme/mit/inf/dslreasoner/AlloyLanguageStandaloneSetup.java | |||
@@ -0,0 +1,16 @@ | |||
1 | /* | ||
2 | * generated by Xtext | ||
3 | */ | ||
4 | package hu.bme.mit.inf.dslreasoner; | ||
5 | |||
6 | /** | ||
7 | * Initialization support for running Xtext languages | ||
8 | * without equinox extension registry | ||
9 | */ | ||
10 | public class AlloyLanguageStandaloneSetup extends AlloyLanguageStandaloneSetupGenerated{ | ||
11 | |||
12 | public static void doSetup() { | ||
13 | new AlloyLanguageStandaloneSetup().createInjectorAndDoEMFRegistration(); | ||
14 | } | ||
15 | } | ||
16 | |||
diff --git a/Solvers/Alloy-Solver/hu.bme.mit.inf.dslreasoner.alloy.language/src/hu/bme/mit/inf/dslreasoner/GenerateAlloyLanguage.mwe2 b/Solvers/Alloy-Solver/hu.bme.mit.inf.dslreasoner.alloy.language/src/hu/bme/mit/inf/dslreasoner/GenerateAlloyLanguage.mwe2 new file mode 100644 index 00000000..fa57e2de --- /dev/null +++ b/Solvers/Alloy-Solver/hu.bme.mit.inf.dslreasoner.alloy.language/src/hu/bme/mit/inf/dslreasoner/GenerateAlloyLanguage.mwe2 | |||
@@ -0,0 +1,133 @@ | |||
1 | module hu.bme.mit.inf.dslreasoner.GenerateAlloyLanguage | ||
2 | |||
3 | import org.eclipse.emf.mwe.utils.* | ||
4 | import org.eclipse.xtext.generator.* | ||
5 | import org.eclipse.xtext.ui.generator.* | ||
6 | |||
7 | var grammarURI = "classpath:/hu/bme/mit/inf/dslreasoner/AlloyLanguage.xtext" | ||
8 | var fileExtensions = "als" | ||
9 | var projectName = "hu.bme.mit.inf.dslreasoner.alloy.language" | ||
10 | var runtimeProject = "../${projectName}" | ||
11 | var generateXtendStub = true | ||
12 | var encoding = "UTF-8" | ||
13 | |||
14 | Workflow { | ||
15 | bean = StandaloneSetup { | ||
16 | scanClassPath = true | ||
17 | platformUri = "${runtimeProject}/.." | ||
18 | // The following two lines can be removed, if Xbase is not used. | ||
19 | registerGeneratedEPackage = "org.eclipse.xtext.xbase.XbasePackage" | ||
20 | registerGenModelFile = "platform:/resource/org.eclipse.xtext.xbase/model/Xbase.genmodel" | ||
21 | } | ||
22 | |||
23 | component = DirectoryCleaner { | ||
24 | directory = "${runtimeProject}/src-gen" | ||
25 | } | ||
26 | |||
27 | component = DirectoryCleaner { | ||
28 | directory = "${runtimeProject}/model/generated" | ||
29 | } | ||
30 | |||
31 | component = DirectoryCleaner { | ||
32 | directory = "${runtimeProject}.ui/src-gen" | ||
33 | } | ||
34 | |||
35 | // component = DirectoryCleaner { | ||
36 | // directory = "${runtimeProject}.tests/src-gen" | ||
37 | // } | ||
38 | |||
39 | component = Generator { | ||
40 | pathRtProject = runtimeProject | ||
41 | pathUiProject = "${runtimeProject}.ui" | ||
42 | //pathTestProject = "${runtimeProject}.tests" | ||
43 | projectNameRt = projectName | ||
44 | projectNameUi = "${projectName}.ui" | ||
45 | encoding = encoding | ||
46 | language = auto-inject { | ||
47 | uri = grammarURI | ||
48 | |||
49 | // Java API to access grammar elements (required by several other fragments) | ||
50 | fragment = grammarAccess.GrammarAccessFragment auto-inject {} | ||
51 | |||
52 | // generates Java API for the generated EPackages | ||
53 | fragment = ecore.EMFGeneratorFragment auto-inject {} | ||
54 | |||
55 | // the old serialization component | ||
56 | // fragment = parseTreeConstructor.ParseTreeConstructorFragment auto-inject {} | ||
57 | |||
58 | // serializer 2.0 | ||
59 | fragment = serializer.SerializerFragment auto-inject { | ||
60 | generateStub = false | ||
61 | } | ||
62 | |||
63 | // a custom ResourceFactory for use with EMF | ||
64 | fragment = resourceFactory.ResourceFactoryFragment auto-inject {} | ||
65 | |||
66 | // The antlr parser generator fragment. | ||
67 | fragment = parser.antlr.XtextAntlrGeneratorFragment auto-inject { | ||
68 | // options = { | ||
69 | // backtrack = true | ||
70 | // } | ||
71 | } | ||
72 | |||
73 | // Xtend-based API for validation | ||
74 | fragment = validation.ValidatorFragment auto-inject { | ||
75 | // composedCheck = "org.eclipse.xtext.validation.ImportUriValidator" | ||
76 | // composedCheck = "org.eclipse.xtext.validation.NamesAreUniqueValidator" | ||
77 | } | ||
78 | |||
79 | // old scoping and exporting API | ||
80 | // fragment = scoping.ImportURIScopingFragment auto-inject {} | ||
81 | // fragment = exporting.SimpleNamesFragment auto-inject {} | ||
82 | |||
83 | // scoping and exporting API | ||
84 | fragment = scoping.ImportNamespacesScopingFragment auto-inject {} | ||
85 | fragment = exporting.QualifiedNamesFragment auto-inject {} | ||
86 | fragment = builder.BuilderIntegrationFragment auto-inject {} | ||
87 | |||
88 | // generator API | ||
89 | fragment = generator.GeneratorFragment auto-inject {} | ||
90 | |||
91 | // formatter API | ||
92 | fragment = formatting.FormatterFragment auto-inject {} | ||
93 | |||
94 | // labeling API | ||
95 | fragment = labeling.LabelProviderFragment auto-inject {} | ||
96 | |||
97 | // outline API | ||
98 | fragment = outline.OutlineTreeProviderFragment auto-inject {} | ||
99 | fragment = outline.QuickOutlineFragment auto-inject {} | ||
100 | |||
101 | // quickfix API | ||
102 | fragment = quickfix.QuickfixProviderFragment auto-inject {} | ||
103 | |||
104 | // content assist API | ||
105 | fragment = contentAssist.ContentAssistFragment auto-inject {} | ||
106 | |||
107 | // generates a more lightweight Antlr parser and lexer tailored for content assist | ||
108 | fragment = parser.antlr.XtextAntlrUiGeneratorFragment auto-inject {} | ||
109 | |||
110 | // generates junit test support classes into Generator#pathTestProject | ||
111 | fragment = junit.Junit4Fragment auto-inject {} | ||
112 | |||
113 | // rename refactoring | ||
114 | fragment = refactoring.RefactorElementNameFragment auto-inject {} | ||
115 | |||
116 | // provides the necessary bindings for java types integration | ||
117 | fragment = types.TypesGeneratorFragment auto-inject {} | ||
118 | |||
119 | // generates the required bindings only if the grammar inherits from Xbase | ||
120 | fragment = xbase.XbaseGeneratorFragment auto-inject {} | ||
121 | |||
122 | // generates the required bindings only if the grammar inherits from Xtype | ||
123 | fragment = xbase.XtypeGeneratorFragment auto-inject {} | ||
124 | |||
125 | // provides a preference page for template proposals | ||
126 | fragment = templates.CodetemplatesGeneratorFragment auto-inject {} | ||
127 | |||
128 | // provides a compare view | ||
129 | fragment = compare.CompareFragment auto-inject {} | ||
130 | } | ||
131 | } | ||
132 | } | ||
133 | |||
diff --git a/Solvers/Alloy-Solver/hu.bme.mit.inf.dslreasoner.alloy.language/src/hu/bme/mit/inf/dslreasoner/formatting/AlloyLanguageFormatter.xtend b/Solvers/Alloy-Solver/hu.bme.mit.inf.dslreasoner.alloy.language/src/hu/bme/mit/inf/dslreasoner/formatting/AlloyLanguageFormatter.xtend new file mode 100644 index 00000000..28797bc4 --- /dev/null +++ b/Solvers/Alloy-Solver/hu.bme.mit.inf.dslreasoner.alloy.language/src/hu/bme/mit/inf/dslreasoner/formatting/AlloyLanguageFormatter.xtend | |||
@@ -0,0 +1,96 @@ | |||
1 | /* | ||
2 | * generated by Xtext | ||
3 | */ | ||
4 | package hu.bme.mit.inf.dslreasoner.formatting | ||
5 | |||
6 | import com.google.inject.Inject | ||
7 | import hu.bme.mit.inf.dslreasoner.services.AlloyLanguageGrammarAccess | ||
8 | import org.eclipse.xtext.formatting.impl.AbstractDeclarativeFormatter | ||
9 | import org.eclipse.xtext.formatting.impl.FormattingConfig | ||
10 | |||
11 | /** | ||
12 | * This class contains custom formatting description. | ||
13 | * | ||
14 | * see : http://www.eclipse.org/Xtext/documentation.html#formatting | ||
15 | * on how and when to use it | ||
16 | * | ||
17 | * Also see {@link org.eclipse.xtext.xtext.XtextFormattingTokenSerializer} as an example | ||
18 | */ | ||
19 | class AlloyLanguageFormatter extends AbstractDeclarativeFormatter { | ||
20 | |||
21 | @Inject extension AlloyLanguageGrammarAccess | ||
22 | |||
23 | override protected void configureFormatting(FormattingConfig c) { | ||
24 | // It's usually a good idea to activate the following three statements. | ||
25 | // They will add and preserve newlines around comments | ||
26 | c.setLinewrap(0, 1, 2).before(SL_COMMENTRule) | ||
27 | c.setLinewrap(0, 1, 2).before(ML_COMMENTRule) | ||
28 | c.setLinewrap(0, 1, 1).after(ML_COMMENTRule) | ||
29 | |||
30 | c.setAutoLinewrap(100000); | ||
31 | |||
32 | //Signatures | ||
33 | c.setIndentationIncrement.after(ALSSignatureBodyAccess.leftCurlyBracketKeyword_5); | ||
34 | c.setLinewrap.after(ALSSignatureBodyAccess.leftCurlyBracketKeyword_5) | ||
35 | c.setIndentationDecrement.before(ALSSignatureBodyAccess.rightCurlyBracketKeyword_7); | ||
36 | c.setLinewrap.after(ALSSignatureBodyAccess.rightCurlyBracketKeyword_7) | ||
37 | c.setLinewrap.before(ALSSignatureBodyAccess.rightCurlyBracketKeyword_7) | ||
38 | c.setNoSpace.before(ALSSignatureBodyAccess.commaKeyword_3_0) | ||
39 | c.setLinewrap.after(ALSSignatureBodyAccess.commaKeyword_3_0) | ||
40 | c.setNoSpace.before(ALSSignatureBodyAccess.commaKeyword_3_0) | ||
41 | c.setNoSpace.before(ALSSignatureBodyAccess.commaKeyword_6_1_0) | ||
42 | c.setLinewrap.after(ALSSignatureBodyAccess.commaKeyword_6_1_0) | ||
43 | c.setNoSpace.before(ALSSignatureBodyAccess.commaKeyword_6_1_0) | ||
44 | //c.setLinewrap(0,1,2).between(ALSSignatureDeclarationRule,ALSSignatureDeclarationRule) | ||
45 | |||
46 | //Enums | ||
47 | c.setIndentationIncrement.after(ALSEnumDeclarationAccess.leftCurlyBracketKeyword_2) | ||
48 | c.setLinewrap.after(ALSEnumDeclarationAccess.leftCurlyBracketKeyword_2) | ||
49 | c.setIndentationDecrement.before(ALSEnumDeclarationAccess.rightCurlyBracketKeyword_5) | ||
50 | c.setLinewrap.before(ALSEnumDeclarationAccess.rightCurlyBracketKeyword_5) | ||
51 | c.setLinewrap.after(ALSEnumDeclarationAccess.rightCurlyBracketKeyword_5) | ||
52 | c.setNoSpace.before(ALSEnumDeclarationAccess.commaKeyword_4_0) | ||
53 | |||
54 | |||
55 | //facts | ||
56 | c.setIndentationIncrement.after(ALSFactDeclarationAccess.leftCurlyBracketKeyword_3) | ||
57 | c.setLinewrap.after(ALSFactDeclarationAccess.leftCurlyBracketKeyword_3) | ||
58 | c.setIndentationDecrement.before(ALSFactDeclarationAccess.rightCurlyBracketKeyword_5) | ||
59 | c.setLinewrap.before(ALSFactDeclarationAccess.rightCurlyBracketKeyword_5) | ||
60 | c.setLinewrap.after(ALSFactDeclarationAccess.rightCurlyBracketKeyword_5) | ||
61 | |||
62 | //predicates | ||
63 | c.setIndentationIncrement.after(ALSRelationDefinitionAccess.leftCurlyBracketKeyword_6) | ||
64 | c.setLinewrap.after(ALSRelationDefinitionAccess.leftCurlyBracketKeyword_6) | ||
65 | c.setIndentationDecrement.before(ALSRelationDefinitionAccess.rightCurlyBracketKeyword_8) | ||
66 | c.setLinewrap.before(ALSRelationDefinitionAccess.rightCurlyBracketKeyword_8) | ||
67 | c.setLinewrap.after(ALSRelationDefinitionAccess.rightCurlyBracketKeyword_8) | ||
68 | c.setNoSpace.after(ALSRelationDefinitionAccess.leftSquareBracketKeyword_2) | ||
69 | c.setNoSpace.before(ALSRelationDefinitionAccess.rightSquareBracketKeyword_5) | ||
70 | c.setNoSpace.before(ALSRelationDefinitionAccess.commaKeyword_4_0) | ||
71 | |||
72 | // terms | ||
73 | //c.setNoSpace.before(ALSJoinAccess.rightSquareBracketKeyword_1_2_1_3) | ||
74 | c.setNoSpace.before(ALSJoinAccess.fullStopKeyword_1_1) | ||
75 | c.setNoSpace.after(ALSJoinAccess.fullStopKeyword_1_1) | ||
76 | |||
77 | c.setNoSpace.before(ALSDirectProductAccess.hyphenMinusGreaterThanSignKeyword_1_2) | ||
78 | c.setNoSpace.after(ALSDirectProductAccess.hyphenMinusGreaterThanSignKeyword_1_2) | ||
79 | |||
80 | c.setNoSpace.before(ALSVariableDeclarationAccess.colonKeyword_1) | ||
81 | // c.setNoSpace.before(ALSPreficedAccess.commaKeyword_5_3_0) | ||
82 | // c.setNoSpace.before(ALSPreficedAccess.commaKeyword_6_4_0) | ||
83 | // | ||
84 | // c.setIndentationIncrement.after(ALSPreficedAccess.leftCurlyBracketKeyword_5_4) | ||
85 | // c.setLinewrap.after(ALSPreficedAccess.leftCurlyBracketKeyword_5_4) | ||
86 | // c.setLinewrap.before(ALSPreficedAccess.rightCurlyBracketKeyword_5_6) | ||
87 | // c.setIndentationDecrement.before(ALSPreficedAccess.rightCurlyBracketKeyword_5_6) | ||
88 | |||
89 | c.setNoSpace.after(ALSBasicRelationTermAccess.leftParenthesisKeyword_6_0) | ||
90 | c.setNoSpace.before(ALSBasicRelationTermAccess.rightParenthesisKeyword_6_2) | ||
91 | |||
92 | // Quantified expression | ||
93 | c.setNoSpace.before(ALSQuantifiedAccess.commaKeyword_0_4_0) | ||
94 | |||
95 | } | ||
96 | } | ||
diff --git a/Solvers/Alloy-Solver/hu.bme.mit.inf.dslreasoner.alloy.language/src/hu/bme/mit/inf/dslreasoner/generator/AlloyLanguageGenerator.xtend b/Solvers/Alloy-Solver/hu.bme.mit.inf.dslreasoner.alloy.language/src/hu/bme/mit/inf/dslreasoner/generator/AlloyLanguageGenerator.xtend new file mode 100644 index 00000000..9afcc300 --- /dev/null +++ b/Solvers/Alloy-Solver/hu.bme.mit.inf.dslreasoner.alloy.language/src/hu/bme/mit/inf/dslreasoner/generator/AlloyLanguageGenerator.xtend | |||
@@ -0,0 +1,24 @@ | |||
1 | /* | ||
2 | * generated by Xtext | ||
3 | */ | ||
4 | package hu.bme.mit.inf.dslreasoner.generator | ||
5 | |||
6 | import org.eclipse.emf.ecore.resource.Resource | ||
7 | import org.eclipse.xtext.generator.IGenerator | ||
8 | import org.eclipse.xtext.generator.IFileSystemAccess | ||
9 | |||
10 | /** | ||
11 | * Generates code from your model files on save. | ||
12 | * | ||
13 | * see http://www.eclipse.org/Xtext/documentation.html#TutorialCodeGeneration | ||
14 | */ | ||
15 | class AlloyLanguageGenerator implements IGenerator { | ||
16 | |||
17 | override void doGenerate(Resource resource, IFileSystemAccess fsa) { | ||
18 | // fsa.generateFile('greetings.txt', 'People to greet: ' + | ||
19 | // resource.allContents | ||
20 | // .filter(typeof(Greeting)) | ||
21 | // .map[name] | ||
22 | // .join(', ')) | ||
23 | } | ||
24 | } | ||
diff --git a/Solvers/Alloy-Solver/hu.bme.mit.inf.dslreasoner.alloy.language/src/hu/bme/mit/inf/dslreasoner/scoping/AlloyLanguageScopeProvider.xtend b/Solvers/Alloy-Solver/hu.bme.mit.inf.dslreasoner.alloy.language/src/hu/bme/mit/inf/dslreasoner/scoping/AlloyLanguageScopeProvider.xtend new file mode 100644 index 00000000..6e095f3c --- /dev/null +++ b/Solvers/Alloy-Solver/hu.bme.mit.inf.dslreasoner.alloy.language/src/hu/bme/mit/inf/dslreasoner/scoping/AlloyLanguageScopeProvider.xtend | |||
@@ -0,0 +1,81 @@ | |||
1 | /* | ||
2 | * generated by Xtext | ||
3 | */ | ||
4 | package hu.bme.mit.inf.dslreasoner.scoping | ||
5 | |||
6 | import hu.bme.mit.inf.dslreasoner.alloyLanguage.ALSDefinition | ||
7 | import hu.bme.mit.inf.dslreasoner.alloyLanguage.ALSDocument | ||
8 | import hu.bme.mit.inf.dslreasoner.alloyLanguage.ALSEnumDeclaration | ||
9 | import hu.bme.mit.inf.dslreasoner.alloyLanguage.ALSFunctionCall | ||
10 | import hu.bme.mit.inf.dslreasoner.alloyLanguage.ALSQuantifiedEx | ||
11 | import hu.bme.mit.inf.dslreasoner.alloyLanguage.ALSReference | ||
12 | import hu.bme.mit.inf.dslreasoner.alloyLanguage.ALSRelationDeclaration | ||
13 | import hu.bme.mit.inf.dslreasoner.alloyLanguage.ALSRelationDefinition | ||
14 | import hu.bme.mit.inf.dslreasoner.alloyLanguage.ALSSignatureBody | ||
15 | import hu.bme.mit.inf.dslreasoner.alloyLanguage.ALSSum | ||
16 | import java.util.ArrayList | ||
17 | import java.util.Collections | ||
18 | import java.util.HashSet | ||
19 | import java.util.LinkedList | ||
20 | import java.util.List | ||
21 | import java.util.Set | ||
22 | import org.eclipse.emf.ecore.EObject | ||
23 | import org.eclipse.emf.ecore.EReference | ||
24 | import org.eclipse.xtext.scoping.IScope | ||
25 | import org.eclipse.xtext.scoping.Scopes | ||
26 | import org.eclipse.xtext.scoping.impl.AbstractDeclarativeScopeProvider | ||
27 | |||
28 | /** | ||
29 | * This class contains custom scoping description. | ||
30 | * | ||
31 | * see : http://www.eclipse.org/Xtext/documentation.html#scoping | ||
32 | * on how and when to use it | ||
33 | * | ||
34 | */ | ||
35 | class AlloyLanguageScopeProvider extends AbstractDeclarativeScopeProvider { | ||
36 | |||
37 | def public IScope scope_ALSReference_referred(ALSReference alsReferecnce, EReference ref) { | ||
38 | val Set<ALSRelationDeclaration> declarations = new HashSet | ||
39 | |||
40 | val parent = alsReferecnce.getAllParents(ALSDocument).head as ALSDocument | ||
41 | val signatures = parent.signatureBodies.map[ALSSignatureBody x|x.declarations].flatten | ||
42 | declarations+=parent.enumDeclarations | ||
43 | declarations+=signatures | ||
44 | declarations+=parent.enumDeclarations.map[ALSEnumDeclaration x | x.literal].flatten | ||
45 | declarations+=parent.signatureBodies.map[ALSSignatureBody x|x.fields].flatten | ||
46 | |||
47 | declarations+=alsReferecnce.getAllParents(ALSQuantifiedEx).map[ALSQuantifiedEx x | x.variables].flatten | ||
48 | declarations+=alsReferecnce.getAllParents(ALSSum).map[ALSSum x | x.variables].flatten | ||
49 | declarations+=alsReferecnce.getAllParents(ALSRelationDefinition).map[ALSRelationDefinition x | x.variables].flatten | ||
50 | |||
51 | // println("---") | ||
52 | // println(declarations.map[it.name].join(", ")) | ||
53 | |||
54 | return Scopes.scopeFor(declarations) | ||
55 | } | ||
56 | //{ALSFunctionCall} (/*functionName=ALSID |*/ referredDefinition=[ALSDefinition]) | ||
57 | def public IScope scope_ALSFunctionCall_referredDefinition(ALSFunctionCall call, EReference ref) { | ||
58 | val parent = call.<ALSDocument>getAllParents(ALSDocument).head as ALSDocument | ||
59 | val list = new LinkedList<ALSDefinition> | ||
60 | list += parent.relationDefinitions | ||
61 | list += parent.functionDefinitions | ||
62 | //list.forEach[println(it.name + " " + it.eContainer)] | ||
63 | return Scopes.scopeFor(list) | ||
64 | } | ||
65 | |||
66 | def <X extends EObject> List<X> getAllParents(EObject object, Class<X> type) { | ||
67 | if(object.eContainer == null) { | ||
68 | return Collections.EMPTY_LIST | ||
69 | } else { | ||
70 | val container = object.eContainer; | ||
71 | val previousParents = container.getAllParents(type) | ||
72 | if(type.isInstance(container)){ | ||
73 | val res = new ArrayList(previousParents) | ||
74 | res+= container as X | ||
75 | return res | ||
76 | } | ||
77 | else return previousParents | ||
78 | |||
79 | } | ||
80 | } | ||
81 | } | ||
diff --git a/Solvers/Alloy-Solver/hu.bme.mit.inf.dslreasoner.alloy.language/src/hu/bme/mit/inf/dslreasoner/validation/AlloyLanguageValidator.xtend b/Solvers/Alloy-Solver/hu.bme.mit.inf.dslreasoner.alloy.language/src/hu/bme/mit/inf/dslreasoner/validation/AlloyLanguageValidator.xtend new file mode 100644 index 00000000..8e1efc99 --- /dev/null +++ b/Solvers/Alloy-Solver/hu.bme.mit.inf.dslreasoner.alloy.language/src/hu/bme/mit/inf/dslreasoner/validation/AlloyLanguageValidator.xtend | |||
@@ -0,0 +1,24 @@ | |||
1 | /* | ||
2 | * generated by Xtext | ||
3 | */ | ||
4 | package hu.bme.mit.inf.dslreasoner.validation | ||
5 | //import org.eclipse.xtext.validation.Check | ||
6 | |||
7 | /** | ||
8 | * Custom validation rules. | ||
9 | * | ||
10 | * see http://www.eclipse.org/Xtext/documentation.html#validation | ||
11 | */ | ||
12 | class AlloyLanguageValidator extends AbstractAlloyLanguageValidator { | ||
13 | |||
14 | // public static val INVALID_NAME = 'invalidName' | ||
15 | // | ||
16 | // @Check | ||
17 | // def checkGreetingStartsWithCapital(Greeting greeting) { | ||
18 | // if (!Character.isUpperCase(greeting.name.charAt(0))) { | ||
19 | // warning('Name should start with a capital', | ||
20 | // MyDslPackage.Literals.GREETING__NAME, | ||
21 | // INVALID_NAME) | ||
22 | // } | ||
23 | // } | ||
24 | } | ||