diff options
author | Rustan Leino <unknown> | 2013-05-30 14:17:40 -0700 |
---|---|---|
committer | Rustan Leino <unknown> | 2013-05-30 14:17:40 -0700 |
commit | ecd49b32f40d6a0683beb89a8ae7cc2ba40d853f (patch) | |
tree | 2ebe0022174a49e76c0365c8cdfc4e65378c6f1c /Test | |
parent | 6a9e8449f14e8c3858ab0809036e68a0a43c2d4e (diff) |
Fixed bug in Interval abstract domain (pertaining to unary negation)
Diffstat (limited to 'Test')
-rw-r--r-- | Test/aitest0/Answer | 7 | ||||
-rw-r--r-- | Test/aitest0/Intervals.bpl | 18 |
2 files changed, 24 insertions, 1 deletions
diff --git a/Test/aitest0/Answer b/Test/aitest0/Answer index 18359b2e..dabe9710 100644 --- a/Test/aitest0/Answer +++ b/Test/aitest0/Answer @@ -119,5 +119,10 @@ Execution trace: Intervals.bpl(68,5): anon0
Intervals.bpl(69,3): anon3_LoopHead
Intervals.bpl(69,3): anon3_LoopDone
+Intervals.bpl(92,3): Error BP5001: This assertion might not hold.
+Execution trace:
+ Intervals.bpl(87,5): anon0
+ Intervals.bpl(88,3): loop_head
+ Intervals.bpl(91,3): after_loop
-Boogie program verifier finished with 4 verified, 2 errors
+Boogie program verifier finished with 5 verified, 3 errors
diff --git a/Test/aitest0/Intervals.bpl b/Test/aitest0/Intervals.bpl index 7ed2c3d2..4520a032 100644 --- a/Test/aitest0/Intervals.bpl +++ b/Test/aitest0/Intervals.bpl @@ -73,3 +73,21 @@ procedure Thresholds4() assert i * 2 == 400; // error: this would hold in an execution, but /infer:j is too weak to infer invariant i<=200
}
+procedure UnaryNegation0() returns (x: int) // this was once buggy
+{
+ x := -1;
+ loop_head:
+ x := x;
+ goto loop_head, after_loop;
+ after_loop:
+ assert x == -1;
+}
+procedure UnaryNegation1() returns (x: int) // this was once buggy
+{
+ x := -1;
+ loop_head:
+ x := x;
+ goto loop_head, after_loop;
+ after_loop:
+ assert x == 1; // error
+}
|