41 PRECONDITION(e1->is_shared_read() || e1->is_shared_write());
42 PRECONDITION(e2->is_shared_read() || e2->is_shared_write());
53 for(eventst::const_iterator
59 if(!e_it->is_shared_read() &&
60 !e_it->is_shared_write() &&
62 !e_it->is_memory_barrier())
continue;
64 dest[e_it->source.thread_nr].push_back(e_it);
76 for(eventst::const_iterator
83 per_thread_mapt::const_iterator next_thread=
85 if(next_thread==per_thread_map.end())
90 for(event_listt::const_iterator
91 n_it=next_thread->second.begin();
92 n_it!=next_thread->second.end();
95 if(!(*n_it)->is_memory_barrier())
109 const per_thread_mapt &per_thread_map)
115 for(eventst::const_iterator
122 per_thread_mapt::const_iterator next_thread=
124 if(next_thread==per_thread_map.end())
132 event_listt::const_iterator n_it=next_thread->second.begin();
134 n_it!=next_thread->second.end() &&
135 (*n_it)->is_memory_barrier();
140 if(n_it!=next_thread->second.end())
161 for(per_thread_mapt::const_iterator
162 t_it=per_thread_map.begin();
163 t_it!=per_thread_map.end();
172 for(event_listt::const_iterator
177 if((*e_it)->is_memory_barrier())
201 for(address_mapt::const_iterator
206 const a_rect &a_rec=a_it->second;
211 for(event_listt::const_iterator
212 w_it1=a_rec.
writes.begin();
213 w_it1!=a_rec.
writes.end();
216 event_listt::const_iterator next=w_it1;
219 for(event_listt::const_iterator w_it2=next;
220 w_it2!=a_rec.
writes.end();
224 if((*w_it1)->source.thread_nr==
225 (*w_it2)->source.thread_nr)
254 for(address_mapt::const_iterator
259 const a_rect &a_rec=a_it->second;
262 for(event_listt::const_iterator
263 w_prime=a_rec.
writes.begin();
264 w_prime!=a_rec.
writes.end();
267 event_listt::const_iterator next=w_prime;
270 for(event_listt::const_iterator w=next;
276 if(
po(*w_prime, *w) &&
282 else if(
po(*w, *w_prime) &&
295 for(choice_symbolst::const_iterator
301 exprt rf=c_it->second;
305 if(c_it->first.second==*w_prime && !ws1.
is_false())
317 else if(c_it->first.second==*w && !ws2.
is_false())
326 and_exprt(
r->guard, (*w_prime)->guard, ws2, rf),
332 cond,
"fr",
r->source);
Base class for all expressions.
bool is_false() const
Return whether the expression is a constant representing false.
The Boolean constant false.
symbol_exprt nondet_bool_symbol(const std::string &prefix)
bool po(event_it e1, event_it e2)
In-thread program order.
void read_from(symex_target_equationt &equation)
For each read r from every address we collect the choice symbols S via register_read_from_choice_symb...
choice_symbolst choice_symbols
std::map< unsigned, event_listt > per_thread_mapt
virtual void operator()(symex_target_equationt &equation, message_handlert &)
void build_per_thread_map(const symex_target_equationt &equation, per_thread_mapt &dest) const
void from_read(symex_target_equationt &equation)
virtual bool program_order_is_relaxed(partial_order_concurrencyt::event_it e1, partial_order_concurrencyt::event_it e2) const
void program_order(symex_target_equationt &equation)
void thread_spawn(symex_target_equationt &equation, const per_thread_mapt &per_thread_map)
void write_serialization_external(symex_target_equationt &equation)
virtual exprt before(event_it e1, event_it e2)
Class that provides messages with a built-in verbosity 'level'.
std::vector< event_it > event_listt
void build_event_lists(symex_target_equationt &equation, message_handlert &message_handler)
First call add_init_writes then for each shared read/write (or spawn) populate: 1) the address_map (w...
exprt before(event_it e1, event_it e2, unsigned axioms)
Build the partial order constraint for two events: if e1 and e2 are in the same atomic section then c...
void build_clock_type()
Initialize the clock_type so that it can be used to number events.
void add_constraint(symex_target_equationt &equation, const exprt &cond, const std::string &msg, const symex_targett::sourcet &source) const
Simplify and add a constraint to equation.
eventst::const_iterator event_it
Expression to hold a symbol (variable)
Inheriting the interface of symex_targett this class represents the SSA form of the input program as ...
The Boolean constant true.
const std::string next_thread_id
Memory models for partial order concurrency.
#define PRECONDITION(CONDITION)
API to expression classes.