Abstract
Attribute grammars decorate the nodes of a program's parse tree with attributes whose values are defined by equations encoding the (static) semantics of a programming language. We show how replacing the equations of an attribute grammar with equivalent constraints that can be solved by a constraint solver allows us to compute repairs of a malformed program solely from a specification that was originally designed for checking its well-formedness. We present two repair modes --- shallow and deep fixing --- whose computed repair alternatives are guaranteed to repair every error on which they are invoked. While shallow fixing may introduce new errors, deep fixing never does; to make it tractable, we implement it using neighborhood search. We demonstrate the feasibility of our approach by implementing it on top of ExtendJ, an attribute grammar based Java compiler, and by applying it to an example from the Java EE context, detecting and fixing well-formedness errors (both real and injected) in a body of 14 open-source subject programs.
- J. T. Boyland. Remote attribute grammars. J. ACM, 52(4): 627–687, 2005. doi: 10.1145/1082036.1082042. Google Scholar
Digital Library
- Y. Brun, R. Holmes, M. D. Ernst, and D. Notkin. Speculative analysis: exploring future development states of software. In Proceedings of the Workshop on Future of Software Engineering Research, FoSER 2010, at the 18th ACM SIGSOFT International Symposium on Foundations of Software Engineering, 2010, Santa Fe, NM, USA, November 7-11, 2010, pages 59–64, 2010. doi: 10.1145/1882362.1882375. Google Scholar
Digital Library
- F. Demarco, J. Xuan, D. L. Berre, and M. Monperrus. Automatic repair of buggy if conditions and missing preconditions with SMT. In Proceedings of the 6th International Workshop on Constraints in Software Testing, Verification, and Analysis, CSTVA 2014, Hyderabad, India, May 31, 2014, pages 30–39, 2014. Google Scholar
Digital Library
- P. Deransart and J. Maluszynski. Relating logic programs and attribute grammars. J. Log. Program., 2(2):119–155, 1985. doi: 10.1016/0743-1066(85)90015-9.Google Scholar
Cross Ref
- W. Dietl, S. Dietzel, M. D. Ernst, K. Muslu, and T. W. Schiller. Building and using pluggable type-checkers. In Proceedings of the 33rd International Conference on Software Engineering, ICSE 2011, Waikiki, Honolulu, HI, USA, May 21-28, 2011, pages 681–690, 2011. doi: 10.1145/1985793.1985889. Google Scholar
Digital Library
- A. Egyed, E. Letier, and A. Finkelstein. Generating and evaluating choices for fixing inconsistencies in UML design models. In 23rd IEEE/ACM International Conference on Automated Software Engineering (ASE 2008), 15-19 September 2008, L’Aquila, Italy, pages 99–108, 2008. doi: 10.1109/ASE. 2008.20. Google Scholar
Digital Library
- T. Ekman and G. Hedin. The JastAdd extensible Java compiler. In Proceedings of the 22nd Annual ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications, OOPSLA 2007, October 21-25, 2007, Montreal, Quebec, Canada, pages 1–18, 2007. Google Scholar
Digital Library
- S. Erdweg, T. van der Storm, M. Völter, L. Tratt, R. Bosman, W. R. Cook, A. Gerritsen, A. Hulshout, S. Kelly, A. Loh, G. D. P. Konat, P. J. Molina, M. Palatnik, R. Pohjonen, E. Schindler, K. Schindler, R. Solmi, V. A. Vergu, E. Visser, K. van der Vlist, G. Wachsmuth, and J. van der Woning. Evaluating and comparing language workbenches: Existing results and benchmarks for the future. Computer Languages, Systems & Structures, 44:24–47, 2015. Google Scholar
Digital Library
- M. Fowler. Domain-Specific Languages. The Addison-Wesley signature series. Addison-Wesley, 2011. ISBN 978-0-321- 71294-3.Google Scholar
- E. C. Freuder and A. K. Mackworth, editors. Constraint-Based Reasoning. The MIT Press, 1994. Google Scholar
Digital Library
- D. Gopinath, M. Z. Malik, and S. Khurshid. Specificationbased program repair using SAT. In Tools and Algorithms for the Construction and Analysis of Systems - 17th International Conference, TACAS 2011, Held as Part of the Joint European Conferences on Theory and Practice of Software, ETAPS 2011, Saarbrücken, Germany, March 26-April 3, 2011. Proceedings, pages 173–188, 2011. Google Scholar
Digital Library
- J. Gosling. Algebraic Constraints. PhD thesis, Department of Computer Science, Carngeie-Mellon University, 1983. CMUCS-83-132. Google Scholar
Digital Library
- G. Gottlob, G. Greco, and T. Mancini. Conditional constraint satisfaction: Logical foundations and complexity. In IJCAI 2007, Proceedings of the 20th International Joint Conference on Artificial Intelligence, Hyderabad, India, January 6-12, 2007, pages 88–93, 2007. Google Scholar
Digital Library
- G. Hedin. Reference attributed grammars. Informatica (Slovenia), 24(3), 2000.Google Scholar
- G. Hedin and E. Magnusson. Jastadd–an aspect-oriented compiler construction system. Sci. Comput. Program., 47 (1):37–58, 2003. doi: 10.1016/S0167-6423(02)00109-0. Google Scholar
Digital Library
- P. V. Hentenryck and L. Michel. Constraint-based local search. MIT Press, 2005. ISBN 978-0-262-22077-4. Google Scholar
Digital Library
- T. Hottelier and R. Bodík. Synthesis of layout engines from relational constraints. In Proceedings of the 2015 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications, OOPSLA 2015, part of SLASH 2015, Pittsburgh, PA, USA, October 25-30, 2015, pages 74–88, 2015. doi: 10.1145/2814270.2814291. Google Scholar
Digital Library
- M. Jourdan. An optimal-time recursive evaluator for attribute grammars. In International Symposium on Programming, 6th Colloquium, Toulouse, April 17-19, 1984, Proceedings, pages 167–178, 1984. doi: 10.1007/3-540-12925-1_37. Google Scholar
Digital Library
- D. E. Knuth. Semantics of context-free languages. Mathematical Systems Theory, 2(2):127–145, 1968. doi: 10.1007/ BF01692511.Google Scholar
Cross Ref
- Linda DeMichiel. JSR 317: Java Persistence API, Version 2.0. JSR Specification, online at https://jcp.org/en/jsr/detail?id=317.Google Scholar
- S. Markstrum, D. Marino, M. Esquivel, T. D. Millstein, C. Andreae, and J. Noble. Javacop: Declarative pluggable types for java. ACM Trans. Program. Lang. Syst., 32(2), 2010. doi: 10.1145/1667048.1667049. Google Scholar
Digital Library
- K. Muslu, Y. Brun, R. Holmes, M. D. Ernst, and D. Notkin. Speculative analysis of integrated development environment recommendations. In Proceedings of the 27th Annual ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications, OOPSLA 2012, part of SPLASH 2012, Tucson, AZ, USA, October 21-25, 2012, pages 669–682, 2012. doi: 10.1145/2384616.2384665. Google Scholar
Digital Library
- C. Nentwich, W. Emmerich, and A. Finkelstein. Consistency management with repair actions. In Proceedings of the 25th International Conference on Software Engineering, May 3-10, 2003, Portland, Oregon, USA, pages 455–464, 2003. Google Scholar
Digital Library
- H. D. T. Nguyen, D. Qi, A. Roychoudhury, and S. Chandra. Semfix: program repair via semantic analysis. In 35th International Conference on Software Engineering, ICSE ’13, San Francisco, CA, USA, May 18-26, 2013, pages 772–781, 2013. Google Scholar
Digital Library
- J. Palsberg and M. I. Schwartzbach. Object-oriented type systems. Wiley professional computing. Wiley, 1994. ISBN 978-0-471-94128-6. Google Scholar
Digital Library
- A. Reder and A. Egyed. Computing repair trees for resolving inconsistencies in design models. In IEEE/ACM International Conference on Automated Software Engineering, ASE’12, Essen, Germany, September 3-7, 2012, pages 220–229, 2012. doi: 10.1145/2351676.2351707. Google Scholar
Digital Library
- H. Samimi, M. Schäfer, S. Artzi, T. D. Millstein, F. Tip, and L. J. Hendren. Automated repair of HTML generation errors in PHP applications using string constraint solving. In 34th International Conference on Software Engineering, ICSE 2012, June 2-9, 2012, Zurich, Switzerland, pages 277–287, 2012. doi: 10.1109/ICSE.2012.6227186. Google Scholar
Digital Library
- M. Schäfer, A. Thies, F. Steimann, and F. Tip. A comprehensive approach to naming and accessibility in refactoring Java programs. IEEE Trans. Software Eng., 38(6):1233–1257, 2012. Google Scholar
Digital Library
- doi: 10.1109/TSE.2012.13.Google Scholar
- F. Steimann. From well-formedness to meaning preservation: model refactoring for almost free. Software and System Modeling, 14(1):307–320, 2015. doi: 10.1007/s10270-013-0314-z. Google Scholar
Digital Library
- F. Steimann. Refactoring and beyond. In R. Lämmel, J. Saraiva, and J. Visser, editors, Grand and Timely Topics in Software Engineering V, International Summer School, GTTSE 2015, Braga, Portugal, July, 2015. Revised Papers, Lecture Notes in Computer Science. Springer, 2017. In preparation.Google Scholar
- F. Steimann and B. Ulke. Generic model assist. In Model-Driven Engineering Languages and Systems - 16th International Conference, MODELS 2013, Miami, FL, USA, September 29 - October 4, 2013. Proceedings, pages 18–34, 2013. Google Scholar
Digital Library
- doi: 10.1007/978-3-642-41533-3_2.Google Scholar
- F. Steimann and J. von Pilgrim. Constraint-based refactoring with foresight. In ECOOP 2012 - Object-Oriented Programming - 26th European Conference, Beijing, China, June 11-16, 2012. Proceedings, pages 535–559, 2012. Google Scholar
Digital Library
- F. Steimann, C. Kollee, and J. von Pilgrim. A refactoring constraint language and its application to Eiffel. In ECOOP 2011 - Object-Oriented Programming - 25th European Conference, Lancaster, UK, July 25-29, 2011 Proceedings, pages 255–280, 2011. doi: 10.1007/978-3-642-22655-7_13. Google Scholar
Digital Library
- F. Tip, R. M. Fuhrer, A. Kiezun, M. D. Ernst, I. Balaban, and B. D. Sutter. Refactoring using type constraints. ACM Trans. Program. Lang. Syst., 33(3):9, 2011. doi: 10.1145/1961204. Google Scholar
Digital Library
- 1961205.Google Scholar
- B. Ulke and F. Steimann. OCL as a constraint generation language. In Proceedings of the MODELS 2013 OCL Workshop co-located with the 16th International ACM/IEEE Conference on Model Driven Engineering Languages and Systems (MODELS 2013), Miami, USA, September 30, 2013.Google Scholar
- , pages 93–102, 2013.Google Scholar
- H. van Antwerpen, P. Neron, A. P. Tolmach, E. Visser, and G. Wachsmuth. A constraint language for static semantic analysis based on scope graphs. In Proceedings of the 2016 ACM SIGPLAN Workshop on Partial Evaluation and Program Manipulation, PEPM 2016, St. Petersburg, FL, USA, January 20 - 22, 2016, pages 49–60, 2016. Google Scholar
Digital Library
- W. M. Waite and G. Goos. Compiler Construction. Texts and Monographs in Computer Science. Springer, 1984. ISBN 978-1-4612-9731-4. doi: 10.1007/978-1-4612-5192-7. Google Scholar
Digital Library
- D. A. Watt and O. L. Madsen. Extended attribute grammars. The Computer Journal, 26(2):142–153, 1983.Google Scholar
Cross Ref
- B. T. V. Zanden. Constraint grammars-a new model for specifying graphical applications. In Proceedings of the SIGCHI Conference on Human Factors in Computing Systems, CHI 1989, Austin, Texas, USA, April 30 - June 4, 1989, pages 325–330, 1989. doi: 10.1145/67449.67513. Google Scholar
Digital Library
- B. T. V. Zanden, B. A. Myers, D. A. Giuse, and P. A. Szekely. Integrating pointer variables into one-way constraint models. ACM Trans. Comput.-Hum. Interact., 1(2):161–213, 1994. doi: 10.1145/180171.180174. Google Scholar
Digital Library
Index Terms
Computing repair alternatives for malformed programs using constraint attribute grammars
Recommendations
Computing repair alternatives for malformed programs using constraint attribute grammars
OOPSLA 2016: Proceedings of the 2016 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and ApplicationsAttribute grammars decorate the nodes of a program's parse tree with attributes whose values are defined by equations encoding the (static) semantics of a programming language. We show how replacing the equations of an attribute grammar with equivalent ...
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 ...
Modular natural language processing using declarative attribute grammars
MICAI'11: Proceedings of the 10th Mexican international conference on Advances in Artificial Intelligence - Volume Part IA system based on a general top-down parsing algorithm has been developed which allows language processors to be created as executable specifications of arbitrary attribute grammars. Declarative notation of attribute grammars allows modular construction ...







Comments