Skip to main content

Type Inference with Structural Subtyping: A Faithful Formalization of an Efficient Constraint Solver

  • Conference paper
Programming Languages and Systems (APLAS 2003)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 2895))

Included in the following conference series:

Abstract

We are interested in type inference in the presence of structural subtyping from a pragmatic perspective. This work combines theoretical and practical contributions: first, it provides a faithful description of an efficient algorithm for solving and simplifying constraints; whose correctness is formally proved. Besides, the framework has been implemented in Objective Caml, yielding a generic type inference engine. Its efficiency is assessed by a complexity result and a series of experiments in realistic cases.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Bourdoncle, F., Merz, S.: Type checking higher-order polymorphic multi-methods. In: 24th Principles of Programming Languages (1997)

    Google Scholar 

  2. Pottier, F.: A versatile constraint-based type inference system. Nordic Journal of Computing 7 (2000)

    Google Scholar 

  3. Aiken, A.S., Fähndrich, M.: Program analysis using mixed term and set constraints. In: 4th Static Analysis Symposium (1997)

    Google Scholar 

  4. Palsberg, J., O’Keefe, P.M.: A type system equivalent to flow analysis. In: 22nd Principles of Programming Languages (1995)

    Google Scholar 

  5. Pottier, F., Simonet, V.: Information flow inference for ML. In: 29th Principles of Programming Languages (2002)

    Google Scholar 

  6. Mitchell, J.C.: Coercion and type inference. In: 11th Principles of Programming Languages (1984)

    Google Scholar 

  7. Cardelli, L.: A semantics of multiple inheritance. Information and Computation 76 (1988)

    Google Scholar 

  8. Tiuryn, J.: Subtype inequalities. In: 7th IEEE Symposium on Logic in Computer Science (1992)

    Google Scholar 

  9. Hoang, M., Mitchell, J.C.: Lower bounds on type inference with subtypes. In: 22nd Principles of Programming Languages (1995)

    Google Scholar 

  10. Mitchell, J.C.: Type inference with simple subtypes. Journal of Functional Programming 1 (1991)

    Google Scholar 

  11. Fuh, Y.C., Mishra, P.: Type inference with subtypes. In: Ganzinger, H. (ed.) ESOP 1988. LNCS, vol. 300, Springer, Heidelberg (1988)

    Google Scholar 

  12. Fuh, Y.C., Mishra, P.: Polymorphic subtype inference: Closing the theory-practice gap. In: Díaz, J., Orejas, F. (eds.) TAPSOFT 1989 and CCIPL 1989. LNCS, vol. 352, Springer, Heidelberg (1989)

    Google Scholar 

  13. Frey, A.: Satisfying subtype inequalities in polynomial space. In: Van Hentenryck, P. (ed.) SAS 1997. LNCS, vol. 1302, Springer, Heidelberg (1997)

    Chapter  Google Scholar 

  14. Kuncak, V., Rinard, M.: Structural subtyping of non-recursive types is decidable. In: 18th IEEE Symposium on Logic in Computer Science (2003)

    Google Scholar 

  15. Aiken, A.S., Fähndrich, M.: Making set-constraint based program analyses scale. Technical Report CSD-96-917, University of California, Berkeley (1996)

    Google Scholar 

  16. Trifonov, V., Smith, S.: Subtyping constrained types. In: Cousot, R., Schmidt, D.A. (eds.) SAS 1996. LNCS, vol. 1145, Springer, Heidelberg (1996)

    Google Scholar 

  17. Flanagan, C., Felleisen, M.: Componential set-based analysis. In: Programming Language Design and Implementation (1997)

    Google Scholar 

  18. Pottier, F.: Simplifying subtyping constraints: a theory. Information and Computation 170 (2001)

    Google Scholar 

  19. Rehof, J.: Minimal typings in atomic subtyping. In: 24th Principles of Programming Languages (1997)

    Google Scholar 

  20. Marlow, S., Wadler, P.: A practical subtyping system for Erlang. In: International Conference on Functional Programming (1997)

    Google Scholar 

  21. Fendrick, M.: Bane, A Library for Scalable Constraint-Based Program Analysis. PhD thesis (1999)

    Google Scholar 

  22. Pottier, F.: Wallace, an efficient implementation of type inference with subtyping (2000), http://pauillac.inria.fr/~fpottier/wallace/

  23. Frey, A.: Jazz (1998), http://www.exalead.com/jazz/

  24. Kodumal, J.: Banshee, a toolkit for building constraint-based analyses. PhD thesis (2002)

    Google Scholar 

  25. Foster, J.S., Fähndrich, M., Aiken, A.: A Theory of Type Qualifiers. In: Programming Language Design and Implementation (1999)

    Google Scholar 

  26. Foster, J.S., Terauchi, T., Aiken, A.: Flow-sensitive type qualifiers. In: Programming Language Design and Implementation (2002)

    Google Scholar 

  27. Glynn, K., Stuckey, P.J., Sulzmann, M., Søndergaard, H.: Boolean constraints for binding-time analysis. In: Danvy, O., Filinski, A. (eds.) PADO 2001. LNCS, vol. 2053, p. 39. Springer, Heidelberg (2001)

    Chapter  Google Scholar 

  28. Simonet, V.: Dalton, an efficient implementation of type inference with structural subtyping (2002), http://cristal.inria.fr/~simonet/soft/dalton/

  29. Heintze, N., McAllester, D.: Linear-time subtransitive control flow analysis. In: Programming Language Design and Implementation (1997)

    Google Scholar 

  30. Saha, B., Heintze, N., Oliva, D.: Subtransitive CFA using types. Technical report, Yale University (1998)

    Google Scholar 

  31. Rémy, D.: Extending ML type system with a sorted equational theory. Research Report 1766, Institut de Recherche en Informatique et en Automatique (1992)

    Google Scholar 

  32. Pessaux, F., Leroy, X.: Type-based analysis of uncaught exceptions. ACM Transactions on Programming Languages and Systems 22 (2000)

    Google Scholar 

  33. Simonet, V.: Type inference with structural subtyping: A precise formalization of an efficient constraint solver (2003), Full version http://cristal.inria.fr/simonet/publis/simonet-structural-subtypingfull.ps.gz

  34. Abadi, M., Banerjee, A., Heintze, N., Riecke, J.G.: A core calculus of dependency. In: 26th Principles of Programming Languages (1999)

    Google Scholar 

  35. Pottier, F.: A constraint-based presentation and generalization of rows. In: 18th IEEE Symposium on Logic in Computer Science (2003)

    Google Scholar 

  36. Tarjan, R.E.: Efficiency of a good but not linear set union algorithm. Journal of the ACM 22 (1975)

    Google Scholar 

  37. Fendrich, M., Foster, J.S., Su, Z., Aiken, A.S.: Partial online cycle elimination in inclusion constraint graphs. In: Programming Language Design and Implementation (1998)

    Google Scholar 

  38. Eifrig, J., Smith, S., Trifonov, V.: Sound polymorphic type inference for objects. ACM SIGPLAN Notices 30 (1995)

    Google Scholar 

  39. Simonet, V.: Flow Caml, information flow inference in Objective Caml., http://cristal.inria.fr/~simonet/soft/flowcaml/ (2002)

  40. Fendrich, M., Rehof, J., Das, M.: Scalable context-sensitive flow analysis using instantiation constraints. In: Programming Language Design and Implementation (2000)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2003 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Simonet, V. (2003). Type Inference with Structural Subtyping: A Faithful Formalization of an Efficient Constraint Solver. In: Ohori, A. (eds) Programming Languages and Systems. APLAS 2003. Lecture Notes in Computer Science, vol 2895. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-40018-9_19

Download citation

  • DOI: https://doi.org/10.1007/978-3-540-40018-9_19

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-20536-4

  • Online ISBN: 978-3-540-40018-9

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics