1
+ open ! Core
1
2
open Stdlib.Effect
2
3
open Stdlib.Effect.Deep
3
4
open React_trace
5
+ open Concrete_domains
4
6
open Interp_effects
5
7
include Recorder_intf
6
8
7
- (* TODO: Replace the dummy string with an actual recording type *)
8
9
type recording = string
9
10
10
- let emp_recording = " empty recording "
11
+ let emp_recording = " = Recording = \n "
11
12
12
13
let event_h =
13
14
{
@@ -20,21 +21,44 @@ let event_h =
20
21
Some
21
22
(fun (k : (a, _) continuation ) ~(recording : recording ) ->
22
23
let () = perform (Update_st (path, label, (v, q))) in
24
+ let recording =
25
+ recording
26
+ ^ sprintf " [path %s] Update state %d -> %s\n "
27
+ (Sexp. to_string (Path. sexp_of_t path))
28
+ label
29
+ (Sexp. to_string (sexp_of_value v))
30
+ in
23
31
continue k () ~recording )
24
32
| Set_dec (path , dec ) ->
25
33
Some
26
34
(fun (k : (a, _) continuation ) ~(recording : recording ) ->
27
35
let () = perform (Set_dec (path, dec)) in
36
+ let recording =
37
+ recording
38
+ ^ sprintf " [path %s] Set decision %s\n "
39
+ (Sexp. to_string (Path. sexp_of_t path))
40
+ (Sexp. to_string (sexp_of_decision dec))
41
+ in
28
42
continue k () ~recording )
29
43
| Enq_eff (path , clos ) ->
30
44
Some
31
45
(fun (k : (a, _) continuation ) ~(recording : recording ) ->
32
46
let () = perform (Enq_eff (path, clos)) in
47
+ let recording =
48
+ recording
49
+ ^ sprintf " [path %s] Enqueue effect\n "
50
+ (Sexp. to_string (Path. sexp_of_t path))
51
+ in
33
52
continue k () ~recording )
34
53
| Alloc_pt ->
35
54
Some
36
55
(fun (k : (a, _) continuation ) ~(recording : recording ) ->
37
56
let path = perform Alloc_pt in
57
+ let recording =
58
+ recording
59
+ ^ sprintf " Allocate path %s\n "
60
+ (Sexp. to_string (Path. sexp_of_t path))
61
+ in
38
62
continue k path ~recording )
39
63
| _ -> None );
40
64
}
0 commit comments