cprover
Toggle main menu visibility
Loading...
Searching...
No Matches
struct_encoding.h
Go to the documentation of this file.
1
// Author: Diffblue Ltd.
2
3
#ifndef CPROVER_SOLVERS_SMT2_INCREMENTAL_STRUCT_ENCODING_H
4
#define CPROVER_SOLVERS_SMT2_INCREMENTAL_STRUCT_ENCODING_H
5
6
#include <
util/expr.h
>
// For passing exprt by value. // IWYU pragma: keep
7
#include <
util/type.h
>
// For passing `typet` by value. // IWYU pragma: keep
8
9
#include <memory>
10
11
class
namespacet
;
12
class
boolbv_widtht
;
13
class
member_exprt
;
14
class
struct_tag_typet
;
15
class
union_tag_typet
;
16
18
class
struct_encodingt
final
19
{
20
public
:
21
explicit
struct_encodingt
(
const
namespacet
&
ns
);
22
struct_encodingt
(
const
struct_encodingt
&other);
23
~struct_encodingt
();
24
25
typet
encode
(
typet
type)
const
;
26
exprt
encode
(
exprt
expr)
const
;
29
exprt
30
decode
(
const
exprt
&encoded,
const
struct_tag_typet
&original_type)
const
;
31
exprt
32
decode
(
const
exprt
&encoded,
const
union_tag_typet
&original_type)
const
;
33
34
private
:
35
std::unique_ptr<boolbv_widtht>
boolbv_width
;
36
std::reference_wrapper<const namespacet>
ns
;
37
38
exprt
encode_member
(
const
member_exprt
&member_expr)
const
;
39
};
40
41
#endif
// CPROVER_SOLVERS_SMT2_INCREMENTAL_STRUCT_ENCODING_H
boolbv_widtht
Definition
boolbv_width.h:19
exprt
Base class for all expressions.
Definition
expr.h:57
member_exprt
Extract member of struct or union.
Definition
std_expr.h:2856
namespacet
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
Definition
namespace.h:91
struct_encodingt::boolbv_width
std::unique_ptr< boolbv_widtht > boolbv_width
Definition
struct_encoding.h:35
struct_encodingt::ns
std::reference_wrapper< const namespacet > ns
Definition
struct_encoding.h:36
struct_encodingt::encode
typet encode(typet type) const
Definition
struct_encoding.cpp:47
struct_encodingt::decode
exprt decode(const exprt &encoded, const struct_tag_typet &original_type) const
Reconstructs a struct expression of the original_type using the data from the bit vector encoded expr...
Definition
struct_encoding.cpp:229
struct_encodingt::~struct_encodingt
~struct_encodingt()
struct_encodingt::encode_member
exprt encode_member(const member_exprt &member_expr) const
The member expression selects the value of a field from a struct or union.
Definition
struct_encoding.cpp:167
struct_encodingt::struct_encodingt
struct_encodingt(const namespacet &ns)
Definition
struct_encoding.cpp:21
struct_tag_typet
A struct tag type, i.e., struct_typet with an identifier.
Definition
std_types.h:493
typet
The type of an expression, extends irept.
Definition
type.h:29
union_tag_typet
A union tag type, i.e., union_typet with an identifier.
Definition
c_types.h:199
expr.h
type.h
Defines typet, type_with_subtypet and type_with_subtypest.
solvers
smt2_incremental
encoding
struct_encoding.h
Generated by
1.17.0