Graphs are a generalized concept that encompasses more complex data structures than trees, such as difference lists, doubly-linked lists, skip lists, and leaf-linked trees. Normally, these structures are handled with destructive assignments to heaps, which is opposed to a purely functional programming style and makes verification difficult. We propose a new purely functional language, $\lambda_{GT}$, that handles graphs as immutable, first-class data structures with a pattern matching mechanism based on Graph Transformation and developed a new type system, $F_{GT}$, for the language. Our approach is in contrast with the analysis of pointer manipulation programs using separation logic, shape analysis, etc. in that (i) we do not consider destructive operations but pattern matchings over graphs provided by the new higher-level language that abstract pointers and heaps away and that (ii) we pursue what properties can be established automatically using a rather simple typing framework.
翻译:图表是一个普遍的概念,它包含比树木更复杂的数据结构,例如差异列表、双链接列表、跳板列表和叶链接树。通常,这些结构被对堆积进行破坏性任务处理,这与纯功能性编程风格相对立,难以验证。我们建议了一个新的纯功能语言,$\lambda ⁇ GT}$,将图表处理成不可移动的、头等级数据结构,其模式匹配机制以图示变为基础,并为语言开发了一个新的类型系统,$F ⁇ GT}$。我们的方法与使用分离逻辑、形状分析等对指针操作程序的分析形成对照,因为(i) 我们不考虑破坏性操作,而是比新的更高层次语言提供的图案匹配模式,这些语言是抽象的指针和数字,以及(ii) 我们用一个非常简单的打字框架来自动查找属性。