cprover
Loading...
Searching...
No Matches
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
28{
29 return constant_exprt{ID_0, *this};
30}
31
33{
34 return constant_exprt{ID_1, *this};
35}
36
38{
39 return constant_exprt{ID_0, *this};
40}
41
43{
44 return constant_exprt{ID_1, *this};
45}
46
48{
49 return constant_exprt{ID_0, *this};
50}
51
53{
54 return constant_exprt{ID_1, *this};
55}
56
58{
59 return constant_exprt{ID_0, *this};
60}
61
63{
64 return constant_exprt{ID_1, *this};
65}
A constant literal expression.
Definition std_expr.h:3118
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.
dstringt irep_idt