Commit 1844cd87 authored by MARCHE Claude's avatar MARCHE Claude

A bit of cleaning, better renaming, and improvement of API documentation

parent bccdfacc
......@@ -1916,9 +1916,11 @@ MODULESTODOC = \
util/extmap util/extset util/exthtbl \
util/weakhtbl util/stdlib util/rc util/debug \
core/ident core/ty core/term core/decl core/theory \
core/env core/task \
core/env core/task core/trans \
driver/whyconf driver/call_provers driver/driver \
session/session session/session_tools session/session_scheduler \
transform/args_wrapper \
session/session_itp session/controller_itp \
session/itp_communication session/itp_server \
whyml/mlw_ty whyml/mlw_expr whyml/mlw_decl whyml/mlw_module \
whyml/mlw_wp
......
(********************************************************************)
(* *)
(* The Why3 Verification Platform / The Why3 Development Team *)
(* Copyright 2010-2015 -- INRIA - CNRS - Paris-Sud University *)
(* Copyright 2010-2017 -- INRIA - CNRS - Paris-Sud University *)
(* *)
(* This software is distributed under the terms of the GNU Lesser *)
(* General Public License version 2.1, with the special exception *)
......
......@@ -14,6 +14,8 @@
open Ident
open Ty
(** {1 Terms and Formulas} *)
(** {2 Variable symbols} *)
type vsymbol = private {
......
......@@ -9,6 +9,8 @@
(* *)
(********************************************************************)
(** Task transformations *)
open Ty
open Term
open Decl
......@@ -16,7 +18,7 @@ open Theory
open Task
open Stdlib
(** Task transformation *)
(** {2 Transformations} *)
type 'a trans
type 'a tlist = 'a list trans
......@@ -33,19 +35,20 @@ val bind : 'a trans -> ('a -> 'b trans) -> 'b trans
val trace_goal : string -> task trans -> task trans
(** Compose transformation *)
(** {2 Compose transformations} *)
val compose : task trans -> 'a trans -> 'a trans
val compose_l : task tlist -> 'a tlist -> 'a tlist
val seq : task trans list -> task trans
val seq_l : task tlist list -> task tlist
val par : task trans list -> task tlist
(** parallelize transformations: [par l] will duplicate the current
task in [n] new tasks, with [n] the length of [l], and apply to each of
this new task the corresponding transformation in [l] *)
val par : task trans list -> task tlist
(** Create Transformation *)
(** {2 Iterating transformations} *)
val fold : (task_hd -> 'a -> 'a ) -> 'a -> 'a trans
val fold_l : (task_hd -> 'a -> 'a list) -> 'a -> 'a tlist
......@@ -83,7 +86,7 @@ val add_tdecls : tdecl list -> task trans
(** [add_decls ld t1] adds decls ld at the end of the task t1 (before the goal) *)
(* Dependent Transformations *)
(** {2 Dependent Transformations} *)
val on_meta : meta -> (meta_arg list list -> 'a trans) -> 'a trans
val on_theory : theory -> (symbol_map list -> 'a trans) -> 'a trans
......@@ -104,7 +107,7 @@ val on_tagged_ts : meta -> (Sts.t -> 'a trans) -> 'a trans
val on_tagged_ls : meta -> (Sls.t -> 'a trans) -> 'a trans
val on_tagged_pr : meta -> (Spr.t -> 'a trans) -> 'a trans
(* Flag-dependent Transformations *)
(** {2 Flag-dependent Transformations} *)
exception UnknownFlagTrans of meta * string * string list
exception IllegalFlagTrans of meta
......@@ -122,7 +125,7 @@ val on_flag : meta -> ('a,'b) flag_trans -> string -> 'a -> 'b trans
val on_flag_t : meta -> ('a,'b) flag_trans -> ('a -> 'b trans) -> 'a -> 'b trans
(** Debug Transformations *)
(** {2 Debug Transformations} *)
val print_meta : Debug.flag -> meta -> task trans
(** [print_meta f m] is an identity transformation that
......@@ -164,21 +167,28 @@ val named : string -> 'a trans -> 'a trans
*)
(* In order to interpret, that is type, string arguments as symbols or terms,
a transformation needs a [naming_table], which is used for looking up strings (the namespace)
and also for printing (the printer), both must be coherent *)
type naming_table = {
namespace : namespace;
known_map : known_map;
printer : Ident.ident_printer;
}
(** In order to interpret, that is type, string arguments as symbols or
terms, a transformation may need a [naming_table]. Typing arguments
requires looking up identifiers into the [namespace] and also
looking up declarations into the [known_map]. Since the identifiers
given as arguments come from the task as it is displayed to the
user, we need to ensure that the names in the [namespace] are
coherent with the names that are printed, this why we also record
the [printer].
See module [Args_wrapper] for the functions that builds objects of
type [naming_table] from given tasks, and types the arguments of
transformations. *)
exception Bad_name_table of string
val empty_naming_table : naming_table
type trans_with_args = string list -> Env.env -> naming_table -> task trans
type trans_with_args_l = string list -> Env.env -> naming_table -> task tlist
......
(********************************************************************)
(* *)
(* The Why3 Verification Platform / The Why3 Development Team *)
(* Copyright 2010-2017 -- INRIA - CNRS - Paris-Sud University *)
(* *)
(* This software is distributed under the terms of the GNU Lesser *)
(* General Public License version 2.1, with the special exception *)
(* on linking described in file LICENSE. *)
(* *)
(********************************************************************)
open Stdlib
open Smt2_model_defs
open Strings
......
(********************************************************************)
(* *)
(* The Why3 Verification Platform / The Why3 Development Team *)
(* Copyright 2010-2017 -- INRIA - CNRS - Paris-Sud University *)
(* *)
(* This software is distributed under the terms of the GNU Lesser *)
(* General Public License version 2.1, with the special exception *)
(* on linking described in file LICENSE. *)
(* *)
(********************************************************************)
(* Debugging function *)
val print_table:
......
(********************************************************************)
(* *)
(* The Why3 Verification Platform / The Why3 Development Team *)
(* Copyright 2010-2017 -- INRIA - CNRS - Paris-Sud University *)
(* *)
(* This software is distributed under the terms of the GNU Lesser *)
(* General Public License version 2.1, with the special exception *)
(* on linking described in file LICENSE. *)
(* *)
(********************************************************************)
open Stdlib
type variable = string
......
(********************************************************************)
(* *)
(* The Why3 Verification Platform / The Why3 Development Team *)
(* Copyright 2010-2017 -- INRIA - CNRS - Paris-Sud University *)
(* *)
(* This software is distributed under the terms of the GNU Lesser *)
(* General Public License version 2.1, with the special exception *)
(* on linking described in file LICENSE. *)
(* *)
(********************************************************************)
open Stdlib
type variable = string
......
(********************)
(* Terminal history *)
(********************)
(********************************************************************)
(* *)
(* The Why3 Verification Platform / The Why3 Development Team *)
(* Copyright 2010-2017 -- INRIA - CNRS - Paris-Sud University *)
(* *)
(* This software is distributed under the terms of the GNU Lesser *)
(* General Public License version 2.1, with the special exception *)
(* on linking described in file LICENSE. *)
(* *)
(********************************************************************)
module History = struct
type 'a hole_list = 'a list * 'a list
......
(********************************************************************)
(* *)
(* The Why3 Verification Platform / The Why3 Development Team *)
(* Copyright 2010-2017 -- INRIA - CNRS - Paris-Sud University *)
(* *)
(* This software is distributed under the terms of the GNU Lesser *)
(* General Public License version 2.1, with the special exception *)
(* on linking described in file LICENSE. *)
(* *)
(********************************************************************)
module History : sig
......
(********************************************************************)
(* *)
(* The Why3 Verification Platform / The Why3 Development Team *)
(* Copyright 2010-2017 -- INRIA - CNRS - Paris-Sud University *)
(* *)
(* This software is distributed under the terms of the GNU Lesser *)
(* General Public License version 2.1, with the special exception *)
(* on linking described in file LICENSE. *)
(* *)
(********************************************************************)
open Why3
......
(********************************************************************)
(* *)
(* The Why3 Verification Platform / The Why3 Development Team *)
(* Copyright 2010-2017 -- INRIA - CNRS - Paris-Sud University *)
(* *)
(* This software is distributed under the terms of the GNU Lesser *)
(* General Public License version 2.1, with the special exception *)
(* on linking described in file LICENSE. *)
(* *)
(********************************************************************)
open Why3
open Format
open Gconfig
......
(********************************************************************)
(* *)
(* The Why3 Verification Platform / The Why3 Development Team *)
(* Copyright 2010-2017 -- INRIA - CNRS - Paris-Sud University *)
(* *)
(* This software is distributed under the terms of the GNU Lesser *)
(* General Public License version 2.1, with the special exception *)
(* on linking described in file LICENSE. *)
(* *)
(********************************************************************)
open Why3
......
(********************************************************************)
(* *)
(* The Why3 Verification Platform / The Why3 Development Team *)
(* Copyright 2010-2017 -- INRIA - CNRS - Paris-Sud University *)
(* *)
(* This software is distributed under the terms of the GNU Lesser *)
(* General Public License version 2.1, with the special exception *)
(* on linking described in file LICENSE. *)
(* *)
(********************************************************************)
open Why3.Strings
open Format
......
(********************************************************************)
(* *)
(* The Why3 Verification Platform / The Why3 Development Team *)
(* Copyright 2010-2017 -- INRIA - CNRS - Paris-Sud University *)
(* *)
(* This software is distributed under the terms of the GNU Lesser *)
(* General Public License version 2.1, with the special exception *)
(* on linking described in file LICENSE. *)
(* *)
(********************************************************************)
......
(********************************************************************)
(* *)
(* The Why3 Verification Platform / The Why3 Development Team *)
(* Copyright 2010-2017 -- INRIA - CNRS - Paris-Sud University *)
(* *)
(* This software is distributed under the terms of the GNU Lesser *)
(* General Public License version 2.1, with the special exception *)
(* on linking described in file LICENSE. *)
(* *)
(********************************************************************)
open Format
open Session_itp
......
(********************************************************************)
(* *)
(* The Why3 Verification Platform / The Why3 Development Team *)
(* Copyright 2010-2015 -- INRIA - CNRS - Paris-Sud University *)
(* Copyright 2010-2017 -- INRIA - CNRS - Paris-Sud University *)
(* *)
(* This software is distributed under the terms of the GNU Lesser *)
(* General Public License version 2.1, with the special exception *)
......@@ -9,11 +9,14 @@
(* *)
(********************************************************************)
(** Controller to run provers and transformations asynchronously on goals of a session
*)
open Session_itp
exception Noprogress
(** State of a proof *)
(** {2 State of a proof or transformation in progress} *)
type proof_attempt_status =
| Unedited (** editor not yet run for interactive proof *)
| JustEdited (** edited but not run yet *)
......@@ -37,6 +40,10 @@ type strategy_status = STSgoto of proofNodeID * int | STShalt
val print_strategy_status : Format.formatter -> strategy_status -> unit
exception Noprogress
(** {2 Signature for asynchronous schedulers} *)
module type Scheduler = sig
(** Any module of this signature should implement a scheduler,
......@@ -61,6 +68,9 @@ module type Scheduler = sig
end
(** {2 Controllers} *)
type controller = private
{ mutable controller_session : Session_itp.session;
controller_config : Whyconf.config;
......@@ -138,6 +148,8 @@ val remove_subtree: controller -> notification:notifier -> removed:notifier ->
val get_undetached_children_no_pa: Session_itp.session -> any -> any list
(** {2 Scheduled jobs} *)
module Make(S : Scheduler) : sig
val set_max_tasks : int -> unit
......
(********************************************************************)
(* *)
(* The Why3 Verification Platform / The Why3 Development Team *)
(* Copyright 2010-2017 -- INRIA - CNRS - Paris-Sud University *)
(* *)
(* This software is distributed under the terms of the GNU Lesser *)
(* General Public License version 2.1, with the special exception *)
(* on linking described in file LICENSE. *)
(* *)
(********************************************************************)
(* Information that the IDE may want to have *)
type prover = string
type transformation = string
......
(********************************************************************)
(* *)
(* The Why3 Verification Platform / The Why3 Development Team *)
(* Copyright 2010-2017 -- INRIA - CNRS - Paris-Sud University *)
(* *)
(* This software is distributed under the terms of the GNU Lesser *)
(* General Public License version 2.1, with the special exception *)
(* on linking described in file LICENSE. *)
(* *)
(********************************************************************)
type prover = string
type transformation = string
type strategy = string
......@@ -7,7 +18,7 @@ val root_node : node_ID
(* --------------------------- types to be expanded if needed --------------------------------- *)
(* Global information known when server process has started and that can be
(** Global information known when server process has started and that can be
shared with the IDE through communication *)
type global_information =
{
......@@ -26,21 +37,21 @@ type global_information =
type message_notification =
| Proof_error of node_ID * string
| Transf_error of node_ID * string * string * Loc.position * string
(* Transf_error (nid, trans_with_arg, arg_opt, loc, error_msg *)
(** Transf_error (nid, trans_with_arg, arg_opt, loc, error_msg *)
| Strat_error of node_ID * string
| Replay_Info of string
| Query_Info of node_ID * string
| Query_Error of node_ID * string
| Help of string
(* General information *)
(** General information *)
| Information of string
(* Number of task scheduled, running, etc *)
(** Number of task scheduled, running, etc *)
| Task_Monitor of int * int * int
(* A file was read or reloaded and now contains a parsing or typing error *)
(** A file was read or reloaded and now contains a parsing or typing error *)
| Parse_Or_Type_Error of Loc.position * string
(* [File_Saved f] f was saved *)
(** [File_Saved f] f was saved *)
| File_Saved of string
(* An error happened that could not be identified in server *)
(** An error happened that could not be identified in server *)
| Error of string
| Open_File_Error of string
......@@ -52,7 +63,7 @@ type node_type =
| NGoal
| NProofAttempt
(* Used to give colors to the parts of the source code that corresponds to the
(** Used to give colors to the parts of the source code that corresponds to the
following property in the current task. For example, the code corresponding
to the goal of the task will have Goal_color in the source code. *)
type color =
......@@ -69,29 +80,29 @@ type update_info =
type notification =
| New_node of node_ID * node_ID * node_type * string * bool
(* Notification of creation of new_node:
(** Notification of creation of new_node:
New_node (new_node, parent_node, node_type, name, detached). *)
| Node_change of node_ID * update_info
(* inform that the data of the given node changed *)
(** inform that the data of the given node changed *)
| Remove of node_ID
(* the given node was removed *)
(** the given node was removed *)
| Next_Unproven_Node_Id of node_ID * node_ID
(* Next_Unproven_Node_Id (asked_id, next_unproved_id). Returns a node and the
(** Next_Unproven_Node_Id (asked_id, next_unproved_id). Returns a node and the
next unproven node from this node *)
| Initialized of global_information
(* initial global data *)
(** initial global data *)
| Saved
(* the session was saved on disk *)
(** the session was saved on disk *)
| Message of message_notification
(* an informative message, can be an error message *)
(** an informative message, can be an error message *)
| Dead of string
(* server exited *)
(** server exited *)
| Task of node_ID * string * (Loc.position * color) list
(* the node_ID's task together with information that allows to color the
(** the node_ID's task together with information that allows to color the
source code corresponding to different part of the task (premise, goal,
etc) *)
| File_contents of string * string
(* File_contents (filename, contents) *)
(** File_contents (filename, contents) *)
type ide_request =
| Command_req of node_ID * string
......@@ -99,23 +110,21 @@ type ide_request =
| Transform_req of node_ID * transformation * string list
| Strategy_req of node_ID * strategy
| Edit_req of node_ID * prover
(*
| Open_session_req of string
*)
| Add_file_req of string
| Set_max_tasks_req of int
| Get_file_contents of string
| Get_task of node_ID * bool
(** [Get_task(id,b) requests for the text of the task in node [id], when [b] is true
then quantified variables and hypotheses are introduced as local definitions *)
(** [Get_task(id,b)] requests for the text of the task in node [id],
when [b] is true then quantified variables and hypotheses are
introduced as local definitions *)
| Focus_req of node_ID
(* Focus on a node. The server only sends info about descendants of this ID *)
(** Focus on a node. The server only sends info about descendants of this ID *)
| Unfocus_req
| Remove_subtree of node_ID
| Copy_paste of node_ID * node_ID
| Copy_detached of node_ID
| Save_file_req of string * string
(* Save_file_req (filename, content_of_file). Save the file *)
(** [Save_file_req(filename, content_of_file)] save the file *)
| Get_first_unproven_node of node_ID
| Mark_obsolete_req of node_ID
| Get_Session_Tree_req
......
(********************************************************************)
(* *)
(* The Why3 Verification Platform / The Why3 Development Team *)
(* Copyright 2010-2017 -- INRIA - CNRS - Paris-Sud University *)
(* *)
(* This software is distributed under the terms of the GNU Lesser *)
(* General Public License version 2.1, with the special exception *)
(* on linking described in file LICENSE. *)
(* *)
(********************************************************************)
open Format
open Stdlib
open Session_itp
......
(********************************************************************)
(* *)
(* The Why3 Verification Platform / The Why3 Development Team *)
(* Copyright 2010-2017 -- INRIA - CNRS - Paris-Sud University *)
(* *)
(* This software is distributed under the terms of the GNU Lesser *)
(* General Public License version 2.1, with the special exception *)
(* on linking described in file LICENSE. *)
(* *)
(********************************************************************)
open Itp_communication
......
(********************************************************************)
(* *)
(* The Why3 Verification Platform / The Why3 Development Team *)
(* Copyright 2010-2017 -- INRIA - CNRS - Paris-Sud University *)
(* *)
(* This software is distributed under the terms of the GNU Lesser *)
(* General Public License version 2.1, with the special exception *)
(* on linking described in file LICENSE. *)
(* *)
(********************************************************************)
open Itp_communication
open Controller_itp
open Call_provers
......
(********************************************************************)
(* *)
(* The Why3 Verification Platform / The Why3 Development Team *)
(* Copyright 2010-2017 -- INRIA - CNRS - Paris-Sud University *)
(* *)
(* This software is distributed under the terms of the GNU Lesser *)
(* General Public License version 2.1, with the special exception *)
(* on linking described in file LICENSE. *)
(* *)
(********************************************************************)
open Itp_communication
(** Useful functions for printing *)
......
(********************************************************************)
(* *)
(* The Why3 Verification Platform / The Why3 Development Team *)
(* Copyright 2010-2017 -- INRIA - CNRS - Paris-Sud University *)
(* *)
(* This software is distributed under the terms of the GNU Lesser *)
(* General Public License version 2.1, with the special exception *)
(* on linking described in file LICENSE. *)
(* *)
(********************************************************************)
open Itp_server
......
(********************************************************************)
(* *)
(* The Why3 Verification Platform / The Why3 Development Team *)
(* Copyright 2010-2017 -- INRIA - CNRS - Paris-Sud University *)
(* *)
(* This software is distributed under the terms of the GNU Lesser *)
(* General Public License version 2.1, with the special exception *)
(* on linking described in file LICENSE. *)
(* *)
(********************************************************************)
let debug = Debug.register_flag ~desc:"ITP server" "itp_server"
let has_extension f =
......
(********************************************************************)
(* *)
(* The Why3 Verification Platform / The Why3 Development Team *)
(* Copyright 2010-2017 -- INRIA - CNRS - Paris-Sud University *)
(* *)
(* This software is distributed under the terms of the GNU Lesser *)
(* General Public License version 2.1, with the special exception *)
(* on linking described in file LICENSE. *)
(* *)
(********************************************************************)
val get_session_dir : allow_mkdir:bool -> string Queue.t -> string
......
(********************************************************************)
(* *)
(* The Why3 Verification Platform / The Why3 Development Team *)
(* Copyright 2010-2017 -- INRIA - CNRS - Paris-Sud University *)
(* *)
(* This software is distributed under the terms of the GNU Lesser *)
(* General Public License version 2.1, with the special exception *)
(* on linking described in file LICENSE. *)
(* *)
(********************************************************************)
......
(********************************************************************)
(* *)
(* The Why3 Verification Platform / The Why3 Development Team *)
(* Copyright 2010-2017 -- INRIA - CNRS - Paris-Sud University *)
(* *)
(* This software is distributed under the terms of the GNU Lesser *)
(* General Public License version 2.1, with the special exception *)
(* on linking described in file LICENSE. *)
(* *)
(********************************************************************)
(** Proof sessions *)
(** {1 New Proof sessions ("Refectoire")} *)
(** {2 upper level structure of sessions}