Skip to content

Commit fd41b5e

Browse files
committed
Rename assigns to assigns_clause
This is to prepare an upcoming change that will rename "modifies" to "assigns."
1 parent d0c403a commit fd41b5e

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

src/goto-instrument/contracts/contracts.cpp

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -150,21 +150,21 @@ void code_contractst::check_apply_loop_contracts(
150150
loop_end = t;
151151

152152
// check for assigns, invariant, and decreases clauses
153-
auto assigns = static_cast<const exprt &>(
153+
auto assigns_clause = static_cast<const exprt &>(
154154
loop_end->get_condition().find(ID_C_spec_assigns));
155155
auto invariant = static_cast<const exprt &>(
156156
loop_end->get_condition().find(ID_C_spec_loop_invariant));
157157
auto decreases_clause = static_cast<const exprt &>(
158158
loop_end->get_condition().find(ID_C_spec_decreases));
159159

160160
assigns_clauset loop_assigns(
161-
assigns.operands(), log, ns, function_name, symbol_table);
161+
assigns_clause.operands(), log, ns, function_name, symbol_table);
162162

163163
loop_assigns.add_static_locals_to_write_set(goto_functions, function_name);
164164

165165
if(invariant.is_nil())
166166
{
167-
if(decreases_clause.is_nil() && assigns.is_nil())
167+
if(decreases_clause.is_nil() && assigns_clause.is_nil())
168168
return;
169169
else
170170
{
@@ -254,7 +254,7 @@ void code_contractst::check_apply_loop_contracts(
254254

255255
// havoc the variables that may be modified
256256
modifiest modifies;
257-
if(assigns.is_nil())
257+
if(assigns_clause.is_nil())
258258
{
259259
try
260260
{
@@ -271,7 +271,8 @@ void code_contractst::check_apply_loop_contracts(
271271
}
272272
else
273273
{
274-
modifies.insert(assigns.operands().cbegin(), assigns.operands().cend());
274+
modifies.insert(
275+
assigns_clause.operands().cbegin(), assigns_clause.operands().cend());
275276

276277
// Create snapshots of write set CARs.
277278
// This must be done before havocing the write set.
@@ -293,7 +294,7 @@ void code_contractst::check_apply_loop_contracts(
293294

294295
// Add the havocing code, but only check against the enclosing scope's
295296
// write set if it was manually specified.
296-
if(assigns.is_nil())
297+
if(assigns_clause.is_nil())
297298
insert_before_swap_and_advance(
298299
goto_function.body,
299300
loop_head,
@@ -624,7 +625,7 @@ bool code_contractst::apply_function_contract(
624625
const auto &type = to_code_with_contract_type(function_symbol.type);
625626

626627
// Isolate each component of the contract.
627-
auto assigns = type.assigns();
628+
auto assigns_clause = type.assigns();
628629
auto requires = conjunction(type.requires());
629630
auto ensures = conjunction(type.ensures());
630631

@@ -740,15 +741,15 @@ bool code_contractst::apply_function_contract(
740741
// ASSIGNS clause should not refer to any quantified variables,
741742
// and only refer to the common symbols to be replaced.
742743
exprt targets;
743-
for(auto &target : assigns)
744+
for(auto &target : assigns_clause)
744745
targets.add_to_operands(std::move(target));
745746
common_replace(targets);
746747

747748
// Create a sequence of non-deterministic assignments...
748749
goto_programt havoc_instructions;
749750

750751
// ...for assigns clause targets
751-
if(!assigns.empty())
752+
if(!assigns_clause.empty())
752753
{
753754
assigns_clauset assigns_clause(
754755
targets.operands(), log, ns, target_function, symbol_table);

0 commit comments

Comments
 (0)