skip to main content
10.1145/3106237.3106303acmconferencesArticle/Chapter ViewAbstractPublication PagesfseConference Proceedingsconference-collections
research-article
Artifacts Evaluated & Reusable

Constraint normalization and parameterized caching for quantitative program analysis

Published:21 August 2017Publication History

ABSTRACT

Symbolic program analysis techniques rely on satisfiability-checking constraint solvers, while quantitative program analysis techniques rely on model-counting constraint solvers. Hence, the efficiency of satisfiability checking and model counting is crucial for efficiency of modern program analysis techniques. In this paper, we present a constraint caching framework to expedite potentially expensive satisfiability and model-counting queries. Integral to this framework is our new constraint normalization procedure under which the cardinality of the solution set of a constraint, but not necessarily the solution set itself, is preserved. We extend these constraint normalization techniques to string constraints in order to support analysis of string-manipulating code. A group-theoretic framework which generalizes earlier results on constraint normalization is used to express our normalization techniques. We also present a parameterized caching approach where, in addition to storing the result of a model-counting query, we also store a model-counter object in the constraint store that allows us to efficiently recount the number of satisfying models for different maximum bounds. We implement our caching framework in our tool Cashew, which is built as an extension of the Green caching framework, and integrate it with the symbolic execution tool Symbolic PathFinder (SPF) and the model-counting constraint solver ABC. Our experiments show that constraint caching can significantly improve the performance of symbolic and quantitative program analyses. For instance, Cashew can normalize the 10,104 unique constraints in the SMC/Kaluza benchmark down to 394 normal forms, achieve a 10x speedup on the SMC/Kaluza-Big dataset, and an average 3x speedup in our SPF-based side-channel analysis experiments.

