Dependently Typed Attribute Grammars

  • Arie Middelkoop
  • Atze Dijkstra
  • S. Doaitse Swierstra
Part of the Lecture Notes in Computer Science book series (LNCS, volume 6647)

Abstract

Attribute Grammars (AGs) are a domain-specific language for functional and composable descriptions of tree traversals. Given such a description, it is not immediately clear how to state and prove properties of AGs formally. To meet this challenge, we apply dependent types to AGs. In a dependently typed AG, the type of an attribute may refer to values of attributes. The type of an attribute is an invariant, the value of an attribute a proof for that invariant. Additionally, when an AG is cycle-free, the composition of the attributes is logically consistent. We present a lightweight approach using a preprocessor in combination with the dependently typed language Agda.

Keywords

Dependent Type Semantic Function Attribute Grammar Cyclic Function Dependent Product 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Bove, A., Dybjer, P.: Dependent Types at Work. In: Bove, A., Barbosa, L.S., Pardo, A., Pinto, J.S. (eds.) Language Engineering and Rigorous Software Development. LNCS, vol. 5520, pp. 57–99. Springer, Heidelberg (2009)CrossRefGoogle Scholar
  2. 2.
    Kastens, U.: Ordered Attributed Grammars. Acta Informatica 13, 229–256 (1980)MathSciNetCrossRefMATHGoogle Scholar
  3. 3.
    Knuth, D.E.: Semantics of Context-Free Languages. Mathematical Systems Theory 2(2), 127–145 (1968)MathSciNetCrossRefMATHGoogle Scholar
  4. 4.
    Middelkoop, A., Dijkstra, A., Swierstra, S.D.: Attribute Grammars with Side Effect. In: HOSC (2010), http://people.cs.uu.nl/ariem/wgt10-journal.pdf
  5. 5.
    Middelkoop, A., Dijkstra, A., Swierstra, S.D.: Iterative Type Inference with Attribute Grammars. In: GPCE 2010, pp. 43–52 (2010)Google Scholar
  6. 6.
    Middelkoop, A., Dijkstra, A., Swierstra, S.D.: Visit Functions for the Semantics of Programming Languages. In: WGT 2010 (2010), http://people.cs.uu.nl/ariem/wgt10-visit.pdf
  7. 7.
    Norell, U.: Dependently-typed Programming in Agda. In: TLDI 2009, pp. 1–2 (2009)Google Scholar
  8. 8.
    Saraiva, J., Swierstra, S.D.: Purely Functional Implementation of Attribute Grammars. Tech. rep., Universiteit Utrecht (1999)Google Scholar
  9. 9.
    Swierstra, S.D., Alcocer, P.R.A.: Attribute Grammars in the Functional Style. In: Systems Implementation 2000, pp. 180–193 (1998)Google Scholar
  10. 10.
    Universiteit Utrecht: Homepage of the Universiteit Utrecht Attribute Grammar System (1998), http://www.cs.uu.nl/wiki/HUT/AttributeGrammarSystem

Copyright information

© Springer-Verlag Berlin Heidelberg 2011

Authors and Affiliations

  • Arie Middelkoop
    • 1
  • Atze Dijkstra
    • 1
  • S. Doaitse Swierstra
    • 1
  1. 1.Universiteit UtrechtThe Netherlands

Personalised recommendations