Skip to main content Accessibility help
×
×
Home

An iterative approach to precondition inference using constrained Horn clauses

  • BISHOKSAN KAFLE (a1), JOHN P. GALLAGHER (a2), GRAEME GANGE (a3), PETER SCHACHTE (a1), HARALD SØNDERGAARD (a1) and PETER J. STUCKEY (a1)...

Abstract

We present a method for automatic inference of conditions on the initial states of a program that guarantee that the safety assertions in the program are not violated. Constrained Horn clauses (CHCs) are used to model the program and assertions in a uniform way, and we use standard abstract interpretations to derive an over-approximation of the set of unsafe initial states. The precondition then is the constraint corresponding to the complement of that set, under-approximating the set of safe initial states. This idea of complementation is not new, but previous attempts to exploit it have suffered from the loss of precision. Here we develop an iterative specialisation algorithm to give more precise, and in some cases optimal safety conditions. The algorithm combines existing transformations, namely constraint specialisation, partial evaluation and a trace elimination transformation. The last two of these transformations perform polyvariant specialisation, leading to disjunctive constraints which improve precision. The algorithm is implemented and tested on a benchmark suite of programs from the literature in precondition inference and software verification competitions.

    • Send article to Kindle

      To send this article to your Kindle, first ensure no-reply@cambridge.org is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about sending to your Kindle. Find out more about sending to your Kindle.

      Note you can select to send to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be sent to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.

      Find out more about the Kindle Personal Document Service.

      An iterative approach to precondition inference using constrained Horn clauses
      Available formats
      ×

      Send article to Dropbox

      To send this article to your Dropbox account, please select one or more formats and confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your <service> account. Find out more about sending content to Dropbox.

      An iterative approach to precondition inference using constrained Horn clauses
      Available formats
      ×

      Send article to Google Drive

      To send this article to your Google Drive account, please select one or more formats and confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your <service> account. Find out more about sending content to Google Drive.

      An iterative approach to precondition inference using constrained Horn clauses
      Available formats
      ×

Copyright

References

