Hostname: page-component-586b7cd67f-rdxmf Total loading time: 0 Render date: 2024-11-25T04:09:48.188Z Has data issue: false hasContentIssue false

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

Published online by Cambridge University Press:  03 September 2015

GRAEME GANGE
Affiliation:
Department of Computing and Information Systems, The University of Melbourne, Victoria 3010, Australia (e-mail: [email protected])
JORGE A. NAVAS
Affiliation:
NASA Ames Research Center, Moffet Field CA, (e-mail: [email protected])
PETER SCHACHTE
Affiliation:
Department of Computing and Information Systems, The University of Melbourne, Victoria 3010, Australia (e-mail: [email protected], [email protected], [email protected])
HARALD SØNDERGAARD
Affiliation:
Department of Computing and Information Systems, The University of Melbourne, Victoria 3010, Australia (e-mail: [email protected], [email protected], [email protected])
PETER J. STUCKEY
Affiliation:
Department of Computing and Information Systems, The University of Melbourne, Victoria 3010, Australia (e-mail: [email protected], [email protected], [email protected])
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the ‘Save PDF’ action button.

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.

Type
Regular Papers
Copyright
Copyright © Cambridge University Press 2015 

Footnotes

*

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

References

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.Google Scholar
Albert, E., Arenas, P., Genaim, S., Puebla, G. and Zanardini, D. 2012. Cost analysis of object-oriented bytecode programs. Theoretical Computer Science 413, 142159.Google Scholar
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.Google Scholar
Ananian, C. S. 1999. The static single information form. M.S. thesis, Princeton University.Google Scholar
Appel, A. W. 1992. Compiling with Continuations. Cambridge University Press.Google Scholar
Appel, A. W. 1998. SSA is functional programming. SIGPLAN Notices 33, 4, 1720.Google Scholar
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.Google Scholar
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.Google Scholar
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.CrossRefGoogle Scholar
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.Google Scholar
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.Google Scholar
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.Google Scholar
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.CrossRefGoogle Scholar
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.Google Scholar
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.Google Scholar
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.Google Scholar
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.Google Scholar
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.Google Scholar
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.Google Scholar
Kelsey, R. A. 1995. A correspondence between continuation passing style and static single assignment form. SIGPLAN Notices 30, 3, 1322.Google Scholar
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.Google Scholar
Miné, A. 2006. The octagon abstract domain. Higher-Order and Symbolic Computation 19, 1, 31100.CrossRefGoogle Scholar
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.Google Scholar
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.Google Scholar
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.Google Scholar
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.Google Scholar
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.Google Scholar
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.Google Scholar
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.Google Scholar
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.CrossRefGoogle Scholar