arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2406.18304cs.PL
收藏

基于示例的多态程序可实现性推理

Example-Based Reasoning about the Realizability of Polymorphic Programs

Niek Mulleners, Johan Jeuring, Bastiaan Heeren

AI总结:

本文研究参数性、输入输出示例与草图之间的交互,提出利用容器态射表示多态函数,并通过转换到容器设定实现多态程序可实现性的自动推理,以辅助程序合成中的搜索空间剪枝。

摘要:

参数性(Parametricity)表明多态函数无论以何种方式实例化,其行为都保持一致。在开发多态程序时,Wadler 的自由定理(free theorems)可以作为免费规范,将原本不完整的规范转化为完整规范,也可能使原本可实现(realizable)的规范变得不可实现。这对程序合成领域尤其重要,因为规范不可实现性可用于剪枝搜索空间。本文聚焦于参数性、输入输出示例与草图(sketches)之间的交互。遗憾的是,自由定理引入了全称量化的函数,使得自动推理变得困难。容器态射(Container morphisms)为多态函数提供了一种替代表示,以更易处理的方式刻画参数性。通过转换到容器设定,我们展示了如何自动推理带有输入输出示例的多态程序可实现性。

英文摘要:

Parametricity states that polymorphic functions behave the same regardless of how they are instantiated. When developing polymorphic programs, Wadler's free theorems can serve as free specifications, which can turn otherwise partial specifications into total ones, and can make otherwise realizable specifications unrealizable. This is of particular interest to the field of program synthesis, where the unrealizability of a specification can be used to prune the search space. In this paper, we focus on the interaction between parametricity, input-output examples, and sketches. Unfortunately, free theorems introduce universally quantified functions that make automated reasoning difficult. Container morphisms provide an alternative representation for polymorphic functions that captures parametricity in a more manageable way. By using a translation to the container setting, we show how reasoning about the realizability of polymorphic programs with input-output examples can be automated.

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

↑