Go to the documentation of this file.
27 interval_union.intervals.emplace_back(std::move(interval));
28 return interval_union;
36 interval_union.intervals.emplace_back(std::move(interval));
37 return interval_union;
52 if(it1->upper < it2->upper)
87 result.intervals.push_back(*it1);
95 result.intervals.push_back(*it2);
98 else if(it1->lower <= it2->lower)
100 result.intervals.push_back(*it1);
105 result.intervals.push_back(*it2);
111 intervalt &back = result.intervals.back();
116 "intervals should be processed in order");
118 (it1 ==
intervals.end() || it1->lower_set) &&
119 (it2 == other.
intervals.end() || it2->lower_set),
120 "intervals unbounded to the left should have been processed in prelude");
126 else if(it2 != other.
intervals.end() && it2->lower <= back.
upper + 1)
133 (it2 == other.
intervals.end() || it1->lower <= it2->lower))
135 result.intervals.push_back(*it1);
140 result.intervals.push_back(*it2);
176 std::ostringstream output;
193 std::vector<exprt> conjuncts;
196 conjuncts.emplace_back(binary_relation_exprt{
197 e, ID_ge, from_integer(interval.lower, e.type())});
201 conjuncts.emplace_back(binary_relation_exprt{
202 e, ID_le, from_integer(interval.upper, e.type())});
212 result.
intervals.emplace_back(std::move(interval));
219 const std::regex limits_regex(
"\\[(-\\d+|\\d*):(-\\d+|\\d*)\\]");
221 for(
const std::string &interval_string :
split_string(to_parse,
','))
223 std::smatch base_match;
224 if(!std::regex_match(interval_string, base_match, limits_regex))
227 if(!base_match[1].str().empty())
229 if(!base_match[2].str().empty())
231 if(!interval.
empty())
247 return interval.
lower;
void make_ge_than(const T &v)
static optionalt< interval_uniont > of_string(const std::string &to_parse)
Parse a string which is a comma , separated list of intervals of the form "[lower1:upper1]",...
exprt conjunction(const exprt::operandst &op)
1) generates a conjunction for two or more operands 2) for one operand, returns the operand 3) return...
interval_uniont make_union(const interval_uniont &other) const
Return a new interval_uniontt object representing the set of intergers in the union of this object an...
static bool strictly_below(const interval_templatet< mp_integer > &a, const interval_templatet< mp_integer > &b)
Check that interval a is strictly below interval b.
const mp_integer string2integer(const std::string &n, unsigned base)
static interval_uniont of_interval(intervalt interval)
Construct interval union from a single interval.
Base class for all expressions.
static interval_uniont greater_or_equal(const mp_integer &value)
Construct interval_uniont object representing the set of integers that are greater or equal to value.
static interval_uniont all_integers()
Set of all integers.
bool validate() const
Check that intervals are strictly ordered.
exprt make_contains_expr(const exprt &e) const
Expression which is true exactly when e belongs to the set.
void approx_union_with(const interval_templatet &i)
void split_string(const std::string &s, char delim, std::vector< std::string > &result, bool strip, bool remove_empty)
std::vector< intervalt > intervals
Non-overlapping intervals stored in order of their lower bound, so that each interval is strictly bel...
exprt disjunction(const exprt::operandst &op)
1) generates a disjunction for two or more operands 2) for one operand, returns the operand 3) return...
optionalt< mp_integer > minimum() const
empty optional means either unbounded on the left or empty, is_empty has to be called to distinguish ...
void intersection(const typename graph_nodet< E >::edgest &a, const typename graph_nodet< E >::edgest &b, typename graph_nodet< E >::edgest &dest)
Compute intersection of two edge sets, in linear time.
nonstd::optional< T > optionalt
interval_uniont make_intersection(const interval_uniont &other) const
Return a new interval_uniontt object representing the set of intergers in the intersection of this ob...
std::string to_string() const
Convert the set to a string representing a sequence of intervals, each interval being of the form "[l...
optionalt< mp_integer > as_singleton() const
If the set contains only one element, return the value of this element.
optionalt< mp_integer > maximum() const
empty optional means either unbounded on the right or empty, is_empty has to be called to distinguish...
void make_le_than(const T &v)
static interval_uniont smaller_or_equal(const mp_integer &value)
Construct interval_uniont object representing the set of integers that are greater or equal to value.
ranget< iteratort > make_range(iteratort begin, iteratort end)
Represents a set of integers by a union of intervals, which are stored in increasing order for effici...