Skip to content

Commit a0646ec

Browse files
committed
Improves description of code_contractst methods
Signed-off-by: Felipe R. Monteiro <felisous@amazon.com>
1 parent 3a1b249 commit a0646ec

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/goto-instrument/contracts/contracts.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,17 +185,24 @@ class code_contractst
185185
const exprt &lhs,
186186
std::vector<exprt> &aliasable_references);
187187

188+
/// Apply loop contracts, whenever available, to all loops in `function`.
189+
/// Loop invariants, loop variants, and loop assigns clauses.
188190
void apply_loop_contract(
189191
const irep_idt &function,
190192
goto_functionst::goto_functiont &goto_function);
191193

192194
/// \brief Does the named function have a contract?
193195
bool has_contract(const irep_idt);
194196

197+
/// Replaces function calls with assertions based on requires clauses,
198+
/// non-deterministic assignments for the write set, and assumptions
199+
/// based on ensures clauses.
195200
bool apply_function_contract(
196201
goto_programt &goto_program,
197202
goto_programt::targett target);
198203

204+
/// Instruments `wrapper_function` adding assumptions based on requires
205+
/// clauses and assertions based on ensures clauses.
199206
void add_contract_check(
200207
const irep_idt &wrapper_function,
201208
const irep_idt &mangled_function,

0 commit comments

Comments
 (0)