<p>I agree that it's often hard to extract the main point from all those details. (In fact, my big issue with every treatment of abstract interpretation I've seen is that they present so much machinery without motivating it.)</p>

<p>Here's how I think of it:</p>

<p><strong>Abstract interpretation is running programs, approximately, on large sets of inputs all at once.</strong></p>

<p>This doesn't cover everything, but it holds up well in general.</p>

<p>The canonical example is evaluating arithmetic expressions to determine the sign of the result. You can imagine a hypothetical, infinitely fast machine that can evaluate an expression on every positive input and return the set of results. If you had one of those, you could in principle determine things like "this program returns positive numbers when given positive numbers."</p>

<p>But of course you don't actually have that machine. You're stuck in real life, so you have to either do the same thing <em>symbolically</em>, which can give exact answers sometimes but often fail, or <em>approximately</em>, in a way that always returns answers but they may not be exact. The latter is what abstract interpretation does.</p>

<p>You can't even represent the set of all positive numbers directly. Instead, you need an <em>abstraction</em> of that set. You also need to abstract the negative numbers and zero. You end up with a family of finite <em>abstract</em> sets $\{neg,zero,pos\}$, that represent the <em>concrete</em> sets $\{\{...,-2,-1\},\{0\},\{1,2,...\}\}$.</p>

<p>Now you can come up with rules, such as "adding two positive numbers results in a positive number," or $add : pos \times pos \to pos$. Come up with rules for each of your language primitives, and you can pretend to evaluate arithmetic expressions on large sets of inputs all at the same time.</p>

<p>Of course, the "adding a positive and a negative number" rule will give you trouble, because additions like that can return anything. The abstract interpretation framework helps you out, here: it says you should return a <em>sound</em> approximation that is as tight as possible. If your rules are sound, and they say addition returns something in an abstract set, any concrete evaluation should return a number in the corresponding concrete set. For example, the $add : pos \times pos \to pos$ rule is sound if $add(a,b)$ is positive for every positive $a$ and $b$. Also, $pos \times neg \to (pos \sqcup zero \sqcup neg)$ is sound, where "$\sqcup$" is your abstract sets' union operation.</p>

<p>I believe even the youngest PL researcher could code up an abstract interpretation like this in an afternoon. It's actually not that hard, and you should try it before reading much more to get a feel for the basics. While you do, you'll discover that your abstract sets need some notion of intersection (denoted "$\sqcap$") and subset (denoted "$\sqsubseteq$"). They should correspond with concrete intersection and subset.</p>

<p>When you want to prove that your abstract interpretation is as tight as possible, you'll want a <em>Galois connection</em> to formalize this correspondence. Just having one ensures that, for any given concrete set, a tightest abstract set exists.</p>

<p>When you want to work with a language with loops or recursion, your programs may not terminate, so you'll need a $\bot$ value to represent nontermination. You'll need to "compute" (in a mathematical sense) concrete functions as fixpoints, and compute abstract functions similarly. If you have higher-order functions, you'll find that typical topological machinery doesn't handle them at all (higher-order application is generally not continuous), and need Scott domains.</p>

<p>IOW, what you've identified as the motivation for abstract interpretation is really the motivation for the machinery required for doing abstract interpretation on Turing-equivalent languages. The actual motivation is usefully summarizing the behavior of programs by running them on many inputs at once.</p>

CC BY-SA 3.0
2013-10-26T18:42:53.633Z
2013-10-26T18:54:40.383Z
2013-10-26T18:54:40.383Z
Neil Toronto
<p>Abstract interpretation is a very general concept and depending on whom you ask, you will receive different explanations because versatile concepts admit multiple perspectives. The view in this answer is mine and I would not assume it is general.</p>

<p><strong>Computational hardness as a motivation</strong></p>

<p>Let's start with decision problems, whose solutions have a structure like this:</p>

<p><img src="https://i.sstatic.net/IMFNR.png" alt="decision problem"></p>

<p>There is often an NP-hard lower bound on the procedure. Checking semantic properties of programs is even undecidable. What can we do?</p>

<p>Let's make two observations. First, we can sometimes solve specific problem instances even if we cannot solve the general problem. Second, applications like compiler optimization tolerate approximation in that a compiler that eliminates some but not all sources of inefficiency is useful. To make this intuition precise, we must answer:</p>

<ol>
<li>What does it mean formally to solve some, but not all problem instances?</li>
<li>What is an approximate solution to a decision problem?</li>
</ol>

