CBMC
memory_model.h
Go to the documentation of this file.
1 /*******************************************************************\
2 
3 Module: Memory models for partial order concurrency
4 
5 Author: Michael Tautschnig, michael.tautschnig@cs.ox.ac.uk
6 
7 \*******************************************************************/
8 
11 
12 #ifndef CPROVER_GOTO_SYMEX_MEMORY_MODEL_H
13 #define CPROVER_GOTO_SYMEX_MEMORY_MODEL_H
14 
16 
18 {
19 public:
20  explicit memory_model_baset(const namespacet &_ns);
21  virtual ~memory_model_baset();
22 
24 
25 protected:
30  bool po(event_it e1, event_it e2);
31 
32  // produce fresh symbols
33  unsigned var_cnt;
34  symbol_exprt nondet_bool_symbol(const std::string &prefix);
35 
36  // This gives us the choice symbol for an R-W pair;
37  // built by the method below.
38  typedef std::map<std::pair<event_it, event_it>, symbol_exprt> choice_symbolst;
40 
45  void read_from(symex_target_equationt &equation);
46 
55  const event_it &r,
56  const event_it &w,
57  symex_target_equationt &equation);
58 
59  // maps thread numbers to an event list
60  typedef std::map<unsigned, event_listt> per_thread_mapt;
61 };
62 
63 #endif // CPROVER_GOTO_SYMEX_MEMORY_MODEL_H
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.
virtual void operator()(symex_target_equationt &, message_handlert &)=0
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...
std::map< std::pair< event_it, event_it >, symbol_exprt > choice_symbolst
Definition: memory_model.h:38
choice_symbolst choice_symbols
Definition: memory_model.h:39
std::map< unsigned, event_listt > per_thread_mapt
Definition: memory_model.h:60
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
Definition: namespace.h:94
Base class for implementing memory models via additional constraints for SSA equations.
eventst::const_iterator event_it
Expression to hold a symbol (variable)
Definition: std_expr.h:131
Inheriting the interface of symex_targett this class represents the SSA form of the input program as ...
static int8_t r
Definition: irep_hash.h:60
Add constraints to equation encoding partial orders on events.