Clef 编程语言中的不动点脚手架
Fixed-Point Scaffolding in the Clef Programming Language
AI总结:
本文提出一种基于不动点组合子的编译器中间表示方法,通过范畴论构造实现类型结构保持和正确性验证,并利用 MLIR 工具链支撑实际编译。
摘要:
对于 Gabriel 的“更糟即更好”的粉丝来说,讽刺的是,C++ 通过 MLIR 充当了编译 ML 家族语言的脚手架,而该语言的正确性属性是结构性的。在我们的 Composer 编译器中,一个关键的交叉点以不动点组合子开始其降级,该组合子保留了程序语义图中的维度、等级、转义和数值表示结构。而来自 PSG 的 MLIR 并非被动宿主。它使用静态单赋值、属性系统和方言来实质性地承载这些结构。我们展示了编译器中间端使用范畴论构造来降级代码,并伴随该层级的验证:一个从编译偏序集到目标范畴的函子,满足组合性方程。我们方法的依据来自三个来源,每个都基于自身的代数对象:Ohori 的机器码证明理论为编译轴提供基础,参数性为底层内容提供基础,伴随模态逻辑为验证层级之间的遍历提供基础。为了扩展论点,我们引入了紧闭负类型和分数类型,并展示了类型机制可以在保持结构的情况下实现,并通过 MLIR 提供的工具实现。更广泛地说,通过编译保持类型的相同不动点原语也提供了证明项,这些证明项可以在 MLIR 中继续使用,以验证其完整性,因为降级过程通过流水线进行。我们认为,这个基础是我们框架预期的一个独特附加点,包括维度类型、Tarau 的群胚和细胞层。在整个过程中,形式化被实现为内部脚手架:抽象支持编译器的机制,开发者永远不需要接触范畴论就能依赖编译器提供的保证。
英文摘要:
Native compilation changes how a program represents values and performs operations from processor to processor. In our view, proofs that justify source-level decisions must remain connected to those changes. We develop fixed-point scaffolding for this continuity in Clef and our Composer compiler. Our Program Semantic Graph retains types, joint constraints and proof dependencies. A thin MLIR middle end witnesses their settled consequences for native CPU, GPU, NPU and FPGA realization. The account connects nanopass traversal with preservation contracts, structural theorems and adjoint interfaces between reasoning modes. Four verification tiers organize automatic inference and reusable domain and system proofs, with probabilistic relations admitted at Tier 4. Established lower-tier facts can directly support richer derivations. We state conditions for composing lowering contracts and assembling compatible program segments, then show how their dependencies govern differential compilation after an edit. A worked foreign-call boundary follows source ranges through argument marshaling, the actual call and return conversion. Current FFI mechanisms bind checking evidence to those witnessed operations. A recent paper from Urschel provides elimination-growth bounds that supply a quantitative example. Reusable premises inform representation and error contracts that retain their sampling, arithmetic and exceptional-path assumptions. A further example admits value-indexed pairing through ordinary MLIR operations, connecting this scaffold to negative and fractional types. Together these constructions explain how a thin middle end can carry the consequences of rich source proofs into unboxed computation graphs. Integrity and efficiency share the same retained evidence. It justifies native realizations and identifies which analyses, proofs and lowered fragments remain reusable during development.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。