Verified compositional compilation (VCC) is a notion of modular verification of compilers that supports compilation of heterogeneous programs. The key to achieve VCC is to design a semantic interface that enables composition of correctness theorems for compiling individual modules. Most of the existing techniques for VCC fix a semantic interface from the very beginning and force it down to every single compiler pass. This requires significant changes to the existing framework and makes it difficult to understand the relationship between conditions enforced by the semantic interface and the actual requirements of compiler passes. A different approach is to design appropriate semantic interfaces for individual compiler passes and combine them into a unified interface which faithfully reflects the requirements of underlying compiler passes. However, this requires vertically composable simulation relations, which were traditionally considered very difficult to construct even with extensive changes to compiler verification frameworks. We propose a solution to construction of unified semantic interfaces for VCC with a bottom-up approach. Our starting point is CompCertO, an extension of CompCert -- the state-of-the-art verified compiler -- that supports VCC but lacks a unified interface. We discover that a CompCert Kripke Logical Relation (CKLR) in CompCertO provides a uniform notion of memory protection for evolving memory states across modules and is transitively composable. Based on this uniform and composable CKLR, we then merge the simulation relations for all the compiler pass in CompCertO (except for three value analysis passes) into a unified interface. We demonstrate the conciseness and effectiveness of this unified interface by applying it to verify the compositional compilation of a non-trivial heterogeneous program with mutual recursion.
翻译:验证组合编译(VCC)是一种支持异构程序编译的模块化编译器验证概念。实现VCC的关键是设计一个语义接口,使得能够组合编译单个模块的正确性定理。大多数现有的VCC技术从一开始就固定了一个语义接口,并将其强行应用到每个编译器通路。这需要对现有框架进行重大改变,并使得理解语义接口所强制的条件与实际编译器通路需求之间的关系变得困难。另一种方法是针对各个编译器通路设计适当的语义接口,并将它们组合成一个统一接口,以忠实地反映底层编译器通路的要求。然而,这需要可纵向组合的模拟关系,即使在对编译器验证框架进行大量更改的情况下,这也被传统上认为是非常困难的。我们提出了一种自下而上的方法来构建用于VCC的统一语义接口的解决方案。我们的出发点是CompCertO,它是CompCert的扩展,支持VCC但缺乏统一接口。我们发现CompCert Kripke Logical Relation(CKLR)在CompCertO中为跨模块不断演变的存储状态提供了一致的内存保护概念,并且是可传递组合的。基于这个具有一致性和可组合性的CKLR,我们将CompCertO中所有编译器通路的模拟关系(除了三个值分析通路)合并成一个统一接口。我们通过将其应用于验证一个非平凡异构程序的组合编译来证明这个统一接口的简洁性和有效性。