CBMC
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
dfcc_wrapper_program.cpp File Reference
+ Include dependency graph for dfcc_wrapper_program.cpp:

Go to the source code of this file.

Functions

static symbol_exprt create_contract_write_set (symbol_table_baset &symbol_table, dfcc_libraryt &library, const symbolt &wrapper_symbol)
 Generate the contract write set.
 
static symbol_exprt create_addr_of_contract_write_set (symbol_table_baset &symbol_table, dfcc_libraryt &library, const symbolt &wrapper_symbol)
 Generate the contract write set pointer.
 
static symbol_exprt create_requires_write_set (symbol_table_baset &symbol_table, dfcc_libraryt &library, const symbolt &wrapper_symbol)
 
static symbol_exprt create_addr_of_requires_write_set (symbol_table_baset &symbol_table, dfcc_libraryt &library, const symbolt &wrapper_symbol)
 Generate the write set pointer to check side effects in requires clauses.
 
static symbol_exprt create_ensures_write_set (symbol_table_baset &symbol_table, dfcc_libraryt &library, const symbolt &wrapper_symbol)
 Generate the write set to check side effects in ensures clauses.
 
static symbol_exprt create_addr_of_ensures_write_set (symbol_table_baset &symbol_table, dfcc_libraryt &library, const symbolt &wrapper_symbol)
 Generate the write set pointer to check side effects in ensures clauses.
 
static symbol_exprt create_ptr_pred_ctx (symbol_table_baset &symbol_table, dfcc_libraryt &library, const symbolt &wrapper_symbol)
 Generate object set used to support is_fresh predicates.
 
static symbol_exprt create_addr_of_ptr_pred_ctx (symbol_table_baset &symbol_table, dfcc_libraryt &library, const symbolt &wrapper_symbol)
 Generate object set pointer used to support is_fresh predicates.
 
void disable_may_fail_rec (exprt &expr, bool no_fail)
 Recursively traverses expression, adding "no_fail" attributes to pointer predicates that we know cannot fail when invoked in an assume context: Starting from the root with "no_fail" true, we recurse over the boolean structure, setting the "no_fail" false for all but the last operand disjunctive operators like || and ==>, and distributing the current "no_fail" status over disjunctions.
 
void disable_may_fail (exprt &expr)
 

Function Documentation

◆ create_addr_of_contract_write_set()

static symbol_exprt create_addr_of_contract_write_set ( symbol_table_baset symbol_table,
dfcc_libraryt library,
const symbolt wrapper_symbol 
)
static

Generate the contract write set pointer.

Definition at line 49 of file dfcc_wrapper_program.cpp.

◆ create_addr_of_ensures_write_set()

static symbol_exprt create_addr_of_ensures_write_set ( symbol_table_baset symbol_table,
dfcc_libraryt library,
const symbolt wrapper_symbol 
)
static

Generate the write set pointer to check side effects in ensures clauses.

Definition at line 105 of file dfcc_wrapper_program.cpp.

◆ create_addr_of_ptr_pred_ctx()

static symbol_exprt create_addr_of_ptr_pred_ctx ( symbol_table_baset symbol_table,
dfcc_libraryt library,
const symbolt wrapper_symbol 
)
static

Generate object set pointer used to support is_fresh predicates.

Definition at line 133 of file dfcc_wrapper_program.cpp.

◆ create_addr_of_requires_write_set()

static symbol_exprt create_addr_of_requires_write_set ( symbol_table_baset symbol_table,
dfcc_libraryt library,
const symbolt wrapper_symbol 
)
static

Generate the write set pointer to check side effects in requires clauses.

Definition at line 77 of file dfcc_wrapper_program.cpp.

◆ create_contract_write_set()

static symbol_exprt create_contract_write_set ( symbol_table_baset symbol_table,
dfcc_libraryt library,
const symbolt wrapper_symbol 
)
static

Generate the contract write set.

Definition at line 35 of file dfcc_wrapper_program.cpp.

◆ create_ensures_write_set()

static symbol_exprt create_ensures_write_set ( symbol_table_baset symbol_table,
dfcc_libraryt library,
const symbolt wrapper_symbol 
)
static

Generate the write set to check side effects in ensures clauses.

Definition at line 91 of file dfcc_wrapper_program.cpp.

◆ create_ptr_pred_ctx()

static symbol_exprt create_ptr_pred_ctx ( symbol_table_baset symbol_table,
dfcc_libraryt library,
const symbolt wrapper_symbol 
)
static

Generate object set used to support is_fresh predicates.

Definition at line 119 of file dfcc_wrapper_program.cpp.

◆ create_requires_write_set()

static symbol_exprt create_requires_write_set ( symbol_table_baset symbol_table,
dfcc_libraryt library,
const symbolt wrapper_symbol 
)
static

Definition at line 63 of file dfcc_wrapper_program.cpp.

◆ disable_may_fail()

void disable_may_fail ( exprt expr)

Definition at line 631 of file dfcc_wrapper_program.cpp.

◆ disable_may_fail_rec()

void disable_may_fail_rec ( exprt expr,
bool  no_fail 
)

Recursively traverses expression, adding "no_fail" attributes to pointer predicates that we know cannot fail when invoked in an assume context: Starting from the root with "no_fail" true, we recurse over the boolean structure, setting the "no_fail" false for all but the last operand disjunctive operators like || and ==>, and distributing the current "no_fail" status over disjunctions.

For instance:

(len > 0):no_fail=false ==> is_fresh(p, len):no_fail=true
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
Definition ai.h:562
static int8_t r
Definition irep_hash.h:60
(
(
(len>0):no_fail=true ==> is_fresh(r, len):no_fail=true
)
)
Parameters
exprThe expression to traverse
no_failThe current no_fail value based on logical context

Definition at line 572 of file dfcc_wrapper_program.cpp.