CBMC
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boolbv_bitreverse.cpp
Go to the documentation of this file.
1/*******************************************************************\
2
3Module:
4
5Author: Michael Tautschnig
6
7\*******************************************************************/
8
10
11#include "boolbv.h"
12
13#include <algorithm>
14
16{
17 const std::size_t width = boolbv_width(expr.type());
18
19 bvt bv = convert_bv(expr.op(), width);
20
21 std::reverse(bv.begin(), bv.end());
22
23 return bv;
24}
API to expression classes for bitvectors.
Reverse the order of bits in a bit-vector.
virtual const bvt & convert_bv(const exprt &expr, const std::optional< std::size_t > expected_width={})
Convert expression to vector of literalts, using an internal cache to speed up conversion if availabl...
Definition boolbv.cpp:39
virtual std::size_t boolbv_width(const typet &type) const
Definition boolbv.h:103
virtual bvt convert_bitreverse(const bitreverse_exprt &expr)
typet & type()
Return the type of the expression.
Definition expr.h:84
const exprt & op() const
Definition std_expr.h:391
std::vector< literalt > bvt
Definition literal.h:201