Hostname: page-component-cd9895bd7-jn8rn Total loading time: 0 Render date: 2024-12-26T07:58:54.089Z Has data issue: false hasContentIssue false

The representational adequacy of Hybrid

Published online by Cambridge University Press:  30 March 2011

R. L. CROLE*
Affiliation:
Department of Computer Science, University of Leicester, University Road, Leicester, LE1 7RH, United Kingdom Email: R.Crole@mcs.le.ac.uk

Abstract

The Hybrid system (Ambler et al. 2002b), implemented within Isabelle/HOL, allows object logics to be represented using higher order abstract syntax (HOAS), and reasoned about using tactical theorem proving in general, and principles of (co)induction in particular. The form of HOAS provided by Hybrid is essentially a lambda calculus with constants.

Of fundamental interest is the form of the lambda abstractions provided by Hybrid. The user has the convenience of writing lambda abstractions using names for the binding variables. However, each abstraction is actually a definition of a de Bruijn expression, and Hybrid can unwind the user's abstractions (written with names) to machine friendly de Bruijn expressions (without names). In this sense the formal system contains a hybrid of named and nameless bound variable notation.

In this paper, we present a formal theory in a logical framework, which can be viewed as a model of core Hybrid, and state and prove that the model is representationally adequate for HOAS. In particular, it is the canonical translation function from λ-expressions to Hybrid that witnesses adequacy. We also prove two results that characterise how Hybrid represents certain classes of λ-expression.

We provide the first detailed proof to be published that proper locally nameless de Bruijn expressions and α-equivalence classes of λ-expressions are in bijective correspondence. This result is presented as a form of de Bruijn representational adequacy, and is a key component of the proof of Hybrid adequacy.

The Hybrid system contains a number of different syntactic classes of expression, and associated abstraction mechanisms. Hence, this paper also aims to provide a self-contained theoretical introduction to both the syntax and key ideas of the system. Although this paper will be of considerable interest to those who wish to work with Hybrid in Isabelle/HOL, a background in automated theorem proving is not essential.

Type
Paper
Copyright
Copyright © Cambridge University Press 2011

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

References

