Skip to content

Commit

Permalink
Test file fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
keyboardDrummer committed Oct 2, 2024
1 parent 064b44a commit a7ce5e0
Show file tree
Hide file tree
Showing 15 changed files with 151 additions and 170 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
// RUN: %parallel-boogie /printSplit:%t "%s" > "%t"
// RUN: %boogie /printSplit:- "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
// RUN: %diff %S/Foo.split.0.bpl.expect %t-Foo-0.spl
// RUN: %diff %S/Foo.split.1.bpl.expect %t-Foo-1.spl
// RUN: %diff %S/Foo.split.2.bpl.expect %t-Foo-2.spl

procedure Foo()
{
Expand Down
36 changes: 36 additions & 0 deletions Test/implementationDivision/split/AssumeFalseSplit.bpl.expect
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
implementation Foo/split@4()
{

anon3_Then:
assert 2 == 1 + 1;
assume false;
return;
}


implementation Foo/split@11()
{

anon3_Else:
assume 2 == 1 + 1;
assert {:split_here} 2 == 2;
assume 3 == 2 + 1;
assume 1 == 1;
goto ;
}


implementation Foo/split@12()
{

anon3_Else:
assume 2 == 1 + 1;
assume 2 == 2;
assert {:split_here} 3 == 2 + 1;
assert 1 == 1;
goto ;
}



Boogie program verifier finished with 1 verified, 0 errors
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
// RUN: %parallel-boogie /printSplit:%t "%s" > "%t"
// RUN: %boogie /printSplit:- "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
// RUN: %diff %S/Foo.split.0.bpl.expect %t-Foo-0.spl
// RUN: %diff %S/Foo.split.1.bpl.expect %t-Foo-1.spl
// RUN: %diff %S/Foo.split.2.bpl.expect %t-Foo-2.spl
// RUN: %diff %S/Foo.split.3.bpl.expect %t-Foo-3.spl

procedure Foo() returns (y: int)
ensures y >= 0;
Expand Down
112 changes: 112 additions & 0 deletions Test/implementationDivision/split/Split.bpl.expect
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
implementation Foo/split@4() returns (y: int)
{

anon0:
assert 5 + 0 == 5;
assert 5 * 5 <= 25;
assume x#AT#0 + y#AT#0 == 5;
assume x#AT#0 * x#AT#0 <= 25;
assume {:partition} 0 >= x#AT#0;
assume y#AT#2 == y#AT#0;
assert y#AT#2 >= 0;
return;
}


implementation Foo/split@15() returns (y: int)
{

anon0:
assume 5 + 0 == 5;
assume 5 * 5 <= 25;
assume x#AT#0 + y#AT#0 == 5;
assume x#AT#0 * x#AT#0 <= 25;
assume {:partition} x#AT#0 > 0;
assume x#AT#1 == x#AT#0 - 1;
assert {:split_here} (x#AT#1 + y#AT#0) * (x#AT#1 + y#AT#0) > 25;
assume y#AT#1 == y#AT#0 + 1;
assume {:partition} x#AT#1 < 3;
assert 2 < 2;
assume y#AT#1 * y#AT#1 > 4;
goto ;
}


implementation Foo/split@19() returns (y: int)
{

anon0:
assume 5 + 0 == 5;
assume 5 * 5 <= 25;
assume x#AT#0 + y#AT#0 == 5;
assume x#AT#0 * x#AT#0 <= 25;
assume {:partition} x#AT#0 > 0;
assume x#AT#1 == x#AT#0 - 1;
assume (x#AT#1 + y#AT#0) * (x#AT#1 + y#AT#0) > 25;
assume y#AT#1 == y#AT#0 + 1;
assume {:partition} x#AT#1 < 3;
assume 2 < 2;
assert {:split_here} y#AT#1 * y#AT#1 > 4;
goto ;
}


implementation Foo/split@22() returns (y: int)
{

anon0:
assume 5 + 0 == 5;
assume 5 * 5 <= 25;
assume x#AT#0 + y#AT#0 == 5;
assume x#AT#0 * x#AT#0 <= 25;
assume {:partition} x#AT#0 > 0;
assume x#AT#1 == x#AT#0 - 1;
assume (x#AT#1 + y#AT#0) * (x#AT#1 + y#AT#0) > 25;
assume y#AT#1 == y#AT#0 + 1;
assume {:partition} 3 <= x#AT#1;
assert {:split_here} y#AT#1 * y#AT#1 * y#AT#1 < 8;
assert 2 < 2;
goto ;
}


implementation Foo/split@25() returns (y: int)
{

anon0:
assume 5 + 0 == 5;
assume 5 * 5 <= 25;
assume x#AT#0 + y#AT#0 == 5;
assume x#AT#0 * x#AT#0 <= 25;
assume {:partition} x#AT#0 > 0;
assume x#AT#1 == x#AT#0 - 1;
assume (x#AT#1 + y#AT#0) * (x#AT#1 + y#AT#0) > 25;
assume y#AT#1 == y#AT#0 + 1;
goto anon6_Then, anon6_Else;

anon6_Then:
assume {:partition} x#AT#1 < 3;
assume 2 < 2;
assume y#AT#1 * y#AT#1 > 4;
goto anon4;

anon6_Else:
assume {:partition} 3 <= x#AT#1;
assume y#AT#1 * y#AT#1 * y#AT#1 < 8;
assume 2 < 2;
goto anon4;

anon4:
assert {:split_here} (x#AT#1 + y#AT#1) * (x#AT#1 + y#AT#1) == 25;
assert x#AT#1 + y#AT#1 == 5;
assert x#AT#1 * x#AT#1 <= 25;
assume false;
return;
}


Split.bpl(15,5): Error: this assertion could not be proved
Execution trace:
Split.bpl(8,5): anon0

Boogie program verifier finished with 0 verified, 1 error

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion Test/pruning/MonomorphicSplit.bpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// RUN: %parallel-boogie /prune:1 /errorTrace:0 /printSplit:"%t" /printSplitDeclarations "%s" > "%t"
// RUN: %OutputCheck "%s" --file-to-check="%t-monomorphicSplit--1.spl"
// RUN: %OutputCheck "%s" --file-to-check="%t-monomorphicSplit.spl"

// The following checks are a bit simplistic, but this is
// on purpose to reduce brittleness. We assume there would now be two uses clauses
Expand Down

0 comments on commit a7ce5e0

Please sign in to comment.