Skip to content

Commit

Permalink
Make DeferredAp a Value
Browse files Browse the repository at this point in the history
  • Loading branch information
7h3kk1d committed Oct 3, 2024
1 parent 6826c4d commit 1c8d27b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/haz3lcore/dynamics/Evaluator.re
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ module EvaluatorEVMode: {
| (BoxedReady, Constructor) => (BoxedValue, c)
| (IndetReady, Constructor) => (Indet, c)
| (IndetBlocked, _) => (Indet, c)
| (_, Value) => (BoxedValue, c)
| (_, Indet) => (Indet, c)
};
};
Expand Down
2 changes: 2 additions & 0 deletions src/haz3lcore/dynamics/EvaluatorStep.re
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ module Decompose = {
| (undo, Result.BoxedValue, env, v) =>
switch (rl(v)) {
| Constructor => Result.BoxedValue
| Value => Result.BoxedValue
| Indet => Result.Indet
| Step(s) => Result.Step([EvalObj.mk(Mark, env, undo, s.kind)])
// TODO: Actually show these exceptions to the user!
Expand Down Expand Up @@ -187,6 +188,7 @@ module TakeStep = {
state_update();
Some(expr);
| Constructor
| Value
| Indet => None
};

Expand Down
5 changes: 3 additions & 2 deletions src/haz3lcore/dynamics/Transition.re
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ type rule =
is_value: bool,
})
| Constructor
| Indet;
| Indet
| Value;

let (let-unbox) = ((request, v), f) =>
switch (Unboxing.unbox(request, v)) {
Expand Down Expand Up @@ -331,7 +332,7 @@ module Transition = (EV: EV_MODE) => {
(d2, ds) => DeferredAp2(d1, d2, ds) |> wrap_ctx,
ds,
);
Constructor;
Value;
| Ap(dir, d1, d2) =>
// TODO I don't know why this needs to be final
let. _ = otherwise(env, (d1, (d2, _)) => Ap(dir, d1, d2) |> rewrap)
Expand Down
1 change: 1 addition & 0 deletions src/haz3lcore/dynamics/ValueChecker.re
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ module ValueCheckerEVMode: {
| (_, _, Constructor) => r
| (_, Expr, Indet) => Expr
| (_, _, Indet) => Indet
| (_, _, Value) => Value
| (true, _, Step(_)) => Expr
| (false, _, Step(_)) => r
};
Expand Down

0 comments on commit 1c8d27b

Please sign in to comment.