Skip to content

Commit 319a06c

Browse files
author
Thomas Kiley
authored
Merge pull request #5334 from thk123/make-min-unwind-consistent-with-unwind
Make min unwind consistent with unwind
2 parents 873daa9 + 293d469 commit 319a06c

File tree

5 files changed

+35
-2
lines changed

5 files changed

+35
-2
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
CORE
2+
main.c
3+
--ignore-properties-before-unwind-min --incremental-loop main.0 --unwind-max 2 --unwind-min 0
4+
^EXIT=10$
5+
^SIGNAL=0$
6+
^\[main.assertion.\d+\] line \d+ property: FAILURE$
7+
^VERIFICATION FAILED$
8+
--
9+
^warning: ignoring
10+
--
11+
This test correctly fails because the first iteration of the loop violates the
12+
property.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
CORE
2+
main.c
3+
--ignore-properties-before-unwind-min --incremental-loop main.0 --unwind-max 2 --unwind-min 1
4+
^EXIT=10$
5+
^SIGNAL=0$
6+
^\[main.assertion.\d+\] line \d+ property: FAILURE$
7+
^VERIFICATION FAILED$
8+
--
9+
^warning: ignoring
10+
--
11+
This test correctly fails because the first iteration of the loop violates the
12+
property.

regression/cbmc-incr-oneloop/ignore-before-unwind/skip_first_unwind.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
main.c
3-
--ignore-properties-before-unwind-min --incremental-loop main.0 --unwind-max 2 --unwind-min 1
3+
--ignore-properties-before-unwind-min --incremental-loop main.0 --unwind-max 2 --unwind-min 2
44
^EXIT=0$
55
^SIGNAL=0$
66
^VERIFICATION SUCCESSFUL$

src/goto-checker/bmc_util.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,11 @@ void run_property_decider(
221221
" of loop L\n" \
222222
" (use --show-loops to get the loop IDs)\n" \
223223
" --unwind-min nr start incremental-loop after nr unwindings\n" \
224+
" but before solving that iteration. If for\n" \
225+
" example it is 1, then the loop will be\n" \
226+
" unwound once, and immediately checked.\n" \
227+
" Note: this means for min-unwind 1 or\n"\
228+
" 0 all properties are checked.\n" \
224229
" --unwind-max nr stop incremental-loop after nr unwindings\n" \
225230
" --ignore-properties-before-unwind-min\n" \
226231
" do not check properties before unwind-min\n" \

src/goto-checker/symex_bmc_incremental_one_loop.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,12 @@ symex_bmc_incremental_one_loopt::symex_bmc_incremental_one_loopt(
3737
: 0),
3838
output_ui(output_ui)
3939
{
40+
// the intended behaviour is to stop asserts that are violated before the
41+
// unwind
42+
// therefore if the min-unwind is 1, then we do one unwind and immediately
43+
// start checking for properties
4044
ignore_assertions =
41-
incr_min_unwind >= 1 &&
45+
incr_min_unwind > 1 &&
4246
options.get_bool_option("ignore-properties-before-unwind-min");
4347
}
4448

0 commit comments

Comments
 (0)