Testing, Debugging, and Verification TDA567/DIT082, LP2, HT2017

Dafny

Installing and Running Dafny

Follow the instructions below to install Dafny, and run it from the command line.

Windows

  1. Download and unzip Dafny from the Dafny project repository releases.
  2. While in the Dafny directory, check whether Dafny is working by creating a test file, e.g. call it test.dfy, and then executing:
    Dafny.exe /compile:0 test.dfy
    or
    Dafny.exe test.dfy

Linux and Mac OS

  1. Download and unzip Dafny from the Dafny project repository releases. Check on the .zip files name to get the appropiate version for your operating system.
  2. Install Mono. It is recommended to install the version 4 or higher.
  3. While in the Dafny directory, check whether Dafny is working by creating a test file, e.g. call it test.dfy, and then executing:
    mono Dafny.exe /compile:0 test.dfy
    or
    mono Dafny.exe test.dfy

    Note that you may have to give execution permits to the file Dafny.exe.

Build from source

Another possiblity is to build Dafny from its sources. You can check how to this on the Dafny's repository instructions . Either way, you have install mono.

Emacs mode

As an alternative to mono, you can use Dafny interactively within Emacs, after installing this dedicated mode.