Commit 9ea5cab3 authored by MARCHE Claude's avatar MARCHE Claude

new files for distrib

parent 33503e93
Installation instructions
Shortly, installation is done by
./configure
make
make install (as root)
To install also the Ocaml library do
make byte
make install-lib (as root)
For detailed instructions and required dependencies, please see
the manual (doc/manual.pdf), Chapter 7.
\ No newline at end of file
......@@ -229,8 +229,6 @@ install_no_local::
mkdir -p $(DATADIR)/why3/theories
mkdir -p $(DATADIR)/why3/theories/transform
mkdir -p $(DATADIR)/why3/drivers
mkdir -p $(OCAMLLIB)/why3
cp -f src/why.cmi src/why.cma src/why.cmxa $(OCAMLLIB)/why3
cp -f theories/*.why $(DATADIR)/why3/theories
cp -f theories/transform/*.why $(DATADIR)/why3/theories/transform
cp -f drivers/*.drv $(DATADIR)/why3/drivers
......@@ -239,14 +237,22 @@ install_no_local::
cp -f share/emacs/why.el $(DATADIR)/why3/emacs/why.el
cp -f share/lang/why.lang $(DATADIR)/why3/lang/why.lang
install_no_local_lib::
mkdir -p $(OCAMLLIB)/why3
cp -f src/why.cm* $(OCAMLLIB)/why3
if test -f src/why.a; then cp -f src/why.a $(OCAMLLIB)/why3; fi
ifeq ("@ENABLE_LOCAL@","no")
install: install_no_local
install-lib: install_no_local_lib
else
install:
install install-lib:
@echo "You use a local configuration you can't install with it."
@echo "Run ./configure without --enable-local"
endif
install-all: install install-lib
##################
# Why binary
......@@ -740,74 +746,6 @@ clean::
rm -f $(PLUGGENERATED)
rm -f .depend.plug
## install: install-binary install-lib install-man
##
## BINARYFILES = $(BINARY) bin/whyide.$(OCAMLBEST)
##
## # install-binary should not depend on $(BINARYFILES); otherwise it
## # enforces the compilation of whyide, even when lablgtk2 is not installed
## install-binary:
## mkdir -p $(BINDIR)
## cp -f $(BINARY) $(BINDIR)/why$(EXE)
## if test -f bin/whyide.$(OCAMLBEST); then \
## cp -f bin/whyide.$(OCAMLBEST) $(BINDIR)/whyide-bin$(EXE); \
## fi
##
## install-lib:
## mkdir -p $(LIBDIR)/why/why
##
## install-man:
## mkdir -p $(MANDIR)/man1
## cp -f doc/*.1 $(MANDIR)/man1
##
## install-coq-no:
## install-coq-yes: install-coq-@COQVER@
## install-coq-v7:
## mkdir -p $(LIBDIR)/why/coq7
## cp -f $(V7FILES) $(LIBDIR)/why/coq7
## cp -f $(VO7) $(LIBDIR)/why/coq7
## install-coq-v8 install-coq-v8.1:
## if test -w $(COQLIB) ; then \
## mkdir -p $(COQLIB)/user-contrib ; \
## cp -f $(V8FILES) $(COQLIB)/user-contrib ; \
## cp -f $(VO8) $(COQLIB)/user-contrib ; \
## else \
## echo "Cannot copy to Coq standard library. Add $(LIBDIR)/why/coq to Coq include path." ;\
## mkdir -p $(LIBDIR)/why/coq ;\
## cp -f $(VO8) $(V8FILES) $(LIBDIR)/why/coq ;\
## fi
##
## install-pvs-no:
## install-pvs-yes: $(PVSFILES)
## mkdir -p $(PVSLIB)/why
## cp $(PVSFILES) $(PVSFILES:.pvs=.prf) $(PVSLIB)/why
## cp lib/pvs/top.pvs lib/pvs/pvscontext.el $(PVSLIB)/why
## @echo "====== Compiling PVS theories, this may take some time ======"
## (cd $(PVSLIB)/why ; @PVSC@ -batch -l pvscontext.el -q -v 2 > top.out)
## @echo "====== Done compiling PVS theories ======"
##
## install-mizar-no:
## install-mizar-yes:
## mkdir -p @MIZARLIB@/mml/dict
## cp lib/mizar/why.miz @MIZARLIB@/mml
## cp lib/mizar/dict/why.voc @MIZARLIB@/mml/dict
##
## local-install: $(BINARY) $(WHYCONFIG) $(JESSIE) bin/whyide.$(OCAMLBEST) byte bin/whyide.byte
## cp $(BINARY) $$HOME/bin/why
## cp $(WHYCONFIG) $$HOME/bin/why
## cp $(JESSIE) $$HOME/bin/jessie
## if test -f bin/whyide.$(OCAMLBEST); then \
## cp -f bin/whyide.$(OCAMLBEST) $$HOME/bin/whyide; \
## fi
##
## local: install
##
## win: why.nsi
## "/cygdrive/c/Program Files (x86)/NSIS/makensis" /DVERSION=$(VERSION) why.nsi
##
## zip:
## zip -A -r why-$(VERSION).zip c:/why/bin c:/why/lib c:/coq/lib/contrib/why c:/coq/lib/contrib7/why
################
# documentation
################
......
TODO: Andrei
\ No newline at end of file
......@@ -4,6 +4,11 @@ Why3 is a tool for automated and interactive proving in first-order
polymorphic logic. It provides a collection of command-line tools, a
graphical interface and an Objective Caml library.
PROJECT HOME
============
https://gforge.inria.fr/projects/why3
DOCUMENTATION
=============
......@@ -32,4 +37,4 @@ xx (see file OCAML-LICENSE).
INSTALLATION
============
See the enclosed file INSTALL.
See the file INSTALL.
......@@ -4,7 +4,7 @@
== Documentation ==
* API: Andrei + Francois
* tools: WhyML (JC), IDE (Claude)
* tools: IDE (Claude)
* semantics:
* tutorial for API:
** build a task
......@@ -22,11 +22,17 @@
== Misc ==
* README (done)
* INSTALL (done)
* LICENSE (done)
* OCAML-LICENSE (TODO: Andrei)
* Builtin arrays in provers (Francois)
(done) make install
(done) debug "make -j"
* META for ocamlfind
* headers
* make install (done)
* make export (TODO: JCF)
* "make -j" (done)
* META for ocamlfind (TODO: ?)
* headers (TODO: ?)
......@@ -34,6 +40,7 @@
= Roadmap for 2011 =
* WhyML (JC)
* Jessie3
* traceability
* Coq plugin
......
......@@ -82,7 +82,7 @@ We gratefully thank all the people who contributed to this document:
\input{library.tex}
\input{whyml.tex}
% \input{whyml.tex}
\input{api.tex}
......
This diff is collapsed.
(**************************************************************************)
(* *)
(* Copyright (C) 2010- *)
(* Francois Bobot *)
(* Jean-Christophe Filliatre *)
(* Johannes Kanig *)
(* Andrei Paskevich *)
(* *)
(* This software is free software; you can redistribute it and/or *)
(* modify it under the terms of the GNU Library General Public *)
(* License version 2.1, with the special exception on linking *)
(* described in file LICENSE. *)
(* *)
(* This software is distributed in the hope that it will be useful, *)
(* but WITHOUT ANY WARRANTY; without even the implied warranty of *)
(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *)
(* *)
(**************************************************************************)
open Why
(** {1 Proof manager database} *)
(** {2 Current proof state} *)
(** prover data *)
type prover
(** abstract type for the set of provers of the database *)
val prover_name : prover -> string
(** name of a prover *)
val get_prover : string -> prover
(** retrieves prover from its unique name. creates a new prover if
needed. *)
(** status of an external proof attempt *)
type proof_attempt_status =
| Scheduled (** external proof attempt is scheduled *)
| Running (** external proof attempt is in progress *)
| Success (** external proof attempt succeeded *)
| Timeout (** external proof attempt was interrupted *)
| Unknown (** external prover answered ``don't know'' or equivalent *)
| HighFailure (** external prover call failed *)
val print_status : Format.formatter -> proof_attempt_status -> unit
type external_proof
(** abstract type for a proof attempt with an external prover *)
val prover : external_proof -> prover
(** the prover used for this attempt *)
val timelimit : external_proof -> int
(** the time limit chosen for this attempt *)
val memlimit : external_proof -> int
(** the memory limit chosen for this attempt *)
val status : external_proof -> proof_attempt_status
(** the current status for this attempt *)
val result_time : external_proof -> float
(** the time taken for this attempt. Only meaningfull for attempts
that are not Scheduled or Running. *)
val trace : external_proof -> string
(** a trace of execution of this attempt. Not used yet. *)
val proof_obsolete : external_proof -> bool
(** this attempt became obsolete because goal has changed. *)
type goal
(** abstract type for goals *)
(** module Goal to allow use of goals in Hashtables or Map or Set *)
module Goal : sig
type t = goal
val hash : t -> int
val equal : t -> t -> bool
val compare : t -> t -> int
end
type transf_data =
{ transf_name : string;
transf_action : Task.task Trans.tlist
}
type transf
(** goal accessors *)
val goal_name : goal -> string
(** returns a goal's name, if any *)
(*
val parent : goal -> transf option
*)
val goal_task : goal -> Task.task
val goal_task_checksum: goal -> string
val external_proofs : goal -> external_proof list
(** returns the set of external proof attempt for that goal *)
val transformations : goal -> transf list
val goal_proved : goal -> bool
(** tells if the goal is proved valid or not.
It returns true iff either
{ul {li exists proof p in [external_proofs g] s.t.
proof_obsolete p == false and status p = Valid}}
or
{ul {li exists transf t in [transformations g] s.t.
transf_obsolete t == false and
forall g in [subgoals t], [goal_proved g]}}
*)
(** transf accessors *)
val transf_data : transf -> transf_data
val transf_obsolete : transf -> bool
val subgoals : transf -> goal list
(** {2 The persistent database} *)
val init_base : string -> unit
(** opens or creates the current database, from given file name *)
val root_goals : unit -> goal list
(** returns the current set of root goals *)
(** {2 attempts to solve goals} *)
exception AlreadyAttempted
val try_prover :
async:((unit->unit)->unit) ->
debug:bool -> timelimit:int -> memlimit:int -> prover:prover ->
command:string -> driver:Driver.driver -> goal ->
(unit -> proof_attempt_status)
(** attempts to prove goal with the given prover. This function
prepares the goal for that prover, adds it as an new
external_proof attempt, setting its current status to Scheduled,
and returns immmediately a function. When called, this function
actually sets the status to running, launches the prover, and
waits for its termination. Upon termination of the external
process, the prover's answer is retrieved and database is
updated, that is the [proved] field of the database is updated,
and also these of any goal affected, according to invariant
above. The prover result is also returned.
Although goal preparation is not re-entrant, the function
returned initially is re-entrant, thus is suitable for being executed
in a thread, in contexts where background execution of provers is wanted.
@param timelimit CPU time limit given for that attempt, in
seconds, must be positive. (unlimited attempts are not allowed
with this function)
@param memlimit memory limit given for that attempt, must be
positive. If not given, does not limit memory consumption
@raise AlreadyAttempted if there already exists a non-obsolete
external proof attempt with the same prover and time limit, or
with a lower or equal time limit and a result different from Timeout
*)
val add_transformation: goal -> transf -> unit
(** adds a transformation on the goal. This function adds a new
corresponding attempt for that goal, computes the subgoals and
and them in the database. In the case where no subgoal is
genereated, the [proved] field is updated, and those of parent
goals.
if this transformation has already been attempted but is markes
as obsolete, it is retried, and the new lists of goals is
carefully matched with the older subgoals, so that if some
subgoals are identical to older ones, then the proof is kept.
Notice that no old proof attempts should be lost in this
process, e.g if the old trans formation produced 3 subgoals
A,B,C, C was proved interactively, and the new transformations
produces only 2 goals, the interactive proof of C is keep in an
extra dummy goal "true"
@raise AlreadyAttempted if this transformation has already been attempted
and is not obsolete
*)
(** TODO: removal of attempts *)
(* {2 goal updates} *)
val add_or_replace_task: tname:string -> name:string -> Task.task -> goal
(** updates the database with the new goal called [name] in the
theory called [tname]. If a goal with the same [(tname,name)]
already exists, it is checked whether the task to prove is
different or not. If it is the same, proof attempts are
preserved. If not the same, former proof attempts are marked as
obsolete.
WARNING: the current implementation always adds a new task,
without checking if it already exists
IMPORTANT: this kills every running prover tasks
*)
(** TODO: full update, removing goals that are not pertinent anymore *)
(**************************************************************************)
(* *)
(* Copyright (C) 2010- *)
(* Francois Bobot *)
(* Jean-Christophe Filliatre *)
(* Johannes Kanig *)
(* Andrei Paskevich *)
(* *)
(* This software is free software; you can redistribute it and/or *)
(* modify it under the terms of the GNU Library General Public *)
(* License version 2.1, with the special exception on linking *)
(* described in file LICENSE. *)
(* *)
(* This software is distributed in the hope that it will be useful, *)
(* but WITHOUT ANY WARRANTY; without even the implied warranty of *)
(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *)
(* *)
(**************************************************************************)
let pname = "[Why-rustprover]"
let () = ignore (GtkMain.Main.init ())
open Format
open Why
open Whyconf
(******************************)
(* loading user configuration *)
(******************************)
let config =
try
Whyconf.read_config None
with
| Not_found ->
eprintf "%s No config file found.@." pname;
exit 1
| e ->
eprintf "%a@." Exn_printer.exn_printer e;
exit 1
let () = eprintf "%s Load path is: %a@." pname
(Pp.print_list Pp.comma Pp.string) config.loadpath
let timelimit =
match config.timelimit with
| None -> 2
| Some n -> n
(* TODO: put that in config file *)
let window_width = 1024
let window_height = 768
let font_name = "Monospace 10"
let split = ref false
let spec = [
"-split", Arg.Set split, "split all goals";
]
let usage_str = "why-rustprover [options] <file>.why"
let file = ref None
let set_file f = match !file with
| Some _ ->
raise (Arg.Bad "only one file")
| None ->
(*
if not (Filename.check_suffix f ".why") then
raise (Arg.Bad ("don't know what to do with " ^ f));
*)
if not (Sys.file_exists f) then begin
Format.eprintf "%s %s: no such file@." pname f;
exit 1
end;
file := Some f
let () = Arg.parse spec set_file usage_str
let fname = match !file with
| None ->
Arg.usage spec usage_str;
exit 1
| Some f ->
f
let lang =
let load_path =
List.fold_right Filename.concat
[Filename.dirname Sys.argv.(0); ".."; "share"] "lang"
in
let languages_manager =
GSourceView2.source_language_manager ~default:true
in
languages_manager#set_search_path
(load_path :: languages_manager#search_path);
match languages_manager#language "why" with
| None -> Format.eprintf "pas trouv@;"; None
| Some _ as l -> l
let source_text =
let ic = open_in fname in
let size = in_channel_length ic in
let buf = String.create size in
really_input ic buf 0 size;
close_in ic;
buf
let env = Why.Env.create_env (Why.Typing.retrieve config.loadpath)
(***********************)
(* Parsing input file *)
(***********************)
let theories : Theory.theory Theory.Mnm.t =
try
let cin = open_in fname in
let m = Env.read_channel env fname cin in
close_in cin;
eprintf "Parsing/Typing Ok@.";
m
with e ->
eprintf "%a@." Exn_printer.exn_printer e;
exit 1
(********************)
(* opening database *)
(********************)
let () = Db.init_base (fname ^ ".db")
let get_driver name =
let pi = Util.Mstr.find name config.provers in
Why.Driver.load_driver env pi.Whyconf.driver
type prover_data =
{ prover : Db.prover;
command : string;
driver : Why.Driver.driver;
}
let provers_data =
printf "===============================@\nProvers: ";
let l =
Util.Mstr.fold
(fun id conf acc ->
let name = conf.Whyconf.name in
printf " %s, " name;
{ prover = Db.get_prover name;
command = conf.Whyconf.command;
driver = get_driver id; } :: acc
) config.provers []
in
printf "@\n===============================@.";
l
let find_prover s =
match
List.fold_left
(fun acc p ->
if Db.prover_name p.prover = s then Some p else acc)
None provers_data
with
| None -> assert false
| Some p -> p
let alt_ergo = find_prover "Alt-Ergo"
let simplify = find_prover "simplify"
let z3 = find_prover "Z3"
let () =
printf "previously known goals:@\n";
List.iter (fun s -> printf "%s@\n" (Db.goal_task_checksum s)) (Db.root_goals ());
printf "@."
(****************)
(* goals widget *)
(****************)
module Ide_goals = struct
let cols = new GTree.column_list
let name_column = cols#add Gobject.Data.string
let id_column = cols#add Gobject.Data.caml
let status_column = cols#add Gobject.Data.gobject
let time_column = cols#add Gobject.Data.string
let renderer = GTree.cell_renderer_text [`XALIGN 0.]
let image_renderer = GTree.cell_renderer_pixbuf [ ]
let view_name_column =
GTree.view_column ~title:"Theories/Goals"
~renderer:(renderer, ["text", name_column]) ()
let () =
view_name_column#set_resizable true;
view_name_column#set_max_width 400
let view_status_column =
GTree.view_column ~title:"Status"
(*
~renderer:(icon_renderer, ["stock_id", status_column])
*)
~renderer:(image_renderer, ["pixbuf", status_column])
()
<