8 #include "common_types.hh"
11 enum class Order { LT, EQ, GT };
13 inline bool toBool(Order odr) {
return odr == Order::EQ; }
17 enum class Order { lt, le, ge, gt };
23 bool satisfy(
double d)
const {
36 using Interpretation = std::vector<double>;
37 ::Order operator()(Interpretation val)
const {
38 if (satisfy(val.at(x))) {
40 }
else if (odr == Order::lt || odr == Order::le) {
48 static inline std::ostream &operator<<(std::ostream &os,
49 const Constraint::Order &odr) {
51 case Constraint::Order::lt:
54 case Constraint::Order::le:
57 case Constraint::Order::ge:
60 case Constraint::Order::gt:
67 static inline std::ostream &operator<<(std::ostream &os,
const Constraint &p) {
68 os <<
"x" << int(p.x) <<
" " << p.odr <<
" " << p.c;
79 return Constraint{x, Constraint::Order::lt, c};
82 return Constraint{x, Constraint::Order::le, c};
85 return Constraint{x, Constraint::Order::gt, c};
88 return Constraint{x, Constraint::Order::ge, c};
95 static inline void widen(std::vector<Constraint> &guard) {
96 guard.erase(std::remove_if(guard.begin(), guard.end(),
98 return g.odr == Constraint::Order::ge ||
99 g.odr == Constraint::Order::gt;
Definition: constraint.hh:73
A constraint in a guard of transitions.
Definition: constraint.hh:16