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

### Cached

### Download Links

- [adam.chlipala.net]
- [www.cs.berkeley.edu]
- DBLP

### Other Repositories/Bibliography

Citations: | 20 - 2 self |

### BibTeX

@MISC{Chlipala08parametrichigher-order,

author = {Adam Chlipala},

title = {Parametric Higher-Order Abstract Syntax for Mechanized Semantics},

year = {2008}

}

### Years of Citing Articles

### OpenURL

### Abstract

We present parametric higher-order abstract syntax (PHOAS), a new approach to formalizing the syntax of programming languages in computer proof assistants based on type theory. Like higherorder abstract syntax (HOAS), PHOAS uses the meta language’s binding constructs to represent the object language’s binding constructs. Unlike HOAS, PHOAS types are definable in generalpurpose type theories that support traditional functional programming, like Coq’s Calculus of Inductive Constructions. We walk through how Coq can be used to develop certified, executable program transformations over several statically-typed functional programming languages formalized with PHOAS; that is, each transformation has a machine-checked proof of type preservation and semantic preservation. Our examples include CPS translation and closure conversion for simply-typed lambda calculus, CPS translation for System F, and translation from a language with ML-style pattern matching to a simpler language with no variable-arity binding constructs. By avoiding the syntactic hassle associated with first-order representation techniques, we achieve a very high degree of proof automation.

### Citations

470 | P.: Interactive Theorem Proving and Program Development. Coq’Art: The Calculus of Inductive Constructions - Bertot, Castéran - 2004 |

420 | Isabelle: A generic theorem prover
- Paulson
- 1994
(Show Context)
Citation Context ...metatheory that drew many solutions employing many different binder representation strategies. The solutions were largely split between implementations in Coq (Bertot and Castéran2004) and Isabelle (=-=Paulson 1994-=-) using first-order variable representations, and solutions in Twelf (Pfenning and Schürmann 1999) using higher-order abstract syntax (Pfenning and Elliot 1988). The first-order proofs required much m... |

313 | System description: Twelf — a meta-logical framework for deductive systems
- Pfenning, Schürmann
- 1999
(Show Context)
Citation Context ... strategies. The solutions were largely split between implementations in Coq (Bertot and Castéran2004) and Isabelle (Paulson 1994) using first-order variable representations, and solutions in Twelf (=-=Pfenning and Schürmann 1999-=-) using higher-order abstract syntax (Pfenning and Elliot 1988). The first-order proofs required much more verbosity surrounding bookkeeping about variables, but the Twelf implementations involved mor... |

303 | N.: Lambda Calculus Notation with Nameless Dummies, a Tool for Automatic Formula Manipulation.; Indag - Bruijn - 1972 |

302 |
Higher-order abstract syntax
- Pfenning, Elliot
- 1988
(Show Context)
Citation Context ...ions in Coq (Bertot and Castéran2004) and Isabelle (Paulson 1994) using first-order variable representations, and solutions in Twelf (Pfenning and Schürmann 1999) using higher-order abstract syntax (=-=Pfenning and Elliot 1988-=-). The first-order proofs required much more verbosity surrounding bookkeeping about variables, but the Twelf implementations involved more tedious proving for the lemmas that would actually appear in... |

226 | Formal certification of a compiler back-end or: programming a compiler with a proof assistant - Leroy - 2006 |

137 | Mechanized metatheory for the masses: The PoplMark challenge - Aydemir, Bohannon, et al. - 2005 |

