Nothing Special   »   [go: up one dir, main page]

skip to main content
10.1145/292540.292560acmconferencesArticle/Chapter ViewAbstractPublication PagespoplConference Proceedingsconference-collections
Article
Free access

Dependent types in practical programming

Published: 01 January 1999 Publication History

Abstract

We present an approach to enriching the type system of ML with a restricted form of dependent types, where type index objects are drawn from a constraint domain C, leading to the DML(C) language schema. This allows specification and inference of significantly more precise type information, facilitating program error detection and compiler optimization. A major complication resulting from introducing dependent types is that pure type inference for the enriched system is no longer possible, but we show that type-checking a sufficiently annotated program in DML(C) can be reduced to constraint satisfaction in the constraint domain C. We exhibit the unobtrusiveness of our approach through practical examples and prove that DML(C) is conservative over ML. The main contribution of the paper lies in our language design, including the formulation of type-checking rules which makes the approach practical. To our knowledge, no previous type system for a general purpose programming language such as ML has combined dependent types with features including datatype declarations, higher-order functions, general recursions, let-polymorphism, mutable references, and exceptions. In addition, we have finished a prototype implementation of DML(C) for an integer constraint domain C, where constraints are linear inequalities (Xi and Pfenning 1998).

References

[1]
Augustsson, L. (1998). Cayenne - a language with dependent types. In Proceedings of A CM SIGPLAN International Conference on Functional Programming, pp. 239-250.]]
[2]
Constable, It. L. et al. (1986). Implementing Mathematics with the Nuprl Proof Development System. Englewood Cliffs, New Jersey: Prentice-Hall.]]
[3]
Danvy, O. (1998, May). Functional unparsing. Technical Report RS-98-12, University of Aarhus.]]
[4]
Dowek, G., A. Felty, H. Herbelin, G. Huet, C. Murthy, C. Parent, C. Paulin-Mohring, and B. Werner (1993). The Coq proof assistant user's guide. Rapport Techniques 154, IN- RIA, Rocquencourt, France. Version 5.8.]]
[5]
Freeman, T. and F. Pfenning (1991). Refinement types for ML. In A CM SIGPLAN Conference on Programming Language Design and Implementation, Toronto, Ontario, pp. 268- 277.]]
[6]
Harper, It. W., F. Honsell, and G. D. Plotkin (1993, January). A framework for defining logics. Journal o/the A CM ~ 0 (1), 143-184.]]
[7]
Hayashi, S. and H. Nakano (1988). PX: A Computational Logic. The MIT Press.]]
[8]
Hudak, P., S. L. Peyton Jones, and P. Wadler (1992, May). Report on the programming language Haskell, a non-strict purely-functional programming language, Version 1.2. SIG- PLAN Notices ~7(5).]]
[9]
Hughes, J., L. Pareto, and A. Sabry (1996). Proving the correctness of reactive systems using sized types. In Conference Record o/P3rd A CM SIGPLAN-SIGA CT Symposium on Principles of Programming Languages, pp. 410-423.]]
[10]
Jay, C. and M. Sekanina (1996). Shape checking of array programs. Technical Report 96.09, University of Technology, Sydney, Australia.]]
[11]
Kreitz, C., M. Hayden, and J. Hickey (1998, July). A proof environment for the development of group communication systems. In H. Kirchner and C. Kirchner (Eds.), 15th International Conference on Automated Deduction, LNAI 1421, Lindau, Germany, pp. 317-332. Springer-Verlag.]]
[12]
Milner, R., M. Tofte, and R. W. Harper (1990). The Definition o.f Standard ML. Cambridge, Massachusetts: MIT Press.]]
[13]
Moggi, E. (1989). Computational lambda-calculus and monads. In Proceedings Fourth Annual Symposium on Logic in Computer Science, pp. 14-23.]]
[14]
Necula, G. (1997). Proof-carrying code. In Conference Record of 2~th Annual A CM Symposium on Principles of Programming Languages, pp. 106-119. ACM press.]]
[15]
Necula, G. and P. Lee (1998, June). The design and implementation of a certifying compiler. In A CM SIGPLAN '98 Conference on Programming Language Design and Implementation, pp. 333-344. ACM press.]]
[16]
Owre, S., S. Rajan, J. Rushby, N. Shankar, and M. Srivas (1996, July/August). PVS: Combining specification, proof checking, and model checking. In R. Alur and T. A. Henzinger (Eds.), Proceedings o.f the 8th International Conference on Computer-Aided Verification, CA V '96, New Brunswick, NJ, pp. 411-414. Springer-Verlag LNCS 1102.]]
[17]
Parent, C. (1995). Synthesizing proofs from programs in the calculus of inductive constructions. In Proceedings o/the International Conference on Mathematics for Programs Constructions. Springer-Verlag LNCS 947.]]
[18]
Pierce, B. and D. Turner (1998). Local type inference. In Proceedings o~ the 25th Annual A CM SIGPLAN-SIGA CT Symposium on Principles o.f Programming Languages, pp. 252-265.]]
[19]
Sabry, A. and M. Felleisen (1993). Reasoning about programs in continuation-passing style. LISP and Symbolic Computation 6(3/4), 289-360.]]
[20]
Sannella, D. and A. Tarlecki (1989, February). Toward formal development of ML programs: Foundations and methodology. Technical Report ECS-LFCS-89-71, Laboratory for Foundations of Computer Science, Depatment of Computer Science, University of Edinburgh.]]
[21]
Sulzmann, M., M. Odersky, and M. Wehr (1997). Type inference with constrained types. In Proceedings of 4th International Workshop on Foundations o~ Object-Oriented Languages.]]
[22]
Weis, P. and X. Leroy (1993). Le langage Carol. Paris: InterEditions.]]
[23]
Xi, H. (1997, November). Some examples of DML programming. Available at ht tp : //www. cs. cmu. edu/'hwxi/DbIL/oxamplos 1.]]
[24]
H. (1998). Dependent Types in Practical Programming. Ph. D. thesis, Carnegie Mellon University. pp. viii+189. Forthcoming. The current version is available as http : //www. ~ s. cmu. edu/" hwxi/DML/thes is. ps.]]
[25]
Xi, H. (1999, January). Dead code elimination through dependent types. In The First International Workshop on Practical Aspects of Declarative Languages, San Antonio, Texas. To appear.]]
[26]
Xi, H. and F. Pfenning (1998, June). Eliminating array bound checking through dependent types. In Proceedings of A CM SIGPLAN Conference on Programming Language Design and Implementation, pp. 249-257.]]
[27]
Zenger, C. (1997). indexed types. Theoretical Computer Science 187, 147-165.]]
[28]
Zenger, C. (1998). Indizierte Typen. Ph. D. thesis, Fakultgt fiir Informatik, Universitgt Karlsruhe. Forthcoming.]]

