Jump to content

Dafny: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Redjamjar (talk | contribs)
Begun creating a page about the Dafny programming language.
 
Redjamjar (talk | contribs)
Add references and additional description
Line 13: Line 13:
}}
}}


'''Dafny''' is an object-oriented programming language which supports [[formal specification]] through [[preconditions]], [[postconditions]] and [[loop invariant]]s. The language combines features from the [[functional programming|Functional]] and [[object-oriented programming|Object-Oriented]] paradigms and provides implicit dynamic frames for reasoning about side-effects. Dafny was created by Rustan Leino after his previous work on developing ESC/Modula-3, [[ESC/Java]], and [[Spec Sharp|Spec#]].
'''Dafny''' is an imperative language which supports [[formal specification]] through [[preconditions]], [[postconditions]] and [[loop invariant]]s. The language combines features primarily from the [[functional programming|Functional]] and [[imperative programming|Imperative]] paradigms, and includes limited support for [[object-oriented programming|Object-Oriented Programming]]. The language supports ''generic classes'', ''dynamic allocation'', ''inductive datatypes'' and a variation of [[separation logic]] known as ''implicit dynamic frames''<ref>{{cite conference|title=Implicit Dynamic Frames: Combining Dynamic Frames and Separation Logic | doi=10.1007/978-3-642-03013-0_8 | conference=Proceedings of the Conference on European Conference on Object Oriented Programming | pages=148--172 | year=2009}}</ref> for reasoning about side effects<ref>{{cite conference|title=Dafny: An Automatic Program Verifier for Functional Correctness | doi=10.1007/978-3-642-17511-4_20 | conference=Proceedings of the Conference on Logic for Programming, Artificial Intelligence, and Reasoning | pages=348--370 | year=2010}}</ref>. Dafny was created by Rustan Leino after his previous work on developing ESC/Modula-3, [[ESC/Java]], and [[Spec Sharp|Spec#]]. Dafny is a [[compiled programming language|compiled language]] that compiles to [[C Sharp (programming language)|C#]].


== Example ==
== Example ==

Revision as of 20:38, 17 December 2017

Dafny
ParadigmImperative, Functional
Designed byK. Rustan M. Leino
First appeared2009
Stable release
2.0.0 / September 23, 2017; 6 years ago (2017-09-23)
Typing disciplineStatic, strong, safe, structural, flow-sensitive
LicenseMIT
Websiteresearch.microsoft.com/dafny

Dafny is an imperative language which supports formal specification through preconditions, postconditions and loop invariants. The language combines features primarily from the Functional and Imperative paradigms, and includes limited support for Object-Oriented Programming. The language supports generic classes, dynamic allocation, inductive datatypes and a variation of separation logic known as implicit dynamic frames[1] for reasoning about side effects[2]. Dafny was created by Rustan Leino after his previous work on developing ESC/Modula-3, ESC/Java, and Spec#. Dafny is a compiled language that compiles to C#.

Example

The following example illustrates many of the interesting features in Whiley, including the use of precconditions, postconditions, and loop invariants.

  1. ^ Implicit Dynamic Frames: Combining Dynamic Frames and Separation Logic. Proceedings of the Conference on European Conference on Object Oriented Programming. 2009. pp. 148--172. doi:10.1007/978-3-642-03013-0_8.
  2. ^ Dafny: An Automatic Program Verifier for Functional Correctness. Proceedings of the Conference on Logic for Programming, Artificial Intelligence, and Reasoning. 2010. pp. 348--370. doi:10.1007/978-3-642-17511-4_20.