Commit 53e0e5b2 authored by MARCHE Claude's avatar MARCHE Claude

resurected why3sesssion_latex

parent f05392e8
......@@ -822,10 +822,10 @@ install_local:: bin/why3webserver
###############
SESSION_FILES = why3session_lib why3session_info \
why3session_html \
why3session_html why3session_latex \
why3session_main
# TODO: why3session_copy why3session_rm why3session_csv why3session_run
# why3session_latex why3session_output
# why3session_output
SESSIONMODULES = $(addprefix src/why3session/, $(SESSION_FILES))
......
......@@ -360,18 +360,35 @@ let rec fold_all_sub_goals_of_proofn s f acc pnid =
in
f acc pn
let goal_iter_proof_attempt s f g =
fold_all_sub_goals_of_proofn
s
(fun _ pn -> Hprover.iter
(fun _ pan ->
let pan = get_proof_attempt_node s pan in
f pan)
pn.proofn_attempts) () g
let fold_all_sub_goals_of_theory s f acc th =
List.fold_left (fold_all_sub_goals_of_proofn s f) acc th.theory_goals
(*
let theory_iter_proofn s f th =
fold_all_sub_goals_of_theory s (fun _ -> f) () th
*)
let theory_iter_proof_attempt s f th =
theory_iter_proofn s
(fun pn -> Hprover.iter (fun _ pan ->
fold_all_sub_goals_of_theory s
(fun _ pn -> Hprover.iter (fun _ pan ->
let pan = get_proof_attempt_node s pan in
f pan)
pn.proofn_attempts) th
pn.proofn_attempts) () th
let file_iter_proof_attempt s f file =
List.iter
(theory_iter_proof_attempt s f)
(file_theories file)
......
......@@ -70,9 +70,15 @@ type proof_attempt_node = private {
proof_script : string option; (* non empty for external ITP *)
}
val goal_iter_proof_attempt:
session -> (proof_attempt_node -> unit) -> proofNodeID -> unit
val theory_iter_proof_attempt:
session -> (proof_attempt_node -> unit) -> theory -> unit
val file_iter_proof_attempt:
session -> (proof_attempt_node -> unit) -> file -> unit
val session_iter_proof_attempt:
(proofAttemptID -> proof_attempt_node -> unit) -> session -> unit
......
......@@ -90,19 +90,6 @@ let run_file (context : context) print_session fname =
module Table =
struct
let rec transf_depth s tr =
List.fold_left
(fun depth g -> max depth (goal_depth s g)) 0 (get_sub_tasks s tr)
and goal_depth s g =
List.fold_left
(fun depth tr -> max depth (1 + transf_depth s tr))
1 (get_transformations s g)
let theory_depth s t =
List.fold_left
(fun depth g -> max depth (goal_depth s g)) 0 (theory_goals t)
let provers_stats s provers theory =
theory_iter_proof_attempt s (fun a ->
Hprover.replace provers a.prover a.prover) theory
......@@ -200,10 +187,9 @@ let rec num_lines s acc tr =
let print_theory s fn fmt th =
let depth = theory_depth s th in
if depth > 0 then
let provers = Hprover.create 9 in
provers_stats s provers th;
let provers = get_used_provers_theory s th in
let provers =
Hprover.fold (fun _ pr acc -> pr :: acc) provers []
Whyconf.Sprover.fold (fun pr acc -> pr :: acc) provers []
in
let provers = List.sort Whyconf.Prover.compare provers in
let name =
......
This diff is collapsed.
......@@ -302,9 +302,47 @@ let ask_yn_nonblock ~callback =
end
let get_used_provers_goal session g =
let sprover = ref Whyconf.Sprover.empty in
Session_itp.goal_iter_proof_attempt session
(fun pa -> sprover := Whyconf.Sprover.add pa.Session_itp.prover !sprover)
g;
!sprover
let get_used_provers_theory session th =
let sprover = ref Whyconf.Sprover.empty in
Session_itp.theory_iter_proof_attempt session
(fun pa -> sprover := Whyconf.Sprover.add pa.Session_itp.prover !sprover)
th;
!sprover
let get_used_provers_file session f =
let sprover = ref Whyconf.Sprover.empty in
Session_itp.file_iter_proof_attempt session
(fun pa -> sprover := Whyconf.Sprover.add pa.Session_itp.prover !sprover)
f;
!sprover
let get_used_provers session =
let sprover = ref Whyconf.Sprover.empty in
Session_itp.session_iter_proof_attempt
(fun _ pa -> sprover := Whyconf.Sprover.add pa.Session_itp.prover !sprover)
session;
!sprover
let rec transf_depth s tr =
List.fold_left
(fun depth g -> max depth (goal_depth s g)) 0 (Session_itp.get_sub_tasks s tr)
and goal_depth s g =
List.fold_left
(fun depth tr -> max depth (1 + transf_depth s tr))
1 (Session_itp.get_transformations s g)
let theory_depth s t =
List.fold_left
(fun depth g -> max depth (goal_depth s g)) 0 (Session_itp.theory_goals t)
let file_depth s f =
List.fold_left (fun depth t -> max depth (theory_depth s t)) 0
(Session_itp.file_theories f)
......@@ -91,6 +91,34 @@ val ask_yn_nonblock : callback:(bool -> unit) -> (unit -> bool)
(** call the callback when an answer have been given,
return true if it must be retried *)
(**)
val get_used_provers : Session_itp.session -> Whyconf.Sprover.t
(** [get_used_provers s] returns the set of provers used somewhere in
session [s] *)
val get_used_provers_file : Session_itp.session -> Session_itp.file
-> Whyconf.Sprover.t
(** [get_used_provers_file s f] returns the set of provers used
somewhere in the file [f] of session [s] *)
val get_used_provers_theory : Session_itp.session -> Session_itp.theory
-> Whyconf.Sprover.t
(** [get_used_provers_theory s th] returns the set of provers used
somewhere in the theory [th] of session [s] *)
val get_used_provers_goal : Session_itp.session -> Session_itp.proofNodeID
-> Whyconf.Sprover.t
(** [get_used_provers_goal s g] returns the set of provers used
somewhere under the goal [g] of session [s] *)
val goal_depth : Session_itp.session -> Session_itp.proofNodeID -> int
(** [goal_depth s g] returns the depth of the tree under goal
[g] in session [s] *)
val theory_depth : Session_itp.session -> Session_itp.theory -> int
(** [theory_depth s th] returns the depth of the tree under theory
[th] in session [s] *)
val file_depth : Session_itp.session -> Session_itp.file -> int
(** [file_depth s f] returns the depth of the tree under file [f] in
session [s] *)
......@@ -17,8 +17,8 @@ let cmds =
[|
Why3session_info.cmd;
Why3session_html.cmd;
(*
Why3session_latex.cmd;
(*
Why3session_csv.cmd;
Why3session_copy.cmd_mod;
Why3session_copy.cmd_copy;
......
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