TitleHAMPI: A solver for word equations over strings, regular expressions, and context-free grammars
Publication TypeJournal Article
Year of Publication2012
AuthorsKieżun A, Ganesh V, Artzi S, Guo PJ, Hooimeijer P, Ernst MD
JournalACM Transactions on Software Engineering and Methodology
Volume21
Pagination25:1–25:28
Date or Month PublishedNovember
AbstractMany automatic testing, analysis, and verification techniques for programs can be effectively reduced to a constraint-generation phase followed by a constraint-solving phase. This separation of concerns often leads to more effective and maintainable software reliability tools. The increasing efficiency of off-the-shelf constraint solvers makes this approach even more compelling. However, there are few effective and sufficiently expressive off-the-shelf solvers for string constraints generated by analysis of string-manipulating programs, so researchers end up implementing their own ad-hoc solvers. \par To fulfill this need, we designed and implemented Hampi, a solver for string constraints over bounded string variables. Users of Hampi specify constraints using regular expressions, context-free grammars, equality between string terms, and typical string operations such as concatenation and substring extraction. Hampi then finds a string that satisfies all the constraints or reports that the constraints are unsatisfiable. \par We demonstrate Hampi's expressiveness and efficiency by applying it to program analysis and automated testing. We used Hampi in static and dynamic analyses for finding SQL injection vulnerabilities in Web applications with hundreds of thousands of lines of code. We also used Hampi in the context of automated bug finding in C programs using dynamic systematic testing (also known as concolic testing). We then compared Hampi with another string solver, CFGAnalyzer, and show that Hampi is several times faster. Hampi's source code, documentation, and experimental data are available at \urlhttps://people.csail.mit.edu/akiezun/hampi/
Downloadshttps://people.csail.mit.edu/akiezun/hampi/ HAMPI implementation and experiments https://homes.cs.washington.edu/~mernst/pubs/string-solver-tosem2012.pdf ISSTA 2009 slides (PDF) https://homes.cs.washington.edu/~mernst/pubs/string-solver-tosem2012.pdf PDF
Citation KeyKiezunGAGHE2012