Storm 1.11.1.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
storm-pomdp.cpp
Go to the documentation of this file.
1#include <typeinfo>
2
25#include "storm/api/storm.h"
34
35namespace storm {
36namespace pomdp {
37namespace cli {
38
40template<typename ValueType>
42 storm::logic::Formula const& formula) {
43 auto const& pomdpSettings = storm::settings::getModule<storm::settings::modules::POMDPSettings>();
44 bool preprocessingPerformed = false;
45 if (pomdpSettings.isSelfloopReductionSet()) {
47 if (selfLoopEliminator.preservesFormula(formula)) {
48 STORM_PRINT_AND_LOG("Eliminating self-loop choices ...");
49 uint64_t oldChoiceCount = pomdp->getNumberOfChoices();
50 pomdp = selfLoopEliminator.transform();
51 STORM_PRINT_AND_LOG(oldChoiceCount - pomdp->getNumberOfChoices() << " choices eliminated through self-loop elimination.\n");
52 preprocessingPerformed = true;
53 } else {
54 STORM_PRINT_AND_LOG("Not eliminating self-loop choices as it does not preserve the formula.\n");
55 }
56 }
57 if (pomdpSettings.isQualitativeReductionSet() && formulaInfo.isNonNestedReachabilityProbability()) {
59 STORM_PRINT_AND_LOG("Computing states with probability 0 ...");
60 storm::storage::BitVector prob0States = qualitativeAnalysis.analyseProb0(formula.asProbabilityOperatorFormula());
61 std::cout << prob0States << '\n';
62 STORM_PRINT_AND_LOG(" done. " << prob0States.getNumberOfSetBits() << " states found.\n");
63 STORM_PRINT_AND_LOG("Computing states with probability 1 ...");
64 storm::storage::BitVector prob1States = qualitativeAnalysis.analyseProb1(formula.asProbabilityOperatorFormula());
65 STORM_PRINT_AND_LOG(" done. " << prob1States.getNumberOfSetBits() << " states found.\n");
67 pomdp = kpt.transform(*pomdp, prob0States, prob1States);
68 // Update formulaInfo to changes from Preprocessing
69 formulaInfo.updateTargetStates(*pomdp, std::move(prob1States));
70 formulaInfo.updateSinkStates(*pomdp, std::move(prob0States));
71 preprocessingPerformed = true;
72 }
73 return preprocessingPerformed;
74}
75
76template<typename ValueType>
77void printResult(ValueType const& lowerBound, ValueType const& upperBound) {
78 if (lowerBound == upperBound) {
79 if (storm::utility::isInfinity(lowerBound)) {
81 } else {
82 STORM_PRINT_AND_LOG(lowerBound);
83 }
84 } else if (storm::utility::isInfinity<ValueType>(-lowerBound)) {
85 if (storm::utility::isInfinity(upperBound)) {
86 STORM_PRINT_AND_LOG("[-inf, inf] (width=inf)");
87 } else {
88 // Only upper bound is known
89 STORM_PRINT_AND_LOG("≤ " << upperBound);
90 }
91 } else if (storm::utility::isInfinity(upperBound)) {
92 STORM_PRINT_AND_LOG("≥ " << lowerBound);
93 } else {
94 STORM_PRINT_AND_LOG("[" << lowerBound << ", " << upperBound << "] (width=" << ValueType(upperBound - lowerBound) << ")");
95 }
97 STORM_PRINT_AND_LOG(" (approx. ");
98 double roundedLowerBound =
99 storm::utility::isInfinity<ValueType>(-lowerBound) ? -storm::utility::infinity<double>() : storm::utility::convertNumber<double>(lowerBound);
100 double roundedUpperBound =
101 storm::utility::isInfinity(upperBound) ? storm::utility::infinity<double>() : storm::utility::convertNumber<double>(upperBound);
102 printResult(roundedLowerBound, roundedUpperBound);
104 }
105}
106
109 auto const& qualSettings = storm::settings::getModule<storm::settings::modules::QualitativePOMDPAnalysisSettings>();
110
111 options.onlyDeterministicStrategies = qualSettings.isOnlyDeterministicSet();
112 uint64_t loglevel = 0;
113 // TODO a big ugly, but we have our own loglevels (for technical reasons)
114 if (storm::utility::getLogLevel() == l3pp::LogLevel::INFO) {
115 loglevel = 1;
116 } else if (storm::utility::getLogLevel() == l3pp::LogLevel::DEBUG) {
117 loglevel = 2;
118 } else if (storm::utility::getLogLevel() == l3pp::LogLevel::TRACE) {
119 loglevel = 3;
120 }
121 options.setDebugLevel(loglevel);
122 options.validateEveryStep = qualSettings.validateIntermediateSteps();
123 options.validateResult = qualSettings.validateFinalResult();
124
125 options.pathVariableType = storm::pomdp::pathVariableTypeFromString(qualSettings.getLookaheadType());
126
127 if (qualSettings.isExportSATCallsSet()) {
128 options.setExportSATCalls(qualSettings.getExportSATCallsPath());
129 }
130
131 return options;
132}
133
134template<typename ValueType>
136 storm::pomdp::analysis::FormulaInformation const& formulaInfo, storm::logic::Formula const& formula) {
137 auto const& qualSettings = storm::settings::getModule<storm::settings::modules::QualitativePOMDPAnalysisSettings>();
138 auto const& coreSettings = storm::settings::getModule<storm::settings::modules::CoreSettings>();
139 std::stringstream sstr;
140 origpomdp->printModelInformationToStream(sstr);
141 STORM_LOG_INFO(sstr.str());
142 STORM_LOG_THROW(formulaInfo.isNonNestedReachabilityProbability(), storm::exceptions::NotSupportedException,
143 "Qualitative memoryless scheduler search is not implemented for this property type.");
144 STORM_LOG_TRACE("Run qualitative preprocessing...");
147 // After preprocessing, this might be done cheaper.
148 storm::storage::BitVector surelyNotAlmostSurelyReachTarget = qualitativeAnalysis.analyseProbSmaller1(formula.asProbabilityOperatorFormula());
149 pomdp.getTransitionMatrix().makeRowGroupsAbsorbing(surelyNotAlmostSurelyReachTarget);
150 storm::storage::BitVector targetStates = qualitativeAnalysis.analyseProb1(formula.asProbabilityOperatorFormula());
151 bool computedSomething = false;
152 if (qualSettings.isMemlessSearchSet()) {
153 computedSomething = true;
154 std::shared_ptr<storm::utility::solver::SmtSolverFactory> smtSolverFactory = std::make_shared<storm::utility::solver::Z3SmtSolverFactory>();
155 uint64_t lookahead = qualSettings.getLookahead();
156 if (lookahead == 0) {
157 lookahead = pomdp.getNumberOfStates();
158 }
159 if (qualSettings.getMemlessSearchMethod() == "one-shot") {
160 storm::pomdp::OneShotPolicySearch<ValueType> memlessSearch(pomdp, targetStates, surelyNotAlmostSurelyReachTarget, smtSolverFactory);
161 if (qualSettings.isWinningRegionSet()) {
162 STORM_LOG_ERROR("Computing winning regions is not supported by the one-shot method.");
163 } else {
164 bool result = memlessSearch.analyzeForInitialStates(lookahead);
165 if (result) {
166 STORM_PRINT_AND_LOG("From initial state, one can almost-surely reach the target.\n");
167 } else {
168 STORM_PRINT_AND_LOG("From initial state, one may not almost-surely reach the target .\n");
169 }
170 }
171 } else if (qualSettings.getMemlessSearchMethod() == "iterative") {
173 storm::pomdp::IterativePolicySearch<ValueType> search(pomdp, targetStates, surelyNotAlmostSurelyReachTarget, smtSolverFactory, options);
174 if (qualSettings.isWinningRegionSet()) {
175 search.computeWinningRegion(lookahead);
176 } else {
177 bool result = search.analyzeForInitialStates(lookahead);
178 if (result) {
179 STORM_PRINT_AND_LOG("From initial state, one can almost-surely reach the target.");
180 } else {
181 // TODO consider adding check for end components to improve this message.
182 STORM_PRINT_AND_LOG("From initial state, one may not almost-surely reach the target.");
183 }
184 }
185
186 if (qualSettings.isPrintWinningRegionSet()) {
187 search.getLastWinningRegion().print();
188 std::cout << '\n';
189 }
190 if (qualSettings.isExportWinningRegionSet()) {
191 std::size_t hash = pomdp.hash();
192 search.getLastWinningRegion().storeToFile(qualSettings.exportWinningRegionPath(), "model hash: " + std::to_string(hash));
193 }
194
195 search.finalizeStatistics();
196 if (pomdp.getInitialStates().getNumberOfSetBits() == 1) {
197 uint64_t initialState = pomdp.getInitialStates().getNextSetIndex(0);
198 uint64_t initialObservation = pomdp.getObservation(initialState);
199 // TODO this is inefficient.
200 uint64_t offset = 0;
201 for (uint64_t state = 0; state < pomdp.getNumberOfStates(); ++state) {
202 if (state == initialState) {
203 break;
204 }
205 if (pomdp.getObservation(state) == initialObservation) {
206 ++offset;
207 }
208 }
209
210 if (search.getLastWinningRegion().isWinning(initialObservation, offset)) {
211 STORM_PRINT_AND_LOG("Initial state is safe!\n");
212 } else {
213 STORM_PRINT_AND_LOG("Initial state may not be safe.\n");
214 }
215 } else {
216 STORM_LOG_WARN("Output for multiple initial states is incomplete");
217 }
218
219 if (coreSettings.isShowStatisticsSet()) {
220 STORM_PRINT_AND_LOG("#STATS Number of belief support states: " << search.getLastWinningRegion().beliefSupportStates() << '\n');
221 if (qualSettings.computeExpensiveStats()) {
222 auto wbss = search.getLastWinningRegion().computeNrWinningBeliefs();
223 STORM_PRINT_AND_LOG("#STATS Number of winning belief support states: [" << wbss.first << "," << wbss.second << "]");
224 }
225 search.getStatistics().print();
226 }
227
228 } else {
229 STORM_LOG_ERROR("This method is not implemented.");
230 }
231 }
232 if (qualSettings.isComputeOnBeliefSupportSet()) {
233 computedSomething = true;
235 janicreator.generate(targetStates, surelyNotAlmostSurelyReachTarget);
236 bool initialOnly = !qualSettings.isWinningRegionSet();
237 janicreator.verifySymbolic(initialOnly);
238 STORM_PRINT_AND_LOG("Initial state is safe: " << janicreator.isInitialWinning() << "\n");
239 }
240 STORM_LOG_THROW(computedSomething, storm::exceptions::InvalidSettingsException, "Nothing to be done, did you forget to set a method?");
241}
242
243template<typename ValueType, typename BeliefType = ValueType>
245 storm::logic::Formula const& formula) {
246 auto const& pomdpSettings = storm::settings::getModule<storm::settings::modules::POMDPSettings>();
247 bool analysisPerformed = false;
248 if (pomdpSettings.isBeliefExplorationSet()) {
249 STORM_PRINT_AND_LOG("Exploring the belief MDP... \n");
250 auto options = storm::pomdp::modelchecker::BeliefExplorationPomdpModelCheckerOptions<ValueType>(pomdpSettings.isBeliefExplorationDiscretizeSet(),
251 pomdpSettings.isBeliefExplorationUnfoldSet());
252 auto const& beliefExplorationSettings = storm::settings::getModule<storm::settings::modules::BeliefExplorationSettings>();
253 beliefExplorationSettings.setValuesInOptionsStruct(options);
255 auto result = checker.check(formula);
256 checker.printStatisticsToStream(std::cout);
258 STORM_PRINT_AND_LOG("\nResult till abort: ");
259 } else {
260 STORM_PRINT_AND_LOG("\nResult: ");
261 }
262 printResult(result.lowerBound, result.upperBound);
264 analysisPerformed = true;
265 }
266 if (pomdpSettings.isQualitativeAnalysisSet()) {
267 performQualitativeAnalysis(pomdp, formulaInfo, formula);
268 analysisPerformed = true;
269 }
270 if (pomdpSettings.isCheckFullyObservableSet()) {
271 STORM_PRINT_AND_LOG("Analyzing the formula on the fully observable MDP ... ");
272 auto resultPtr = storm::api::verifyWithSparseEngine<ValueType>(pomdp->template as<storm::models::sparse::Mdp<ValueType>>(),
273 storm::api::createTask<ValueType>(formula.asSharedPointer(), true));
274 if (resultPtr) {
275 auto result = resultPtr->template asExplicitQuantitativeCheckResult<ValueType>();
276 result.filter(storm::modelchecker::ExplicitQualitativeCheckResult(pomdp->getInitialStates()));
278 STORM_PRINT_AND_LOG("\nResult till abort: ");
279 } else {
280 STORM_PRINT_AND_LOG("\nResult: ");
281 }
282 printResult(result.getMin(), result.getMax());
284 } else {
285 STORM_PRINT_AND_LOG("\nResult: Not available.\n");
286 }
287 analysisPerformed = true;
288 }
289 return analysisPerformed;
290}
291
292template<typename ValueType>
294 auto const& pomdpSettings = storm::settings::getModule<storm::settings::modules::POMDPSettings>();
295 auto const& ioSettings = storm::settings::getModule<storm::settings::modules::IOSettings>();
296 auto const& transformSettings = storm::settings::getModule<storm::settings::modules::ToParametricSettings>();
297 bool transformationPerformed = false;
298 bool memoryUnfolded = false;
299 if (pomdpSettings.getMemoryBound() > 1) {
300 STORM_PRINT_AND_LOG("Computing the unfolding for memory bound " << pomdpSettings.getMemoryBound() << " and memory pattern '"
301 << storm::storage::toString(pomdpSettings.getMemoryPattern()) << "' ...");
302 storm::storage::PomdpMemory memory = storm::storage::PomdpMemoryBuilder().build(pomdpSettings.getMemoryPattern(), pomdpSettings.getMemoryBound());
303 std::cout << memory.toString() << '\n';
304 storm::transformer::PomdpMemoryUnfolder<ValueType> memoryUnfolder(*pomdp, memory);
305 pomdp = memoryUnfolder.transform();
306 STORM_PRINT_AND_LOG(" done.\n");
307 pomdp->printModelInformationToStream(std::cout);
308 transformationPerformed = true;
309 memoryUnfolded = true;
310 }
311
312 // From now on the POMDP is considered memoryless
313
314 if (transformSettings.isMecReductionSet()) {
315 STORM_PRINT_AND_LOG("Eliminating mec choices ...");
316 // Note: Elimination of mec choices only preserves memoryless schedulers.
317 uint64_t oldChoiceCount = pomdp->getNumberOfChoices();
319 pomdp = mecChoiceEliminator.transform(formula);
320 STORM_PRINT_AND_LOG(" done.\n");
321 STORM_PRINT_AND_LOG(oldChoiceCount - pomdp->getNumberOfChoices() << " choices eliminated through MEC choice elimination.\n");
322 pomdp->printModelInformationToStream(std::cout);
323 transformationPerformed = true;
324 }
325
326 if (transformSettings.isTransformBinarySet() || transformSettings.isTransformSimpleSet()) {
327 if (transformSettings.isTransformSimpleSet()) {
328 STORM_PRINT_AND_LOG("Transforming the POMDP to a simple POMDP.");
329 pomdp = storm::transformer::BinaryPomdpTransformer<ValueType>().transform(*pomdp, true).transformedPomdp;
330 } else {
331 STORM_PRINT_AND_LOG("Transforming the POMDP to a binary POMDP.");
332 pomdp = storm::transformer::BinaryPomdpTransformer<ValueType>().transform(*pomdp, false).transformedPomdp;
333 }
334 pomdp->printModelInformationToStream(std::cout);
335 STORM_PRINT_AND_LOG(" done.\n");
336 transformationPerformed = true;
337 }
338
339 if (pomdpSettings.isExportToParametricSet()) {
340 STORM_PRINT_AND_LOG("Transforming memoryless POMDP to pMC...");
342 std::string transformMode = transformSettings.getFscApplicationTypeString();
343 auto pmc = toPMCTransformer.transform(storm::transformer::parsePomdpFscApplicationMode(transformMode));
344 STORM_PRINT_AND_LOG(" done.\n");
345 if (transformSettings.allowPostSimplifications()) {
346 STORM_PRINT_AND_LOG("Simplifying pMC...");
347 pmc = storm::api::performBisimulationMinimization<storm::RationalFunction>(pmc->template as<storm::models::sparse::Dtmc<storm::RationalFunction>>(),
348 {formula.asSharedPointer()}, storm::storage::BisimulationType::Strong)
349 ->template as<storm::models::sparse::Dtmc<storm::RationalFunction>>();
350 STORM_PRINT_AND_LOG(" done.\n");
351 pmc->printModelInformationToStream(std::cout);
352 }
353 STORM_PRINT_AND_LOG("Exporting pMC...");
355 auto const& parameterSet = constraints.getVariables();
356 std::vector<storm::RationalFunctionVariable> parameters(parameterSet.begin(), parameterSet.end());
357 std::vector<std::string> parameterNames;
358 for (auto const& parameter : parameters) {
359 parameterNames.push_back(parameter.name());
360 }
361 storm::api::exportSparseModelAsDrn(pmc, pomdpSettings.getExportToParametricFilename(), parameterNames,
362 !ioSettings.isExplicitExportPlaceholdersDisabled());
363 STORM_PRINT_AND_LOG(" done.\n");
364 transformationPerformed = true;
365 }
366 if (transformationPerformed && !memoryUnfolded) {
367 STORM_PRINT_AND_LOG("Implicitly assumed restriction to memoryless schedulers for at least one transformation.\n");
368 }
369 return transformationPerformed;
370}
371
372template<typename ValueType>
374 auto const& pomdpSettings = storm::settings::getModule<storm::settings::modules::POMDPSettings>();
375
376 if (!pomdpSettings.isNoCanonicSet()) {
378 pomdp = makeCanonic.transform();
379 }
380
381 if (pomdpSettings.isAnalyzeUniqueObservationsSet()) {
382 STORM_PRINT_AND_LOG("Analyzing states with unique observation ...\n");
384 std::cout << uniqueAnalysis.analyse() << '\n';
385 }
386}
387
388template<typename ValueType>
389void processFormula(std::shared_ptr<storm::models::sparse::Pomdp<ValueType>>&& pomdp, std::shared_ptr<storm::logic::Formula const> const& formula) {
390 auto formulaInfo = storm::pomdp::analysis::getFormulaInformation(*pomdp, *formula);
391 STORM_LOG_THROW(!formulaInfo.isUnsupported(), storm::exceptions::InvalidPropertyException,
392 "The formula '" << *formula << "' is not supported by storm-pomdp.");
393
395 // Note that formulaInfo contains state-based information which potentially needs to be updated during preprocessing
396 if (performPreprocessing(pomdp, formulaInfo, *formula)) {
397 sw.stop();
398 STORM_PRINT_AND_LOG("Time for graph-based POMDP (pre-)processing: " << sw << ".\n");
399 pomdp->printModelInformationToStream(std::cout);
400 }
401
402 sw.restart();
403 if (performTransformation(pomdp, *formula)) {
404 sw.stop();
405 STORM_PRINT_AND_LOG("Time for POMDP transformation(s): " << sw << ".\n");
406 }
407
408 sw.restart();
409 if (performAnalysis(pomdp, formulaInfo, *formula)) {
410 sw.stop();
411 STORM_PRINT_AND_LOG("Time for POMDP analysis: " << sw << ".\n");
412 }
413}
414
415template<typename ValueType>
416void processPomdpFormula(std::shared_ptr<storm::models::sparse::Pomdp<ValueType>>&& pomdp, std::shared_ptr<storm::logic::Formula const> const& formula) {
417 STORM_LOG_ASSERT(pomdp, "No POMDP given or input POMDP is of unexpected type.");
418 processPomdp(pomdp);
419
420 if (formula) {
421 processFormula(std::move(pomdp), formula);
422 } else {
423 STORM_LOG_WARN("Nothing to be done. Did you forget to specify a formula?");
424 }
425}
426
428 auto symbolicInput = storm::cli::parseSymbolicInput();
430 std::tie(symbolicInput, mpi) = storm::cli::preprocessSymbolicInput(symbolicInput);
433 storm::exceptions::UnexpectedException, "Unexpected ValueType for model building.");
434
435 auto model = storm::cli::buildPreprocessExportModel(symbolicInput, mpi);
436 if (!model) {
437 STORM_PRINT_AND_LOG("No input model given.\n");
438 return;
439 }
440 STORM_LOG_THROW(model->getType() == storm::models::ModelType::Pomdp && model->isSparseModel(), storm::exceptions::WrongFormatException,
441 "Expected a POMDP in sparse representation.");
442
443 std::shared_ptr<storm::logic::Formula const> formula;
444 if (!symbolicInput.properties.empty()) {
445 formula = symbolicInput.properties.front().getRawFormula();
446 STORM_PRINT_AND_LOG("Analyzing property '" << *formula << "'\n");
447 STORM_LOG_WARN_COND(symbolicInput.properties.size() == 1,
448 "There is currently no support for multiple properties. All other properties will be ignored.");
449 }
450
451 if (model->isExact()) {
453 } else {
454 processPomdpFormula(model->template as<storm::models::sparse::Pomdp<double>>(), formula);
455 }
456}
457
458} // namespace cli
459} // namespace pomdp
460} // namespace storm
461
469int main(const int argc, const char** argv) {
470 try {
472 } catch (storm::exceptions::BaseException const& exception) {
473 STORM_LOG_ERROR("An exception caused Storm-pomdp to terminate. The message of the exception is: " << exception.what());
474 return 1;
475 } catch (std::exception const& exception) {
476 STORM_LOG_ERROR("An unexpected exception occurred and caused Storm-pomdp to terminate. The message of this exception is: " << exception.what());
477 return 2;
478 }
479}
Class to collect constraints on parametric Markov chains.
std::set< storm::RationalFunctionVariable > const & getVariables() const
Returns the set of variables in the model.
storm::storage::BitVector analyseProb0(storm::logic::ProbabilityOperatorFormula const &formula) const
storm::storage::BitVector analyseProbSmaller1(storm::logic::ProbabilityOperatorFormula const &formula) const
storm::storage::BitVector analyseProb1(storm::logic::ProbabilityOperatorFormula const &formula) const
This class represents the base class of all exception classes.
virtual const char * what() const noexcept override
Retrieves the message associated with this exception.
ProbabilityOperatorFormula & asProbabilityOperatorFormula()
Definition Formula.cpp:476
std::shared_ptr< Formula const > asSharedPointer()
Definition Formula.cpp:571
This class represents a discrete-time Markov chain.
Definition Dtmc.h:13
This class represents a (discrete-time) Markov decision process.
Definition Mdp.h:13
storm::storage::SparseMatrix< ValueType > const & getTransitionMatrix() const
Retrieves the matrix representing the transitions of the model.
Definition Model.cpp:197
virtual uint_fast64_t getNumberOfStates() const override
Returns the number of states of the model.
Definition Model.cpp:162
storm::storage::BitVector const & getInitialStates() const
Retrieves the initial states of the model.
Definition Model.cpp:177
This class represents a partially observable Markov decision process.
Definition Pomdp.h:13
virtual std::size_t hash() const override
Definition Pomdp.cpp:147
uint32_t getObservation(uint64_t state) const
Definition Pomdp.cpp:63
WinningRegion const & getLastWinningRegion() const
void setExportSATCalls(std::string const &path)
MemlessSearchPathVariables pathVariableType
bool analyzeForInitialStates(uint64_t k)
Check if you can find a memoryless policy from the initial states.
std::pair< storm::RationalNumber, storm::RationalNumber > computeNrWinningBeliefs() const
storm::RationalNumber beliefSupportStates() const
bool isWinning(uint64_t observation, uint64_t offset) const
void storeToFile(std::string const &path, std::string const &preamble="", bool append=false) const
void updateSinkStates(PomdpType const &pomdp, storm::storage::BitVector &&newSinkStates)
void updateTargetStates(PomdpType const &pomdp, storm::storage::BitVector &&newTargetStates)
Model checker for checking reachability queries on POMDPs using approximations based on exploration o...
Result check(storm::Environment const &env, storm::logic::Formula const &formula, storm::Environment const &preProcEnv, std::vector< std::vector< std::unordered_map< uint64_t, ValueType > > > const &additionalUnderApproximationBounds=std::vector< std::vector< std::unordered_map< uint64_t, ValueType > > >())
Performs model checking of the given POMDP with regards to a formula using the previously specified o...
void printStatisticsToStream(std::ostream &stream) const
Prints statistics of the process to a given output stream.
void generate(storm::storage::BitVector const &targetStates, storm::storage::BitVector const &badStates)
std::shared_ptr< storm::models::sparse::Pomdp< ValueType > > transform(storm::models::sparse::Pomdp< ValueType > const &pomdp, storm::storage::BitVector &prob0States, storm::storage::BitVector &prob1States)
A bit vector that is internally represented as a vector of 64-bit values.
Definition BitVector.h:16
uint64_t getNextSetIndex(uint64_t startingIndex) const
Retrieves the index of the bit that is the next bit set to true in the bit vector.
uint64_t getNumberOfSetBits() const
Returns the number of bits that are set to true in this bit vector.
PomdpMemory build(PomdpMemoryPattern pattern, uint64_t numStates) const
std::string toString() const
std::shared_ptr< storm::models::sparse::Model< storm::RationalFunction > > transform(PomdpFscApplicationMode applicationMode=PomdpFscApplicationMode::SIMPLE_LINEAR) const
PomdpTransformationResult< ValueType > transform(storm::models::sparse::Pomdp< ValueType > const &pomdp, bool transformSimple, bool keepStateValuations=false) const
std::shared_ptr< storm::models::sparse::Pomdp< ValueType > > transform() const
bool preservesFormula(storm::logic::Formula const &formula) const
std::shared_ptr< storm::models::sparse::Pomdp< ValueType > > transform(storm::logic::Formula const &formula) const
std::shared_ptr< storm::models::sparse::Pomdp< ValueType > > transform() const
std::shared_ptr< storm::models::sparse::Pomdp< ValueType > > transform(bool dropUnreachableStates=true) const
A class that provides convenience operations to display run times.
Definition Stopwatch.h:14
void restart()
Reset the stopwatch and immediately start it.
Definition Stopwatch.cpp:59
void stop()
Stop stopwatch and add measured time to total time.
Definition Stopwatch.cpp:42
#define STORM_LOG_INFO(message)
Definition logging.h:24
#define STORM_LOG_WARN(message)
Definition logging.h:25
#define STORM_LOG_TRACE(message)
Definition logging.h:12
#define STORM_LOG_ERROR(message)
Definition logging.h:26
#define STORM_LOG_ASSERT(cond, message)
Definition macros.h:11
#define STORM_LOG_WARN_COND(cond, message)
Definition macros.h:38
#define STORM_LOG_THROW(cond, exception, message)
Definition macros.h:30
#define STORM_PRINT_AND_LOG(message)
Definition macros.h:68
void exportSparseModelAsDrn(std::shared_ptr< storm::models::sparse::Model< ValueType > > const &model, std::string const &filename, std::vector< std::string > const &parameterNames={}, bool allowPlaceholders=true)
Definition export.h:29
std::shared_ptr< storm::models::ModelBase > buildPreprocessExportModel(SymbolicInput const &input, ModelProcessingInformation const &mpi)
SymbolicInput parseSymbolicInput()
int process(std::string const &name, std::string const &executableName, std::function< void(std::string const &, std::string const &)> initSettingsFunc, std::function< void(void)> processOptionsFunc, const int argc, const char **argv)
Processes the options and returns the exit code.
Definition cli.cpp:84
std::pair< SymbolicInput, ModelProcessingInformation > preprocessSymbolicInput(SymbolicInput const &input)
FormulaInformation getFormulaInformation(PomdpType const &pomdp, storm::logic::ProbabilityOperatorFormula const &formula)
bool performPreprocessing(std::shared_ptr< storm::models::sparse::Pomdp< ValueType > > &pomdp, storm::pomdp::analysis::FormulaInformation &formulaInfo, storm::logic::Formula const &formula)
Perform preprocessings based on the graph structure (if requested or necessary). Return true,...
void processPomdp(std::shared_ptr< storm::models::sparse::Pomdp< ValueType > > &pomdp)
bool performTransformation(std::shared_ptr< storm::models::sparse::Pomdp< ValueType > > &pomdp, storm::logic::Formula const &formula)
MemlessSearchOptions fillMemlessSearchOptionsFromSettings()
void performQualitativeAnalysis(std::shared_ptr< storm::models::sparse::Pomdp< ValueType > > const &origpomdp, storm::pomdp::analysis::FormulaInformation const &formulaInfo, storm::logic::Formula const &formula)
void printResult(ValueType const &lowerBound, ValueType const &upperBound)
bool performAnalysis(std::shared_ptr< storm::models::sparse::Pomdp< ValueType > > const &pomdp, storm::pomdp::analysis::FormulaInformation const &formulaInfo, storm::logic::Formula const &formula)
void processPomdpFormula(std::shared_ptr< storm::models::sparse::Pomdp< ValueType > > &&pomdp, std::shared_ptr< storm::logic::Formula const > const &formula)
void processFormula(std::shared_ptr< storm::models::sparse::Pomdp< ValueType > > &&pomdp, std::shared_ptr< storm::logic::Formula const > const &formula)
MemlessSearchPathVariables pathVariableTypeFromString(std::string const &in)
void initializePomdpSettings(std::string const &name, std::string const &executableName)
Initialize the settings manager.
std::string toString(PomdpMemoryPattern const &pattern)
PomdpFscApplicationMode parsePomdpFscApplicationMode(std::string const &mode)
bool isTerminate()
Check whether the program should terminate (due to some abort signal).
bool isInfinity(ValueType const &a)
l3pp::LogLevel getLogLevel()
Gets the global log level.
int main(const int argc, const char **argv)
Entry point for the pomdp backend.