Skip to content

Commit be859fb

Browse files
committed
BDDs require a namespace - pass one to guardt's or operator
1 parent 8b0f13c commit be859fb

File tree

5 files changed

+12
-13
lines changed

5 files changed

+12
-13
lines changed

src/goto-symex/goto_symex_state.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,7 @@ bool goto_symex_statet::l2_thread_read_encoding(
679679
// that implies the current one
680680
return false;
681681

682-
write_guard|=*it;
682+
write_guard.logical_or(*it, ns);
683683
}
684684
}
685685

@@ -704,7 +704,7 @@ bool goto_symex_statet::l2_thread_read_encoding(
704704
// that implies the current one
705705
return false;
706706

707-
read_guard|=*it;
707+
read_guard.logical_or(*it, ns);
708708
}
709709

710710
exprt cond=read_guard.as_expr();

src/goto-symex/symex_atomic_section.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ void goto_symext::symex_atomic_end(statet &state)
7676
it=++(r_it->second.second.begin());
7777
it!=r_it->second.second.end();
7878
++it)
79-
read_guard|=*it;
79+
read_guard.logical_or(*it, ns);
8080
exprt read_guard_expr=read_guard.as_expr();
8181
do_simplify(read_guard_expr);
8282

@@ -102,7 +102,7 @@ void goto_symext::symex_atomic_end(statet &state)
102102
it=++(w_it->second.begin());
103103
it!=w_it->second.end();
104104
++it)
105-
write_guard|=*it;
105+
write_guard.logical_or(*it, ns);
106106
exprt write_guard_expr=write_guard.as_expr();
107107
do_simplify(write_guard_expr);
108108

src/goto-symex/symex_goto.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ void goto_symext::merge_gotos(statet &state)
244244
merge_value_sets(goto_state, state);
245245

246246
// adjust guard
247-
state.guard|=goto_state.guard;
247+
state.guard.logical_or(goto_state.guard, ns);
248248

249249
// adjust depth
250250
state.depth=std::min(state.depth, goto_state.depth);

src/util/guard.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ Author: Daniel Kroening, [email protected]
1212

1313
#include "std_expr.h"
1414
#include "simplify_utils.h"
15-
#include "symbol_table.h"
1615
#include "namespace.h"
1716
#include "guard.h"
1817

@@ -169,7 +168,7 @@ guardt &operator -= (guardt &g1, const guardt &g2)
169168

170169
/*******************************************************************\
171170
172-
Function: operator |=
171+
Function: guardt::logical_or
173172
174173
Inputs:
175174
@@ -179,8 +178,10 @@ Function: operator |=
179178
180179
\*******************************************************************/
181180

182-
guardt &operator |= (guardt &g1, const guardt &g2)
181+
guardt& guardt::logical_or(const guardt &g2, const namespacet &ns)
183182
{
183+
guardt &g1=*this;
184+
184185
if(g2.is_false() || g1.is_true()) return g1;
185186
if(g1.is_false() || g2.is_true()) { g1=g2; return g1; }
186187

@@ -194,8 +195,6 @@ guardt &operator |= (guardt &g1, const guardt &g2)
194195
else
195196
g1=or_exprt(g1, g2);
196197

197-
symbol_tablet symbol_table;
198-
namespacet ns(symbol_table);
199198
bdd_exprt t(ns);
200199
t.from_expr(g1);
201200
g1=t.as_expr();
@@ -257,8 +256,6 @@ guardt &operator |= (guardt &g1, const guardt &g2)
257256
{
258257
g1.add(or_exprt(and_expr1, and_expr2));
259258

260-
symbol_tablet symbol_table;
261-
namespacet ns(symbol_table);
262259
bdd_exprt t(ns);
263260
t.from_expr(g1);
264261
g1=t.as_expr();

src/util/guard.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ Author: Daniel Kroening, [email protected]
1313

1414
#include "expr.h"
1515

16+
class namespacet;
17+
1618
class guardt:public exprt
1719
{
1820
public:
@@ -58,7 +60,7 @@ class guardt:public exprt
5860
#endif
5961

6062
friend guardt &operator -= (guardt &g1, const guardt &g2);
61-
friend guardt &operator |= (guardt &g1, const guardt &g2);
63+
guardt& logical_or(const guardt &g2, const namespacet &ns);
6264

6365
#if 0
6466
void swap(guardt &g)

0 commit comments

Comments
 (0)