52 bool dotOutput =
false);
64 if (derivative.isZero()) {
67 }
else if (derivative.isConstant()) {
68 monIncr = derivative.constantPart() >= 0;
69 monDecr = derivative.constantPart() <= 0;
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());
79 auto lb = utility::convertNumber<RationalNumber>(reg.
getLowerBoundary(variable));
80 auto ub = utility::convertNumber<RationalNumber>(reg.
getUpperBoundary(variable));
81 exprBounds = exprBounds && manager->rational(lb) < managerVariable && managerVariable < manager->rational(ub);
93 exprToCheck = converter.toExpression(derivative) > manager->rational(0);
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>>>>
140 void extendOrderWithAssumptions(std::shared_ptr<Order> order, uint_fast64_t val1, uint_fast64_t val2,
141 std::vector<std::shared_ptr<expressions::BinaryRelationExpression>> assumptions,
146 ValueType getDerivative(ValueType function,
VariableType var);
148 std::shared_ptr<models::ModelBase> model;
150 std::vector<std::shared_ptr<logic::Formula const>> formulas;
156 bool onlyCheckOnOrder;
160 std::map<VariableType, std::vector<uint_fast64_t>> occuringStatesAtVariable;
162 std::map<std::shared_ptr<Order>,
163 std::pair<std::shared_ptr<MonotonicityResult<VariableType>>, std::vector<std::shared_ptr<expressions::BinaryRelationExpression>>>>
168 ConstantType precision;
174 std::unordered_map<ValueType, std::unordered_map<VariableType, ValueType>> derivatives;
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...
Monotonicity checkLocalMonotonicity(std::shared_ptr< Order > order, uint_fast64_t state, VariableType var, storage::ParameterRegion< ValueType > region)
Checks for local monotonicity at the given state.