Reference. Is sized typing for Coq practical?
Contemporary proof assistants such as Coq require that recursive functions be terminating and corecursive functions be productive to maintain logical consistency of their type theories, and some ensure these properties using syntactic checks. However, being syntactic, they are inherently delicate and restrictive, preventing users from easily writing obviously terminating or productive functions at their whim. Meanwhile, there exist many sized type theories that perform type-based termination and productivity checking, including theories based on the Calculus of (Co)Inductive Constructions (CIC), the core calculus underlying Coq. These theories are more robust and compositional in comparison. So why haven’t they been adapted to Coq? In this paper, we venture to answer this question with CIC , a sized type theory based on CIC. It extends past work on sized types in CIC with additional Coq features such as global and local definitions. We also present a corresponding size inference algorithm and implement it within Coq’s kernel; for maximal backward compatibility with existing Coq developments, it requires no additional annotations from the user. In our evaluation of the implementation, we find a severe performance degradation when compiling parts of the Coq standard library, inherent to the algorithm itself. We conclude that if we wish to maintain backward compatibility, using size inference as a replacement for syntactic checking is impractical in terms of performance.
Cite
Cites 39 works (0 here)
External (39)
- Why Not W? (2021)
- ionathanch/coq: Is Sized Typing for Coq Practical? (JFP) (software artifact) (2021)
- The Coq Proof Assistant (8.13) (2021)
- Coq Coq correct! verification of type checking and erasure for Coq, in Coq (2019)
- CoqTerminationDiscussion (Coq wiki) (2018)
- Decidability of conversion for type theory in type theory (2017)
- Normalization by evaluation for sized dependent types (2017)
- Well-founded recursion with copatterns and sized types (2016)
- Coq^: Type-Based Termination in the Coq Proof Assistant (web page) (2016)
- jsacchini/cicminus (software) (2015)
- jsacchini/cic-wf (software) (2015)
- Well-Founded Sized Types in the Calculus of (Co)Inductive Constructions (unpublished) (2015)
- Linear Sized Types in the Calculus of Constructions (2014)
- A Simplified Proof of the Church–Rosser Theorem (2013)
- Type-Based Productivity of Stream Definitions in the Calculus of Constructions (2013)
- Type-Based Termination, Inflationary Fixed-Points, and Mixed Inductive-Coinductive Types (2012)
- Semantical Investigations in Intuitionistic Set Theory and Type Theories with Inductive Families (habilitation) (2012)
- On type-based termination and dependent pattern matching in the calculus of inductive constructions (PhD thesis) (2011)
- MiniAgda: Integrating Sized and Dependent Types (2010)
- On Strong Normalization of the Calculus of Constructions with Type-Based Termination (2010)
- Difference Constraints and Shortest Paths (2009)
- Type-Based Termination with Sized Products (2008)
- CIC $\widehat ~$ : Type-Based Termination of Recursive Definitions in the Calculus of Inductive Constructions (2006)
- Type-based termination: a polymorphic lambda-calculus with sized higher-order types (PhD thesis) (2006)
- Practical Inference for Type-Based Termination in a Polymorphic Setting (2005)
- Type-based termination of recursive definitions (2004)
- Representing Nested Inductive Types Using W-Types (2004)
- Type-Based Termination of Recursive Definitions and Constructor Subtyping in Typed Lambda Calculi (PhD thesis) (2004)
- The not so simple proof-irrelevant model of CC (2002)
- On Relating Type Theories and Set Theories (1999)
- Structural recursive definitions in type theory (1998)
- Analysis of a guard condition in type theory (1998)
- Representing Inductively Defined Sets by Wellorderings in Martin-Löf's Type Theory (1997)
- Extensional Constructs in Intensional Type Theory (1997)
- Proving the correctness of reactive systems using sized types (1996)
- Codifying guarded definitions with recursive schemes (1995)
- Lambda Calculi with Types (1993)
- Pure type systems with definitions (Computing Science Notes 93/24) (1993)
- On a routing problem (1958)