33template<
typename ValueType>
36 std::ofstream outfile;
39 if (monSettings.isExportMonotonicitySet()) {
44 STORM_LOG_THROW(regions.size() <= 1, storm::exceptions::InvalidArgumentException,
"Monotonicity analysis only allowed on single region");
45 if (!monSettings.isMonSolutionSet()) {
48 monSettings.isDotOutputSet());
49 if (monSettings.isExportMonotonicitySet()) {
50 monotonicityHelper.checkMonotonicityInBuild(outfile, monSettings.isUsePLABoundsSet(), monSettings.getDotOutputFilename());
52 monotonicityHelper.checkMonotonicityInBuild(std::cout, monSettings.isUsePLABoundsSet(), monSettings.getDotOutputFilename());
60 std::function<std::unique_ptr<storm::modelchecker::CheckResult>(std::shared_ptr<storm::logic::Formula const>
const& formula)> verificationCallback;
61 std::function<void(std::unique_ptr<storm::modelchecker::CheckResult>
const&)> postprocessingCallback;
64 verificationCallback = [&](std::shared_ptr<storm::logic::Formula const>
const& formula) {
65 std::unique_ptr<storm::modelchecker::CheckResult> result =
71 auto result = verificationCallback(property.getRawFormula())->asExplicitQuantitativeCheckResult<ValueType>().getValueVector();
74 auto states = model->getInitialStates();
75 for (
auto state : states) {
76 valuation += result[state];
83 if (res.first && res.second) {
85 }
else if (res.first) {
87 }
else if (res.second) {
93 if (monSettings.isExportMonotonicitySet()) {
101 if (monSettings.isExportMonotonicitySet()) {
105 monotonicityWatch.
stop();
106 STORM_PRINT(
"\nTotal time for monotonicity checking: " << monotonicityWatch <<
".\n\n");
static std::pair< bool, bool > checkDerivative(ValueType const &derivative, storage::ParameterRegion< ValueType > const ®)
Checks if a derivative >=0 or/and <=0.
void addMonotonicityResult(VariableType var, Monotonicity mon)
Adds a new variable with a given Monotonicity to the map.
std::string toString() const
Constructs a string output of all variables and their corresponding Monotonicity.
Base class for all sparse models.
A class that provides convenience operations to display run times.
void stop()
Stop stopwatch and add measured time to total time.
#define STORM_LOG_THROW(cond, exception, message)
#define STORM_PRINT(message)
Define the macros that print information and optionally also log it.
storm::modelchecker::CheckTask< storm::logic::Formula, ValueType > createTask(std::shared_ptr< const storm::logic::Formula > const &formula, bool onlyInitialStatesRelevant=false)
std::vector< std::shared_ptr< storm::logic::Formula const > > extractFormulasFromProperties(std::vector< storm::jani::Property > const &properties)
std::unique_ptr< storm::modelchecker::CheckResult > verifyWithSparseEngine(storm::Environment const &env, std::shared_ptr< storm::models::sparse::Dtmc< ValueType > > const &dtmc, storm::modelchecker::CheckTask< storm::logic::Formula, ValueType > const &task)
void closeFile(std::ofstream &stream)
Close the given file after writing.
void openFile(std::string const &filepath, std::ofstream &filestream, bool append=false, bool silent=false)
Open the given file for writing.
std::set< storm::RationalFunctionVariable > getProbabilityParameters(Model< storm::RationalFunction > const &model)
Get all probability parameters occurring on transitions.
void analyzeMonotonicity(std::shared_ptr< storm::models::sparse::Model< ValueType > > const &model, cli::SymbolicInput const &input, std::vector< storm::storage::ParameterRegion< ValueType > > const ®ions)
SettingsType const & getModule()
Get module.