CBMC
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boolbv_abs.cpp
Go to the documentation of this file.
1/*******************************************************************\
2
3Module:
4
5Author: Daniel Kroening, kroening@kroening.com
6
7\*******************************************************************/
8
9#include "boolbv.h"
10
11#include "boolbv_type.h"
12
14
16
18{
19 const bvt &op_bv=convert_bv(expr.op());
20
21 if(expr.op().type()!=expr.type())
22 return conversion_failed(expr);
23
24 const bvtypet bvtype = get_bvtype(expr.type());
25
29 {
31 }
33 {
35 return float_utils.abs(op_bv);
36 }
37
38 return conversion_failed(expr);
39}
Pre-defined bitvector types.
const floatbv_typet & to_floatbv_type(const typet &type)
Cast a typet to a floatbv_typet.
bvtypet get_bvtype(const typet &type)
bvtypet
Definition boolbv_type.h:17
Absolute value.
Definition std_expr.h:442
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
Definition ai.h:562
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
bv_utilst bv_utils
Definition boolbv.h:118
bvt conversion_failed(const exprt &expr)
Print that the expression of x has failed conversion, then return a vector of x's width.
Definition boolbv.cpp:94
virtual bvt convert_abs(const abs_exprt &expr)
bvt absolute_value(const bvt &op)
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