CBMC
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
memory_model.h
Go to the documentation of this file.
1/*******************************************************************\
2
3Module: Memory models for partial order concurrency
4
5Author: 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{
19public:
20 explicit memory_model_baset(const namespacet &_ns);
21 virtual ~memory_model_baset();
22
24
25protected:
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
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
Definition ai.h:562
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....
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
choice_symbolst choice_symbols
std::map< unsigned, event_listt > per_thread_mapt
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
Definition namespace.h:91
Base class for implementing memory models via additional constraints for SSA equations.
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.