123 | Primitive recursion for higherorder abstract syntax
- Despeyroux, Pfenning, et al.
- 1997
(Show Context)
Citation Context ... are called exotic terms. There are a number of tricks for building HOAS encodings that rule out exotic terms, including meta language enhancements based on new type systems (Fegaras and Sheard 1996; =-=Schürmann et al. 2001-=-). The technique that we will use, PHOAS, does not require such enhancements. It is essentially a melding of weak HOAS (Despeyroux et al. 1995; Honsell et al. 2001) and the “boxes go bananas” (BGB) (W... |

96 | Semantical analysis of higher-order abstract syntax - Hofmann - 1999 |

89 | A type-theoretic interpretation of Standard ML
- Harper, Stone
- 1998
(Show Context)
Citation Context ...ut of a translation has the same meaning as the input. Following our past approach (Chlipala 2007), we choose a denotational style of meaning assignment that has been called type-theoretic semantics (=-=Harper and Stone 2000-=-). That is, we provide definitional compilers from all of the languages we formalize into CIC, and we construct machine-checked proofs using Coq’s very good built-in support for reasoning about the te... |

82 | Nominal techniques in Isabelle/HOL
- Urban
(Show Context)
Citation Context ...proof assistants, including studies using nominal syntax with two classes of variables in LEGO (Mckinna and Pollack 1999), de Bruijn indices in LEGO (Altenkirch 1993), nominal syntax in Isabelle/HOL (=-=Urban and Tasson 2005-=-), and locally nameless syntax in Coq (Aydemir et al. 2008). All of these first-order approaches involve extra syntactic bookkeeping in the definition of functions over syntax and the statement and pr... |

68 | Explicit polymorphism and CPS conversion
- Harper, Lillibridge
- 1993
(Show Context)
Citation Context ...the new type translation: ⌊·⌋ : ∀T : ⋆. type(T ) → cpsType(T ) ⌊|α|⌋ = |α| ⌊bool⌋ = bool ⌊τ1 → τ2⌋ = (⌊τ1⌋ × (⌊τ2⌋ → 0)) → 0 ⌊∀τ⌋ = ∀α. (⌊τ(α)⌋ → 0) → 0 We apply a standard double negation transform (=-=Harper and Lillibridge 1993-=-) to ∀ types, which moves the type’s body into a position where we can quantify over its free type variable without ⌊·⌋ : ∀T : ⋆. ∀V : cpsType(T ) → ⋆. ∀τ : type(T ). term(T , V ◦ ⌊·⌋) τ → cpsTerm(T ,... |

54 | Revisiting catamorphism over datatypes with embedded functions
- Fegaras, Sheard
- 1996
(Show Context)
Citation Context ... Counterexamples like bad are called exotic terms. There are a number of tricks for building HOAS encodings that rule out exotic terms, including meta language enhancements based on new type systems (=-=Fegaras and Sheard 1996-=-; Schürmann et al. 2001). The technique that we will use, PHOAS, does not require such enhancements. It is essentially a melding of weak HOAS (Despeyroux et al. 1995; Honsell et al. 2001) and the “box... |

52 | R.: Some lambda calculus and type theory formalized
- McKinna, Pollack
- 1999
(Show Context)
Citation Context ...iables. There have been many studies of the classic first-order variable binding representations within proof assistants, including studies using nominal syntax with two classes of variables in LEGO (=-=Mckinna and Pollack 1999-=-), de Bruijn indices in LEGO (Altenkirch 1993), nominal syntax in Isabelle/HOL (Urban and Tasson 2005), and locally nameless syntax in Coq (Aydemir et al. 2008). All of these first-order approaches in... |

46 |
A type-theoretic foundation for programming with higher-order abstract syntax and first-class substitutions
- Pientka
- 2008
(Show Context)
Citation Context ...s, with examples like the term equivalence judgments parameterized on variable contexts. There have been several approaches proposed for functional programming over HOAS terms (Schürmann et al. 2001; =-=Pientka 2008-=-), but they all involve creating new type systems rather than working within a generalpurpose type theory like CIC, and their implementations are still immature and lacking in the kind of “proof assis... |

44 | Fully reflexive intensional type analysis - Trifonov, Saha, et al. - 2000 |

41 |
A certified type-preserving compiler from lambda calculus to assembly language
- Chlipala
- 2007
(Show Context)
Citation Context ...seems less fundamental, though certainly much more is known about proof assistant support for the logics at the cores of Isabelle and Coq than about such support for Twelf’s meta-logic. In past work (=-=Chlipala 2007-=-), we tackled these representation issues in the context of compiler verification. Language metatheory problems are popular as benchmarks because they can admit relatively straightforward pencil-and-p... |

39 |
A Formalization of the Strong Normalization Proof for System F
- Altenkirch
- 1993
(Show Context)
Citation Context ...rst-order variable binding representations within proof assistants, including studies using nominal syntax with two classes of variables in LEGO (Mckinna and Pollack 1999), de Bruijn indices in LEGO (=-=Altenkirch 1993-=-), nominal syntax in Isabelle/HOL (Urban and Tasson 2005), and locally nameless syntax in Coq (Aydemir et al. 2008). All of these first-order approaches involve extra syntactic bookkeeping in the defi... |

34 | Combining higher order abstract syntax with tactical theorem proving and (co)induction
- Ambler, Crole, et al.
- 2002
(Show Context)
Citation Context ...ith de Bruijn indices or another first-order technique at the lowest level, but a HOAS interface is built on top, including convenient induction principles. This has been implemented in Isabelle/HOL (=-=Ambler et al. 2002-=-), Nuprl (Barzilay and Allen 2002), Coq (Capretta and Felty 2006), and MetaPRL (Hickey et al. 2006). PHOAS has a close qualitative connection to these approaches, as it also allows switching between f... |

34 | A tactic language for the system Coq
- Delahaye
- 2000
(Show Context)
Citation Context ... possible, to minimize the overhead of adding new features to a language and its certified implementation. Towards this end, we have implemented a number of new tactics using Coq’s tactical language (=-=Delahaye 2000-=-). This is a dynamically-typed language whose most important feature is a very general construct for pattern matching on CIC terms and proof sequents, with a novel backtracking semantics for pattern m... |

33 | Compiler verification: a bibliography - Dave |

21 | André Hirschowitz. Higher-order abstract syntax in Coq - Despeyroux, Felty - 1995 |

19 | An axiomatic approach to metareasoning on nominal algebras in hoas
- Honsell, Miculan, et al.
(Show Context)
Citation Context ... systems (Fegaras and Sheard 1996; Schürmann et al. 2001). The technique that we will use, PHOAS, does not require such enhancements. It is essentially a melding of weak HOAS (Despeyroux et al. 1995; =-=Honsell et al. 2001-=-) and the “boxes go bananas” (BGB) (Washburn and Weirich 2008) HOAS technique. We can illustrate the central ideas by modifying our example type definition for this section so that Coq will accept it ... |

13 | A type-preserving compiler in Haskell - Guillemette, Monnier - 2008 |

12 | Combining de Bruijn indices and higher-order abstract syntax in Coq
- Capretta, Felty
- 2007
(Show Context)
Citation Context ...he lowest level, but a HOAS interface is built on top, including convenient induction principles. This has been implemented in Isabelle/HOL (Ambler et al. 2002), Nuprl (Barzilay and Allen 2002), Coq (=-=Capretta and Felty 2006-=-), and MetaPRL (Hickey et al. 2006). PHOAS has a close qualitative connection to these approaches, as it also allows switching between first-order and higherorder views of terms, as demonstrated in ou... |

8 |
Mechanized meta-reasoning using a hybrid HOAS/de Bruijn representation and reflection
- Hickey, Nogin, et al.
- 2006
(Show Context)
Citation Context ...s built on top, including convenient induction principles. This has been implemented in Isabelle/HOL (Ambler et al. 2002), Nuprl (Barzilay and Allen 2002), Coq (Capretta and Felty 2006), and MetaPRL (=-=Hickey et al. 2006-=-). PHOAS has a close qualitative connection to these approaches, as it also allows switching between first-order and higherorder views of terms, as demonstrated in our closure conversion. We already m... |

7 | Reflecting higher-order abstract syntax in Nuprl
- Barzilay, Allen
- 2002
(Show Context)
Citation Context ...ther first-order technique at the lowest level, but a HOAS interface is built on top, including convenient induction principles. This has been implemented in Isabelle/HOL (Ambler et al. 2002), Nuprl (=-=Barzilay and Allen 2002-=-), Coq (Capretta and Felty 2006), and MetaPRL (Hickey et al. 2006). PHOAS has a close qualitative connection to these approaches, as it also allows switching between first-order and higherorder views ... |

4 | X.: Mechanized verification of CPS transformations - Dargaye, Leroy |

2 | Yasuhiko Minamide and Koji Okuma. Verifying CPS transformations in Isabelle/HOL - Moore - 2003 |