A Formalized General Theory of Syntax with Bindings

Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 10499)


We present the formalization of a theory of syntax with bindings that has been developed and refined over the last decade to support several large formalization efforts. Terms are defined for an arbitrary number of constructors of varying numbers of inputs, quotiented to alpha-equivalence and sorted according to a binding signature. The theory includes a rich collection of properties of the standard operators on terms, such as substitution and freshness. It also includes induction and recursion principles and support for semantic interpretation, all tailored for smooth interaction with the bindings and the standard operators.



We thank the anonymous reviewers for suggesting textual improvements. Popescu has received funding from UK’s Engineering and Physical Sciences Research Council (EPSRC) via the grant EP/N019547/1, Verification of Web-based Systems (VOWS).


  1. 1.
  2. 2.
    Aydemir, B.E., Bohannon, A., Weirich, S.: Nominal reasoning techniques in Coq: (extended abstract). Electron. Notes Theor. Comput. Sci. 174(5), 69–77 (2007)CrossRefMATHGoogle Scholar
  3. 3.
    Aydemir, B.E., Charguéraud, A., Pierce, B.C., Pollack, R., Weirich, S.: Engineering formal metatheory. In: POPL 2008, pp. 3–15 (2008)Google Scholar
  4. 4.
    Barendregt, H.P.: The Lambda Calculus. North-Holland, Amsterdam (1984)MATHGoogle Scholar
  5. 5.
    Bengtson, J., Parrow, J., Weber, T.: Psi-calculi in Isabelle. J. Autom. Reason. 56(1), 1–47 (2016)MathSciNetCrossRefMATHGoogle Scholar
  6. 6.
    Berghofer, S., Wenzel, M.: Inductive datatypes in HOL — lessons learned in formal-logic engineering. In: Bertot, Y., Dowek, G., Théry, L., Hirschowitz, A., Paulin, C. (eds.) TPHOLs 1999. LNCS, vol. 1690, pp. 19–36. Springer, Heidelberg (1999). doi: 10.1007/3-540-48256-3_3 CrossRefGoogle Scholar
  7. 7.
    Blanchette, J.C., Popescu, A.: Mechanizing the metatheory of sledgehammer. In: Fontaine, P., Ringeissen, C., Schmidt, R.A. (eds.) FroCoS 2013. LNCS (LNAI), vol. 8152, pp. 245–260. Springer, Heidelberg (2013). doi: 10.1007/978-3-642-40885-4_17 CrossRefGoogle Scholar
  8. 8.
    Blanchette, J.C., Böhme, S., Popescu, A., Smallbone, N.: Encoding monomorphic and polymorphic types. In: Piterman, N., Smolka, S.A. (eds.) TACAS 2013. LNCS, vol. 7795, pp. 493–507. Springer, Heidelberg (2013). doi: 10.1007/978-3-642-36742-7_34 CrossRefGoogle Scholar
  9. 9.
    Blanchette, J.C., Bouzy, A., Lochbihler, A., Popescu, A., Traytel, D.: Friends with benefits - implementing corecursion in foundational proof assistants. In: Yang, H. (ed.) ESOP 2017. LNCS, vol. 10201, pp. 111–140. Springer, Heidelberg (2017). doi: 10.1007/978-3-662-54434-1_5 CrossRefGoogle Scholar
  10. 10.
    Blanchette, J.C., Hölzl, J., Lochbihler, A., Panny, L., Popescu, A., Traytel, D.: Truly modular (co)datatypes for Isabelle/HOL. In: Klein, G., Gamboa, R. (eds.) ITP 2014. LNCS, vol. 8558, pp. 93–110. Springer, Cham (2014). doi: 10.1007/978-3-319-08970-6_7 Google Scholar
  11. 11.
    Blanchette, J.C., Meier, F., Popescu, A., Traytel, D.: Foundational nonuniform (co)datatypes for higher-order logic. In: LICS. IEEE (2017)Google Scholar
  12. 12.
    Blanchette, J.C., Popescu, A., Traytel, D.: Cardinals in Isabelle/HOL. In: Klein, G., Gamboa, R. (eds.) ITP 2014. LNCS, vol. 8558, pp. 111–127. Springer, Cham (2014). doi: 10.1007/978-3-319-08970-6_8 Google Scholar
  13. 13.
    Blanchette, J.C., Popescu, A., Traytel, D.: Unified classical logic completeness—a coinductive pearl. In: Demri, S., Kapur, D., Weidenbach, C. (eds.) IJCAR 2014. LNCS (LNAI), vol. 8562, pp. 46–60. Springer, Cham (2014). doi: 10.1007/978-3-319-08587-6_4 Google Scholar
  14. 14.
    Blanchette, J.C., Popescu, A., Traytel, D.: Foundational extensible corecursion: a proof assistant perspective. In: ICFP, pp. 192–204 (2015)Google Scholar
  15. 15.
    Blanchette, J.C., Popescu, A., Traytel, D.: Soundness and completeness proofs by coinductive methods. J. Autom. Reason. 58(1), 149–179 (2017)MathSciNetCrossRefMATHGoogle Scholar
  16. 16.
    Chlipala, A.J.: Parametric higher-order abstract syntax for mechanized semantics. In: ICFP, pp. 143–156 (2008)Google Scholar
  17. 17.
    Despeyroux, J., Felty, A., Hirschowitz, A.: Higher-order abstract syntax in Coq. In: Dezani-Ciancaglini, M., Plotkin, G. (eds.) TLCA 1995. LNCS, vol. 902, pp. 124–138. Springer, Heidelberg (1995). doi: 10.1007/BFb0014049 CrossRefGoogle Scholar
  18. 18.
    Felty, A.P., Momigliano, A.: Hybrid - a definitional two-level approach to reasoning with higher-order abstract syntax. J. Autom. Reason. 48(1), 43–105 (2012)CrossRefMATHGoogle Scholar
  19. 19.
    Fiore, M., Plotkin, G., Turi, D.: Abstract syntax and variable binding (extended abstract). In: LICS 1999, pp. 193–202 (1999)Google Scholar
  20. 20.
    Gabbay, M.J.: A general mathematics of names. Inf. Comput. 205(7), 982–1011 (2007)MathSciNetCrossRefMATHGoogle Scholar
  21. 21.
    Gheri, L., Popescu, A.: This Paper’s Homepage. http://andreipopescu.uk/papers/BindingTheory.html
  22. 22.
    Gheri, L., Popescu, A.: A formalized general theory of syntax with bindings. CoRR (2017)Google Scholar
  23. 23.
    Gordon, A.D., Melham, T.: Five axioms of alpha-conversion. In: Goos, G., Hartmanis, J., Leeuwen, J., Wright, J., Grundy, J., Harrison, J. (eds.) TPHOLs 1996. LNCS, vol. 1125, pp. 173–190. Springer, Heidelberg (1996). doi: 10.1007/BFb0105404 CrossRefGoogle Scholar
  24. 24.
    Gunter, E.L., Osborn, C.J., Popescu, A.: Theory support for weak higher order abstract syntax in Isabelle/HOL. In: LFMTP, pp. 12–20 (2009)Google Scholar
  25. 25.
    Harper, R., Honsell, F., Plotkin, G.: A framework for defining logics. In: LICS 1987, pp. 194–204. IEEE Computer Society Press (1987)Google Scholar
  26. 26.
    Hennessy, M., Milner, R.: On observing nondeterminism and concurrency. In: Bakker, J., Leeuwen, J. (eds.) ICALP 1980. LNCS, vol. 85, pp. 299–309. Springer, Heidelberg (1980). doi: 10.1007/3-540-10003-2_79 CrossRefGoogle Scholar
  27. 27.
    Hirschowitz, A., Maggesi, M.: Nested abstract syntax in Coq. J. Autom. Reason. 49(3), 409–426 (2012)MathSciNetCrossRefMATHGoogle Scholar
  28. 28.
    Kammüller, F., Wenzel, M., Paulson, L.C.: Locales a sectioning concept for Isabelle. In: Bertot, Y., Dowek, G., Théry, L., Hirschowitz, A., Paulin, C. (eds.) TPHOLs 1999. LNCS, vol. 1690, pp. 149–165. Springer, Heidelberg (1999). doi: 10.1007/3-540-48256-3_11 CrossRefGoogle Scholar
  29. 29.
    Keisler, H.J.: Model Theory for Infinitary Logic. North-Holland, Amsterdam (1971)MATHGoogle Scholar
  30. 30.
    Lochbihler, A.: Java and the Java memory model — a unified, machine-checked formalisation. In: Seidl, H. (ed.) ESOP 2012. LNCS, vol. 7211, pp. 497–517. Springer, Heidelberg (2012). doi: 10.1007/978-3-642-28869-2_25 CrossRefGoogle Scholar
  31. 31.
    Luttik, B.: Choice quantification in process algebra. Ph.D. thesis, University of Amsterdam, April 2002Google Scholar
  32. 32.
    Miller, D., Tiu, A.: A proof theory for generic judgments. ACM Trans. Comput. Logic 6(4), 749–783 (2005)MathSciNetCrossRefMATHGoogle Scholar
  33. 33.
    Milner, R.: Communication and Concurrency. Prentice Hall, Upper Saddle River (1989)MATHGoogle Scholar
  34. 34.
    Milner, R.: Communicating and Mobile Systems: The \(\pi \)-Calculus. Cambridge University Press, Cambridge (2001)MATHGoogle Scholar
  35. 35.
    Nipkow, T., Klein, G.: Concrete Semantics: With Isabelle/HOL. Springer, Heidelberg (2014). doi: 10.1007/978-3-319-10542-0 CrossRefMATHGoogle Scholar
  36. 36.
    Nipkow, T., von Oheimb, D.: Java\({}_{\text{light}}\) is type-safe - definitely. In: POPL, pp. 161–170 (1998)Google Scholar
  37. 37.
    Nipkow, T., Paulson, L.C., Wenzel, M.: Isabelle/HOL: A Proof Assistant for Higher-Order Logic. Springer, Heidelberg (2002). doi: 10.1007/3-540-45949-9 CrossRefMATHGoogle Scholar
  38. 38.
    Norrish, M.: Mechanising lambda-calculus using a classical first order theory of terms with permutations. High.-Order Symb. Comput. 19(2–3), 169–195 (2006)CrossRefMATHGoogle Scholar
  39. 39.
    Norrish, M., Vestergaard, R.: Proof pearl: de bruijn terms really do work. In: Schneider, K., Brandt, J. (eds.) TPHOLs 2007. LNCS, vol. 4732, pp. 207–222. Springer, Heidelberg (2007). doi: 10.1007/978-3-540-74591-4_16 CrossRefGoogle Scholar
  40. 40.
    Pitts, A.M.: Nominal logic: a first order theory of names and binding. In: Kobayashi, N., Pierce, B.C. (eds.) TACS 2001. LNCS, vol. 2215, pp. 219–242. Springer, Heidelberg (2001). doi: 10.1007/3-540-45500-0_11 CrossRefGoogle Scholar
  41. 41.
    Pitts, A.M.: Alpha-structural recursion and induction. J. ACM 53(3), 459–506 (2006)MathSciNetCrossRefMATHGoogle Scholar
  42. 42.
    Popescu, A.: Contributions to the theory of syntax with bindings and to process algebra. Ph.D. thesis, University of Illinois (2010). andreipopescu.uk/thesis.pdf
  43. 43.
    Popescu, A., Gunter, E.L.: Incremental pattern-based coinduction for process algebra and its isabelle formalization. In: Ong, L. (ed.) FoSSaCS 2010. LNCS, vol. 6014, pp. 109–127. Springer, Heidelberg (2010). doi: 10.1007/978-3-642-12032-9_9 CrossRefGoogle Scholar
  44. 44.
    Popescu, A., Gunter, E.L.: Recursion principles for syntax with bindings and substitution. In: ICFP, pp. 346–358 (2011)Google Scholar
  45. 45.
    Popescu, A., Gunter, E.L., Osborn, C.J.: Strong normalization of system F by HOAS on top of FOAS. In: LICS, pp. 31–40 (2010)Google Scholar
  46. 46.
    Popescu, A., Hölzl, J., Nipkow, T.: Proving concurrent noninterference. In: Hawblitzel, C., Miller, D. (eds.) CPP 2012. LNCS, vol. 7679, pp. 109–125. Springer, Heidelberg (2012). doi: 10.1007/978-3-642-35308-6_11 CrossRefGoogle Scholar
  47. 47.
    Popescu, A., Hölzl, J., Nipkow, T.: Formalizing probabilistic noninterference. In: Gonthier, G., Norrish, M. (eds.) CPP 2013. LNCS, vol. 8307, pp. 259–275. Springer, Cham (2013). doi: 10.1007/978-3-319-03545-1_17 CrossRefGoogle Scholar
  48. 48.
    Popescu, A., Rosu, G.: Term-generic logic. Theor. Comput. Sci. 577, 1–24 (2015)MathSciNetCrossRefMATHGoogle Scholar
  49. 49.
    Schropp, A., Popescu, A.: Nonfree datatypes in Isabelle/HOL. In: Gonthier, G., Norrish, M. (eds.) CPP 2013. LNCS, vol. 8307, pp. 114–130. Springer, Cham (2013). doi: 10.1007/978-3-319-03545-1_8 CrossRefGoogle Scholar
  50. 50.
    Sewell, P., Nardelli, F.Z., Owens, S., Peskine, G., Ridge, T., Sarkar, S., Strnisa, R.: Ott: effective tool support for the working semanticist. J. Funct. Program. 20(1), 71–122 (2010)CrossRefMATHGoogle Scholar
  51. 51.
    Slind, K., Norrish, M.: A brief overview of HOL4. In: Mohamed, O.A., Muñoz, C., Tahar, S. (eds.) TPHOLs 2008. LNCS, vol. 5170, pp. 28–32. Springer, Heidelberg (2008). doi: 10.1007/978-3-540-71067-7_6 CrossRefGoogle Scholar
  52. 52.
    Sun, Y.: An algebraic generalization of frege structures–binding algebras. Theor. Comput. Sci. 211(1–2), 189–232 (1999)MathSciNetCrossRefMATHGoogle Scholar
  53. 53.
    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
  54. 54.
    Urban, C.: Nominal techniques in Isabelle/HOL. J. Autom. Reason. 40(4), 327–356 (2008)MathSciNetCrossRefMATHGoogle Scholar
  55. 55.
    Urban, C., Berghofer, S., Norrish, M.: Barendregt’s variable convention in rule inductions. In: Pfenning, F. (ed.) CADE 2007. LNCS, vol. 4603, pp. 35–50. Springer, Heidelberg (2007). doi: 10.1007/978-3-540-73595-3_4 CrossRefGoogle Scholar
  56. 56.
    Urban, C., Kaliszyk, C.: General bindings and alpha-equivalence in nominal Isabelle. In: Barthe, G. (ed.) ESOP 2011. LNCS, vol. 6602, pp. 480–500. Springer, Heidelberg (2011). doi: 10.1007/978-3-642-19718-5_25 CrossRefGoogle Scholar
  57. 57.
    Urban, C., Tasson, C.: Nominal techniques in Isabelle/HOL. In: Nieuwenhuis, R. (ed.) CADE 2005. LNCS (LNAI), vol. 3632, pp. 38–53. Springer, Heidelberg (2005). doi: 10.1007/11532231_4 CrossRefGoogle Scholar

Copyright information

© Springer International Publishing AG 2017

Authors and Affiliations

  1. 1.Department of Computer ScienceMiddlesex UniversityLondonUK
  2. 2.Institute of Mathematics Simion Stoilow of the Romanian AcademyBucharestRomania

Personalised recommendations