Source-linked AI summary

On the Expressiveness of Asynchronous Processes with Nested Session Types

Sjors Wortelboer, Dan Frumin, Jorge A. Pérez

arXiv:2610.32558v1cs.PLcs.DC

TL;DR

The paper asks whether the well-typed processes of ASP, the process language associated with Nested Session Types, can be Turing complete. It encodes Minsky machines using state-aware counters and instructions governed by NSTs, and proves ASP Turing complete.

  • Problem

    Whether well-typed ASP configurations are Turing complete remains open, despite known results on the intrinsic expressiveness of NSTs.

    Source: §1 · p. 2
  • Method

    The paper encodes Minsky machines in ASP, representing counters as stacks with polymorphic nested types and making instruction processes state-aware.

    Source: §1 · p. 2
  • Results

    ASP is Turing complete by a correct encoding of Minsky machines.

    Source: §1 · p. 2
  • Takeaways & Limitations

    Typability and operational correspondence together establish Turing completeness for the coupling of ASP and NSTs.

    Source: §4 · p. 18

Abstract

from arXiv · show

Session types are a type-based approach to correct message-passing programs, where types specify protocols for channels and type checking guarantees communication correctness. Traditional session types express regular protocols only, which leaves out many protocols found in practice. Aiming at overcoming this limitation, Nested Session Types (NSTs) can specify nested recursive protocols. NSTs are known to be characterised by one-counter machines and deterministic context-free languages. In this paper, we study the expressiveness of ASP (Asynchronous Session Processes), the process model associated with NSTs as introduced by Das et al. We prove that AST is Turing complete by giving a correct encoding of two-counter machines into typed processes. Our encoding uses a non-trivial state-aware representation of counters and instructions that is neatly governed by NSTs.

1 Introduction

The paper asks whether well-typed ASP configurations can be Turing complete, complementing prior work on the intrinsic expressiveness of Nested Session Types (NSTs). It answers yes by encoding Minsky machines, with NSTs governing state-aware counter and instruction processes.

1 Introduction

  • NSTs are characterised by one-counter machines and deterministic context-free languages, complementing results on their decidable type equality, equivalence, and duality.Traditional session types express regular protocols, while NSTs use nested type constructors so recursive type parameters can act like a stack.Source: §1 · p. 1
  • The open question is whether ASP’s synchronization mechanisms and NSTs’ intrinsic expressiveness suffice to make well-typed configurations Turing complete.ASP is the asynchronous process language associated with NSTs; its well-typed configurations enjoy confluence and deadlock freedom.Source: §1 · p. 2
  • ASP is Turing complete: the paper correctly encodes Minsky machines, whose two counters and finite instruction set provide the simulated computation.The instructions increment or decrement counters, or jump depending on whether a counter is zero.Source: §1 · p. 2
  • NSTs govern state-aware counter and instruction processes, capturing the correct state after instructions and their interactions.The encoding models counters as stacks using polymorphic nested types; instructions need a mechanism to track the combined counter state.Source: §1 · p. 2

2 Background

The background introduces Nested Session Types (NSTs), their associated asynchronous process language ASP, and the typing and reduction properties of ASP. It then defines Minsky machines as the computational model used in the paper.

2.1 Nested Session Types

  • NSTs use parameterized type definitions to construct nested types, and type equality for NSTs is decidable with a sound algorithm.Type definitions bind sequences of parameters; instantiation substitutes actual types for those parameters.Source: §2.1 · p. 3
  • ASP follows the intuitionistic Curry–Howard correspondence and supports asynchronous message passing, with messages modeled as atomic processes.Messages carry channel continuations renamed to preserve linearity as they are consumed.Source: §2.1 · p. 3
  • Well-typed ASP configurations preserve their types under reduction, make progress on internal channels, and are confluent.Confluence means that configurations reached through different reduction sequences can reduce to a common configuration.Source: §2.1 · p. 5

2.2 Minsky machines

  • A Minsky machine has a finite instruction set and two counters; its instructions increment, decrement when nonzero, or jump when the counter is zero.The machine state records the current instruction and both counter values; it starts with counters at zero.Source: §2.2 · p. 6

3 Encoding Minsky Machines in ASP

This section develops an ASP encoding of Minsky-machine configurations, with state-aware protocols governed by Nested Session Types coordinating counters and instructions. It explains the encoding’s well-typedness and correspondence with machine reductions, and illustrates terminating and non-terminating behaviour with a worked machine.

