Skip to main content

From Types to Sets by Local Type Definitions in Higher-Order Logic

  • Conference paper
  • First Online:
Interactive Theorem Proving (ITP 2016)

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

Included in the following conference series:

Abstract

Types in Higher-Order Logic (HOL) are naturally interpreted as nonempty sets—this intuition is reflected in the type definition rule for the HOL-based systems (including Isabelle/HOL), where a new type can be defined whenever a nonempty set is exhibited. However, in HOL this definition mechanism cannot be applied inside proof contexts. We propose a more expressive type definition rule that addresses the limitation and we prove its soundness. This higher expressive power opens the opportunity for a HOL tool that relativizes type-based statements to more flexible set-based variants in a principled way. We also address particularities of Isabelle/HOL and show how to perform the relativization in the presence of type classes.

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

Access this chapter

Subscribe and save

Springer+ Basic
EUR 32.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or Ebook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

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 EPUB and 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

Similar content being viewed by others

Notes

  1. 1.

    Dependent type theory has its own pluses and minuses. Moreover, even if we came to the conclusion that the pluses prevail, we do not know how to combine dependent types with higher-order logic and the tools built around it. Hence the avoidance of the dependent types.

  2. 2.

    We silently assume parametricity of the quantifier \(\exists \) and \(\mathsf {P}\).

  3. 3.

    This is Wenzel’s approach [32] to represent axiomatic type classes by internalizing them as predicates on types, i.e., constants of type \(\forall \alpha .\;\mathsf {bool}\). As this particular type is not allowed in Isabelle, Wenzel uses instead \(\alpha \;\mathsf {itself} \rightarrow \mathsf {bool}\), where \(\alpha \;\mathsf {itself}\) is a singleton type.

  4. 4.

    Let us recall that \(\forall x.\,P\;x\) is a shorthand for \({{\mathsf {All}}}\;(\lambda x.\,P\;x)\) and \(\forall x \in A.\,P\;x\) for \({{\mathsf {Ball}}}\;A\;(\lambda x.\,P\;x)\), where \({{\mathsf {All}}}\) and \({{\mathsf {Ball}}}\) are the HOL combinators for quantification. Thus the statement about isomorphism between the two quantifications means isomorphism between \({{\mathsf {All}}}\) and \({{\mathsf {Ball}}}\;A\).

  5. 5.

    Unless there is a type depending on \(*\).

  6. 6.

    Again, the rigorous justification of this result is based on our work on Isabelle/HOL’s consistency [21] and can be found in the extended version of this paper [1].

  7. 7.

    These rules are related to Reynolds’s relational parametricity [28] and Wadler’s free theorems [31]. The Transfer tool is a working implementation of Mitchell’s representation independence [24] and it demonstrates that transferring of properties across related types can be organized and largely automated using relational parametricity.

