Normal Form Bisimulations for Delimited-Control Operators
We define a notion of normal form bisimilarity for the untyped call-by-value lambda calculus extended with the delimited-control operators shift and reset. Normal form bisimilarities are simple, easy-to-use behavioral equivalences which relate terms without having to test them within all contexts (like contextual equivalence), or by applying them to function arguments (like applicative bisimilarity). We prove that the normal form bisimilarity for shift and reset is sound but not complete w.r.t. contextual equivalence and we define up-to techniques that aim at simplifying bisimulation proofs. Finally, we illustrate the simplicity of the techniques we develop by proving several equivalences on terms.
💡 Research Summary
The paper tackles the problem of reasoning about program equivalence in a call‑by‑value, untyped λ‑calculus that is extended with the delimited‑control operators shift and reset. Traditional techniques for establishing contextual equivalence require quantifying over all possible surrounding contexts, which quickly becomes intractable when control operators that capture and reinstate evaluation contexts are present. Applicative bisimilarity, another well‑known method, alleviates the need for arbitrary contexts but still demands that every possible argument be applied to functions, a burden that grows dramatically in the presence of shift/reset. To address these difficulties, the authors introduce normal‑form bisimilarity (NFB), a relation that compares terms solely on the basis of the normal forms they can reach. A normal form is a term that cannot be reduced further—typically a value or a stuck term. By focusing on the end‑points of evaluation rather than on intermediate interactions with arbitrary contexts, NFB offers a much simpler, more tractable notion of behavioral equivalence.
The paper proceeds in several stages. First, the operational semantics of the extended language are presented, with explicit reduction rules for shift (which captures the current delimited continuation) and reset (which delimits the continuation that may be captured). Using these rules, the authors define a binary relation ≈ₙf that holds between two terms when, for every reduction sequence leading to a normal form, the resulting normal forms are themselves related by a value‑level equivalence. This definition is coinductive, mirroring classic bisimulation techniques, but it is restricted to normal forms, hence the name.
The authors then prove two fundamental meta‑theoretical results. Soundness: if two terms are NFB‑equivalent, then they are contextually equivalent; that is, no context can distinguish them. The proof proceeds by showing that any context can be decomposed into a sequence of reductions that preserve the NFB relation, leveraging the fact that NFB already guarantees identical observable outcomes at the normal‑form level. Incompleteness: there exist contextually equivalent terms that are not related by NFB. A concrete counter‑example is given where two terms differ only in the way a captured continuation is re‑installed, a distinction that is invisible to NFB because both terms converge to the same value after the same number of reductions, yet a carefully crafted context can expose the difference. This demonstrates that NFB is a sound but not complete approximation of contextual equivalence.
Recognising that incompleteness is often acceptable in practice if the equivalence relation is easier to use, the authors develop a suite of up‑to techniques to simplify bisimulation proofs. The main ideas are:
- Up‑to context – when proving that two terms are related, one may ignore a common surrounding context and focus on the core subterms.
- Up‑to reduction – intermediate reduction steps can be “skipped” provided the resulting terms are already known to be related.
- Up‑to expansion – one may relate a term to a more “expanded” version of another term, useful when dealing with η‑expansions or when a reset introduces an extra layer of delimiters.
These techniques are formally justified by showing that any relation closed under the corresponding up‑to rule is still a subset of the greatest NFB relation. Consequently, they can be safely employed without sacrificing soundness.
The paper culminates with several illustrative examples that showcase the practicality of NFB combined with up‑to reasoning:
- η‑law for shift/reset – proving that
reset (shift k. e)is equivalent toewhenkdoes not appear free ine. The proof proceeds by a single up‑to reduction step, avoiding the need to consider all possible contexts that could surround the term. - Reset nesting law – establishing
reset (reset e) ≈ reset e. Using up‑to context, the innerresetcan be eliminated directly. - Capture‑reinstatement equivalence – demonstrating
reset (shift k. reset (k v)) ≈ reset v. This example involves multiple layers of continuation capture and reinstatement; the up‑to expansion technique allows the proof to treat the innerreset (k v)as an expansion ofv.
In each case, the authors compare the traditional applicative bisimulation proof (which would require enumerating all possible argument applications) with the NFB proof, highlighting the dramatic reduction in proof obligations.
The discussion section reflects on the limitations of the current work. The definition of NFB is tied to a call‑by‑value, untyped setting; extending it to typed calculi, to call‑by‑need or call‑by‑name strategies, or to richer control operators (e.g., multi‑prompt shift) remains open. Moreover, achieving completeness would likely require augmenting the relation with additional clauses or moving to a more expressive bisimulation framework, but such extensions could compromise the simplicity that makes NFB attractive.
In summary, the paper makes three key contributions: (1) a clean definition of normal‑form bisimilarity for a language with delimited control, (2) a rigorous proof of its soundness and demonstration of its incompleteness, and (3) a set of up‑to techniques that render NFB a practical tool for equational reasoning about programs that use shift and reset. The work bridges the gap between the theoretical elegance of contextual equivalence and the pragmatic need for manageable proof techniques in languages featuring advanced control flow constructs.