X-Git-Url: http://git.nguyen.vg/gitweb/?p=tatoo.git;a=blobdiff_plain;f=src%2Frun.ml;fp=src%2Frun.ml;h=887eb35cdeb2f44588923714608c64c4f89e50a2;hp=0ae25f9cf5693c6136ac07fe7a12859e75228743;hb=a96c64d15866719b4c8eb6d98ad7f1fc948e7636;hpb=e3ad6d6f098809af95ddaf8b1e9bc4ec5cb7b0f4 diff --git a/src/run.ml b/src/run.ml index 0ae25f9..887eb35 100644 --- a/src/run.ml +++ b/src/run.ml @@ -23,9 +23,9 @@ open Bigarray type stats = { mutable pass : int; tree_size : int; mutable fetch_trans_cache_access : int; - mutable fetch_trans_cache_hit : int; + mutable fetch_trans_cache_miss : int; mutable eval_trans_cache_access : int; - mutable eval_trans_cache_hit : int; + mutable eval_trans_cache_miss : int; mutable nodes_per_run : int list; } @@ -120,15 +120,15 @@ let get_form run tag (q : State.t) = if phi == dummy_form then let phi = Ata.get_form auto tag q in let () = + stats.fetch_trans_cache_miss <- stats.fetch_trans_cache_miss + 1; Cache.N2.add fetch_trans_cache (tag.QName.id :> int) (q :> int) phi in phi - else begin - stats.fetch_trans_cache_hit <- stats.fetch_trans_cache_hit + 1; + else phi - end + let eval_form phi fcs nss ps ss summary = @@ -191,17 +191,17 @@ let eval_trans run trans_cache tag summary fcs nss ps ss todo = let res = Cache.N6.find trans_cache tagid summary ssid fcsid nssid psid in stats.eval_trans_cache_access <- 1 + stats.eval_trans_cache_access; - if res != dummy_set then begin - stats.eval_trans_cache_hit <- 1 + stats.eval_trans_cache_hit; + if res != dummy_set then res - end else let new_sat = + else let new_sat = eval_trans_fix run tag summary fcs nss ps ss todo - in - Cache.N6.add trans_cache tagid summary ssid fcsid nssid psid new_sat; - new_sat + in + stats.eval_trans_cache_miss <- 1 + stats.eval_trans_cache_miss; + Cache.N6.add trans_cache tagid summary ssid fcsid nssid psid new_sat; + new_sat -module Make (T : Tree.S) (L : Node_list.S with type node = T.node) = +module Make (T : Tree.S) (L : Deque.S with type elem = T.node) = struct let make auto tree = @@ -222,9 +222,9 @@ struct pass = 0; tree_size = len; fetch_trans_cache_access = 0; - fetch_trans_cache_hit = 0; + fetch_trans_cache_miss = 0; eval_trans_cache_access = 0; - eval_trans_cache_hit = 0; + eval_trans_cache_miss = 0; nodes_per_run = []; } }