diff options
author | 2019-03-20 16:09:09 +0100 | |
---|---|---|
committer | 2019-03-20 16:09:09 +0100 | |
commit | 3f5aaab5025b8eb243f414b1c789085327df04f4 (patch) | |
tree | 156d9d95888fce6b003d73f509b9155e6b24555f /Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation | |
parent | Fix ParseUtil to avoid breaking the .vql editor in Eclipse (diff) | |
download | VIATRA-Generator-3f5aaab5025b8eb243f414b1c789085327df04f4.tar.gz VIATRA-Generator-3f5aaab5025b8eb243f414b1c789085327df04f4.tar.zst VIATRA-Generator-3f5aaab5025b8eb243f414b1c789085327df04f4.zip |
Fault tree transformation for partial models WIP
Diffstat (limited to 'Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation')
34 files changed, 147 insertions, 62 deletions
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/META-INF/MANIFEST.MF b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/META-INF/MANIFEST.MF index ce704acf..5ee6a4f1 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/META-INF/MANIFEST.MF +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/META-INF/MANIFEST.MF | |||
@@ -15,7 +15,6 @@ Require-Bundle: com.google.guava, | |||
15 | org.eclipse.viatra.query.runtime.localsearch, | 15 | org.eclipse.viatra.query.runtime.localsearch, |
16 | hu.bme.mit.inf.dslreasoner.faulttree.components, | 16 | hu.bme.mit.inf.dslreasoner.faulttree.components, |
17 | hu.bme.mit.inf.dslreasoner.logic.model, | 17 | hu.bme.mit.inf.dslreasoner.logic.model, |
18 | com.github.jnr.constants;bundle-version="0.9.8", | ||
19 | org.apache.commons.lang;bundle-version="2.6.0" | 18 | org.apache.commons.lang;bundle-version="2.6.0" |
20 | Export-Package: hu.bme.mit.inf.dslreasoner.faulttree.transformation.cft2ft, | 19 | Export-Package: hu.bme.mit.inf.dslreasoner.faulttree.transformation.cft2ft, |
21 | hu.bme.mit.inf.dslreasoner.faulttree.transformation.ecore2cft, | 20 | hu.bme.mit.inf.dslreasoner.faulttree.transformation.ecore2cft, |
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/src/hu/bme/mit/inf/dslreasoner/faulttree/transformation/cft2ft/EventMaterializer.xtend b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/src/hu/bme/mit/inf/dslreasoner/faulttree/transformation/cft2ft/EventMaterializer.xtend index c9aefe51..6b3ed0d0 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/src/hu/bme/mit/inf/dslreasoner/faulttree/transformation/cft2ft/EventMaterializer.xtend +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/src/hu/bme/mit/inf/dslreasoner/faulttree/transformation/cft2ft/EventMaterializer.xtend | |||
@@ -17,6 +17,8 @@ import java.util.Map | |||
17 | import org.eclipse.emf.ecore.util.EcoreUtil | 17 | import org.eclipse.emf.ecore.util.EcoreUtil |
18 | import org.eclipse.xtend.lib.annotations.Data | 18 | import org.eclipse.xtend.lib.annotations.Data |
19 | 19 | ||
20 | import static extension hu.bme.mit.inf.dslreasoner.faulttree.model.util.CftExtensions.* | ||
21 | |||
20 | class EventMaterializer { | 22 | class EventMaterializer { |
21 | extension val FtFactory = FtFactory.eINSTANCE | 23 | extension val FtFactory = FtFactory.eINSTANCE |
22 | 24 | ||
@@ -169,8 +171,10 @@ class EventMaterializer { | |||
169 | val input = findInput(component, inputEvent) | 171 | val input = findInput(component, inputEvent) |
170 | val builder = EventCollection.builder | 172 | val builder = EventCollection.builder |
171 | for (connection : input.incomingConnections) { | 173 | for (connection : input.incomingConnections) { |
172 | val materializedEvent = getOrMaterialize(connection.output) | 174 | if (connection.isCurrentlyConnected) { |
173 | builder.add(materializedEvent) | 175 | val materializedEvent = getOrMaterialize(connection.output) |
176 | builder.add(materializedEvent) | ||
177 | } | ||
174 | } | 178 | } |
175 | builder.build | 179 | builder.build |
176 | } | 180 | } |
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/src/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/ComponentFaultTreeTrace.xtend b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/src/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/ComponentFaultTreeTrace.xtend index 7a3e377b..10c91fb4 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/src/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/ComponentFaultTreeTrace.xtend +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/src/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/ComponentFaultTreeTrace.xtend | |||
@@ -2,6 +2,7 @@ package hu.bme.mit.inf.dslreasoner.faulttree.transformation.ecore2cft | |||
2 | 2 | ||
3 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.CftFactory | 3 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.CftFactory |
4 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.ComponentDefinition | 4 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.ComponentDefinition |
5 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.Modality | ||
5 | import java.util.Map | 6 | import java.util.Map |
6 | import org.eclipse.viatra.query.runtime.api.IPatternMatch | 7 | import org.eclipse.viatra.query.runtime.api.IPatternMatch |
7 | import org.eclipse.xtend.lib.annotations.Accessors | 8 | import org.eclipse.xtend.lib.annotations.Accessors |
@@ -13,10 +14,16 @@ class ComponentFaultTreeTrace { | |||
13 | val Map<IPatternMatch, ComponentInstanceTrace> componentInstancesMap = newHashMap | 14 | val Map<IPatternMatch, ComponentInstanceTrace> componentInstancesMap = newHashMap |
14 | 15 | ||
15 | def instantiateComponent(IPatternMatch patternMatch, ComponentDefinition componenDefinition) { | 16 | def instantiateComponent(IPatternMatch patternMatch, ComponentDefinition componenDefinition) { |
17 | instantiateComponent(patternMatch, componenDefinition, Modality.MUST, false) | ||
18 | } | ||
19 | |||
20 | def instantiateComponent(IPatternMatch patternMatch, ComponentDefinition componenDefinition, Modality exists, | ||
21 | boolean allowMultiple) { | ||
16 | if (componentInstancesMap.containsKey(patternMatch)) { | 22 | if (componentInstancesMap.containsKey(patternMatch)) { |
17 | throw new IllegalArgumentException("Already instantiated component for match: " + patternMatch) | 23 | throw new IllegalArgumentException("Already instantiated component for match: " + patternMatch) |
18 | } | 24 | } |
19 | val componentTrace = new ComponentInstanceTrace(componentFaultTree, componenDefinition, nameGenerator) | 25 | val componentTrace = new ComponentInstanceTrace(componentFaultTree, componenDefinition, nameGenerator, |
26 | exists, allowMultiple) | ||
20 | componentInstancesMap.put(patternMatch, componentTrace) | 27 | componentInstancesMap.put(patternMatch, componentTrace) |
21 | componentTrace | 28 | componentTrace |
22 | } | 29 | } |
@@ -30,6 +37,9 @@ class ComponentFaultTreeTrace { | |||
30 | throw new IllegalArgumentException("Top level component must have 1 output, got " + outputs.size + | 37 | throw new IllegalArgumentException("Top level component must have 1 output, got " + outputs.size + |
31 | " instead") | 38 | " instead") |
32 | } | 39 | } |
40 | if (!trace.appearsExactlyOnce) { | ||
41 | throw new IllegalArgumentException("Top level must appear in the fault tree exactly once") | ||
42 | } | ||
33 | componentFaultTree.topEvent = outputs.head | 43 | componentFaultTree.topEvent = outputs.head |
34 | } | 44 | } |
35 | 45 | ||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/src/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/ComponentInstanceTrace.xtend b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/src/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/ComponentInstanceTrace.xtend index 7353bfe5..158ab2e1 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/src/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/ComponentInstanceTrace.xtend +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/src/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/ComponentInstanceTrace.xtend | |||
@@ -6,18 +6,23 @@ import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.ComponentDefinition | |||
6 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.ComponentFaultTree | 6 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.ComponentFaultTree |
7 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.EventDeclaration | 7 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.EventDeclaration |
8 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.InputEvent | 8 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.InputEvent |
9 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.Modality | ||
9 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.Output | 10 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.Output |
10 | import java.util.Map | 11 | import java.util.Map |
11 | 12 | ||
13 | import static extension hu.bme.mit.inf.dslreasoner.faulttree.model.util.CftExtensions.* | ||
14 | |||
12 | class ComponentInstanceTrace { | 15 | class ComponentInstanceTrace { |
13 | val componentInstance = CftFactory.eINSTANCE.createComponent | 16 | val componentInstance = CftFactory.eINSTANCE.createComponent |
14 | val Map<InputEvent, InputTrace> inputEventsMap | 17 | val Map<InputEvent, InputTrace> inputEventsMap |
15 | val Map<EventDeclaration, Output> outputEventsMap | 18 | val Map<EventDeclaration, Output> outputEventsMap |
16 | 19 | ||
17 | protected new(ComponentFaultTree faultTree, ComponentDefinition componentDefinition, | 20 | protected new(ComponentFaultTree faultTree, ComponentDefinition componentDefinition, |
18 | ComponentNameGenerator nameGenerator) { | 21 | ComponentNameGenerator nameGenerator, Modality exists, boolean multipleAllowed) { |
19 | componentInstance.componentDefinition = componentDefinition | 22 | componentInstance.componentDefinition = componentDefinition |
20 | componentInstance.name = nameGenerator.nextName(componentDefinition) | 23 | componentInstance.name = nameGenerator.nextName(componentDefinition) |
24 | componentInstance.exists = exists | ||
25 | componentInstance.multipleAllowed = multipleAllowed | ||
21 | inputEventsMap = Maps.newHashMapWithExpectedSize(componentDefinition.inputEvents.size) | 26 | inputEventsMap = Maps.newHashMapWithExpectedSize(componentDefinition.inputEvents.size) |
22 | for (inputEvent : componentDefinition.inputEvents) { | 27 | for (inputEvent : componentDefinition.inputEvents) { |
23 | val inputTrace = new InputTrace(componentInstance, inputEvent) | 28 | val inputTrace = new InputTrace(componentInstance, inputEvent) |
@@ -34,6 +39,11 @@ class ComponentInstanceTrace { | |||
34 | } | 39 | } |
35 | 40 | ||
36 | def void assign(EventDeclaration inputEvent, ComponentInstanceTrace sourceComponent, EventDeclaration outputEvent) { | 41 | def void assign(EventDeclaration inputEvent, ComponentInstanceTrace sourceComponent, EventDeclaration outputEvent) { |
42 | assign(inputEvent, sourceComponent, outputEvent, Modality.MUST) | ||
43 | } | ||
44 | |||
45 | def void assign(EventDeclaration inputEvent, ComponentInstanceTrace sourceComponent, EventDeclaration outputEvent, | ||
46 | Modality exists) { | ||
37 | val inputTrace = inputEventsMap.get(inputEvent) | 47 | val inputTrace = inputEventsMap.get(inputEvent) |
38 | if (inputTrace === null) { | 48 | if (inputTrace === null) { |
39 | throw new IllegalArgumentException("Unknown input: " + inputEvent) | 49 | throw new IllegalArgumentException("Unknown input: " + inputEvent) |
@@ -42,10 +52,14 @@ class ComponentInstanceTrace { | |||
42 | if (output === null) { | 52 | if (output === null) { |
43 | throw new IllegalArgumentException("Unknown output: " + outputEvent) | 53 | throw new IllegalArgumentException("Unknown output: " + outputEvent) |
44 | } | 54 | } |
45 | inputTrace.assign(output) | 55 | inputTrace.assign(output, exists) |
46 | } | 56 | } |
47 | 57 | ||
48 | protected def getOutputs() { | 58 | protected def getOutputs() { |
49 | componentInstance.outputs | 59 | componentInstance.outputs |
50 | } | 60 | } |
61 | |||
62 | protected def appearsExactlyOnce() { | ||
63 | componentInstance.appearsExactlyOnce | ||
64 | } | ||
51 | } | 65 | } |
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/src/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/InputTrace.xtend b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/src/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/InputTrace.xtend index c529a09b..b892eff1 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/src/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/InputTrace.xtend +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/src/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/InputTrace.xtend | |||
@@ -5,9 +5,12 @@ import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.Component | |||
5 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.Connection | 5 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.Connection |
6 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.Input | 6 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.Input |
7 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.InputEvent | 7 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.InputEvent |
8 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.Modality | ||
8 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.Output | 9 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.Output |
9 | import java.util.Map | 10 | import java.util.Map |
10 | 11 | ||
12 | import static extension hu.bme.mit.inf.dslreasoner.faulttree.model.util.CftExtensions.* | ||
13 | |||
11 | class InputTrace { | 14 | class InputTrace { |
12 | val Input input = CftFactory.eINSTANCE.createInput | 15 | val Input input = CftFactory.eINSTANCE.createInput |
13 | val Map<Output, Connection> connectionsMap = newHashMap | 16 | val Map<Output, Connection> connectionsMap = newHashMap |
@@ -17,13 +20,16 @@ class InputTrace { | |||
17 | component.inputs += input | 20 | component.inputs += input |
18 | } | 21 | } |
19 | 22 | ||
20 | def void assign(Output output) { | 23 | def void assign(Output output, Modality exists) { |
21 | val connection = connectionsMap.get(output) | 24 | val connection = connectionsMap.get(output) |
22 | if (connection === null) { | 25 | if (connection === null) { |
23 | val newConnection = CftFactory.eINSTANCE.createConnection | 26 | val newConnection = CftFactory.eINSTANCE.createConnection |
24 | newConnection.output = output | 27 | newConnection.output = output |
28 | newConnection.exists = exists | ||
25 | input.incomingConnections += newConnection | 29 | input.incomingConnections += newConnection |
26 | connectionsMap.put(output, newConnection) | 30 | connectionsMap.put(output, newConnection) |
31 | } else if (exists.isMoreConcreteThan(connection.exists)) { | ||
32 | connection.exists = exists | ||
27 | } | 33 | } |
28 | } | 34 | } |
29 | } | 35 | } |
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/src/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ft2galileo/Ft2GalileoTransformation.xtend b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/src/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ft2galileo/Ft2GalileoTransformation.xtend index 732d9fed..4a19e2cd 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/src/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ft2galileo/Ft2GalileoTransformation.xtend +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/src/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ft2galileo/Ft2GalileoTransformation.xtend | |||
@@ -14,14 +14,15 @@ import org.eclipse.xtend2.lib.StringConcatenationClient | |||
14 | 14 | ||
15 | class Ft2GalileoTransformation { | 15 | class Ft2GalileoTransformation { |
16 | def toGalileo(FaultTree faultTree) ''' | 16 | def toGalileo(FaultTree faultTree) ''' |
17 | toplevel «faultTree.topEvent.name»; | 17 | toplevel "«faultTree.topEvent.name»"; |
18 | «FOR event : faultTree.events» | 18 | «FOR event : faultTree.events» |
19 | «event.name» «defineEvent(event)»; | 19 | "«event.name»" «defineEvent(event)»; |
20 | «ENDFOR» | 20 | «ENDFOR» |
21 | ''' | 21 | ''' |
22 | 22 | ||
23 | protected dispatch def defineEvent(BasicEvent basicEvent) { | 23 | protected dispatch def defineEvent(BasicEvent basicEvent) { |
24 | defineDistribution(basicEvent.distribution) | 24 | // ft-diet (https://moves.rwth-aachen.de/ft-diet/) needs a dormancy factor. |
25 | '''«defineDistribution(basicEvent.distribution)» dorm=0.0''' | ||
25 | } | 26 | } |
26 | 27 | ||
27 | protected dispatch def StringConcatenationClient defineDistribution(ConstantDistribution distribution) { | 28 | protected dispatch def StringConcatenationClient defineDistribution(ConstantDistribution distribution) { |
@@ -37,7 +38,7 @@ class Ft2GalileoTransformation { | |||
37 | } | 38 | } |
38 | 39 | ||
39 | protected dispatch def StringConcatenationClient defineEvent(Gate gate) { | 40 | protected dispatch def StringConcatenationClient defineEvent(Gate gate) { |
40 | '''«defineGate(gate)» «FOR input : gate.inputEvents SEPARATOR " "»«input.name»«ENDFOR»''' | 41 | '''«defineGate(gate)» «FOR input : gate.inputEvents SEPARATOR " "»"«input.name»"«ENDFOR»''' |
41 | } | 42 | } |
42 | 43 | ||
43 | protected dispatch def StringConcatenationClient defineGate(AndGate gate) '''and''' | 44 | protected dispatch def StringConcatenationClient defineGate(AndGate gate) '''and''' |
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/src/hu/bme/mit/inf/dslreasoner/faulttree/transformation/solver/StormDftHandler.xtend b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/src/hu/bme/mit/inf/dslreasoner/faulttree/transformation/solver/StormDftHandler.xtend index 91c6a0d0..a250a955 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/src/hu/bme/mit/inf/dslreasoner/faulttree/transformation/solver/StormDftHandler.xtend +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/src/hu/bme/mit/inf/dslreasoner/faulttree/transformation/solver/StormDftHandler.xtend | |||
@@ -8,8 +8,6 @@ import java.io.IOException | |||
8 | import java.io.InputStream | 8 | import java.io.InputStream |
9 | import java.io.InputStreamReader | 9 | import java.io.InputStreamReader |
10 | import java.util.regex.Pattern | 10 | import java.util.regex.Pattern |
11 | import jnr.constants.platform.Signal | ||
12 | import org.apache.commons.lang.SystemUtils | ||
13 | 11 | ||
14 | class StormDftException extends RuntimeException { | 12 | class StormDftException extends RuntimeException { |
15 | new(String s) { | 13 | new(String s) { |
@@ -29,8 +27,9 @@ class StormDftHandler { | |||
29 | static val RESULT_REGEX = '''^Result:\s*\[(?:(?<«SINGLE_RESULT_GROUP»>«DOUBLE_REGEX»)|\((?<«LOWER_BOUND_GROUP»>«DOUBLE_REGEX»),\s*(?<«UPPER_BOUND_GROUP»>«DOUBLE_REGEX»)\))\]''' | 27 | static val RESULT_REGEX = '''^Result:\s*\[(?:(?<«SINGLE_RESULT_GROUP»>«DOUBLE_REGEX»)|\((?<«LOWER_BOUND_GROUP»>«DOUBLE_REGEX»),\s*(?<«UPPER_BOUND_GROUP»>«DOUBLE_REGEX»)\))\]''' |
30 | static val RESULT_PATTERN = Pattern.compile(RESULT_REGEX) | 28 | static val RESULT_PATTERN = Pattern.compile(RESULT_REGEX) |
31 | 29 | ||
32 | // See http://hg.openjdk.java.net/jdk7/jdk7/jdk/file/jdk7-b147/src/solaris/native/java/lang/UNIXProcess_md.c#l332 | 30 | static val SIGNAL_EXIT_VALUE_OFFSET = 0x80 |
33 | static val SIGNAL_EXIT_VALUE_OFFSET = if(SystemUtils.IS_OS_SOLARIS) 0 else 0x80 | 31 | static val SIGXCPU = 24 |
32 | static val SIGXFSZ = 25 | ||
34 | 33 | ||
35 | static val STORM_GENERAL_ERROR = (-1).bitwiseAnd(0xff) | 34 | static val STORM_GENERAL_ERROR = (-1).bitwiseAnd(0xff) |
36 | static val STORM_TIMEOUT = (-2).bitwiseAnd(0xff) | 35 | static val STORM_TIMEOUT = (-2).bitwiseAnd(0xff) |
@@ -166,18 +165,15 @@ class StormDftHandler { | |||
166 | case STORM_GENERAL_ERROR: | 165 | case STORM_GENERAL_ERROR: |
167 | throw new StormDftException("Storm error: " + error) | 166 | throw new StormDftException("Storm error: " + error) |
168 | case STORM_TIMEOUT, | 167 | case STORM_TIMEOUT, |
169 | case SIGNAL_EXIT_VALUE_OFFSET + Signal.SIGXCPU.intValue: | 168 | case SIGNAL_EXIT_VALUE_OFFSET + SIGXCPU: |
170 | ReliabilityResult.TIMEOUT | 169 | ReliabilityResult.TIMEOUT |
171 | case STORM_MEMOUT, | 170 | case STORM_MEMOUT, |
172 | case SIGNAL_EXIT_VALUE_OFFSET + Signal.SIGXFSZ.intValue: | 171 | case SIGNAL_EXIT_VALUE_OFFSET + SIGXFSZ: |
173 | ReliabilityResult.MEMOUT | 172 | ReliabilityResult.MEMOUT |
174 | default: { | 173 | default: { |
175 | if (exitValue > SIGNAL_EXIT_VALUE_OFFSET) { | 174 | if (exitValue > SIGNAL_EXIT_VALUE_OFFSET) { |
176 | val signalNumber = exitValue - SIGNAL_EXIT_VALUE_OFFSET | 175 | val signalNumber = exitValue - SIGNAL_EXIT_VALUE_OFFSET |
177 | val signal = Signal.values.findFirst[intValue == signalNumber] | 176 | throw new StormDftException("Storm unexpectedly killed by signal " + signalNumber + ": " + error) |
178 | if (signal !== null) { | ||
179 | throw new StormDftException("Storm unexpectedly killed by signal " + signal + ": " + error) | ||
180 | } | ||
181 | } | 177 | } |
182 | throw new StormDftException("Storm unexpectedly exit with status " + exitValue + ": " + error) | 178 | throw new StormDftException("Storm unexpectedly exit with status " + exitValue + ": " + error) |
183 | } | 179 | } |
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/cft2ft/.Cft2FtTransformation.xtendbin b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/cft2ft/.Cft2FtTransformation.xtendbin index 226e6227..f68d0464 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/cft2ft/.Cft2FtTransformation.xtendbin +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/cft2ft/.Cft2FtTransformation.xtendbin | |||
Binary files differ | |||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/cft2ft/.EventCollection.xtendbin b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/cft2ft/.EventCollection.xtendbin index 54ba3d09..6aebfa85 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/cft2ft/.EventCollection.xtendbin +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/cft2ft/.EventCollection.xtendbin | |||
Binary files differ | |||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/cft2ft/.EventMaterializer.xtendbin b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/cft2ft/.EventMaterializer.xtendbin index 175ae3f1..323f40b2 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/cft2ft/.EventMaterializer.xtendbin +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/cft2ft/.EventMaterializer.xtendbin | |||
Binary files differ | |||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/cft2ft/.FaultTreeBuilder.xtendbin b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/cft2ft/.FaultTreeBuilder.xtendbin index db3a7e73..45b228d3 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/cft2ft/.FaultTreeBuilder.xtendbin +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/cft2ft/.FaultTreeBuilder.xtendbin | |||
Binary files differ | |||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/cft2ft/.gitignore b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/cft2ft/.gitignore index 75154a4c..058cff19 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/cft2ft/.gitignore +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/cft2ft/.gitignore | |||
@@ -6,3 +6,11 @@ | |||
6 | /.FaultTreeBuilder.java._trace | 6 | /.FaultTreeBuilder.java._trace |
7 | /.FaultModelBuilder.java._trace | 7 | /.FaultModelBuilder.java._trace |
8 | /.EventCollection.java._trace | 8 | /.EventCollection.java._trace |
9 | /.Cft2FtTransformation.xtendbin | ||
10 | /.EventCollection.xtendbin | ||
11 | /.EventMaterializer.xtendbin | ||
12 | /.FaultTreeBuilder.xtendbin | ||
13 | /Cft2FtTransformation.java | ||
14 | /EventCollection.java | ||
15 | /EventMaterializer.java | ||
16 | /FaultTreeBuilder.java | ||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/cft2ft/EventMaterializer.java b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/cft2ft/EventMaterializer.java index ac1fc209..98a82b7d 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/cft2ft/EventMaterializer.java +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/cft2ft/EventMaterializer.java | |||
@@ -22,6 +22,7 @@ import hu.bme.mit.inf.dslreasoner.faulttree.model.ft.Gate; | |||
22 | import hu.bme.mit.inf.dslreasoner.faulttree.model.ft.KOfMGate; | 22 | import hu.bme.mit.inf.dslreasoner.faulttree.model.ft.KOfMGate; |
23 | import hu.bme.mit.inf.dslreasoner.faulttree.model.ft.OrGate; | 23 | import hu.bme.mit.inf.dslreasoner.faulttree.model.ft.OrGate; |
24 | import hu.bme.mit.inf.dslreasoner.faulttree.model.ft.RandomEvent; | 24 | import hu.bme.mit.inf.dslreasoner.faulttree.model.ft.RandomEvent; |
25 | import hu.bme.mit.inf.dslreasoner.faulttree.model.util.CftExtensions; | ||
25 | import hu.bme.mit.inf.dslreasoner.faulttree.transformation.cft2ft.EventCollection; | 26 | import hu.bme.mit.inf.dslreasoner.faulttree.transformation.cft2ft.EventCollection; |
26 | import java.util.LinkedHashSet; | 27 | import java.util.LinkedHashSet; |
27 | import java.util.Map; | 28 | import java.util.Map; |
@@ -416,7 +417,8 @@ public class EventMaterializer { | |||
416 | final EventCollection.Builder builder = EventCollection.builder(); | 417 | final EventCollection.Builder builder = EventCollection.builder(); |
417 | EList<Connection> _incomingConnections = input.getIncomingConnections(); | 418 | EList<Connection> _incomingConnections = input.getIncomingConnections(); |
418 | for (final Connection connection : _incomingConnections) { | 419 | for (final Connection connection : _incomingConnections) { |
419 | { | 420 | boolean _isCurrentlyConnected = CftExtensions.isCurrentlyConnected(connection); |
421 | if (_isCurrentlyConnected) { | ||
420 | final Event materializedEvent = this.getOrMaterialize(connection.getOutput()); | 422 | final Event materializedEvent = this.getOrMaterialize(connection.getOutput()); |
421 | builder.add(materializedEvent); | 423 | builder.add(materializedEvent); |
422 | } | 424 | } |
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.ComponentFaultTreeTrace.xtendbin b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.ComponentFaultTreeTrace.xtendbin index f705fefe..59a21d5c 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.ComponentFaultTreeTrace.xtendbin +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.ComponentFaultTreeTrace.xtendbin | |||
Binary files differ | |||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.ComponentInstanceTrace.xtendbin b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.ComponentInstanceTrace.xtendbin index bab76345..0a5c81fe 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.ComponentInstanceTrace.xtendbin +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.ComponentInstanceTrace.xtendbin | |||
Binary files differ | |||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.ComponentNameGenerator.xtendbin b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.ComponentNameGenerator.xtendbin index 257bfc56..87965646 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.ComponentNameGenerator.xtendbin +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.ComponentNameGenerator.xtendbin | |||
Binary files differ | |||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.Ecore2CftTransformation.xtendbin b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.Ecore2CftTransformation.xtendbin index a1339a18..cd930545 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.Ecore2CftTransformation.xtendbin +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.Ecore2CftTransformation.xtendbin | |||
Binary files differ | |||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.InputTrace.xtendbin b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.InputTrace.xtendbin index ba19d0fb..2f779ecb 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.InputTrace.xtendbin +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.InputTrace.xtendbin | |||
Binary files differ | |||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.LookupHandler.xtendbin b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.LookupHandler.xtendbin index 1e8612b2..93bad7e0 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.LookupHandler.xtendbin +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.LookupHandler.xtendbin | |||
Binary files differ | |||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.MappingHandler.xtendbin b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.MappingHandler.xtendbin index ebe80f2e..fde76cfd 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.MappingHandler.xtendbin +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.MappingHandler.xtendbin | |||
Binary files differ | |||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.MappingQueries.xtendbin b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.MappingQueries.xtendbin index 03bd16f8..4754c634 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.MappingQueries.xtendbin +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.MappingQueries.xtendbin | |||
Binary files differ | |||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.gitignore b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.gitignore index 33bb70d4..377aa872 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.gitignore +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/.gitignore | |||
@@ -7,3 +7,19 @@ | |||
7 | /.CftTransformation.java._trace | 7 | /.CftTransformation.java._trace |
8 | /.Ecore2CftTransformation.java._trace | 8 | /.Ecore2CftTransformation.java._trace |
9 | /.ComponentNameGenerator.java._trace | 9 | /.ComponentNameGenerator.java._trace |
10 | /.ComponentFaultTreeTrace.xtendbin | ||
11 | /.ComponentInstanceTrace.xtendbin | ||
12 | /.ComponentNameGenerator.xtendbin | ||
13 | /.Ecore2CftTransformation.xtendbin | ||
14 | /.InputTrace.xtendbin | ||
15 | /.LookupHandler.xtendbin | ||
16 | /.MappingHandler.xtendbin | ||
17 | /.MappingQueries.xtendbin | ||
18 | /ComponentFaultTreeTrace.java | ||
19 | /ComponentInstanceTrace.java | ||
20 | /ComponentNameGenerator.java | ||
21 | /Ecore2CftTransformation.java | ||
22 | /InputTrace.java | ||
23 | /LookupHandler.java | ||
24 | /MappingHandler.java | ||
25 | /MappingQueries.java | ||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/ComponentFaultTreeTrace.java b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/ComponentFaultTreeTrace.java index 46e711d9..ddcf9036 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/ComponentFaultTreeTrace.java +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/ComponentFaultTreeTrace.java | |||
@@ -3,6 +3,7 @@ package hu.bme.mit.inf.dslreasoner.faulttree.transformation.ecore2cft; | |||
3 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.CftFactory; | 3 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.CftFactory; |
4 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.ComponentDefinition; | 4 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.ComponentDefinition; |
5 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.ComponentFaultTree; | 5 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.ComponentFaultTree; |
6 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.Modality; | ||
6 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.Output; | 7 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.Output; |
7 | import hu.bme.mit.inf.dslreasoner.faulttree.transformation.ecore2cft.ComponentInstanceTrace; | 8 | import hu.bme.mit.inf.dslreasoner.faulttree.transformation.ecore2cft.ComponentInstanceTrace; |
8 | import hu.bme.mit.inf.dslreasoner.faulttree.transformation.ecore2cft.ComponentNameGenerator; | 9 | import hu.bme.mit.inf.dslreasoner.faulttree.transformation.ecore2cft.ComponentNameGenerator; |
@@ -24,13 +25,17 @@ public class ComponentFaultTreeTrace { | |||
24 | private final Map<IPatternMatch, ComponentInstanceTrace> componentInstancesMap = CollectionLiterals.<IPatternMatch, ComponentInstanceTrace>newHashMap(); | 25 | private final Map<IPatternMatch, ComponentInstanceTrace> componentInstancesMap = CollectionLiterals.<IPatternMatch, ComponentInstanceTrace>newHashMap(); |
25 | 26 | ||
26 | public ComponentInstanceTrace instantiateComponent(final IPatternMatch patternMatch, final ComponentDefinition componenDefinition) { | 27 | public ComponentInstanceTrace instantiateComponent(final IPatternMatch patternMatch, final ComponentDefinition componenDefinition) { |
28 | return this.instantiateComponent(patternMatch, componenDefinition, Modality.MUST, false); | ||
29 | } | ||
30 | |||
31 | public ComponentInstanceTrace instantiateComponent(final IPatternMatch patternMatch, final ComponentDefinition componenDefinition, final Modality exists, final boolean allowMultiple) { | ||
27 | ComponentInstanceTrace _xblockexpression = null; | 32 | ComponentInstanceTrace _xblockexpression = null; |
28 | { | 33 | { |
29 | boolean _containsKey = this.componentInstancesMap.containsKey(patternMatch); | 34 | boolean _containsKey = this.componentInstancesMap.containsKey(patternMatch); |
30 | if (_containsKey) { | 35 | if (_containsKey) { |
31 | throw new IllegalArgumentException(("Already instantiated component for match: " + patternMatch)); | 36 | throw new IllegalArgumentException(("Already instantiated component for match: " + patternMatch)); |
32 | } | 37 | } |
33 | final ComponentInstanceTrace componentTrace = new ComponentInstanceTrace(this.componentFaultTree, componenDefinition, this.nameGenerator); | 38 | final ComponentInstanceTrace componentTrace = new ComponentInstanceTrace(this.componentFaultTree, componenDefinition, this.nameGenerator, exists, allowMultiple); |
34 | this.componentInstancesMap.put(patternMatch, componentTrace); | 39 | this.componentInstancesMap.put(patternMatch, componentTrace); |
35 | _xblockexpression = componentTrace; | 40 | _xblockexpression = componentTrace; |
36 | } | 41 | } |
@@ -53,6 +58,11 @@ public class ComponentFaultTreeTrace { | |||
53 | " instead"); | 58 | " instead"); |
54 | throw new IllegalArgumentException(_plus_1); | 59 | throw new IllegalArgumentException(_plus_1); |
55 | } | 60 | } |
61 | boolean _appearsExactlyOnce = trace.appearsExactlyOnce(); | ||
62 | boolean _not = (!_appearsExactlyOnce); | ||
63 | if (_not) { | ||
64 | throw new IllegalArgumentException("Top level must appear in the fault tree exactly once"); | ||
65 | } | ||
56 | this.componentFaultTree.setTopEvent(IterableExtensions.<Output>head(outputs)); | 66 | this.componentFaultTree.setTopEvent(IterableExtensions.<Output>head(outputs)); |
57 | } | 67 | } |
58 | 68 | ||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/ComponentInstanceTrace.java b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/ComponentInstanceTrace.java index 840f501d..4034bdf3 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/ComponentInstanceTrace.java +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/ComponentInstanceTrace.java | |||
@@ -7,7 +7,9 @@ import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.ComponentDefinition; | |||
7 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.ComponentFaultTree; | 7 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.ComponentFaultTree; |
8 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.EventDeclaration; | 8 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.EventDeclaration; |
9 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.InputEvent; | 9 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.InputEvent; |
10 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.Modality; | ||
10 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.Output; | 11 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.Output; |
12 | import hu.bme.mit.inf.dslreasoner.faulttree.model.util.CftExtensions; | ||
11 | import hu.bme.mit.inf.dslreasoner.faulttree.transformation.ecore2cft.ComponentNameGenerator; | 13 | import hu.bme.mit.inf.dslreasoner.faulttree.transformation.ecore2cft.ComponentNameGenerator; |
12 | import hu.bme.mit.inf.dslreasoner.faulttree.transformation.ecore2cft.InputTrace; | 14 | import hu.bme.mit.inf.dslreasoner.faulttree.transformation.ecore2cft.InputTrace; |
13 | import java.util.Map; | 15 | import java.util.Map; |
@@ -21,9 +23,11 @@ public class ComponentInstanceTrace { | |||
21 | 23 | ||
22 | private final Map<EventDeclaration, Output> outputEventsMap; | 24 | private final Map<EventDeclaration, Output> outputEventsMap; |
23 | 25 | ||
24 | protected ComponentInstanceTrace(final ComponentFaultTree faultTree, final ComponentDefinition componentDefinition, final ComponentNameGenerator nameGenerator) { | 26 | protected ComponentInstanceTrace(final ComponentFaultTree faultTree, final ComponentDefinition componentDefinition, final ComponentNameGenerator nameGenerator, final Modality exists, final boolean multipleAllowed) { |
25 | this.componentInstance.setComponentDefinition(componentDefinition); | 27 | this.componentInstance.setComponentDefinition(componentDefinition); |
26 | this.componentInstance.setName(nameGenerator.nextName(componentDefinition)); | 28 | this.componentInstance.setName(nameGenerator.nextName(componentDefinition)); |
29 | this.componentInstance.setExists(exists); | ||
30 | this.componentInstance.setMultipleAllowed(multipleAllowed); | ||
27 | this.inputEventsMap = Maps.<InputEvent, InputTrace>newHashMapWithExpectedSize(componentDefinition.getInputEvents().size()); | 31 | this.inputEventsMap = Maps.<InputEvent, InputTrace>newHashMapWithExpectedSize(componentDefinition.getInputEvents().size()); |
28 | EList<InputEvent> _inputEvents = componentDefinition.getInputEvents(); | 32 | EList<InputEvent> _inputEvents = componentDefinition.getInputEvents(); |
29 | for (final InputEvent inputEvent : _inputEvents) { | 33 | for (final InputEvent inputEvent : _inputEvents) { |
@@ -48,6 +52,10 @@ public class ComponentInstanceTrace { | |||
48 | } | 52 | } |
49 | 53 | ||
50 | public void assign(final EventDeclaration inputEvent, final ComponentInstanceTrace sourceComponent, final EventDeclaration outputEvent) { | 54 | public void assign(final EventDeclaration inputEvent, final ComponentInstanceTrace sourceComponent, final EventDeclaration outputEvent) { |
55 | this.assign(inputEvent, sourceComponent, outputEvent, Modality.MUST); | ||
56 | } | ||
57 | |||
58 | public void assign(final EventDeclaration inputEvent, final ComponentInstanceTrace sourceComponent, final EventDeclaration outputEvent, final Modality exists) { | ||
51 | final InputTrace inputTrace = this.inputEventsMap.get(inputEvent); | 59 | final InputTrace inputTrace = this.inputEventsMap.get(inputEvent); |
52 | if ((inputTrace == null)) { | 60 | if ((inputTrace == null)) { |
53 | throw new IllegalArgumentException(("Unknown input: " + inputEvent)); | 61 | throw new IllegalArgumentException(("Unknown input: " + inputEvent)); |
@@ -56,10 +64,14 @@ public class ComponentInstanceTrace { | |||
56 | if ((output == null)) { | 64 | if ((output == null)) { |
57 | throw new IllegalArgumentException(("Unknown output: " + outputEvent)); | 65 | throw new IllegalArgumentException(("Unknown output: " + outputEvent)); |
58 | } | 66 | } |
59 | inputTrace.assign(output); | 67 | inputTrace.assign(output, exists); |
60 | } | 68 | } |
61 | 69 | ||
62 | protected EList<Output> getOutputs() { | 70 | protected EList<Output> getOutputs() { |
63 | return this.componentInstance.getOutputs(); | 71 | return this.componentInstance.getOutputs(); |
64 | } | 72 | } |
73 | |||
74 | protected boolean appearsExactlyOnce() { | ||
75 | return CftExtensions.appearsExactlyOnce(this.componentInstance); | ||
76 | } | ||
65 | } | 77 | } |
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/InputTrace.java b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/InputTrace.java index c12f2bae..2b30566f 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/InputTrace.java +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/InputTrace.java | |||
@@ -5,7 +5,9 @@ import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.Component; | |||
5 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.Connection; | 5 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.Connection; |
6 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.Input; | 6 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.Input; |
7 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.InputEvent; | 7 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.InputEvent; |
8 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.Modality; | ||
8 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.Output; | 9 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.Output; |
10 | import hu.bme.mit.inf.dslreasoner.faulttree.model.util.CftExtensions; | ||
9 | import java.util.Map; | 11 | import java.util.Map; |
10 | import org.eclipse.emf.common.util.EList; | 12 | import org.eclipse.emf.common.util.EList; |
11 | import org.eclipse.xtext.xbase.lib.CollectionLiterals; | 13 | import org.eclipse.xtext.xbase.lib.CollectionLiterals; |
@@ -22,14 +24,20 @@ public class InputTrace { | |||
22 | _inputs.add(this.input); | 24 | _inputs.add(this.input); |
23 | } | 25 | } |
24 | 26 | ||
25 | public void assign(final Output output) { | 27 | public void assign(final Output output, final Modality exists) { |
26 | final Connection connection = this.connectionsMap.get(output); | 28 | final Connection connection = this.connectionsMap.get(output); |
27 | if ((connection == null)) { | 29 | if ((connection == null)) { |
28 | final Connection newConnection = CftFactory.eINSTANCE.createConnection(); | 30 | final Connection newConnection = CftFactory.eINSTANCE.createConnection(); |
29 | newConnection.setOutput(output); | 31 | newConnection.setOutput(output); |
32 | newConnection.setExists(exists); | ||
30 | EList<Connection> _incomingConnections = this.input.getIncomingConnections(); | 33 | EList<Connection> _incomingConnections = this.input.getIncomingConnections(); |
31 | _incomingConnections.add(newConnection); | 34 | _incomingConnections.add(newConnection); |
32 | this.connectionsMap.put(output, newConnection); | 35 | this.connectionsMap.put(output, newConnection); |
36 | } else { | ||
37 | boolean _isMoreConcreteThan = CftExtensions.isMoreConcreteThan(exists, connection.getExists()); | ||
38 | if (_isMoreConcreteThan) { | ||
39 | connection.setExists(exists); | ||
40 | } | ||
33 | } | 41 | } |
34 | } | 42 | } |
35 | } | 43 | } |
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ft2galileo/.Ft2GalileoTransformation.xtendbin b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ft2galileo/.Ft2GalileoTransformation.xtendbin index 9fe75a0f..25ddc417 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ft2galileo/.Ft2GalileoTransformation.xtendbin +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ft2galileo/.Ft2GalileoTransformation.xtendbin | |||
Binary files differ | |||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ft2galileo/.gitignore b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ft2galileo/.gitignore index 3f932890..f4610b04 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ft2galileo/.gitignore +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ft2galileo/.gitignore | |||
@@ -1 +1,3 @@ | |||
1 | /.Ft2GalileoTransformation.java._trace | 1 | /.Ft2GalileoTransformation.java._trace |
2 | /.Ft2GalileoTransformation.xtendbin | ||
3 | /Ft2GalileoTransformation.java | ||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ft2galileo/Ft2GalileoTransformation.java b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ft2galileo/Ft2GalileoTransformation.java index e900c62a..8748825d 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ft2galileo/Ft2GalileoTransformation.java +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ft2galileo/Ft2GalileoTransformation.java | |||
@@ -19,18 +19,19 @@ import org.eclipse.xtend2.lib.StringConcatenationClient; | |||
19 | public class Ft2GalileoTransformation { | 19 | public class Ft2GalileoTransformation { |
20 | public CharSequence toGalileo(final FaultTree faultTree) { | 20 | public CharSequence toGalileo(final FaultTree faultTree) { |
21 | StringConcatenation _builder = new StringConcatenation(); | 21 | StringConcatenation _builder = new StringConcatenation(); |
22 | _builder.append("toplevel "); | 22 | _builder.append("toplevel \""); |
23 | String _name = faultTree.getTopEvent().getName(); | 23 | String _name = faultTree.getTopEvent().getName(); |
24 | _builder.append(_name); | 24 | _builder.append(_name); |
25 | _builder.append(";"); | 25 | _builder.append("\";"); |
26 | _builder.newLineIfNotEmpty(); | 26 | _builder.newLineIfNotEmpty(); |
27 | { | 27 | { |
28 | EList<RandomEvent> _events = faultTree.getEvents(); | 28 | EList<RandomEvent> _events = faultTree.getEvents(); |
29 | for(final RandomEvent event : _events) { | 29 | for(final RandomEvent event : _events) { |
30 | _builder.append("\""); | ||
30 | String _name_1 = event.getName(); | 31 | String _name_1 = event.getName(); |
31 | _builder.append(_name_1); | 32 | _builder.append(_name_1); |
32 | _builder.append(" "); | 33 | _builder.append("\" "); |
33 | StringConcatenationClient _defineEvent = this.defineEvent(event); | 34 | Object _defineEvent = this.defineEvent(event); |
34 | _builder.append(_defineEvent); | 35 | _builder.append(_defineEvent); |
35 | _builder.append(";"); | 36 | _builder.append(";"); |
36 | _builder.newLineIfNotEmpty(); | 37 | _builder.newLineIfNotEmpty(); |
@@ -39,8 +40,12 @@ public class Ft2GalileoTransformation { | |||
39 | return _builder; | 40 | return _builder; |
40 | } | 41 | } |
41 | 42 | ||
42 | protected StringConcatenationClient _defineEvent(final BasicEvent basicEvent) { | 43 | protected Object _defineEvent(final BasicEvent basicEvent) { |
43 | return this.defineDistribution(basicEvent.getDistribution()); | 44 | StringConcatenation _builder = new StringConcatenation(); |
45 | StringConcatenationClient _defineDistribution = this.defineDistribution(basicEvent.getDistribution()); | ||
46 | _builder.append(_defineDistribution); | ||
47 | _builder.append(" dorm=0.0"); | ||
48 | return _builder; | ||
44 | } | 49 | } |
45 | 50 | ||
46 | protected StringConcatenationClient _defineDistribution(final ConstantDistribution distribution) { | 51 | protected StringConcatenationClient _defineDistribution(final ConstantDistribution distribution) { |
@@ -87,8 +92,10 @@ public class Ft2GalileoTransformation { | |||
87 | } else { | 92 | } else { |
88 | _builder.appendImmediate(" ", ""); | 93 | _builder.appendImmediate(" ", ""); |
89 | } | 94 | } |
95 | _builder.append("\""); | ||
90 | String _name = input.getName(); | 96 | String _name = input.getName(); |
91 | _builder.append(_name); | 97 | _builder.append(_name); |
98 | _builder.append("\""); | ||
92 | } | 99 | } |
93 | } | 100 | } |
94 | } | 101 | } |
@@ -138,7 +145,7 @@ public class Ft2GalileoTransformation { | |||
138 | throw new IllegalArgumentException(("Unknown random even: " + randomEvent)); | 145 | throw new IllegalArgumentException(("Unknown random even: " + randomEvent)); |
139 | } | 146 | } |
140 | 147 | ||
141 | protected StringConcatenationClient defineEvent(final RandomEvent basicEvent) { | 148 | protected Object defineEvent(final RandomEvent basicEvent) { |
142 | if (basicEvent instanceof BasicEvent) { | 149 | if (basicEvent instanceof BasicEvent) { |
143 | return _defineEvent((BasicEvent)basicEvent); | 150 | return _defineEvent((BasicEvent)basicEvent); |
144 | } else if (basicEvent instanceof Gate) { | 151 | } else if (basicEvent instanceof Gate) { |
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/solver/.ReliabilityResult.xtendbin b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/solver/.ReliabilityResult.xtendbin index 57c4608d..552c946a 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/solver/.ReliabilityResult.xtendbin +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/solver/.ReliabilityResult.xtendbin | |||
Binary files differ | |||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/solver/.StormDftConfiguration.xtendbin b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/solver/.StormDftConfiguration.xtendbin index f5cb52f4..a3f9c647 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/solver/.StormDftConfiguration.xtendbin +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/solver/.StormDftConfiguration.xtendbin | |||
Binary files differ | |||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/solver/.StormDftHandler.xtendbin b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/solver/.StormDftHandler.xtendbin index 5dad0728..d7f66fd0 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/solver/.StormDftHandler.xtendbin +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/solver/.StormDftHandler.xtendbin | |||
Binary files differ | |||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/solver/.StormDftSolver.xtendbin b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/solver/.StormDftSolver.xtendbin index abd8a501..b9fdf395 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/solver/.StormDftSolver.xtendbin +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/solver/.StormDftSolver.xtendbin | |||
Binary files differ | |||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/solver/.gitignore b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/solver/.gitignore index 59cc8fe8..8a74c101 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/solver/.gitignore +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/solver/.gitignore | |||
@@ -7,3 +7,14 @@ | |||
7 | /.StormDftException.java._trace | 7 | /.StormDftException.java._trace |
8 | /.ReliabilityModelSolution.java._trace | 8 | /.ReliabilityModelSolution.java._trace |
9 | /.ReliabilityResult.java._trace | 9 | /.ReliabilityResult.java._trace |
10 | /.ReliabilityResult.xtendbin | ||
11 | /.StormDftConfiguration.xtendbin | ||
12 | /.StormDftHandler.xtendbin | ||
13 | /.StormDftSolver.xtendbin | ||
14 | /ApproximationHeuristic.java | ||
15 | /FtAnalysisObjective.java | ||
16 | /ReliabilityResult.java | ||
17 | /StormDftConfiguration.java | ||
18 | /StormDftException.java | ||
19 | /StormDftHandler.java | ||
20 | /StormDftSolver.java | ||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/solver/StormDftHandler.java b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/solver/StormDftHandler.java index 003d9cc5..46127425 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/solver/StormDftHandler.java +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/solver/StormDftHandler.java | |||
@@ -16,15 +16,11 @@ import java.io.InputStreamReader; | |||
16 | import java.util.ArrayList; | 16 | import java.util.ArrayList; |
17 | import java.util.regex.Matcher; | 17 | import java.util.regex.Matcher; |
18 | import java.util.regex.Pattern; | 18 | import java.util.regex.Pattern; |
19 | import jnr.constants.platform.Signal; | ||
20 | import org.apache.commons.lang.SystemUtils; | ||
21 | import org.eclipse.xtend2.lib.StringConcatenation; | 19 | import org.eclipse.xtend2.lib.StringConcatenation; |
22 | import org.eclipse.xtext.xbase.lib.CollectionLiterals; | 20 | import org.eclipse.xtext.xbase.lib.CollectionLiterals; |
23 | import org.eclipse.xtext.xbase.lib.Conversions; | ||
24 | import org.eclipse.xtext.xbase.lib.Exceptions; | 21 | import org.eclipse.xtext.xbase.lib.Exceptions; |
25 | import org.eclipse.xtext.xbase.lib.Extension; | 22 | import org.eclipse.xtext.xbase.lib.Extension; |
26 | import org.eclipse.xtext.xbase.lib.Functions.Function0; | 23 | import org.eclipse.xtext.xbase.lib.Functions.Function0; |
27 | import org.eclipse.xtext.xbase.lib.Functions.Function1; | ||
28 | import org.eclipse.xtext.xbase.lib.InputOutput; | 24 | import org.eclipse.xtext.xbase.lib.InputOutput; |
29 | import org.eclipse.xtext.xbase.lib.IterableExtensions; | 25 | import org.eclipse.xtext.xbase.lib.IterableExtensions; |
30 | 26 | ||
@@ -60,17 +56,11 @@ public class StormDftHandler { | |||
60 | 56 | ||
61 | private static final Pattern RESULT_PATTERN = Pattern.compile(StormDftHandler.RESULT_REGEX); | 57 | private static final Pattern RESULT_PATTERN = Pattern.compile(StormDftHandler.RESULT_REGEX); |
62 | 58 | ||
63 | private static final int SIGNAL_EXIT_VALUE_OFFSET = new Function0<Integer>() { | 59 | private static final int SIGNAL_EXIT_VALUE_OFFSET = 0x80; |
64 | public Integer apply() { | 60 | |
65 | int _xifexpression = (int) 0; | 61 | private static final int SIGXCPU = 24; |
66 | if (SystemUtils.IS_OS_SOLARIS) { | 62 | |
67 | _xifexpression = 0; | 63 | private static final int SIGXFSZ = 25; |
68 | } else { | ||
69 | _xifexpression = 0x80; | ||
70 | } | ||
71 | return _xifexpression; | ||
72 | } | ||
73 | }.apply().intValue(); | ||
74 | 64 | ||
75 | private static final int STORM_GENERAL_ERROR = ((-1) & 0xff); | 65 | private static final int STORM_GENERAL_ERROR = ((-1) & 0xff); |
76 | 66 | ||
@@ -305,9 +295,7 @@ public class StormDftHandler { | |||
305 | _matched=true; | 295 | _matched=true; |
306 | } | 296 | } |
307 | if (!_matched) { | 297 | if (!_matched) { |
308 | int _intValue = Signal.SIGXCPU.intValue(); | 298 | if (Objects.equal(exitValue, (StormDftHandler.SIGNAL_EXIT_VALUE_OFFSET + StormDftHandler.SIGXCPU))) { |
309 | int _plus = (StormDftHandler.SIGNAL_EXIT_VALUE_OFFSET + _intValue); | ||
310 | if (Objects.equal(exitValue, _plus)) { | ||
311 | _matched=true; | 299 | _matched=true; |
312 | } | 300 | } |
313 | } | 301 | } |
@@ -320,9 +308,7 @@ public class StormDftHandler { | |||
320 | _matched=true; | 308 | _matched=true; |
321 | } | 309 | } |
322 | if (!_matched) { | 310 | if (!_matched) { |
323 | int _intValue_1 = Signal.SIGXFSZ.intValue(); | 311 | if (Objects.equal(exitValue, (StormDftHandler.SIGNAL_EXIT_VALUE_OFFSET + StormDftHandler.SIGXFSZ))) { |
324 | int _plus_1 = (StormDftHandler.SIGNAL_EXIT_VALUE_OFFSET + _intValue_1); | ||
325 | if (Objects.equal(exitValue, _plus_1)) { | ||
326 | _matched=true; | 312 | _matched=true; |
327 | } | 313 | } |
328 | } | 314 | } |
@@ -334,14 +320,7 @@ public class StormDftHandler { | |||
334 | { | 320 | { |
335 | if ((exitValue > StormDftHandler.SIGNAL_EXIT_VALUE_OFFSET)) { | 321 | if ((exitValue > StormDftHandler.SIGNAL_EXIT_VALUE_OFFSET)) { |
336 | final int signalNumber = (exitValue - StormDftHandler.SIGNAL_EXIT_VALUE_OFFSET); | 322 | final int signalNumber = (exitValue - StormDftHandler.SIGNAL_EXIT_VALUE_OFFSET); |
337 | final Function1<Signal, Boolean> _function = (Signal it) -> { | 323 | throw new StormDftException(((("Storm unexpectedly killed by signal " + Integer.valueOf(signalNumber)) + ": ") + error)); |
338 | int _intValue_2 = it.intValue(); | ||
339 | return Boolean.valueOf((_intValue_2 == signalNumber)); | ||
340 | }; | ||
341 | final Signal signal = IterableExtensions.<Signal>findFirst(((Iterable<Signal>)Conversions.doWrapArray(Signal.values())), _function); | ||
342 | if ((signal != null)) { | ||
343 | throw new StormDftException(((("Storm unexpectedly killed by signal " + signal) + ": ") + error)); | ||
344 | } | ||
345 | } | 324 | } |
346 | throw new StormDftException(((("Storm unexpectedly exit with status " + Integer.valueOf(exitValue)) + ": ") + error)); | 325 | throw new StormDftException(((("Storm unexpectedly exit with status " + Integer.valueOf(exitValue)) + ": ") + error)); |
347 | } | 326 | } |