Semantics of Typed Lambda-Calculus with Constructors
We present a Curry-style second-order type system with union and intersection types for the lambda-calculus with constructors of Arbiser, Miquel and Rios, an extension of lambda-calculus with a patter
We present a Curry-style second-order type system with union and intersection types for the lambda-calculus with constructors of Arbiser, Miquel and Rios, an extension of lambda-calculus with a pattern matching mechanism for variadic constructors. We then prove the strong normalisation and the absence of match failure for a restriction of this system, by adapting the standard reducibility method.
💡 Research Summary
The paper extends the λ‑calculus with constructors, originally introduced by Arbiser, Miquel, and Rios, by adding a Curry‑style second‑order type system that incorporates both union ( ∪ ) and intersection ( ∩ ) types. The authors first formalise the syntax of terms, which now include variadic constructors C t₁ … tₙ and a case expression that performs pattern matching on these constructors. Types are built from type variables, arrow types, universal quantification, and the two new type constructors for union and intersection.
Typing rules follow a standard Curry‑style presentation: variables are looked up in the context, abstractions receive arrow types, applications require the function to have a suitable arrow type, constructors are typed according to their declared signatures, and each branch of a case expression is type‑checked under the assumption that the pattern’s arguments have the types prescribed by the constructor’s signature. Union and intersection types obey the usual sub‑typing relationships (τ₁ ≤ τ₁ ∪ τ₂, τ₁ ∩ τ₂ ≤ τ₁, etc.), allowing a term to be simultaneously regarded as belonging to multiple types.
Because the unrestricted system does not guarantee strong normalisation or the absence of pattern‑match failures, the authors define a restricted fragment. The restriction imposes two constraints: (1) every constructor and pattern must match its declared type exactly, with type variables instantiated consistently; (2) union and intersection types may only be used in a disciplined way that preserves decidability of sub‑typing (e.g., unions are required to be disjoint). Within this fragment the authors prove two central meta‑theoretical properties.
The strong normalisation proof adapts Girard’s reducibility candidates (also known as the “candidats de réductibilité”) technique. A reducibility candidate 𝔠(τ) is defined for each type τ and is required to satisfy four closure conditions: (CR1) all members are strongly normalising; (CR2) the set is closed under β‑reduction; (CR3) it respects the algebra of unions and intersections (a term belongs to 𝔠(τ₁ ∩ τ₂) iff it belongs to both 𝔠(τ₁) and 𝔠(τ₂), and belongs to 𝔠(τ₁ ∪ τ₂) iff it belongs to at least one); and (CR4) it is closed under the new term constructors, i.e., if each argument of a constructor belongs to the appropriate candidate then the whole constructor term belongs to the candidate for its result type, and similarly for case expressions.
Key lemmas include a substitution lemma (type substitution preserves candidacy), subject reduction (typing is preserved by reduction), and an adequacy lemma (any well‑typed term of type τ lies in 𝔠(τ)). Combining these, the authors obtain the Strong Normalisation Theorem: every well‑typed term in the restricted system reduces to a normal form after a finite number of β‑steps.
The second main result is the absence of match failure. In the unrestricted calculus a case expression can fail at runtime if none of its patterns matches the constructor of the scrutinee. The restriction guarantees that the scrutinee’s type uniquely determines which constructor can appear, and the typing rules enforce that every possible constructor is covered by a pattern whose argument types are compatible. The authors formalise this as a “Match Soundness Lemma”: if Γ ⊢ case t of … : τ then t must evaluate to a constructor that is explicitly handled, making runtime match failure impossible.
Related work is discussed: traditional System F and its extensions support polymorphism but lack union/intersection types and pattern matching; Hindley‑Milner based languages provide ADTs and pattern matching but not variadic constructors or the expressive power of intersection types. By integrating all these features, the paper offers a richer type discipline that can be used as a foundation for future functional languages with advanced data‑type manipulation.
The conclusion summarises the contributions—(i) a novel type system for λ‑calculus with constructors, (ii) a rigorous strong‑normalisation proof adapted to the presence of union and intersection types, and (iii) a formal guarantee that well‑typed programs never encounter a pattern‑match failure. The authors outline future directions: relaxing the restrictions to cover the full language, developing practical type‑inference algorithms, and exploring efficient execution models (e.g., graph rewriting) that respect the proved properties.
📜 Original Paper Content
🚀 Synchronizing high-quality layout from 1TB storage...