We present an algebraic semantics for governed execution in which governance is axiomatized, compositional, and coterminous with expressibility. The framework, mechanized in 32 Rocq modules (~12,000 lines, 454 theorems, 0 admitted), is built on interaction trees and parameterized coinduction. A three-axiom GovernanceAlgebra record (safety, transparency, properness) induces a symmetric monoidal category with verified pentagon, triangle, and hexagon coherence, where every tensor composition preserves governance. An algebraic effect system constrains the handler algebra so that only governance-preserving handlers can be constructed in the safe fragment; programs in the empty capability set provably emit only observability directives. Capability-indexed composition bundles programs with machine-checked capability bounds, and a dual guarantee theorem establishes that within_caps and gov_safe hold simultaneously under all composition operators. The capstone result is the coterminous boundary: within our formal model, every program expressible via the four primitive morphism constructors is governed under interpretation, and every governed program is the image of such a program. Turing completeness is preserved inside governance; unmediated I/O is excluded from the governed fragment. Governance denial is modeled as safe coinductive divergence. The governance algebra is parametric: any system instantiating the three axioms inherits all derived properties, including convergence, compositional closure, and goal preservation. Extracted OCaml runs as a NIF in the BEAM runtime, with property-based testing (70,000+ random inputs, zero disagreements) confirming behavioral equivalence between the specification and the runtime interpreter.
翻译:我们提出了一种受治理执行的代数语义,其中治理性被公理化、组合化,并与可表达性同延。该框架基于交互树和参数化余归纳实现,并在32个Rocq模块中机械化(约12000行代码、454个定理、0个未证明)。由三条公理构成的可治理代数记录(安全性、透明性、恰当性)诱导出一个经验证满足五边形、三角形和六边形相干条件的对称幺半范畴,其中每个张量组合均保持治理性。一个代数效应系统约束了处理器代数,使得在安全片段中仅能构造保持治理性的处理器;空能力集程序可证明仅发射可观测性指令。能力索引组合将程序与机器检验的能力边界捆绑,对偶保证定理确立了在任意组合算子下within_caps和gov_safe同时成立。最终结论是同延边界定理:在我们的形式模型中,通过四种原始态射构造子可表达的每个程序在解释下均受治理,且每个受治理程序皆为此类程序的像。图灵完备性在治理内部得到保持;无中介的I/O被排除在治理片段之外。治理拒绝被建模为安全余归纳发散。该可治理代数是参数化的:任何实例化三条公理的系统均继承所有导出性质,包括收敛性、组合封闭性与目标保持性。提取的OCaml代码作为NIF在BEAM运行时中运行,基于属性的测试(超过70000个随机输入,零分歧)确认了规约与运行时解释器之间的行为等价性。