Commit 90501084 authored by MARCHE Claude's avatar MARCHE Claude

preliminary support for gappa

parent bd3b16ae
......@@ -604,8 +604,8 @@ testl-type: bin/whyml.byte
test-api: src/why.cma
ocaml unix.cma str.cma nums.cma dynlink.cma ocamlgraph/graph.cma \
src/why.cma -I src examples/use_api.ml
src/why.cma -I src examples/use_api.ml \
|| (printf "Test of Why API calls failed. Please fix it"; exit 2)
## install: install-binary install-lib install-man
##
......
\chapter{The Why3 Application Programming Interface}
\label{chap:api}
\section{Building Terms and Formulas}
......
\chapter{IDE}
\label{chap:ide}
\section{IDE}
......
\chapter{Introduction}
\section{Organization of this document}
This document is organized as follows. The first three chapters are
user manuals, to learn how to use Why3. Other chapters are reference
manuals, giving detailed technical informations.
Chapter~\ref{chap:syntax} presents the input syntax for file defining
Why theories. The semantics is given informally with examples.
Chapter~\ref{chap:ide} explains how to use the Why IDE for visualizing
theories and goals, call external provers for trying to solve them,
apply transformations to simplify them. The two first chapters are
thus to read for the beginners.
Chapter~\ref{chap:api} presents how to use Why3 programmatically,
using the API. It is for the more advanced 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.
%%% Local Variables:
%%% mode: latex
%%% TeX-PDF-mode: t
%%% TeX-master: "manual"
%%% End:
\chapter{Reference manuals for the Why3 tools}
\label{chap:manpages}
\section{Compilation, Installation}
......
......@@ -68,6 +68,8 @@ to use Why programmatically, via an well-defined API.
We gratefully thank all the people who contributed to this document:
\input{intro.tex}
\input{syntax.tex}
\input{ide.tex}
......@@ -77,6 +79,7 @@ We gratefully thank all the people who contributed to this document:
\input{manpages.tex}
\chapter{Complete API documentation}
\label{chap:apidoc}
\input{./apidoc.tex}
......
\chapter{Syntax}
\label{chap:syntax}
This chapter describes the input syntax, and informally gives its semantics,
illustrated by examples.
......
......@@ -3,8 +3,7 @@
prelude "# this is a prelude for Gappa"
(* printer "gappa" *)
printer "why3"
printer "gappa"
filename "%f-%t-%g.gappa"
valid 0
......
......@@ -122,5 +122,3 @@ let () = printf "@[On task 3, alt-ergo answers %a@."
(* build a theory with all these goals *)
......@@ -70,7 +70,7 @@ let load rc =
tps
let read_auto_detection_data main =
let filename = Filename.concat main.datadir "provers-detection-data.conf" in
let filename = Filename.concat (Whyconf.datadir main) "provers-detection-data.conf" in
try
let rc = Rc.from_file filename in
load rc
......@@ -144,7 +144,7 @@ let detect_prover main acc data =
{name = data.prover_name;
version = ver;
command = c;
driver = Filename.concat main.datadir data.prover_driver;
driver = Filename.concat (datadir main) data.prover_driver;
editor = data.prover_editor} acc
with Not_found ->
begin
......
......@@ -23,17 +23,15 @@ open Rc
(* lib and shared dirs *)
let libdir =
try
Sys.getenv "WHY3LIB"
with Not_found -> default_option Config.libdir Config.localdir
let compilation_libdir = default_option Config.libdir Config.localdir
let datadir =
try
Sys.getenv "WHY3DATA"
with Not_found -> option_apply Config.datadir
let compilation_datadir =
option_apply Config.datadir
(fun d -> Filename.concat d "share") Config.localdir
let compilation_loadpath =
Filename.concat compilation_datadir "theories"
let default_conf_file =
Filename.concat (match Config.localdir with
| None -> Rc.get_home_dir ()
......@@ -50,14 +48,24 @@ type config_prover = {
}
type main = {
libdir : string;
datadir : string;
private_libdir : string;
private_datadir : string;
loadpath : string list;
timelimit : int;
memlimit : int;
running_provers_max : int;
}
let libdir m =
try
Sys.getenv "WHY3LIB"
with Not_found -> m.private_libdir
let datadir m =
try
Sys.getenv "WHY3DATA"
with Not_found -> m.private_datadir
type config = {
conf_file : string; (* "/home/innocent_user/.why.conf" *)
config : Rc.t ;
......@@ -67,9 +75,9 @@ type config = {
let default_main =
{
libdir = libdir;
datadir = datadir;
loadpath = [Filename.concat datadir "theories"];
private_libdir = compilation_libdir;
private_datadir = compilation_datadir;
loadpath = [compilation_loadpath];
timelimit = 10;
memlimit = 0;
running_provers_max = 2;
......@@ -77,8 +85,8 @@ let default_main =
let set_main rc main =
let section = empty_section in
let section = set_string section "libdir" main.libdir in
let section = set_string section "datadir" main.datadir in
let section = set_string section "libdir" main.private_libdir in
let section = set_string section "datadir" main.private_datadir in
let section = set_stringl section "loadpath" main.loadpath in
let section = set_int section "timelimit" main.timelimit in
let section = set_int section "memlimit" main.memlimit in
......@@ -116,8 +124,8 @@ let load_prover dirname provers (id,section) =
} provers
let load_main dirname section =
{ libdir = get_string ~default:default_main.libdir section "libdir";
datadir = get_string ~default:default_main.datadir section "datadir";
{ private_libdir = get_string ~default:default_main.private_libdir section "libdir";
private_datadir = get_string ~default:default_main.private_datadir section "datadir";
loadpath = List.map (absolute_filename dirname)
(get_stringl ~default:default_main.loadpath section "loadpath");
timelimit = get_int ~default:default_main.timelimit section "timelimit";
......
......@@ -30,8 +30,8 @@ type config_prover = {
}
type main = {
libdir : string; (* "/usr/local/lib/why/" *)
datadir : string; (* "/usr/local/share/why/" *)
private_libdir : string; (* "/usr/local/lib/why/" *)
private_datadir : string; (* "/usr/local/share/why/" *)
loadpath : string list; (* "/usr/local/lib/why/theories" *)
timelimit : int; (* default prover time limit in seconds
(0 unlimited) *)
......@@ -41,6 +41,9 @@ type main = {
(* max number of running prover processes *)
}
val libdir: main -> string
val datadir: main -> string
type config
(** A configuration linked to an rc file. Whyconf gives access to
every sections of the rc file ({!Whyconf.get_section},
......
......@@ -154,7 +154,7 @@ let get_main () = (get_main config.config)
let image ?size f =
let main = get_main () in
let n = Filename.concat main.datadir (Filename.concat "images" (f^".png"))
let n = Filename.concat (datadir main) (Filename.concat "images" (f^".png"))
in
match size with
| None ->
......
......@@ -55,7 +55,7 @@ let fname = match !file with
let lang =
let main = get_main () in
let load_path = Filename.concat main.datadir "lang" in
let load_path = Filename.concat (datadir main) "lang" in
let languages_manager =
GSourceView2.source_language_manager ~default:true
in
......
This diff is collapsed.
......@@ -3,6 +3,10 @@ theory Test
use import int.Int
goal Test0 : true
goal Test0_5 : false
goal Test1: 2+2 = 4
goal Test2: forall x:int. x*x >= 0
......
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