Aczel, P. (1977) An Introduction to Inductive Definitions. In: Handbook of Mathematical Logic. (Latest impression, 1993.)Google Scholar
Ambler, S. J., Crole, R. L. and Momigliano, A. (2002a) A Hybrid Encoding of Howe's Method for Establishing Congruence of Bisimilarity. (Extended Abstract). In: Proceedings of the Third International Workshop on Logical Frameworks and Meta-Languages (LFM'02). Electronic Notes in Theoretical Computer Science 70 (2).Google Scholar
Ambler, S. J., Crole, R. L. and Momigliano, A. (2002b) Combining Higher Order Abstract Syntax with Tactical Theorem Proving and (Co)Induction. In: Proceedings of the 15th International Conference on Theorem Proving in Higher Order Logics. Springer-Verlag Lecture Notes in Computer Science 2410 1330.CrossRefGoogle Scholar
Ambler, S. J., Crole, R. L. and Momigliano, A. (2004) A Combinator and Presheaf Topos Model for Primitive Recursion over Higher Order Abstract Syntax. In: Baaz, M., Makowsky, J. and Voronkov, A. (eds.) Computer Science Logic/8th Kurt Godel Colloquium Poster Collection, Vienna, August 2003. Collegium Logicum (Proceedings of the Kurt Godel Society), KGS Publications 8390.Google Scholar
Anderson, P. and Pfenning, F. (2004) Verifying Uniqueness in a Logical Framework. In: Proceedings of the 17th International Conference on Theorem Proving in Higher Order Logics. Springer-Verlag Lecture Notes in Computer Science 3223.Google Scholar
Aydemir, B. E., Charguéraud, A., Pierce, B. C., Pollack, R. and Weirich, S. (2008) Engineering Formal Metatheory. SIGPLAN Notices 43 (1)315.CrossRefGoogle Scholar
Berghofer, S. and Urban, C. (2007) A Head-to-Head Comparison of de Bruijn Indices and Names. In: Proceedings of the First International Workshop on Logical Frameworks and Meta-Languages: Theory and Practice (LFMTP 2006). Electronic Notes in Theoretical Computer Science 174 (5)5367.CrossRefGoogle Scholar
Berghofer, S., Cheney, J. and Urban, C. (2008) Mechanizing the Metatheory of LF. In: Proc. of the 23rd IEEE Symposium on Logic in Computer Science (LICS 2008), IEEE Computer Society 4556.Google Scholar
Berghofer, S., Cheney, J. and Urban, C. (2010) Mechanizing the Metatheory of LF. Technical report, Edinburgh and Munich.Google Scholar
Capretta, V. and Felty, A. (2007) Combining de Bruijn Indices and Higher-Order Abstract Syntax in Coq. In: Altenkirch, T. and McBride, C. (eds.) Proceedings of TYPES 2006. Springer-Verlag Lecture Notes in Computer Science 45026377.Google Scholar
Capretta, V. and Felty, A. (2009) Higher Order Abstract Syntax in Type Theory. In: Cooper, S. B., Geuvers, H., Pillay, A. and Väänänen, J. (eds.) Logic Colloquium 2006. Lecture Notes in Logic 32, Cambridge University Press 6590.Google Scholar
Cheney, J. (2009) A Simple Nominal Type Theory. Electronic Notes in Computer Science 228 3752.CrossRefGoogle Scholar
Clouston, R. (2010) Equational Logic for Names and Binders, Ph.D. thesis, University of Cambridge Computer Laboratory.Google Scholar
Clouston, R. A. and Pitts, A. M. (2007) Nominal equational logic. In: Cardelli, L., Fiore, M. and Winskel, G. (eds.) Computation, Meaning and Logic, Articles dedicated to Gordon Plotkin. Electronic Notes in Theoretical Computer Science 1496 223257.Google Scholar
Crole, R. L. (1998) Lectures on [Co]Induction and [Co]Algebras. Technical Report 1998/12, Department of Mathematics and Computer Science, University of Leicester.Google Scholar
Crole, R. L. (2010) α-Equivalence Equalities.Google Scholar
deBruijn, N. Bruijn, N. (1972) Lambda Calculus Notation with Nameless Dummies: a Tool for Automatic Formula Manipulation, with Application to the Church Rosser Theorem. Indagationes Mathematicae 34 (5)381392.Google Scholar
Despeyroux, J., Felty, A. and Hirschowitz, A. (1995) Higher-order abstract syntax in Coq. In: Dezani-Ciancaglini, M. and Plotkin, G. (eds.) Proceedings of the International Conference on Typed Lambda Calculi and Applications. Springer-Verlag Lecture Notes in Computer Science 902124138.Google Scholar
Despeyroux, J. and Leleu, P. (2000) Metatheoretic results for a modal λ-calculus. Journal of Functional and Logic Programming 1.Google Scholar
Despeyroux, J., Pfenning, F. and Schürmann, C. (1997) Primitive recursion for higher-order abstract syntax. In: Hindley, R. (ed.) Proceedings of the Third International Conference on Typed Lambda Calculus and Applications (TLCA'97). Springer-Verlag Lecture Notes in Computer Science 1210147163. (An extended version is available as Technical Report CMU-CS-96-172, Carnegie Mellon University.)Google Scholar
Felty, A. (2002a) Interactive Theorem Proving in Twelf. The Association of Logic Programming Newsletter 15 (3).Google Scholar
Felty, A. (2002b) Two-level Meta-reasoning in Coq. In: Carreño, V. A. (ed.) Proceedings of the 15th International Conference on Theorem Proving in Higher Order Logics. Springer-Verlag Lecture Notes in Computer Science 2342.Google Scholar
Felty, A. and Pientka, B. (2010) Reasoning with Higher-Order Abstract Syntax and Contexts: A Comparison. In: Kaufmann, M. and Paulson, L. (eds.) International Conference on Interactive Theorem Proving. Springer-Verlag Lecture Notes in Computer Science 6172228243.Google Scholar
Felty, A. P. and Momigliano, A. (2009) Reasoning with Hypothetical Judgments and Open Terms in Hybrid. In: PPDP '09: Proceedings of the 11th ACM SIGPLAN conference on Principles and practice of declarative programming, ACM 8392.CrossRefGoogle Scholar
Felty, A. P. and Momigliano, A. (2010) Hybrid – A Definitional Two-Level Approach to Reasoning with Higher-Order Abstract Syntax. Journal of Automated Reasoning 1–63.Google Scholar
Fiore, M., Plotkin, G. D. and Turi, D. (1999) Abstract Syntax and Variable Binding. In: Proceedings of the 14th Annual Symposium on Logic in Computer Science (LICS'99), IEEE Computer Society Press 193202.Google Scholar
Fiore, M. P. (2006) On the structure of substitution. Invited address for the 22nd Mathematical Foundations of Programming Semantics Conference (MFPS XXII), DISI, University of Genova, Italy.Google Scholar
Ford, J. and Mason, I. A. (2001) Operational Techniques in PVS – A Preliminary Evaluation. In: Proceedings of the Australasian Theory Symposium, CATS '01.CrossRefGoogle Scholar
Gabbay, M. and Mathijssen, A. (2008) Capture-Avoiding Substitution as a Nominal Algebra (journal version). Formal Aspects of Computing 20 (4-5)451479.CrossRefGoogle Scholar
Gabbay, M. and Mathijssen, A. (2010) A Nominal Axiomatisation of the Lambda-Calculus. Journal of Logic and Computation 20 (2)501531.CrossRefGoogle Scholar
Gabbay, M. and Pitts, A. (1999) A New Approach to Abstract Syntax Involving Binders. In: Longo, G. (ed.) Proceedings of the 14th Annual Symposium on Logic in Computer Science (LICS'99), IEEE Computer Society Press 214224.Google Scholar
Gabbay, M. J. and Pitts, A. M. (2002) A New Approach to Abstract Syntax with Variable Binding. Formal Aspects of Computing 13 341363.CrossRefGoogle Scholar
Gacek, A. (2008) The Abella Interactive Theorem Prover (System Description). In: Armando, A., Baumgartner, P. and Dowek, G. (eds.) Proceedings of IJCAR. Springer-Verlag Lecture Notes in Computer Science 5195154161.Google Scholar
Gacek, A., Miller, D. and Nadathur, G. (2008) Combining Generic Judgments with Recursive Definitions. In: Proceedings of the Twenty-Third Annual IEEE Symposium on Logic in Computer Science, LICS 2008, IEEE Computer Society 3344.Google Scholar
Gordon, A. (1994) A Mechanisation of Name-Carrying Syntax up to Alpha-Conversion. In: Joyce, J. J. and Seger, C.-J. H. (eds.) International Workshop on Higher Order Logic Theorem Proving and its Applications. Springer-Verlag Lecture Notes in Computer Science 780 414427.Google Scholar
Gordon, A. D. and Melham, T. (1996) Five Axioms of Alpha-Conversion. In: von Wright, J., Grundy, J. and Harrison, J. (eds.) Proceedings of the 9th International Conference on Theorem Proving in Higher Order Logics (TPHOLs'96). Springer-Verlag Lecture Notes in Computer Science 1125173190.Google Scholar
Hallnas, L. (1991) Partial Inductive Definitions. Theoretical Computer Science 87 (1)115147.CrossRefGoogle Scholar
Harper, R., Honsell, F. and Plotkin, G. (1987) A Framework for Defining Logics. In: Proceedings, Symposium on Logic in Computer Science, Ithaca, New York, IEEE Computer Society Press 194204.Google Scholar
Harper, R., Honsell, F. and Plotkin, G. (1993) A Framework for Defining Logics. Journal of the Association for Computing Machinery 40 (1)143184.CrossRefGoogle Scholar
Harper, R. and Licata, D. R. (2007) Mechanizing Metatheory in a Logical Framework. Journal of Functional Programming 17 (4-5)613673.CrossRefGoogle Scholar
Harper, R. and Pfenning, F. (2005) On Equivalence and Canonical Forms in the LF Type Theory. Transactions on Computational Logic 6 61101.CrossRefGoogle Scholar
Hindley, J. and Seldin, J. (1988) Introduction to Combinators and the Lambda Calculus, London Mathematical Society Student Texts 1, Cambridge University Press.Google Scholar
Hofmann, M. (1999) Semantical Analysis of Higher-Order Abstract Syntax. In: Proceedings of 14th Annual IEEE Symposium on Logic in Computer Science, LICS'99, Trento, Italy, IEEE Computer Society Press 204213.Google Scholar
Honsell, F., Miculan, M. and Scagnetto, I. (2001a) An axiomatic approach to metareasoning on systems in higher-order abstract syntax. In: Proceedings ICALP'01. Springer-Verlag Lecture Notes in Computer Science 2076 963978.CrossRefGoogle Scholar
Honsell, F., Miculan, M. and Scagnetto, I. (2001b) Π-calculus in (Co)Inductive Type Theories. Theoretical Computer Science 2 (253)239285.CrossRefGoogle Scholar
Honsell, F., Miculan, M. and Scagnetto, I. (2005) Translating Specifications from Nominal Logic to CIC with the Theory of Contexts. In: Pollack, R. (ed.) MERLIN'05, Mechanized Reasoning about Languages with Variable Binding 2005 Workshop, ACM Digital Library.Google Scholar
Huet, G. P. (1994) Residual Theory in Lambda-Calculus: a Formal Development. Journal of Functional Programming 4 (3)371394.CrossRefGoogle Scholar
Lakin, M. R. and Pitts, A. M. (2007) A Metalanguage for Structural Operational Semantics. In: Morazán, M. (ed.) Eighth Symposium on Trends in Functional Programming (TFP 2007), Intellect 1935.Google Scholar
McDowell, R. (1997) Reasoning in a Logic with Definitions and Induction, Ph.D. thesis, University of Pennsylvania.Google Scholar
McDowell, R. and Miller, D. (1997) A Logic for Reasoning with Higher-Order Abstract Syntax: An Extended Abstract. In: Winskel, G. (ed.) Proceedings of the Twelfth Annual Symposium on Logic in Computer Science, IEEE Computer Society Press 434445.CrossRefGoogle Scholar
McDowell, R. and Miller, D. (2002) Reasoning with Higher-Order Abstract Syntax in a Logical Framework. ACM Transactions on Computational Logic 3 (1)80136.CrossRefGoogle Scholar
McKinna, J. and Pollack, R. (1999) Some Lambda Calculus and Type Theory Formalized. Journal of Automated Reasoning 23 (3-4)373409.CrossRefGoogle Scholar
Melham, T. F. (1994) A Mechanized Theory of the π-Calculus in HOL. Nordic Journal of Computing 1 (1)5076.Google Scholar
Miculan, M. (2001) Developing (Meta)Theory of Lambda-Calculus in the Theory of Contexts. In: Ambler, S., Crole, R. and Momigliano, A. (eds.) MERLIN 2001: Proceedings of the Workshop on MEchanized Reasoning about Languages with variable bINding. Electronic Notes in Theoretical Computer Science 58122.Google Scholar
Miller, D. (2006) Representing and reasoning with operational semantics. In: Furbach, U. and Shankar, N. (eds.) Automated Reasoning: Third International Joint Conference, IJCAR 2006. Springer-Verlag Lecture Notes in Computer Science 4130420.Google Scholar
Momigliano, A. and Ambler, S. J. (2003) Multi-Level Meta-Reasoning with Higher Order Abstract Syntax. In: Gordon, A. D. (ed.) Foundations of Software Science and Computation Structures. Springer-Verlag Lecture Notes in Computer Science 2620375391.Google Scholar
Momigliano, A., Ambler, S. J. and Crole, R. L. (2001) A Comparison of Formalizations of the Meta-Theory of a Language with Variable Bindings in Isabelle. In: Boulton, R. J. and Jackson, P. B. (eds.) Supplemental Proceedings of the 14th International Conference on Theorem Proving in Higher Order Logics, Report EDI-INF-RR-0046 267–282.Google Scholar
Momigliano, A., Martin, A. J. and Felty, A. P. (2009) Two-level Hybrid: A System for Reasoning using Higher Order Abstract Syntax. In: Proceedings of the International Workshop on Logical Frameworks and Meta-Languages: Theory and Practice (LFMTP 2008). Electronic Notes in Theoretical Computer Science 196 8593.CrossRefGoogle Scholar
Nipkow, T. (2001) More Church-Rosser Proofs (in Isabelle/HOL). Journal of Automated Reasoning 26 5166.CrossRefGoogle Scholar
Norrish, M. and Vestergaard, R. (2007) Proof Pearl: de Bruijn Terms Really Do Work. In: Schneider, K. and Brandt, J. (eds.) Theorem Proving in Higher Order Logics, 20th International Conference. Springer-Verlag Lecture Notes in Computer Science 4732207222.Google Scholar
Paulson, L. (1997) ML for the Working Programmer, Second Edition, Cambridge University Press.Google Scholar
Pfenning, F. (2003) Computation and deduction. (Available from: http://www.cs.cmu.edu/~twelf/notes/cd.ps.)Google Scholar
Pfenning, F. and Elliott, C. (1988) Higher-Order Abstract Syntax. In: Proceedings of the ACM SIGPLAN '88 Symposium on Language Design and Implementation 199208.CrossRefGoogle Scholar
Pfenning, F. and Schürmann, C. (1999) System Description: Twelf – A Meta-Logical Framework for Deductive Systems. In: Ganzinger, H. (ed.) Proceedings of the 16th International Conference on Automated Deduction (CADE-16). Springer-Verlag Lecture Notes in Artificial Intelligence 1632202206.Google Scholar
Pitts, A. M. (2001) Nominal Logic: A First Order Theory of Names and Binding. In: Kobayashi, N. and Pierce, B. C. (eds.) Proceedings: Theoretical Aspects of Computer Software, 4th International Symposium, TACS 2001. Springer-Verlag Lecture Notes in Computer Science 2215219242.Google Scholar
Pitts, A. M. (2003) Nominal Logic, a First Order Theory of Names and Binding. Information and Computation 186 165193.CrossRefGoogle Scholar
Pitts, A. M. (2006) Alpha-Structural Recursion and Induction. Journal of the ACM 53 459506.CrossRefGoogle Scholar
Shankar, N. (1988) A Mechanical Proof of the Church–Rosser Theorem. ACM 35 (3)475522.Google Scholar
Shinwell, M. R. and Pitts, A. M. (2005) Fresh Objective Caml User Manual. Technical Report UCAM-CL-TR-621, University of Cambridge Computer Laboratory.Google Scholar
Shinwell, M. R., Pitts, A. M. and Gabbay, M. J. (2003) FreshML: Programming with Binders Made Simple. In: Eighth ACM SIGPLAN International Conference on Functional Programming (ICFP 2003), Uppsala, Sweden, ACM Press 263274.CrossRefGoogle Scholar
Urban, C. (2008) Nominal Techniques in Isabelle/HOL. Journal of Automated Reasoning 40 (4)327356.CrossRefGoogle Scholar
Urban, C., Pitts, A. M. and Gabbay, M. J. (2004) Nominal unification. Theoretical Computer Science 323 473497.CrossRefGoogle Scholar
Urban, C. and Tasson, C. (2005) Nominal Techniques in Isabelle/HOL. In: Nieuwenhuis, R. (ed.) Proceedings of the 20th Conference on Automated Deduction (CADE 2005), Tallinn, Estonia. Springer-Verlag Lecture Notes in Computer Science 36323853.Google Scholar
vanDalen, D. Dalen, D. (1989) Logic and Structure, Third Edition, Corrected Third Printing, Universitext, Springer-Verlag.Google Scholar
Vestergaard, R. and Brotherson, J. (2001) A Formalized First-Order Conflence Proof for the λ-Calculus using One Sorted Variable Names. In: Middelrop, A. (ed.) Proceedings of RTA'12. Springer-Verlag Lecture Notes in Computer Science 2051 306321.Google Scholar