arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2212.08177cs.PL
收藏

函数机器演算

The Functional Machine Calculus

Willem Heijltjes

AI总结:

本文提出函数机器演算,通过位置和排序推广lambda演算以编码读/写效应,实现合流性和类型终止性。

摘要:

本文提出函数机器演算(FMC),作为带“读/写”效应的高阶计算的简单模型:高阶可变存储、输入/输出以及概率和非确定性计算。FMC源自lambda演算,将按名调用栈机器的标准操作视角作为主要视角,并引入两个自然推广。其一,“位置”引入多个栈,每个栈可代表一种效应,从而使得效应算子能被编码进演算的抽象和应用构造中。其二,“排序”已知于kappa演算和拼接式编程语言,引入“跳过”和“顺序”的命令式概念。这能编码归约策略,包括按值调用lambda演算和单子构造。将效应编码进广义抽象和应用意味着lambda演算的标准结果可推广到效应。主要结果是合流性,这之所以可能,是因为编码的效应以代数方式而非操作方式归约。归约生成熟悉的状态代数定律,且与单子设置不同,读/写效应能无缝组合。一个简单类型系统赋予机器终止性。

英文摘要:

This paper presents the Functional Machine Calculus (FMC) as a simple model of higher-order computation with "reader/writer" effects: higher-order mutable store, input/output, and probabilistic and non-deterministic computation. The FMC derives from the lambda-calculus by taking the standard operational perspective of a call-by-name stack machine as primary, and introducing two natural generalizations. One, "locations", introduces multiple stacks, which each may represent an effect and so enable effect operators to be encoded into the abstraction and application constructs of the calculus. The second, "sequencing", is known from kappa-calculus and concatenative programming languages, and introduces the imperative notions of "skip" and "sequence". This enables the encoding of reduction strategies, including call-by-value lambda-calculus and monadic constructs. The encoding of effects into generalized abstraction and application means that standard results from the lambda-calculus may carry over to effects. The main result is confluence, which is possible because encoded effects reduce algebraically rather than operationally. Reduction generates the familiar algebraic laws for state, and unlike in the monadic setting, reader/writer effects combine seamlessly. A system of simple types confers termination of the machine.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