10#include "dlinear/symbolic/hash.h"
11#include "dlinear/symbolic/symbolic_environment.h"
12#include "dlinear/symbolic/symbolic_expression.h"
13#include "dlinear/symbolic/symbolic_variable.h"
14#include "dlinear/symbolic/symbolic_variables.h"
16namespace dlinear::drake {
20enum class FormulaKind {
37bool operator<(FormulaKind k1, FormulaKind k2);
43class RelationalFormulaCell;
115 FormulaKind get_kind() const;
116 size_t get_hash() const;
125 bool IsFlattened() const;
186 const FormulaSubstitution &formula_subst)
const;
208 std::string to_smt2_string()
const;
214 explicit operator bool()
const {
return Evaluate(); }
216 friend std::ostream &operator<<(std::ostream &os,
const Formula &f);
217 friend void swap(
Formula &a,
Formula &b) { std::swap(a.ptr_, b.ptr_); }
237 friend const FormulaFalse *to_false(
const Formula &f);
238 friend const FormulaTrue *to_true(
const Formula &f);
239 friend const FormulaVar *to_variable(
const Formula &f);
240 friend const RelationalFormulaCell *to_relational(
const Formula &f);
241 friend const FormulaEq *to_equal_to(
const Formula &f);
242 friend const FormulaNeq *to_not_equal_to(
const Formula &f);
243 friend const FormulaGt *to_greater_than(
const Formula &f);
244 friend const FormulaGeq *to_greater_than_or_equal_to(
const Formula &f);
245 friend const FormulaLt *to_less_than(
const Formula &f);
246 friend const FormulaLeq *to_less_than_or_equal_to(
const Formula &f);
247 friend const NaryFormulaCell *to_nary(
const Formula &f);
248 friend NaryFormulaCell *to_nary(
Formula &f);
249 friend const FormulaAnd *to_conjunction(
const Formula &f);
250 friend const FormulaOr *to_disjunction(
const Formula &f);
251 friend const FormulaNot *to_negation(
const Formula &f);
252 friend const FormulaForall *to_forall(
const Formula &f);
277 explicit Formula(FormulaCell *ptr);
375std::ostream &operator<<(std::ostream &os,
const Formula &f);
378bool is_false(
const Formula &f);
382bool is_variable(
const Formula &f);
384bool is_equal_to(
const Formula &f);
386bool is_not_equal_to(
const Formula &f);
388bool is_greater_than(
const Formula &f);
390bool is_greater_than_or_equal_to(
const Formula &f);
392bool is_less_than(
const Formula &f);
394bool is_less_than_or_equal_to(
const Formula &f);
396bool is_relational(
const Formula &f);
398bool is_conjunction(
const Formula &f);
400bool is_disjunction(
const Formula &f);
404bool is_negation(
const Formula &f);
406bool is_forall(
const Formula &f);
426const std::set<Formula> &get_operands(
const Formula &f);
458struct less<
dlinear::drake::symbolic::Formula> {
461 return lhs.
Less(rhs);
467struct equal_to<
dlinear::drake::symbolic::Formula> {
475struct hash<
dlinear::drake::symbolic::Formula> {
Represents a symbolic environment (mapping from a variable to a value).
Represents a symbolic form of an expression.
Represents a symbolic variable.
Represents a set of variables.
Global namespace for the dlinear library.
Formula make_conjunction(const std::vector< Formula > &formulas)
Make conjunction of formulas.
LpColBound operator!(LpColBound bound)
Invert the bound with delta == 0.
Formula make_disjunction(const std::vector< Formula > &formulas)
Make disjunction of formulas.