cprover
Toggle main menu visibility
Loading...
Searching...
No Matches
mathematical_types.cpp
Go to the documentation of this file.
1
/*******************************************************************\
2
3
Module: Mathematical types
4
5
Author: 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
19
bool
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
27
constant_exprt
integer_typet::zero_expr
()
const
28
{
29
return
constant_exprt
{ID_0, *
this
};
30
}
31
32
constant_exprt
integer_typet::one_expr
()
const
33
{
34
return
constant_exprt
{ID_1, *
this
};
35
}
36
37
constant_exprt
natural_typet::zero_expr
()
const
38
{
39
return
constant_exprt
{ID_0, *
this
};
40
}
41
42
constant_exprt
natural_typet::one_expr
()
const
43
{
44
return
constant_exprt
{ID_1, *
this
};
45
}
46
47
constant_exprt
rational_typet::zero_expr
()
const
48
{
49
return
constant_exprt
{ID_0, *
this
};
50
}
51
52
constant_exprt
rational_typet::one_expr
()
const
53
{
54
return
constant_exprt
{ID_1, *
this
};
55
}
56
57
constant_exprt
real_typet::zero_expr
()
const
58
{
59
return
constant_exprt
{ID_0, *
this
};
60
}
61
62
constant_exprt
real_typet::one_expr
()
const
63
{
64
return
constant_exprt
{ID_1, *
this
};
65
}
constant_exprt
A constant literal expression.
Definition
std_expr.h:2997
integer_typet::one_expr
constant_exprt one_expr() const
Definition
mathematical_types.cpp:32
integer_typet::zero_expr
constant_exprt zero_expr() const
Definition
mathematical_types.cpp:27
irept::id
const irep_idt & id() const
Definition
irep.h:388
natural_typet::zero_expr
constant_exprt zero_expr() const
Definition
mathematical_types.cpp:37
natural_typet::one_expr
constant_exprt one_expr() const
Definition
mathematical_types.cpp:42
rational_typet::zero_expr
constant_exprt zero_expr() const
Definition
mathematical_types.cpp:47
rational_typet::one_expr
constant_exprt one_expr() const
Definition
mathematical_types.cpp:52
real_typet::zero_expr
constant_exprt zero_expr() const
Definition
mathematical_types.cpp:57
real_typet::one_expr
constant_exprt one_expr() const
Definition
mathematical_types.cpp:62
typet
The type of an expression, extends irept.
Definition
type.h:29
is_number
bool is_number(const typet &type)
Returns true if the type is a rational, real, integer, natural, complex, unsignedbv,...
Definition
mathematical_types.cpp:19
mathematical_types.h
Mathematical types.
std_expr.h
API to expression classes.
irep_idt
dstringt irep_idt
Definition
verification_result.h:16
util
mathematical_types.cpp
Generated by
1.17.0