Skip to content
Preprint

On Eliminating the Impossible with Dependent Types: Choreographic Libraries with Proof-Carrying Located Values

Aug 2026 · 0 citations · 11 references
Computer Science

TL;DR

This work uses the dependently typed Lean programming language to implement a similar choreographic library, ChorLean, which ensures total EPP and safe value access via proof-carrying located values, passing Lean's totality checker without undefined cases, while supporting the same feature set as libraries like MultiChor.

Abstract

With growing complexity, distributed software systems become increasingly challenging to maintain and reason about. When implementing a distributed protocol, developers must ensure manually that the different components fit together. Choreographic programming addresses this challenge by specifying global protocols in a single program and projecting them into communicating processes, so-called endpoints. Recent choreographic approaches are designed as programming libraries that embed this paradigm into a host language like Haskell or Rust. In these designs, we observe common cases of partiality: unreachable branches in endpoint projection (EPP) and located-value access can trigger runtime errors or undefined behavior, relying on manual discipline of library maintainers rather than being statically type-checked. Also, some programs require users to write down dummy branches that should not be reachable, for example when branching on sum types. To close this gap, we use the dependently typed Lean programming language to implement a similar choreographic library. We show how we are able to move from a partial EPP to a total EPP function, and also eliminate cases of partiality in user-written code with pattern matching on sum types. ChorLean ensures total EPP and safe value access via proof-carrying located values, passing Lean's totality checker without undefined cases, while supporting the same feature set as libraries like MultiChor.

View source

Similar papers

Preprint Aug 2026

Mechanizing Choreographic Programs and Hoare Logic with State Transformers

Choreographic programming is a programming model for developing distributed applications where an entire communication protocol is written as a single program, which a compiler then projects to one process per participant. Choreographic programming abstracts over low-level network communication primitives such as socke...

Timon Böhler, Simon Daniel, D. Richter et al. · 0 citations
Preprint Sep 2026

Designing a Producer-driven Stream Protocol by Formal Refinement

The coroutine has broadly diffused in the practice of concurrent programming in the form of generators and asynchronous functions as well as processes communicating through pipes. We wanted to use coroutines in Python to create single-threaded Unix-style pipelines. Unfortunately, available solutions in Python are cumbe...

Erick Lavoie · 0 citations
#software testing Open access Oct 2026

Random Testing via Runtime Abstract Interpretation

Property-based testing of C programs can be automated by synthesizing random input generators from separation-logic specifications. Existing work in this space, such as the Bennet testing tool, uses randomized backtracking search, generating random values and checking them against constraints, backtracking on failure....

Zain K. Aamer, Benjamin C. Pierce · 1 citation
Preprint Aug 2026

Composable Building Blocks for Resilient Asynchronous Code

This work shows how higher-order combinators solve higher-order problems of asynchronous calls to a network service, database, or language model uniformly, including timeouts, retries, rate limiting, caching, reentrant locking, and cancellation.

Frank Tip · 0 citations
Book Open access Aug 2026

What Have We Learned about Dependently Typed Programming from Haskell? (Keynote)

The "rebound" library is used to demonstrate and reflect on the current capabilities of dependently-typed programming in Haskell, and supports working with well-scoped de Bruijn indices in abstract syntax trees.

Stephanie Weirich · 0 citations
Open access Oct 2026

avaCGs: Version-Aware Call Graphs for Efficient Version-Range Queries

Developers employ version ranges to specify a range of valid versions for software libraries their projects depend on. While this can yield benefits like automatic adoption of library updates, it complicates method reachability analysis: a sound whole-program analysis must consider method invocations of every library r...

Johannes Düsing, Dominik Helm, Ben Hermann · 0 citations

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.