Contributions to the Theory of Syntax with Bindings and to Process Algebra

Contributions to the Theory of Syntax with Bindings and to Process Algebra

CONTRIBUTIONS TO THE THEORY OF SYNTAX WITH BINDINGS AND TO PROCESS ALGEBRA BY ANDREI POPESCU DISSERTATION Submitted in partial fulfillment of the requirements for the degree of Doctor of Philosophy in Computer Science in the Graduate College of the University of Illinois at Urbana-Champaign, 2010 Urbana, Illinois Doctoral Committee: Research Associate Professor Elsa Gunter, Chair and Director of Research Professor Gul Agha Associate Professor Grigore Ro¸su Professor Amy Felty, University of Ottawa Abstract We develop a theory of syntax with bindings, focusing on: - methodological issues concerning the convenient representation of syntax; - techniques for recursive definitions and inductive reasoning. Our approach consists of a combination of FOAS (First-Order Abstract Syntax) and HOAS (Higher-Order Abstract Syntax) and tries to take advantage of the best of both worlds. The connection between FOAS and HOAS follows some general patterns and is presented as a (formally certified) statement of adequacy. We also develop a general technique for proving bisimilarity in process algebra Our technique, presented as a formal proof system, is applicable to a wide range of process algebras. The proof system is incremental, in that it allows building incrementally an a priori unknown bisimulation, and pattern-based, in that it works on equalities of process patterns (i.e., universally quantified equations of process terms containing process variables), thus taking advantage of equational reasoning in a \circular" manner, inside coinductive proof loops. All the work presented here has been formalized in the Isabelle theorem prover. The formalization is performed in a general setting: arbitrary many-sorted syntax with bindings and arbitrary SOS-specified process algebra in de Simone format. The usefulness of our techniques is illustrated by several formalized case studies: - a development of call-by-name and call-by-value λ-calculus with constants, including Church- Rosser theorems, connection with de Bruijn representation, connection with other Isabelle formalizations, HOAS representation, and contituation-passing-style (CPS) transformation; - a proof in HOAS of strong normalization for the polymorphic second-order λ-calculus (a.k.a. System F). We also indicate the outline and some details of the formal development. ii to Leili R. Marleene iii Acknowledgments I thank my adviser, Elsa Gunter. Professionally, she has inoculated me with the passion for theorem proving. More personally, but also with a strong professional component, she has provided me with one of the rare examples of people I could \safely" admire, without any reserve. I thank my good friend, Traian S¸erb˘anut¸˘a,who occasionally played the role of an Alyosha Karamazov during turbid times. I thank Grigore Ro¸sufor his mentoring in the first half of this Ph.D., and for his continuous support and friendship. I also thank him for his heroic (but unfortunately failed) attempt to transform me into a morning person. I thank my colleague Ayesha Yasmeen for encouraging me to develop and finish the work reported here. I thank Professor Amy Felty for being an active member in my dissertation committee, and for her inspiring work on Higher-Order Abstract Syntax. I thank Professor Gul Agha for the high intellectual standing of his course on concurrency { taking this course had the effect of a Copernican revolution in the way I regard the topic. I thank Dr. Tom Gambill, at whose courses I have been TAing for a large part of this Ph.D.. He was a very reasonable and caring supervisor { this helped tremendously with my time management. I thank my parents, back home in Romania, to whom I also apologize for taking so long to finish. The research presented in this thesis was supported in part by the NSF Grant #0917218 TC: Small: Formalizing Operator Task Analysis. iv Table of Contents Chapter 1 Context . 1 1.1 Introduction . .1 1.2 Background and some related work . .5 1.3 Conventions, notations and pointers to supporting scripts . .9 1.4 Technical preliminaries . 11 Chapter 2 FOAS . 18 2.1 Introduction . 18 2.2 Induction . 20 2.3 Two problems of rigorous/formal reasoning . 23 2.4 Intermezzo { solving a genuinely \ordinary" problem . 26 2.5 Terms with bindings as an ordinary data type . 31 2.6 More examples . 39 2.7 Pushing the Horn approach even further . 46 2.8 Variations of the Horn-based recursion principle . 48 2.9 Generalization and formalization . 51 2.10 Related work . 80 Chapter 3 HOAS . 88 3.1 Introduction . 88 3.2 The λ-calculus reduction and the System F typing system recalled . 91 3.3 HOAS view of syntax . 93 3.4 HOAS representation of inference . 98 3.5 The HOAS principles at work . 104 3.6 Formalization . 107 3.7 Conclusions and related work . 110 Chapter 4 Process algebra . 118 4.1 Introduction . 118 4.2 Syntax and operational semantics of processes . 121 4.3 The raw coinductive proof system . 124 4.4 Deduction of universally quantified bisimilarity equations . 127 4.5 The scope of our results . 134 4.6 More examples . 138 4.7 Details regarding the Isabelle formalization . 142 4.8 Related work . 145 v Chapter 5 Conclusions and future work . 148 5.1 Lessons learned from formal reasoning . 148 5.2 Future work . 150 References . 153 vi Chapter 1 Context 1.1 Introduction Given the ever increasing complexity of modern software systems, the need for convenient theoretical frameworks for specifying, organizing, and reasoning about such systems has become drastic. (1) A salient feature of many of these systems is the presence of scoping and bindings at the level of their syntax, reflected by higher-order functionals at the level of their mathematical semantics. A sound and clean conceptual setting for the scoping and binding structure typically facilitates a clean semantics and, consequently, the availability of insightful, intuitive and easy to use reasoning mechanisms. In effect, it has been widely recognized in both formal logic and programming language theory that the syntactic structure of formal systems stays in a very tight relationship with the structure of inference, and that inference itself is a process of building \generalized syntax", with binding, scoping and substitution as the main engines. Because of their highly intuitive nature, the subtleties of these engines are too often treated rather non-rigorously in mathematical textbooks, with the expectation that the reader will fill in the details. By contrast, an implementation or a formalization (of a programming language or a logic) has to give a full formal account of these concepts and consequently has to deal with a myriad of details (such as renaming variables to avoid variable capture), which tend to become overwhelming and hinder the access to general ideas or goals. Relatively recently, quite a few logicians and computer scientists became interested in taking these \details" more seriously and organizing them on sound formal principles having in mind not only mathematical rigor, but also the possibility of their hassle-free manipulation in definitions and proofs. First-order abstract syntax (FOAS) is an already traditional methodology for describing the syntax of logics and programming languages. Several recent approaches, notably Nominal Logic and work based on functor categories1 are adapting/generalizing FOAS to give a 1To avoid loading the introduction with long lists of bracketed numbers, we do not to cite any paper in this introduction, deferring citations to the more technical parts of the text. 1 deeper account of the notion of binding, thus going beyond the context-freeness limitation of standard FOAS. Another powerful methodology emerging from these efforts is the so called Higher Order Abstract Syntax (HOAS) approach, which tries to identify (whenever possible) object-level mechanisms with corresponding meta-level mechanisms from the underlying logic. Thus, for instance, the presumptive λ-abstraction from the object system would be represented by λ-abstraction in the meta-logic, so that object-level substitution becomes mere function application { this avoids (or, better said, integrates into the meta-level layer) a great amount of tedious details. One can notice from the above example that, in the context of the host logic being a familiar logic for the development of mathematics such as higher-order logic where bindings have a functional meaning, the HOAS approach may be regarded as an effort to anticipate syntactically as much as possible from the semantics of a language. Indeed, under HOAS, an abstract syntax tree is no longer pure syntax, but features semantic handles; thus, a term λx.E is now represented as an honest-to-goodness function (as its semantics would typically prescribe), able to take inputs and return a result via the substitution mechanism, which now has become function application. (Therefore, the ability to accommodate part of the intended semantics in advance into the syntax on one hand and the ability to perform hassle-free reasoning on that syntax on the other appear as two faces of the same coin.) The HOAS convenience comes with a price though: given that the object system is now integrated in the meta layer, often desired facilities such as structural inductive reasoning are no longer immediately available. Recovering such facilities while retaining the advantages of HOAS is a subject of intensive ongoing research in the HOAS community. This is also a main theme of this dissertation, where HOAS is combined with, and based on, a FOAS representation and machinery. (2) Another feature that becomes increasingly important these days is concurrent behavior, which needs to be accommodated into essentially all modern software systems. Concurrency refuses to obey many paradigms well-established for sequential functional systems, notably domain theory. The gap between the rather straightforward description of concurrent systems by Structural Operational Semantics (SOS) or other similar means and the actual intended semantics, which needs to be filled in by rather elaborate notions of process equivalence such as bisimilarity, testing equivalence or behavioral equivalence (with various flavors), is one of the difficulties in dealing with concurrent systems on a formal basis.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    167 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us