I cloned and built the latest version of Dafny (changeset d954a409627e), found happily that #145 is fixed, and proceeded with my project. Unfortunately, I soon encountered another bug, similar to the previous one:
```
function method inhabited(world: array2<bool>): bool
requires world != null
{
exists i,j :: 0 <= i < world.Length0 && 0 <= j < world.Length1 && world[i,j]
}
method GameOfLife(size: nat, N: nat)
requires 0 < size
{
var world := new bool[size,size];
var n := 0;
while inhabited(world) && n < N {
forall i,j | 0 <= i < size && 0 <= j < size {
world[i,j] := false;
}
assert inhabited(world); // This assertion is wrongly verified
// ...
n := n + 1;
}
}
```
This bug is also observed at [rise4fun](http://rise4fun.com/Dafny/WoYe). As before, one can get around it by inlining the body of the `inhabited` function in the assertion. This is very frustrating, however, because we will have to rewrite all assertions in our code base involving functions and quantifiers. Do you have any suggestions (turning on some options etc) ?
```
function method inhabited(world: array2<bool>): bool
requires world != null
{
exists i,j :: 0 <= i < world.Length0 && 0 <= j < world.Length1 && world[i,j]
}
method GameOfLife(size: nat, N: nat)
requires 0 < size
{
var world := new bool[size,size];
var n := 0;
while inhabited(world) && n < N {
forall i,j | 0 <= i < size && 0 <= j < size {
world[i,j] := false;
}
assert inhabited(world); // This assertion is wrongly verified
// ...
n := n + 1;
}
}
```
This bug is also observed at [rise4fun](http://rise4fun.com/Dafny/WoYe). As before, one can get around it by inlining the body of the `inhabited` function in the assertion. This is very frustrating, however, because we will have to rewrite all assertions in our code base involving functions and quantifiers. Do you have any suggestions (turning on some options etc) ?