-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix problems with isolate each assertion and isolating jumps
- Loading branch information
1 parent
f01b081
commit e38b443
Showing
8 changed files
with
173 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#nullable enable | ||
using Microsoft.Boogie; | ||
|
||
namespace VCGeneration; | ||
|
||
public class ImplicitJump : TokenWrapper { | ||
public ImplicitJump(IToken inner) : base(inner) | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
Test/implementationDivision/isolateJump/isolateJumpAndSplitOnEveryAssert.bpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// RUN: %boogie /printSplit:- /errorTrace:0 "%s" > "%t" | ||
// RUN: %diff "%s.expect" "%t" | ||
|
||
procedure {:vcs_split_on_every_assert} MergeAtEnd(x: int) returns (r: int) | ||
ensures r > 1; | ||
{ | ||
if (x > 0) { | ||
r := 1; | ||
} | ||
else { | ||
r := 2; | ||
} | ||
} | ||
|
||
procedure {:vcs_split_on_every_assert} MultipleEnsures(x: int) returns (r: int) | ||
ensures r > 1; | ||
ensures r < 10; | ||
{ | ||
if (x > 0) { | ||
r := 1; | ||
return; | ||
} | ||
else { | ||
r := 20; | ||
return; | ||
} | ||
} |
100 changes: 100 additions & 0 deletions
100
Test/implementationDivision/isolateJump/isolateJumpAndSplitOnEveryAssert.bpl.expect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
implementation {:vcs_split_on_every_assert} MergeAtEnd/assert@5(x: int) returns (r: int) | ||
{ | ||
|
||
anon0: | ||
goto anon3_Then, anon3_Else; | ||
|
||
anon3_Then: | ||
assume {:partition} x > 0; | ||
assume r#AT#0 == 1; | ||
goto GeneratedUnifiedExit; | ||
|
||
anon3_Else: | ||
assume {:partition} 0 >= x; | ||
assume r#AT#0 == 2; | ||
goto GeneratedUnifiedExit; | ||
|
||
GeneratedUnifiedExit: | ||
assert r#AT#0 > 1; | ||
return; | ||
} | ||
|
||
|
||
isolateJumpAndSplitOnEveryAssert.bpl(9,3): Error: a postcondition could not be proved on this return path | ||
isolateJumpAndSplitOnEveryAssert.bpl(5,3): Related location: this is the postcondition that could not be proved | ||
implementation {:vcs_split_on_every_assert} MultipleEnsures/return@25/assert@16(x: int) returns (r: int) | ||
{ | ||
|
||
anon0: | ||
goto anon3_Else; | ||
|
||
anon3_Else: | ||
assume {:partition} 0 >= x; | ||
assume r#AT#0 == 20; | ||
goto GeneratedUnifiedExit; | ||
|
||
GeneratedUnifiedExit: | ||
assert r#AT#0 > 1; | ||
return; | ||
} | ||
|
||
|
||
implementation {:vcs_split_on_every_assert} MultipleEnsures/return@25/assert@17(x: int) returns (r: int) | ||
{ | ||
|
||
anon0: | ||
goto anon3_Else; | ||
|
||
anon3_Else: | ||
assume {:partition} 0 >= x; | ||
assume r#AT#0 == 20; | ||
goto GeneratedUnifiedExit; | ||
|
||
GeneratedUnifiedExit: | ||
assume r#AT#0 > 1; | ||
assert r#AT#0 < 10; | ||
return; | ||
} | ||
|
||
|
||
implementation {:vcs_split_on_every_assert} MultipleEnsures/return@21/assert@16(x: int) returns (r: int) | ||
{ | ||
|
||
anon0: | ||
goto anon3_Then; | ||
|
||
anon3_Then: | ||
assume {:partition} x > 0; | ||
assume r#AT#0 == 1; | ||
goto GeneratedUnifiedExit; | ||
|
||
GeneratedUnifiedExit: | ||
assert r#AT#0 > 1; | ||
return; | ||
} | ||
|
||
|
||
implementation {:vcs_split_on_every_assert} MultipleEnsures/return@21/assert@17(x: int) returns (r: int) | ||
{ | ||
|
||
anon0: | ||
goto anon3_Then; | ||
|
||
anon3_Then: | ||
assume {:partition} x > 0; | ||
assume r#AT#0 == 1; | ||
goto GeneratedUnifiedExit; | ||
|
||
GeneratedUnifiedExit: | ||
assume r#AT#0 > 1; | ||
assert r#AT#0 < 10; | ||
return; | ||
} | ||
|
||
|
||
isolateJumpAndSplitOnEveryAssert.bpl(21,5): Error: a postcondition could not be proved on this return path | ||
isolateJumpAndSplitOnEveryAssert.bpl(16,3): Related location: this is the postcondition that could not be proved | ||
isolateJumpAndSplitOnEveryAssert.bpl(25,5): Error: a postcondition could not be proved on this return path | ||
isolateJumpAndSplitOnEveryAssert.bpl(17,3): Related location: this is the postcondition that could not be proved | ||
|
||
Boogie program verifier finished with 0 verified, 3 errors |