Project

General

Profile

Revision 3769b712 src/tools/stateflow/semantics/memo.ml

View differences:

src/tools/stateflow/semantics/memo.ml
17 17
let apply (Memo hashf) f =
18 18
  fun x ->
19 19
    try
20
      Log.report ~level:sf_level (fun fmt -> Format.fprintf fmt "lookup 1@.");
20
      Lustrec.Log.report ~level:sf_level (fun fmt -> Format.fprintf fmt "lookup 1@.");
21 21
      Hashtbl.find hashf x
22 22
    with Not_found ->
23 23
      let res = f x in
24 24
      begin
25
	Log.report ~level:sf_level (fun fmt -> Format.fprintf fmt "hashing 1@.");
25
	Lustrec.Log.report ~level:sf_level (fun fmt -> Format.fprintf fmt "hashing 1@.");
26 26
	Hashtbl.add hashf x res;
27 27
	res
28 28
      end;;
......
30 30
let apply2 (Memo hashf) f =
31 31
  fun x y ->
32 32
    try
33
      Log.report ~level:sf_level (fun fmt -> Format.fprintf fmt "lookup 2@.");
33
      Lustrec.Log.report ~level:sf_level (fun fmt -> Format.fprintf fmt "lookup 2@.");
34 34
      Hashtbl.find hashf (x, y)
35 35
    with Not_found ->
36 36
      let res = f x y in
37 37
      begin
38
	Log.report ~level:sf_level (fun fmt -> Format.fprintf fmt "hashing 2@.");
38
	Lustrec.Log.report ~level:sf_level (fun fmt -> Format.fprintf fmt "hashing 2@.");
39 39
	Hashtbl.add hashf (x, y) res;
40 40
	res
41 41
      end;;
......
43 43
let apply3 (Memo hashf) f =
44 44
  fun x y z ->
45 45
    try
46
      Log.report ~level:sf_level (fun fmt -> Format.fprintf fmt "lookup 3@.");
46
      Lustrec.Log.report ~level:sf_level (fun fmt -> Format.fprintf fmt "lookup 3@.");
47 47
      Hashtbl.find hashf (x, y, z)
48 48
    with Not_found ->
49 49
      let res = f x y z in
50 50
      begin
51
	Log.report ~level:sf_level (fun fmt -> Format.fprintf fmt "hashing 3@.");
51
	Lustrec.Log.report ~level:sf_level (fun fmt -> Format.fprintf fmt "hashing 3@.");
52 52
	Hashtbl.add hashf (x, y, z) res;
53 53
	res
54 54
      end;;

Also available in: Unified diff