Skip to content

Commit a9b4514

Browse files
Label properties before using property slicer
The labelling must happen after assertions are introduced (goto_check, cover, etc), but not relabelled after using the property slicer; otherwise the argument to the "property" option would be invalid.
1 parent 7f8d909 commit a9b4514

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

src/cbmc/cbmc_parse_options.cpp

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -456,8 +456,6 @@ int cbmc_parse_optionst::doit()
456456
if(get_goto_program_ret!=-1)
457457
return get_goto_program_ret;
458458

459-
label_properties(goto_functions);
460-
461459
if(cmdline.isset("show-claims") || // will go away
462460
cmdline.isset("show-properties")) // use this one
463461
{
@@ -801,13 +799,6 @@ bool cbmc_parse_optionst::process_goto_program(
801799
status() << "Generic Property Instrumentation" << eom;
802800
goto_check(ns, options, goto_functions);
803801

804-
// full slice?
805-
if(cmdline.isset("full-slice"))
806-
{
807-
status() << "Performing a full slice" << eom;
808-
full_slicer(goto_functions, ns);
809-
}
810-
811802
// checks don't know about adjusted float expressions
812803
adjust_float_expressions(goto_functions, ns);
813804

@@ -857,6 +848,23 @@ bool cbmc_parse_optionst::process_goto_program(
857848
return true;
858849
}
859850

851+
// label the assertions
852+
// This must be done after adding assertions and
853+
// before using the argument of the "property" option.
854+
// Do not re-label after using the property slicer because
855+
// this would cause the property identifiers to change.
856+
label_properties(goto_functions);
857+
858+
// full slice?
859+
if(cmdline.isset("full-slice"))
860+
{
861+
status() << "Performing a full slice" << eom;
862+
if(cmdline.isset("property"))
863+
property_slicer(goto_functions, ns, cmdline.get_values("property"));
864+
else
865+
full_slicer(goto_functions, ns);
866+
}
867+
860868
// remove skips
861869
remove_skip(goto_functions);
862870
goto_functions.update();

0 commit comments

Comments
 (0)