• Documents
  • Authors
  • Tables
  • Log in
  • Sign up
  • MetaCart
  • DMCA
  • Donate

CiteSeerX logo

Advanced Search Include Citations
Advanced Search Include Citations | Disambiguate

Parametric Higher-Order Abstract Syntax for Mechanized Semantics (2008)

by Adam Chlipala
Add To MetaCart

Tools

Sorted by:
Results 1 - 10 of 42
Next 10 →

A Verified Compiler for an Impure Functional Language

by Adam Chlipala , 2009
"... We present a verified compiler to an idealized assembly language from a small, untyped functional language with mutable references and exceptions. The compiler is programmed in the Coq proof assistant and has a proof of total correctness with respect to bigstep operational semantics for the source a ..."
Abstract - Cited by 38 (3 self) - Add to MetaCart
We present a verified compiler to an idealized assembly language from a small, untyped functional language with mutable references and exceptions. The compiler is programmed in the Coq proof assistant and has a proof of total correctness with respect to bigstep operational semantics for the source and target languages. Compilation is staged and includes standard phases like translation to continuation-passing style and closure conversion, as well as a common subexpression elimination optimization. In this work, our focus has been on discovering and using techniques that make our proofs easy to engineer and maintain. While most programming language work with proof assistants uses very manual proof styles, all of our proofs are implemented as adaptive programs in Coq’s tactic language, making it possible to reuse proofs unchanged as new language features are added. In this paper, we focus especially on phases of compilation that rearrange the structure of syntax with nested variable binders. That aspect has been a key challenge area in past compiler verification projects, with much more effort expended in the statement and proof of binder-related lemmas than is found in standard penciland-paper proofs. We show how to exploit the representation technique of parametric higher-order abstract syntax to avoid the need to prove any of the usual lemmas about binder manipulation, often leading to proofs that are actually shorter than their pencil-andpaper analogues. Our strategy is based on a new approach to encoding operational semantics which delegates all concerns about substitution to the meta language, without using features incompatible with general-purpose type theories like Coq’s logic.

A Definitional Two-Level Approach to Reasoning with Higher-Order Abstract Syntax

by Amy Felty, Alberto Momigliano - Journal of Automated Reasoning , 2010
"... Abstract. Combining higher-order abstract syntax and (co)-induction in a logical framework is well known to be problematic. Previous work [ACM02] described the implementation of a tool called Hybrid, within Isabelle HOL, syntax, and reasoned about using tactical theorem proving and principles of (co ..."
Abstract - Cited by 23 (4 self) - Add to MetaCart
Abstract. Combining higher-order abstract syntax and (co)-induction in a logical framework is well known to be problematic. Previous work [ACM02] described the implementation of a tool called Hybrid, within Isabelle HOL, syntax, and reasoned about using tactical theorem proving and principles of (co)induction. Moreover, it is definitional, which guarantees consistency within a classical type theory. The idea is to have a de Bruijn representation of syntax, while offering tools for reasoning about them at the higher level. In this paper we describe how to use it in a multi-level reasoning fashion, similar in spirit to other meta-logics such as Linc and Twelf. By explicitly referencing provability in a middle layer called a specification logic, we solve the problem of reasoning by (co)induction in the presence of non-stratifiable hypothetical judgments, which allow very elegant and succinct specifications of object logic inference rules. We first demonstrate the method on a simple example, formally proving type soundness (subject reduction) for a fragment of a pure functional language, using a minimal intuitionistic logic as the specification logic. We then prove an analogous result for a continuation-machine presentation of the operational semantics of the same language, encoded this time in an ordered linear logic that serves as the specification layer. This example demonstrates the ease with which we can incorporate new specification logics, and also illustrates a significantly
(Show Context)

Citation Context

...-calculus and closure-conversion in functional programming. 27 For the record, the by now standard terminology “weak” HOAS was coined by the second author of the present paper in [MAC01]. 41Chlipala =-=[Chl08]-=- recently introduced an alternate axiomatic approach to reasoning with weak HOAS. Object-level terms are identified as meta-terms belonging to an inductive type family, where the type of terms is para...

Syntax for free: Representing syntax with binding using parametricity

by Robert Atkey - OF LECTURE NOTES IN COMPUTER SCIENCE , 2009
"... We show that, in a parametric model of polymorphism, the type ∀α.((α → α) → α) → (α → α → α) → α is isomorphic to closed de Bruijn terms. That is, the type of closed higher-order abstract syntax terms is isomorphic to a concrete representation. To demonstrate the proof we have constructed a mode ..."
Abstract - Cited by 17 (5 self) - Add to MetaCart
We show that, in a parametric model of polymorphism, the type ∀α.((α → α) → α) → (α → α → α) → α is isomorphic to closed de Bruijn terms. That is, the type of closed higher-order abstract syntax terms is isomorphic to a concrete representation. To demonstrate the proof we have constructed a model of parametric polymorphism inside the Coq proof assistant. The proof of the theorem requires parametricity over Kripke relations. We also investigate some variants of this representation.
(Show Context)

