Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1145/1868294.1868302acmconferencesArticle/Chapter ViewAbstractPublication PagesgpceConference Proceedingsconference-collections
research-article

Iterative type inference with attribute grammars

Published: 10 October 2010 Publication History

Abstract

Type inference is the process of constructing a typing derivation while gradually discovering type information. During this process, inference algorithms typically make subtle decisions based on the derivation constructed so far.
Because a typing derivation is a decorated tree we aim to use attribute grammars as the main implementation tool. Unfortunately, we can neither express iteration, nor express decisions based on intermediate derivations in such grammars.
We present the language ruler-front, a conservative extension to ordered attribute grammars, that deals with the aforementioned problems. We show why this extension is suitable for the description of constraint-based inference algorithms.

References

[1]
}}B. Arbab. Compiling Circular Attribute Grammars Into Prolog. IBM Journal of Research and Development, 30(3):294--309, 1986.
[2]
}}J. T. Boyland. Conditional Attribute Grammars. ACM Transactions on Programming Languages and Systems, 18(1):73--108, 1996.
[3]
}}A. Dijkstra and S. D. Swierstra. Typing Haskell with an Attribute Grammar. In AFP, pages 1--72, 2004.
[4]
}}A. Dijkstra and S. D. Swierstra. Ruler: Programming Type Rules. In FLOPS, pages 30--46, 2006.
[5]
}}A. Dijkstra, J. Fokker, and S. D. Swierstra. The Architecture of the Utrecht Haskell Compiler. In Haskell, pages 93--104, 2009.
[6]
}}T. Ekman and G. Hedin. The JastAdd Extensible Java Compiler. In OOPSLA, pages 1--18, 2007.
[7]
}}J. Engelfriet and G. Filé. Passes, sweeps, and visits in attribute grammars. Journal of the ACM, 36(4):841--869, 1989.
[8]
}}J. Fokker and S. D. Swierstra. Abstract Interpretation of Functional Programs using an Attribute Grammar System. ENTCS, 238(5):117--133, 2009.
[9]
}}P. Hudak, S. L. P. Jones, P. Wadler, B. Boutel, J. Fairbairn, J. H. Fasel, M. M. Guzmán, K. Hammond, J. Hughes, T. Johnsson, R. B. Kieburtz, R. S. Nikhil, W. Partain, and J. Peterson. Report on the Programming Language Haskell, A Non-strict, Purely Functional Language. SIGPLAN Notices, 27(5):1--, 1992.
[10]
}}L. G. Jones. Efficient Evaluation of Circular Attribute Grammars. ACM Transactions on Programming Languages and Systems, 12(3):429--462, 1990.
[11]
}}U. Kastens. Ordered Attributed Grammars. Acta Informatica, 13:229--256, 1980.
[12]
}}L. C. L. Kats, A. M. Sloane, and E. Visser. Decorated Attribute Grammars: Attribute Evaluation Meets Strategic Programming. In CC, pages 142-- 157, 2009.
[13]
}}K. Kennedy and S. K. Warren. Automatic Generation of Efficient Evaluators for Attribute Grammars. In POPL, pages 32--49, 1976.
[14]
}}D. E. Knuth. Semantics of Context-Free Languages. Mathematical Systems Theory, 2(2):127--145, 1968.
[15]
}}A. Middelkoop, A. Dijkstra, and S. D. Swierstra. Towards Dependently Typed Attribute Grammars. http://people.cs.uu.nl/ariem/ifl10-depend.pdf, 2010a.
[16]
}}A. Middelkoop, A. Dijkstra, and S. D. Swierstra. Iterative Type Inference with Attribute Grammars. http://people.cs.uu.nl/ariem/ wgt10-journal.pdf, 2010b.
[17]
}}J. Saraiva. Component-Based Programming for Higher-Order Attribute Grammars. In GPCE, pages 268--282, 2002.
[18]
}}J. A. B. V. Saraiva and S. D. Swierstra. Purely Functional Implementation of Attribute Grammars. Technical report, Universiteit Utrecht, 1999.
[19]
}}S. D. Swierstra and P. R. A. Alcocer. Attribute grammars in the functional style. In Systems Implementation 2000, pages 180--193, 1998.
[20]
}}Universiteit Utrecht.Universiteit Utrecht Attribute Grammar System. http://www.cs.uu.nl/wiki/HUT/AttributeGrammarSystem, 1998.
[21]
}}E. v. Wyk, D. Bodin, J. Gao, and L. Krishnan.Silver: an Extensible Attribute Grammar System. ENTCS, 203(2):103--116, 2008.
[22]
}}M. Viera, S. D. Swierstra, and W. Swierstra. Attribute Grammars Fly First-class: how to do Aspect Oriented Programming in Haskell. In ICFP, pages 245--256, 2009.
[23]
}}H. Vogt, S. D. Swierstra, and M. F. Kuiper. Higher-Order Attribute Grammars. In PLDI, pages 131--145, 1989.

