Storm 1.14.0.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
transformation.cpp
Go to the documentation of this file.
1#include "transformation.h"
2
3#include <memory>
4
7
8namespace storm::dft {
9namespace api {
10
11template<typename ValueType>
12std::pair<bool, std::string> isWellFormed(storm::dft::storage::DFT<ValueType> const& dft, bool validForMarkovianAnalysis) {
13 std::stringstream stream;
14 bool wellFormed = false;
15 if (validForMarkovianAnalysis) {
17 } else {
19 }
20 return std::pair<bool, std::string>(wellFormed, stream.str());
21}
22
23template<typename ValueType>
25 std::stringstream stream;
27 return std::pair<bool, std::string>(modelingIssues, stream.str());
28}
29
30template<typename ValueType>
31std::shared_ptr<storm::dft::storage::DFT<ValueType>> applyTransformations(storm::dft::storage::DFT<ValueType> const& dft, bool uniqueBE, bool binaryFDEP,
32 bool exponentialDistributions) {
33 std::shared_ptr<storm::dft::storage::DFT<ValueType>> transformedDft = std::make_shared<storm::dft::storage::DFT<ValueType>>(dft);
36 }
39 }
42 }
43 return transformedDft;
44}
45
46template<typename ValueType>
47std::shared_ptr<storm::dft::storage::DFT<ValueType>> prepareForMarkovAnalysis(storm::dft::storage::DFT<ValueType> const& dft) {
48 return storm::dft::api::applyTransformations(dft, true, true, true);
49}
50
51// Explicitly instantiate methods
52template std::pair<bool, std::string> isWellFormed(storm::dft::storage::DFT<double> const&, bool);
53template std::pair<bool, std::string> hasPotentialModelingIssues(storm::dft::storage::DFT<double> const&);
54template std::shared_ptr<storm::dft::storage::DFT<double>> applyTransformations(storm::dft::storage::DFT<double> const&, bool, bool, bool);
55template std::shared_ptr<storm::dft::storage::DFT<double>> prepareForMarkovAnalysis(storm::dft::storage::DFT<double> const&);
56
57template std::pair<bool, std::string> isWellFormed(storm::dft::storage::DFT<storm::RationalFunction> const&, bool);
59template std::shared_ptr<storm::dft::storage::DFT<storm::RationalFunction>> applyTransformations(storm::dft::storage::DFT<storm::RationalFunction> const&, bool,
60 bool, bool);
61template std::shared_ptr<storm::dft::storage::DFT<storm::RationalFunction>> prepareForMarkovAnalysis(storm::dft::storage::DFT<storm::RationalFunction> const&);
62
63} // namespace api
64} // namespace storm::dft
Represents a Dynamic Fault Tree.
Definition DFT.h:49
static bool hasUniqueFailedBE(storm::dft::storage::DFT< ValueType > const &dft)
Check whether at most one constant failed BE is present in the DFT.
static std::shared_ptr< storm::dft::storage::DFT< ValueType > > transformUniqueFailedBE(storm::dft::storage::DFT< ValueType > const &dft)
Introduce unique BE which is always failed (instead of multiple ones).
static bool hasNonBinaryDependency(storm::dft::storage::DFT< ValueType > const &dft)
Check whether the DFT has dependencies with multiple dependent events.
static std::shared_ptr< storm::dft::storage::DFT< ValueType > > transformBinaryDependencies(storm::dft::storage::DFT< ValueType > const &dft)
Introduce binary dependencies (with only one dependent event) instead of dependencies with multiple d...
static bool hasOnlyExponentialDistributions(storm::dft::storage::DFT< ValueType > const &dft)
Check whether the DFT contains only BEs with exponential distributions (or constant failed/failsafe B...
static std::shared_ptr< storm::dft::storage::DFT< ValueType > > transformExponentialDistributions(storm::dft::storage::DFT< ValueType > const &dft)
Replace certain BE distributions by DFT constructs using only exponential distributions to make them ...
static bool isDftValidForMarkovianAnalysis(storm::dft::storage::DFT< ValueType > const &dft, std::ostream &stream)
Check whether the DFT can be analysed by translation to a Markov model, i.e.
static bool isDftWellFormed(storm::dft::storage::DFT< ValueType > const &dft, std::ostream &stream)
Check whether the DFT is well-formed.
static bool hasPotentialModelingIssues(storm::dft::storage::DFT< ValueType > const &dft, std::ostream &stream)
Check whether the DFT has potential modeling issues.
std::shared_ptr< storm::dft::storage::DFT< ValueType > > prepareForMarkovAnalysis(storm::dft::storage::DFT< ValueType > const &dft)
Apply transformations to make DFT feasible for Markovian analysis.
std::shared_ptr< storm::dft::storage::DFT< ValueType > > applyTransformations(storm::dft::storage::DFT< ValueType > const &dft, bool uniqueBE, bool binaryFDEP, bool exponentialDistributions)
Apply transformations for DFT.
std::pair< bool, std::string > isWellFormed(storm::dft::storage::DFT< ValueType > const &dft, bool validForMarkovianAnalysis)
Check whether the DFT is well-formed.
std::pair< bool, std::string > hasPotentialModelingIssues(storm::dft::storage::DFT< ValueType > const &dft)
Check whether the DFT has potential modeling issues.