Abstract Interpretation - Formalization

Formalization

Let L be an ordered set, called a concrete set and let L′ be another ordered set, called an abstract set. These two sets are related to each other by defining total functions that map elements from one to the other.

A function α is called an abstraction function if it maps an element x in the concrete set L to an element α(x) in the abstract set L′. That is, element α(x) in L′ is the abstraction of x in L.

A function γ is called a concretization function if it maps an element x′ in the abstract set L′ to an element γ(x′) in the concrete set L. That is, element γ(x′) in L is a concretization of x′ in L′.

Let L1, L2, L1 and L2 be ordered sets. The concrete semantics f is a monotonic function from L1 to L2. A function f′ from L1 to L2 is said to be a valid abstraction of f if for all x′ in L1, (f ∘ γ)(x′) ≤ (γ ∘ f′)(x′).

Program semantics are generally described using fixed points in the presence of loops or recursive procedures. Let us suppose that L is a complete lattice and let f be a monotonic function from L into L. Then, any x′ such that f′(x′) ≤ x′ is an abstraction of the least fixed-point of f, which exists, according to the Knaster–Tarski theorem.

The difficulty is now to obtain such an x′. If L′ is of finite height, or at least verifies the ascending chain condition (all ascending sequences are ultimately stationary), then such an x′ may be obtained as the stationary limit of the ascending sequence xn defined by induction as follows: x0=⊥ (the least element of L′) and xn+1=f′(xn).

In other cases, it is still possible to obtain such an x′ through a widening operator ∇: for all x and y, xy should be greater or equal than both x and y, and for any sequence yn, the sequence defined by x0=⊥ and xn+1=xnyn is ultimately stationary. We can then take yn=f′(xn).

In some cases, it is possible to define abstractions using Galois connections (α, γ) where α is from L to L′ and γ is from L′ to L. This supposes the existence of best abstractions, which is not necessarily the case. For instance, if we abstract sets of couples (x, y) of real numbers by enclosing convex polyhedra, there is no optimal abstraction to the disc defined by x2+y2 ≤ 1.

Read more about this topic:  Abstract Interpretation