Communication Dans Un Congrès Année : 2025

Type-Checking Heterogeneous Sequences in a Simple Embeddable Type System

Résumé

Heterogeneously typed sequences are supported in a wide range of programming languages, both dynamically and statically typed. These sequences often exhibit type patterns such as repetition, alternation, and optionality. The programmer needs a mechanism to declare and query adherence to this regularity. The theory of finite automata over finite alphabets was conceived for characterizing patterns in so-called regular languages, but does not exactly meet this challenge, because the set of potential elements of the sequences is infinite. In this article, we present a generalization of regular expressions called rational type expressions as a means of declaring regular patterns in heterogeneous sequences. We present procedures for constructing and manipulating symbolic finite automata, a generalization of classical finite automata, using a portable, simple, embeddable, type system. For type systems with subtyping, the subtype relation and type vacuity cannot always be computed programmatically. We provide a working, sound solution for constructing finite automata for type-based regular expressions even in cases where the subtype decidability relations is not computable retrospectively, but can be ensured by construction. We demonstrate the generality and portability of the system by providing implementations in Common Lisp, Clojure, Scala, and Python.

Fichier principal
Vignette du fichier
newton.25.padl.pdf (438.54 Ko) Télécharger le fichier
Origine Fichiers produits par l'(les) auteur(s)
Licence

Dates et versions

hal-04923150 , version 1 (31-01-2025)

Licence

Identifiants

Citer

Jim E Newton. Type-Checking Heterogeneous Sequences in a Simple Embeddable Type System. PADL 2025 (Practical Aspects of Declarative Languages), Jan 2025, Denver, CO (US), United States. pp.18-34, ⟨10.1007/978-3-031-84924-4_2⟩. ⟨hal-04923150⟩
54 Consultations
181 Téléchargements

Altmetric

Partager

  • More