Skip to main content

Advertisement

SpringerLink
Log in
Menu
Find a journal Publish with us Track your research
Search
Cart
Book cover

European Symposium on Programming

ESOP 2007: Programming Languages and Systems pp 426–440Cite as

  1. Home
  2. Programming Languages and Systems
  3. Conference paper
A Rewriting Semantics for Type Inference

A Rewriting Semantics for Type Inference

  • George Kuan1,
  • David MacQueen1 &
  • Robert Bruce Findler1 
  • Conference paper
  • 1025 Accesses

  • 3 Citations

  • 1 Altmetric

Part of the Lecture Notes in Computer Science book series (LNTCS,volume 4421)

Abstract

When students first learn programming, they often rely on a simple operational model of a program’s behavior to explain how particular features work. Because such models build on their earlier training in algebra, students find them intuitive, even obvious. Students learning type systems, however, have to confront an entirely different notation with a different semantics that many find difficult to understand.

In this work, we begin to build the theoretical underpinnings for treating type checking in a manner like the operational semantics of execution. Intuitively, each term is incrementally rewritten to its type. For example, each basic constant rewrites directly to its type and each lambda expression rewrites to an arrow type whose domain is the type of the lambda’s formal parameter and whose range is the body of the lambda expression which, in turn, rewrites to the range type.

Chapter PDF

Download to read the full chapter text

References

  1. Appel, A.W., MacQueen, D.B.: Standard ML of New Jersey. In: Małuszyński, J., Wirsing, M. (eds.) PLILP 1991. LNCS, vol. 528, pp. 1–13. Springer, Heidelberg (1991)

    Google Scholar 

  2. Beaven, M., Stansifer, R.: Explaining type errors in polymorphic languages. ACM Letters on Programming Languages and Systems 2(1-4), 17–30 (1993)

    CrossRef  Google Scholar 

  3. Bravenboer, M., et al.: Stratego/XT Tutorial, Examples, and Reference Manual for Stratego/XT 0.16. Department of Information and Computing Sciences, Universiteit Utrecht, Utrecht, The Netherlands (November 2005)

    Google Scholar 

  4. Cardelli, L.: Basic polymorphic typechecking. Science of Computer Programming 8(2), 147–172 (1987)

    CrossRef  MATH  MathSciNet  Google Scholar 

  5. Cousot, P.: Types as abstract interpretations. In: POPL ’97: Proceedings of the 24th ACM SIGPLAN-SIGACT symposium on Principles of programming languages, pp. 316–331. ACM Press, New York (1997)

    CrossRef  Google Scholar 

  6. Curry, H.B.: Modified basic functionality in combinatory logic. Dialectica 23, 83–92 (1969)

    CrossRef  MATH  Google Scholar 

  7. Damas, L.: unpublished note (1982)

    Google Scholar 

  8. Danvy, O., Nielsen, L.R.: Refocusing in reduction semantics. Technical Report BRICS RS-04-26, Department of Computer Science, University of Aarhus, Aarhus, Denmark (2004), http://citeseer.ist.psu.edu/danvy04refocusing.html

  9. Duggan, D., Bent, F.: Explaining type inference. Science of Computer Programming 27, 37–83 (1996)

    CrossRef  MATH  Google Scholar 

  10. Felleisen, M., Flatt, M.: Programming languages and lambda calculi. Revision of 1989 edition (2003)

    Google Scholar 

  11. Felleisen, M., Hieb, R.: A revised report on the syntactic theories of sequential control and state. Theoretical Computer Science 103(2), 235–271 (1992)

    CrossRef  MATH  MathSciNet  Google Scholar 

  12. Haack, C., Wells, J.B.: Type error slicing in implicitly typed higher-order languages. Sci. Comput. Program. 50(1-3), 189–224 (2004)

    CrossRef  MATH  MathSciNet  Google Scholar 

  13. Heeren, B., Hage, J., Swierstra, S.D.: Scripting the type inference process. In: ICFP ’03: Proceedings of the eighth ACM SIGPLAN international conference on Functional programming, pp. 3–13. ACM Press, New York (2003)

    CrossRef  Google Scholar 

  14. Hindley, J.R.: The principal type scheme of an object in combinatory logic. Transactions of the American Mathematical Society 146, 29–40 (1969)

    CrossRef  MATH  MathSciNet  Google Scholar 

  15. Kahrs, S.: Polymorphic type checking by interpretation of code. Technical Report ECS-LFCS-92-238, University of Edinburgh (1992)

    Google Scholar 

  16. Kuan, G.: A rewriting semantics for type inference. Technical Report TR-2007-01, University of Chicago (2007)

    Google Scholar 

  17. Lee, O., Yi, K.: Proofs about a folklore let-polymorphic type inference algorithm. ACM Transanctions on Programming Languages and Systems 20(4), 707–723 (1998)

    CrossRef  Google Scholar 

  18. Lerner, B., Grossman, D., Chambers, C.: Seminal: searching for ML type-error messages. In: ML ’06: Proceedings of the 2006 Workshop on ML, pp. 63–73. ACM Press, New York (2006)

    CrossRef  Google Scholar 

  19. Leroy, X.: Programmation du système Unix en Caml Light. Technical report 147, INRIA (1992)

    Google Scholar 

  20. Martelli, A., Montanari, U.: An efficient unification algorithm. ACM Trans. Program. Lang. Syst. 4(2), 258–282 (1982)

    CrossRef  MATH  Google Scholar 

  21. Matthews, J., et al.: A visual environment for developing context-sensitive term rewriting systems. In: Rewriting Techniques and Applications (2004)

    Google Scholar 

  22. McAdam, B.: How to repair type errors automatically. In: Trends in functional programming, pp. 87–98 (2002)

    Google Scholar 

  23. McAllester, D.: A logical algorithm for ML type inference. In: Rewriting Techniques and Applications (2003)

    Google Scholar 

  24. Milner, R.: A theory of type polymorphism in programming. JCSS 17, 348–375 (1978)

    MATH  MathSciNet  Google Scholar 

  25. Neubauer, M., Thiemann, P.: Discriminative sum types locate the source of type errors. In: ICFP ’03: Proceedings of the eighth ACM SIGPLAN international conference on Functional programming, pp. 15–26. ACM Press, New York (2003)

    CrossRef  Google Scholar 

  26. Pašalić, E., Siek, J.G., Taha, W.: Concoqtion: Mixing indexed types and Hindley-Milner type inference. In: POPL ’07: Conference record of the 34th ACM SIGPLAN-SIGACT symposium on Principles of programming languages (2007)

    Google Scholar 

  27. Rémy, D.: Extending ML type system with a sorted equational theory. Research Report 1766, Institut National de Recherche en Informatique et Automatisme, Rocquencourt, Le Chesnay, France (1992)

    Google Scholar 

  28. Robinson, J.A.: A machine-oriented logic based on the resolution principle. J. ACM 12(1), 23–41 (1965)

    CrossRef  MATH  Google Scholar 

  29. Soosaipillai, H.: An explanation based polymorphic type checker for Standard ML. Master’s Thesis (1990)

    Google Scholar 

  30. Wand, M.: Finding the source of type errors. In: POPL ’86: Proceedings of the 13th ACM SIGACT-SIGPLAN symposium on Principles of programming languages, pp. 38–43. ACM Press, New York (1986)

    CrossRef  Google Scholar 

  31. Wand, M.: A simple algorithm and proof for type inference. Fundamenta Infomaticae 10, 115–122 (1987)

    MATH  MathSciNet  Google Scholar 

  32. Yang, J.: Explaining type errors by finding the source of a type conflict. In: SFP ’99: Selected papers from the 1st Scottish Functional Programming Workshop (SFP99), Exeter, UK, pp. 59–67. Intellect Books, Oxford (2000)

    Google Scholar 

  33. Yang, J.: Improving Polymorphic Type Explanations. PhD thesis, Heriot-Watt University (2001)

    Google Scholar 