Cited By

View all
  • (2024)The Ultimate Conditional SyntaxProceedings of the ACM on Programming Languages10.1145/36897468:OOPSLA2(988-1017)Online publication date: 8-Oct-2024
  • (2024)Contextual TypingProceedings of the ACM on Programming Languages10.1145/36746558:ICFP(880-908)Online publication date: 15-Aug-2024
  • (2024)Answer Refinement Modification: Refinement Type System for Algebraic Effects and HandlersProceedings of the ACM on Programming Languages10.1145/36332808:POPL(115-147)Online publication date: 5-Jan-2024
  • Show More Cited By

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM Conferences
POPL '99: Proceedings of the 26th ACM SIGPLAN-SIGACT symposium on Principles of programming languages
January 1999
324 pages
ISBN:1581130953
DOI:10.1145/292540
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 ACM 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]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 01 January 1999

Permissions

Request permissions for this article.

Check for updates

Qualifiers

  • Article

Conference

POPL99
POPL99: Symposium on Prinicples of Programming Languages 1999
January 20 - 22, 1999
Texas, San Antonio, USA

Acceptance Rates

POPL '99 Paper Acceptance Rate 24 of 136 submissions, 18%;
Overall Acceptance Rate 824 of 4,130 submissions, 20%

Upcoming Conference

POPL '25

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)319
  • Downloads (Last 6 weeks)55
Reflects downloads up to 19 Nov 2024

Other Metrics

Citations

Cited By

View all
  • (2024)The Ultimate Conditional SyntaxProceedings of the ACM on Programming Languages10.1145/36897468:OOPSLA2(988-1017)Online publication date: 8-Oct-2024
  • (2024)Contextual TypingProceedings of the ACM on Programming Languages10.1145/36746558:ICFP(880-908)Online publication date: 15-Aug-2024
  • (2024)Answer Refinement Modification: Refinement Type System for Algebraic Effects and HandlersProceedings of the ACM on Programming Languages10.1145/36332808:POPL(115-147)Online publication date: 5-Jan-2024
  • (2024)Pipelines and Beyond: Graph Types for ADTs with FuturesProceedings of the ACM on Programming Languages10.1145/36328598:POPL(482-511)Online publication date: 5-Jan-2024
  • (2023)Contextual Refinement TypesElectronic Proceedings in Theoretical Computer Science10.4204/EPTCS.396.2396(4-19)Online publication date: 17-Nov-2023
  • (2023)Type Patterns: Pattern Matching on Shape-Carrying Array TypesProceedings of the 35th Symposium on Implementation and Application of Functional Languages10.1145/3652561.3652572(1-14)Online publication date: 29-Aug-2023
  • (2023)Flux: Liquid Types for RustProceedings of the ACM on Programming Languages10.1145/35912837:PLDI(1533-1557)Online publication date: 6-Jun-2023
  • (2023)Polymorphic Types with Polynomial SizesProceedings of the 9th ACM SIGPLAN International Workshop on Libraries, Languages and Compilers for Array Programming10.1145/3589246.3595372(36-49)Online publication date: 6-Jun-2023
  • (2023)Types, Modes and so Much More – The Prolog WayProlog: The Next 50 Years10.1007/978-3-031-35254-6_2(23-37)Online publication date: 17-Jun-2023
  • (2023)Gradual Tensor Shape CheckingProgramming Languages and Systems10.1007/978-3-031-30044-8_8(197-224)Online publication date: 22-Apr-2023
  • Show More Cited By

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Login options

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media