Commit 4822694f authored by Guillaume Melquiond's avatar Guillaume Melquiond

Merge branch 'master' into new_system

parents a7c1eea4 7129b259
...@@ -152,7 +152,6 @@ why3.conf ...@@ -152,7 +152,6 @@ why3.conf
/src/coq-tactic/.why3-vo-* /src/coq-tactic/.why3-vo-*
# Coq # Coq
/lib/coq/bv/BV_Gen.v
# PVS # PVS
.pvscontext .pvscontext
...@@ -200,6 +199,8 @@ pvsbin/ ...@@ -200,6 +199,8 @@ pvsbin/
/src/util/config.ml /src/util/config.ml
/src/util/lexlib.ml /src/util/lexlib.ml
/src/util/rc.ml /src/util/rc.ml
/src/util/json_parser.mli
/src/util/json_parser.ml
# /src/session # /src/session
/src/session/xml.ml /src/session/xml.ml
...@@ -216,6 +217,13 @@ pvsbin/ ...@@ -216,6 +217,13 @@ pvsbin/
/plugins/tptp/tptp_parser.conflicts /plugins/tptp/tptp_parser.conflicts
/plugins/parser/dimacs.ml /plugins/parser/dimacs.ml
# /plugins/python/
/plugins/python/py_lexer.ml
/plugins/python/py_parser.ml
/plugins/python/py_parser.mli
/plugins/python/test/
/plugins/python/py_parser.conflicts
# /drivers # /drivers
/drivers/coq-realizations.aux /drivers/coq-realizations.aux
/drivers/pvs-realizations.aux /drivers/pvs-realizations.aux
...@@ -228,6 +236,8 @@ pvsbin/ ...@@ -228,6 +236,8 @@ pvsbin/
/tests/test-and/ /tests/test-and/
/tests/test-extraction/* /tests/test-extraction/*
!/tests/test-extraction/main.ml !/tests/test-extraction/main.ml
/tests/python/*/why3session.xml
/tests/python/*/why3shapes.gz
# /examples/ # /examples/
/examples/in_progress/course/ /examples/in_progress/course/
...@@ -288,6 +298,7 @@ pvsbin/ ...@@ -288,6 +298,7 @@ pvsbin/
/modules/pqueue/ /modules/pqueue/
/modules/mach/array/ /modules/mach/array/
/modules/mach/int/ /modules/mach/int/
/modules/python/
# Try Why3 # Try Why3
/src/trywhy3/trywhy3.byte /src/trywhy3/trywhy3.byte
...@@ -304,9 +315,13 @@ pvsbin/ ...@@ -304,9 +315,13 @@ pvsbin/
/src/trywhy3/index.html /src/trywhy3/index.html
/src/trywhy3/ace-builds/ /src/trywhy3/ace-builds/
/src/trywhy3/*.png /src/trywhy3/*.png
/src/trywhy3/alt-ergo-1.00-private-2015-01-29 /src/trywhy3/alt-ergo*
/src/trywhy3/fontawesome/ /src/trywhy3/fontawesome/
# IDE
/src/ide/fontawesome
/src/ide/ace-builds
# jessie3 # jessie3
/src/jessie/config.log /src/jessie/config.log
/src/jessie/Makefile /src/jessie/Makefile
......
...@@ -13,10 +13,12 @@ S src/coq-tactic ...@@ -13,10 +13,12 @@ S src/coq-tactic
S src/why3session S src/why3session
S src/why3doc S src/why3doc
S src/jessie S src/jessie
S src/trywhy3
S plugins/parser S plugins/parser
S plugins/printer S plugins/printer
S plugins/transform S plugins/transform
S plugins/tptp S plugins/tptp
S plugins/python
B src/util B src/util
B src/core B src/core
...@@ -33,10 +35,12 @@ B src/coq-tactic ...@@ -33,10 +35,12 @@ B src/coq-tactic
B src/why3session B src/why3session
B src/why3doc B src/why3doc
B src/jessie B src/jessie
B src/trywhy3
B plugins/parser B plugins/parser
B plugins/printer B plugins/printer
B plugins/transform B plugins/transform
B plugins/tptp B plugins/tptp
B plugins/python
B lib/why3 B lib/why3
PKG str unix num dynlink @ZIPLIB@ @LABLGTK2PKG@ @META_OCAMLGRAPH@ PKG str unix num dynlink @ZIPLIB@ @LABLGTK2PKG@ @META_OCAMLGRAPH@
...@@ -12,9 +12,13 @@ with contributions of ...@@ -12,9 +12,13 @@ with contributions of
Sylvie Boldo Sylvie Boldo
Martin Clochard Martin Clochard
Simon Cruanes Simon Cruanes
Sylvain Dailler
Clément Fumex
Leon Gondelman Leon Gondelman
David Hauzar
Daisuke Ishii Daisuke Ishii
Johannes Kanig Johannes Kanig
Mikhail Mandrykin
David Mentré David Mentré
Benjamin Monate Benjamin Monate
Thi-Minh-Tuyen Nguyen Thi-Minh-Tuyen Nguyen
......
* marks an incompatible change * marks an incompatible change
Tools Tools
o why3 config now generates default proof strategies using the o why3 config now generates default proof strategies using the
installed provers. These are available under name "Auto level 1" installed provers. These are available under name "Auto level 1"
and "Auto level 2" in why3 ide. and "Auto level 2" in why3 ide.
Version 0.87.3, January ??, 2017 Version 0.87.3, January 12, 2017
================================= ================================
bug fixes bug fixes
o o fixed OCaml extraction with respect to ghost parameters
o assorted bug fixes
Provers provers
o support for Alt-Ergo 1.30 (released ??, 2016) o support for Alt-Ergo 1.30 (released Nov 21, 2016)
o support for Coq 8.6 (released ?, 2016) o support for Coq 8.6 (released Dec 8, 2016)
o support for Gappa 1.3 (released ?, 2016) o support for Gappa 1.3 (released Jul 20, 2016)
* discarded support for Isabelle 2015 * discarded support for Isabelle 2015
o support for Isabelle 2016-1 (released Dec 2016) o support for Isabelle 2016-1 (released Dec 2016)
o support for Z3 4.5.0 (released ? 2016) o support for Z3 4.5.0 (released Nov 8, 2016)
Version 0.87.2, September 1, 2016 Version 0.87.2, September 1, 2016
================================= =================================
......
This diff is collapsed.
#################################################################### ####################################################################
# # # #
# The Why3 Verification Platform / The Why3 Development Team # # The Why3 Verification Platform / The Why3 Development Team #
# Copyright 2010-2016 -- INRIA - CNRS - Paris-Sud University # # Copyright 2010-2017 -- INRIA - CNRS - Paris-Sud University #
# # # #
# This software is distributed under the terms of the GNU Lesser # # This software is distributed under the terms of the GNU Lesser #
# General Public License version 2.1, with the special exception # # General Public License version 2.1, with the special exception #
...@@ -176,8 +176,8 @@ OCAMLVERSION=`$OCAMLC -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' ` ...@@ -176,8 +176,8 @@ OCAMLVERSION=`$OCAMLC -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
echo "ocaml version is $OCAMLVERSION" echo "ocaml version is $OCAMLVERSION"
case "$OCAMLVERSION" in case "$OCAMLVERSION" in
0.*|1.*|2.*|3.*|4.00.*) 0.*|1.*|2.*|3.*|4.00.*|4.01.*|4.02.[[0-2]])
AC_MSG_ERROR(You need Objective Caml 4.01.0 or higher);; AC_MSG_ERROR(You need Objective Caml 4.02.3 or higher);;
esac esac
# Ocaml library path # Ocaml library path
......
...@@ -5,8 +5,9 @@ This chapter is a tutorial for the users who want to link their own ...@@ -5,8 +5,9 @@ This chapter is a tutorial for the users who want to link their own
OCaml code with the \why library. We progressively introduce the way OCaml code with the \why library. We progressively introduce the way
one can use the library to build terms, formulas, theories, proof one can use the library to build terms, formulas, theories, proof
tasks, call external provers on tasks, and apply transformations on tasks, call external provers on tasks, and apply transformations on
tasks. The complete documentation for API calls is given tasks. The complete documentation for API calls is given\begin{latexonly}
at URL~\url{http://why3.lri.fr/api-\whyversion/}. at URL~\urlapi{}.\end{latexonly}
%HEVEA at this \ahref{\urlapi}{URL}.
We assume the reader has a fair knowledge of the OCaml We assume the reader has a fair knowledge of the OCaml
language. Notice that the \why library must be installed, see language. Notice that the \why library must be installed, see
...@@ -291,9 +292,9 @@ access the internal identifier for addition: it must be retrieved from ...@@ -291,9 +292,9 @@ access the internal identifier for addition: it must be retrieved from
the standard theory \texttt{Int} of the file \texttt{int.why} (see the standard theory \texttt{Int} of the file \texttt{int.why} (see
Chap~\ref{sec:library}). Chap~\ref{sec:library}).
\begin{ocamlcode} \begin{ocamlcode}
let two : Term.term = let two : Term.term =
Term.t_const (Number.ConstInt (Number.int_const_dec "2")) Term.t_const (Number.ConstInt (Number.int_const_dec "2"))
let four : Term.term = let four : Term.term =
Term.t_const (Number.ConstInt (Number.int_const_dec "4")) Term.t_const (Number.ConstInt (Number.int_const_dec "4"))
let int_theory : Theory.theory = let int_theory : Theory.theory =
Env.read_theory env ["int"] "Int" Env.read_theory env ["int"] "Int"
...@@ -327,7 +328,7 @@ To illustrate how to build quantified formulas, let us consider ...@@ -327,7 +328,7 @@ To illustrate how to build quantified formulas, let us consider
the formula $\forall x:int. x*x \geq 0$. The first step is to the formula $\forall x:int. x*x \geq 0$. The first step is to
obtain the symbols from \texttt{Int}. obtain the symbols from \texttt{Int}.
\begin{ocamlcode} \begin{ocamlcode}
let zero : Term.term = let zero : Term.term =
Term.t_const (Number.ConstInt (Number.int_const_dec "0")) Term.t_const (Number.ConstInt (Number.int_const_dec "0"))
let mult_symbol : Term.lsymbol = let mult_symbol : Term.lsymbol =
Theory.ns_find_ls int_theory.Theory.th_export ["infix *"] Theory.ns_find_ls int_theory.Theory.th_export ["infix *"]
...@@ -362,14 +363,14 @@ be done by a sequence of calls: ...@@ -362,14 +363,14 @@ be done by a sequence of calls:
Creation of a theory named \verb|My_theory| is done by Creation of a theory named \verb|My_theory| is done by
\begin{ocamlcode} \begin{ocamlcode}
let my_theory : Theory.theory_uc = let my_theory : Theory.theory_uc =
Theory.create_theory (Ident.id_fresh "My_theory") Theory.create_theory (Ident.id_fresh "My_theory")
\end{ocamlcode} \end{ocamlcode}
First let us add formula 1 above as a goal: First let us add formula 1 above as a goal:
\begin{ocamlcode} \begin{ocamlcode}
let decl_goal1 : Decl.decl = let decl_goal1 : Decl.decl =
Decl.create_prop_decl Decl.Pgoal goal_id1 fmla1 Decl.create_prop_decl Decl.Pgoal goal_id1 fmla1
let my_theory : Theory.theory_uc = let my_theory : Theory.theory_uc =
Theory.add_decl my_theory decl_goal1 Theory.add_decl my_theory decl_goal1
\end{ocamlcode} \end{ocamlcode}
...@@ -379,12 +380,12 @@ already defined to create task 1 above. ...@@ -379,12 +380,12 @@ already defined to create task 1 above.
Adding formula 2 needs to add the declarations of predicate variables A Adding formula 2 needs to add the declarations of predicate variables A
and B first: and B first:
\begin{ocamlcode} \begin{ocamlcode}
let my_theory : Theory.theory_uc = let my_theory : Theory.theory_uc =
Theory.add_param_decl my_theory prop_var_A Theory.add_param_decl my_theory prop_var_A
let my_theory : Theory.theory_uc = let my_theory : Theory.theory_uc =
Theory.add_param_decl my_theory prop_var_B Theory.add_param_decl my_theory prop_var_B
let decl_goal2 : Decl.decl = let decl_goal2 : Decl.decl =
Decl.create_prop_decl Decl.Pgoal goal_id2 fmla2 Decl.create_prop_decl Decl.Pgoal goal_id2 fmla2
let my_theory : Theory.theory_uc = Theory.add_decl my_theory decl_goal2 let my_theory : Theory.theory_uc = Theory.add_decl my_theory decl_goal2
\end{ocamlcode} \end{ocamlcode}
...@@ -395,33 +396,33 @@ combination of an ``export'' and the creation of a namespace. We ...@@ -395,33 +396,33 @@ combination of an ``export'' and the creation of a namespace. We
provide a helper function for that: provide a helper function for that:
\begin{ocamlcode} \begin{ocamlcode}
(* [use th1 th2] insert the equivalent of a "use import th2" in (* [use th1 th2] insert the equivalent of a "use import th2" in
theory th1 under construction *) theory th1 under construction *)
let use th1 th2 = let use th1 th2 =
let name = th2.Theory.th_name in let name = th2.Theory.th_name in
Theory.close_scope Theory.close_scope
(Theory.use_export (Theory.use_export
(Theory.open_scope th1 name.Ident.id_string) th2) true (Theory.open_scope th1 name.Ident.id_string) th2) true
\end{ocamlcode} \end{ocamlcode}
Addition of formula 3 is then Addition of formula 3 is then
\begin{ocamlcode} \begin{ocamlcode}
let my_theory : Theory.theory_uc = use my_theory int_theory let my_theory : Theory.theory_uc = use my_theory int_theory
let decl_goal3 : Decl.decl = let decl_goal3 : Decl.decl =
Decl.create_prop_decl Decl.Pgoal goal_id3 fmla3 Decl.create_prop_decl Decl.Pgoal goal_id3 fmla3
let my_theory : Theory.theory_uc = let my_theory : Theory.theory_uc =
Theory.add_decl my_theory decl_goal3 Theory.add_decl my_theory decl_goal3
\end{ocamlcode} \end{ocamlcode}
Addition of goal 4 is nothing more complex: Addition of goal 4 is nothing more complex:
\begin{ocamlcode} \begin{ocamlcode}
let decl_goal4 : Decl.decl = let decl_goal4 : Decl.decl =
Decl.create_prop_decl Decl.Pgoal goal_id4 fmla4 Decl.create_prop_decl Decl.Pgoal goal_id4 fmla4
let my_theory : let my_theory :
Theory.theory_uc = Theory.add_decl my_theory decl_goal4 Theory.theory_uc = Theory.add_decl my_theory decl_goal4
\end{ocamlcode} \end{ocamlcode}
Finally, we close our theory under construction as follows. Finally, we close our theory under construction as follows.
\begin{ocamlcode} \begin{ocamlcode}
let my_theory : Theory.theory = Theory.close_theory my_theory let my_theory : Theory.theory = Theory.close_theory my_theory
\end{ocamlcode} \end{ocamlcode}
We can inspect what we did by printing that theory: We can inspect what we did by printing that theory:
...@@ -433,19 +434,19 @@ which outputs ...@@ -433,19 +434,19 @@ which outputs
theory is: theory is:
theory My_theory theory My_theory
(* use BuiltIn *) (* use BuiltIn *)
goal goal1 : true \/ false goal goal1 : true \/ false
predicate A predicate A
predicate B predicate B
goal goal2 : A /\ B -> A goal goal2 : A /\ B -> A
(* use int.Int *) (* use int.Int *)
goal goal3 : (2 + 2) = 4 goal goal3 : (2 + 2) = 4
goal goal4 : forall x:int. (x * x) >= 0 goal goal4 : forall x:int. (x * x) >= 0
end end
\end{verbatim} \end{verbatim}
...@@ -453,7 +454,7 @@ end ...@@ -453,7 +454,7 @@ end
From a theory, one can compute at once all the proof tasks it contains From a theory, one can compute at once all the proof tasks it contains
as follows: as follows:
\begin{ocamlcode} \begin{ocamlcode}
let my_tasks : Task.task list = let my_tasks : Task.task list =
List.rev (Task.split_theory my_theory None None) List.rev (Task.split_theory my_theory None None)
\end{ocamlcode} \end{ocamlcode}
Note that the tasks are returned in reverse order, so we reverse the Note that the tasks are returned in reverse order, so we reverse the
...@@ -461,7 +462,7 @@ list above. ...@@ -461,7 +462,7 @@ list above.
We can check our generated tasks by printing them: We can check our generated tasks by printing them:
\begin{ocamlcode} \begin{ocamlcode}
let () = let () =
printf "Tasks are:@."; printf "Tasks are:@.";
let _ = let _ =
List.fold_left List.fold_left
......
...@@ -216,7 +216,7 @@ The provers can give the following output: ...@@ -216,7 +216,7 @@ The provers can give the following output:
\label{sec:proveoptions} \label{sec:proveoptions}
\begin{description} \begin{description}
\item[\texttt{-{}-get-ce}] activates the generation of a potential \item[\texttt{-{}-get-ce}] activates the generation of a potential
counter-example when a proof does not succeed (experimental). counter-example when a proof does not succeed (experimental).
\item[\texttt{-{}-extra-expl-prefix \textsl{<s>}}] specifies \item[\texttt{-{}-extra-expl-prefix \textsl{<s>}}] specifies
\textsl{s} as an additional prefix for labels that denotes VC \textsl{s} as an additional prefix for labels that denotes VC
...@@ -473,25 +473,25 @@ are grouped together under several tabs. ...@@ -473,25 +473,25 @@ are grouped together under several tabs.
\subsection{Displaying Counterexamples} \subsection{Displaying Counterexamples}
When the selected prover finds (counterexample) model, it is possible to When the selected prover finds (counterexample) model, it is possible to
display parts of this model in the terms of the original Why3 input. display parts of this model in the terms of the original Why3 input.
Currently, this is supported for CVC4 prover version 1.5 and newer. Currently, this is supported for CVC4 prover version 1.5 and newer.
To display the counterexample in Why3 IDE, the counterexample model generation To display the counterexample in Why3 IDE, the counterexample model generation
must be enabled in File -/> Preferences -/> get must be enabled in File -/> Preferences -/> get
counter-example. counter-example.
After running the prover and clicking on the prover result in, the After running the prover and clicking on the prover result in, the
counterexample can be displayed in the tab counterexample can be displayed in the tab
Counter-example. Counter-example.
The counterexample is displayed with the original Why3 code in comments. The counterexample is displayed with the original Why3 code in comments.
Counterexample values for Why3 source code elements at given line are Counterexample values for Why3 source code elements at given line are
displayed in a comment at the line below. displayed in a comment at the line below.
An alternative way how to display a counterexample is to use the option An alternative way how to display a counterexample is to use the option
\texttt{-{}-get-ce} of the \texttt{prove} command. \texttt{-{}-get-ce} of the \texttt{prove} command.
Why3 source code elemets that should be a part of counterexample must be Why3 source code elemets that should be a part of counterexample must be
explicitly marked with \texttt{"model"} label. The following example shows a explicitly marked with \texttt{"model"} label. The following example shows a
Why3 theory with some terms annotated with the \texttt{model} label and the Why3 theory with some terms annotated with the \texttt{model} label and the
generated counterexample in comments: generated counterexample in comments:
\begin{whycode} \begin{whycode}
...@@ -504,7 +504,7 @@ theory T ...@@ -504,7 +504,7 @@ theory T