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

Bonsai:基于合成的类型系统推理

Bonsai: Synthesis-Based Reasoning for Type Systems

Kartik Chandra, Rastislav Bodik

摘要:

我们描述的符号推理算法的类型系统的可执行模型,支持三个查询类型系统的设计者打算。首先,我们检查类型健全性错误,并合成一个反例程序,如果这样的错误被发现。其次,我们比较两个版本的类型系统,合成一个程序接受,但拒绝了另一个。第三,我们最小化合成反例程序的大小。这些算法象征性地评估类型检查器和解释器,产生表征在类型检查器和解释器中失败或成功的程序集的公式。然而,象征性地评估解释器带来了效率挑战,这是由于必须合并各种可能的输入程序的执行路径而引起的。我们的主要贡献是盆景树,一个新的象征性的表示程序和程序状态,解决这些挑战。Bonsai树根据逻辑约束对复杂的语法信息进行编码,从而实现更有效的合并。我们实现这些算法的盆景工具,类型系统设计师的助手。我们对Bonsai如何帮助测试和探索各种类型系统进行案例研究。Bonsai有效地合成了自动化工具无法访问的可靠性错误的反例,并且是第一个为最近发现的Scala可靠性错误SI-9633找到反例的自动化工具。

英文摘要:

We describe algorithms for symbolic reasoning about executable models of type systems, supporting three queries intended for designers of type systems. First, we check for type soundness bugs and synthesize a counterexample program if such a bug is found. Second, we compare two versions of a type system, synthesizing a program accepted by one but rejected by the other. Third, we minimize the size of synthesized counterexample programs. These algorithms symbolically evaluate typecheckers and interpreters, producing formulas that characterize the set of programs that fail or succeed in the typechecker and the interpreter. However, symbolically evaluating interpreters poses efficiency challenges, which are caused by having to merge execution paths of the various possible input programs. Our main contribution is the Bonsai tree, a novel symbolic representation of programs and program states which addresses these challenges. Bonsai trees encode complex syntactic information in terms of logical constraints, enabling more efficient merging. We implement these algorithms in the Bonsai tool, an assistant for type system designers. We perform case studies on how Bonsai helps test and explore a variety of type systems. Bonsai efficiently synthesizes counterexamples for soundness bugs that have been inaccessible to automatic tools, and is the first automated tool to find a counterexample for the recently discovered Scala soundness bug SI-9633.

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

↑