Cited By

View all
  • (2022)Zipping Strategies and Attribute GrammarsFunctional and Logic Programming10.1007/978-3-030-99461-7_7(112-132)Online publication date: 3-May-2022
  • (2018)Memoized zipper-based attribute grammars and their higher order extensionScience of Computer Programming10.1016/j.scico.2018.10.006Online publication date: Nov-2018
  • (2016)Embedding attribute grammars and their extensions using functional zippersScience of Computer Programming10.1016/j.scico.2016.03.005132:P1(2-28)Online publication date: 15-Dec-2016
  • Show More Cited By

Index Terms

  1. Iterative type inference with attribute grammars

    Recommendations

    Comments

    Information & Contributors

    Information

    Published In

    cover image ACM Conferences
    GPCE '10: Proceedings of the ninth international conference on Generative programming and component engineering
    October 2010
    198 pages
    ISBN:9781450301541
    DOI:10.1145/1868294
    • General Chair:
    • Eelco Visser,
    • Program Chair:
    • Jaakko Järvi
    • cover image ACM SIGPLAN Notices
      ACM SIGPLAN Notices  Volume 46, Issue 2
      GPCE '10
      Febuary 2011
      185 pages
      ISSN:0362-1340
      EISSN:1558-1160
      DOI:10.1145/1942788
      Issue’s Table of Contents
    Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

    Sponsors

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 10 October 2010

    Permissions

    Request permissions for this article.

    Check for updates

    Author Tags

    1. attribute grammars
    2. type inference

    Qualifiers

    • Research-article

    Conference

    GPCE'10
    Sponsor:
    GPCE'10: Generative Programming and Component Engineering
    October 10 - 13, 2010
    Eindhoven, The Netherlands

    Acceptance Rates

    GPCE '10 Paper Acceptance Rate 18 of 59 submissions, 31%;
    Overall Acceptance Rate 56 of 180 submissions, 31%

    Upcoming Conference

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)3
    • Downloads (Last 6 weeks)0
    Reflects downloads up to 22 Sep 2024

    Other Metrics

    Citations

    Cited By

    View all
    • (2022)Zipping Strategies and Attribute GrammarsFunctional and Logic Programming10.1007/978-3-030-99461-7_7(112-132)Online publication date: 3-May-2022
    • (2018)Memoized zipper-based attribute grammars and their higher order extensionScience of Computer Programming10.1016/j.scico.2018.10.006Online publication date: Nov-2018
    • (2016)Embedding attribute grammars and their extensions using functional zippersScience of Computer Programming10.1016/j.scico.2016.03.005132:P1(2-28)Online publication date: 15-Dec-2016
    • (2016)Memoized Zipper-Based Attribute GrammarsProgramming Languages10.1007/978-3-319-45279-1_4(46-61)Online publication date: 17-Sep-2016
    • (2014)Generating attribute grammar-based bidirectional transformations from rewrite rulesProceedings of the ACM SIGPLAN 2014 Workshop on Partial Evaluation and Program Manipulation10.1145/2543728.2543745(63-70)Online publication date: 11-Jan-2014
    • (2013)Zipper-Based Attribute Grammars and Their ExtensionsProgramming Languages10.1007/978-3-642-40922-6_10(135-149)Online publication date: 2013
    • (2011)Stepwise evaluation of attribute grammarsProceedings of the Eleventh Workshop on Language Descriptions, Tools and Applications10.1145/1988783.1988788(1-8)Online publication date: 26-Mar-2011
    • (2011)Visitor-based Attribute Grammars with Side EffectElectronic Notes in Theoretical Computer Science (ENTCS)10.1016/j.entcs.2011.06.004264:5(47-69)Online publication date: 1-Jul-2011
    • (2011)Dependently Typed Attribute GrammarsImplementation and Application of Functional Languages10.1007/978-3-642-24276-2_7(105-120)Online publication date: 2011
    • (2010)Dependently typed attribute grammarsProceedings of the 22nd international conference on Implementation and application of functional languages10.5555/2050135.2050142(105-120)Online publication date: 1-Sep-2010
    • Show More Cited By

    View Options

    Get Access

    Login options

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Media

    Figures

    Other

    Tables

    Share

    Share

    Share this Publication link

    Share on social media