First-order logic is a natural way of expressing properties of computation. It is traditionally used in various program logics for expressing the correctness properties and certificates. Although such representations are expressive for some theories, they fail to express many interesting properties of algebraic data types (ADTs). In this paper, we explore three different approaches to represent program invariants of ADT-manipulating programs: tree automata, and first-order formulas with or without size constraints. We compare the expressive power of these representations and prove the negative definability of both first-order representations using the pumping lemmas. We present an approach to automatically infer program invariants of ADT-manipulating programs by a reduction to a finite model finder. The implementation called RInGen has been evaluated against state-of-the-art invariant synthesizers and has been experimentally shown to be competitive. In particular, program invariants represented by automata are capable of expressing more complex properties of computation and their automatic construction is often less expensive.
翻译:第一阶逻辑是表达计算属性的一种自然方式。它传统上用于各种程序逻辑,以表达正确性属性和证书。虽然这种表达方式对某些理论有其表态,但却未能表达代数数据类型(ADTs)的许多有趣的特性。在本文中,我们探索了三种不同的方法来代表ADT管理程序的程序变量:树自动成像仪和有大小限制或没有尺寸限制的第一阶公式。我们比较了这些表达方式的表达力,并证明使用泵 Lemmas 进行的第一阶演示的负定义性。我们展示了一种方法,通过将ADT-manage-mangic 程序的变量减少为有限的模型查找器来自动推断程序变量。RInGen的实施工作是对照状态的变异合成器进行评估的,并且实验性地证明具有竞争性。特别是,由自动成形仪所代表的程序变量能够表达更复杂的计算特性,其自动构造往往成本较低。