Really Natural Linear Indexed Type Checking

Recent works have shown the power of linear indexed type systems for enforcing complex program properties. These systems combine linear types with a language of type-level indices, allowing more fine-grained analyses. Such systems have been fruitfully applied in diverse domains, including implicit complexity and differential privacy. A natural way to enhance the expressiveness of this approach is by allowing the indices to depend on runtime information, in the spirit of dependent types. This approach is used in DFuzz, a language for differential privacy. The DFuzz type system relies on an index language supporting real and natural number arithmetic over constants and variables. Moreover, DFuzz uses a subtyping mechanism to make types more flexible. By themselves, linearity, dependency, and subtyping each require delicate handling when performing type checking or type inference; their combination increases this challenge substantially, as the features can interact in non-trivial ways. In this paper, we study the type-checking problem for DFuzz. We show how we can reduce type checking for (a simple extension of) DFuzz to constraint solving over a first-order theory of naturals and real numbers which, although undecidable, can often be handled in practice by standard numeric solvers.

[1]  Ugo Dal Lago,et al.  Functional Programming in Sublinear Space , 2010, ESOP.

[2]  Benjamin C. Pierce,et al.  Bounded Existentials and Minimal Typing , 1998, Theor. Comput. Sci..

[3]  Matteo Maffei,et al.  Differential Privacy by Typing in Security Protocols , 2013, 2013 IEEE 26th Computer Security Foundations Symposium.

[4]  Martin Odersky,et al.  Type Inference with Constrained Types , 1999, Theory Pract. Object Syst..

[5]  Dan R. Ghica,et al.  Bounded Linear Types in a Resource Semiring , 2014, ESOP.

[6]  Ugo Dal Lago,et al.  Type Inference for Sublinear Space Functional Programming , 2010, APLAS.

[7]  Frank Pfenning,et al.  Efficient resource management for linear logic proof search , 1996, Theor. Comput. Sci..

[8]  Benjamin C. Pierce,et al.  Distance makes the types grow stronger: a calculus for differential privacy , 2010, ICFP '10.

[9]  Andreas Haeberlen,et al.  Sensitivity analysis using type-based constraints , 2013, FPCDSL '13.

[10]  Andreas Haeberlen,et al.  Linear dependent types for differential privacy , 2013, POPL.

[11]  Suresh Jagannathan,et al.  Compositional and Lightweight Dependent Type Inference for ML , 2013, VMCAI.

[12]  Karl Crary,et al.  A type system for higher-order modules , 2003, POPL '03.

[13]  Philip Wadler Is there a use for linear logic , 1991 .

[14]  Ugo Dal Lago,et al.  Linear Dependent Types and Relative Completeness , 2011, 2011 IEEE 26th Annual Symposium on Logic in Computer Science.

[15]  Frank Pfenning,et al.  Dependent types in practical programming , 1999, POPL '99.

[16]  Andre Scedrov,et al.  Bounded Linear Logic: A Modular Approach to Polynomial-Time Computability , 1992, Theor. Comput. Sci..

[17]  M. Lillibridge Translucent Sums: A Foundation for Higher-Order Module Systems , 1997 .

[18]  Alan Mycroft,et al.  Coeffects: Unified Static Analysis of Context-Dependence , 2013, ICALP.

[19]  Jurriaan Hage,et al.  Generalizing Hindley-Milner Type Inference Algorithms , 2002 .

[20]  Benjamin C. Pierce,et al.  Higher-Order Subtyping , 1994, Theor. Comput. Sci..

[21]  Marco Gaboardi,et al.  A Core Quantitative Coeffect Calculus , 2014, ESOP.

[22]  Dan R. Ghica,et al.  Geometry of synthesis III: resource management through type inference , 2011, POPL '11.

[23]  Ugo Dal Lago,et al.  Linear dependent types in a call-by-value scenario , 2012, Sci. Comput. Program..

[24]  Clement A. Baker-Finch,et al.  Usage Analysis with Natural Reduction Types , 1993, WSA.

[25]  Chiyan Chen,et al.  Combining programming with theorem proving , 2005, ICFP '05.

[26]  Philip Wadler,et al.  Is there a use for linear logic? , 1991, PEPM '91.

[27]  Ugo Dal Lago,et al.  The geometry of types , 2012, POPL.