Hide All
Bagnara, R., Hill, P. M., and Zaffanella, E. 2008. The Parma Polyhedra Library: Toward a complete set of numerical abstractions for the analysis and verification of hardware and software systems. Sci. Comput. Program. 72, 1–2, 321.
Bakhirkin, A., Berdine, J., and Piterman, N. 2014. Backward analysis via over-approximate abstraction and under-approximate subtraction. In Static Analysis, Müller-Olm, M. and Seidl, H., Eds. LNCS, vol. 8723. Springer, 3450.
Bakhirkin, A. and Monniaux, D. 2017. Combining forward and backward abstract interpretation of Horn clauses. In Static Analysis, Ranzato, F., Ed. LNCS, vol. 10422. Springer, 2345.
Ball, T., Cook, B., Levin, V., and Rajamani, S. K. 2004. SLAM and static driver verifier: Technology transfer of formal methods inside Microsoft. In Integrated Formal Methods, Boiten, E. A., Derrick, J., and Smith, G., Eds. LNCS, vol. 2999. Springer, 120.
Beyer, D. 2013. SV-COMP 2013. In Tools and Algorithms for the Construction and Analysis of Systems, Piterman, N. and Smolka, S. A., Eds. LNCS, vol. 7795. Springer, 594609.
Beyer, D., Henzinger, T. A., Majumdar, R., and Rybalchenko, A. 2007. Path invariants. In Programming Language Design and Implementation, Ferrante, J. and McKinley, K. S., Eds. ACM, 300309.
Cassez, F., Jensen, P. G., and Larsen, K. G. 2017. Refinement of trace abstraction for real-time programs. In Reachability Problems, Hague, M. and Potapov, I., Eds. LNCS, vol. 10506. Springer, 4258.
Clarke, E. M., Grumberg, O., Jha, S., Lu, Y., and Veith, H. 2003. Counterexample-guided abstraction refinement for symbolic model checking. J. ACM 50, 5, 752794.
Cousot, P. and Cousot, R. 1992. Abstract interpretation and application to logic programs. J. Log. Program. 13, 2&3, 103179.
Cousot, P., Cousot, R., and Logozzo, F. 2011. Precondition inference from intermittent assertions and applications to contracts on collections. In Verification, Model Checking and Abstract Interpretation, Jhala, R. and Schmidt, D., Eds. LNCS, vol. 6538. Springer, 150168.
De Angelis, E., Fioravanti, F., Pettorossi, A., and Proietti, M. 2014. Program verification via iterated specialization. Sci. Comput. Program. 95, 149175.
De Angelis, E., Fioravanti, F., Pettorossi, A., and Proietti, M. 2017. Semantics-based generation of verification conditions via program specialization. Sci. Comput. Program. 147, 78108.
Dutertre, B. 2014. Yices 2.2. In Computer-Aided Verification, Biere, A. and Bloem, R., Eds. LNCS, vol. 8559. Springer, 737744.
Gallagher, J. P. 1993. Specialisation of logic programs: A tutorial. In Proc. ACM SIGPLAN Symp. PEPM'93. ACM Press, 8898.
Gallagher, J. P. and Lafave, L. 1996. Regular approximation of computation paths in logic and functional languages. In Partial Evaluation, Danvy, O., Glück, R., and Thiemann, P., Eds. LNCS, vol. 1110. Springer, 115136.
Graf, S. and Saïdi, H. 1997. Construction of abstract state graphs with PVS. In Computer Aided Verification, 9th International Conference, CAV, Grumberg, O., Ed. Lecture Notes in Computer Science, vol. 1254. Springer, 7283.
Grebenshchikov, S., Lopes, N. P., Popeea, C., and Rybalchenko, A. 2012. Synthesizing software verifiers from proof rules. In Proc. 33rd ACM SIGPLAN Conf. Programming Language Design and Implementation, Vitek, J., Lin, H., and Tip, F., Eds. ACM, 405–416.
Gulavani, B. S., Chakraborty, S., Nori, A. V., and Rajamani, S. K. 2008. Automatically refining abstract interpretations. In Tools and Algorithms for the Construction and Analysis of Systems, Ramakrishnan, C. R. and Rehof, J., Eds. LNCS, vol. 4963. Springer, 443458.
Gupta, A. and Rybalchenko, A. 2009. InvGen: An efficient invariant generator. In Computer-Aided Verification, Bouajjani, A. and Maler, O., Eds. LNCS, vol. 5643. Springer, 634640.
Gurfinkel, A., Kahsai, T., Komuravelli, A., and Navas, J. A. 2015. The SeaHorn verification framework. In Computer Aided Verification, Kroening, D. and Păsăreanu, C. S., Eds. LNCS, vol. 9206. Springer, 343361.
Hermenegildo, M. V., Bueno, F., Carro, M., López-García, P., Mera, E., Morales, J. F., and Puebla, G. 2012. An overview of Ciao and its design philosophy. TPLP 12, 1-2, 219252.
Howe, J. M., King, A., and Lu, L. 2004. Analysing logic programs by reasoning backwards. In Program Development in Computational Logic, Bruynooghe, M. and Lau, K., Eds. LNCS, vol. 3049. Springer, 152188.
Jaffar, J., Maher, M., Marriott, K., and Stuckey, P. J. 1998. The semantics of constraint logic programs. J. Log. Program. 37, 1–3, 146.
Jaffar, J., Murali, V., Navas, J. A., and Santosa, A. E. 2012. TRACER: A symbolic execution tool for verification. In Computer-Aided Verification, Madhusudan, P. and Seshia, S. A., Eds. LNCS, vol. 7358. Springer, 758766.
Jhala, R. and McMillan, K. L. 2006. A practical and complete approach to predicate refinement. In Tools and Algorithms for the Construction and Analysis of Systems, Hermanns, H. and Palsberg, J., Eds. LNCS, vol. 3920. Springer, 459473.
Jones, N., Gomard, C., and Sestoft, P. 1993. Partial Evaluation and Automatic Software Generation. Prentice Hall.
Kafle, B. and Gallagher, J. P. 2017a. Constraint specialisation in Horn clause verification. Sci. Comput. Program. 137, 125140.
Kafle, B. and Gallagher, J. P. 2017b. Horn clause verification with convex polyhedral abstraction and tree automata-based refinement. Computer Languages, Systems & Structures 47, 218.
Kafle, B., Gallagher, J. P., and Morales, J. F. 2016. RAHFT: A tool for verifying Horn clauses using abstract interpretation and finite tree automata. In Computer-Aided Verification, Chaudhuri, S. and Farzan, A., Eds. LNCS, vol. 9779. Springer, 261268.
Marriott, K. and Søndergaard, H. 1993. Precise and efficient groundness analysis for logic programs. ACM LOPLAS 2, 1–4, 181196.
Miné, A. 2006. The octagon abstract domain. Higher-Order and Symbolic Computation 19, 1, 31100.
Miné, A. 2012a. Inferring sufficient conditions with backward polyhedral under-approximations. Electr. Notes Theor. Comput. Sci. 287, 89100.
Miné, A. 2012b. Sufficient condition polyhedral prototype analyzer. https://www-apr.lip6.fr/~mine/banal/syntax.html. Accessed: 2018-01-23.
Moy, Y. 2008. Sufficient preconditions for modular assertion checking. In Verification, Model Checking and Abstract Interpretation, Logozzo, F., Peled, D. A., and Zuck, L. D., Eds. LNCS, vol. 4905. Springer, 188202.
Peralta, J. C., Gallagher, J. P. and Sağlam, H. 1998. Analysis of imperative programs through analysis of constraint logic programs. In Static Analysis, Levi, G., Ed. LNCS, vol. 1503. 246261.
Recommend this journal

Email your librarian or administrator to recommend adding this journal to your organisation's collection.

Theory and Practice of Logic Programming
  • ISSN: 1471-0684
  • EISSN: 1475-3081
  • URL: /core/journals/theory-and-practice-of-logic-programming
Please enter your name
Please enter a valid email address
Who would you like to send this to? *
×

Keywords

Metrics

Full text views

Total number of HTML views: 0
Total number of PDF views: 0 *
Loading metrics...

Abstract views

Total abstract views: 0 *
Loading metrics...

* Views captured on Cambridge Core between <date>. This data will be updated every 24 hours.

Usage data cannot currently be displayed