一句话:提出仅用正例的ILP算法,从内存图合成含数据性质(如有序性)的递归分离逻辑堆谓词。
本文研究如何从具体数据结构实例自动合成分离逻辑(SL)中的递归堆谓词。现有归纳逻辑编程(ILP)方法依赖负例,而堆结构负例难以自动构造;同时合成结果不仅要概括堆形状,还要刻画所存数据的性质。作者提出一种新的谓词学习算法,仅使用正例进行 ILP 学习,并基于具体内存图合成性质丰富的 SL 谓词;还提供从程序生成正例堆的内存图生成器。实验表明,该方法能高效、正确地合成现有工具难以处理的谓词,包括带非平凡负载约束的二叉搜索树和嵌套递归的 n 叉树,并可用于演绎验证与构造即正确的代码合成。
We present an approach to automatically synthesise recursive predicates in Separation Logic (SL) from concrete data structure instances using Inductive Logic Programming (ILP) techniques. The main challenges to make such synthesis effective are (1) making it work without negative examples that are required in ILP but are difficult to construct for heap-based structures in an automated fashion, and (2) to be capable of summarising not just the shape of a heap (e.g., it is a linked list), but also the properties of the data it stores (e.g., it is a sorted linked list). We tackle these challenges with a new predicate learning algorithm. The key contributions of our work are (a) the formulation of ILP-based learning only using positive examples and (b) an algorithm that synthesises property-rich SL predicates from concrete memory graphs based on the positive-only learning. We show that our framework can efficiently and correctly synthesise SL predicates for structures that were beyond the reach of the state-of-the-art tools, including those featuring non-trivial payload constraints (e.g., binary search trees) and nested recursion (e.g., n-ary trees). We further extend the usability of our approach by a memory graph generator that produces positive heap examples from programs. Finally, we show how our approach facilitates deductive verification and synthesis of correct-by-construction code.