how to write modifies clauses to avoid unnecessary ‘unchanged’ postconditions
I am working on a Dafny project where instances of a class can modify the fields of other objects stored in lists within that class.
how to write modifies clauses to avoid unnecessary ‘unchanged’ postconditions
I am working on a Dafny project where instances of a class can modify the fields of other objects stored in lists within that class.
how to write modifies clauses to avoid unnecessary ‘unchanged’ postconditions
I am working on a Dafny project where instances of a class can modify the fields of other objects stored in lists within that class.
Index out of range in “var max: int := a[0];”
Here is my Dafny code that finds the index of an input array such that the value in the array at that index is the maximal. However, Dafny indicates that there is an index out of range problem on line 8 (var max: int := a[0];
). This is highly confusing as it seems trivially correct. Can anyone offer insights to this problem?
(Dafny) Index out of range in “var max: int := a[0];”
I am new to Dafny, and here is my Dafny code that finds the index of an input array such that the value in the array at that index is the maximal. However, Dafny indicates that there is an index out of range problem on line 8 (var max: int := a[0];). This is highly confusing as it seems trivially correct. Can anyone offer insights to this problem? Thank you!
Proof of the sieve of Eratosthenes
I need to write the code for the sieve of Eratosthenes algorithm so that it is verifiable, that is, to verify that the method really returns only prime numbers.
Generic Seq Comprehension in Dafny
I’m unable to prove the following basic property of a sequence comprehension.
Refining modules inside a module refinement in Dafny?
I’m trying to refine an abstract module inside the refinement of an abstract module, but am having trouble working out how to do it.
Creating a class object in a class in another module
A project I’m working on has a peculiar construct. I created a module like so:
unclear behaviour of traits and test type in Dafny
I am trying to understand how Dafny handles postconditions of concrete classes. In the example below, I have two classes B and C that extend a trait A. Both have different postconditions for the method m.