@@ -67,10 +67,6 @@ void memory_model_baset::read_from(symex_target_equationt &equation)
67
67
}
68
68
}
69
69
70
- // value equals the one of some write
71
-
72
- exprt rf_some = disjunction (rf_choice_symbols);
73
-
74
70
// uninitialised global symbol like symex_dynamic::dynamic_object*
75
71
// or *$object
76
72
if (!rf_choice_symbols.empty ())
@@ -79,7 +75,7 @@ void memory_model_baset::read_from(symex_target_equationt &equation)
79
75
// by each entry in rf_some
80
76
add_constraint (
81
77
equation,
82
- implies_exprt ( read_event->guard , rf_some) ,
78
+ implies_exprt{ read_event->guard , disjunction (rf_choice_symbols)} ,
83
79
" rf-some" ,
84
80
read_event->source );
85
81
}
@@ -98,23 +94,21 @@ symbol_exprt memory_model_baset::register_read_from_choice_symbol(
98
94
choice_symbols.emplace (std::make_pair (r, w), s);
99
95
100
96
bool is_rfi = w->source .thread_nr == r->source .thread_nr ;
101
- // We rely on the fact that there is at least
102
- // one write event that has guard 'true'.
103
- implies_exprt read_from (s,
104
- and_exprt (w->guard ,
105
- equal_exprt (r->ssa_lhs , w->ssa_lhs )));
106
-
107
97
// Uses only the write's guard as precondition, read's guard
108
98
// follows from rf_some
109
- add_constraint (equation,
110
- read_from, is_rfi?" rfi" :" rf" , r->source );
99
+ add_constraint (
100
+ equation,
101
+ // We rely on the fact that there is at least
102
+ // one write event that has guard 'true'.
103
+ implies_exprt{s, and_exprt{w->guard , equal_exprt{r->ssa_lhs , w->ssa_lhs }}},
104
+ is_rfi ? " rfi" : " rf" ,
105
+ r->source );
111
106
112
107
if (!is_rfi)
113
108
{
114
109
// if r reads from w, then w must have happened before r
115
- const implies_exprt cond (s, before (w, r));
116
- add_constraint (equation,
117
- cond, " rf-order" , r->source );
110
+ add_constraint (
111
+ equation, implies_exprt{s, before (w, r)}, " rf-order" , r->source );
118
112
}
119
113
120
114
return s;
0 commit comments