Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
BuildSettings.cpp
Go to the documentation of this file.
2
11
14
15namespace storm {
16namespace settings {
17namespace modules {
18
19const std::string BuildSettings::moduleName = "build";
20
21const std::string explorationOrderOptionName = "explorder";
22const std::string explorationOrderOptionShortName = "eo";
23const std::string explorationChecksOptionName = "explchecks";
24const std::string explorationChecksOptionShortName = "ec";
25const std::string prismCompatibilityOptionName = "prismcompat";
26const std::string prismCompatibilityOptionShortName = "pc";
27const std::string dontFixDeadlockOptionName = "nofixdl";
28const std::string dontFixDeadlockOptionShortName = "ndl";
29const std::string noBuildOptionName = "nobuild";
30const std::string fullModelBuildOptionName = "buildfull";
31const std::string applyNoMaxProgAssumptionOptionName = "nomaxprog";
32const std::string buildChoiceLabelOptionName = "buildchoicelab";
33const std::string buildChoiceOriginsOptionName = "buildchoiceorig";
34const std::string buildStateValuationsOptionName = "buildstateval";
35const std::string buildObservationValuationsOptionName = "buildobsval";
36const std::string buildAllLabelsOptionName = "build-all-labels";
37const std::string buildOutOfBoundsStateOptionName = "build-out-of-bounds-state";
38const std::string buildOverlappingGuardsLabelOptionName = "build-overlapping-guards-label";
39const std::string noSimplifyOptionName = "no-simplify";
40const std::string bitsForUnboundedVariablesOptionName = "int-bits";
41const std::string performLocationElimination = "location-elimination";
42const std::string explorationStateLimitOptionName = "state-limit";
43
46 "Enables PRISM compatibility. This may be necessary to process some PRISM models.")
48 .build());
50 "If the model contains deadlock states, they need to be fixed by setting this option.")
52 .setIsAdvanced()
53 .build());
54 this->addOption(storm::settings::OptionBuilder(moduleName, fullModelBuildOptionName, false, "If set, include all rewards and labels.").build());
56 "If set, the maximum progress assumption is not applied while building the model (relevant for MAs)")
57 .setIsAdvanced()
58 .build());
59 this->addOption(
60 storm::settings::OptionBuilder(moduleName, buildChoiceLabelOptionName, false, "If set, also build the choice labels").setIsAdvanced().build());
61 this->addOption(
63 "If set, also build information that for each choice indicates the part(s) of the input that yielded the choice.")
64 .setIsAdvanced()
65 .build());
66 this->addOption(
67 storm::settings::OptionBuilder(moduleName, buildStateValuationsOptionName, false, "If set, also build the state valuations").setIsAdvanced().build());
69 "If set, also build the observation valuations (only relevant for POMDPs)")
70 .setIsAdvanced()
71 .build());
72 this->addOption(storm::settings::OptionBuilder(moduleName, buildAllLabelsOptionName, false, "If set, build all labels").setIsAdvanced().build());
73 this->addOption(storm::settings::OptionBuilder(moduleName, noBuildOptionName, false, "If set, do not build the model.").setIsAdvanced().build());
74
75 std::vector<std::string> explorationOrders = {"dfs", "bfs"};
76 this->addOption(storm::settings::OptionBuilder(moduleName, explorationOrderOptionName, false, "Sets which exploration order to use.")
78 .setIsAdvanced()
79 .addArgument(storm::settings::ArgumentBuilder::createStringArgument("name", "The name of the exploration order to choose.")
82 .build())
83 .build());
85 "If set, additional checks (if available) are performed during model exploration to debug the model.")
87 .build());
88 this->addOption(storm::settings::OptionBuilder(moduleName, buildOutOfBoundsStateOptionName, false, "If set, a state for out-of-bounds valuations is added")
89 .setIsAdvanced()
90 .build());
92 "For states where multiple guards are enabled, we add a label (for debugging DTMCs)")
93 .setIsAdvanced()
94 .build());
95 this->addOption(
96 storm::settings::OptionBuilder(moduleName, noSimplifyOptionName, false, "If set, simplification PRISM input is disabled.").setIsAdvanced().build());
98 "Sets the number of bits that is used for unbounded integer variables.")
99 .setIsAdvanced()
100 .addArgument(storm::settings::ArgumentBuilder::createUnsignedIntegerArgument("number", "The number of bits.")
103 .build())
104 .build());
106 "If set, location elimination will be performed before the model is built.")
107 .setIsAdvanced()
109 "location-heuristic", "If this number of locations is reached, no further unfolding will be performed")
111 .makeOptional()
112 .build())
114 "edges-heuristic", "Determines how many new edges may be created by a single elimination")
116 .makeOptional()
117 .build())
118 .build());
119
121 "Potentially stopped exploration once the specified number of states is exceeded.")
122 .setIsAdvanced()
123 .addArgument(storm::settings::ArgumentBuilder::createUnsignedIntegerArgument("number", "states to explore before stopping.").build())
124 .build());
125}
126
128 return this->getOption(explorationOrderOptionName).getHasOptionBeenSet();
129}
130
132 return this->getOption(prismCompatibilityOptionName).getHasOptionBeenSet();
133}
134
136 return this->getOption(dontFixDeadlockOptionName).getHasOptionBeenSet();
137}
138
139std::unique_ptr<storm::settings::SettingMemento> BuildSettings::overrideDontFixDeadlocksSet(bool stateToSet) {
140 return this->overrideOption(dontFixDeadlockOptionName, stateToSet);
141}
142
144 return this->getOption(fullModelBuildOptionName).getHasOptionBeenSet();
145}
146
148 return this->getOption(noBuildOptionName).getHasOptionBeenSet();
149}
150
152 return this->getOption(applyNoMaxProgAssumptionOptionName).getHasOptionBeenSet();
153}
154
156 return this->getOption(buildChoiceLabelOptionName).getHasOptionBeenSet();
157}
158
160 return this->getOption(buildChoiceOriginsOptionName).getHasOptionBeenSet();
161}
162
164 return this->getOption(buildStateValuationsOptionName).getHasOptionBeenSet();
165}
166
168 return this->getOption(buildObservationValuationsOptionName).getHasOptionBeenSet();
169}
170
172 return this->getOption(buildOutOfBoundsStateOptionName).getHasOptionBeenSet();
173}
174
176 return this->getOption(buildOverlappingGuardsLabelOptionName).getHasOptionBeenSet();
177}
178
180 return this->getOption(buildAllLabelsOptionName).getHasOptionBeenSet();
181}
182
184 std::string explorationOrderAsString = this->getOption(explorationOrderOptionName).getArgumentByName("name").getValueAsString();
185 if (explorationOrderAsString == "dfs") {
187 } else if (explorationOrderAsString == "bfs") {
189 }
190 STORM_LOG_THROW(false, storm::exceptions::IllegalArgumentValueException, "Unknown exploration order '" << explorationOrderAsString << "'.");
191}
192
194 return this->getOption(explorationChecksOptionName).getHasOptionBeenSet();
195}
196
198 return this->getOption(noSimplifyOptionName).getHasOptionBeenSet();
199}
200
202 return this->getOption(bitsForUnboundedVariablesOptionName).getArgumentByName("number").getValueAsUnsignedInteger();
203}
204
206 return this->getOption(performLocationElimination).getHasOptionBeenSet();
207}
208
210 return this->getOption(performLocationElimination).getArgumentByName("location-heuristic").getValueAsUnsignedInteger();
211}
212
214 return this->getOption(performLocationElimination).getArgumentByName("edges-heuristic").getValueAsUnsignedInteger();
215}
216
218 return this->getOption(explorationStateLimitOptionName).getHasOptionBeenSet();
219}
220
222 return this->getOption(explorationStateLimitOptionName).getArgumentByName("number").getValueAsUnsignedInteger();
223}
224
225} // namespace modules
226
227} // namespace settings
228} // namespace storm
virtual std::string getValueAsString() const =0
Retrieves the value of this argument as a string.
virtual uint_fast64_t getValueAsUnsignedInteger() const =0
Retrieves the value of this argument as an unsigned integer.
static ArgumentBuilder createUnsignedIntegerArgument(std::string const &name, std::string const &description)
Creates an unsigned integer argument with the given parameters.
static ArgumentBuilder createStringArgument(std::string const &name, std::string const &description)
Creates a string argument with the given parameters.
static std::shared_ptr< ArgumentValidator< uint64_t > > createUnsignedRangeValidatorExcluding(uint64_t lowerBound, uint64_t upperBound)
static std::shared_ptr< ArgumentValidator< std::string > > createMultipleChoiceValidator(std::vector< std::string > const &choices)
This class provides the interface to create an option...
ArgumentBase const & getArgumentByName(std::string const &argumentName) const
Returns a reference to the argument with the specified long name.
Definition Option.cpp:79
bool getHasOptionBeenSet() const
Retrieves whether the option has been set.
Definition Option.cpp:125
uint64_t getExplorationStateLimit() const
Retrieves the state limit (if set).
bool isExplorationStateLimitSet() const
Retrieves whether an exploration state limit has been set in which case state space exploration might...
bool isBuildStateValuationsSet() const
Retrieves whether the choice labels should be build.
uint64_t getLocationEliminationLocationHeuristic() const
Retrieves the location parameter of the location elimination heuristic.
std::unique_ptr< storm::settings::SettingMemento > overrideDontFixDeadlocksSet(bool stateToSet)
Overrides the option to not fix deadlocks by setting it to the specified value.
bool isExplorationOrderSet() const
Retrieves whether the model exploration order was set.
bool isNoSimplifySet() const
Retrieves whether simplification of symbolic inputs through static analysis shall be disabled.
storm::builder::ExplorationOrder getExplorationOrder() const
Retrieves the exploration order if it was set.
uint64_t getLocationEliminationEdgesHeuristic() const
Retrieves the edge parameter of the location elimination heuristic.
bool isDontFixDeadlocksSet() const
Retrieves whether the dont-fix-deadlocks option was set.
bool isBuildObservationValuationsSet() const
Retrieves whether the observation valuations should be build.
bool isBuildAllLabelsSet() const
Retrieves whether all labels should be build.
bool isBuildOutOfBoundsStateSet() const
Retrieves whether out of bounds state should be added.
BuildSettings()
Creates a new set of core settings.
bool isAddOverlappingGuardsLabelSet() const
Retrieves whether to build the overlapping label.
bool isApplyNoMaximumProgressAssumptionSet() const
Retrieves whether the maximum progress assumption is to be applied when building the model.
bool isBuildChoiceOriginsSet() const
Retrieves whether the choice origins should be build.
bool isBuildFullModelSet() const
Retrieves whether the full model should be build, that is, the model including all labels and rewards...
uint64_t getBitsForUnboundedVariables() const
Retrieves the number of bits that should be used to represent unbounded integer variables.
bool isBuildChoiceLabelsSet() const
Retrieves whether the choice labels should be build.
bool isNoBuildModelSet() const
Retrieves whether no model should be build at all, in case one just want to translate models or parse...
bool isLocationEliminationSet() const
Retrieves whether location elimination is enabled.
bool isPrismCompatibilityEnabled() const
Retrieves whether the PRISM compatibility mode was enabled.
bool isExplorationChecksSet() const
Retrieves whether to perform additional checks during model exploration (e.g.
This is the base class of the settings for a particular module.
std::unique_ptr< storm::settings::SettingMemento > overrideOption(std::string const &name, bool requiredStatus)
Sets the option with the given name to the required status.
void addOption(std::shared_ptr< Option > const &option)
Adds and registers the given option.
Option & getOption(std::string const &longName)
Retrieves the option with the given long name.
#define STORM_LOG_THROW(cond, exception, message)
Definition macros.h:30
const std::string noBuildOptionName
const std::string explorationChecksOptionName
const std::string applyNoMaxProgAssumptionOptionName
const std::string buildChoiceOriginsOptionName
const std::string buildStateValuationsOptionName
const std::string explorationChecksOptionShortName
const std::string buildAllLabelsOptionName
const std::string noSimplifyOptionName
const std::string buildObservationValuationsOptionName
const std::string dontFixDeadlockOptionName
const std::string explorationOrderOptionShortName
const std::string explorationStateLimitOptionName
const std::string performLocationElimination
const std::string fullModelBuildOptionName
const std::string prismCompatibilityOptionName
const std::string buildOutOfBoundsStateOptionName
const std::string dontFixDeadlockOptionShortName
const std::string buildChoiceLabelOptionName
const std::string prismCompatibilityOptionShortName
const std::string bitsForUnboundedVariablesOptionName
const std::string buildOverlappingGuardsLabelOptionName
const std::string explorationOrderOptionName
SettingsType const & getModule()
Get module.
LabParser.cpp.
Definition cli.cpp:18