Set-Theoretic Types for Erlang: Theory, Implementation, and Evaluation

📅 2026-03-23
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
This work addresses the susceptibility of Erlang programs to runtime errors due to its dynamic typing and the lack of static checking support in existing type annotations. We present the first complete integration of a set-theoretic type system into Erlang, which supports dynamic type tests, subtyping, recursive types, parametric polymorphism, and untagged union types, while preserving both type safety and decidability alongside Erlang’s distinctive language features. We design and implement corresponding type inference and checking algorithms, and validate their effectiveness on the Erlang standard library, third-party projects, and the checker’s own codebase. The evaluation demonstrates the approach’s practicality by successfully identifying latent type errors, confirming its feasibility and utility in real-world scenarios.

Technology Category

Application Category

📝 Abstract
Erlang's dynamic typing discipline can lead to runtime errors that persist even after process restarts. Some of these runtime errors could be prevented through static type checking. While Erlang provides a type specification language, the compiler does not enforce these types, thereby limiting their role to documentation purposes. Type checking Erlang code is challenging due to language features such as dynamic type tests, subtyping, equi-recursive types, polymorphism, intersection types in signatures, and untagged union types. This work presents a set-theoretic type system for Erlang which captures the core features of Erlang's existing type language. The formal type system guarantees type soundness, and ensures that type checking remains decidable. Additionally, an implementation of a type checker is provided, supporting all features of the Erlang type language and most term-level language constructs. A case study with modules from Erlang's standard library, an external project, and the type checker itself demonstrates its effectiveness in verifying real-world Erlang code.
Problem

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

Erlang
static type checking
runtime errors
type system
dynamic typing
Innovation

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

set-theoretic types
Erlang
static type checking
type soundness
decidable type inference
🔎 Similar Papers
No similar papers found.
A
Albert Schimpf
RPTU University Kaiserslautern-Landau, Germany
S
Stefan Wehr
Offenburg University of Applied Sciences, Germany
Annette Bieniusa
Annette Bieniusa
RPTU University of Kaiserslautern-Landau
Programming languagesDistributed SystemsSoftware Transactional Memory