<p><strong>Abstract Interpretation Idea 1: Change the Problem Statement</strong></p>

<p>To me, a major insight of abstract interpretation is to change the problem formulation so that instead of asking for a <em>Yes/No</em> answer, we ask for a <em>Yes/No/Maybe</em> answer.</p>

<p><img src="https://i.sstatic.net/AuURN.png" alt="yes-no-maybe"></p>

<p>As a consequence, every problem has a trivial, constant time solution (output <em>Maybe</em>). We can now shift our attention to deriving a procedure that does not always produce <em>Maybe</em>. To return to the questions above, a solution that works for some problem instances is one that returns <em>Maybe</em> on problems it cannot solve. Moreover, <em>Maybe</em> is an approximation of <em>Yes</em> and <em>No</em>  because we are not certain what the answer is. </p>

<p>This idea is not restricted to decision problems. Consider these problems concerning programs.</p>

<ol>
<li>Which lines of code in the program are dead (will never be executed)?</li>
<li>Which variables in the program have constant values?</li>
<li>Which assertions in the program are violated?</li>
</ol>

<p>In all these situations, we can move from an exact solution to an approximate one by considering solutions that have some uncertainty.</p>

<ol>
<li>What is <em>a set</em> of lines of code that is dead? </li>
<li>What is <em>a set</em> of variables in the program that have constant values?</li>
<li>What is <em>a set</em> of assertions in the program that is not violated?</li>
</ol>

<p>The sets produced need not be the largest. This idea is extremely general and applies to problems that have little to do with program analysis.</p>

<ol>
<li>Instead of adding $m$ and $n$, we can ask for a range $[a,b]$ in which the sum lies. </li>
<li>Instead of multiplying $m$ by $n$ we can ask for $k$ bits of the result (specific, common examples are the sign or the parity bit).</li>
<li>Instead of asking for the satisfying assignments to a formula, we can ask for a set that contains the satisfying assignments. </li>
</ol>

<p>Note that we have not only changed the problem but also strictly generalized it because a solution to the original problem is still a solution to the modified problem. The big unanswered question now is: How can we find an approximate solution?</p>

<p><strong>Abstract Interpretation Idea 2: Fixed Point Characterization of the Original Solutions</strong></p>

<p>The second big idea is to observe that <em>the set of solutions</em> to many problems has a characterization as a fixed point in a lattice of candidate solutions. As an example, suppose you have a graph and you want to know if a vertex $t$ is reachable from a vertex $s$. We can break this down into finding the set $\mathit{Reach}(s)$ of all vertices reachable from $s$ and then checking if $t$ is in this set. We can further observe that $\mathit{Reach}(s)$ is the least solution to the equation:</p>

<blockquote>
  <p>$X = \{s\} \cup \{ w ~|~ v \text{ is in } X \text{ and } (v,w) \text{ is an edge}\}$</p>
</blockquote>

<p>The value of a fixed point characterization is that the exact solution can be viewed as the limit of a series of approximations. In this example, the $n$-th element of the series is the set of graph vertices reachable in $n$ steps from $s$ and approximation is a subset of these vertices. </p>

<p>The fixed point characterization is a design decision. There are many different characterizations of a set of solutions. Each of them may have different advantages. In the case of programming languages, we have more structure than just dealing with a graph. The fixed point equations we care about can be defined by <em>induction on structure</em> of the input program. This idea is not specific to programs. When applying abstract interpretation to elements of a structured language such as a grammar, logical formula, program, arithmetic expression, etc. we can define fixed points by induction on the structure of some syntactic object.</p>

<p>By giving this fixed point characterization, we are committing to a specific way of computing solutions. We will not actually calculate this fixed point because it is at least as hard as solving the original problem, which brings us to the next step.</p>

<p><strong>Abstract Interpretation Idea 3: Fixed Point Approximation</strong></p>

<p>Instead of computing a fixed point of a function $F$ in a lattice $L$, we can compute a fixed point of another function $G$ in a lattice $M$. Provided certain conditions are met relating $M$ to $L$, a solution computed in $M$ is guaranteed to be an approximation of the solution in $L$. This is one of the foundational results of abstract interpretation, usually called the <em>fixed point transfer theorem</em>. The soundness condition is given either by Galois connections, or weaker settings involving abstraction or concretization functions, or soundness relations. </p>

