Storm 1.14.0.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
print.cpp
Go to the documentation of this file.
5
7
8namespace storm::pars {
9
10template<typename ValueType>
11void printInitialStatesResult(std::unique_ptr<storm::modelchecker::CheckResult> const &result, storm::utility::Stopwatch *watch,
13 if (result) {
14 STORM_PRINT_AND_LOG("Result (initial states)");
15 if (valuation) {
16 bool first = true;
17 std::stringstream ss;
18 for (auto const &entry : *valuation) {
19 if (!first) {
20 ss << ", ";
21 } else {
22 first = false;
23 }
24 ss << entry.first << "=" << entry.second;
25 }
26
27 STORM_PRINT_AND_LOG(" for instance [" << ss.str() << "]");
28 }
30
31 auto const *regionCheckResult = dynamic_cast<storm::modelchecker::RegionCheckResult<ValueType> const *>(result.get());
32 if (regionCheckResult != nullptr) {
34 std::stringstream outStream;
35 if (partitionSettings.isPrintFullResultSet()) {
36 regionCheckResult->writeToStream(outStream);
37 } else {
38 regionCheckResult->writeCondensedToStream(outStream);
39 }
40 outStream << '\n';
41 if (!partitionSettings.isPrintNoIllustrationSet()) {
42 auto const *regionRefinementCheckResult = dynamic_cast<storm::modelchecker::RegionRefinementCheckResult<ValueType> const *>(regionCheckResult);
43 if (regionRefinementCheckResult != nullptr) {
44 regionRefinementCheckResult->writeIllustrationToStream(outStream);
45 }
46 }
47 outStream << '\n';
48 STORM_PRINT_AND_LOG(outStream.str());
49 } else {
50 STORM_PRINT_AND_LOG(*result << '\n');
51 }
52 if (watch) {
53 STORM_PRINT_AND_LOG("Time for model checking: " << *watch << ".\n\n");
54 }
55 } else {
56 STORM_LOG_ERROR("Property is unsupported by selected engine/settings.\n");
57 }
58}
59
60template void printInitialStatesResult<storm::RationalFunction>(std::unique_ptr<storm::modelchecker::CheckResult> const &result,
63} // namespace storm::pars
A class that provides convenience operations to display run times.
Definition Stopwatch.h:13
#define STORM_LOG_ERROR(message)
Definition logging.h:29
template void printInitialStatesResult< storm::RationalFunction >(std::unique_ptr< storm::modelchecker::CheckResult > const &result, storm::utility::Stopwatch *watch, const storm::utility::parametric::Valuation< storm::RationalFunction > *valuation)
void printInitialStatesResult(std::unique_ptr< storm::modelchecker::CheckResult > const &result, storm::utility::Stopwatch *watch, const storm::utility::parametric::Valuation< ValueType > *valuation)
Definition print.cpp:11
SettingsType const & getModule()
Get module.
std::map< typename VariableType< FunctionType >::type, typename CoefficientType< FunctionType >::type > Valuation
Definition parametric.h:43
#define STORM_PRINT_AND_LOG(message)
Definition print.h:20