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>>>>
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;
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...