Go to the source code of this file.
◆ count_trailing_bit_width()
◆ empty_encoding()
static exprt empty_encoding |
( |
| ) |
|
|
static |
Empty structs and unions are encoded as a zero byte.
This has useful properties such as -
- A zero byte is valid SMT, unlike zero length bit vectors.
- Any two zero byte instances are always equal. This property would not be true of two instances of a non-det byte for instance.
Definition at line 129 of file struct_encoding.cpp.
◆ encode() [1/3]
Structs are flattened into a large bit vector using concatenation to express all the member operands of struct_expr
.
Definition at line 137 of file struct_encoding.cpp.
◆ encode() [2/3]
◆ encode() [3/3]
◆ extricate_updates()
Extracts the component/field names and new values from a with_exprt
which expresses a new struct value where one or more members of a struct have had their values substituted with new values.
- Note
- This is implemented using direct access to the operands and other underlying irept interfaces, because the interface for
with_exprt
only supports a single where
/ new_value
pair and does not support extracting the name from the where
operand.
Definition at line 82 of file struct_encoding.cpp.
◆ needs_width()
static std::optional<std::size_t> needs_width |
( |
const typet & |
type, |
|
|
const boolbv_widtht & |
boolbv_width |
|
) |
| |
|
static |
If the given type
needs re-encoding as a bit-vector then this function.
- Returns
- the width of the new bitvector type. The width calculation is delegated to
boolbv_width
.
Definition at line 38 of file struct_encoding.cpp.