3 Encoding Minsky Machines in ASP

  • The encoding makes ASP Turing complete by representing each machine configuration with counter, state-aware instruction, and instantiation processes; correctness rests on typability and soundness/completeness.Operational correspondence ensures machine steps are mimicked by the encoding and that encoded steps are enabled by the machine.Source: §3 · p. 7

3.1 Stateful Protocols

  • Nested Peano counter protocols encode each counter’s state, while state-aware instructions and an instantiation protocol coordinate both counters and recover the next instruction after decrement.Jumps leave counter state unchanged; after decrement, instantiation supplies the information needed to continue from the generic predecessor type.Source: §3.1 · pp. 7–8

3.2 Processes

  • Instruction processes send action labels over counter channels; increments predict and instantiate the next state, jumps preserve it, decrements hand off dependencies and the next index, and out-of-bounds states halt.The instantiation process enables continuation after decrement, when the next instruction cannot be instantiated over a generic type variable.Source: §3.2 · pp. 10–11
  • The instantiation process is a decrementing tree whose nodes encode zero/successor transitions and counter dependencies; leaf, linear, and binary nodes cover configurations with zero, one, or two nonzero counters.Transitions are encoded as dependencies on type definitions, so the instantiation processes use second-order predecessors, unlike counters and instructions.Source: §3.2 · pp. 12–13
  • Increment instructions predict the next state and can advance asynchronously, while decrements rely on instantiation to select the next instruction and wait for it to catch up.For a zero-counter jump, the state remains unchanged and the process proceeds to the target instruction.Source: §3.2 · pp. 14–15

3.3 Correctness

  • The encoding is typable for every machine state, inheriting ASP’s type preservation and confluence; progress holds except over channel y, which simulates termination for out-of-bound instructions.Theorem 4’s proof uses induction on counter values and case analysis on instructions.Source: §3.3 · pp. 15–16
  • Soundness and completeness establish operational correspondence: machine steps are simulated, and reachable ASP configurations can reduce to an encoding of another machine state.Completeness relies on ASP confluence to reorder reductions; soundness follows from stateful session types capturing instruction transitions.Source: §3.3 · p. 16

3.4 Examples

  • In the example machine, starting with an increment lets a decrement succeed and terminate out of bounds; skipping it makes the decrement fail and loop back.Asynchronous instruction messages can queue, but can be consumed so the encoding matches the simulated machine state.Source: §3.4 · pp. 16–17

4 Concluding Remarks

The paper establishes Turing completeness for ASP with NSTs by encoding Minsky machines, using state-aware instruction processes to coordinate nested counter protocols. Typability and operational correspondence establish the encoding’s correctness.

4 Concluding Remarks

  • ASP and NSTs are Turing complete through an encoding of Minsky machines with state-aware instruction processes and nested counter protocols.The encoding’s correctness is established through typability and operational correspondence.Source: §4 · p. 18
  • The authors report that they are unaware of other typed encodings of Minsky machines, contrasting with prior uses of the machines in untyped concurrency calculi.Source: §4 · p. 18
  • Prior typed-calculus results include encoding the asynchronous π-calculus by adding recursive shared types and the importance of non-tail recursive types for name-passing encodings.The discussion notes that correct Minsky-machine encoding remains nontrivial even with nested recursion and polymorphism.Source: §4 · p. 18

A.1 Type rules ASP (Definition 3)

The ASP rules specify how processes and messages use channels, choices, and linear connectives. They cover process-level branching and selection as well as message-level communication and channel closure.

A.1 Type rules ASP (Definition 3)

  • Process rules cover selecting a branch, handling a case over alternatives, and receiving a channel component.Source: §A.1 · p. 22
  • The process rules also include offering a choice over alternatives and waiting on a channel of unit type.Source: §A.1 · p. 22
  • Message rules include forwarding variables, function definitions, and sending or closing channels.Source: §A.1 · p. 22
  • Message-level rules type external and internal choice labels as communications over the corresponding session channels.Source: §A.1 · p. 22

B.1 Constituent process definitions (Definition 12)

The constituent process definitions use cases on the instruction channel and state-indexed nested types to represent instruction behavior. Their branches include channel interactions for handling instructions and updating counter protocols.

B.1 Constituent process definitions (Definition 12)

  • The instruction-process definitions include channel sends and receives around instruction handling and counter interactions.Source: §B.1 · pp. 24–25
  • State-indexed process branches use nested types such as S[α] and 0[] when constructing counter protocols.Source: §B.1 · pp. 24–25
  • The cited definitions Ns,s, N1,1, Ns,1, and N1,s each show case z with ins0 branching to b.ter, then wait and receives into r0, r1, and y.Source: §B.1 · pp. 24–25
Loading 2610.32558v1…