dReal4
formula_evaluator_cell.h
1 #pragma once
2 
3 #include <memory>
4 #include <ostream>
5 #include <vector>
6 
7 #include "dreal/solver/formula_evaluator.h"
8 #include "dreal/util/box.h"
9 
10 namespace dreal {
11 
12 /// Base type for evaluator cell types.
14  public:
15  explicit FormulaEvaluatorCell(Formula f);
16 
17  /// Deleted copy-constructor.
19 
20  /// Deleted move-constructor.
22 
23  /// Deleted copy-assignment operator.
25 
26  /// Deleted move-assignment operator.
28 
29  /// Default destructor.
30  virtual ~FormulaEvaluatorCell() = default;
31 
32  const Formula& formula() const { return f_; }
33 
34  /// Returns true if the based formula is a simple relational formula which is
35  /// in form of `constant relop variable` or `!(constant relop variable)`.
36  bool is_simple_relational() const { return is_simple_relational_; }
37 
38  /// Returns true if the based formula is a not-equal formula which is
39  /// in form of `e1 != e2` or `!(e1 == e2)`.
40  bool is_neq() const { return is_neq_; }
41 
42  /// Evaluates the constraint/formula with @p box.
43  virtual FormulaEvaluationResult operator()(const Box& box) const = 0;
44 
45  virtual const Variables& variables() const = 0;
46 
47  virtual std::ostream& Display(std::ostream& os) const = 0;
48 
49  private:
50  const Formula f_;
51  const bool is_simple_relational_{false};
52  const bool is_neq_{false};
53 };
54 
55 } // namespace dreal
Sum type of symbolic::Expression and symbolic::Formula.
Definition: api.cc:9
FormulaEvaluatorCell & operator=(const FormulaEvaluatorCell &)=delete
Deleted copy-assignment operator.
virtual ~FormulaEvaluatorCell()=default
Default destructor.
Base type for evaluator cell types.
Definition: formula_evaluator_cell.h:13
Represents the evaluation result of a constraint given a box.
Definition: formula_evaluator.h:14
bool is_simple_relational() const
Returns true if the based formula is a simple relational formula which is in form of constant relop v...
Definition: formula_evaluator_cell.h:36
Represents a n-dimensional interval vector.
Definition: box.h:17
Represents a set of variables.
Definition: symbolic_variables.h:25
virtual FormulaEvaluationResult operator()(const Box &box) const =0
Evaluates the constraint/formula with box.
Represents a symbolic form of a first-order logic formula.
Definition: symbolic_formula.h:101
bool is_neq() const
Returns true if the based formula is a not-equal formula which is in form of e1 != e2 or !(e1 == e2)...
Definition: formula_evaluator_cell.h:40