Definitioncore
Galois connection
Also called adjunction between posets, Galois insertion.
A pair of monotone maps alpha and gamma between concrete and abstract posets with alpha(x) <= y exactly when x <= gamma(y).
A Galois connection is a pair of monotone maps between a concrete ordered set and an abstract one: the abstraction maps a set of states to its best description, and the concretization maps a description to the set of states it allows. The two are tied by one equivalence, . From it come the best abstract version of each concrete operation and the transfer of fixed points from the concrete side to the abstract one.
Definition
Let and be partially ordered sets. In program analysis is ordered by inclusion, as in the collecting semantics, and is an abstract domain. The orders are the Cousot orders: lower is more precise. A pair of maps and is a Galois connection when, for all and ,
In words, describes soundly in the abstract order exactly when is inside the meaning of in the concrete order. The notation is .
Theorem 1 (four conditions). is a Galois connection if and only if
- is monotone,
- is monotone,
- for every , and
- for every .
Proof. Assume the equivalence. For condition 4, put : since , we get . For condition 3, put : since , we get . For condition 1, let . By condition 4, , and the equivalence turns this into . For condition 2, let . By condition 3, , and the equivalence turns this into .
Now assume the four conditions. If , then by condition 4 and condition 2. If , then by condition 1 and condition 3.
Theorem 2 (each map determines the other). In a Galois connection,
So if and are both Galois connections, then , and the same holds for .
Proof. By condition 3, is in the set . By the equivalence, each in the set has . So is the greatest element of the set. The formula for is the dual argument with condition 4. A greatest element is unique, so depends only on .
Theorem 3 (joins and meets). preserves every join that exists in , and preserves every meet that exists in . In particular when exists.
Proof. Let have a join . For every ,
So the upper bounds of are exactly the elements above , and is the join of . The case of is dual. For the join is , and the claim gives .
The converse holds for complete lattices: if preserves all joins, then makes a Galois connection. Indeed puts in the set, so ; and if , then . So to give a Galois connection between complete lattices, it is enough to give an that preserves joins.
Closure. From conditions 1, 3 and 4, : the inequality is condition 4 under the monotone , and is condition 3. Dually . So is an upper closure on : monotone, extensive () and idempotent. It maps each set of states to the smallest set that the domain can express.
Galois insertion. A Galois connection is a Galois insertion when , the special case where condition 3 holds with equality. These are equivalent:
- ;
- is onto;
- is one to one.
Proof. From 1, each equals , so is onto; and gives . From 2, write ; then . From 3, by the closure identity, so .
In an insertion no two abstract elements have the same meaning, so the domain has no redundant elements. Every Galois connection gives an insertion when is cut down to the image of ; this keeps one element for each meaning.
The best transformer. Let be monotone, for example the concrete of an instruction. Call sound for when pointwise. Then:
- is sound: by condition 4.
- It is the most precise sound map: for each , if and only if , by the equivalence. So is sound exactly when .
- If is monotone, soundness is the same as . From : by condition 3 and the monotone . From : by condition 4 and the monotone .
The best transformer is a specification. It may not be computable in a closed form, and a real domain often uses a sound map that is less precise but faster.
Theorem 4 (fixed point transfer). Let and be complete lattices, and let and be monotone with . Then
If moreover , then .
Proof. Let . By the last point above, . So is an element with , and by the Knaster-Tarski theorem the least fixed point of is below it: . The equivalence gives . For the second claim, , so is a fixed point of , and is below it.
When , the abstraction is called complete for : the abstract least fixed point loses nothing beyond what loses on the exact answer. This is rare. Most transfer functions give only the inequality, and a widening then gives an element above , which is still sound.
Order-reversing form. Ore and the older algebra texts use a pair of order-reversing maps with , as between sets of polynomials and sets of their roots. Reverse the order of to get the monotone form used here. The monotone form is also called an adjunction between posets, with the lower adjoint and the upper adjoint.
Examples and non-examples
Intervals. Let and let be the interval domain with bounds in . Put , , and otherwise. Then says and , which says . So this is a Galois connection. It is an insertion, because is onto: . For , and , which shows that condition 4 can be strict. The best transformer for applied to is , while the interval product of with itself gives , because it does not know that both factors are the same number.
A connection that is not an insertion. Take two names and the plain product of two interval domains, without identifying the pairs that contain . Then , so is not one to one, and . The pair is still a Galois connection: the four conditions hold. Identify every pair that has a component with one bottom element, and the result is an insertion. The reduced product does the same in general, with a reduction operator.
Non-example: no best abstraction. Let be the subsets of the real plane and the closed convex polyhedra, with the inclusion, as in the polyhedra domain. The disk has no least polyhedron above it. Take any polyhedron . The boundary of a polyhedron is made of finitely many line segments, and the boundary of is a circle, so , and some point is in and not in . The disk is closed and convex, so a line separates from : there is a closed half-plane with and . Then is a polyhedron above and strictly below . So does not exist, and by Theorem 2 no makes a Galois connection with this . The domain is still usable: it only needs and sound operations.
Non-example: monotone maps that do not match. On and the interval domain, keep and take for every nonempty . Both maps are monotone and condition 4 holds, but , so condition 3 fails. Then describes soundly, but is false, and the equivalence breaks. By Theorem 2 the only that works with this is the one in the interval example.
Related definitions
- Abstract domain: the abstract side; a domain needs and sound operations, and a Galois connection is the extra structure that gives best descriptions.
- Collecting semantics: the concrete side, at each point.
- Abstract interpretation: the general technique, which uses Theorem 4 to relate the abstract fixed point to the concrete one.
- Knaster-Tarski theorem and fixed point: the facts about least fixed points that the transfer theorem uses.
- Join-semilattice: Theorem 3 says that is a join homomorphism.
- Reduced product: a product of two Galois connections, cut down to an insertion by a reduction.
- Widening operator: the way to reach an element above when the abstract lattice has infinite chains.
References
- Patrick Cousot and Radhia Cousot, Systematic design of program analysis frameworks, POPL 1979, pages 269 to 282, the Galois connection between the concrete and the abstract lattice, the best approximation of the concrete operations, and the design of analyses from it
- Patrick Cousot and Radhia Cousot, Abstract interpretation: a unified lattice model for static analysis of programs by construction or approximation of fixpoints, POPL 1977, pages 238 to 252, the abstraction and concretization functions that relate an abstract interpretation to the static semantics
- Patrick Cousot and Radhia Cousot, Abstract interpretation frameworks, Journal of Logic and Computation 2(4), 1992, pages 511 to 547, the comparison of the framework with a Galois connection and the frameworks with a concretization function only
- B. A. Davey and H. A. Priestley, Introduction to Lattices and Order, second edition, Cambridge University Press, 2002, Chapter 7 (Complete lattices and Galois connections), the section on Galois connections
- Flemming Nielson, Hanne Riis Nielson and Chris Hankin, Principles of Program Analysis, Springer, 1999, Chapter 4 (Abstract Interpretation), the sections on Galois connections, Galois insertions and induced operations
Where this leads
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H0 no proof |
|
| Lean | L0 no Lean part |
|
| Visual | V0 none |
|
| Writing | W4 complete |
|
Tag 733ZE7 Edit this page History Report an error Markdown