skip to main content
10.1145/2746325.2746335acmotherconferencesArticle/Chapter ViewAbstractPublication PagesiflConference Proceedingsconference-collections
research-article

Really Natural Linear Indexed Type Checking

Published: 01 October 2014 Publication History

Abstract

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.

References

[1]
A. Brunel, M. Gaboardi, D. Mazza, and S. Zdancewic. A core quantitative coeffect calculus. In European Symposium on Programming (ESOP), Grenoble, France. Springer, 2014.
[2]
I. Cervesato, J. S. Hodas, and F. Pfenning. Efficient resource management for linear logic proof search. Theoretical Computer Science, 232 (1-2):133--163, 2000.
[3]
C. Chen and H. Xi. Combining programming with theorem proving. In ACM SIGPLAN International Conference on Functional Programming (ICFP), Tallinn, Estonia, pages 66--77, 2005. ISBN 1-59593-064-7.
[4]
U. Dal Lago and M. Gaboardi. Linear dependent types and relative completeness. In IEEE Symposium on Logic in Computer Science (LICS), Toronto, Ontario, pages 133--142. IEEE, 2011.
[5]
U. Dal Lago and U. Schöpp. Functional programming in sublinear space. In ACM Transactions on Programming Languages and Systems, pages 205--225. Springer, 2010.
[6]
U. Dal Lago, B. Petit, et al. The geometry of types. In ACM SIGPLAN--SIGACT Symposium on Principles of Programming Languages (POPL), Rome, Italy, pages 167--178, 2013.
[7]
L. D'Antoni, M. Gaboardi, E. J. Gallego Arias, A. Haeberlen, and B. C. Pierce. Sensitivity analysis using type-based constraints. In Workshop on Functional Programming Concepts in Domain-specific Languages (FPCDSL), FPCDSL '13, pages 43--50, New York, NY, USA, 2013. ACM. ISBN 978-1-4503-2380-2.
[8]
D. Dreyer, K. Crary, and R. Harper. A type system for higher-order modules. In ACM SIGPLAN--SIGACT Symposium on Principles of Programming Languages (POPL), New Orleans, Louisiana, POPL '03, pages 236--249, New York, NY, USA, 2003. ACM. ISBN 1-58113-628-5.
[9]
F. Eigner and M. Maffei. Differential privacy by typing in security protocols. In IEEE Computer Security Foundations Symposium, New Orleans, Louisiana, pages 272--286, 2013.
[10]
M. Gaboardi, A. Haeberlen, J. Hsu, A. Narayan, and B. C. Pierce. Linear dependent types for differential privacy. In ACM SIGPLAN--SIGACT Symposium on Principles of Programming Languages (POPL), Rome, Italy, POPL '13, pages 357--370, New York, NY, USA, 2013. ACM. ISBN 978-1-4503-1832-7.
[11]
G. Ghelli and B. Pierce. Bounded existentials and minimal typing. Theoretical Computer Science, 193(1--2):75 -- 96, 1998.
[12]
D. R. Ghica and A. Smith. Geometry of synthesis III: Resource management through type inference. In ACM SIGPLAN--SIGACT Symposium on Principles of Programming Languages (POPL), Austin, Texas, volume 46, pages 345--356. ACM, 2011.
[13]
D. R. Ghica and A. Smith. Bounded linear types in a resource semiring. In European Symposium on Programming (ESOP), Grenoble, France. Springer, 2014.
[14]
J.-Y. Girard, A. Scedrov, and P. J. Scott. Bounded linear logic: a modular approach to polynomial-time computability. Theoretical Computer Science, 97(1):1--66, 1992.
[15]
B. Heeren, B. Heeren, J. Hage, J. Hage, D. Swierstra, and D. Swierstra. Generalizing Hindley-Milner type inference algorithms. Technical report, 2002.
[16]
U. D. Lago and B. Petit. Linear dependent types in a call-by-value scenario. In D. D. Schreye, G. Janssens, and A. King, editors, ACM SIGPLAN International Conference on Principles and Practice of Declarative Programming (PPDP), Leuven, Belgium, pages 115--126. ACM, 2012. ISBN 978-1-4503-1522-7.
[17]
U. D. Lago and U. Schöpp. Type inference for sublinear space functional programming. In K. Ueda, editor, Asian Symposium on Programming Languages and Systems (APLAS), Shanghai, China, volume 6461 of Lecture Notes in Computer Science, pages 376--391. Springer, 2010. ISBN 978-3-642-17163-5.
[18]
M. Lillibridge. Translucent Sums: A Foundation for Higher-Order Module Systems. PhD thesis. PhD thesis, Carnegie Mellon University, Pittsburgh, PA, December 1996.
[19]
M. Odersky, M. Sulzmann, and M. Wehr. Type inference with constrained types. TAPOS, 5(1):35--55, 1999.
[20]
T. Petricek, D. Orchard, and A. Mycroft. Coeffects: Unified static analysis of context-dependence. In International Colloquium on Automata, Languages and Programming (ICALP), Riga, Latvia, pages 385--397. Springer, 2013.
[21]
B. C. Pierce and M. Steffen. Higher-order subtyping. In IFIP Working Conference on Programming Concepts, Methods and Calculi (PROCOMET), pages 511--530, 1994. Full version in Theoretical Computer Science, vol. 176, no. 1--2, pp. 235--282, 1997 (corrigendum in TCS vol. 184 (1997), p. 247).
[22]
F. Pottier and D. Rémy. The essence of ML type inference. In B. C. Pierce, editor, Advanced Topics in Types and Programming Languages, chapter 10, pages 389--489. MIT Press, 2005.
[23]
J. Reed and B. C. Pierce. Distance makes the types grow stronger: A calculus for differential privacy. In ACM SIGPLAN International Conference on Functional Programming (ICFP), Baltimore, Maryland, ICFP '10, pages 157--168, New York, NY, USA, 2010. ISBN 978-1-60558-794-3.
[24]
P. Wadler. Is there a use for linear logic? In Symposium on Partial Evaluation and Semantics-Based Program Manipulation (PEPM), New Haven, Connecticut, volume 26, pages 255--273. ACM, 1991.
[25]
D. A. Wright and C. A. Baker-Finch. Usage analysis with natural reduction types. In P. Cousot, M. Falaschi, G. Filé, and A. Rauzy, editors, Workshop on Static Analysis (WSA), Padova, Italy, volume 724 of Lecture Notes in Computer Science, pages 254--266. Springer, 1993. ISBN 3-540-57264-3.
[26]
H. Xi and F. Pfenning. Dependent types in practical programming. In ACM SIGPLAN--SIGACT Symposium on Principles of Programming Languages (POPL), San Antonio, Texas, pages 214--227. ACM, 1999.
[27]
H. Zhu and S. Jagannathan. Compositional and lightweight dependent type inference for ML. In International Conference on Verification, Model Checking, and Abstract Interpretation (VMCAI), Rome, Italy, pages 295--314. Springer, 2013.

Cited By

View all

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Other conferences
IFL '14: Proceedings of the 26nd 2014 International Symposium on Implementation and Application of Functional Languages
October 2014
124 pages
ISBN:9781450332842
DOI:10.1145/2746325
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

In-Cooperation

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 01 October 2014

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. linear types
  2. sensitivity analysis
  3. subtyping
  4. type checking
  5. type inference

Qualifiers

  • Research-article
  • Research
  • Refereed limited

Conference

IFL '14

Acceptance Rates

IFL '14 Paper Acceptance Rate 10 of 20 submissions, 50%;
Overall Acceptance Rate 19 of 36 submissions, 53%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)11
  • Downloads (Last 6 weeks)1
Reflects downloads up to 09 Oct 2024

Other Metrics

Citations

Cited By

View all

View Options

Get Access

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media