CBMC
nondet_padding.h
Go to the documentation of this file.
1 // Author: Diffblue Ltd.
2 
5 
6 #ifndef CPROVER_SOLVERS_SMT2_INCREMENTAL_ENCODING_NONDET_PADDING_H
7 #define CPROVER_SOLVERS_SMT2_INCREMENTAL_ENCODING_NONDET_PADDING_H
8 
9 #include <util/bitvector_types.h>
10 #include <util/expr.h>
11 #include <util/invariant.h>
12 
14 void validate_expr(const nondet_padding_exprt &padding);
15 
21 {
22 public:
24 
27  {
28  validate_expr(*this);
29  }
30 };
31 
32 template <>
34 {
36 }
37 
38 inline void validate_expr(const nondet_padding_exprt &padding)
39 {
40  INVARIANT(
41  can_cast_type<bv_typet>(padding.type()),
42  "Nondet padding is expected to pad a bit vector type.");
43 }
44 
45 #endif // CPROVER_SOLVERS_SMT2_INCREMENTAL_ENCODING_NONDET_PADDING_H
Pre-defined bitvector types.
bool can_cast_type< bv_typet >(const typet &type)
Check whether a reference to a typet is a bv_typet.
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Definition: dstring.h:38
Base class for all expressions.
Definition: expr.h:344
Base class for all expressions.
Definition: expr.h:56
typet & type()
Return the type of the expression.
Definition: expr.h:84
const irep_idt & id() const
Definition: irep.h:384
This expression serves as a placeholder for the bits which have non deterministic value in a larger b...
nondet_padding_exprt(typet type)
static const irep_idt ID_nondet_padding
The type of an expression, extends irept.
Definition: type.h:29
bool can_cast_expr< nondet_padding_exprt >(const exprt &base)
void validate_expr(const nondet_padding_exprt &padding)
#define INVARIANT(CONDITION, REASON)
This macro uses the wrapper function 'invariant_violated_string'.
Definition: invariant.h:423