Commit e7fe6ce9 authored by Jean-Christophe's avatar Jean-Christophe

PVS output revamped (in preparation of forthcoming PVS realizations)

parent 00f2af66
......@@ -1268,13 +1268,13 @@ clean::
tags:
find src -regex ".*\.ml[^#]*" | grep -v ".svn" | sort -r | xargs \
etags "--regex=/let[ \t]+\([^ \t]+\)/\1/" \
"--regex=/let[ \t]+rec[ \t]+\([^ \t]+\)/\1/" \
"--regex=/and[ \t]+\([^ \t]+\)/\1/" \
"--regex=/type[ \t]+\([^ \t]+\)/\1/" \
"--regex=/exception[ \t]+\([^ \t]+\)/\1/" \
"--regex=/val[ \t]+\([^ \t]+\)/\1/" \
"--regex=/module[ \t]+\([^ \t]+\)/\1/"
etags "--regex-ocaml=/let[ \t]+\([^ \t]+\)/\1/" \
"--regex-ocaml=/let[ \t]+rec[ \t]+\([^ \t]+\)/\1/" \
"--regex-ocaml=/and[ \t]+\([^ \t]+\)/\1/" \
"--regex-ocaml=/type[ \t]+\([^ \t]+\)/\1/" \
"--regex-ocaml=/exception[ \t]+\([^ \t]+\)/\1/" \
"--regex-ocaml=/val[ \t]+\([^ \t]+\)/\1/" \
"--regex-ocaml=/module[ \t]+\([^ \t]+\)/\1/"
otags:
find \( -name '*.ml' -or -name '*.mli' \) -print0 | xargs -0 otags
......
\chapter{Theory Realizations}
\label{chap:realizations}
Given a \why theory, one can use a proof assistant to make a
\emph{realization} of this theory, that is to provide definitions for
some of its uninterpreted symbols and proofs for some of its
axioms. This way, one can show the consistency of some axiomatized
theory and/or make a connection to an existing library (of the proof
assistant) to ease some proofs.
Currently, realizations are supported for the proof assistants Coq and PVS.
\section{Generating a realization}
Generating the skeleton for a theory is done by passing to \why the
......@@ -8,7 +16,7 @@ Generating the skeleton for a theory is done by passing to \why the
the theories to realize, and the target directory.
\begin{verbatim}
why3 --realize -D path/to/drivers/coq-realize.drv
why3 --realize -D path/to/drivers/prover-realize.drv
-T env_path.theory_name -o path/to/target/dir/
\end{verbatim}
......@@ -41,7 +49,9 @@ parameter, if not empty, provides a name to be used inside generated
scripts to point to the realization, in case the default name is not
suitable for the interactive prover.
\section{Coq scripts}
\section{Generated/edited files}
\subsection{Coq}
This section describes the content of the Coq files generated by \why for
both proof obligations and theory realizations. When reading a Coq
......@@ -79,6 +89,10 @@ much about comments. For instance, \why can easily be confused by
some terminating directive like \verb+Qed+ that would be present in a
comment.
\subsection{PVS}
TODO
\section{Shipping libraries of realizations}
While modifying an existing driver file might be sufficient for local
......
......@@ -4,7 +4,7 @@ unknown "Error: \\(.*\\)$" "\\1"
fail "Syntax error: \\(.*\\)$" "\\1"
time "why3cpulimit time : %s s"
transformation "inline_trivial"
(*transformation "inline_trivial"*)
transformation "eliminate_builtin"
(* PVS does not support mutual recursion *)
......@@ -71,10 +71,10 @@ theory int.Int
syntax function zero "0"
syntax function one "1"
syntax function (+) "(%1 + %2)"
syntax function (-) "(%1 - %2)"
syntax function (*) "(%1 * %2)"
syntax function (-_) "(-%1)"
syntax function ( + ) "(%1 + %2)"
syntax function ( - ) "(%1 - %2)"
syntax function ( * ) "(%1 * %2)"
syntax function (-_) "(-%1)"
syntax predicate (<=) "(%1 <= %2)"
syntax predicate (<) "(%1 < %2)"
......@@ -157,12 +157,12 @@ theory real.Real
syntax function zero "0"
syntax function one "1"
syntax function (+) "(%1 + %2)"
syntax function (-) "(%1 - %2)"
syntax function (-_) "(-%1)"
syntax function (*) "(%1 * %2)"
syntax function (/) "(%1 / %2)"
syntax function inv "(1 / %1)"
syntax function ( + ) "(%1 + %2)"
syntax function ( - ) "(%1 - %2)"
syntax function (-_) "(-%1)"
syntax function ( * ) "(%1 * %2)"
syntax function ( / ) "(%1 / %2)"
syntax function inv "(1 / %1)"
syntax predicate (<=) "(%1 <= %2)"
syntax predicate (<) "(%1 < %2)"
......
(*
prelude "% This file is generated by Why3's PVS driver"
prelude "% Beware! Only edit allowed sections below "
*)
printer "pvs-realize"
filename "%t.pvs"
import "pvs-common.gen"
(*
prelude "% This file is generated by Why3's PVS driver"
prelude "% Beware! Only edit allowed sections below "
*)
printer "pvs"
filename "%f_%t_%g.pvs"
......
......@@ -322,18 +322,19 @@ command = "'@LOCALBIN@why3-cpulimit' 0 %m -s %e -I %l/coq-tactic -R %l/coq Why3
driver = "drivers/coq.drv"
editor = "coqide"
# [ITP pvs]
# name = "PVS"
# exec = "pvs"
# version_switch = "-version"
# version_regexp = "PVS Version \\([^ \n]+\\)"
# version_ok = "5.0"
# command = "'@LOCALBIN@why3-cpulimit' 0 %m -s proveit %f"
# driver = "drivers/pvs.drv"
# editor = "pvs"
[ITP pvs]
name = "PVS"
exec = "pvs"
version_switch = "-version"
version_regexp = "PVS Version \\([^ \n]+\\)"
version_ok = "5.0"
command = "'@LOCALBIN@why3-cpulimit' 0 %m -s proveit %f"
driver = "drivers/pvs.drv"
editor = "pvs"
# [editor pvs]
# command = "pvs %f"
[editor pvs]
name = "PVS"
command = "pvs %f"
[editor coqide]
name = "CoqIDE"
......
......@@ -199,6 +199,6 @@ let () =
try
main ()
with e when not (Debug.test_flag Debug.stack_trace) ->
eprintf "%a@." Exn_printer.exn_printer e;
eprintf "Error: %a@." Exn_printer.exn_printer e;
exit 1
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment