Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
DFTModelChecker.h
Go to the documentation of this file.
1#pragma once
2
3#include "storm/api/storm.h"
7
10
11namespace storm::dft {
12namespace modelchecker {
13
17template<typename ValueType>
19 public:
20 typedef std::pair<ValueType, ValueType> approximation_result;
21 typedef std::vector<boost::variant<ValueType, approximation_result>> dft_results;
22 typedef std::vector<std::shared_ptr<storm::logic::Formula const>> property_vector;
23
24 class ResultOutputVisitor : public boost::static_visitor<> {
25 public:
26 void operator()(ValueType result, std::ostream& os) const {
27 os << result;
28 }
29
30 void operator()(std::pair<ValueType, ValueType> const& result, std::ostream& os) const {
31 os << "(" << result.first << ", " << result.second << ")";
32 }
33 };
34
38 DFTModelChecker(bool printOutput) : printInfo(printOutput) {}
39
55 dft_results check(storm::dft::storage::DFT<ValueType> const& origDft, property_vector const& properties, bool symred = true,
56 bool allowModularisation = true, storm::dft::utility::RelevantEvents const& relevantEvents = {}, bool allowDCForRelevant = false,
57 double approximationError = 0.0,
59 bool eliminateChains = false,
61
67 void printTimings(std::ostream& os = std::cout);
68
75 void printResults(dft_results const& results, std::ostream& os = std::cout);
76
77 private:
78 bool printInfo;
79
80 // Timing values
81 storm::utility::Stopwatch buildingTimer;
82 storm::utility::Stopwatch explorationTimer;
83 storm::utility::Stopwatch bisimulationTimer;
84 storm::utility::Stopwatch modelCheckingTimer;
86
102 dft_results checkHelper(storm::dft::storage::DFT<ValueType> const& dft, property_vector const& properties, bool symred, bool allowModularisation,
103 storm::dft::utility::RelevantEvents const& relevantEvents, bool allowDCForRelevant = false, double approximationError = 0.0,
105 bool eliminateChains = false,
107
119 std::shared_ptr<storm::models::sparse::Ctmc<ValueType>> buildModelViaComposition(storm::dft::storage::DFT<ValueType> const& dft,
120 property_vector const& properties, bool symred, bool allowModularisation,
121 storm::dft::utility::RelevantEvents const& relevantEvents,
122 bool allowDCForRelevant);
123
139 dft_results checkDFT(storm::dft::storage::DFT<ValueType> const& dft, property_vector const& properties, bool symred,
140 storm::dft::utility::RelevantEvents const& relevantEvents, bool allowDCForRelevant, double approximationError = 0.0,
142 bool eliminateChains = false,
144
153 std::vector<ValueType> checkModel(std::shared_ptr<storm::models::sparse::Model<ValueType>>& model, property_vector const& properties);
154
167 bool isApproximationSufficient(ValueType lowerBound, ValueType upperBound, double approximationError, bool relative);
168};
169
170} // namespace modelchecker
171} // namespace storm::dft
void operator()(std::pair< ValueType, ValueType > const &result, std::ostream &os) const
void operator()(ValueType result, std::ostream &os) const
DFTModelChecker(bool printOutput)
Constructor.
std::pair< ValueType, ValueType > approximation_result
void printTimings(std::ostream &os=std::cout)
Print timings of all operations to stream.
void printResults(dft_results const &results, std::ostream &os=std::cout)
Print result to stream.
std::vector< boost::variant< ValueType, approximation_result > > dft_results
dft_results check(storm::dft::storage::DFT< ValueType > const &origDft, property_vector const &properties, bool symred=true, bool allowModularisation=true, storm::dft::utility::RelevantEvents const &relevantEvents={}, bool allowDCForRelevant=false, double approximationError=0.0, storm::dft::builder::ApproximationHeuristic approximationHeuristic=storm::dft::builder::ApproximationHeuristic::DEPTH, bool eliminateChains=false, storm::transformer::EliminationLabelBehavior labelBehavior=storm::transformer::EliminationLabelBehavior::KeepLabels)
Main method for checking DFTs.
std::vector< std::shared_ptr< storm::logic::Formula const > > property_vector
Represents a Dynamic Fault Tree.
Definition DFT.h:52
Base class for all sparse models.
Definition Model.h:33
A class that provides convenience operations to display run times.
Definition Stopwatch.h:14
ApproximationHeuristic
Enum representing the heuristic used for deciding which states to expand.
SFTBDDChecker::ValueType ValueType
EliminationLabelBehavior
Specify criteria whether a state can be eliminated and how its labels should be treated.