diff options
author | MichalMoskal <unknown> | 2010-12-17 00:33:23 +0000 |
---|---|---|
committer | MichalMoskal <unknown> | 2010-12-17 00:33:23 +0000 |
commit | 5b6a6e266c32f211c9f1ceff1d9605592b2016dd (patch) | |
tree | 92cbb7d5189293a0a421e3273cbb0ff7f39ae13a /Test/test2/SelectiveChecking.bpl | |
parent | 12c28b0c769090a4d444cd31d7e871f707dd06a1 (diff) |
Add new feature: {:selective_checking} on procedures. See testcase for a description (it was implemented in VCC before and is quite useful).
Diffstat (limited to 'Test/test2/SelectiveChecking.bpl')
-rw-r--r-- | Test/test2/SelectiveChecking.bpl | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/Test/test2/SelectiveChecking.bpl b/Test/test2/SelectiveChecking.bpl new file mode 100644 index 00000000..2f08618a --- /dev/null +++ b/Test/test2/SelectiveChecking.bpl @@ -0,0 +1,49 @@ +/* +In functions marked with {:selective_checking} all asserts are turned into assumes, +except for the ones reachable from the commands marked with {:start_checking_here}. +Thus, "assume {:start_checking_here} whatever;" is an inverse of "assume false;". +The first one disables all verification before it, and the second one disables +all verification after. +*/ + +procedure {:selective_checking} foo() +{ + var x, y, z : int; + + assert x < y; + assert y < z; + assume {:start_checking_here} true; + assert x < z; +} + +procedure {:selective_checking} foo_fail1() +{ + var x, y, z : int; + + assert x < y; + assume {:start_checking_here} true; + assert x < z; +} + +procedure {:selective_checking} foo_fail2() +{ + var x, y, z : int; + + assert x < y; + + if (*) { + assume {:start_checking_here} true; + } + + assert x < z; +} + +procedure foo_no_selch() +{ + var x, y, z : int; + + assert x < y; + assume {:start_checking_here} true; + assert x < z; +} + |