CSC410 Dafny Resources
Video Tutorials
-
Preconditions and Postconditions
How to define preconditions and postconditions for methods via
requires
andensures
. -
Verifying that a property holds at a given program location using
assert
statements. -
Using
invariant
clauses to specify loop invariants. Usingdecreases
clauses to specify termination measures. -
How to reason about arrays. Using quantifiers and
old
expressions. The purpose of themodifies
clause. -
Reasoning about recursion using binary search as an example.
-
Reasoning about sequences using merge sort as an example.
-
Using the calc construct to prove chains of equivalences.
-
Writing functions and proving properties involving them.
Dafny Arguments
The following code forces Dafny to spend no more than one second verifying individual verification conditions. This is helpful if you want to keep your proofs simple and quick to verify. It should be pasted in your settings.json in Visual Studio Code.
"dafny.serverVerifyArguments": [
"/timeLimit:1"
],