Contextual MetaML: Syntax and Full Abstraction
Haoxuan Yin, Andrzej S. Murawski, C.-H. Luke Ong
摘要
MetaML-style metaprogramming languages allow programmers to construct, manipulate and run code. In the presence of higher-order references for code, ensuring type safety is challenging, as free variables can escape their binders. In this paper, we present Contextual MetaML, the first metaprogramming language that supports storing and running open code under a strong type safety guarantee. The type system utilises contextual modal types to track and reason about free variables in code explicitly.
A crucial concern in metaprogramming-based program optimisations is whether the optimised program preserves the meaning of the original program. Addressing this question requires a notion of program equivalence and techniques to reason about it. In this paper, we provide a semantic model that captures contextual equivalence for Contextual MetaML, establishing the first full abstraction result for an imperative MetaML-style language. Our model is based on traces derived via operational game semantics, where the meaning of a program is modelled by its possible interactions with the environment. We also establish a novel closed instances of use theorem that accounts for both call-by-value and call-by-name closing substitutions.
问问这篇 Paper
智能体会读完全文。
Lune 把这篇 Paper 索引到了每一个公式,引用它的顶会 Paper 也一样。你提问,回答直接引用原文。
它引用的顶会 Paper3
- Mœbius: metaprogramming using contextual types: the stage where system f can pattern match on itselfJunyoung Jang, Samuel Gélineau, Stefan Monnier, Brigitte PientkaPOPL 2022 · 被引用 28 次
- Staging with class: a specification for typed template HaskellNingning Xie, Matthew Pickering, Andres Löh, Nicolas Wu 等POPL 2022 · 被引用 17 次
- A Dependent Type Theory for Meta-programming with Intensional AnalysisJason Z. S. Hu, Brigitte PientkaPOPL 2025 · 被引用 2 次
相关 Paper
- Reachability Types, Traces and Full AbstractionBenedict Bunting, Andrzej S. MurawskiLICS 2025 · 被引用 2 次
- When Do Staging Annotations Preserve Semantics? Mechanizing Typed Semantics-Preserving Multi-stage Programming with Let-InsertionJun Tan, Guannan WeiOOPSLA 2026
- Refined² Environment ClassifiersYuito Murase, Atsushi IgarashiOOPSLA 2026
- Contextual Equivalence for State and Control via Nested DataBenedict Bunting, Andrzej S. MurawskiLICS 2024
- Modeling Reachability Types with Logical Relations: Semantic Type Soundness, Termination, Effect Safety, and Equational TheoryYuyan Bao, Songlin Jia, Guannan Wei, Oliver Bracevac 等OOPSLA 2025 · 被引用 3 次
