Title
HAMPI: A solver for word equations over strings, regular expressions, and context-free grammars
Abstract
Many 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. 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. 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 http://people.csail.mit.edu/akiezun/hampi1
Year
DOI
Venue
2012
10.1145/2377656.2377662
ACM Trans. Softw. Eng. Methodol.
Keywords
Field
DocType
word equation,context-free grammar,concolic testing,typical string operation,automated testing,string term,regular expression,bounded string variable,string solver,dynamic analysis,string constraint,dynamic systematic testing,automatic testing,regular languages,context free languages,context free grammar,program analysis
Regular expression,Substring,Programming language,Context-free grammar,Computer science,Theoretical computer science,Concolic testing,Concatenation,Solver,Program analysis,String operations
Journal
Volume
Issue
ISSN
21
4
1049-331X
Citations 
PageRank 
References 
19
0.70
42
Authors
6
Name
Order
Citations
PageRank
Adam Kiezun156627.47
Vijay Ganesh2156394.66
Shay Artzi364328.70
Philip J. Guo4188286.27
Pieter Hooimeijer559826.19
Michael D. Ernst66629347.51