13#include <unordered_map>
17#include "dlinear/libs/libgmp.h"
18#include "dlinear/symbolic/literal.h"
19#include "dlinear/symbolic/symbolic.h"
20#include "dlinear/util/Config.h"
21#include "dlinear/util/Interval.h"
58 void Add(
const Variable &v,
const mpq_class &lb,
const mpq_class &ub);
64 [[nodiscard]]
bool empty()
const;
73 [[nodiscard]]
int size()
const;
106 [[nodiscard]]
const std::vector<Variable> &
variables()
const;
146 [[nodiscard]] std::pair<mpq_class, int>
MaxDiam()
const;
154 [[nodiscard]] std::pair<Box, Box>
Bisect(
int i)
const;
162 [[nodiscard]] std::pair<Box, Box>
Bisect(
const Variable &var)
const;
172 [[nodiscard]] std::pair<Box, Box>
BisectInt(
int i)
const;
189 friend std::ostream &operator<<(std::ostream &os,
const Box &box);
192std::ostream &operator<<(std::ostream &os,
const Box &box);
194bool operator==(
const Box &b1,
const Box &b2);
196bool operator!=(
const Box &b1,
const Box &b2);
198std::ostream &DisplayDiff(std::ostream &os,
const std::vector<Variable> &variables,
const std::vector<Interval> &old_iv,
199 const std::vector<Interval> &new_iv);
203#ifdef DLINEAR_INCLUDE_FMT
205#include "dlinear/util/logging.h"
Collection of variables with associated intervals.
std::vector< Interval > values_
Interval vector of the box.
std::pair< mpq_class, int > MaxDiam() const
Return the max diameter of the box and the associated index.
std::shared_ptr< std::unordered_map< Variable, int > > var_to_idx_
Variable to index map.
std::vector< Interval > & m_interval_vector()
Return the interval vector of the box.
std::shared_ptr< std::vector< Variable > > variables_
Variables in the box.
void Add(const Variable &v)
Add the variable v to the box.
std::shared_ptr< std::unordered_map< int, Variable > > idx_to_var_
Index to variable map.
Interval & operator[](int i)
Return the interval at index i.
Config::LPSolver lp_solver_
LP solver.
std::pair< Box, Box > Bisect(int i) const
Bisect the box at i -th dimension.
int index(const Variable &var) const
Return the index associated with var.
std::pair< Box, Box > BisectInt(int i) const
Bisects the box at i -th dimension.
const std::vector< Variable > & variables() const
Get read-only access to the variables of the box.
Box(Config::LPSolver lp_solver)
Construct a new Box object associated with the given lp_solver.
const std::vector< Interval > & interval_vector() const
Return the interval vector of the box.
Config::LPSolver lp_solver() const
Get read-only access to the lp_solver of the box.
bool empty() const
Check whether the box is empty.
std::pair< Box, Box > BisectContinuous(int i) const
Bisects the box at i -th dimension.
int size() const
Get read-only access to the number of variables of the box.
const Variable & variable(int i) const
Return the i -th variable in the box.
void set_empty()
Clear the box, making it empty.
bool has_variable(const Variable &var) const
Checks if this box contains var.
LPSolver
Underlying LP solver used by the theory solver.
Represents a symbolic variable.
Global namespace for the dlinear library.