Download references

Author information

Authors and Affiliations

  1. University of Chicago, 1100 East 58th Street, Chicago, IL 60637,  

    George Kuan, David MacQueen & Robert Bruce Findler

Authors
  1. George Kuan
    View author publications

    You can also search for this author in PubMed Google Scholar

  2. David MacQueen
    View author publications

    You can also search for this author in PubMed Google Scholar

  3. Robert Bruce Findler
    View author publications

    You can also search for this author in PubMed Google Scholar

Editor information

Rocco De Nicola

Rights and permissions

Reprints and Permissions

Copyright information

© 2007 Springer Berlin Heidelberg

About this paper

Cite this paper

Kuan, G., MacQueen, D., Findler, R.B. (2007). A Rewriting Semantics for Type Inference. In: De Nicola, R. (eds) Programming Languages and Systems. ESOP 2007. Lecture Notes in Computer Science, vol 4421. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-71316-6_29

Download citation

  • .RIS
  • .ENW
  • .BIB
  • DOI: https://doi.org/10.1007/978-3-540-71316-6_29

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-71314-2

  • Online ISBN: 978-3-540-71316-6

  • eBook Packages: Computer ScienceComputer Science (R0)

Share this paper

Anyone you share the following link with will be able to read this content:

Sorry, a shareable link is not currently available for this article.

Provided by the Springer Nature SharedIt content-sharing initiative

Publish with us

Policies and ethics

search

Navigation

  • Find a journal
  • Publish with us
  • Track your research

Discover content

  • Journals A-Z
  • Books A-Z

Publish with us

  • Publish your research
  • Open access publishing

Products and services

  • Our products
  • Librarians
  • Societies
  • Partners and advertisers

Our imprints

  • Springer
  • Nature Portfolio
  • BMC
  • Palgrave Macmillan
  • Apress
  • Your US state privacy rights
  • Accessibility statement
  • Terms and conditions
  • Privacy policy
  • Help and support
  • Cancel contracts here

167.114.118.210

Not affiliated

Springer Nature

© 2023 Springer Nature