Equivalence of eval-readback and eval-apply big-step evaluators by regimentation of the lambda-calculus's strategy space

12/05/2022
by   Pablo Nogueira, et al.
0

We study the equivalence of eval-readback and eval-apply big-step evaluators in the general setting of the pure lambda calculus. The equivalence extends to evaluators in typed lambda calculi if the strategy (the evaluation order of redexes) is realisable. We present a proof that one-step equivalence holds when (1) the `readback' stage satisfies straightforward well-formedness provisos, (2) the `eval' stage implements a `uniform' strategy, and (3) the eval-apply evaluator implements a `balanced hybrid' strategy that has `eval' as a subsidiary strategy. The proof proceeds by application of the `lightweight fusion by fixed-point promotion' program transformation on evaluator implementations to fuse readback and eval into the balanced hybrid. The proof can be followed with no previous knowledge of the transformation. We use Haskell as the implementation language, with all evaluators written in monadic style to guarantee semantics (strategy) preservation, but the choice of implementation language is immaterial. To determine the extent of the equivalence, we provide a comprehensive survey of the strategy space using canonical eval-apply evaluators. We discuss the strategies' properties and uses. We improve the formal definition of uniform and hybrid strategy, and use it to regiment the strategy space and to obtain the generic higher-order evaluators used in the proof that deliver all plain evaluators as fixed-points by instantiation. We introduce a systematic notation for both evaluator styles and use it to summarise strategy and evaluator equivalences, including (non-)equivalences within a style and (non-)equivalences between styles not proven by the transformation.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
11/20/2020

A Comparison of Big-step Semantics Definition Styles

Formal semantics provides rigorous, mathematically precise definitions o...
research
10/27/2022

Reductions in Higher-Order Rewriting and Their Equivalence

Proof terms are syntactic expressions that represent computations in ter...
research
08/30/2022

Program Equivalence in an Untyped, Call-by-value Lambda Calculus with Uncurried Recursive Functions

We aim to reason about the correctness of behaviour-preserving transform...
research
05/30/2022

A Probabilistic Call-by-Need Lambda-Calculus – Extended Version

To support the understanding of declarative probabilistic programming la...
research
08/23/2023

A Frame Stack Semantics for Sequential Core Erlang

We present a small-step, frame stack style, semantics for sequential Cor...
research
07/01/2019

Coherence of Type Class Resolution

Elaboration-based type class resolution, as found in languages like Hask...
research
03/30/2023

Uniform Substitution for Dynamic Logic with Communicating Hybrid Programs

This paper introduces a uniform substitution calculus for dℒ_CHP, the dy...

Please sign up or login with your details

Forgot password? Click here to reset