cprover
Toggle main menu visibility
Loading...
Searching...
No Matches
guard_bdd.h
Go to the documentation of this file.
1
/*******************************************************************\
2
3
Module: Guard Data Structure
4
5
Author: 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
18
class
bdd_exprt
;
19
class
exprt
;
20
21
class
guard_bddt
22
{
23
public
:
24
guard_bddt
(
const
exprt
&e,
bdd_exprt
&
manager
);
25
guard_bddt
(
const
guard_bddt
&other) :
manager
(other.
manager
),
bdd
(other.
bdd
)
26
{
27
}
28
29
guard_bddt
&
operator=
(
const
guard_bddt
&other);
30
guard_bddt
&
operator=
(
guard_bddt
&&other);
31
guard_bddt
&
add
(
const
exprt
&expr);
32
guard_bddt
&
append
(
const
guard_bddt
&
guard
);
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
56
friend
guard_bddt
&
operator-=
(
guard_bddt
&g1,
const
guard_bddt
&g2);
57
58
friend
guard_bddt
&
operator|=
(
guard_bddt
&g1,
const
guard_bddt
&g2);
59
60
guard_bddt
operator!
()
const
61
{
62
return
guard_bddt
(
manager
,
bdd
.bdd_not());
63
}
64
67
bool
disjunction_may_simplify
(
const
guard_bddt
&other_guard)
68
{
69
return
true
;
70
}
71
72
private
:
73
bdd_exprt
&
manager
;
74
bddt
bdd
;
75
76
guard_bddt
(
bdd_exprt
&
manager
,
bddt
bdd
)
77
:
manager
(
manager
),
bdd
(
std
::move(
bdd
))
78
{
79
}
80
};
81
82
#endif
// CPROVER_ANALYSES_GUARD_BDD_H
bdd.h
Choice between the different interface to BDD libraries.
guard
static exprt guard(const exprt::operandst &guards, exprt cond)
Definition
c_safety_checks.cpp:69
bdd_exprt
Conversion between exprt and bbdt This encapsulate a bdd_managert, thus BDDs created with this class ...
Definition
bdd_expr.h:34
bddt
Logical operations on BDDs.
Definition
bdd_cudd.h:78
exprt
Base class for all expressions.
Definition
expr.h:57
guard_bddt
Definition
guard_bdd.h:22
guard_bddt::operator!
guard_bddt operator!() const
Definition
guard_bdd.h:60
guard_bddt::is_true
bool is_true() const
Definition
guard_bdd.h:44
guard_bddt::disjunction_may_simplify
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::guard_bddt
guard_bddt(const guard_bddt &other)
Definition
guard_bdd.h:25
guard_bddt::as_expr
exprt as_expr() const
Definition
guard_bdd.cpp:82
guard_bddt::add
guard_bddt & add(const exprt &expr)
Definition
guard_bdd.cpp:64
guard_bddt::is_always_simplified
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
guard_bddt::operator|=
friend guard_bddt & operator|=(guard_bddt &g1, const guard_bddt &g2)
Definition
guard_bdd.cpp:76
guard_bddt::guard_bddt
guard_bddt(const exprt &e, bdd_exprt &manager)
Definition
guard_bdd.cpp:19
guard_bddt::append
guard_bddt & append(const guard_bddt &guard)
Definition
guard_bdd.cpp:58
guard_bddt::operator-=
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::guard_bddt
guard_bddt(bdd_exprt &manager, bddt bdd)
Definition
guard_bdd.h:76
guard_bddt::guard_expr
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
guard_bddt::bdd
bddt bdd
Definition
guard_bdd.h:74
guard_bddt::is_false
bool is_false() const
Definition
guard_bdd.h:49
guard_bddt::manager
bdd_exprt & manager
Definition
guard_bdd.h:73
guard_bddt::operator=
guard_bddt & operator=(const guard_bddt &other)
Definition
guard_bdd.cpp:24
std
STL namespace.
analyses
guard_bdd.h
Generated by
1.17.0