1#ifndef STORM_MONOTONICITYHELPER_H
2#define STORM_MONOTONICITYHELPER_H
31template<
typename ValueType,
typename ConstantType>
52 bool dotOutput =
false);
71 std::shared_ptr<utility::solver::SmtSolverFactory> smtSolverFactory = std::make_shared<utility::solver::MathsatSmtSolverFactory>();
74 std::set<VariableType> variables =
derivative.gatherVariables();
77 for (
auto variable : variables) {
78 auto managerVariable = manager->declareRationalVariable(variable.name());
81 exprBounds = exprBounds && manager->rational(lb) < managerVariable && managerVariable < manager->rational(ub);
99 assert(!(monIncr && monDecr) ||
derivative.isZero());
101 return std::pair<bool, bool>(monIncr, monDecr);
111 std::map<std::shared_ptr<Order>,
112 std::pair<std::shared_ptr<MonotonicityResult<VariableType>>, std::vector<std::shared_ptr<expressions::BinaryRelationExpression>>>>
129 void extendOrderWithAssumptions(std::shared_ptr<Order> order, uint_fast64_t val1, uint_fast64_t val2,
130 std::vector<std::shared_ptr<expressions::BinaryRelationExpression>> assumptions,
133 std::shared_ptr<models::ModelBase> model;
135 std::vector<std::shared_ptr<logic::Formula const>> formulas;
141 bool onlyCheckOnOrder;
145 std::map<VariableType, std::vector<uint_fast64_t>> occuringStatesAtVariable;
147 std::map<std::shared_ptr<Order>,
148 std::pair<std::shared_ptr<MonotonicityResult<VariableType>>, std::vector<std::shared_ptr<expressions::BinaryRelationExpression>>>>
153 ConstantType precision;
159 std::unordered_map<ValueType, std::unordered_map<VariableType, ValueType>> derivatives;
MonotonicityResult< VariableType >::Monotonicity Monotonicity
std::map< std::shared_ptr< Order >, std::pair< std::shared_ptr< MonotonicityResult< VariableType > >, std::vector< std::shared_ptr< expressions::BinaryRelationExpression > > > > checkMonotonicityInBuild(std::ostream &outfile, bool usePLA=false, std::string dotOutfileName="dotOutput")
Builds Reachability Orders for the given model and simultaneously uses them to check for Monotonicity...
std::shared_ptr< LocalMonotonicityResult< VariableType > > createLocalMonotonicityResult(std::shared_ptr< Order > order, storage::ParameterRegion< ValueType > region)
Builds Reachability Orders for the given model and simultaneously uses them to check for Monotonicity...
storage::ParameterRegion< ValueType > Region
MonotonicityHelper(std::shared_ptr< models::sparse::Model< ValueType > > model, std::vector< std::shared_ptr< logic::Formula const > > formulas, std::vector< storage::ParameterRegion< ValueType > > regions, uint_fast64_t numberOfSamples=0, double const &precision=0.000001, bool dotOutput=false)
Constructor of MonotonicityHelper.
utility::parametric::VariableType< ValueType >::type VariableType
utility::parametric::CoefficientType< ValueType >::type CoefficientType
static std::pair< bool, bool > checkDerivative(ValueType derivative, storage::ParameterRegion< ValueType > reg)
Checks if a derivative >=0 or/and <=0.
storm::analysis::MonotonicityKind Monotonicity
This class is responsible for managing a set of typed variables and all expressions using these varia...
This class represents a discrete-time Markov chain.
This class represents a (discrete-time) Markov decision process.
Base class for all sparse models.
virtual void add(storm::expressions::Expression const &assertion) override
Adds an assertion to the solver's stack.
virtual void reset() override
Removes all assertions from the solver's stack.
virtual CheckResult check() override
Checks whether the conjunction of assertions that are currently on the solver's stack is satisfiable.
CoefficientType const & getLowerBoundary(VariableType const &variable) const
CoefficientType const & getUpperBoundary(VariableType const &variable) const
A class that holds a possibly non-square matrix in the compressed row storage format.
TargetType convertNumber(SourceType const &number)