cprover
Toggle main menu visibility
Loading...
Searching...
No Matches
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
13
class
nondet_padding_exprt
;
14
void
validate_expr
(
const
nondet_padding_exprt
&padding);
15
20
class
nondet_padding_exprt
:
public
expr_protectedt
21
{
22
public
:
23
static
const
irep_idt
ID_nondet_padding
;
24
25
explicit
nondet_padding_exprt
(
typet
type
)
26
:
expr_protectedt
{
ID_nondet_padding
,
std
::move(
type
)}
27
{
28
validate_expr
(*
this
);
29
}
30
};
31
32
template
<>
33
inline
bool
can_cast_expr<nondet_padding_exprt>
(
const
exprt
&base)
34
{
35
return
base.
id
() ==
nondet_padding_exprt::ID_nondet_padding
;
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
bitvector_types.h
Pre-defined bitvector types.
expr_protectedt::expr_protectedt
expr_protectedt(irep_idt _id, typet _type)
Definition
expr.h:353
exprt
Base class for all expressions.
Definition
expr.h:57
exprt::type
typet & type()
Return the type of the expression.
Definition
expr.h:85
irept::id
const irep_idt & id() const
Definition
irep.h:388
nondet_padding_exprt
This expression serves as a placeholder for the bits which have non deterministic value in a larger b...
Definition
nondet_padding.h:21
nondet_padding_exprt::nondet_padding_exprt
nondet_padding_exprt(typet type)
Definition
nondet_padding.h:25
nondet_padding_exprt::ID_nondet_padding
static const irep_idt ID_nondet_padding
Definition
nondet_padding.h:23
typet
The type of an expression, extends irept.
Definition
type.h:29
expr.h
can_cast_type
bool can_cast_type(const typet &base)
Check whether a reference to a generic typet is of a specific derived class.
std
STL namespace.
can_cast_expr< nondet_padding_exprt >
bool can_cast_expr< nondet_padding_exprt >(const exprt &base)
Definition
nondet_padding.h:33
validate_expr
void validate_expr(const nondet_padding_exprt &padding)
Definition
nondet_padding.h:38
invariant.h
INVARIANT
#define INVARIANT(CONDITION, REASON)
This macro uses the wrapper function 'invariant_violated_string'.
Definition
invariant.h:423
irep_idt
dstringt irep_idt
Definition
verification_result.h:16
solvers
smt2_incremental
encoding
nondet_padding.h
Generated by
1.17.0