{"id":170169,"date":"2008-12-23T10:54:51","date_gmt":"2008-12-23T10:54:51","guid":{"rendered":"https:\/\/www.microsoft.com\/en-us\/research\/project\/dafny-a-language-and-program-verifier-for-functional-correctness\/"},"modified":"2018-04-03T16:44:49","modified_gmt":"2018-04-03T23:44:49","slug":"dafny-a-language-and-program-verifier-for-functional-correctness","status":"publish","type":"msr-project","link":"https:\/\/www.microsoft.com\/en-us\/research\/project\/dafny-a-language-and-program-verifier-for-functional-correctness\/","title":{"rendered":"Dafny: A Language and Program Verifier for Functional Correctness"},"content":{"rendered":"

\"dafny-logo_sm\"Dafny is a programming language with built-in specification constructs. The Dafny static program verifier can be used to verify the functional correctness of programs.<\/p>\n

The Dafny programming language is designed to support the static verification of programs. It is imperative, sequential, supports generic classes, dynamic allocation, and\u00a0inductive datatypes,\u00a0and builds in specification constructs. The specifications include pre- and postconditions, frame specifications (read and write sets), and termination metrics.<\/p>\n

To further support specifications, the language also offers updatable ghost variables, recursive functions, and types like sets and sequences. Specifications and ghost constructs are used only during verification; the compiler omits them from the executable code.<\/p>\n

The Dafny verifier is run as part of the compiler. As such, a programmer interacts with it much in the same way as with the static type checker\u2014when the tool produces errors, the programmer responds by changing the program\u2019s type declarations, specifications, and statements.<\/p>\n

The easiest way to try out Dafny is in your web browser at rise4fun (opens in new tab)<\/span><\/a>.\u00a0 Once you get a bit more serious, you may prefer to download (opens in new tab)<\/span><\/a> to run it on your machine.\u00a0 Although Dafny can be run from the command line (on Windows or other platforms), the preferred way to run it is in Microsoft Visual Studio 2010, where the Dafny verifier runs in the background while the programmer is editing the program.<\/p>\n

The Dafny verifier is powered by Boogie (opens in new tab)<\/span><\/a> and Z3.<\/p>\n

From verified programs, the Dafny compiler produces code (.dll or .exe) for the .NET platform.\u00a0 However, the facilities for interfacing with other .NET code are minimal.<\/p>\n

The source code (opens in new tab)<\/span><\/a> for Dafny is available.<\/p>\n\t

\n\t\t\t\t\t
\n\t\t\t\t\n\t\t\t\t\t