CBMC
boolbv_map.h
Go to the documentation of this file.
1
/*******************************************************************\
2
3
Module:
4
5
Author: Daniel Kroening, kroening@kroening.com
6
7
\*******************************************************************/
8
9
10
#ifndef CPROVER_SOLVERS_FLATTENING_BOOLBV_MAP_H
11
#define CPROVER_SOLVERS_FLATTENING_BOOLBV_MAP_H
12
13
#include <
util/type.h
>
14
15
#include <
solvers/prop/literal.h
>
16
17
#include <functional>
18
#include <iosfwd>
19
20
class
propt
;
21
22
class
boolbv_mapt
23
{
24
public
:
25
explicit
boolbv_mapt
(
propt
&_prop) :
prop
(_prop)
26
{
27
}
28
29
class
map_entryt
30
{
31
public
:
32
typet
type
;
33
bvt
literal_map
;
34
35
std::string
get_value
(
const
propt
&)
const
;
36
};
37
38
typedef
std::unordered_map<irep_idt, map_entryt>
mappingt
;
39
40
void
show
(std::ostream &out)
const
;
41
42
const
bvt
&
get_literals
(
43
const
irep_idt
&identifier,
44
const
typet
&type,
45
std::size_t width);
46
47
void
set_literals
(
48
const
irep_idt
&identifier,
49
const
typet
&type,
50
const
bvt
&literals);
51
52
void
erase_literals
(
53
const
irep_idt
&identifier,
54
const
typet
&type);
55
56
optionalt<std::reference_wrapper<const map_entryt>
>
57
get_map_entry
(
const
irep_idt
&identifier)
const
58
{
59
const
auto
entry =
mapping
.find(identifier);
60
if
(entry ==
mapping
.end())
61
return
{};
62
63
return
optionalt<std::reference_wrapper<const map_entryt>
>(entry->second);
64
}
65
66
const
mappingt
&
get_mapping
()
const
67
{
68
return
mapping
;
69
}
70
71
protected
:
72
mappingt
mapping
;
73
propt
&
prop
;
74
};
75
76
#endif // CPROVER_SOLVERS_FLATTENING_BOOLBV_MAP_H
dstringt
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Definition:
dstring.h:36
boolbv_mapt::erase_literals
void erase_literals(const irep_idt &identifier, const typet &type)
Definition:
boolbv_map.cpp:118
boolbv_mapt::get_mapping
const mappingt & get_mapping() const
Definition:
boolbv_map.h:66
boolbv_mapt::map_entryt::get_value
std::string get_value(const propt &) const
Definition:
boolbv_map.cpp:19
typet
The type of an expression, extends irept.
Definition:
type.h:28
boolbv_mapt::prop
propt & prop
Definition:
boolbv_map.h:73
bvt
std::vector< literalt > bvt
Definition:
literal.h:201
boolbv_mapt::get_literals
const bvt & get_literals(const irep_idt &identifier, const typet &type, std::size_t width)
Definition:
boolbv_map.cpp:41
boolbv_mapt::map_entryt::literal_map
bvt literal_map
Definition:
boolbv_map.h:33
type.h
boolbv_mapt::map_entryt
Definition:
boolbv_map.h:29
boolbv_mapt::mapping
mappingt mapping
Definition:
boolbv_map.h:72
boolbv_mapt::show
void show(std::ostream &out) const
Definition:
boolbv_map.cpp:35
boolbv_mapt::mappingt
std::unordered_map< irep_idt, map_entryt > mappingt
Definition:
boolbv_map.h:38
optionalt
nonstd::optional< T > optionalt
Definition:
optional.h:35
literal.h
boolbv_mapt::get_map_entry
optionalt< std::reference_wrapper< const map_entryt > > get_map_entry(const irep_idt &identifier) const
Definition:
boolbv_map.h:57
boolbv_mapt::map_entryt::type
typet type
Definition:
boolbv_map.h:32
boolbv_mapt::boolbv_mapt
boolbv_mapt(propt &_prop)
Definition:
boolbv_map.h:25
propt
TO_BE_DOCUMENTED.
Definition:
prop.h:22
boolbv_mapt
Definition:
boolbv_map.h:22
boolbv_mapt::set_literals
void set_literals(const irep_idt &identifier, const typet &type, const bvt &literals)
Definition:
boolbv_map.cpp:75
src
solvers
flattening
boolbv_map.h
Generated by
1.8.17