The Functional Machine Calculus

12/15/2022
by   Willem Heijltjes, et al.
0

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.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
05/25/2023

On the Simply-Typed Functional Machine Calculus: Categorical Semantics and Strong Normalisation

The Functional Machine Calculus (FMC) was recently introduced as a gener...
research
11/23/2022

The Functional Machine Calculus II: Semantics

The Functional Machine Calculus (FMC), recently introduced by the author...
research
12/07/2019

Modular Termination for Second-Order Computation Rules and Application to Algebraic Effect Handlers

We present a new modular proof method of termination for second-order co...
research
07/25/2023

Higher-Order Asynchronous Effects

We explore asynchronous programming with algebraic effects. We complemen...
research
06/17/2015

Pragmatic Side Effects

In the quest to give a formal compositional semantics to natural languag...
research
02/19/2020

Decomposing Probabilistic Lambda-calculi

A notion of probabilistic lambda-calculus usually comes with a prescribe...
research
07/02/2019

Local Reasoning for Robust Observational Equivalence

We propose a new core calculus for programming languages with effects, i...

Please sign up or login with your details

Forgot password? Click here to reset