1/*******************************************************************\
3Module: Memory model for partial order concurrency
5Author: Michael Tautschnig, michael.tautschnig@cs.ox.ac.uk
7\*******************************************************************/
34 if(
e1->source.thread_nr ==
e2->source.thread_nr)
38 // in general un-ordered, with exception of thread-spawning
45 // We iterate over all the reads, and
46 // make them match at least one
47 // (internal or external) write.
56 // this is quadratic in #events per address
59 // rf cannot contradict program order
67 // uninitialised global symbol like symex_dynamic::dynamic_object*
71 // Add the read's guard, each of the writes' guards is implied
72 // by each entry in rf_some
93 bool is_rfi =
w->source.thread_nr ==
r->source.thread_nr;
94 // Uses only the write's guard as precondition, read's guard
95 // follows from rf_some
98 // We rely on the fact that there is at least
99 // one write event that has guard 'true'.
106 // if r reads from w, then w must have happened before r
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
Boolean AND All operands must be boolean, and the result is always boolean.
std::vector< exprt > operandst
virtual ~memory_model_baset()
symbol_exprt nondet_bool_symbol(const std::string &prefix)
bool po(event_it e1, event_it e2)
In-thread program order.
symbol_exprt register_read_from_choice_symbol(const event_it &r, const event_it &w, symex_target_equationt &equation)
Introduce a new choice symbol s for the pair (r, w) add constraint s => (w.guard /\ r....
memory_model_baset(const namespacet &_ns)
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
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
Base class for implementing memory models via additional constraints for SSA equations.
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...
irep_idt address(event_it event) const
Produce an address ID for an event.
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 ...
Memory models for partial order concurrency.
exprt disjunction(const exprt::operandst &op)
1) generates a disjunction for two or more operands 2) for one operand, returns the operand 3) return...
API to expression classes.