When Is a Type Refinement an Inductive Type?

Dependently typed programming languages allow sophisticated properties of data to be expressed within the type system. Of particular use in dependently typed programming are indexed types that refine data by computationally useful information. For example, the N-indexed type of vectors refines lists by their lengths. Other data types may be refined in similar ways, but programmers must produce purposespecific refinements on an ad hoc basis, developers must anticipate which refinements to include in libraries, and implementations often store redundant information about data and their refinements. This paper shows how to generically derive inductive characterisations of refinements of inductive types, and argues that these characterisations can alleviate some of the aforementioned difficulties associated with ad hoc refinements. These characterisations also ensure that standard techniques for programming with and reasoning about inductive types are applicable to refinements, and that refinements can themselves be further refined.

[1]  Frank Pfenning,et al.  Refinement Types for Logical Frameworks , 2010 .

[2]  Conor McBride,et al.  Inductive Families Need Not Store Their Indices , 2003, TYPES.

[3]  Frank Pfenning,et al.  Refinement types for ML , 1991, PLDI '91.

[4]  Hongwei Xi,et al.  Dependently Typed Data Structures , 2000 .

[5]  Peter Morris,et al.  The gentle art of levitation , 2010, ICFP '10.

[6]  Joshua Dunfield,et al.  A unified system of type refinements , 2007 .

[7]  Thorsten Altenkirch,et al.  Containers: Constructing strictly positive types , 2005, Theor. Comput. Sci..

[8]  Frank Pfenning,et al.  Practical refinement-type checking , 2005 .

[9]  Jeremy Gibbons,et al.  Datatype-Generic Programming , 2006, Lecture Notes in Computer Science.

[10]  Richard S. Bird,et al.  Algebra of programming , 1997, Prentice Hall International series in computer science.

[11]  Natarajan Shankar,et al.  Subtypes for Specifications: Predicate Subtyping in PVS , 1998, IEEE Trans. Software Eng..

[12]  Erik Poll,et al.  Algebra of Programming by Richard Bird and Oege de Moor, Prentice Hall, 1996 (dated 1997). , 1999 .

[13]  Clifford Stein,et al.  Introduction to Algorithms, 2nd edition. , 2001 .

[14]  Jan-Li Lin,et al.  An Algebra of Dependent Data Types , 2006 .

[15]  Andrew D. Gordon,et al.  Principles and Applications of Refinement Types , 2010, Logics and Languages for Reliability and Security.

[16]  Frank Pfenning,et al.  Refinement Types for Logical Frameworks and Their Interpretation as Proof Irrelevance , 2010, Log. Methods Comput. Sci..

[17]  S. Lack,et al.  Introduction to extensive and distributive categories , 1993 .

[18]  Ewen Denney Refinement types for specification , 1998, PROCOMET.

[19]  Ranjit Jhala,et al.  Type-based data structure verification , 2009, PLDI '09.

[20]  Bart Jacobs,et al.  Categorical Logic and Type Theory , 2001, Studies in logic and the foundations of mathematics.

[21]  Peter Morris,et al.  Generic Programming with Dependent Types , 2006, SSDGP.

[22]  Jeremy Gibbons Datatype-Generic Programming , 2006, SSDGP.

[23]  Bart Jacobs Comprehension Categories and the Semantics of Type Dependency , 1993, Theor. Comput. Sci..

[24]  Patricia Johann,et al.  Fibrational Induction Rules for Initial Algebras , 2010, CSL.

[25]  Frank Pfenning,et al.  Logic Programming and Automated Reasoning , 1994, Lecture Notes in Computer Science.

[26]  M. Barr,et al.  Toposes, Triples and Theories , 1984 .

[27]  Nax Paul Mendler,et al.  Predictive type universes and primitive recursion , 1991, [1991] Proceedings Sixth Annual IEEE Symposium on Logic in Computer Science.

[28]  Maribel Fernández,et al.  Curry-Style Types for Nominal Terms , 2006, TYPES.

[29]  Peter Dybjer,et al.  Universes for Generic Programs and Proofs in Dependent Type Theory , 2003, Nord. J. Comput..

[30]  Alex K. Simpson,et al.  Computational Adequacy in an Elementary Topos , 1998, CSL.

[31]  Bart Jacobs,et al.  Structural Induction and Coinduction in a Fibrational Setting , 1998, Inf. Comput..