Horn Clauses as an Intermediate Representation for Program Analysis and Transformation
Graeme Gange, Jorge A. Navas, Peter Schachte, Harald Sondergaard,, Peter J. Stuckey

TL;DR
This paper proposes using a restricted logic programming language as an intermediate representation in program analysis and compilation, enabling effective transformations while preserving simple semantics.
Contribution
It introduces a deterministic, single-moded logic program language as a practical intermediate representation for analysis and compilation.
Findings
Logic programs can serve as effective intermediate representations.
Restrictions like determinism simplify program transformation.
The approach maintains semantics during compilation.
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.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
