Skip to main content
×
×
Home

Horn clauses as an intermediate representation for program analysis and transformation*

  • GRAEME GANGE (a1), JORGE A. NAVAS (a2), PETER SCHACHTE (a3), HARALD SØNDERGAARD (a3) and PETER J. STUCKEY (a3)...
Abstract

Many recent analyses for conventional imperative programs begin by transforming programs into logic programs, capitalising on existing LP analyses and simple LP semantics. We propose using logic programs as an intermediate program representation throughout the compilation process. With restrictions ensuring determinism and single-modedness, a logic program can easily be transformed to machine language or other low-level language, while maintaining the simple semantics that makes it suitable as a language for program analysis and transformation. We present a simple LP language that enforces determinism and single-modedness, and show that it makes a convenient program representation for analysis and transformation.

    • 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.

      Horn clauses as an intermediate representation for program analysis and transformation*
      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.

      Horn clauses as an intermediate representation for program analysis and transformation*
      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.

      Horn clauses as an intermediate representation for program analysis and transformation*
      Available formats
      ×
Copyright
Footnotes
Hide All
*

This work was supported by the Australian Research Council through Discovery Project Grant DP140102194.

Footnotes
References
Hide All
Albarghouthi, A., Li, Y., Gurfinkel, A. and Chechik, M. 2012. Ufo: A framework for abstraction- and interpolation-based software verification. In Proc. 24rd Int. Conf. Computer Aided Verification, Madhusudan, P. and Seshia, S. A., Eds. Lecture Notes in Computer Science, vol. 7358. Springer, 672678.
Albert, E., Arenas, P., Genaim, S., Puebla, G. and Zanardini, D. 2012. Cost analysis of object-oriented bytecode programs. Theoretical Computer Science 413, 142159.
Alpern, B., Wegman, M. N. and Zadeck, F. K. 1988. Detecting equality of variables in programs. In Proc. 15th ACM SIGPLAN-SIGACT Symp. Principles of Programming Languages. ACM, 1–11.
Ananian, C. S. 1999. The static single information form. M.S. thesis, Princeton University.
Appel, A. W. 1992. Compiling with Continuations. Cambridge University Press.
Appel, A. W. 1998. SSA is functional programming. SIGPLAN Notices 33, 4, 1720.
Ballance, R. A., Maccabe, A. B. and Ottenstein, K. J. 1990. The program dependence web: A representation supporting control-, data-, and demand-driven interpretation of imperative languages. In Proc. ACM SIGPLAN Conf. Programming Language Design and Implementation. ACM, 257–271.
Benton, W. C. and Fischer, C. N. 2007. Interactive, scalable, declarative program analysis: From prototype to implementation. In Proc. 9th ACM SIGPLAN Int. Conf. Principles and Practice of Declarative Programming. ACM, 13–24.
Chow, F., Chan, S., Liu, S.-M., Lo, R. and Streich, M. 1996. Effective representation of aliases and indirect memory operations in SSA form. In Compiler Construction, Gyimóthy, T., Ed. Lecture Notes in Computer Science, vol. 1060. Springer, 253267.
Cytron, R., Ferrante, J., Rosen, B. K., Wegman, M. N. and Zadeck, F. K. 1991. Efficiently computing static single assignment form and the control dependence graph. ACM Transactions on Programming Languages and Systems 13, 4, 451490.
De Angelis, E., Fioravanti, F., Pettorossi, A. and Proietti, M. 2014. VeriMAP: A tool for verifying programs through transformations. In Proc. 20th Int. Conf. Tools and Algorithms for the Construction and Analysis of Systems, Ábrahám, A. and Havelund, K., Eds. Lecture Notes in Computer Science, vol. 8413. Springer, 568574.
Delzanno, G. and Podelski, A. 1999. Model checking in CLP. In Proc. 5th Int. Conf. Tools and Algorithms for the Construction and Analysis of Systems, Cleaveland, W. R., Ed. Lecture Notes in Computer Science, vol. 1579. 223–239.
Flanagan, C. 2003. Automatic software model checking using CLP. In Programming Languages and Systems: Proc. 12th European Symp. Programming, Degano, P., Ed. Lecture Notes in Computer Science, vol. 2618. Springer, 189203.
Gange, G., Navas, J., Schachte, P., Søndergaard, H. and Stuckey, P. J. 2015. Interval analysis and machine arithmetic: Why signedness ignorance is bliss. ACM Transactions on Programming Languages and Systems 37, 1, 1:11:35.
Gerlek, M. P., Stolz, E. and Wolfe, M. 1995. Beyond induction variables: Detecting and classifying sequences using a demand-driven SSA form. ACM Transactions on Programming Languages and Systems 17, 1, 85122.
Grebenshchikov, S., Lopes, N. P., Popeea, C. and Rybalchenko, A. 2012. Synthesizing software verifiers from proof rules. In Proc. ACM SIGPLAN Conf. Programming Language Design and Implementation. ACM, 405–416.
Gupta, A., Popeea, C. and Rybalchenko, A. 2011. Threader: A constraint-based verifier for multi-threaded programs. In Proc. 23rd Int. Conf. Computer Aided Verification, Gopalakrishnan, G. and Qadeer, S., Eds. Lecture Notes in Computer Science, vol. 6806. Springer, 412417.
Gurfinkel, A., Kahsai, T. and Navas, J. A. 2015. SeaHorn: A framework for verifying C programs (competition contribution). In Proc. 21st Int. Conf. Tools and Algorithms for the Construction and Analysis of Systems, Baier, C. and Timelli, C., Eds. Vol. 9035. Springer, 447450.
Jaffar, J., Murali, V., Navas, J. A. and Santosa, A. E. 2012. TRACER: A symbolic execution tool for verification. In Proc. 24th Int. Conf. Computer Aided verification, Madhusudan, P. and Seshia, S. A., Eds. Lecture Notes in Computer Science, vol. 7358. Springer, 758766.
Kelsey, R. A. 1995. A correspondence between continuation passing style and static single assignment form. SIGPLAN Notices 30, 3, 1322.
Lattner, C. and Adve, V. 2004. LLVM: A compilation framework for lifelong program analysis and transformation. In Proc. Int. Symp. Code Generation and Optimization (CGO'04). IEEE Comp. Soc., 75–86.
Miné, A. 2006. The octagon abstract domain. Higher-Order and Symbolic Computation 19, 1, 31100.
Morales, J. F., Carro, M. and Hermenegildo, M. 2015. Description and optimization of abstract machines in a dialect of Prolog. Theory and Practice of Logic Programming. To appear.
Peralta, J. C. and Cruz-Carlón, J. A. 2006. From static single-assignment form to definite programs and back. In Pre-Proceedings of 16th International Symposium on Logic Based Program Synthesis and Transformation (LOPSTR 2006), Puebla, G., Ed. 79–84.
Peralta, J. C., Gallagher, J. P. and Saglam, H. 1998. Analysis of imperative programs through analysis of constraint logic programs. In Static Analysis, Levi, G., Ed. Lecture Notes in Computer Science, vol. 1503. Springer, 246261.
Rümmer, P., Hojjat, H. and Kuncak, V. 2013. Disjunctive interpolants for Horn-clause verification. In Proc. 25rd Int. Conf. Computer Aided Verification, Sharygina, N. and Veith, H., Eds. Lecture Notes in Computer Science, vol. 8044. 347–363.
Somogyi, Z., Henderson, F. and Conway, T. 1996. The execution algorithm of Mercury: An efficient purely declarative logic programming language. Journal of Logic Programming 29, 1–3, 1764.
Spoto, F., Mesnard, R. and Payet, É. 2010. A termination analyzer for Java bytecode based on path-length. ACM Transactions on Programming Languages and Systems 32, 8:18:70.
Tu, P. and Padua, D. 1995. Efficient building and placing of gating functions. In Proc. ACM SIGPLAN Conf. Programming Language Design and Implementation. ACM, 47–55.
Whaley, J., Avots, D., Carbin, M. and Lam, M. S. 2005. Using Datalog with binary decision diagrams for program analysis. In Proc. Third Asian Symp. Programming Languages and Systems, Yi, K., Ed. Lecture Notes in Computer Science, vol. 3780. Springer, 97118.
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