Skip to main content

Programming and Proving with Classical Types

  • Conference paper
  • First Online:
  • 876 Accesses

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 10695))

Abstract

The propositions-as-types correspondence is ordinarily presented as linking the metatheory of typed \(\lambda \)-calculi and the proof theory of intuitionistic logic. Griffin observed that this correspondence could be extended to classical logic through the use of control operators. This observation set off a flurry of further research, leading to the development of Parigot’s \(\lambda \mu \)-calculus. In this work, we use the \(\lambda \mu \)-calculus as the foundation for a system of proof terms for classical first-order logic. In particular, we define an extended call-by-value \(\lambda \mu \)-calculus with a type system in correspondence with full classical logic. We extend the language with polymorphic types, add a host of data types in ‘direct style’, and prove several metatheoretical properties. All of our proofs and definitions are mechanised in Isabelle/HOL, and we automatically obtain an interpreter for a system of proof terms cum programming language—called \(\mu \)ML—using Isabelle’s code generation mechanism. Atop our proof terms, we build a prototype LCF-style interactive theorem prover—called \(\mu \)TP—for classical first-order logic, capable of synthesising \(\mu \)ML programs from completed tactic-driven proofs. We present example closed \(\mu \)ML programs with classical tautologies for types, including some inexpressible as closed programs in the original \(\lambda \mu \)-calculus, and some example tactic-driven \(\mu \)TP proofs of classical tautologies.

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

Buying options

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

Learn about institutional subscriptions

Notes

  1. 1.

    Strictly speaking, our evaluation strategy is a call-by-weak-head-normal-form. A pure call-by-value \(\lambda \mu \)-calculus could get stuck when evaluating an application whose argument is a \(\mu \)-abstraction, which is undesirable. We retain the terminology call-by-value since it gives a better intuition of the desired behaviour.

  2. 2.

    See: https://bitbucket.org/Cristina_Matache/prog-classical-types.

  3. 3.

    Note that formulae are currently manually constructed, due to the lack of a parser.

