[Paper Review] Implementing Open Call-by-Value (Extended Version)
This paper presents Fast GLAMOUr, a novel abstract machine for open call-by-value lambda calculus that achieves bilinear overhead—linear in both the number of β-steps and the initial term size—without using environment labels or complex optimizations. It provides a simple, efficient implementation that supports strong evaluation via recursive levels, resolving long-standing trade-offs between simplicity and efficiency in abstract machine design for open terms.
The theory of the call-by-value lambda-calculus relies on weak evaluation and closed terms, that are natural hypotheses in the study of programming languages. To model proof assistants, however, strong evaluation and open terms are required. Open call-by-value is the intermediate setting of weak evaluation with open terms, on top of which Grégoire and Leroy designed the abstract machine of Coq. This paper provides a theory of abstract machines for open call-by-value. The literature contains machines that are either simple but inefficient, as they have an exponential overhead, or efficient but heavy, as they rely on a labelling of environments and a technical optimization. We introduce a machine that is simple and efficient: it does not use labels and it implements open call-by-value within a bilinear overhead. Moreover, we provide a new fine understanding of how different optimizations impact on the complexity of the overhead.
Motivation & Objective
- Address the lack of efficient, simple abstract machines for open call-by-value, a critical setting for proof assistants like Coq.
- Overcome the trade-off between efficiency and simplicity in existing machines, which either incur exponential overhead or rely on complex labeling and optimizations.
- Provide a formal cost analysis of the machine’s overhead, showing it is bilinear in the number of β-steps and initial term size.
- Enable strong evaluation in proof assistants by recursively applying the open CbV machine under abstractions, as used in Coq’s implementation strategy.
- Establish a theoretical foundation for efficient evaluation of open terms, bridging the gap between closed and strong evaluation strategies.
Proposed method
- Design a new abstract machine, Fast GLAMOUr, based on the fireball calculus (λfire), which generalizes values to fireballs to support weak evaluation on open terms.
- Introduce a novel cost model that tracks transitions: β-reductions, substitution steps, and commutative transitions, each with bounded overhead.
- Leverage the subterm invariant to bound the cost of each operation, ensuring that no transition increases the size of the term beyond a constant factor.
- Use a size measure for commutative transitions that depends linearly on the number of substitution steps and the initial term size.
- Prove that the total number of transitions is bounded by (1 + |ρ|β) · |t0|, where |ρ|β is the number of β-steps and |t0| is the initial term size.
- Establish that the machine’s total runtime on a RAM is O((1 + |ρ|β) · |t0|), achieving bilinear overhead without labels or complex optimizations.
Experimental results
Research questions
- RQ1Can an abstract machine for open call-by-value be both simple and efficient, avoiding the exponential overhead of naive machines and the complexity of labeled ones?
- RQ2What is the precise overhead of implementing open call-by-value evaluation in terms of β-steps and initial term size?
- RQ3How do different optimization strategies—such as on-demand substitution and commutative transitions—affect the overall complexity of the machine?
- RQ4Can the strong evaluation strategy used in Coq be formally justified and efficiently implemented via a weak, open CbV machine?
- RQ5Is the number of β-steps a reasonable cost model for open call-by-value, even in the presence of size explosion?
Key findings
- Fast GLAMOUr achieves a bilinear overhead of O((1 + |ρ|β) · |t0|), where |ρ|β is the number of β-steps and |t0| is the size of the initial term.
- The number of substitution transitions |ρ|s is bounded by |ρ|β, ensuring that substitution does not dominate the cost.
- The number of commutative transitions |ρ|c is bounded by (1 + |ρ|s) · |t0| ≤ (1 + |ρ|β) · |t0|, which is linear in both the number of β-steps and the initial term size.
- The machine does not require environment labeling or technical optimizations, making it simpler than prior efficient machines.
- The machine supports strong evaluation via recursive application under abstractions, as used in Coq’s implementation by levels.
- The size explosion family {snI}n∈N demonstrates that even closed, weakly-evaluated terms can exhibit exponential blowup, validating the need for efficient machines with good cost models.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.