Commit edbc438b authored by François Bobot's avatar François Bobot

whybench : memoization don't work??!!?? so precompute....

parent 87b2b7a3
...@@ -313,20 +313,25 @@ let () = ...@@ -313,20 +313,25 @@ let () =
let fold_prob acc = function let fold_prob acc = function
| None, _ -> acc | None, _ -> acc
| Some f, _ -> | Some f, _ ->
let gen env task = let env = env in
let fwhy () = let task = !opt_task in
let fname, cin = match f with let tlist =
| "-" -> "stdin", stdin let fname, cin = match f with
| f -> f, open_in f | "-" -> "stdin", stdin
in | f -> f, open_in f
let m = Env.read_channel ?format:!opt_parser env fname cin in in
close_in cin; let m = Env.read_channel ?format:!opt_parser env fname cin in
let th = Mnm.bindings m in close_in cin;
let map (name,th) = name,Task.split_theory th None task in let th = Mnm.bindings m in
let fold acc (n,l) = let map (name,th) = name,Task.split_theory th None task in
List.rev_append (List.map (fun v -> (n,v)) l) acc in let fold acc (n,l) =
th |> List.map map |> List.fold_left fold [] in List.rev_append (List.map (fun v -> (n,v)) l) acc in
Scheduler.do_why_sync fwhy () in th |> List.map map |> List.fold_left fold [] in
(* let gen = Env.Wenv.memoize 3 (fun env -> *)
(* let memo = Trans.store (fun task -> gen env task) in *)
(* Trans.apply memo) in *)
let gen _ _ = tlist in
let gen env task = Scheduler.do_why_sync (gen env) task in
{ B.ptask = gen; { B.ptask = gen;
ptrans = transl; ptrans = transl;
}::acc in }::acc in
......
...@@ -72,6 +72,7 @@ let find_theory env sl s = ...@@ -72,6 +72,7 @@ let find_theory env sl s =
let env_tag env = env.env_tag let env_tag env = env.env_tag
module Wenv = Hashweak.Make(struct type t = env let tag = env_tag end)
(** Parsers *) (** Parsers *)
......
...@@ -25,6 +25,8 @@ type env ...@@ -25,6 +25,8 @@ type env
val env_tag : env -> Hashweak.tag val env_tag : env -> Hashweak.tag
module Wenv : Hashweak.S with type key = env
type retrieve_theory = env -> string list -> theory Mnm.t type retrieve_theory = env -> string list -> theory Mnm.t
val create_env : retrieve_theory -> env val create_env : retrieve_theory -> env
......
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