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