28template<
typename ValueType>
29std::optional<storm::analysis::ConstraintCollector>
collectConstraints(std::shared_ptr<storm::models::ModelBase>
const& model) {
30 if constexpr (std::is_same_v<ValueType, storm::RationalFunction>) {
31 if (model && model->isSparseModel()) {
35 STORM_LOG_WARN(
"Could not collect the constraints of the model; they will be treated as undecided: " << exception.
what());
47template<
typename ValueType>
48std::optional<storm::pars::analysis::RegionCheckResult>
checkRegionConstraints(std::optional<storm::analysis::ConstraintCollector>
const& collector,
50 if constexpr (std::is_same_v<ValueType, storm::RationalFunction>) {
56 STORM_LOG_WARN(
"Could not check the constraints for region " << region <<
"; treating them as undecided: " << exception.
what());
67 std::stringstream message;
68 message <<
"the constraint '" << result.
violatedConstraint->toString() <<
"' is violated";
70 message <<
" at the point " << *result.
witness;
84template<
typename ValueType>
87 bool graphPreservationRequired) {
89 bool const needsGraphPreservation = assumed || graphPreservationRequired;
94 for (
auto const& region : regions) {
96 if (result && result->verdict == storm::pars::analysis::ConstraintVerdict::Sat) {
99 bool const violated = result && result->verdict == storm::pars::analysis::ConstraintVerdict::Unsat;
101 if (!needsGraphPreservation) {
108 }
else if (assumed) {
109 STORM_LOG_WARN_COND(!violated,
"Region " << region <<
" does not preserve the graph structure of the parametric model: "
112 STORM_LOG_THROW(!violated, storm::exceptions::InvalidSettingsException,
113 "Region " << region <<
" is provably not graph-preserving: " <<
describeViolation(*result)
114 <<
". Pass --assume-graph-preserving true to proceed nevertheless.");
116 "Cannot prove that region " << region
117 <<
" preserves the graph structure of the parametric model. This is only possible for sparse "
118 "parametric models with decidable (e.g. linear) constraints. Pass --assume-graph-preserving "
119 "true to skip this check.");
Class to collect constraints on parametric Markov chains.
This class represents the base class of all exception classes.
virtual const char * what() const noexcept override
Retrieves the message associated with this exception.
Base class for all sparse models.
Checks whether the constraints collected for a parametric model hold over an entire rectangular regio...
RegionCheckResult checkGraphPreservation(RationalFunctionRegion const ®ion) const
Checks the graph-preserving constraints together with the well-formedness constraints,...
RegionCheckResult checkWellformedness(RationalFunctionRegion const ®ion) const
#define STORM_LOG_WARN(message)
#define STORM_LOG_WARN_COND(cond, message)
#define STORM_LOG_THROW(cond, exception, message)
GraphPreservationStatus
Describes to what extent a set of regions is known to be well-defined and to preserve the graph struc...
@ WellDefined
The regions are known to be well-defined, i.e.
@ Unknown
It could not be established whether the regions are well-defined or preserve the graph structure of t...
@ GraphPreserving
The regions are known (or assumed) to preserve the graph structure of the model.
std::optional< storm::pars::analysis::RegionCheckResult > checkRegionConstraints(std::optional< storm::analysis::ConstraintCollector > const &collector, storm::storage::ParameterRegion< ValueType > const ®ion, bool wellformedness)
Checks the well-formedness constraints or the graph-preservation constraints over the region.
std::optional< storm::analysis::ConstraintCollector > collectConstraints(std::shared_ptr< storm::models::ModelBase > const &model)
Collects the constraints of the model.
storm::pars::analysis::GraphPreservationStatus establishGraphPreservation(std::shared_ptr< storm::models::ModelBase > const &model, std::vector< storm::storage::ParameterRegion< ValueType > > const ®ions, bool graphPreservationRequired)
Determines to what extent the regions are known to be well-defined and graph-preserving.
std::string describeViolation(storm::pars::analysis::RegionCheckResult const &result)
Describes a violated constraint, including the point at which it fails.
SettingsType const & getModule()
Get module.
std::optional< RegionWitness > witness
A point at which a constraint is violated.
std::optional< storm::expressions::Expression > violatedConstraint
The constraint violated at the witness.