Abstract

The abstract interpretation of programs relates the exact semantics of a programming language to a finite approximation of those semantics. In this article, we describe an approach to abstract interpretation that is based in logic and logic programming.Our approach consists of faithfully representing a transition system within logic and then manipulating this initial specification to create a logical approximation of the original specification. The objective is to derive a logical approximation that can be interpreted as a terminating forward-chaining logic program; this ensures that the approximation is finite and that, furthermore, an appropriate logic programming interpreter can implement the derived approximation.We are particularly interested in the specification of the operational semantics of programming languages in ordered logic, a technique we call substructural operational semantics (SSOS). We show that manifestly sound control flow and alias analyses can be derived as logical approximations of the substructural operational semantics of relevant languages.

Highlights

  • A central goal of logical frameworks is to specify the operational semantics of evolving systems in a framework that is logically motivated and that allows specifications to be as simple as possible

  • We show that manifestly sound control flow and alias analyses can be derived as logical approximations of the substructural operational semantics of relevant languages

  • Our particular interest is in the representation and static analysis of programming languages; we illustrate our approach by deriving control flow and alias analyses by logical approximation

Read more

Summary

Introduction

A central goal of logical frameworks is to specify the operational semantics of evolving systems (in particular, the operational semantics of programming languages) in a framework that is logically motivated and that allows specifications to be as simple as possible. We apply logically justified techniques for manipulating and approximating the specification to yield approximations that are correct by construction These approximations have the form of forwardchaining (or “bottom-up”) logic programs which can be run to saturation, generalizing proposals by McAllester and Ganzinger [14, 21] with certain higher-order features. Our particular interest is in the representation and static analysis of programming languages; we illustrate our approach by deriving control flow and alias analyses by logical approximation. Defining these specific approximations requires insight, but the correctness proofs do not, because they follow from a general metatheorem justifying the kinds of approximations we make, together with straightforward termination arguments

A simple example
Representation in ordered linear logic
Translation into linear logic
Approximation as a logic program
Substructural operational semantics
Outline
Ordered logical specifications
An environment semantics for SSOS specifications
Transitions in ordered logical specifications
Adequacy of transitions
Logical correctness of transitions
Linear and persistent logical specifications
Correctness of the translation
Linear destination-passing style
Approximation and the meta-approximation theorem
Termination and Skolemization
A control flow analysis from an SSOS specification
Approximating SSOS specifications for alias analysis
Conclusion
Related work
Right focus
Weakening and strengthening
Correctness of inversion
Main proof of Theorem 2
Main theorem To recall
Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call