一句话:提出关系机器演算 RMC:一阶关系编程的基础模型,以语法对合与 Frobenius 幺半群字符串图统一多种计算模型。
本文提出关系机器演算(RMC),一个简单的一阶关系编程基础模型。RMC 源自函数式机器演算(FMC),通过位置引入多栈以编码效应,通过顺序引入 skip 与 sequence 等命令式概念。其关键观察是 FMC 一阶片段具有潜在对偶性,经构造子分解后表现为语法上的对合,从而为 Frobenius 幺半群的字符串图给出可靠且完备的演算;同时将合一视为 β-归约的对称推广。加入 Kleene 代数算子后,RMC 可嵌入 kappa 演算、逻辑编程、自动机、交互网与 Petri 网等模型,并保持操作语义。其等式理论对一阶 lambda 演算和 Kleene 代数保守,可定向为合流归约关系。
This paper presents the Relational Machine Calculus (RMC): a simple, foundational model of first-order relational programming. The RMC originates from the Functional Machine Calculus (FMC), which generalizes the lambda-calculus and its standard call-by-name stack machine in two directions. One, "locations", introduces multiple stacks, which enable effect operators to be encoded into the abstraction and application constructs. The second, "sequencing", introduces the imperative notions of "skip" and "sequence", similar to kappa-calculus and concatenative programming languages. The key observation of the RMC is that the first-order fragment of the FMC exhibits a latent duality which, given a simple decomposition of the relevant constructors, can be concretely expressed as an involution on syntax. Semantically, this gives rise to a sound and complete calculus for string diagrams of Frobenius monoids. We consider unification as the corresponding symmetric generalization of beta-reduction. By further including standard operators of Kleene algebra, the RMC embeds a range of computational models: the kappa-calculus, logic programming, automata, Interaction Nets, and Petri Nets, among others. These embeddings preserve operational semantics, which for the RMC is again given by a generalization of the standard stack machine for the lambda-calculus. The equational theory of the RMC (which supports reasoning about its operational semantics) is conservative over both the first-order lambda-calculus and Kleene algebra, and can be oriented to give a confluent reduction relation.