Horn clauses as an intermediate representation for program analysis and transformation
نویسندگان
چکیده
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.
منابع مشابه
Probabilistic Horn Clause Verification
Constrained Horn clauses have proven to be a natural intermediate language for logically characterizing program semantics and reasoning about program behavior. In this paper, we present probabilistically constrained Horn clauses (pchc), which incorporate probabilistic variables inside otherwise traditional constrained Horn clauses. pchc enable reasoning about probabilistic programs by encoding ...
متن کاملA Flexible, (C)LP-Based Approach to the Analysis of Object-Oriented Programs
Static analyses of object-oriented programs usually rely on intermediate representations that respect the original semantics while having a more uniform and basic syntax. Most of the work involving object-oriented languages and abstract interpretation usually omits the description of that language or just refers to the Control Flow Graph (CFG) it represents. However, this lack of formalization ...
متن کاملEnergy Consumption Analysis and Verification by Transformation into Horn Clauses and Abstract Interpretation∗
The static estimation of the energy consumed by program executions has applications in program optimization and verification, and is instrumental in energy-aware software development. We describe our approach for estimating such energy consumption statically (i.e., at compile-time, without running the program) in the form of functions on the input data sizes of procedures (and possibly other ha...
متن کاملProving Horn Clause Specifications of Imperative Programs
We present a method for verifying the correctness of an imperative program with respect to a specification defined in terms of a set of possibly recursive Horn clauses. Given a program prog, we consider a partial correctness specification of the form {φ} prog {ψ}, where the assertions φ and ψ are predicates defined by a set Spec of Horn clauses. The verification method consists in: (i) encoding...
متن کاملSolving non-linear Horn clauses using a linear solver
Developing an efficient non-linear Horn clause solver is a challenging task since the solver has to reason about the tree structures rather than the linear ones as in a linear solver. In this paper we propose an incremental approach to solving a set of non-linear Horn clauses using a linear Horn clause solver. We achieve this by interleaving a program transformation and a linear solver. The pro...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
- TPLP
دوره 15 شماره
صفحات -
تاریخ انتشار 2015