Conferences on Intelligent Computer Mathematics

CICM 2015: Intelligent Computer Mathematics pp 87-101 | Cite as

Type Inference for ZFH

  • Steven ObuaEmail author
  • Jacques Fleuriot
  • Phil Scott
  • David Aspinall
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 9150)


ZFH stands for Zermelo-Fraenkel set theory implemented in higher-order logic. It is a descendant of Agerholm’s and Gordon’s HOL-ST but does not allow the use of type variables nor the definition of new types. We first motivate why we are using ZFH for ProofPeer, the collaborative theorem proving system we are building. We then focus on the type inference algorithm we have developed for ZFH. In ZFH’s syntax, function application, written as juxtaposition, is overloaded to be either set-theoretic or higher-order. Our algorithm extends Hindley-Milner type inference to cope with this particular overloading of function application. We describe the algorithm, prove its correctness, and discuss why prior general approaches to type inference in the presence of coercions or overloading do not cover our particular case.


  1. 1.
  2. 2.
    Obua, S., Fleuriot, J., Scott, P., Aspinall, D.: ProofPeer: Collaborative Theorem Proving.
  3. 3.
    Hales, T., et al.: A formal proof of the Kepler conjecture.
  4. 4.
    Homotopy Type Theory.
  5. 5.
    Agerholm, S., Gordon, M.: Experiments with ZF set theory in HOL and Isabelle. In: Schubert, E.T., Alves-Foss, J., Windley, P. (eds.) HUG 1995. LNCS, vol. 971. Springer, Heidelberg (1995) Google Scholar
  6. 6.
    Gordon, M.: Set theory, higher order logic or both? In: von Wright, J., Harrison, J., Grundy, J. (eds.) TPHOLs 1996. LNCS, vol. 1125. Springer, Heidelberg (1996) Google Scholar
  7. 7.
    Paulson, L.C.: Set theory for verification: I. from foundations to functions. J. Autom. Reasoning 11(3), 353–389 (1993). SpringerMathSciNetCrossRefzbMATHGoogle Scholar
  8. 8.
    Krauss, A.: Partial and nested recursive function definitions in higher-order logic. J. Autom. Reasoning 44(4), 303–336 (2010). SpringerMathSciNetCrossRefzbMATHGoogle Scholar
  9. 9.
  10. 10.
    Baader, F., Nipkow, T.: Term Rewriting and All That. Cambridge University Press, Cambridge (1999) zbMATHGoogle Scholar
  11. 11.
    Milner, R.: A theory of type polymorphism in programming. J. Comput. Syst. Sci. 17, 348–375 (1978)MathSciNetCrossRefzbMATHGoogle Scholar
  12. 12.
    Traytel, D., Berghofer, S., Nipkow, T.: Extending hindley-milner type inference with coercive structural subtyping. In: Yang, H. (ed.) APLAS 2011. LNCS, vol. 7078, pp. 89–104. Springer, Heidelberg (2011) CrossRefGoogle Scholar
  13. 13.
    Luo, Z.: Coercions in a polymorphic type system. Math. Struct. Comput. Sci. 18(04), 729–751 (2008). Cambridge JournalsMathSciNetCrossRefzbMATHGoogle Scholar
  14. 14.
    Odersky, M., Wadler, P., Wehr, M.: A second look at overloading. In: Proceedings of the Seventh International Conference on Functional Programming Languages and Computer Architecture. ACM (1995)Google Scholar

Copyright information

© Springer International Publishing Switzerland 2015

Authors and Affiliations

  • Steven Obua
    • 1
    Email author
  • Jacques Fleuriot
    • 1
  • Phil Scott
    • 1
  • David Aspinall
    • 1
  1. 1.School of InformaticsEdinburgh UniversityEdinburghScotland, UK

Personalised recommendations