Une MAJ de sécurité est nécessaire sur notre version actuelle. Elle sera effectuée lundi 02/08 entre 12h30 et 13h. L'interruption de service devrait durer quelques minutes (probablement moins de 5 minutes).

Commit 65a92cec authored by MARCHE Claude's avatar MARCHE Claude
Browse files

replayer finally does something

parent 876d26e1
...@@ -567,7 +567,8 @@ let replay_obsolete_proofs () = ...@@ -567,7 +567,8 @@ let replay_obsolete_proofs () =
List.iter List.iter
(fun row -> (fun row ->
let a = get_any row in let a = get_any row in
M.replay ~context_unproved_goals_only:!context_unproved_goals_only a) M.replay ~obsolete_only:true
~context_unproved_goals_only:!context_unproved_goals_only a)
goals_view#selection#get_selected_rows goals_view#selection#get_selected_rows
......
...@@ -119,7 +119,7 @@ let main_loop () = ...@@ -119,7 +119,7 @@ let main_loop () =
begin begin
let ms = let ms =
match !timeout_handler with match !timeout_handler with
| None -> 0.1 | None -> raise Exit
| Some(ms,_) -> ms | Some(ms,_) -> ms
in in
usleep (ms -. time) usleep (ms -. time)
...@@ -223,8 +223,14 @@ let main () = ...@@ -223,8 +223,14 @@ let main () =
M.maximum_running_proofs := M.maximum_running_proofs :=
Whyconf.running_provers_max (Whyconf.get_main config); Whyconf.running_provers_max (Whyconf.get_main config);
eprintf " done@."; eprintf " done@.";
(* for each file f *) let _ = M.replay (* f *) in let files = M.get_all_files () in
main_loop () List.iter
(fun f ->
eprintf "Replaying file '%s'@." f.M.file_name;
M.replay ~obsolete_only:false
~context_unproved_goals_only:false (M.File f)) files;
try main_loop ()
with Exit -> eprintf "Everything done@."
with e -> with e ->
eprintf "Error while opening session with database '%s'@." project_dir; eprintf "Error while opening session with database '%s'@." project_dir;
eprintf "Aborting...@."; eprintf "Aborting...@.";
......
...@@ -1217,40 +1217,40 @@ let proof_successful a = ...@@ -1217,40 +1217,40 @@ let proof_successful a =
| Done { Call_provers.pr_answer = Call_provers.Valid } -> true | Done { Call_provers.pr_answer = Call_provers.Valid } -> true
| _ -> false | _ -> false
let rec replay_on_goal_or_children ~context_unproved_goals_only g = let rec replay_on_goal_or_children ~obsolete_only ~context_unproved_goals_only g =
Hashtbl.iter Hashtbl.iter
(fun _ a -> (fun _ a ->
if a.proof_obsolete then if not obsolete_only || a.proof_obsolete then
if not context_unproved_goals_only || proof_successful a if not context_unproved_goals_only || proof_successful a
then redo_external_proof g a) then redo_external_proof g a)
g.external_proofs; g.external_proofs;
Hashtbl.iter Hashtbl.iter
(fun _ t -> (fun _ t ->
List.iter List.iter
(replay_on_goal_or_children ~context_unproved_goals_only) (replay_on_goal_or_children ~obsolete_only ~context_unproved_goals_only)
t.subgoals) t.subgoals)
g.transformations g.transformations
let replay ~context_unproved_goals_only a = let replay ~obsolete_only ~context_unproved_goals_only a =
match a with match a with
| Goal g -> | Goal g ->
replay_on_goal_or_children ~context_unproved_goals_only g replay_on_goal_or_children ~obsolete_only ~context_unproved_goals_only g
| Theory th -> | Theory th ->
List.iter List.iter
(replay_on_goal_or_children ~context_unproved_goals_only) (replay_on_goal_or_children ~obsolete_only ~context_unproved_goals_only)
th.goals th.goals
| File file -> | File file ->
List.iter List.iter
(fun th -> (fun th ->
List.iter List.iter
(replay_on_goal_or_children ~context_unproved_goals_only) (replay_on_goal_or_children ~obsolete_only ~context_unproved_goals_only)
th.goals) th.goals)
file.theories file.theories
| Proof_attempt a -> | Proof_attempt a ->
replay_on_goal_or_children ~context_unproved_goals_only a.proof_goal replay_on_goal_or_children ~obsolete_only ~context_unproved_goals_only a.proof_goal
| Transformation tr -> | Transformation tr ->
List.iter List.iter
(replay_on_goal_or_children ~context_unproved_goals_only) (replay_on_goal_or_children ~obsolete_only ~context_unproved_goals_only)
tr.subgoals tr.subgoals
......
...@@ -208,8 +208,13 @@ module Make(O: OBSERVER) : sig ...@@ -208,8 +208,13 @@ module Make(O: OBSERVER) : sig
val edit_proof : val edit_proof :
default_editor:string -> project_dir:string -> proof_attempt -> unit default_editor:string -> project_dir:string -> proof_attempt -> unit
val replay : context_unproved_goals_only:bool -> any -> unit val replay :
(** [replay a] reruns all valid but obsolete proofs under [a] *) obsolete_only:bool ->
context_unproved_goals_only:bool -> any -> unit
(** [replay a] reruns proofs under [a]
if obsolete_only is set then does not rerun non-obsolete proofs
if context_unproved_goals_only is set then reruns only proofs with result was 'valid'
*)
(* (*
TODO TODO
......
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