First-order logic is a natural way of expressing the properties of computation, traditionally used in various program logics for expressing the correctness properties and certificates. Subsequently, modern methods in the automated inference of program invariants progress towards the construction of first-order definable invariants. Although the first-order representations are very expressive for some theories, they fail to express many interesting properties of algebraic data types (ADTs). Thus we propose to represent program invariants regularly with tree automata. We show how to automatically infer such regular invariants of ADT-manipulating programs using finite model finders. We have implemented our approach and evaluated it against the state-of-art engines for the invariant inference in first-order logic for ADT-manipulating programs. Our evaluation shows that automata-based representation of invariants is more practical than the one based on first-order logic since invariants are capable of expressing more complex properties of the computation and their automatic construction is less expensive.
翻译:第一阶逻辑是表达计算特性的一种自然方式,传统上用于各种程序逻辑,以表达正确性属性和证书。随后,程序变异性自动推断的现代方法在构建一级可定义变异性上的进展。虽然第一阶表达方式对某些理论来说非常明确,但它们未能表达代数数据类型(ADTs)的许多有趣的特性。因此,我们提议用树自动图定期代表程序变异性。我们展示了如何用有限的模型发现器自动推断ADT管理程序的经常变异性。我们实施了我们的方法,并对照ADT管理程序在一级变异性推论方面最先进的引擎对它进行了评估。我们的评估表明,基于自动变异性表示方式比基于第一阶逻辑的更实际,因为变异性能够表达更复杂的计算特性,其自动构造费用较低。