Horn clauses as an intermediate representation for program analysis and transformation

Graeme Gange, Jorge A. Navas, Peter Schachte, Harald Sondergaard, Peter J. Stuckey

Research output: Contribution to journalArticleResearchpeer-review

19 Citations (Scopus)

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.

Original languageEnglish
Pages (from-to)526-542
Number of pages17
JournalTheory and Practice of Logic Programming
Volume15
Issue number4-5
DOIs
Publication statusPublished - Jul 2015
Externally publishedYes

Keywords

  • compilers
  • control flow graphs
  • intermediate representation
  • program analysis and transformation
  • SSA

Cite this