完全可组合且充分的可信编译:开放模块间的直接精化(技术报告)
Fully Composable and Adequate Verified Compilation with Direct Refinements between Open Modules (Technical Report)
AI总结:
提出一种基于CompCert内存模型和带内存保护的Kripke关系的开放模块可信组合编译方法,实现直接精化,支持完整编译链的端到端验证,降低验证复杂度。
摘要:
开放模块(即功能依赖于其他模块的模块)的可信编译为当代软件中普遍存在的模块化程序的端到端验证提供了基础。然而,尽管该主题已历经数十年的深入研究,所提出的方法在实际应用中仍难以使用,因为它们依赖于对编译器内部工作机制的假设,这使得外部用户难以应用验证结果。我们提出了一种无需此类假设的可信组合编译方法,适用于对使用支持全局内存和指针的一阶语言编写的异构模块进行验证编译。我们的方法基于CompCert的内存模型,并发现带有内存保护概念的Kripke关系可以作为编译器遍(passes)的统一且可组合的语义接口。通过将所有编译器遍对内存演化的依赖-保证条件吸收到该Kripke内存关系中,并将对编译器优化的要求附加于其上,我们获得了现实优化编译器的组合正确性定理,这些定理作为直接关联开放模块原生语义且不关心中间编译过程的精化。这种直接精化支持开放模块可信编译所需的所有组合性和充分性属性。我们已将该方法应用于CompCert的完整编译链及其Clight源语言,并通过端到端验证可自由相互调用(例如,相互递归)的非平凡异构模块,证明了我们的编译器正确性定理对组合开放且易于使用,同时降低了验证复杂度。
英文摘要:
Verified compilation of open modules (i.e., modules whose functionality depends on other modules) provides a foundation for end-to-end verification of modular programs ubiquitous in contemporary software. However, despite intensive investigation in this topic for decades, the proposed approaches are still difficult to use in practice as they rely on assumptions about the internal working of compilers which make it difficult for external users to apply the verification results. We propose an approach to verified compositional compilation without such assumptions in the setting of verifying compilation of heterogeneous modules written in first-order languages supporting global memory and pointers. Our approach is based on the memory model of CompCert and a new discovery that a Kripke relation with a notion of memory protection can serve as a uniform and composable semantic interface for the compiler passes. By absorbing the rely-guarantee conditions on memory evolution for all compiler passes into this Kripke Memory Relation and by piggybacking requirements on compiler optimizations onto it, we get compositional correctness theorems for realistic optimizing compilers as refinements that directly relate native semantics of open modules and that are ignorant of intermediate compilation processes. Such direct refinements support all the compositionality and adequacy properties essential for verified compilation of open modules. We have applied this approach to the full compilation chain of CompCert with its Clight source language and demonstrated that our compiler correctness theorem is open to composition and intuitive to use with reduced verification complexity through end-to-end verification of non-trivial heterogeneous modules that may freely invoke each other (e.g., mutually recursively).
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。