<p>The fixed point transfer theorem guarantees that you do not have to prove that you are computing a sound approximation every time you design an approximate analysis. You only have to prove that the lattices $L$ (containing original solutions) and $M$ (containing approximations)  and the functions $F$ and $G$ satisfy certain constraints. This is a big win if you are the designer of an analysis and you care about soundness.</p>

<p>You may find the intuition behind fixed point transfer insightful. We can think of a fixed point as the limit of a (possibly transfinite) chain of elements. Computing approximate solutions amounts to approximating this limit, which we can do by approximating elements of the chain.</p>

<p>The notion of approximation depends on the application. If you are using graph reachability to plan a trip, you may accept an approximation that tells you there is no path between $s$ and $t$ even if there is a path, but you will not be happy if the algorithm says there is a path from $s$ to $t$ where there is no path. </p>

<p><strong>Abstract Interpretation Idea 4: Fixed Point Approximation Algorithms</strong></p>

<p>Everything seen so far has been a mathematical existence result. The final step is to compute the approximation. When the lattice of approximations is finite (or if the ascending/descending chain condition is met), we can use a simple iterative procedure. If the lattice is infinite an iterative procedure may not suffice, though computing a fixed point may still be decidable. In this situation, many techniques are used to further approximate the solution, or to jump to an exact solution faster than a naive iteration algorithm. In the context of computing a solution, you hear terms like <em>widening</em>, <em>narrowing</em>, <em>strategy iteration</em>, <em>acceleration</em>, etc.</p>

<p><strong>Summary</strong></p>

<p>In my opinion, abstract interpretation provides a mathematical basis for the notion of abstraction in the same way that mathematical logic provides a mathematical basis for reasoning. The solutions to many problems we care about have characterizations as fixed points. This observation is not restricted to programming language problems and even to computer science. Approximate solutions can be characterized as approximations of fixed points and are computed with specialized algorithms. These characterizations and algorithms will exploit the structure of the problem instance. In the case of programs, this structure is given by the syntax of the language.</p>

<p>Computing approximations to problems that do not have a natural metric is an art constantly developed and refined by practitioners. Abstract interpretation is one mathematical theory for the science behind this art.</p>

<p><strong>References</strong>
There are several good tutorials on abstract interpretation that you can read.</p>

