Commit d6538090 authored by Andrei Paskevich's avatar Andrei Paskevich

weekly trailing whitespace removal, thank you

parent 5b6a5d37
This diff is collapsed.
......@@ -48,22 +48,22 @@ val register_format : string -> string list -> read_channel -> unit
[f] is the function to perform parsing *)
exception NoFormat
exception UnknownExtension of string
exception UnknownExtension of string
exception UnknownFormat of string (* format name *)
val read_channel : ?format:string -> read_channel
(** [read_channel ?format env f c] returns the map of theories
in channel [c]. When given, [format] enforces the format, otherwise
the format is chosen according to [f]'s extension.
Beware that nothing ensures that [c] corresponds to the contents of [f]
the format is chosen according to [f]'s extension.
Beware that nothing ensures that [c] corresponds to the contents of [f]
@raise NoFormat if [format] is not given and [f] has no extension
@raise UnknownExtension [s] if the extension [s] is not known in
@raise UnknownExtension [s] if the extension [s] is not known in
any registered parser
@raise UnknownFormat [f] if the [format] is not registered
*)
val read_file : ?format:string -> env -> string -> theory Mnm.t
val read_file : ?format:string -> env -> string -> theory Mnm.t
(** [read_file ?format env f] returns the map of theories
in file [f]. When given, [format] enforces the format, otherwise
the format is chosen according to [f]'s extension. *)
......
......@@ -25,11 +25,11 @@ open Rc
let compilation_libdir = default_option Config.libdir Config.localdir
let compilation_datadir =
let compilation_datadir =
option_apply Config.datadir
(fun d -> Filename.concat d "share") Config.localdir
let compilation_loadpath =
let compilation_loadpath =
Filename.concat compilation_datadir "theories"
let default_conf_file =
......@@ -58,7 +58,7 @@ type main = {
running_provers_max : int;
(* max number of running prover processes *)
plugins : string list;
(* plugins to load, without extension, relative to
(* plugins to load, without extension, relative to
[private_libdir]/plugins *)
}
......@@ -76,7 +76,7 @@ let datadir m =
d
with Not_found -> m.private_datadir
let loadpath m =
let loadpath m =
try
let d = Sys.getenv "WHY3LOADPATH" in
(*
......
......@@ -711,7 +711,7 @@ module Goal = struct
WHERE goals.goal_theory=?"
in
let stmt = bind db sql [Sqlite3.Data.INT th] in
step_fold_gen db stmt
step_fold_gen db stmt
(fun stmt acc ->
let g = stmt_column_INT stmt 0 "Goal.of_theory" in
let n = stmt_column_string stmt 1 "Goal.of_theory" in
......@@ -723,7 +723,7 @@ module Goal = struct
WHERE goals.goal_transf=?"
in
let stmt = bind db sql [Sqlite3.Data.INT tr] in
step_fold_gen db stmt
step_fold_gen db stmt
(fun stmt acc ->
let g = stmt_column_INT stmt 0 "Goal.of_transf" in
let sum = stmt_column_string stmt 1 "Goal.of_transf" in
......@@ -763,7 +763,7 @@ module Transf = struct
in
db_must_ok db (fun () -> Sqlite3.exec db.raw_db sql)
let add db root_goal tr_id =
let add db root_goal tr_id =
transaction db
(fun () ->
let sql =
......@@ -910,10 +910,10 @@ let add_proof_attempt g pid = External_proof.add (current()) g pid
let set_status a r t =
External_proof.set_status (current()) a r t
let set_obsolete a =
External_proof.set_obsolete (current()) a
let set_obsolete a =
External_proof.set_obsolete (current()) a
let set_edited_as a f =
let set_edited_as a f =
External_proof.set_edited_as (current()) a f
let add_transformation g tr_id = Transf.add (current()) g tr_id
......
......@@ -40,7 +40,7 @@ type theory
type goal
(** each theory contains an ordered sequences of goals *)
type proof_attempt
type proof_attempt
(** each goal has a set of proof attempts, indeed a map indexed
by prover identifiers *)
......@@ -57,7 +57,7 @@ type proof_status =
| Unknown (** external prover answered ``don't know'' or equivalent *)
| Failure (** external prover call failed *)
(** parent of a goal: either a theory (for "toplevel" goals)
(** parent of a goal: either a theory (for "toplevel" goals)
or a transformation (for "subgoals") *)
(* useful ?
type goal_parent =
......@@ -80,7 +80,7 @@ val prover : proof_attempt -> prover_id
(*
val proof_goal : proof_attempt -> goal
*)
val status_and_time :
val status_and_time :
proof_attempt -> proof_status * float * bool * string
(** returns (status, time, obsolete flag, edited file name) *)
......@@ -107,7 +107,7 @@ val transf_id : transf -> transf_id
*)
val subgoals : transf -> goal Why.Util.Mstr.t
(** theory accessors *)
(** theory accessors *)
val theory_name : theory -> string
val goals : theory -> goal Why.Util.Mstr.t
(*
......@@ -176,7 +176,7 @@ val add_transformation : goal -> transf_id -> transf
val add_goal : theory -> string -> string -> goal
(** [add_goal th id sum] adds to theory [th] a new goal named [id], with
[sum] as the checksum of its task.
[sum] as the checksum of its task.
@raise AlreadyExist if a goal with the same id already exists
in this theory *)
......@@ -185,7 +185,7 @@ val change_checksum: goal -> string -> unit
val add_subgoal : transf -> string -> string -> goal
(** [add_subgoal t id sum] adds to transf [t] a new subgoal named [id], with
[sum] as the checksum of its task.
[sum] as the checksum of its task.
@raise AlreadyExist if a goal with the same id already exists
as subgoal of this transf *)
......@@ -203,7 +203,7 @@ val add_theory : file -> string -> theory
(** {3 files} *)
val add_file : string -> file
val add_file : string -> file
(** adds a file to the database.
@raise AlreadyExist if a file with the same id already exists *)
......@@ -213,7 +213,7 @@ val add_file : string -> file
(*
Local Variables:
......
......@@ -11,7 +11,7 @@ type prover_data =
mutable editor : string;
}
type t =
type t =
{ mutable window_width : int;
mutable window_height : int;
mutable tree_width : int;
......@@ -27,7 +27,7 @@ type t =
}
val get_prover_data : Why.Env.env -> string ->
Why.Whyconf.config_prover ->
Why.Whyconf.config_prover ->
prover_data Why.Util.Mstr.t -> prover_data Why.Util.Mstr.t
val save_config : unit -> unit
......@@ -68,7 +68,7 @@ val preferences : t -> unit
val run_auto_detection : t -> unit
(*
Local Variables:
Local Variables:
compile-command: "unset LANG; make -C ../.. bin/whyide.opt"
End:
End:
*)
This diff is collapsed.
......@@ -74,7 +74,7 @@ puis le relancer, et là on peut de nouveau déplier le fichier.
open Format
let () =
let () =
eprintf "Init the GTK interface...@?";
ignore (GtkMain.Main.init ());
eprintf " done.@."
......@@ -174,7 +174,7 @@ let project_dir, file_to_read =
else
begin
eprintf "Info: found regular file '%s'@." fname;
let d =
let d =
try Filename.chop_extension fname
with Invalid_argument _ -> fname
in
......@@ -402,37 +402,37 @@ let tools_window =
~title: "Why3 tool box"
()
let tools_window_vbox =
let tools_window_vbox =
GPack.vbox ~homogeneous:false ~packing:tools_window#add ()
*)
let tools_window_vbox =
let tools_window_vbox =
try
GPack.vbox ~packing:(hb#pack ~expand:false) ()
with Gtk.Error _ -> assert false
let tools_frame = GBin.frame ~label:"Provers"
let tools_frame = GBin.frame ~label:"Provers"
~packing:(tools_window_vbox#pack ~expand:false) ()
(*
let tools_frame = tools_window_vbox
*)
let tools_box = GPack.button_box `VERTICAL ~border_width:5
let tools_box = GPack.button_box `VERTICAL ~border_width:5
(*
~layout
~child_height
~child_width
~child_height
~child_width
*)
~spacing:5
~packing:tools_frame#add ()
~packing:tools_frame#add ()
let others_frame =
GBin.frame ~label:"Other"
let others_frame =
GBin.frame ~label:"Other"
~packing:(tools_window_vbox#pack ~expand:false) ()
let others_box =
GPack.button_box `VERTICAL ~border_width:5 ~packing:others_frame#add ()
let others_box =
GPack.button_box `VERTICAL ~border_width:5 ~packing:others_frame#add ()
(* horizontal paned *)
......@@ -745,7 +745,7 @@ let rec reimport_any_goal parent gname t db_goal goal_obsolete =
let subtask_db =
try Util.Mstr.find sum db_subgoals
(* a subgoal has the same check sum *)
with Not_found ->
with Not_found ->
(* otherwise, create a new one *)
Db.add_subgoal tr subgoal_name sum
in
......@@ -810,7 +810,7 @@ let () =
let db_th =
try
Util.Mstr.find tname ths
with Not_found -> Db.add_theory f tname
with Not_found -> Db.add_theory f tname
in
let mth = Helpers.add_theory_row mfile th db_th in
let goals = Db.goals db_th in
......@@ -849,12 +849,12 @@ let () =
match file_to_read with
| None -> ()
| Some fn ->
if List.exists (fun (_,f) -> f = fn) files_in_db then
if List.exists (fun (_,f) -> f = fn) files_in_db then
eprintf "Info: file %s already in database@." fn
else
try
Helpers.add_file fn
with e ->
with e ->
eprintf "@[Error while reading file@ '%s':@ %a@.@]" fn
Exn_printer.exn_printer e;
exit 1
......@@ -1074,7 +1074,7 @@ let split_unproved_goals () =
let sum = task_checksum subtask in
let subtask_db = Db.add_subgoal db_transf subgoal_name sum in
(* TODO: call add_goal_row *)
let goal = {
let goal = {
Model.goal_name = subgoal_name;
Model.parent = Model.Transf tr;
Model.task = subtask ;
......@@ -1367,7 +1367,7 @@ let () =
let i = GMisc.image ~pixbuf:(!image_prover) ()in
let () = b#set_image i#coerce in
let (_ : GtkSignal.id) =
b#connect#pressed
b#connect#pressed
~callback:(fun () -> prover_on_selected_goals p)
in ())
gconfig.provers
......@@ -1420,7 +1420,7 @@ let (_ : GMenu.image_menu_item) =
(* vertical paned on the right*)
(******************************)
let vp =
let vp =
try
GPack.paned `VERTICAL ~border_width:3 ~packing:hp#add ()
with Gtk.Error _ -> assert false
......@@ -1588,7 +1588,7 @@ let select_row p =
let ft_of_th th =
(Filename.basename th.Model.theory_parent.Model.file_name,
(Filename.basename th.Model.theory_parent.Model.file_name,
th.Model.theory.Theory.th_name.Ident.id_string)
let rec ft_of_goal g =
......@@ -1610,26 +1610,26 @@ let edit_selected_row p =
()
| Model.Row_proof_attempt a ->
let g = a.Model.proof_goal in
let t = g.Model.task in
let t = g.Model.task in
let driver = a.Model.prover.driver in
let file =
match a.Model.edited_as with
| "" ->
let (fn,tn) = ft_of_pa a in
let file = Driver.file_of_task driver
(Filename.concat project_dir fn) tn t
let file = Driver.file_of_task driver
(Filename.concat project_dir fn) tn t
in
(* Uniquify the filename if it exists on disk *)
let i =
try String.rindex file '.'
with _ -> String.length file
let i =
try String.rindex file '.'
with _ -> String.length file
in
let name = String.sub file 0 i in
let ext = String.sub file i (String.length file - i) in
let i = ref 1 in
while Sys.file_exists
while Sys.file_exists
(name ^ "_" ^ (string_of_int !i) ^ ext) do
incr i
incr i
done;
let file = name ^ "_" ^ (string_of_int !i) ^ ext in
a.Model.edited_as <- file;
......
......@@ -17,7 +17,7 @@
(* *)
(**************************************************************************)
(* POUR L'INSTANT, CE NE SONT ICI QUE DES EXPRIENCES
(* POUR L'INSTANT, CE NE SONT ICI QUE DES EXPRIENCES
MERCI DE NE PAS CONSIDRER CE CODE COMME DFINITIF
-- jcf
*)
......@@ -38,10 +38,10 @@ let font_family = "Monospace"
let file = ref None
let set_file f = match !file with
| Some _ ->
| Some _ ->
raise (Arg.Bad "only one file, please")
| None ->
if not (Filename.check_suffix f ".why") then
| 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 "why-ide: %s: no such file@." f; exit 1
......@@ -49,35 +49,35 @@ let set_file f = match !file with
file := Some f
let loadpath = ref []
let spec =
let spec =
[
"-I", Arg.String (fun s -> loadpath := s :: !loadpath),
"-I", Arg.String (fun s -> loadpath := s :: !loadpath),
"<dir> Add <dir> to the library search path";
]
let usage_str = "why-ide [options] file.why"
let () = Arg.parse spec set_file usage_str
let fname = match !file with
| None ->
| None ->
Arg.usage spec usage_str; exit 1
| Some f ->
| Some f ->
f
let lang =
let load_path =
List.fold_right Filename.concat
[Filename.dirname Sys.argv.(0); ".."; "share"] "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
let languages_manager =
GSourceView2.source_language_manager ~default:true
in
languages_manager#set_search_path
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 text =
let text =
let ic = open_in fname in
let size = in_channel_length ic in
let buf = String.create size in
......@@ -87,7 +87,7 @@ let text =
let env = Env.create_env (Typing.retrieve !loadpath)
let theories =
let theories =
let cin = open_in fname in
let m = Env.read_channel env fname cin in
close_in cin;
......@@ -99,12 +99,12 @@ module Ide_namespace = struct
let cols = new GTree.column_list
let column = cols#add Gobject.Data.string
let renderer = GTree.cell_renderer_text [`XALIGN 0.]
let vcolumn =
GTree.view_column ~title:"theories"
~renderer:(renderer, ["text", column]) ()
let renderer = GTree.cell_renderer_text [`XALIGN 0.]
let vcolumn =
GTree.view_column ~title:"theories"
~renderer:(renderer, ["text", column]) ()
let () =
let () =
vcolumn#set_resizable true;
vcolumn#set_max_width 400
......@@ -116,12 +116,12 @@ module Ide_namespace = struct
ignore (view#append_column vcolumn);
model
let clear model =
let clear model =
model#clear ()
let add_theory (model : GTree.tree_store) th =
let rec fill parent ns =
let add_s k s _ =
let add_s k s _ =
let row = model#append ~parent () in
model#set ~row ~column (k ^ s)
in
......@@ -145,9 +145,9 @@ end
(* windows, etc *)
let main () =
let w = GWindow.window
let w = GWindow.window
~allow_grow:true ~allow_shrink:true
~width:window_width ~height:window_height
~width:window_width ~height:window_height
~title:"why-ide" ()
in
let _ = w#connect#destroy ~callback:(fun () -> exit 0) in
......@@ -159,16 +159,16 @@ let main () =
let accel_group = factory#accel_group in
let file_menu = factory#add_submenu "_File" in
let file_factory = new GMenu.factory file_menu ~accel_group in
let _ =
file_factory#add_image_item ~key:GdkKeysyms._Q ~label:"_Quit"
~callback:(fun () -> exit 0) ()
let _ =
file_factory#add_image_item ~key:GdkKeysyms._Q ~label:"_Quit"
~callback:(fun () -> exit 0) ()
in
(* top line *)
let top_box = GPack.hbox ~packing:vbox#pack () in
(* Replay *)
let button =
GButton.button ~label:"repousser le front d'obsolescence"
let button =
GButton.button ~label:"repousser le front d'obsolescence"
~packing:top_box#add ()
in
ignore (button#connect#clicked
......@@ -178,9 +178,9 @@ let main () =
let hp = GPack.paned `HORIZONTAL ~border_width:3 ~packing:vbox#add () in
(* left tree of namespace *)
let scrollview =
GBin.scrolled_window ~hpolicy:`AUTOMATIC ~vpolicy:`AUTOMATIC
~width:(window_width / 3) ~packing:hp#add ()
let scrollview =
GBin.scrolled_window ~hpolicy:`AUTOMATIC ~vpolicy:`AUTOMATIC
~width:(window_width / 3) ~packing:hp#add ()
in
let _ = scrollview#set_shadow_type `ETCHED_OUT in
......@@ -206,7 +206,7 @@ let main () =
source_view#source_buffer#set_language lang;
source_view#set_highlight_current_line true;
source_view#source_buffer#set_text text;
w#add_accel_group accel_group;
w#show ()
......@@ -215,7 +215,7 @@ let () =
GtkThread.main ()
(*
Local Variables:
Local Variables:
compile-command: "unset LANG; make -C ../.. bin/whyide.opt"
End:
End:
*)
......@@ -25,7 +25,7 @@ val async: ((unit->unit)->unit->unit) ref
for the current user interface (e.g. GtkThread.async) *)
val maximum_running_proofs: int ref
(** bound on the number of prover processes running in parallel.
(** bound on the number of prover processes running in parallel.
default is 2 *)
type proof_attempt_status =
......@@ -36,11 +36,11 @@ type proof_attempt_status =
| Unknown (** external prover answered ``don't know'' or equivalent *)
| HighFailure (** external prover call failed *)
val schedule_proof_attempt :
debug:bool -> timelimit:int -> memlimit:int ->
val schedule_proof_attempt :
debug:bool -> timelimit:int -> memlimit:int ->
?old:in_channel ->
command:string -> driver:Driver.driver ->
callback:(proof_attempt_status -> float -> string -> unit) ->
command:string -> driver:Driver.driver ->
callback:(proof_attempt_status -> float -> string -> unit) ->
Task.task (* Db.goal *) -> unit
(** schedules an attempt to prove goal with the given prover. This
function just prepares the goal for the proof attempt, and puts
......@@ -50,7 +50,7 @@ val schedule_proof_attempt :
The callback is called each time the status of that proves
changes, typically from Scheduled, then Running, then Success or
Timeout or Failure.
@param timelimit CPU time limit given for that attempt, in
seconds, must be positive. (unlimited attempts are not allowed
with this function)
......@@ -82,9 +82,9 @@ val edit_proof :
callback:(unit->unit) -> Why.Task.task -> unit
(*
Local Variables:
Local Variables:
compile-command: "make -C ../.. bin/whyide.byte"
End:
End:
*)
......
This diff is collapsed.
......@@ -25,7 +25,7 @@ open Why
(** prover data *)
type prover
type prover
(** abstract type for the set of provers of the database *)
val prover_name : prover -> string
......@@ -76,9 +76,9 @@ type goal
(** 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
......@@ -146,10 +146,10 @@ val root_goals : unit -> goal list
exception AlreadyAttempted
val try_prover :
val try_prover :
async:((unit->unit)->unit) ->
debug:bool -> timelimit:int -> memlimit:int -> prover:prover ->
command:string -> driver:Driver.driver -> goal ->
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
......@@ -160,12 +160,12 @@ val try_prover :
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.
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)
......@@ -196,7 +196,7 @@ val add_transformation: goal -> transf -> unit
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
......@@ -221,10 +221,10 @@ val add_or_replace_task: tname:string -> name:string -> Task.task -> goal
IMPORTANT: this kills every running prover tasks