arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2610.14898cs.PL
收藏

在Agda中实现指称语义的机械化

Mechanising Denotational Semantics in Agda

Delft University of Technology(代尔夫特理工大学);Swansea University(斯旺西大学);University of Sussex(萨塞克斯大学)

Peter D. Mosses, Jesper Cockx, Bernhard Reus

AI总结:

本文将编程语言的Scott-Strachey指称语义嵌入Agda以实现机械化,借助Agda类型检查器检测定义的良构性与类型问题,还通过三个案例阐释方法并探讨合成域理论的机械化可能性。

摘要:

数学定义的机械化(也称为形式化)具有诸多益处。本文聚焦于通过将编程语言的指称语义定义嵌入Agda语言,实现其机械化。Agda的类型检查器会检测并报告嵌入定义在良构性与类型正确性方面的任何问题。为最小化所需工作量并便于关联原始定义与其Agda嵌入版本,机械化不应涉及重大的重新表述或扩展。本文展示了如何在几乎不改动λ-记号或域方程的情况下,将传统Scott-Strachey指称定义嵌入Agda;Agda中类型与函数的定义记号与指称语义的传统元记号高度契合。我们已开发一组Agda模块,其中包含常用域构造子及其关联操作的假设类型。我们通过对三个指称定义的机械化来阐释该方法:无类型λ演算的模型、Plotkin的PCF指称语义,以及Scheme子语言的语义。过往研究中,在Agda内开展的类似机械化已揭示出已发表指称定义中若干未被察觉的良构性问题。我们定义的部分假设属性与Agda的经典集合论解释不一致;我们推测,这些属性在高阶直觉主义逻辑(如Simpson在合成域理论研究中所用的逻辑)对Agda的解释下将保持一致。在回顾过往关于域理论机械化的研究后,我们探讨了在Agda中实现合成域理论机械化的可能性。

英文摘要:

Mechanisation of a mathematical definition (also referred to as formalisation) has many benefits. Here, we focus on mechanising denotational semantic definitions of programming languages by embedding them in the Agda language. The Agda type-checker detects and reports any issues with the wellformedness and type correctness of the embedded definitions. To minimise the effort required, and to facilitate correlation of the original definition with its Agda embedding, mechanisation should not involve significant reformulation or extension. Here, we show how to embed conventional Scott-Strachey denotational definitions in Agda with almost no changes to $λ$-notation or domain equations. Agda notation for definitions of types and functions corresponds closely to the conventional meta-notation of denotational semantics. We have developed a collection of Agda modules with postulated types for commonly used domain constructors and their associated operations. We illustrate our approach with mechanisations of three denotational definitions: a model of the untyped $λ$-calculus, Plotkin's denotational semantics of PCF, and a semantics of a sublanguage of Scheme. In previous work, similar mechanisations in Agda have revealed several unsuspected wellformedness issues in published denotational definitions. Some of the postulated properties of our definitions are inconsistent with a classical set-theoretic interpretation of Agda. We conjecture that they would be consistent with an interpretation of Agda in a higher-order intuititionistic logic, such as that used by Simpson in his work on synthetic domain theory. After recalling previous work on mechanising domain theory, we consider the possibility of mechanising synthetic domain theory in Agda.

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

↑