dReal4
api.h
1 #pragma once
2 
3 #include "dreal/solver/config.h"
5 #include "dreal/util/box.h"
6 #include "dreal/util/optional.h"
7 
8 namespace dreal {
9 
10 /// Checks the satisfiability of a given formula @p f with a given precision
11 /// @p delta.
12 ///
13 /// @returns a model, a mapping from a variable to an interval, if @p f is
14 /// δ-satisfiable.
15 /// @returns a nullopt, if @p is unsatisfiable.
16 optional<Box> CheckSatisfiability(const Formula& f, double delta);
17 
18 /// Checks the satisfiability of a given formula @p f with a given configuration
19 /// @p config.
20 optional<Box> CheckSatisfiability(const Formula& f, Config config);
21 
22 /// Checks the satisfiability of a given formula @p f with a given precision
23 /// @p delta.
24 ///
25 /// @returns true if it finds a model which will be saved in @p box.
26 /// @returns false if it concludes unsat.
27 ///
28 /// @note We provide this version of API to avoid the use of optional.
29 bool CheckSatisfiability(const Formula& f, double delta, Box* box);
30 
31 /// Checks the satisfiability of a given formula @p f with a given configuration
32 /// @p config.
33 bool CheckSatisfiability(const Formula& f, Config config, Box* box);
34 
35 /// Finds a solution to minimize @p objective function while satisfying a
36 /// given @p constraint using @p delta.
37 ///
38 /// @returns a model, a mapping from a variable to an interval, if a solution
39 /// exists.
40 /// @returns nullopt, if there is no solution.
41 optional<Box> Minimize(const Expression& objective, const Formula& constraint,
42  double delta);
43 
44 /// Finds a solution to minimize @p objective function while satisfying a
45 /// given @p constraint using @p delta.
46 optional<Box> Minimize(const Expression& objective, const Formula& constraint,
47  Config config);
48 
49 /// Finds a solution to minimize @p objective function while satisfying a
50 /// given @p constraint using @p delta.
51 ///
52 /// @returns true if it finds a model which will be saved in @p box.
53 /// @returns false if it concludes unsat.
54 ///
55 /// @note We provide this version of API to avoid the use of optional.
56 bool Minimize(const Expression& objective, const Formula& constraint,
57  double delta, Box* box);
58 
59 /// Finds a solution to minimize @p objective function while satisfying a
60 /// given @p constraint using @p delta.
61 bool Minimize(const Expression& objective, const Formula& constraint,
62  Config config, Box* box);
63 
64 } // namespace dreal
Sum type of symbolic::Expression and symbolic::Formula.
Definition: api.cc:9
optional< Box > Minimize(const Expression &objective, const Formula &constraint, double delta)
Finds a solution to minimize objective function while satisfying a given constraint using delta...
Definition: api.cc:43
optional< Box > CheckSatisfiability(const Formula &f, const double delta)
Checks the satisfiability of a given formula f with a given precision delta.
Definition: api.cc:11
This is the header file that we consolidate Drake&#39;s symbolic classes and expose them inside of dreal ...