Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: do not evaluate under binders (except lets)
This change means our EvalFull is "closed evaluation", rather than "open evaluation". Note that we must evaluate under (various flavours of) `let` bindings since we need substitute usages of these variables: we do not want to consider `let x = 1 in x + x` to be stuck, but we are happy to consider `λx.MkPair x (not True)` to be stuck. The main reason to do this is so that evaluations of programs-in-construction (especially recursive ones) do not pointlessly blow up in size: if `even` and `odd` are defined recursively, then evaluating `even` would evaluate under the lambda and inside case branches, expanding `odd` and recursing; when it eventually times out one would have a big tree with many unrolled copies of `even` and `odd`, which is not very illuminating. Note that we do not evaluate in the RHS of pattern match branches which bind variables, for the same reason as we do not evaluate under lambdas; for consistency we also do not evaluate in the RHS of branches which do not bind variables. Signed-off-by: Ben Price <[email protected]>
- Loading branch information