References

  1. Redis. https://redis.io/.Google ScholarGoogle Scholar
  2. P. A. Abdulla, M. F. Atig, Y. Chen, L. Holík, A. Rezine, P. Rümmer, and J. Stenman. String constraints for verification. In Proceedings of the 26th International Conference on Computer Aided Verification (CAV), pages 150–166, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. F. A. Aloul, K. A. Sakallah, and I. L. Markov. Efficient symmetry breaking for boolean satisfiability. IEEE Transactions on Computers, 55(5):549–558, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. A. Aquino, F. A. Bianchi, M. Chen, G. Denaro, and M. Pezzè. Reusing constraint proofs in program analysis. In Proceedings of the 2015 International Symposium on Software Testing and Analysis, pages 305–315. ACM, 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. A. Aquino, G. Denaro, and M. Pezzè. Heuristically matching solution spaces of arithmetic formulas to efficiently reuse solutions. In Proceedings of the 39th International Conference on Software Engineering, pages 427–437. IEEE Press, 2017. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. A. Aydin, L. Bang, and T. Bultan. Automata-based model counting for string constraints. In Computer Aided Verification - 27th International Conference, CAV 2015, San Francisco, CA, USA, Proceedings, Part I, pages 255–272, 2015.Google ScholarGoogle Scholar
  7. M. Backes, B. Köpf, and A. Rybalchenko. Automatic discovery and quantification of information leaks. In 30th IEEE Symposium on Security and Privacy (S&P 2009), 17-20 May 2009, Oakland, California, USA, pages 141–153, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. V. Baldoni, N. Berline, J. D. Loera, B. Dutra, M. Köppe, S. Moreinis, G. Pinto, M. Vergne, and J. Wu. Latte integrale v1.7.2. http://www.math.ucdavis.edu/ latte/, 2004.Google ScholarGoogle Scholar
  9. L. Bang, A. Aydin, Q.-S. Phan, C. S. Păsăreanu, and T. Bultan. String analysis for side channels with segmented oracles. In Proceedings of the 2016 24th ACM SIGSOFT International Symposium on Foundations of Software Engineering, pages 193–204. ACM, 2016. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. C. Barrett, L. de Moura, S. Ranise, A. Stump, and C. Tinelli. The smt-lib initiative and the rise of smt. In Haifa Verification Conference, pages 3–3. Springer, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. ESEC/FSE’17, September 4–8, 2017, Paderborn, Germany T. Brennan, N. Tsiskaridze, N. Rosner, S. Aydin, and T. BultanGoogle ScholarGoogle Scholar
  12. C. Barrett, C. L. Conway, M. Deters, L. Hadarean, D. Jovanović, T. King, A. Reynolds, and C. Tinelli. Cvc4. In International Conference on Computer Aided Verification, pages 171–177. Springer, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. C. Barrett, M. Deters, L. De Moura, A. Oliveras, and A. Stump. 6 years of smt-comp. Journal of Automated Reasoning, 50(3):243–277, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. C. Barrett, P. Fontaine, and C. Tinelli. The SMT-LIB Standard: Version 2.5. Technical report, Department of Computer Science, The University of Iowa, 2015. Available at www.smt-lib.org.Google ScholarGoogle Scholar
  15. M. Borges, A. Filieri, M. d’Amorim, and C. S. Pasareanu. Iterative distributionaware sampling for probabilistic symbolic execution. In Proceedings of the 2015 10th Joint Meeting on Foundations of Software Engineering, ESEC/FSE 2015, Bergamo, Italy, August 30 - September 4, 2015, pages 866–877, 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. C. Cadar, D. Dunbar, and D. R. Engler. KLEE: unassisted and automatic generation of high-coverage tests for complex systems programs. In 8th USENIX Symposium on Operating Systems Design and Implementation, OSDI 2008, December 8-10, 2008, San Diego, California, USA, Proceedings, pages 209–224, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. S. Chakraborty, K. S. Meel, R. Mistry, and M. Y. Vardi. Approximate probabilistic inference via word-level counting. arXiv preprint arXiv:1511.07663, 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. D. Clark, S. Hunt, and P. Malacaria. A static analysis for quantifying information flow in a simple imperative language. Journal of Computer Security, 15(3):321–371, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. J. Crawford. A theoretical analysis of reasoning by symmetry in first-order logic. In AAAI Workshop on Tractable Reasoning. Citeseer, 1992.Google ScholarGoogle Scholar
  20. J. Crawford, M. Ginsberg, E. Luks, and A. Roy. Symmetry-breaking predicates for search problems. KR, 96:148–159, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. L. De Moura and N. Bjørner. Z3: An efficient smt solver. In International conference on Tools and Algorithms for the Construction and Analysis of Systems, pages 337– 340. Springer, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. B. Dutertre. Yices 2.2. In International Conference on Computer Aided Verification, pages 737–744. Springer, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. A. Filieri, C. S. Pasareanu, and W. Visser. Reliability analysis in symbolic pathfinder. In 35th International Conference on Software Engineering, ICSE ’13, San Francisco, CA, USA, May 18-26, 2013, pages 622–631, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. V. Ganesh, M. Minnes, A. Solar-Lezama, and M. C. Rinard. Word equations with length constraints: What’s decidable? In Proceedings of the 8th International Haifa Verification Conference (HVC), pages 209–226, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. J. Geldenhuys, M. B. Dwyer, and W. Visser. Probabilistic symbolic execution. In International Symposium on Software Testing and Analysis, ISSTA 2012, Minneapolis, MN, USA, July 15-20, 2012, pages 166–176, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. I. P. Gent and B. Smith. Symmetry breaking during search in constraint programming. Citeseer, 1999.Google ScholarGoogle Scholar
  27. I. P. Gent, K. E. Petrie, and J.-F. Puget. Symmetry in constraint programming. Foundations of Artificial Intelligence, 2:329–376, 2006.Google ScholarGoogle ScholarCross RefCross Ref
  28. P. Godefroid, N. Klarlund, and K. Sen. DART: directed automated random testing. In Proceedings of the ACM SIGPLAN 2005 Conference on Programming Language Design and Implementation, Chicago, IL, USA, June 12-15, 2005, pages 213–223, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. J. Heusser and P. Malacaria. Quantifying information leaks in software. In Twenty-Sixth Annual Computer Security Applications Conference, ACSAC 2010, Austin, Texas, USA, 6-10 December 2010, pages 261–269, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. P. Hooimeijer and W. Weimer. A decision procedure for subset constraints over regular languages. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI), pages 188–198, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. P. Hooimeijer and W. Weimer. Solving string constraints lazily. In Proceedings of the 25th IEEE/ACM International Conference on Automated Software Engineering (ASE), pages 377–386, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. X. Jia, C. Ghezzi, and S. Ying. Enhancing reuse of constraint solutions to improve symbolic execution. In Proceedings of the 2015 International Symposium on Software Testing and Analysis, pages 177–187. ACM, 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. S. Khurshid, C. S. Pasareanu, and W. Visser. Generalized symbolic execution for model checking and testing. In Tools and Algorithms for the Construction and Analysis of Systems, 9th International Conference, TACAS 2003, Warsaw, Poland, April 7-11, 2003, Proceedings, pages 553–568, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. A. Kiezun, V. Ganesh, P. J. Guo, P. Hooimeijer, and M. D. Ernst. Hampi: a solver for string constraints. In Proceedings of the 18th International Symposium on Software Testing and Analysis (ISSTA), pages 105–116, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. G. Li and I. Ghosh. PASS: string solving with parameterized array and interval automaton. In Proceedings of the 9th International Haifa Verification Conference (HVC), pages 15–31, 2013.Google ScholarGoogle ScholarCross RefCross Ref
  36. T. Liang, N. Tsiskaridze, A. Reynolds, C. Tinelli, and C. Barrett. A decision procedure for regular membership and length constraints over unbounded strings. In C. Lutz and S. Ranise, editors, Proceedings of the 10th International Symposium on Frontiers of Combining Systems, volume 9322 of Lecture Notes in Computer Science, pages 135–150. Springer, 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. T. Liang, A. Reynolds, N. Tsiskaridze, C. Tinelli, C. Barrett, and M. Deters. An efficient smt solver for string constraints. Formal Methods in System Design, 48 (3):206–234, 2016. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. J. A. D. Loera, R. Hemmecke, J. Tauzer, and R. Yoshida. Effective lattice point counting in rational convex polytopes. Journal of Symbolic Computation, 38(4): 1273 – 1302, 2004. ISSN 0747-7171.Google ScholarGoogle ScholarCross RefCross Ref
  39. K. Luckow, C. S. Păsăreanu, M. B. Dwyer, A. Filieri, and W. Visser. Exact and approximate probabilistic symbolic execution for nondeterministic programs. In Proceedings of the 29th ACM/IEEE international conference on Automated software engineering, pages 575–586. ACM, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. L. Luu, S. Shinde, P. Saxena, and B. Demsky. A model counter for constraints over unbounded strings. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI), page 57, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. B. Mao, W. Hu, A. Althoff, J. Matai, J. Oberg, D. Mu, T. Sherwood, and R. Kastner. Quantifying timing-based information flow in cryptographic hardware. In Proceedings of the IEEE/ACM International Conference on Computer-Aided Design, pages 552–559. IEEE Press, 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. S. McCamant and M. D. Ernst. Quantitative information flow as network flow capacity. In Proceedings of the ACM SIGPLAN 2008 Conference on Programming Language Design and Implementation, Tucson, AZ, USA, June 7-13, 2008, pages 193–205, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. C. S. Pasareanu, W. Visser, D. H. Bushnell, J. Geldenhuys, P. C. Mehlitz, and N. Rungta. Symbolic pathfinder: integrating symbolic execution with model checking for java bytecode analysis. Autom. Softw. Eng., 20(3):391–425, 2013.Google ScholarGoogle ScholarCross RefCross Ref
  44. Q. Phan, P. Malacaria, O. Tkachuk, and C. S. Pasareanu. Symbolic quantitative information flow. ACM SIGSOFT Software Engineering Notes, 37(6):1–5, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  45. Q. Phan, P. Malacaria, C. S. Pasareanu, and M. d’Amorim. Quantifying information leaks using reliability analysis. In Proceedings of the International Symposium on Model Checking of Software, SPIN 2014, San Jose, CA, USA, pages 105–108, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  46. Q.-S. Phan and P. Malacaria. Abstract model counting: a novel approach for quantification of information leaks. In Proceedings of the 9th ACM symposium on Information, computer and communications security, pages 283–292. ACM, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  47. J. Rizzo and T. Duong. The crime attack. Ekoparty Security Conference, 2012.Google ScholarGoogle Scholar
  48. P. Saxena, D. Akhawe, S. Hanna, F. Mao, S. McCamant, and D. Song. A symbolic execution framework for javascript. In Proceedings of the 31st IEEE Symposium on Security and Privacy, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  49. K. Sen, D. Marinov, and G. Agha. CUTE: a concolic unit testing engine for C. In Proceedings of the 10th European Software Engineering Conference held jointly with 13th ACM SIGSOFT International Symposium on Foundations of Software Engineering, 2005, Lisbon, Portugal, September 5-9, 2005, pages 263–272, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  50. I. Shlyakhter. Generating effective symmetry-breaking predicates for search problems. Electronic Notes in Discrete Mathematics, 9:19–35, 2001.Google ScholarGoogle ScholarCross RefCross Ref
  51. G. Smith. On the foundations of quantitative information flow. In Foundations of Software Science and Computational Structures, 12th International Conference, FOSSACS 2009, York, UK, March 22-29, 2009. Proceedings, pages 288–302, 2009.Google ScholarGoogle Scholar
  52. M. Thurley. sharpsat–counting models with advanced component caching and implicit bcp. In International Conference on Theory and Applications of Satisfiability Testing, pages 424–429. Springer, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  53. M. Trinh, D. Chu, and J. Jaffar. S3: A symbolic string solver for vulnerability detection in web applications. In Proceedings of the ACM SIGSAC Conference on Computer and Communications Security (CCS), pages 1232–1243, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  54. C. G. Val, M. A. Enescu, S. Bayless, W. Aiello, and A. J. Hu. Precisely measuring quantitative information flow: 10k lines of code and beyond. In Security and Privacy (EuroS&P), 2016 IEEE European Symposium on, pages 31–46. IEEE, 2016.Google ScholarGoogle Scholar
  55. S. Verdoolaege. barvinok: User guide. Version 0.23), Electronically available at http://www. kotnet. org/˜ skimo/barvinok, 2007.Google ScholarGoogle Scholar
  56. W. Visser, J. Geldenhuys, and M. B. Dwyer. Green: reducing, reusing and recycling constraints in program analysis. In Proceedings of the ACM SIGSOFT 20th International Symposium on the Foundations of Software Engineering, page 58. ACM, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  57. M. Weir, S. Aggarwal, M. P. Collins, and H. Stern. Testing metrics for password creation policies by attacking large sets of revealed passwords. In Proceedings of the 17th ACM Conference on Computer and Communications Security, CCS 2010, Chicago, Illinois, USA, October 4-8, 2010, pages 162–175, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  58. Y. Zheng, X. Zhang, and V. Ganesh. Z3-str: A z3-based string solver for web application analysis. In Proceedings of the 9th Joint Meeting on Foundations of Software Engineering (ESEC/FSE), pages 114–124, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Constraint normalization and parameterized caching for quantitative program analysis

    Recommendations

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in
    • Published in

      cover image ACM Conferences
      ESEC/FSE 2017: Proceedings of the 2017 11th Joint Meeting on Foundations of Software Engineering
      August 2017
      1073 pages
      ISBN:9781450351058
      DOI:10.1145/3106237

      Copyright © 2017 ACM

      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]

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 21 August 2017

      Permissions

      Request permissions about this article.

      Request Permissions

      Check for updates

      Qualifiers

      • research-article

      Acceptance Rates

      Overall Acceptance Rate112of543submissions,21%

      Upcoming Conference

      FSE '24

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader