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.
- }}B. Arbab. Compiling Circular Attribute Grammars Into Prolog. IBM Journal of Research and Development, 30(3):294--309, 1986. Google Scholar
Digital Library
- }}J. T. Boyland. Conditional Attribute Grammars. ACM Transactions on Programming Languages and Systems, 18(1):73--108, 1996. Google Scholar
Digital Library
- }}A. Dijkstra and S. D. Swierstra. Typing Haskell with an Attribute Grammar. In AFP, pages 1--72, 2004. Google Scholar
Digital Library
- }}A. Dijkstra and S. D. Swierstra. Ruler: Programming Type Rules. In FLOPS, pages 30--46, 2006. Google Scholar
Digital Library
- }}A. Dijkstra, J. Fokker, and S. D. Swierstra. The Architecture of the Utrecht Haskell Compiler. In Haskell, pages 93--104, 2009. Google Scholar
Digital Library
- }}T. Ekman and G. Hedin. The JastAdd Extensible Java Compiler. In OOPSLA, pages 1--18, 2007. Google Scholar
Digital Library
- }}J. Engelfriet and G. Filé. Passes, sweeps, and visits in attribute grammars. Journal of the ACM, 36(4):841--869, 1989. Google Scholar
Digital Library
- }}J. Fokker and S. D. Swierstra. Abstract Interpretation of Functional Programs using an Attribute Grammar System. ENTCS, 238(5):117--133, 2009. Google Scholar
Digital Library
- }}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. Google Scholar
Digital Library
- }}L. G. Jones. Efficient Evaluation of Circular Attribute Grammars. ACM Transactions on Programming Languages and Systems, 12(3):429--462, 1990. Google Scholar
Digital Library
- }}U. Kastens. Ordered Attributed Grammars. Acta Informatica, 13:229--256, 1980.Google Scholar
Digital Library
- }}L. C. L. Kats, A. M. Sloane, and E. Visser. Decorated Attribute Grammars: Attribute Evaluation Meets Strategic Programming. In CC, pages 142-- 157, 2009. Google Scholar
Digital Library
- }}K. Kennedy and S. K. Warren. Automatic Generation of Efficient Evaluators for Attribute Grammars. In POPL, pages 32--49, 1976. Google Scholar
Digital Library
- }}D. E. Knuth. Semantics of Context-Free Languages. Mathematical Systems Theory, 2(2):127--145, 1968.Google Scholar
Cross Ref
- }}A. Middelkoop, A. Dijkstra, and S. D. Swierstra. Towards Dependently Typed Attribute Grammars. http://people.cs.uu.nl/ariem/ifl10-depend.pdf, 2010a.Google Scholar
- }}A. Middelkoop, A. Dijkstra, and S. D. Swierstra. Iterative Type Inference with Attribute Grammars. http://people.cs.uu.nl/ariem/ wgt10-journal.pdf, 2010b.Google Scholar
- }}J. Saraiva. Component-Based Programming for Higher-Order Attribute Grammars. In GPCE, pages 268--282, 2002. Google Scholar
Digital Library
- }}J. A. B. V. Saraiva and S. D. Swierstra. Purely Functional Implementation of Attribute Grammars. Technical report, Universiteit Utrecht, 1999.Google Scholar
- }}S. D. Swierstra and P. R. A. Alcocer. Attribute grammars in the functional style. In Systems Implementation 2000, pages 180--193, 1998. Google Scholar
Digital Library
- }}Universiteit Utrecht.Universiteit Utrecht Attribute Grammar System. http://www.cs.uu.nl/wiki/HUT/AttributeGrammarSystem, 1998.Google Scholar
- }}E. v. Wyk, D. Bodin, J. Gao, and L. Krishnan.Silver: an Extensible Attribute Grammar System. ENTCS, 203(2):103--116, 2008. Google Scholar
Digital Library
- }}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. Google Scholar
Digital Library
- }}H. Vogt, S. D. Swierstra, and M. F. Kuiper. Higher-Order Attribute Grammars. In PLDI, pages 131--145, 1989.. Google Scholar
Digital Library
Index Terms
Iterative type inference with attribute grammars
Recommendations
Iterative type inference with attribute grammars
GPCE '10: Proceedings of the ninth international conference on Generative programming and component engineeringType 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 ...
A Classification of Noncircular Attribute Grammars Based on the Look-Ahead Behavior
We propose a family of static evaluators for subclasses of the well-defined (i.e., noncircular) attribute grammars. These evaluators augment the evaluator for the absolutely noncircular attribute grammars with look-ahead behaviors. Because this family ...
The Interpretation of Meta Grammars Describing Syntax-Directed Interpreters Using an Attribute Grammar Interpreter
A syntax-directed interpreter of attribute grammars is applied to interpret meta grammars describing translators. A specific example is used which concerns the formal description of the same syntax-directed interpreter of attribute grammars for ...







Comments