CIRT: Calculus of Inductive Refinement Types
Alessio Ferrarini, Niki Vazou, G. A. Kavvos
Abstract
Refinement types are a powerful mechanism for statically verifying properties of programs. They have been successfully integrated into practical languages such as Haskell, Scala, and Rust. However, their metatheory is not yet fully understood. In this paper we present the first semantic model for a refinement type system that supports the full feature combination of subtyping, SMT-style equality, impredicative polymorphism, and (stratified) inductive types. Interactions between these features have led to inconsistencies in the past, and existing formalizations of refinement type systems omit at least one of them. We present a realizability model based on partial equivalence relations (PERs) over a Scott domain, which overcomes these obstacles. We use our model to prove the consistency of a core refinement type system and to give a semantic account of the annotation-independence property of refinement types. Our semantics uses two interpretations: a refined one, which interprets types and their refinements as PERs; and an unrefined one, consisting of complete uniform PERs with a bottom element (CUPERs), which models computational behaviour independently of refinements. We extend the model to positive and stratified inductive types, showing that both are consistent in the presence of impredicativity.
Create a lesson
Related papers
Well-Typed ComfyUI Cannot Go Wrong: Gradual Refinement Types for Generative-AI Workflow Graphs
Shared title terminology · Pingchuan Ma, Zhantong Xue, Hui Li et al.
You Have Mail: Set-Theoretic Types for Actors
Shared title terminology · Giuseppe Castagna, Luca Padovani, Daniele Varacca et al.
Mode Inference for Substructural Adjoint Types
Shared title terminology · Sophia Roshal, Frank Pfenning
When Is Program Structure Required? Certificate-Grounded Calibration of Program-Induction Difficulty
Shared title terminology · Wenzhang Du
Statically Typed Purely Functional Definitional Interpreters for Essentials of Programming Languages
Shared title terminology · Kwanghoon Choi
Type-Confusion Security
Shared title terminology · Silei Ren, Hanxi Chen, Suraaj Kanniwadi et al.