type opcode =
- | CACHE of unit
- | RETURN of unit
+ | CACHE
+ | RETURN
| LEFT of Translist.t * jump
| RIGHT of Translist.t * jump
| BOTH of Translist.t * jump * jump
type t = opcode Cache.Lvl2.t
-let dummy = CACHE()
+
+let dummy = CACHE
let print_opcode fmt o = match o with
- | CACHE _ -> fprintf fmt "CACHE()"
- | RETURN _ -> fprintf fmt "RETURN ()"
+ | CACHE -> fprintf fmt "CACHE"
+ | RETURN -> fprintf fmt "RETURN"
| LEFT (tl, j) -> fprintf fmt "LEFT(\n[%a], %a)" Translist.print tl print_jump j
| RIGHT (tl, j) -> fprintf fmt "RIGHT(\n[%a], %a)" Translist.print tl print_jump j
| BOTH (tl, j1, j2) -> fprintf fmt "BOTH(\n[%a], %a, %a)" Translist.print tl print_jump j1 print_jump j2
-
+(*
let print_cache fmt d =
let c = Cache.Lvl2.to_array d in
Array.iteri begin fun tag a ->
fprintf fmt "---------------------------\n%!"
end
end c
-
-let create () = Cache.Lvl2.create 1024 dummy
-
+*)
+let create () = Cache.Lvl2.create 4096 dummy
+(*
let stats fmt c =
let d = Cache.Lvl2.to_array c in
let len = Array.fold_left (fun acc a -> Array.length a + acc) 0 d in
len lvl1 lvl2 (Ocaml.size_kb d);
fprintf fmt "%s" "L2JIT Content:\n";
print_cache fmt c
+*)
-let find t tag set = Cache.Lvl2.find t tag (Uid.to_int set.StateSet.Node.id)
+let find t tag set = Cache.Lvl2.find t (Uid.to_int set.StateSet.Node.id) tag
-let add t tag set v = Cache.Lvl2.add t tag (Uid.to_int set.StateSet.Node.id) v
+let add t tag set v = Cache.Lvl2.add t (Uid.to_int set.StateSet.Node.id) tag v
let collect_trans tag ((a_t, a_s1, a_s2) as acc) (labels, tr) =
if TagSet.mem tag labels
then
let _, _, _, f = Transition.node tr in
- let (_, _, s1), (_, _, s2) = Formula.st f in
+ let s1, s2 = Formula.st f in
(Translist.cons tr a_t,
StateSet.union s1 a_s1,
StateSet.union s2 a_s2)
let op =
let empty_s1 = StateSet.is_empty states1 in
let empty_s2 = StateSet.is_empty states2 in
- if empty_s1 && empty_s2 then RETURN ()
+ if empty_s1 && empty_s2 then RETURN
else if empty_s1 then
RIGHT (tr_list,
compute_jump auto tree tag states2 DIR_RIGHT)
op
let get_transitions = function
- | CACHE _ | RETURN _ -> failwith "get_transitions"
+ | CACHE | RETURN -> failwith "get_transitions"
| LEFT (tr, _)
| RIGHT (tr, _)
| BOTH (tr, _, _) -> tr