arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2301.02195cs.CLcs.AIcs.LO
收藏

数学的自动形式化和代码正确性:初等证明实验

Towards Autoformalization of Mathematics and Code Correctness: Experiments with Elementary Proofs

Ohio University(俄亥俄大学);UNC Charlotte(北卡罗来纳大学夏洛特分校)

Garett Cunningham, Razvan C. Bunescu, David Juedes

摘要:

数学证明的日益复杂性使得数学家的人工验证在认知上要求很高。自动形式化试图通过将用自然语言编写的证明转换为通过交互式定理证明器可由计算机验证的形式表示来解决这个问题。在本文中,我们介绍了一种语义解析方法,通用Transformer架构的基础上,转换成一个等价的形式化的Coq交互式定理证明语言的基本数学证明。同样的架构也被训练来将用Hoare三元组装饰的简单命令式代码转换成Coq中的形式可验证的正确性证明。在有限的人工和人类书面证明领域上的实验表明,该模型可以很好地推广到训练过程中看不到的中间长度和自然语言的变化。

英文摘要:

The ever-growing complexity of mathematical proofs makes their manual verification by mathematicians very cognitively demanding. Autoformalization seeks to address this by translating proofs written in natural language into a formal representation that is computer-verifiable via interactive theorem provers. In this paper, we introduce a semantic parsing approach, based on the Universal Transformer architecture, that translates elementary mathematical proofs into an equivalent formalization in the language of the Coq interactive theorem prover. The same architecture is also trained to translate simple imperative code decorated with Hoare triples into formally verifiable proofs of correctness in Coq. Experiments on a limited domain of artificial and human-written proofs show that the models generalize well to intermediate lengths not seen during training and variations in natural language.

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

↑