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.
翻译:本文介绍功能机器计算法(FMC),作为具有“ 读数/ 写数” 效果的更高顺序计算方法的简单模型: 更高顺序的变异存储、 输入/ 输出、 概率和非确定性的计算。 FMC 以按名书架机的标准操作角度为主, 并引入两种自然的概括。 一种是“ 位置 ”, 引入多个堆叠, 每一个都可能代表一种效果, 从而使得效果操作者能够被编码成计算器的抽象和应用结构。 第二种是“ 序列”, 由 kappa- 计算法和调制式编程语言所著称, 并引入了“ skip” 和“ 序列” 等必要概念。 这使得削减战略的组合, 包括按按名调的羔羊- 计算法和 monadic 构造。 将效果归为普通抽象的抽象缩略图和应用程序, 意味着由羊驼- 计算法的标准结果可能会传到效果上。 主要结果是, 解算法, 的缩缩缩定义是,, 的生成,, 和 的缩缩 的 的生成是 的,,,, 可能产生共同生成法, 的 的 并产生 并列, 的,, 并列 并列 的,,,, 的 的, 的 的 的,, 使 和 常规 的 的 的 的 的 的 的 的,,,,, 使 的 的 的 的, 使,, 使 使,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,