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

📅 2026-08-20
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
本文使用依赖类型解决分布式系统中协议实现的复杂性问题,通过在Lean语言中实现编舞库,确保端点投影和值访问的安全与完整。
📝 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.
Problem

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

distributed protocol
choreographic programming
partiality
endpoint projection
located-value access
Innovation

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

Dependent Types
Total EPP
Proof-Carrying Located Values