Citation Context

...abstract, so that inhabitants cannot inspect their variables. Hofmann [9] analysed this construction in the setting of presheaves, using a presheaf of variables for ν. Following on from [6], Chlipala =-=[3]-=- noticed that, if the meta language has parametric polymorphism, then the type ∀ν.τWH (ν) can be used to represent λ-terms, but he did not have a proof. He called this technique parameterised higher-o...

LNgen: Tool Support for Locally Nameless Representations

by Brian Aydemir, Stephanie Weirich
"... Given the complexity of the metatheoretic reasoning involved with current programming languages and their type systems, techniques for mechanical formalization and checking of the metatheory have received much recent attention. In previous work, we advocated a combination of locally nameless represe ..."
Abstract - Cited by 16 (5 self) - Add to MetaCart
Given the complexity of the metatheoretic reasoning involved with current programming languages and their type systems, techniques for mechanical formalization and checking of the metatheory have received much recent attention. In previous work, we advocated a combination of locally nameless representation and cofinite quantification as a lightweight style for carrying out such formalizations in the Coq proof assistant. As part of the presentation of that methodology, we described a number of operations associated with variable binding and listed a number of properties, called “infrastructure lemmas, ” about those operations that needed to be shown. The proofs of these infrastructure lemmas are generally straightforward, given a specification of the binding structure of the language. In this work, we present LNgen, a prototype tool for automatically generating these definitions, lemmas, and proofs from Ott-like language specifications. Furthermore, the tool also generates a recursion scheme for defining functions over syntax, which was not available in our previous work. We also show the soundness and completeness of our tool’s output. For untyped lambda terms, we prove the adequacy of our representation with respect to a fully concrete representation, and we argue that the representation is complete—that we generate the right set of lemmas—with respect to Gordon and Melham’s “Five Axioms of Alpha-Conversion. ” Finally, we claim that our recursion scheme is simpler to work with than either Gordon and Melham’s recursion scheme or the recursion scheme of Nominal Logic. 1.
(Show Context)

Citation Context

...received much recent attention. One question that is foremost on any mechanization is the treatment of binding. Many tools exist to aid in this practice—Hybrid (Momigliano et al. 2008), Lambda Tamer (=-=Chlipala 2008-=-), Nominal-Isabelle (Urban and Berghofer 2008), Twelf (Pfenning and Schürmann 1999)—as well as many representation techniques—de Bruijn indices (1972), locally named (McKinna and Pollack 1999), locall...

Meta-theory à la carte

by Benjamin Delaware, Bruno C. D. S. Oliveira, Tom Schrijvers - In POPL ’13 , 2013
"... Formalizing meta-theory, or proofs about programming languages, in a proof assistant has many well-known benefits. However, the considerable effort involved in mechanizing proofs has prevented it from becoming standard practice. This cost can be amortized by reusing as much of an existing formalizat ..."
Abstract - Cited by 13 (3 self) - Add to MetaCart
Formalizing meta-theory, or proofs about programming languages, in a proof assistant has many well-known benefits. However, the considerable effort involved in mechanizing proofs has prevented it from becoming standard practice. This cost can be amortized by reusing as much of an existing formalization as possible when building a new language or extending an existing one. Unfortunately reuse of components is typically ad-hoc, with the language designer cutting and pasting existing definitions and proofs, and expending considerable effort to patch up the results. This paper presents a more structured approach to the reuse of formalizations of programming language semantics through the composition of modular definitions and proofs. The key contribution is the development of an approach to induction for extensible Church encodings which uses a novel reinterpretation of the universal property of folds. These encodings provide the foundation for a framework, formalized in Coq, which uses type classes to automate the composition of proofs from modular components. Several interesting language features, including binders and general recursion, illustrate the capabilities of our framework. We reuse these features to build fully mechanized definitions and proofs for a number of languages, including a version of mini-ML. Bounded induction enables proofs of properties for non-inductive semantic functions, and mediating type classes enable proof adaptation for more feature-rich languages. 1.
(Show Context)

Citation Context

...n the Calculus of (Inductive) Constructions [34, 35]. Ubiquitous higher-order features such as binders and general recursion can also be implemented in MTC. Binders are modeled with a parametric HOAS =-=[7]-=- representation (a first-order representation would be possible too). Because such higher-order featuresrequire general recursion, they cannot be defined inductively using folds. To support these non...

Functional programming with structured graphs

