summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Valentin Wüstholz <wuestholz@gmail.com>2015-11-17 14:03:06 -0600
committerGravatar Valentin Wüstholz <wuestholz@gmail.com>2015-11-17 14:03:06 -0600
commite25dac8edab3e3f23db7c83b393ed388840d239f (patch)
treea03f403d9c2e2f4af62f786836f4a892665c5fe0
parent67a0a458aad9ece669a49cca085b695a56003d0e (diff)
Fix issue #25.
-rw-r--r--Source/AbsInt/IntervalDomain.cs4
-rw-r--r--Test/aitest0/Issue25.bpl14
-rw-r--r--Test/aitest0/Issue25.bpl.expect8
3 files changed, 26 insertions, 0 deletions
diff --git a/Source/AbsInt/IntervalDomain.cs b/Source/AbsInt/IntervalDomain.cs
index 0d2676f2..ee9d632b 100644
--- a/Source/AbsInt/IntervalDomain.cs
+++ b/Source/AbsInt/IntervalDomain.cs
@@ -698,9 +698,13 @@ namespace Microsoft.Boogie.AbstractInterpretation
lo = Lo; hi = Hi;
if (hi != null) {
Lo = node.Type.IsReal ? -hi : 1 - hi;
+ } else {
+ Lo = null;
}
if (lo != null) {
Hi = node.Type.IsReal ? -lo : 1 - lo;
+ } else {
+ Hi = null;
}
}
else if (op.Op == UnaryOperator.Opcode.Not) {
diff --git a/Test/aitest0/Issue25.bpl b/Test/aitest0/Issue25.bpl
new file mode 100644
index 00000000..6ffcd113
--- /dev/null
+++ b/Test/aitest0/Issue25.bpl
@@ -0,0 +1,14 @@
+// RUN: %boogie -infer:j "%s" > "%t"
+// RUN: %diff "%s.expect" "%t"
+
+const N: int;
+axiom 0 <= N;
+
+procedure vacuous_post()
+ensures (forall k, l: int :: 0 <= k && k <= l && l < N ==> N < N); // Used to verify at some point (see https://github.com/boogie-org/boogie/issues/25).
+{
+var x: int;
+x := -N;
+while (x != x) {
+}
+}
diff --git a/Test/aitest0/Issue25.bpl.expect b/Test/aitest0/Issue25.bpl.expect
new file mode 100644
index 00000000..80eeb1a7
--- /dev/null
+++ b/Test/aitest0/Issue25.bpl.expect
@@ -0,0 +1,8 @@
+Bug25.bpl(12,1): Error BP5003: A postcondition might not hold on this return path.
+Bug25.bpl(8,1): Related location: This is the postcondition that might not hold.
+Execution trace:
+ Bug25.bpl(11,3): anon0
+ Bug25.bpl(12,1): anon2_LoopHead
+ Bug25.bpl(12,1): anon2_LoopDone
+
+Boogie program verifier finished with 0 verified, 1 error