CBMC
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
guard_bdd.h
Go to the documentation of this file.
1/*******************************************************************\
2
3Module: Guard Data Structure
4
5Author: Romain Brenguier, romain.brenguier@diffblue.com
6
7\*******************************************************************/
8
12
13#ifndef CPROVER_ANALYSES_GUARD_BDD_H
14#define CPROVER_ANALYSES_GUARD_BDD_H
15
16#include <solvers/bdd/bdd.h> // IWYU pragma: keep
17
18class bdd_exprt;
19class exprt;
20
22{
23public:
25 guard_bddt(const guard_bddt &other) : manager(other.manager), bdd(other.bdd)
26 {
27 }
28
29 guard_bddt &operator=(const guard_bddt &other);
31 guard_bddt &add(const exprt &expr);
33 exprt as_expr() const;
34
38 static constexpr bool is_always_simplified = true;
39
42 exprt guard_expr(exprt expr) const;
43
44 bool is_true() const
45 {
46 return bdd.is_true();
47 }
48
49 bool is_false() const
50 {
51 return bdd.is_false();
52 }
53
57
59
61 {
62 return guard_bddt(manager, bdd.bdd_not());
63 }
64
68 {
69 return true;
70 }
71
72private:
75
80};
81
82#endif // CPROVER_ANALYSES_GUARD_BDD_H
Choice between the different interface to BDD libraries.
static exprt guard(const exprt::operandst &guards, exprt cond)
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
Definition ai.h:562
Conversion between exprt and bbdt This encapsulate a bdd_managert, thus BDDs created with this class ...
Definition bdd_expr.h:34
Logical operations on BDDs.
Definition bdd_cudd.h:78
bddt bdd_not() const
Definition bdd_cudd.h:95
bool is_true() const
Definition bdd_cudd.h:85
bool is_false() const
Definition bdd_cudd.h:90
Base class for all expressions.
Definition expr.h:56
guard_bddt operator!() const
Definition guard_bdd.h:60
bool is_true() const
Definition guard_bdd.h:44
bool disjunction_may_simplify(const guard_bddt &other_guard)
Returns true if operator|= with other_guard may result in a simpler expression.
Definition guard_bdd.h:67
guard_bddt(const guard_bddt &other)
Definition guard_bdd.h:25
exprt as_expr() const
Definition guard_bdd.cpp:82
guard_bddt & add(const exprt &expr)
Definition guard_bdd.cpp:64
static constexpr bool is_always_simplified
BDDs are always in a simplified form and thus no further simplification is required after calls to as...
Definition guard_bdd.h:38
friend guard_bddt & operator|=(guard_bddt &g1, const guard_bddt &g2)
Definition guard_bdd.cpp:76
guard_bddt & append(const guard_bddt &guard)
Definition guard_bdd.cpp:58
friend guard_bddt & operator-=(guard_bddt &g1, const guard_bddt &g2)
Transforms g1 into g1' such that ‘g1’ & g2 => g1 => g1'` and returns a reference to g1.
Definition guard_bdd.cpp:70
guard_bddt(bdd_exprt &manager, bddt bdd)
Definition guard_bdd.h:76
exprt guard_expr(exprt expr) const
Return guard => dest or a simplified variant thereof if either guard or dest are trivial.
Definition guard_bdd.cpp:38
bool is_false() const
Definition guard_bdd.h:49
bdd_exprt & manager
Definition guard_bdd.h:73
guard_bddt & operator=(const guard_bddt &other)
Definition guard_bdd.cpp:24
STL namespace.