by Bruno C. D. S. Oliveira, William R. Cook - In Proceedings of the 17th ACM SIGPLAN international conference on Functional programming, ICFP ’12 , 2012
"... This paper presents a new functional programming model for graph structures called structured graphs. Structured graphs extend conventional algebraic datatypes with explicit definition and manipulation of cycles and/or sharing, and offer a practical and convenient way to program graphs in functional ..."
Abstract - Cited by 11 (1 self) - Add to MetaCart
This paper presents a new functional programming model for graph structures called structured graphs. Structured graphs extend conventional algebraic datatypes with explicit definition and manipulation of cycles and/or sharing, and offer a practical and convenient way to program graphs in functional programming languages like Haskell. The representation of sharing and cycles (edges) employs recursive binders and uses an encoding inspired by parametric higher-order abstract syntax. Unlike traditional approaches based on mutable references or node/edge lists, well-formedness of the graph structure is ensured statically and reasoning can be done with standard functional programming techniques. Since the binding structure is generic, we can define many useful generic combinators for manipulating structured graphs. We give applications and show how to reason about structured graphs.
(Show Context)

Citation Context

...represent possible sharing points. To provide a convenient and expressive programming interface, structured graphs use a binding representation based on parametric higherorder abstract syntax (PHOAS) =-=[9]-=-. This representation not only ensures well-formedness of the binding structure, but it also allows using standard proofs methods, including structural induction, in proofs for a large class of progra...

Strongly Typed Term Representations in Coq

by Nick Benton, Chung-kil Hur, Andrew Kennedy, Conor McBride - J AUTOM REASONING
"... There are two approaches to formalizing the syntax of typed object languages in a proof assistant or programming language. The extrinsic approach is to first define a type that encodes untyped object expressions and then make a separate definition of typing judgements over the untyped terms. The int ..."
Abstract - Cited by 11 (2 self) - Add to MetaCart
There are two approaches to formalizing the syntax of typed object languages in a proof assistant or programming language. The extrinsic approach is to first define a type that encodes untyped object expressions and then make a separate definition of typing judgements over the untyped terms. The intrinsic approach is to make a single definition that captures well-typed object expressions, so ill-typed expressions cannot even be expressed. Intrinsic encodings are attractive and naturally enforce the requirement that metalanguage operations on object expressions, such as substitution, respect object types. The price is that the metalanguage types of intrinsic encodings and operations involve non-trivial dependency, adding significant complexity. This paper describes intrinsic-style formalizations of both simply-typed and polymorphic languages, and basic syntactic operations thereon, in the Coq proof assistant. The Coq types encoding object-level variables (de Bruijn indices) and terms are indexed by both type and typing environment. One key construction is the boot-strapping of definitions and lemmas about the action of substitutions in terms of similar ones for a simpler notion of renamings. In the simply-typed case, this yields definitions that are free of any use of type equality coercions. In the polymorphic case, some substitution operations do still require type coercions, which we at least partially tame by uniform use of heterogeneous equality.

Programming type-safe transformations using higher-order abstract syntax

by Olivier Savary-Belanger, Stefan Monnier, Brigitte Pientka
"... ..."
Abstract - Cited by 6 (4 self) - Add to MetaCart
Abstract not found

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

by Andrei Popescu , 2010
"... 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 Abst ..."
Abstract - Cited by 5 (4 self) - Add to MetaCart
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
(Show Context)

Citation Context

...h a denotational-semantics flavor) in [46, 67, 14, 47].6 Our work in this chapter, the above HOAS-tailored approaches, as well as [39], the work on Hybrid [13, 92, 95, 43], as well as parametric HOAS =-=[30]-=-, parametricity-based HOAS [70],7 and de-Bruijn-mixed-HOAS [66], fall within strong HOAS. In weak HOAS, some of the convenience is lost, since substitution of terms for variables is not mere function ...

Recursion principles for syntax with bindings and substitution

by Andrei Popescu, Elsa L. Gunter - In ICFP , 2011
"... We characterize the data type of terms with bindings, freshness and substitution, as an initial model in a suitable Horn theory. This characterization yields a convenient recursive definition principle, which we have formalized in Isabelle/HOL and employed in a series of case studies taken from the ..."
Abstract - Cited by 5 (4 self) - Add to MetaCart
We characterize the data type of terms with bindings, freshness and substitution, as an initial model in a suitable Horn theory. This characterization yields a convenient recursive definition principle, which we have formalized in Isabelle/HOL and employed in a series of case studies taken from the λ-calculus literature.
Powered by: Apache Solr
  • About CiteSeerX
  • Submit and Index Documents
  • Privacy Policy
  • Help
  • Data
  • Source
  • Contact Us

Developed at and hosted by The College of Information Sciences and Technology

© 2007-2019 The Pennsylvania State University