Why3

Only available on StudyMode
  • Topic: Evidence, Command-line interface, Scientific evidence
  • Pages : 76 (18585 words )
  • Download(s) : 73
  • Published : May 1, 2013
Open Document
Text Preview
The Why3 platform

Version 0.80, October 2012

François Bobot1,2 Jean-Christophe Filliâtre1,2 Claude Marché2,1 Guillaume Melquiond2,1 Andrei Paskevich1,2

1 2

LRI, CNRS & University Paris-Sud, Orsay, F-91405 Inria Saclay – Île-de-France, Palaiseau, F-91120

c 2010-2012 University Paris-Sud, CNRS, Inria This work has been partly supported by the ‘U3CAT’ national ANR project (ANR-08-SEGI-021-08, http://frama-c.com/u3cat/) and by the ‘Hi-Lite’ (http://www.open-do.org/projects/hi-lite/) FUI project of the System@tic competitivity cluster.

Foreword
Why3 is a platform for deductive program verification. It provides a rich language for specification and programming, called WhyML, and relies on external theorem provers, both automated and interactive, to discharge verification conditions. Why3 comes with a standard library of logical theories (integer and real arithmetic, Boolean operations, sets and maps, etc.) and basic programming data structures (arrays, queues, hash tables, etc.). A user can write WhyML programs directly and get correct-by-construction OCaml programs through an automated extraction mechanism. WhyML is also used as an intermediate language for the verification of C, Java, or Ada programs. Why3 is a complete reimplementation of the former Why platform [6]. Among the new features are: numerous extensions to the input language, a new architecture for calling external provers, and a well-designed API, allowing to use Why3 as a software library. An important emphasis is put on modularity and genericity, giving the end user a possibility to easily reuse Why3 formalizations or to add support for a new external prover if wanted.

Availability
Why3 project page is http://why3.lri.fr/. The last distribution is available there, in source format, together with this documentation and several examples. Why3 is distributed as open source and freely available under the terms of the GNU LGPL 2.1. See the file LICENSE. See the file INSTALL for quick installation instructions, and Section 5 of this document for more detailed instructions.

Contact
There is a public mailing list for users’ discussions: http://lists.gforge.inria.fr/ mailman/listinfo/why3-club. Report any bug to the Why3 Bug Tracking System: https://gforge.inria.fr/ tracker/?atid=10293&group_id=2990&func=browse.

Acknowledgements
We gratefully thank the people who contributed to Why3, directly or indirectly: Romain Bardou, Simon Cruanes, Leon Gondelman, Johannes Kanig, Stéphane Lescuyer, Simão Melo de Sousa, Benjamin Monate, Asma Tafat.

3

Contents
Contents 5

I Tutorial

7

1 Getting Started 9 1.1 Hello Proofs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 1.2 Getting Started with the GUI . . . . . . . . . . . . . . . . . . . . . . . . . . 9 1.3 Getting Started with the Why3 Command . . . . . . . . . . . . . . . . . . . 15 2 The 2.1 2.2 2.3 3 The 3.1 3.2 3.3 3.4 3.5 4 The 4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.8 Why3 Language 17 Example 1: lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 Example 1 (continued): lists and abstract orderings . . . . . . . . . . . . . . 18 Example 2: Einstein’s problem . . . . . . . . . . . . . . . . . . . . . . . . . 21 WhyML Programming Language Problem 1: Sum and Maximum . . . . Problem 2: Inverting an Injection . . . Problem 3: Searching a Linked List . . Problem 4: N-Queens . . . . . . . . . Problem 5: Amortized Queue . . . . . Why3 API Building Propositional Formulas Building Tasks . . . . . . . . . . Calling External Provers . . . . . Building Terms . . . . . . . . . . Building Quantified Formulas . . Building Theories . . . . . . . . . Applying transformations . . . . Writing new functions on term . 25 26 27 29 32 36 41 41 42 43 45 46 46 47 47

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

....
tracking img