Quantcast
Channel: Dafny: An Automatic Program Verifier for Functional Correctness
Viewing all articles
Browse latest Browse all 1106

New Post: Bug in Dafny's 1.9.1 console version

$
0
0
When the following code is checked using the console version 1.9.1, in spite of the fact that the while loop should not be verified successfully, Dafny does not report any error.

class Bug {
  var list:array<int>;

  method Foo()
  modifies this`list;
  {
    list := new int[10];

    var i:int := 0;
    while (i < 10)
    decreases i;
    {
    }
  }
}

The problem seems to be in assignment to the array list, when it is placed as a variable of the class. If you remove the assignment, or you defined list as a local variable, then Dafny reports the expected error related to the loop.

Viewing all articles
Browse latest Browse all 1106

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>