Storm 1.14.0.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
DdJaniModelBuilder.h
Go to the documentation of this file.
1#pragma once
2
3#include <boost/optional.hpp>
4
9
11#include "storm/logic/Formula.h"
12
13namespace storm {
14class Environment;
15namespace models {
16namespace symbolic {
17template<storm::dd::DdType Type, typename ValueType>
18class Model;
19}
20} // namespace models
21namespace jani {
22class Model;
23class ModelFeatures;
24} // namespace jani
25
26namespace builder {
27
28template<storm::dd::DdType Type, typename ValueType = double>
30 public:
35
41 static bool canHandle(storm::jani::Model const& model, storm::OptionalRef<std::vector<storm::jani::Property> const> properties = storm::NullRef);
42
43 struct Options {
47 Options(bool buildAllLabels = false, bool buildAllRewardModels = false, bool applyMaximumProgressAssumption = true);
48
54 Options(storm::logic::Formula const& formula);
55
61 Options(std::vector<std::shared_ptr<storm::logic::Formula const>> const& formulas);
62
69 void preserveFormula(storm::logic::Formula const& formula);
70
80
84 std::set<std::string> const& getRewardModelNames() const;
85
89 void addLabel(std::string const& labelName);
90
94 bool isBuildAllLabelsSet() const;
95
98
102 bool isBuildAllRewardModelsSet() const;
103
104 // A flag that indicates whether or not all reward models are to be build.
106
109
111 std::set<std::string> labelNames;
112
113 // A list of reward models to be build in case not all reward models are to be build.
114 std::set<std::string> rewardModelsToBuild;
115
116 // An optional mapping that, if given, contains defining expressions for undefined constants.
117 boost::optional<std::map<storm::expressions::Variable, storm::expressions::Expression>> constantDefinitions;
118
119 // An optional set of expression or labels that characterizes (a subset of) the terminal states of the model.
120 // If this is set, the outgoing transitions of these states are replaced with a self-loop.
122
123 // A flag that indicates whether deadlock states should be fixed by inserting a self-loop. If not set,
124 // an error is raised whenever a deadlock state is encountered.
125 bool fixDeadlocks = true;
126 };
127
137 std::shared_ptr<storm::models::symbolic::Model<Type, ValueType>> build(storm::Environment const& env, storm::jani::Model const& model,
138 Options const& options = Options());
139};
140
141} // namespace builder
142} // namespace storm
Helper class that optionally holds a reference to an object of type T.
Definition OptionalRef.h:48
std::shared_ptr< storm::models::symbolic::Model< Type, ValueType > > build(storm::Environment const &env, storm::jani::Model const &model, Options const &options=Options())
Translates the given program into a symbolic model (i.e.
static storm::jani::ModelFeatures getSupportedJaniFeatures()
Returns the jani features with which this builder can deal natively.
static bool canHandle(storm::jani::Model const &model, storm::OptionalRef< std::vector< storm::jani::Property > const > properties=storm::NullRef)
A quick check to detect whether the given model is not supported.
Base class for all symbolic models.
Definition Model.h:42
constexpr NullRefType NullRef
Definition OptionalRef.h:31
bool buildAllLabels
A flag that indicates whether all labels are to be built. In this case, the label names are to be ign...
void setTerminalStatesFromFormula(storm::logic::Formula const &formula)
Analyzes the given formula and sets an expression for the states states of the model that can be trea...
Options(bool buildAllLabels=false, bool buildAllRewardModels=false, bool applyMaximumProgressAssumption=true)
Creates an object representing the default building options.
storm::builder::TerminalStates terminalStates
bool isBuildAllRewardModelsSet() const
Retrieves whether the flag to build all reward models is set.
bool applyMaximumProgressAssumption
A flag that indicates whether the maximum progress assumption should be applied.
void preserveFormula(storm::logic::Formula const &formula)
Changes the options in a way that ensures that the given formula can be checked on the model once it ...
void addLabel(std::string const &labelName)
Adds the given label to the ones that are supposed to be built.
std::set< std::string > const & getRewardModelNames() const
Retrieves the names of the reward models to build.
boost::optional< std::map< storm::expressions::Variable, storm::expressions::Expression > > constantDefinitions
std::set< std::string > labelNames
A set of labels to build.
bool isBuildAllLabelsSet() const
Retrieves whether the flag to build all labels is set.