References

  1. Ariola, Z.M., Herbelin, H.: Minimal classical logic and control operators. In: Baeten, J.C.M., Lenstra, J.K., Parrow, J., Woeginger, G.J. (eds.) ICALP 2003. LNCS, vol. 2719, pp. 871–885. Springer, Heidelberg (2003). https://doi.org/10.1007/3-540-45061-0_68

    Chapter  Google Scholar 

  2. Ariola, Z.M., Herbelin, H., Sabry, A.: A type-theoretic foundation of continuations and prompts. In: ICFP (2004)

    Google Scholar 

  3. Asperti, A., Ricciotti, W., Sacerdoti Coen, C., Tassi, E.: The matita interactive theorem prover. In: Bjørner, N., Sofronie-Stokkermans, V. (eds.) CADE 2011. LNCS (LNAI), vol. 6803, pp. 64–69. Springer, Heidelberg (2011). https://doi.org/10.1007/978-3-642-22438-6_7

    Chapter  Google Scholar 

  4. Barbanera, F., Berardi, S.: A symmetric lambda calculus for “classical” program extraction. In: TACS (1994)

    Google Scholar 

  5. Barbanera, F., Berardi, S.: A strong normalization result for classical logic. Ann. Pure Appl. Log. 76(2), 99–116 (1995)

    Article  MathSciNet  MATH  Google Scholar 

  6. Barbanera, F., Berardi, S., Schivalocchi, M.: “Classical” programming-with-proofs in \(\lambda _{\sf Sym\sf ^{\sf PA}}\): an analysis of non-confluence. In: TACS (1997)

    Google Scholar 

  7. Berghofer, S.: Proofs, programs and executable specifications in higher order logic. Ph.D. thesis, Technical University Munich, Germany (2003)

    Google Scholar 

  8. Barthe, G., Hatcliff, J., Sørensen, M.H.: A notion of classical pure type system. Electron. Notes Theor. Comput. Sci. 6, 4–59 (1997)

    Article  MathSciNet  MATH  Google Scholar 

  9. Bierman, G.M.: A computational interpretation of the \(\lambda \mu \)-calculus. In: Brim, L., Gruska, J., Zlatuška, J. (eds.) MFCS 1998. LNCS, vol. 1450, pp. 336–345. Springer, Heidelberg (1998). https://doi.org/10.1007/BFb0055783

    Chapter  Google Scholar 

  10. Berghofer, S., Nipkow, T.: Proof terms for simply typed higher order logic. In: Aagaard, M., Harrison, J. (eds.) TPHOLs 2000. LNCS, vol. 1869, pp. 38–52. Springer, Heidelberg (2000). https://doi.org/10.1007/3-540-44659-1_3

    Chapter  Google Scholar 

  11. Barthe, G., Uustalu, T.: CPS translating inductive and coinductive types. In: PEPM (2002)

    Google Scholar 

  12. Barendregt, H., Wiedijk, F.: The challenge of computer mathematics. Philos. Trans. A 363, 2005 (1835)

    MATH  Google Scholar 

  13. Crolard, T., Polonowski, E.: A program logic for higher-order procedural variables and non-local jumps. CoRR, abs/1112.1554 (2011)

    Google Scholar 

  14. de Bruijn, N.G.: Lambda calculus notation with nameless dummies, a tool for automatic formula manipulation, with application to the Church-Rosser theorem. Indagationes Mathematicae 75(5), 381–392 (1972)

    Article  MathSciNet  MATH  Google Scholar 

  15. de Groote, P.: A CPS-translation of the lambda-\(\mu \)-calculus. In: CAAP (1994)

    Google Scholar 

  16. Groote, P.: On the relation between the \(\lambda \mu \)-calculus and the syntactic theory of sequential control. In: Pfenning, F. (ed.) LPAR 1994. LNCS, vol. 822, pp. 31–43. Springer, Heidelberg (1994). https://doi.org/10.1007/3-540-58216-9_27

    Chapter  Google Scholar 

  17. Groote, P.: A simple calculus of exception handling. In: Dezani-Ciancaglini, M., Plotkin, G. (eds.) TLCA 1995. LNCS, vol. 902, pp. 201–215. Springer, Heidelberg (1995). https://doi.org/10.1007/BFb0014054

    Chapter  Google Scholar 

  18. de Groote, P.: An environment machine for the \(\lambda \mu \)-calculus. Math. Struct. Comput. Sci. 8(6), 637–669 (1998)

    Article  MathSciNet  Google Scholar 

  19. Groote, P.: Strong normalization of classical natural deduction with disjunction. In: Abramsky, S. (ed.) TLCA 2001. LNCS, vol. 2044, pp. 182–196. Springer, Heidelberg (2001). https://doi.org/10.1007/3-540-45413-6_17

    Chapter  Google Scholar 

  20. Felleisen, M., Friedman, D.P., Kohlbecker, E.E., Duba, B.F.: A syntactic theory of sequential control. Theor. Comput. Sci. 52, 205–237 (1987)

    Article  MathSciNet  MATH  Google Scholar 

  21. Girard, J.-Y.: Une extension de l’interprétation de Gödel à l’analyse et son application à l’élimination des coupures dans l’analyse et la théorie des types. In: Proceedings of the Second Scandinavian Logic Symposium (1971)

    Google Scholar 

  22. Geuvers, H., Krebbers, R., McKinna, J.: The \(\lambda \mu ^{ T}\)-calculus. Ann. Pure Appl. Logic 164(6), 676–701 (2013)

    Article  MathSciNet  MATH  Google Scholar 

  23. Gödel, K.: Über eine bisher noch nicht benützte erweiterung des finiten standpunktes. Dialectica 12(3–4), 280–287 (1958)

    Article  MathSciNet  MATH  Google Scholar 

  24. Gordon, M.J.C.: Introduction to the HOL system. In: HOL (1991)

    Google Scholar 

  25. Griffin, T.: A formulae-as-types notion of control. In: POPL (1990)

    Google Scholar 

  26. Huet, G.P., Herbelin, H.: 30 years of research and development around Coq. In: POPL (2014)

    Google Scholar 

  27. Harper, B., Lillibridge, M.: ML with callcc is unsound (1991). https://www.seas.upenn.edu/sweirich/types/archive/1991/msg00034.html

  28. Kumar, R., Hurd, J.: Standalone tactics using opentheory. In: Beringer, L., Felty, A. (eds.) ITP 2012. LNCS, vol. 7406, pp. 405–411. Springer, Heidelberg (2012). https://doi.org/10.1007/978-3-642-32347-8_28

    Chapter  Google Scholar 

  29. Krivine, J-L.: Bar recursion in classical realisability: dependent choice and continuum hypothesis. In: CSL pp. 25:1–25:11 (2016)

    Google Scholar 

  30. Matache, C., Gomes, V.B.F., Mulligan, D.P.: The \(\lambda \mu \)-calculus. Archive of Formal Proofs (2017)

    Google Scholar 

  31. Milner, R.: Lcf: a way of doing proofs with a machine. In: Bečvář, J. (ed.) MFCS 1979. LNCS, vol. 74, pp. 146–159. Springer, Heidelberg (1979). https://doi.org/10.1007/3-540-09526-8_11

    Chapter  Google Scholar 

  32. Murthy, C.R.: An evaluation semantics for classical proofs. In: LICS (1991)

    Google Scholar 

  33. Ong, C.-H.L., Stewart, C.A.: A Curry-Howard foundation for functional computation with control. In: POPL. ACM Press (1997)

    Google Scholar 

  34. Parigot, M.: \(\lambda \mu \)-Calculus: an algorithmic interpretation of classical natural deduction. In: Voronkov, A. (ed.) LPAR 1992. LNCS, vol. 624, pp. 190–201. Springer, Heidelberg (1992). https://doi.org/10.1007/BFb0013061

    Chapter  Google Scholar 

  35. Parigot, M.: Classical proofs as programs. In: Gottlob, G., Leitsch, A., Mundici, D. (eds.) KGC 1993. LNCS, vol. 713, pp. 263–276. Springer, Heidelberg (1993). https://doi.org/10.1007/BFb0022575

    Chapter  Google Scholar 

  36. Parigot, M.: Strong normalization for second order classical natural deduction. In: LICS (1993)

    Google Scholar 

  37. Parigot, M.: Proofs of strong normalisation for second order classical natural deduction. J. Symb. Log. 62(4), 1461–1479 (1997)

    Article  MathSciNet  MATH  Google Scholar 

  38. Pottier, F., Régis-Gianas, Y.: The Menhir parser generator (2017)

    Google Scholar 

  39. Py, W.: Confluence en \(\lambda \mu \)-calcul. Ph.D. thesis (1998)

    Google Scholar 

  40. Rehof, J., Sørensen, M.H.: The \(\lambda _{\Delta }\)-calculus. In: TACS (1994)

    Google Scholar 

Download references

Acknowledgments

Gomes and Mulligan acknowledge funding from EPSRC grant EP/K008528 (‘REMS: Rigorous Engineering for Mainstream Systems’). We thank the anonymous referees and Peter Sewell for their helpful comments.

Author information

Authors and Affiliations

Authors

Corresponding authors

Correspondence to Cristina Matache , Victor B. F. Gomes or Dominic P. Mulligan .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2017 Springer International Publishing AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Matache, C., Gomes, V.B.F., Mulligan, D.P. (2017). Programming and Proving with Classical Types. In: Chang, BY. (eds) Programming Languages and Systems. APLAS 2017. Lecture Notes in Computer Science(), vol 10695. Springer, Cham. https://doi.org/10.1007/978-3-319-71237-6_11

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-71237-6_11

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-71236-9

  • Online ISBN: 978-3-319-71237-6

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics