arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2602.03033cs.PL
收藏

Contextual MetaML: Syntax and Full Abstraction

Contextual MetaML: Syntax and Full Abstraction

University of Oxford(牛津大学);Nanyang Technological University(南洋理工大学)

Haoxuan Yin, Andrzej S. Murawski, C. -H. Luke Ong

AI总结:

本文提出Contextual MetaML,一种支持在强类型保证下存储和运行开放代码的元编程语言,通过上下文模态类型追踪和推理自由变量,实现了元编程语言的首次完全抽象结果。

摘要:

MetaML风格的元编程语言允许程序员构造、操作和运行代码。在存在高阶引用的情况下,确保类型安全具有挑战性,因为自由变量可能逃脱绑定器。在本文中,我们提出了Contextual MetaML,即第一个支持在强类型安全保证下存储和运行开放代码的元编程语言。类型系统利用上下文模态类型来显式跟踪和推理代码中的自由变量。元编程基础程序优化中的关键问题是优化后的程序是否保持原始程序的意义。解决这个问题需要程序等价性的概念和推理技术。在本文中,我们提供了一个语义模型,该模型捕捉了Contextual MetaML的上下文等价性,建立了第一个针对 imperative MetaML 风格语言的完全抽象结果。我们的模型基于通过操作游戏语义推导出的轨迹,其中程序的意义由其与环境的可能交互建模。我们还建立了新的闭实例使用定理,该定理考虑了值传递和名称传递的闭合替换。

英文摘要:

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, \textit{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 \textit{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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