Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Remy Willems committed Nov 9, 2021
1 parent 67af2e0 commit 524772c
Show file tree
Hide file tree
Showing 10 changed files with 63 additions and 62 deletions.
10 changes: 1 addition & 9 deletions Test/test0/Prune.bpl → Test/pruning/Automatic.bpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %parallel-boogie /pruneFunctionsAndAxioms "%s" > "%t"
// RUN: %parallel-boogie /prune:1 /errorTrace:0 "%s" > "%t"
// RUN: %diff "%s.expect" "%t"

function {:exclude_dep} f1 (x: int) : int;
Expand All @@ -24,14 +24,6 @@ procedure I1(x : int) returns (y: int)
// is thus removed from the outgoing set of I1.
// This makes the axiom on line 23 unreachable from I1, which is thus pruned away.
{
var i: int where false;

if (x > 0) {
havoc i; // mentioning i in this branch results in assuming false because of the where clause.
// Thus, the post-condition proves for this path.
} else {
assume {:focus} true; // i is not mentioned in this branch so the where clause is not assumed for it.
}
}

procedure I2(x : int) returns (y: int)
Expand Down
6 changes: 6 additions & 0 deletions Test/pruning/Automatic.bpl.expect
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Automatic.bpl(27,1): Error: A postcondition might not hold on this return path.
Automatic.bpl(23,3): Related location: This is the postcondition that might not hold.
Automatic.bpl(57,1): Error: A postcondition might not hold on this return path.
Automatic.bpl(55,3): Related location: This is the postcondition that might not hold.

Boogie program verifier finished with 1 verified, 2 errors
File renamed without changes.
6 changes: 6 additions & 0 deletions Test/pruning/Basic.bpl.expect
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Basic.bpl(29,1): Error: A postcondition might not hold on this return path.
Basic.bpl(25,3): Related location: This is the postcondition that might not hold.
Basic.bpl(29,1): Error: A postcondition might not hold on this return path.
Basic.bpl(26,3): Related location: This is the postcondition that might not hold.

Boogie program verifier finished with 1 verified, 2 errors
47 changes: 47 additions & 0 deletions Test/pruning/Focus.bpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// RUN: %parallel-boogie /vcsDumpSplits /errorTrace:0 "%s" > "%t"
// RUN: mv %/S/Ex.split* %/S/Output/
// RUN: %diff "%s.expect" "%t"
// RUN: %diff ./Output/Ex.split.0.bpl ./Output/Ex.split.0.bpl
// RUN: %diff ./Output/Ex.split.1.bpl ./Output/Ex.split.1.bpl
// RUN: %diff ./Output/Ex.split.2.bpl ./Output/Ex.split.2.bpl
// RUN: %diff ./Output/Ex.split.3.bpl ./Output/Ex.split.3.bpl
// RUN: %diff ./Output/Ex.split.4.bpl ./Output/Ex.split.4.bpl
// RUN: %diff ./Output/Ex.split.5.bpl ./Output/Ex.split.5.bpl

procedure Ex() returns (y: int)
ensures y >= 0;
{
var x: int;
x := 5;
y := 0;
while (x > 0)
invariant x + y == 5;
invariant x*x <= 25;
{
x := x - 1;
assert {:split_here} (x+y) * (x+y) > 16; // should not lead to more than one split.
assert {:focus} (x+y) * (x+y) > 25;
y := y + 1;
if (x < 3) {
assert 2 < 2;
assert {:focus} y*y > 4;
}
else {
assert 2 < 2;
}
assert {:focus} (x+y) * (x+y) == 25;
}
}

procedure focusInconsistency(x : int) returns (y: int)
ensures false;
{
var i: int where false;

if (x > 0) {
havoc i; // mentioning i in this branch results in assuming false because of the where clause.
// Thus, the post-condition proves for this path.
} else {
assume {:focus} true; // i is not mentioned in this branch so the where clause is not assumed for it.
}
}
3 changes: 3 additions & 0 deletions Test/pruning/Focus.bpl.expect
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Focus.bpl(22,5): Error: This assertion might not hold.

Boogie program verifier finished with 1 verified, 1 error
2 changes: 0 additions & 2 deletions Test/pruning/basic.bpl.expect

This file was deleted.

33 changes: 0 additions & 33 deletions Test/test0/Focus.bpl

This file was deleted.

7 changes: 0 additions & 7 deletions Test/test0/Focus.bpl.expect

This file was deleted.

11 changes: 0 additions & 11 deletions Test/test0/Prune.bpl.expect

This file was deleted.

0 comments on commit 524772c

Please sign in to comment.