References

  1. From Types to Sets - Associated Web Page. http://www21.in.tum.de/~kuncar/documents/types-to-sets/

  2. The HOL4 Theorem Prover. http://hol.sourceforge.net/

  3. Adams, M.: Introducing HOL Zero. In: Fukuda, K., Hoeven, J., Joswig, M., Takayama, N. (eds.) ICMS 2010. LNCS, vol. 6327, pp. 142–143. Springer, Heidelberg (2010)

    Chapter  Google Scholar 

  4. Aransay, J., Ballarin, C., Rubio, J.: A mechanized proof of the basic perturbation lemma. J. Autom. Reason. 40(4), 271–292 (2008)

    Article  MathSciNet  MATH  Google Scholar 

  5. Asperti, A., Ricciotti, W., Sacerdoti Coen, C., Tassi, E.: The Matita interactive theorem prover. In: Bjorner, N., Sofronie-Stokkermans, V. (eds.) CADE 2011. LNCS, vol. 6803, pp. 64–69. Springer, Heidelberg (2011)

    Chapter  Google Scholar 

  6. Bertot, Y., Castéran, P.: Interactive Theorem Proving and Program Development - Coq’Art: The Calculus of Inductive Constructions. Texts in Theoretical Computer Science. An EATCS Series. Springer, Berlin (2004)

    Book  MATH  Google Scholar 

  7. Bove, A., Dybjer, P., Norell, U.: A brief overview of Agda – a functional language with dependent types. In: Berghofer, S., Nipkow, T., Urban, C., Wenzel, M. (eds.) TPHOLs 2009. LNCS, vol. 5674, pp. 73–78. Springer, Heidelberg (2009)

    Chapter  Google Scholar 

  8. Chan, H., Norrish, M.: Mechanisation of AKS algorithm: part 1 - the main theorem. In: Urban, C., Zhang, X. (eds.) ITP 2015. LNCS, vol. 9236, pp. 117–136. Springer, New York (2015)

    Google Scholar 

  9. Coble, A.R.: Formalized information-theoretic proofs of privacy using the HOL4 theorem-prover. In: Borisov, N., Goldberg, I. (eds.) PETS 2008. LNCS, vol. 5134, pp. 77–98. Springer, Heidelberg (2008)

    Chapter  Google Scholar 

  10. Constable, R.L., Allen, S.F., Bromley, H.M., Cleaveland, W.R., Cremer, J.F., Harper, R.W., Howe, D.J., Knoblock, T.B., Mendler, N.P., Panangaden, P., Sasaki, J.T., Smith, S.F.: Implementing Mathematics with the Nuprl Proof Development System. Prentice-Hall Inc, Upper Saddle River (1986)

    Google Scholar 

  11. Gordon, M.J.C., Melham, T.F. (eds.): Introduction to HOL: A Theorem Proving Environment for Higher Order Logic. Cambridge University Press, Cambridge (1993)

    MATH  Google Scholar 

  12. Grabowski, A., Kornilowicz, A., Naumowicz, A.: Mizar in a nutshell. J. Formalized Reason. 3(2), 153–245 (2010)

    MathSciNet  MATH  Google Scholar 

  13. Haftmann, F., Wenzel, M.: Constructive type classes in Isabelle. In: Altenkirch, T., McBride, C. (eds.) TYPES 2006. LNCS, vol. 4502, pp. 160–174. Springer, Heidelberg (2007)

    Chapter  Google Scholar 

  14. Harrison, J.: HOL Light: a tutorial introduction. In: Srivas, K., Camilleri, M.A.J. (eds.) FMCAD 1996. LNCS, vol. 1166, pp. 265–269. Springer, Heidelberg (1996)

    Chapter  Google Scholar 

  15. Hölzl, J., Heller, A.: Three chapters of measure theory in Isabelle/HOL. In: van Eekelen, M., Geuvers, H., Schmaltz, J., Wiedijk, F. (eds.) ITP 2011. LNCS, vol. 6898, pp. 135–151. Springer, Heidelberg (2011)

    Chapter  Google Scholar 

  16. Homeier, P.V.: The HOL-Omega logic. In: Berghofer, S., Nipkow, T., Urban, C., Wenzel, M. (eds.) TPHOLs 2009. LNCS, vol. 5674, pp. 244–259. Springer, Heidelberg (2009)

    Chapter  Google Scholar 

  17. Huffman, B., Kunčar, O.: Lifting and Transfer: a modular design for quotients in Isabelle/HOL. In: Gonthier, G., Norrish, M. (eds.) CPP 2013. LNCS, vol. 8307, pp. 131–146. Springer, Heidelberg (2013)

    Chapter  Google Scholar 

  18. Immler, F.: Generic Construction of Probability Spaces for Paths of Stochastic Processes. Master’s thesis, Institut für Informatik, Technische Universität München (2012)

    Google Scholar 

  19. Kaufmann, M., Manolios, P., Moore, J.S.: Computer-Aided Reasoning: An Approach. Kluwer Academic Publishers, Boston (2000)

    Google Scholar 

  20. Krauss, A., Schropp, A.: A mechanized translation from higher-order logic to set theory. In: Kaufmann, M., Paulson, L.C. (eds.) ITP 2010. LNCS, vol. 6172, pp. 323–338. Springer, Heidelberg (2010)

    Chapter  Google Scholar 

  21. Kunčar, O., Popescu, A.: Comprehending Isabelle/HOL’s Consistency, Draft. http://andreipopescu.uk/HOLC.html

  22. Kunčar, O.: Types, Abstraction and Parametric Polymorphism in Higher-Order Logic. Ph.D. thesis, Fakultät für Informatik, Technische Universität München (2016). http://www21.in.tum.de/~kuncar/documents/kuncar-phdthesis.pdf

  23. Maggesi, M.: A formalisation of metric spaces in HOL Light. In: Presented at the workshop formal mathematics for mathematicians, CICM 2015 (2015). http://www.cicm-conference.org/2015/fm4m/FMM_2015_paper_3.pdf

  24. Mitchell, J.C.: Representation independence and data abstraction. In: POPL 1986, pp. 263–276. ACM (1986)

    Google Scholar 

  25. Nipkow, T., Paulson, L.C., Wenzel, M.: Isabelle/HOL–A Proof Assistant for Higher-Order Logic. LNCS, vol. 2283. Springer, Heidelberg (2002)

    MATH  Google Scholar 

  26. Nipkow, T., Paulson, L.C., Wenzel, M.: Isabelle/HOL – A Proof Assistant for Higher-Order Logic. Part of the Isabelle 2015 distribution (2015). https://isabelle.in.tum.de/dist/Isabelle2015/doc/tutorial.pdf

  27. Pitts, A.: The HOL Logic. In: Gordon and Melham [11], pp. 191–232 (1993)

    Google Scholar 

  28. Reynolds, J.C.: Types, Abstraction and Parametric Polymorphism. In: IFIP Congress, pp. 513–523 (1983)

    Google Scholar 

  29. Shankar, N., Owre, S., Rushby, J.M.: PVS Tutorial. Computer Science Laboratory, SRI International (1993)

    Google Scholar 

  30. Traytel, D., Popescu, A., Blanchette, J.C.: Foundational, compositional (co)datatypes for higher-order logic: category theory applied to theorem proving. In: LICS 2012, pp. 596–605. IEEE (2012)

    Google Scholar 

  31. Wadler, P.: Theorems for Free! In: FPCA 1989, pp. 347–359. ACM (1989)

    Google Scholar 

  32. Wenzel, M.: Type classes and overloading in higher-order logic. In: Gunter, E.L., Felty, A.P. (eds.) TPHOLs 1997. LNCS, vol. 1275, pp. 307–322. Springer, Heidelberg (1997)

    Chapter  Google Scholar 

  33. Wickerson, J.: Isabelle Users List, February 2013. https://lists.cam.ac.uk/mailman/htdig/cl-isabelle-users/2013-February/msg00222.html

Download references

Acknowledgements

We are indebted to the reviewers for useful comments and suggestions. We gratefully acknowledge support from DFG through grant Ni 491/13-3 and from EPSRC through grant EP/N019547/1.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Ondřej Kunčar .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2016 Springer International Publishing Switzerland

About this paper

Cite this paper

Kunčar, O., Popescu, A. (2016). From Types to Sets by Local Type Definitions in Higher-Order Logic. In: Blanchette, J., Merz, S. (eds) Interactive Theorem Proving. ITP 2016. Lecture Notes in Computer Science(), vol 9807. Springer, Cham. https://doi.org/10.1007/978-3-319-43144-4_13

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-43144-4_13

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-43143-7

  • Online ISBN: 978-3-319-43144-4

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics