Research

Paper

TESTING March 23, 2026

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

Authors

Albert Schimpf, Stefan Wehr, Annette Bieniusa

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.

Metadata

arXiv ID: 2603.22032
Provider: ARXIV
Primary Category: cs.PL
Published: 2026-03-23
Fetched: 2026-03-24 06:02

Related papers

Raw Data (Debug)
{
  "raw_xml": "<entry>\n    <id>http://arxiv.org/abs/2603.22032v1</id>\n    <title>Set-Theoretic Types for Erlang: Theory, Implementation, and Evaluation</title>\n    <updated>2026-03-23T14:36:41Z</updated>\n    <link href='https://arxiv.org/abs/2603.22032v1' rel='alternate' type='text/html'/>\n    <link href='https://arxiv.org/pdf/2603.22032v1' rel='related' title='pdf' type='application/pdf'/>\n    <summary>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.</summary>\n    <category scheme='http://arxiv.org/schemas/atom' term='cs.PL'/>\n    <published>2026-03-23T14:36:41Z</published>\n    <arxiv:comment>85 pages, under review for JFP</arxiv:comment>\n    <arxiv:primary_category term='cs.PL'/>\n    <author>\n      <name>Albert Schimpf</name>\n    </author>\n    <author>\n      <name>Stefan Wehr</name>\n    </author>\n    <author>\n      <name>Annette Bieniusa</name>\n    </author>\n  </entry>"
}