Skip to content

Commit

Permalink
Add 27-inv_invariants/22-mine-tutorial-ex4.4 as test
Browse files Browse the repository at this point in the history
  • Loading branch information
sim642 committed Nov 8, 2024
1 parent 06e0554 commit 065f990
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions tests/regression/27-inv_invariants/22-mine-tutorial-ex4.4.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// PARAM: --enable ana.int.interval
#include <goblint.h>
int main() {
int x, y, z;
__goblint_assume(0 <= x);
__goblint_assume(x <= 10);
__goblint_assume(5 <= y);
__goblint_assume(y <= 15);
__goblint_assume(-10 <= z);
__goblint_assume(z <= 10);

if (x >= y) {
__goblint_check(5 <= x);
__goblint_check(y <= 10); // why doesn't Miné refine this?
}

if (z >= x) {
__goblint_check(0 <= z);
}

if (x >= y && z >= x) { // CIL transform does branches sequentially (good order)
__goblint_check(5 <= x);
__goblint_check(y <= 10); // why doesn't Miné refine this?
__goblint_check(0 <= z);

__goblint_check(5 <= z);
}

if (z >= x && x >= y) { // CIL transform does branches sequentially (bad order)
__goblint_check(5 <= x);
__goblint_check(y <= 10); // why doesn't Miné refine this?
__goblint_check(0 <= z);

__goblint_check(5 <= z); // TODO
}

return 0;
}

0 comments on commit 065f990

Please sign in to comment.