Skip to content

Commit bbabb1f

Browse files
Add is_always_simplified field in guard implementations
Expressions obtained from BDDs are already simple. Trying to simplify them is redundant and can slow down the execution. We add this field so that symex code can take the decision to simplify or not an expression based on this information.
1 parent cfa7274 commit bbabb1f

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/analyses/guard_bdd.h

+5
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ class guard_bddt
3535
guard_bddt &append(const guard_bddt &guard);
3636
exprt as_expr() const;
3737

38+
/// BDDs are always in a simplified form and thus no further simplification
39+
/// is required after calls to \ref as_expr().
40+
/// This can vary according to the guard implementation.
41+
static constexpr bool is_always_simplified = true;
42+
3843
/// Assign dest to `guard => dest` unless guard or dest are trivial.
3944
void guard_expr(exprt &dest) const;
4045

src/analyses/guard_expr.h

+5
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ class guard_exprt
5050
return expr;
5151
}
5252

53+
/// The result of \ref as_expr is not always in a simplified form
54+
/// and may requires some simplification.
55+
/// This can vary according to the guard implementation.
56+
static constexpr bool is_always_simplified = false;
57+
5358
void guard_expr(exprt &dest) const;
5459

5560
bool is_true() const

0 commit comments

Comments
 (0)