This document is organized as follows. The first three chapters are
user manuals, to learn how to use Why3. Other chapters are reference
This document is organized as follows. The first part, made of three chapters, provides tutorials to learn how to use Why3. The second part gathers reference
manuals, giving detailed technical informations.
Chapter~\ref{chap:starting} explains how to get started with the Why
...
...
@@ -38,9 +37,6 @@ batch. Chapter~\ref{chap:syntax} presents the input syntax for file
defining Why theories. The semantics is given informally with
examples. The two first chapters are thus to read for the beginners.
Chapter~\ref{chap:library} documents the standard library of theories
distributed with Why3.
%Chapter~\ref{chap:whyml} presents the
%verification condition generator built upon the Why3 core.
% The two
...
...
@@ -51,12 +47,16 @@ Chapter~\ref{chap:api} presents how to use Why3 programmatically,
using the API. It is for the experimented users, who wants to link
Why3 library with their own code.
Chapter~\ref{chap:manpages} are the technical manual pages for the
tools of the platform. All tool options, and all the configuration
files are described in details there.
Chapter~\ref{chap:apidoc} is the technical documentation of the API.
Part 2 provides:
\begin{itemize}
\item In Chapter~\ref{chap:syntaxref}, the input syntax of files.
\item In Chapter~\ref{chap:library}, the standard library of
theories distributed with Why3.
\item In Chapter~\ref{chap:manpages}, the technical manual pages for the
tools of the platform. All tool options, and all the configuration
files are described in details there.
\item In Chapter~\ref{chap:apidoc}, the technical documentation of the API.
@@ -44,15 +44,16 @@ The GUI is launched on the file above as follows.
why3ide hello_proof.why
\end{verbatim}
When the GUI is started for the first time, you should get a window
which look like the screenshot of Figure~\ref{fig:gui1}. First of all,
the left row is a tool bar which provide different actions to apply on
goals. In this case, the section ``Provers'' is empty, which means
that you did not perform prover detection yet. You should do it now
using the menu \textsf{File/Detect provers}. Second, the middle part
is a tree view that allows to browse inside the theories. Initially,
the item of this tree are closed. You should now expand this view
using the menu \textsf{View/Expand all} or its shortcut
\textsf{Ctrl-E}. This should result is something like the screenshot of Figure~\ref{fig:gui2}.
which looks like the screenshot of Figure~\ref{fig:gui1}. First of
all, the left row is a tool bar which provide different actions to
apply on goals. In this case, the section ``Provers'' is empty, which
means that you did not perform prover detection yet. You should do it
now using the menu \textsf{File/Detect provers}. Second, the middle
part is a tree view that allows to browse inside the
theories. Initially, the item of this tree are closed. You should now
expand this view using the menu \textsf{View/Expand all} or its
shortcut \textsf{Ctrl-E}. This should result is something like the
screenshot of Figure~\ref{fig:gui2}.
\begin{figure}[tbp]
\includegraphics[width=\textwidth]{gui2.png}
...
...
@@ -92,7 +93,7 @@ get the display of Figure~\ref{fig:gui3}.
The row corresponding to goal $G_1$ is now closed, and marked with
green ``checked'' icon in the status column. This means that the goal
is proved by the Simplify prover. On the contrary, the two other goals
are not proved, they are mark with an orange question mark.
are not proved, they are marked with an orange question mark.
You can immediately attempt to prove the remaining goals using another
prover, {\eg} Alt-Ergo, by clicking on the corresponding button. The
...
...
@@ -104,7 +105,7 @@ Instead of calling a prover on a goal, you can apply a transformation
to it. Since $G_2$ is a conjunction, a possibility is to split it
into subgoals. You can do that by clicking on the \textsf{Split}
button of section ``Transformations'' of the left toolbar. Now you
have two subgoals, and you can try again a prover in them, for example
have two subgoals, and you can try again a prover on them, for example
Simplify. Assuming we expand everything again, you should see now what
is displayed on Figure~\ref{fig:gui4}.
...
...
@@ -116,7 +117,7 @@ is displayed on Figure~\ref{fig:gui4}.
The first part of goal $G_2$ is still unproved. As a last resort, we
can try to call the Coq proof assistant. The first step is to click on
the \textsf{Coq} button. A new sub-row appear for coq, and
the \textsf{Coq} button. A new sub-row appear for Coq, and
unsurprisingly the goal is not proved by Coq either. What can be done
now is editing the proof: select that row and then click on the
\textsf{Edit} button in section ``Tools'' of the toolbar. This should
...
...
@@ -142,7 +143,7 @@ explained below.
\subsection{Modifying the input}
Currently, the GUI does not allow to modify the input file. You must
exit the GUI and modify the file by some editor of your choice. Let's assume we change the goal $G_2$into
exit the GUI and modify the file by some editor of your choice. Let's assume we change the goal $G_2$by replacing the first occurrence of true by false, \eg
\begin{verbatim}
goal G2 : (false -> false) and (true or false)
\end{verbatim}
...
...
@@ -163,17 +164,72 @@ shown but marked with "(obsolete)" so that you know the results are
not accurate. You can now retry to prove all what remains unproved
using any of the provers.
\section{Getting Started with the Why3 Command}
\label{sec:batch}
The why3 command allows to check the validity of goals with external
provers, in batch mode. This section presents the basic use of this
tool. Refer to Section~\ref{sec:why3ref} for a more complete
description.
description of this tool and all its command-line options.
The very first time you want to use Why, you should proceed with
autodetection of external provers. This is done as follows, where ``>'' is the prompt.
\begin{verbatim}
> why3config --autodetect-provers
\end{verbatim}
This prints some information messages on what detections are attempted. To know which
provers have been successfully detected, you can run do as follows.
\begin{verbatim}
> why3 --list-provers
Known provers:
alt-ergo (Alt-Ergo)
coq (Coq)
simplify (Simplify)
\end{verbatim}
The first word of each line is a unique identifier for the associated prover. We thus
have now the three provers Alt-Ergo~\cite{ergo}, Coq~\cite{CoqArt} and
Simplify~\cite{simplify05}.
Let's assume now we want to run Simplify on the HelloProof
example. The command to type and its output are as follows, where the
\verb|-P| option is follow by the unique identifier as shown as above.