cprover
Toggle main menu visibility
Loading...
Searching...
No Matches
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
15
#include "
partial_order_concurrency.h
"
16
17
class
memory_model_baset
:
public
partial_order_concurrencyt
18
{
19
public
:
20
explicit
memory_model_baset
(
const
namespacet
&_ns);
21
virtual
~memory_model_baset
();
22
23
virtual
void
operator()
(
symex_target_equationt
&,
message_handlert
&) = 0;
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
;
39
choice_symbolst
choice_symbols
;
40
45
void
read_from
(
symex_target_equationt
&equation);
46
54
symbol_exprt
register_read_from_choice_symbol
(
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
memory_model_baset::~memory_model_baset
virtual ~memory_model_baset()
Definition
memory_model.cpp:21
memory_model_baset::nondet_bool_symbol
symbol_exprt nondet_bool_symbol(const std::string &prefix)
Definition
memory_model.cpp:25
memory_model_baset::po
bool po(event_it e1, event_it e2)
In-thread program order.
Definition
memory_model.cpp:31
memory_model_baset::operator()
virtual void operator()(symex_target_equationt &, message_handlert &)=0
memory_model_baset::register_read_from_choice_symbol
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....
Definition
memory_model.cpp:83
memory_model_baset::var_cnt
unsigned var_cnt
Definition
memory_model.h:33
memory_model_baset::memory_model_baset
memory_model_baset(const namespacet &_ns)
Definition
memory_model.cpp:16
memory_model_baset::read_from
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...
Definition
memory_model.cpp:43
memory_model_baset::choice_symbolst
std::map< std::pair< event_it, event_it >, symbol_exprt > choice_symbolst
Definition
memory_model.h:38
memory_model_baset::choice_symbols
choice_symbolst choice_symbols
Definition
memory_model.h:39
memory_model_baset::per_thread_mapt
std::map< unsigned, event_listt > per_thread_mapt
Definition
memory_model.h:60
message_handlert
Definition
message.h:27
namespacet
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
Definition
namespace.h:91
partial_order_concurrencyt::partial_order_concurrencyt
partial_order_concurrencyt(const namespacet &_ns)
Definition
partial_order_concurrency.cpp:18
partial_order_concurrencyt::event_it
eventst::const_iterator event_it
Definition
partial_order_concurrency.h:28
symbol_exprt
Expression to hold a symbol (variable).
Definition
std_expr.h:132
symex_target_equationt
Inheriting the interface of symex_targett this class represents the SSA form of the input program as ...
Definition
symex_target_equation.h:34
r
static int8_t r
Definition
irep_hash.h:60
partial_order_concurrency.h
Add constraints to equation encoding partial orders on events.
goto-symex
memory_model.h
Generated by
1.17.0