<ol>
<li><a href="http://www.di.ens.fr/~cousot/publications.www/slides-public/PCousot-SBFM-2012-4-1.pdf" rel="noreferrer">A casual introduction to Abstract Interpretation</a>, Patrick Cousot (Joint work with Radhia Cousot), Workshop on Systems Biology and Formals Methods (SBFM'12)</li>
<li><a href="http://www.di.ens.fr/~cousot/publications.www/CousotCousot-Marktoberdorf-2009.pdf" rel="noreferrer">A gentle introduction to formal verification of computer systems by abstract interpretation</a>, Patrick and Radhia Cousot, Marktoberdorf Summer School 2010.</li>
<li><a href="http://web.mit.edu/16.399/www/lecture_13-abstraction1/Cousot_MIT_2005_Course_13_4-1.pdf" rel="noreferrer">Lecture 13: Abstraction Part I</a>, Patrick Cousot, Abstract interpretation, MIT Course.</li>
<li><a href="http://www.cs.berkeley.edu/~necula/cs263/handouts/AbramskiAI.pdf" rel="noreferrer">Introduction to Abstract Interpretation</a>, Samson Abramsky and Chris Hankin, Abstract Interpretation of Declarative Languages, 1987.</li>
<li><a href="http://www.di.ens.fr/~cousot/COUSOTpapers/JLP92.shtml" rel="noreferrer">Abstract interpretation and application to logic programs</a>, Patrick and Radhia Cousot, 1992. The first two sections have a general, high-level overview with several examples.</li>
</ol>

CC BY-SA 3.0
2013-10-27T07:20:31.117Z
2013-10-27T07:50:47.327Z
2013-10-27T07:50:47.327Z
Vijay D
<p>I am now trying to understand better what "abstract interpretation" in programming languages are. I found a good book chapter that explains the idea of extending the domain with a least fixed element, the four axioms that yield a fixed point for a continuous function, and so on. I understand these technical details (though I am not quite sure what is "abstract interpretation" exactly referring to in this whole scheme).</p>

<p>What I am not sure about is what motivates the use of abstract interpretation? Is it just identifying fixed points for computable functions? Is the main motivation coming from having recursion in most programming languages?</p>

<p>Would also be glad to get some high-level overview which does go technically deep enough for someone who has a degree in computer science. I find the Wikipedia page rather unsettling.</p>

CC BY-SA 3.0
2013-10-26T15:50:17.263Z
cite the book plz. wikipedia [abstract interpretation](http://en.wikipedia.org/wiki/Abstract_interpretation)
vzn
CC BY-SA 3.0
2013-10-26T21:40:13.023Z
Could you please mention which book chapter you are reading?
Vijay D
CC BY-SA 3.0
2013-10-27T07:36:33.640Z
Wikipedia is not always the best place for a tutorial on more technical topics.
Vijay D
CC BY-SA 3.0
2013-10-27T20:00:26.887Z
@Vijay and vzn That's one thing I looked at: http://www.cs.berkeley.edu/~necula/cs263/handouts/AbramskiAI.pdf
newToPL
<pl.programming-languages><program-analysis>
What is the goal behind abstract interpretation in programming languages?
newToPL
# What is the goal behind abstract interpretation in programming languages?

(Asked by: username_0 on 2013-10-26)

I am now trying to understand better what "abstract interpretation" in programming languages are. I found a good book chapter that explains the idea of extending the domain with a least fixed element, the four axioms that yield a fixed point for a continuous function, and so on. I understand these technical details (though I am not quite sure what is "abstract interpretation" exactly referring to in this whole scheme).

What I am not sure about is what motivates the use of abstract interpretation? Is it just identifying fixed points for computable functions? Is the main motivation coming from having recursion in most programming languages?

Would also be glad to get some high-level overview which does go technically deep enough for someone who has a degree in computer science. I find the Wikipedia page rather unsettling.

**Tags:** pl.programming-languages, program-analysis
> **Comments:**
> **username_1**: cite the book plz. wikipedia [abstract interpretation](http://en.wikipedia.org/wiki/Abstract_interpretation)  
> **username_2**: Could you please mention which book chapter you are reading?  
> **username_2**: Wikipedia is not always the best place for a tutorial on more technical topics.  
> **username_0**: @Vijay and vzn That's one thing I looked at: http://www.cs.berkeley.edu/~necula/cs263/handouts/AbramskiAI.pdf  

---

## 2 answers

### Answer by username_2 on 2013-10-27. Score: 17 | Accepted answer

Abstract interpretation is a very general concept and depending on whom you ask, you will receive different explanations because versatile concepts admit multiple perspectives. The view in this answer is mine and I would not assume it is general.

**Computational hardness as a motivation**

Let's start with decision problems, whose solutions have a structure like this:

![decision problem](https://i.sstatic.net/IMFNR.png)

There is often an NP-hard lower bound on the procedure. Checking semantic properties of programs is even undecidable. What can we do?

Let's make two observations. First, we can sometimes solve specific problem instances even if we cannot solve the general problem. Second, applications like compiler optimization tolerate approximation in that a compiler that eliminates some but not all sources of inefficiency is useful. To make this intuition precise, we must answer:

1. What does it mean formally to solve some, but not all problem instances?
2. What is an approximate solution to a decision problem?

**Abstract Interpretation Idea 1: Change the Problem Statement**

To me, a major insight of abstract interpretation is to change the problem formulation so that instead of asking for a *Yes/No* answer, we ask for a *Yes/No/Maybe* answer.

![yes-no-maybe](https://i.sstatic.net/AuURN.png)

As a consequence, every problem has a trivial, constant time solution (output *Maybe*). We can now shift our attention to deriving a procedure that does not always produce *Maybe*. To return to the questions above, a solution that works for some problem instances is one that returns *Maybe* on problems it cannot solve. Moreover, *Maybe* is an approximation of *Yes* and *No* because we are not certain what the answer is.

This idea is not restricted to decision problems. Consider these problems concerning programs.

1. Which lines of code in the program are dead (will never be executed)?
2. Which variables in the program have constant values?
3. Which assertions in the program are violated?

In all these situations, we can move from an exact solution to an approximate one by considering solutions that have some uncertainty.

1. What is *a set* of lines of code that is dead?
2. What is *a set* of variables in the program that have constant values?
3. What is *a set* of assertions in the program that is not violated?

The sets produced need not be the largest. This idea is extremely general and applies to problems that have little to do with program analysis.

1. Instead of adding $m$ and $n$, we can ask for a range $[a,b]$ in which the sum lies.
2. Instead of multiplying $m$ by $n$ we can ask for $k$ bits of the result (specific, common examples are the sign or the parity bit).
3. Instead of asking for the satisfying assignments to a formula, we can ask for a set that contains the satisfying assignments.

Note that we have not only changed the problem but also strictly generalized it because a solution to the original problem is still a solution to the modified problem. The big unanswered question now is: How can we find an approximate solution?

**Abstract Interpretation Idea 2: Fixed Point Characterization of the Original Solutions**

The second big idea is to observe that *the set of solutions* to many problems has a characterization as a fixed point in a lattice of candidate solutions. As an example, suppose you have a graph and you want to know if a vertex $t$ is reachable from a vertex $s$. We can break this down into finding the set $\mathit{Reach}(s)$ of all vertices reachable from $s$ and then checking if $t$ is in this set. We can further observe that $\mathit{Reach}(s)$ is the least solution to the equation:

> $X = \{s\} \cup \{ w ~|~ v \text{ is in } X \text{ and } (v,w) \text{ is an edge}\}$

The value of a fixed point characterization is that the exact solution can be viewed as the limit of a series of approximations. In this example, the $n$-th element of the series is the set of graph vertices reachable in $n$ steps from $s$ and approximation is a subset of these vertices.

The fixed point characterization is a design decision. There are many different characterizations of a set of solutions. Each of them may have different advantages. In the case of programming languages, we have more structure than just dealing with a graph. The fixed point equations we care about can be defined by *induction on structure* of the input program. This idea is not specific to programs. When applying abstract interpretation to elements of a structured language such as a grammar, logical formula, program, arithmetic expression, etc. we can define fixed points by induction on the structure of some syntactic object.

By giving this fixed point characterization, we are committing to a specific way of computing solutions. We will not actually calculate this fixed point because it is at least as hard as solving the original problem, which brings us to the next step.

**Abstract Interpretation Idea 3: Fixed Point Approximation**

Instead of computing a fixed point of a function $F$ in a lattice $L$, we can compute a fixed point of another function $G$ in a lattice $M$. Provided certain conditions are met relating $M$ to $L$, a solution computed in $M$ is guaranteed to be an approximation of the solution in $L$. This is one of the foundational results of abstract interpretation, usually called the *fixed point transfer theorem*. The soundness condition is given either by Galois connections, or weaker settings involving abstraction or concretization functions, or soundness relations.

The fixed point transfer theorem guarantees that you do not have to prove that you are computing a sound approximation every time you design an approximate analysis. You only have to prove that the lattices $L$ (containing original solutions) and $M$ (containing approximations) and the functions $F$ and $G$ satisfy certain constraints. This is a big win if you are the designer of an analysis and you care about soundness.

You may find the intuition behind fixed point transfer insightful. We can think of a fixed point as the limit of a (possibly transfinite) chain of elements. Computing approximate solutions amounts to approximating this limit, which we can do by approximating elements of the chain.

The notion of approximation depends on the application. If you are using graph reachability to plan a trip, you may accept an approximation that tells you there is no path between $s$ and $t$ even if there is a path, but you will not be happy if the algorithm says there is a path from $s$ to $t$ where there is no path.

**Abstract Interpretation Idea 4: Fixed Point Approximation Algorithms**

Everything seen so far has been a mathematical existence result. The final step is to compute the approximation. When the lattice of approximations is finite (or if the ascending/descending chain condition is met), we can use a simple iterative procedure. If the lattice is infinite an iterative procedure may not suffice, though computing a fixed point may still be decidable. In this situation, many techniques are used to further approximate the solution, or to jump to an exact solution faster than a naive iteration algorithm. In the context of computing a solution, you hear terms like *widening*, *narrowing*, *strategy iteration*, *acceleration*, etc.

**Summary**

In my opinion, abstract interpretation provides a mathematical basis for the notion of abstraction in the same way that mathematical logic provides a mathematical basis for reasoning. The solutions to many problems we care about have characterizations as fixed points. This observation is not restricted to programming language problems and even to computer science. Approximate solutions can be characterized as approximations of fixed points and are computed with specialized algorithms. These characterizations and algorithms will exploit the structure of the problem instance. In the case of programs, this structure is given by the syntax of the language.

Computing approximations to problems that do not have a natural metric is an art constantly developed and refined by practitioners. Abstract interpretation is one mathematical theory for the science behind this art.

**References**
There are several good tutorials on abstract interpretation that you can read.

1. [A casual introduction to Abstract Interpretation](http://www.di.ens.fr/~cousot/publications.www/slides-public/PCousot-SBFM-2012-4-1.pdf), Patrick Cousot (Joint work with Radhia Cousot), Workshop on Systems Biology and Formals Methods (SBFM'12)
2. [A gentle introduction to formal verification of computer systems by abstract interpretation](http://www.di.ens.fr/~cousot/publications.www/CousotCousot-Marktoberdorf-2009.pdf), Patrick and Radhia Cousot, Marktoberdorf Summer School 2010.
3. [Lecture 13: Abstraction Part I](http://web.mit.edu/16.399/www/lecture_13-abstraction1/Cousot_MIT_2005_Course_13_4-1.pdf), Patrick Cousot, Abstract interpretation, MIT Course.
4. [Introduction to Abstract Interpretation](http://www.cs.berkeley.edu/~necula/cs263/handouts/AbramskiAI.pdf), Samson Abramsky and Chris Hankin, Abstract Interpretation of Declarative Languages, 1987.
5. [Abstract interpretation and application to logic programs](http://www.di.ens.fr/~cousot/COUSOTpapers/JLP92.shtml), Patrick and Radhia Cousot, 1992. The first two sections have a general, high-level overview with several examples.


---

### Answer by username_3 on 2013-10-26. Score: 7

I agree that it's often hard to extract the main point from all those details. (In fact, my big issue with every treatment of abstract interpretation I've seen is that they present so much machinery without motivating it.)

Here's how I think of it:

**Abstract interpretation is running programs, approximately, on large sets of inputs all at once.**

This doesn't cover everything, but it holds up well in general.

The canonical example is evaluating arithmetic expressions to determine the sign of the result. You can imagine a hypothetical, infinitely fast machine that can evaluate an expression on every positive input and return the set of results. If you had one of those, you could in principle determine things like "this program returns positive numbers when given positive numbers."

But of course you don't actually have that machine. You're stuck in real life, so you have to either do the same thing *symbolically*, which can give exact answers sometimes but often fail, or *approximately*, in a way that always returns answers but they may not be exact. The latter is what abstract interpretation does.

You can't even represent the set of all positive numbers directly. Instead, you need an *abstraction* of that set. You also need to abstract the negative numbers and zero. You end up with a family of finite *abstract* sets $\{neg,zero,pos\}$, that represent the *concrete* sets $\{\{...,-2,-1\},\{0\},\{1,2,...\}\}$.

Now you can come up with rules, such as "adding two positive numbers results in a positive number," or $add : pos \times pos \to pos$. Come up with rules for each of your language primitives, and you can pretend to evaluate arithmetic expressions on large sets of inputs all at the same time.

Of course, the "adding a positive and a negative number" rule will give you trouble, because additions like that can return anything. The abstract interpretation framework helps you out, here: it says you should return a *sound* approximation that is as tight as possible. If your rules are sound, and they say addition returns something in an abstract set, any concrete evaluation should return a number in the corresponding concrete set. For example, the $add : pos \times pos \to pos$ rule is sound if $add(a,b)$ is positive for every positive $a$ and $b$. Also, $pos \times neg \to (pos \sqcup zero \sqcup neg)$ is sound, where "$\sqcup$" is your abstract sets' union operation.

I believe even the youngest PL researcher could code up an abstract interpretation like this in an afternoon. It's actually not that hard, and you should try it before reading much more to get a feel for the basics. While you do, you'll discover that your abstract sets need some notion of intersection (denoted "$\sqcap$") and subset (denoted "$\sqsubseteq$"). They should correspond with concrete intersection and subset.

When you want to prove that your abstract interpretation is as tight as possible, you'll want a *Galois connection* to formalize this correspondence. Just having one ensures that, for any given concrete set, a tightest abstract set exists.

When you want to work with a language with loops or recursion, your programs may not terminate, so you'll need a $\bot$ value to represent nontermination. You'll need to "compute" (in a mathematical sense) concrete functions as fixpoints, and compute abstract functions similarly. If you have higher-order functions, you'll find that typical topological machinery doesn't handle them at all (higher-order application is generally not continuous), and need Scott domains.

IOW, what you've identified as the motivation for abstract interpretation is really the motivation for the machinery required for doing abstract interpretation on Turing-equivalent languages. The actual motivation is usefully summarizing the behavior of programs by running them on many inputs at once.


---

