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 = \ ...@@ -1916,9 +1916,11 @@ MODULESTODOC = \
util/extmap util/extset util/exthtbl \ util/extmap util/extset util/exthtbl \
util/weakhtbl util/stdlib util/rc util/debug \ util/weakhtbl util/stdlib util/rc util/debug \
core/ident core/ty core/term core/decl core/theory \ 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 \ 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_ty whyml/mlw_expr whyml/mlw_decl whyml/mlw_module \
whyml/mlw_wp whyml/mlw_wp
......
(********************************************************************) (********************************************************************)
(* *) (* *)
(* The Why3 Verification Platform / The Why3 Development Team *) (* 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 *) (* 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 *)
......
...@@ -14,6 +14,8 @@ ...@@ -14,6 +14,8 @@
open Ident open Ident
open Ty open Ty
(** {1 Terms and Formulas} *)
(** {2 Variable symbols} *) (** {2 Variable symbols} *)
type vsymbol = private { type vsymbol = private {
......
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
(* *) (* *)
(********************************************************************) (********************************************************************)
(** Task transformations *)
open Ty open Ty
open Term open Term
open Decl open Decl
...@@ -16,7 +18,7 @@ open Theory ...@@ -16,7 +18,7 @@ open Theory
open Task open Task
open Stdlib open Stdlib
(** Task transformation *) (** {2 Transformations} *)
type 'a trans type 'a trans
type 'a tlist = 'a list trans type 'a tlist = 'a list trans
...@@ -33,19 +35,20 @@ val bind : 'a trans -> ('a -> 'b trans) -> 'b trans ...@@ -33,19 +35,20 @@ val bind : 'a trans -> ('a -> 'b trans) -> 'b trans
val trace_goal : string -> task trans -> task trans val trace_goal : string -> task trans -> task trans
(** Compose transformation *) (** {2 Compose transformations} *)
val compose : task trans -> 'a trans -> 'a trans val compose : task trans -> 'a trans -> 'a trans
val compose_l : task tlist -> 'a tlist -> 'a tlist val compose_l : task tlist -> 'a tlist -> 'a tlist
val seq : task trans list -> task trans val seq : task trans list -> task trans
val seq_l : task tlist list -> task tlist val seq_l : task tlist list -> task tlist
val par : task trans list -> task tlist
(** parallelize transformations: [par l] will duplicate the current (** parallelize transformations: [par l] will duplicate the current
task in [n] new tasks, with [n] the length of [l], and apply to each of task in [n] new tasks, with [n] the length of [l], and apply to each of
this new task the corresponding transformation in [l] *) 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 : (task_hd -> 'a -> 'a ) -> 'a -> 'a trans
val fold_l : (task_hd -> 'a -> 'a list) -> 'a -> 'a tlist val fold_l : (task_hd -> 'a -> 'a list) -> 'a -> 'a tlist
...@@ -83,7 +86,7 @@ val add_tdecls : tdecl list -> task trans ...@@ -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) *) (** [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_meta : meta -> (meta_arg list list -> 'a trans) -> 'a trans
val on_theory : theory -> (symbol_map 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 ...@@ -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_ls : meta -> (Sls.t -> 'a trans) -> 'a trans
val on_tagged_pr : meta -> (Spr.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 UnknownFlagTrans of meta * string * string list
exception IllegalFlagTrans of meta exception IllegalFlagTrans of meta
...@@ -122,7 +125,7 @@ val on_flag : meta -> ('a,'b) flag_trans -> string -> 'a -> 'b trans ...@@ -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 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 val print_meta : Debug.flag -> meta -> task trans
(** [print_meta f m] is an identity transformation that (** [print_meta f m] is an identity transformation that
...@@ -164,21 +167,28 @@ val named : string -> 'a trans -> 'a trans ...@@ -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 = { type naming_table = {
namespace : namespace; namespace : namespace;
known_map : known_map; known_map : known_map;
printer : Ident.ident_printer; 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 exception Bad_name_table of string
val empty_naming_table : naming_table val empty_naming_table : naming_table
type trans_with_args = string list -> Env.env -> naming_table -> task trans 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 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 Stdlib
open Smt2_model_defs open Smt2_model_defs
open Strings 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 *) (* Debugging function *)
val print_table: 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 open Stdlib
type variable = string 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 open Stdlib
type variable = string 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 module History = struct
type 'a hole_list = 'a list * 'a list 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 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 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 Why3
open Format open Format
open Gconfig 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 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 Why3.Strings
open Format 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 Format
open Session_itp open Session_itp
......
(********************************************************************) (********************************************************************)
(* *) (* *)
(* The Why3 Verification Platform / The Why3 Development Team *) (* 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 *) (* 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 *)
...@@ -9,11 +9,14 @@ ...@@ -9,11 +9,14 @@
(* *) (* *)
(********************************************************************) (********************************************************************)
(** Controller to run provers and transformations asynchronously on goals of a session
*)
open Session_itp open Session_itp
exception Noprogress
(** State of a proof *) (** {2 State of a proof or transformation in progress} *)
type proof_attempt_status = type proof_attempt_status =
| Unedited (** editor not yet run for interactive proof *) | Unedited (** editor not yet run for interactive proof *)
| JustEdited (** edited but not run yet *) | JustEdited (** edited but not run yet *)
...@@ -37,6 +40,10 @@ type strategy_status = STSgoto of proofNodeID * int | STShalt ...@@ -37,6 +40,10 @@ type strategy_status = STSgoto of proofNodeID * int | STShalt
val print_strategy_status : Format.formatter -> strategy_status -> unit val print_strategy_status : Format.formatter -> strategy_status -> unit
exception Noprogress
(** {2 Signature for asynchronous schedulers} *)
module type Scheduler = sig module type Scheduler = sig
(** Any module of this signature should implement a scheduler, (** Any module of this signature should implement a scheduler,
...@@ -61,6 +68,9 @@ module type Scheduler = sig ...@@ -61,6 +68,9 @@ module type Scheduler = sig
end end
(** {2 Controllers} *)
type controller = private type controller = private
{ mutable controller_session : Session_itp.session; { mutable controller_session : Session_itp.session;
controller_config : Whyconf.config; controller_config : Whyconf.config;
...@@ -138,6 +148,8 @@ val remove_subtree: controller -> notification:notifier -> removed:notifier -> ...@@ -138,6 +148,8 @@ val remove_subtree: controller -> notification:notifier -> removed:notifier ->
val get_undetached_children_no_pa: Session_itp.session -> any -> any list val get_undetached_children_no_pa: Session_itp.session -> any -> any list
(** {2 Scheduled jobs} *)
module Make(S : Scheduler) : sig module Make(S : Scheduler) : sig
val set_max_tasks : int -> unit 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 *) (* Information that the IDE may want to have *)
type prover = string type prover = string
type transformation = 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 prover = string
type transformation = string type transformation = string
type strategy = string type strategy = string
...@@ -7,7 +18,7 @@ val root_node : node_ID ...@@ -7,7 +18,7 @@ val root_node : node_ID
(* --------------------------- types to be expanded if needed --------------------------------- *) (* --------------------------- 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 *) shared with the IDE through communication *)
type global_information = type global_information =
{ {
...@@ -26,21 +37,21 @@ type global_information = ...@@ -26,21 +37,21 @@ type global_information =
type message_notification = type message_notification =
| Proof_error of node_ID * string | Proof_error of node_ID * string
| Transf_error of node_ID * string * string * Loc.position * 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 | Strat_error of node_ID * string
| Replay_Info of string | Replay_Info of string
| Query_Info of node_ID * string | Query_Info of node_ID * string
| Query_Error of node_ID * string | Query_Error of node_ID * string
| Help of string | Help of string
(* General information *) (** General information *)
| Information of string | Information of string
(* Number of task scheduled, running, etc *) (** Number of task scheduled, running, etc *)
| Task_Monitor of int * int * int | 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 | Parse_Or_Type_Error of Loc.position * string
(* [File_Saved f] f was saved *) (** [File_Saved f] f was saved *)
| File_Saved of string | 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 | Error of string
| Open_File_Error of string | Open_File_Error of string
...@@ -52,7 +63,7 @@ type node_type = ...@@ -52,7 +63,7 @@ type node_type =
| NGoal | NGoal
| NProofAttempt | 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 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. *) to the goal of the task will have Goal_color in the source code. *)
type color = type color =
...@@ -69,29 +80,29 @@ type update_info = ...@@ -69,29 +80,29 @@ type update_info =
type notification = type notification =
| New_node of node_ID * node_ID * node_type * string * bool | 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). *) New_node (new_node, parent_node, node_type, name, detached). *)
| Node_change of node_ID * update_info | 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 | 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 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 *) next unproven node from this node *)
| Initialized of global_information | Initialized of global_information
(* initial global data *) (** initial global data *)
| Saved | Saved
(* the session was saved on disk *) (** the session was saved on disk *)
| Message of message_notification | Message of message_notification
(* an informative message, can be an error message *) (** an informative message, can be an error message *)
| Dead of string | Dead of string
(* server exited *) (** server exited *)
| Task of node_ID * string * (Loc.position * color) list | 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, source code corresponding to different part of the task (premise, goal,
etc) *) etc) *)
| File_contents of string * string | File_contents of string * string
(* File_contents (filename, contents) *) (** File_contents (filename, contents) *)
type ide_request = type ide_request =
| Command_req of node_ID * string | Command_req of node_ID * string
...@@ -99,23 +110,21 @@ type ide_request = ...@@ -99,23 +110,21 @@ type ide_request =
| Transform_req of node_ID * transformation * string list | Transform_req of node_ID * transformation * string list
| Strategy_req of node_ID * strategy