The Functional Machine Calculus III: Control

📅 2025-10-09
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
This paper addresses the theoretical limitation of Functional Machine Calculus (FMC) in supporting imperative control-flow constructs such as branching and loops. To resolve this, we propose an extended FMC—grounded in a simplified Krivine machine’s operational semantics—that introduces a multi-operand stack and a continuation stack, together with a corresponding simple type system. For the first time, this calculus fully embeds a minimal complete imperative language—including conditionals, exception handling, iteration, constants, and algebraic data types—while preserving confluence and strong normalization (in the absence of iteration). It unifies functional and imperative paradigms by explicitly modeling computational effects, evaluation strategies, and control flow, and supports side effects and concurrency. The core contribution is the first property-guaranteed extension of FMC that enables precise, formally verified embedding of imperative constructs, thereby providing a unified computational framework for hybrid programming models—one that combines intuitive operational semantics with rigorous theoretical foundations.

Technology Category

Application Category

📝 Abstract
The Functional Machine Calculus (Heijltjes 2022) is a new approach to unifying the imperative and functional programming paradigms. It extends the lambda-calculus, preserving the key features of confluent reduction and typed termination, to embed computational effects, evaluation strategies, and control flow operations. The first instalment modelled sequential higher-order computation with global store, input/output, probabilities, and non-determinism, and embedded both the call-by-name and call-by-value lambda-calculus, as well as Moggi's computational metalanguage and Levy's call-by-push-value. The present paper extends the calculus from sequential to branching and looping control flow. This allows the faithful embedding of a minimal but complete imperative language, including conditionals, exception handling, and iteration, as well as constants and algebraic data types. The calculus is defined through a simple operational semantics, extending the (simplified) Krivine machine for the lambda-calculus with multiple operand stacks to model effects and a continuation stack to model sequential, branching, and looping computation. It features a confluent reduction relation and a system of simple types that guarantees termination of the machine and strong normalization of reduction (in the absence of iteration). These properties carry over to the embedded imperative language, providing a unified functional-imperative model of computation that supports simple types, a direct and intuitive operational semantics, and a confluent reduction semantics.
Problem

Research questions and friction points this paper is trying to address.

Extending lambda-calculus to embed control flow operations
Unifying functional and imperative programming paradigms
Modeling branching and looping computation with types
Innovation

Methods, ideas, or system contributions that make the work stand out.

Extends lambda-calculus with multiple operand stacks
Adds continuation stack for branching and looping
Provides unified functional-imperative computation model