Skip to content

Commit 2b0eacd

Browse files
authored
Fix probe duplication (#1982)
2 parents 1e3ccd6 + 5a58531 commit 2b0eacd

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

src/language/dynamics/transition/Transition.re

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -197,9 +197,9 @@ module Transition = (EV: EV_MODE) => {
197197
ids: [rep_id(d)],
198198
});
199199

200-
let (let.wrap_closure) = (env, f: unit => rule) =>
200+
let (let.wrap_closure) = ((env, d'), f: unit => rule) =>
201201
switch (mode) {
202-
| `Environment => wrap_closure_when_done(~in_closure, d, env, f())
202+
| `Environment => wrap_closure_when_done(~in_closure, d', env, f())
203203
| `Substitution => f()
204204
};
205205

@@ -230,7 +230,7 @@ module Transition = (EV: EV_MODE) => {
230230
is_value,
231231
});
232232
| None =>
233-
let.wrap_closure _ = env;
233+
let.wrap_closure _ = (env, d);
234234
Indet;
235235
};
236236
| `Substitution =>
@@ -251,7 +251,7 @@ module Transition = (EV: EV_MODE) => {
251251
let. _ = otherwise(env, d1 => Let(dp, d1, d2) |> rewrap)
252252
and. d1' =
253253
req_final(req(state, env), d1 => Let1(dp, d1, d2) |> wrap_ctx, d1);
254-
let.wrap_closure _ = env;
254+
let.wrap_closure _ = (env, Let(dp, d1', d2) |> rewrap);
255255
let {matches, closures} = matches(dp, d1');
256256
let matches_str = {
257257
switch (matches) {
@@ -274,7 +274,7 @@ module Transition = (EV: EV_MODE) => {
274274
| TypFun(_)
275275
| Fun(_, _, _, _) =>
276276
let. _ = otherwise(env, d);
277-
let.wrap_closure _ = env;
277+
let.wrap_closure _ = (env, d);
278278
Value;
279279
| FixF(dp, d1, None) when mode == `Environment =>
280280
let. _ = otherwise(env, FixF(dp, d1, None) |> rewrap);
@@ -507,10 +507,10 @@ module Transition = (EV: EV_MODE) => {
507507
if (n_args == 1) {
508508
(
509509
Tuple(n_args),
510-
tuple([d2]) // TODO Should we not be going to a tuple?
510+
tuple([d2']) // TODO Should we not be going to a tuple?
511511
);
512512
} else {
513-
(Tuple(n_args), d2);
513+
(Tuple(n_args), d2');
514514
};
515515
let new_args = {
516516
let rec go = (deferred, args) =>
@@ -547,7 +547,7 @@ module Transition = (EV: EV_MODE) => {
547547
let. _ = otherwise(env, c => If(c, d1, d2) |> rewrap)
548548
and. c' =
549549
req_final(req(state, env), c => If1(c, d1, d2) |> wrap_ctx, c);
550-
let.wrap_closure _ = env;
550+
let.wrap_closure _ = (env, If(c', d1, d2) |> rewrap);
551551
let-unbox b = (Atom(Bool), c');
552552
Step({
553553
expr: {
@@ -593,7 +593,7 @@ module Transition = (EV: EV_MODE) => {
593593
d1 => BinOp1(Bool(And), d1, d2) |> wrap_ctx,
594594
d1,
595595
);
596-
let.wrap_closure _ = env;
596+
let.wrap_closure _ = (env, BinOp(Bool(And), d1', d2) |> rewrap);
597597
let-unbox b1 = (Atom(Bool), d1');
598598
Step({
599599
expr: b1 ? asc(d2, IdTagged.FreshGrammar.Typ.bool()) : bool(false),
@@ -609,7 +609,7 @@ module Transition = (EV: EV_MODE) => {
609609
d1 => BinOp1(Bool(Or), d1, d2) |> wrap_ctx,
610610
d1,
611611
);
612-
let.wrap_closure _ = env;
612+
let.wrap_closure _ = (env, BinOp(Bool(Or), d1', d2) |> rewrap);
613613
let-unbox b1 = (Atom(Bool), d1');
614614
Step({
615615
expr: b1 ? bool(true) : asc(d2, IdTagged.FreshGrammar.Typ.bool()),
@@ -876,7 +876,7 @@ module Transition = (EV: EV_MODE) => {
876876
is_value: false,
877877
})
878878
| None =>
879-
let.wrap_closure _ = env;
879+
let.wrap_closure _ = (env, Match(d1, rules) |> rewrap);
880880
Indet;
881881
};
882882
| Closure(env', d) =>
@@ -904,7 +904,7 @@ module Transition = (EV: EV_MODE) => {
904904
};
905905
| MultiHole(_) =>
906906
let. _ = otherwise(env, d);
907-
let.wrap_closure _ = env;
907+
let.wrap_closure _ = (env, d);
908908
Indet;
909909
| EmptyHole
910910
| Invalid(_) =>
@@ -913,7 +913,7 @@ module Transition = (EV: EV_MODE) => {
913913
Indet;
914914
| DynamicErrorHole(_) =>
915915
let. _ = otherwise(env, d);
916-
let.wrap_closure _ = env;
916+
let.wrap_closure _ = (env, d);
917917
Indet;
918918
| Asc(d', t) =>
919919
switch (Ascriptions.transition(d)) {

0 commit comments

Comments
 (0)