diff options
author | 2019-08-01 14:49:53 +0200 | |
---|---|---|
committer | 2019-08-01 14:49:53 +0200 | |
commit | 972baab642bd889d2c3476c0c9e17a6929e0c318 (patch) | |
tree | 8f724cb348c60e4fc45d446d8532988ed8e40748 /Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner | |
parent | Counting scope propagator (simpler than BasicTypeHierarchy) (diff) | |
download | VIATRA-Generator-972baab642bd889d2c3476c0c9e17a6929e0c318.tar.gz VIATRA-Generator-972baab642bd889d2c3476c0c9e17a6929e0c318.tar.zst VIATRA-Generator-972baab642bd889d2c3476c0c9e17a6929e0c318.zip |
[Stochastic] Remove fault tree support for now
Diffstat (limited to 'Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner')
4 files changed, 2 insertions, 63 deletions
diff --git a/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/ApplicationConfiguration.xtext b/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/ApplicationConfiguration.xtext index be1ac662..537989f7 100644 --- a/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/ApplicationConfiguration.xtext +++ b/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/ApplicationConfiguration.xtext | |||
@@ -2,7 +2,6 @@ grammar hu.bme.mit.inf.dslreasoner.application.ApplicationConfiguration with org | |||
2 | 2 | ||
3 | import "http://www.eclipse.org/emf/2002/Ecore" as ecore | 3 | import "http://www.eclipse.org/emf/2002/Ecore" as ecore |
4 | import "http://www.eclipse.org/viatra/query/patternlanguage/emf/PatternLanguage" as viatra | 4 | import "http://www.eclipse.org/viatra/query/patternlanguage/emf/PatternLanguage" as viatra |
5 | import "http://www.bme.hu/mit/inf/dslreasoner/faulttree/components/CftLanguage" as cftLanguage | ||
6 | generate applicationConfiguration "http://www.bme.hu/mit/inf/dslreasoner/application/ApplicationConfiguration" | 5 | generate applicationConfiguration "http://www.bme.hu/mit/inf/dslreasoner/application/ApplicationConfiguration" |
7 | 6 | ||
8 | ConfigurationScript: | 7 | ConfigurationScript: |
@@ -25,16 +24,13 @@ INTLiteral returns ecore::EInt: | |||
25 | // Imports | 24 | // Imports |
26 | /////////////////////////////////////////////////// | 25 | /////////////////////////////////////////////////// |
27 | Import: | 26 | Import: |
28 | EPackageImport | ViatraImport | CftImport; | 27 | EPackageImport | ViatraImport; |
29 | 28 | ||
30 | EPackageImport: | 29 | EPackageImport: |
31 | "import" "epackage" importedPackage=[ecore::EPackage|STRING]; | 30 | "import" "epackage" importedPackage=[ecore::EPackage|STRING]; |
32 | 31 | ||
33 | ViatraImport: | 32 | ViatraImport: |
34 | "import" "viatra" importedViatra=[viatra::PatternModel|STRING]; | 33 | "import" "viatra" importedViatra=[viatra::PatternModel|STRING]; |
35 | |||
36 | CftImport: | ||
37 | "import" "reliability" importedCft=[cftLanguage::CftModel|STRING]; | ||
38 | 34 | ||
39 | /////////////////////////////////////////////////// | 35 | /////////////////////////////////////////////////// |
40 | // Declaration | 36 | // Declaration |
@@ -160,7 +156,7 @@ ThresholdEntry: | |||
160 | function=ObjectiveFunction operator=ComparisonOperator threshold=REALLiteral; | 156 | function=ObjectiveFunction operator=ComparisonOperator threshold=REALLiteral; |
161 | 157 | ||
162 | ObjectiveFunction: | 158 | ObjectiveFunction: |
163 | CostObjectiveFunction | ReliabilityObjectiveFunction; | 159 | CostObjectiveFunction; |
164 | 160 | ||
165 | CostObjectiveFunction: | 161 | CostObjectiveFunction: |
166 | 'cost' '{' entries+=CostEntry (',' entries+=CostEntry)* '}'; | 162 | 'cost' '{' entries+=CostEntry (',' entries+=CostEntry)* '}'; |
@@ -168,17 +164,6 @@ CostObjectiveFunction: | |||
168 | CostEntry: | 164 | CostEntry: |
169 | patternElement=PatternElement '=' weight=INTLiteral; | 165 | patternElement=PatternElement '=' weight=INTLiteral; |
170 | 166 | ||
171 | ReliabilityObjectiveFunction: | ||
172 | ReliabiltiyProbability | Mtff; | ||
173 | |||
174 | ReliabiltiyProbability: | ||
175 | 'reliability' (package=[cftLanguage::CftModel|QualifiedName] '::')? | ||
176 | transformation=[cftLanguage::TransformationDefinition] | ||
177 | 'at' time=REALLiteral; | ||
178 | |||
179 | Mtff: | ||
180 | 'mtff' (package=[cftLanguage::CftModel|QualifiedName] '::')? transformation=[cftLanguage::TransformationDefinition]; | ||
181 | |||
182 | ObjectiveDeclaration: | 167 | ObjectiveDeclaration: |
183 | 'objectives' name=ID specification=ObjectiveSpecification; | 168 | 'objectives' name=ID specification=ObjectiveSpecification; |
184 | 169 | ||
diff --git a/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/GenerateApplicationConfiguration.mwe2 b/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/GenerateApplicationConfiguration.mwe2 index 3983cd10..13cc78a8 100644 --- a/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/GenerateApplicationConfiguration.mwe2 +++ b/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/GenerateApplicationConfiguration.mwe2 | |||
@@ -31,7 +31,6 @@ Workflow { | |||
31 | name = "hu.bme.mit.inf.dslreasoner.application.ApplicationConfiguration" | 31 | name = "hu.bme.mit.inf.dslreasoner.application.ApplicationConfiguration" |
32 | referencedResource = "platform:/resource/org.eclipse.emf.ecore/model/Ecore.genmodel" | 32 | referencedResource = "platform:/resource/org.eclipse.emf.ecore/model/Ecore.genmodel" |
33 | referencedResource = "platform:/resource/org.eclipse.viatra.query.patternlanguage.emf/model/PatternLanguage.genmodel" | 33 | referencedResource = "platform:/resource/org.eclipse.viatra.query.patternlanguage.emf/model/PatternLanguage.genmodel" |
34 | referencedResource = "platform:/resource/hu.bme.mit.inf.dslreasoner.faulttree.components/model/generated/CftLanguage.genmodel" | ||
35 | fileExtensions = "vsconfig" | 34 | fileExtensions = "vsconfig" |
36 | serializer = { | 35 | serializer = { |
37 | generateStub = false | 36 | generateStub = false |
diff --git a/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/linking/ApplicationConfigurationLinkingService.xtend b/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/linking/ApplicationConfigurationLinkingService.xtend index ec79ac89..fafba1d7 100644 --- a/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/linking/ApplicationConfigurationLinkingService.xtend +++ b/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/linking/ApplicationConfigurationLinkingService.xtend | |||
@@ -2,13 +2,9 @@ package hu.bme.mit.inf.dslreasoner.application.linking | |||
2 | 2 | ||
3 | import com.google.inject.Inject | 3 | import com.google.inject.Inject |
4 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.ApplicationConfigurationPackage | 4 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.ApplicationConfigurationPackage |
5 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.CftImport | ||
6 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.ConfigurationScript | ||
7 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.EPackageImport | 5 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.EPackageImport |
8 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.PatternEntry | ||
9 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.ViatraImport | 6 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.ViatraImport |
10 | import java.util.Collections | 7 | import java.util.Collections |
11 | import java.util.List | ||
12 | import java.util.Optional | 8 | import java.util.Optional |
13 | import org.eclipse.emf.common.util.URI | 9 | import org.eclipse.emf.common.util.URI |
14 | import org.eclipse.emf.ecore.EObject | 10 | import org.eclipse.emf.ecore.EObject |
@@ -17,7 +13,6 @@ import org.eclipse.emf.ecore.EReference | |||
17 | import org.eclipse.emf.ecore.resource.Resource | 13 | import org.eclipse.emf.ecore.resource.Resource |
18 | import org.eclipse.emf.ecore.resource.ResourceSet | 14 | import org.eclipse.emf.ecore.resource.ResourceSet |
19 | import org.eclipse.viatra.query.patternlanguage.emf.scoping.IMetamodelProvider | 15 | import org.eclipse.viatra.query.patternlanguage.emf.scoping.IMetamodelProvider |
20 | import org.eclipse.xtext.EcoreUtil2 | ||
21 | import org.eclipse.xtext.conversion.IValueConverterService | 16 | import org.eclipse.xtext.conversion.IValueConverterService |
22 | import org.eclipse.xtext.conversion.ValueConverterException | 17 | import org.eclipse.xtext.conversion.ValueConverterException |
23 | import org.eclipse.xtext.linking.impl.DefaultLinkingService | 18 | import org.eclipse.xtext.linking.impl.DefaultLinkingService |
@@ -39,10 +34,6 @@ class ApplicationConfigurationLinkingService extends DefaultLinkingService { | |||
39 | if (ref == viatraImport_ImportedViatra) { | 34 | if (ref == viatraImport_ImportedViatra) { |
40 | return getViatra(context, node) | 35 | return getViatra(context, node) |
41 | } | 36 | } |
42 | } else if (context instanceof CftImport) { | ||
43 | if (ref == cftImport_ImportedCft) { | ||
44 | return getCftModel(context, node) | ||
45 | } | ||
46 | } | 37 | } |
47 | return super.getLinkedObjects(context, ref, node) | 38 | return super.getLinkedObjects(context, ref, node) |
48 | } | 39 | } |
@@ -113,8 +104,4 @@ class ApplicationConfigurationLinkingService extends DefaultLinkingService { | |||
113 | Optional.empty | 104 | Optional.empty |
114 | } | 105 | } |
115 | } | 106 | } |
116 | |||
117 | private def getCftModel(CftImport context, INode node) { | ||
118 | getByUri(context, cftImport_ImportedCft, node) | ||
119 | } | ||
120 | } | 107 | } |
diff --git a/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/scoping/ApplicationConfigurationScopeProvider.xtend b/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/scoping/ApplicationConfigurationScopeProvider.xtend index 4daf9831..e5db9893 100644 --- a/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/scoping/ApplicationConfigurationScopeProvider.xtend +++ b/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/scoping/ApplicationConfigurationScopeProvider.xtend | |||
@@ -4,15 +4,12 @@ | |||
4 | package hu.bme.mit.inf.dslreasoner.application.scoping | 4 | package hu.bme.mit.inf.dslreasoner.application.scoping |
5 | 5 | ||
6 | import com.google.inject.Inject | 6 | import com.google.inject.Inject |
7 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.CftImport | ||
8 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.ConfigurationScript | 7 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.ConfigurationScript |
9 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.EPackageImport | 8 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.EPackageImport |
10 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.MetamodelElement | 9 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.MetamodelElement |
11 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.MetamodelEntry | 10 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.MetamodelEntry |
12 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.PatternEntry | 11 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.PatternEntry |
13 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.ReliabilityObjectiveFunction | ||
14 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.ViatraImport | 12 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.ViatraImport |
15 | import hu.bme.mit.inf.dslreasoner.faulttree.components.cftLanguage.CftModel | ||
16 | import org.eclipse.emf.ecore.EClass | 13 | import org.eclipse.emf.ecore.EClass |
17 | import org.eclipse.emf.ecore.EEnum | 14 | import org.eclipse.emf.ecore.EEnum |
18 | import org.eclipse.emf.ecore.EObject | 15 | import org.eclipse.emf.ecore.EObject |
@@ -47,10 +44,6 @@ class ApplicationConfigurationScopeProvider extends AbstractApplicationConfigura | |||
47 | getViatraPackageScope(context, reference, document) | 44 | getViatraPackageScope(context, reference, document) |
48 | case PATTERN_ELEMENT__PATTERN: | 45 | case PATTERN_ELEMENT__PATTERN: |
49 | getViatraPatternScope(context, document) | 46 | getViatraPatternScope(context, document) |
50 | case RELIABILITY_OBJECTIVE_FUNCTION__PACKAGE: | ||
51 | getCftPackageScope(context, reference, document) | ||
52 | case RELIABILITY_OBJECTIVE_FUNCTION__TRANSFORMATION: | ||
53 | getCftTransformationScope(context, document) | ||
54 | default: | 47 | default: |
55 | super.getScope(context, reference) | 48 | super.getScope(context, reference) |
56 | } | 49 | } |
@@ -72,14 +65,6 @@ class ApplicationConfigurationScopeProvider extends AbstractApplicationConfigura | |||
72 | document.allViatraPackages.map[patterns].flatten | 65 | document.allViatraPackages.map[patterns].flatten |
73 | } | 66 | } |
74 | 67 | ||
75 | private def getAllCftPackages(ConfigurationScript document) { | ||
76 | document.imports.filter(CftImport).map[importedCft].filterNull | ||
77 | } | ||
78 | |||
79 | private def getAllCftTransformations(ConfigurationScript document) { | ||
80 | document.allCftPackages.map[transformationDefinitions].flatten | ||
81 | } | ||
82 | |||
83 | private def getEPackageScope(ConfigurationScript document) { | 68 | private def getEPackageScope(ConfigurationScript document) { |
84 | Scopes.scopeFor(document.allEPackages) | 69 | Scopes.scopeFor(document.allEPackages) |
85 | } | 70 | } |
@@ -126,23 +111,6 @@ class ApplicationConfigurationScopeProvider extends AbstractApplicationConfigura | |||
126 | } | 111 | } |
127 | Scopes.scopeFor(patterns) | 112 | Scopes.scopeFor(patterns) |
128 | } | 113 | } |
129 | |||
130 | private def getCftPackageScope(EObject context, EReference reference, ConfigurationScript document) { | ||
131 | val cftModelNameConverter = [ CftModel cftModel | | ||
132 | toQualifiedNameOrNull(cftModel.packageName) | ||
133 | ] | ||
134 | Scopes.scopeFor(document.allCftPackages, cftModelNameConverter, super.getScope(context, reference)) | ||
135 | } | ||
136 | |||
137 | private def getCftTransformationScope(EObject context, ConfigurationScript document) { | ||
138 | val transformations = switch (context) { | ||
139 | ReliabilityObjectiveFunction case context.package !== null: | ||
140 | context.package.transformationDefinitions | ||
141 | default: | ||
142 | document.allCftTransformations | ||
143 | } | ||
144 | Scopes.scopeFor(transformations) | ||
145 | } | ||
146 | 114 | ||
147 | private def toQualifiedNameOrNull(String packageName) { | 115 | private def toQualifiedNameOrNull(String packageName) { |
148 | if (packageName === null) { | 116 | if (packageName === null) { |