智能系统的受控元编程:将Eval重新分类为受控效应
Governed Metaprogramming for Intelligent Systems: Reclassifying Eval as a Governed Effect
AI总结:
针对AI系统运行时动态生成可执行代码带来的权限放大问题,提出受控元编程语言设计,将程序表示视为一等值,将形式到可执行机器的转换作为受控效应,并通过形式化证明和mashinTalk DSL实现验证。
摘要:
AI系统越来越多地在运行时合成可执行结构:LLM生成程序,智能体构建工作流,自我改进系统修改自身行为。在经典的homoiconic和分阶段语言中,从代码表示到执行的转换是不受限制的。eval是一种语言原语,而不是受控操作。我们认为,在受控智能系统中,这种转换是一种权限放大:它将符号结构转换为可执行权限,必须像任何其他效应一样被中介。我们提出了受控元编程,一种语言设计,其中程序表示(机器形式)是一等值,形式操作是纯计算,而物化(从形式到可执行机器的转换)是一种受控效应,需经过结构检查。治理系统在允许执行之前分析提议程序的能力需求、策略合规性和资源估计。我们形式化了两个判断:纯形式评估(不发出指令)和受控物化(恰好发出一个受控指令)。我们证明了三个性质:形式操作的纯度、无旁路定理和边界保持。我们在mashinTalk中实现了该设计,mashinTalk是一种用于AI工作流的DSL,编译为BEAM字节码,并报告了与454个现有机器检查的Rocq定理的集成。核心贡献是将eval从语言原语重新分类为受控效应。
英文摘要:
AI systems increasingly synthesize executable structure at runtime: LLMs generate programs, agents construct workflows,self-improving systems modify their own behavior. In classical homoiconic and staged languages, the transition from code representation to execution is unrestricted. eval is a language primitive, not a governed operation. We argue that in governed intelligent systems, this transition is an authority amplification: it converts symbolic structure into executable authority and must be mediated like any other effect. We present governed metaprogramming, a language design where program representations (machine forms) are first-class values, form manipulation is pure computation, and materialization (the transition from form to executable machine) is a governed effect subject to structural inspection. The governance system analyzes the proposed program's capability requirements, policy compliance, and resource estimates before permitting execution. We formalize two judgments: pure form evaluation (which emits no directives) and governed materialization (which emits exactly one governed directive). We prove three properties: purity of form manipulation, the no-bypass theorem, and boundary preservation. We implement the design in mashinTalk, a DSL for AI workflows compiling to BEAM byte code, and report on integration with 454 existing machine-checked Rocq theorems. The central contribution is reclassifying eval from a language primitive into a governed effect.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。