CBMC
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
interval_constraint.cpp
Go to the documentation of this file.
1/*******************************************************************\
2
3Module: Interval constraint
4
5Author: Jeannie Moulton
6
7\*******************************************************************/
8
10#include "arith_tools.h"
11
13{
14 // expr >= lower_bound && expr <= upper_bound
15 return and_exprt(
17 expr, ID_ge, from_integer(interval.lower, expr.type())),
19 expr, ID_le, from_integer(interval.upper, expr.type())));
20}
constant_exprt from_integer(const mp_integer &int_value, const typet &type)
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
Definition ai.h:562
Boolean AND.
Definition std_expr.h:2125
A base class for relations, i.e., binary predicates whose two operands have the same type.
Definition std_expr.h:762
Base class for all expressions.
Definition expr.h:56
typet & type()
Return the type of the expression.
Definition expr.h:84
exprt interval_constraint(const exprt &expr, const integer_intervalt &interval)
Given an exprt and an integer interval return an exprt that represents restricting the expression to ...