CBMC
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
mathematical_types.cpp
Go to the documentation of this file.
1/*******************************************************************\
2
3Module: Mathematical types
4
5Author: Daniel Kroening, kroening@kroening.com
6 Maria Svorenova, maria.svorenova@diffblue.com
7
8\*******************************************************************/
9
12
13#include "mathematical_types.h"
14
15#include "std_expr.h"
16
19bool is_number(const typet &type)
20{
21 const irep_idt &id = type.id();
22 return id == ID_rational || id == ID_real || id == ID_integer ||
23 id == ID_natural || id == ID_complex || id == ID_unsignedbv ||
24 id == ID_signedbv || id == ID_floatbv || id == ID_fixedbv;
25}
26
31
33{
34 return constant_exprt{ID_1, *this};
35}
36
41
43{
44 return constant_exprt{ID_1, *this};
45}
46
51
56
58{
59 return constant_exprt{ID_0, *this};
60}
61
63{
64 return constant_exprt{ID_1, *this};
65}
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
Definition ai.h:562
A constant literal expression.
Definition std_expr.h:3117
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Definition dstring.h:38
constant_exprt one_expr() const
constant_exprt zero_expr() const
const irep_idt & id() const
Definition irep.h:388
constant_exprt zero_expr() const
constant_exprt one_expr() const
constant_exprt zero_expr() const
constant_exprt one_expr() const
constant_exprt zero_expr() const
constant_exprt one_expr() const
The type of an expression, extends irept.
Definition type.h:29
bool is_number(const typet &type)
Returns true if the type is a rational, real, integer, natural, complex, unsignedbv,...
Mathematical types.
API to expression classes.