一句话:提出构造性 Galois 连接,使抽象解释中的 Galois 连接可在依赖类型证明助手中机械化并支持可提取算法。
Galois 连接是抽象解释与语义中组织抽象的基础工具,但其在证明助手中的机械化此前仅限受限用法,难以广泛用于机械化元理论与认证编程。本文提出构造性 Galois 连接:识别经典 Galois 连接的一种既通用又适合在依赖类型函数式语言中机械化的受限使用模式,并加入 monadic 结构控制“规约效应”。效应化计算可经典推理,纯计算保留可提取内容,从而支持在规约与实现间显式切换及 Cousot 的计算式推理风格。案例研究包括用计算式抽象解释设计静态分析器,以及为渐进类型建立语义基础;机械化证明贴近原始纸笔证明,支持已验证算法抽取,并采用此前机械化方法未涵盖的推理原则。
Abstract Galois connections are a foundational tool for structuring abstraction in semantics, and their use lies at the heart of the theory of abstract interpretation. Yet, mechanization of Galois connections using proof assistants remains limited to restricted modes of use, preventing their general application in mechanized metatheory and certified programming. This paper presents constructive Galois connections , a variant of Galois connections that is effective both on paper and in proof assistants; is complete with respect to a large subset of classical Galois connections; and enables more general reasoning principles, including the “calculational” style advocated by Cousot. To design constructive Galois connections, we identify a restricted mode of use of classical ones which is both general and amenable to mechanization in dependently typed functional programming languages. Crucial to our metatheory is the addition of monadic structure to Galois connections to control a “specification effect.” Effectful calculations may reason classically, while pure calculations have extractable computational content. Explicitly moving between the worlds of specification and implementation is enabled by our metatheory. To validate our approach, we provide two case studies in mechanizing existing proofs from the literature: the first uses calculational abstract interpretation to design a static analyzer, and the second forms a semantic basis for gradual typing. Both mechanized proofs closely follow their original paper-and-pencil counterparts, employ reasoning principles not captured by previous mechanization approaches, support the extraction of verified algorithms, and are novel.