Skip to content

Commit 63347d5

Browse files
committed
Addressed two comments I had missed.
1 parent 3b3a8d4 commit 63347d5

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

doc/architectural/background-concepts.md

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ digraph ast {
230230
}
231231
\enddot
232232
233-
In the end, we produce a sequence of graphs modeling each declaration
233+
In the end, we produce a sequence of trees modeling each declaration
234234
in the translation unit (i.e., the file `factorial.c`).
235235
236236
This data structure is already useful: At this level, we can easily
@@ -371,9 +371,7 @@ here is the code:
371371
}
372372
return fac;
373373
```
374-
375-
This function
376-
consists of four basic blocks:
374+
This function consists of four basic blocks:
377375
1. `Declaration: unsigned long fac.1, value 1`<br/>
378376
`Declaration: unsigned i.1, value 1`
379377
2. `i.1 <= n.1`
@@ -708,7 +706,18 @@ An abstract interpretation is made up from four ingredients:
708706
in the previous step that describes the behavior of the program.
709707

710708
The first ingredient we need for abstract interpretation is the
711-
**abstract domain**. An abstract domain is a set $D$ (or, if you
709+
**abstract domain**.
710+
The domain allows us to express what we know about a given variable or
711+
value at a given program location; in our example, whether it is zero or not.
712+
The way we use the abstract domain is for each program point, we have a
713+
map from visible variables to elements of the abstract domain,
714+
describing what we know about the values of the variables at this point.
715+
716+
For instance, consider the `factorial` example again. After running the
717+
first basic block, we know that `fac` and `i` both contain 1, so we have
718+
a map that associates both `fac` and `i` to "not 0".
719+
720+
An abstract domain is a set $D$ (or, if you
712721
prefer, a data type) with the following properties:
713722
- There is a function merge that takes two elements of $D$ and returns
714723
an element of $D$. This function is associative (merge(x, merge(y,z))
@@ -717,9 +726,11 @@ prefer, a data type) with the following properties:
717726
- There is an element bottom of $D$ such that merge(x, bottom) = x.
718727

719728
Algebraically speaking, $D$ needs to be a semi-lattice.
729+
720730
For our example, we use the following domain:
721731
- D contains the elements "bottom" (nothing is known),
722732
"equals 0", "not 0" and "could be 0".
733+
723734
- merge is defined as follows:
724735
merge(bottom, x) = x
725736
merge("could be 0", x) = "could be 0"
@@ -728,16 +739,6 @@ For our example, we use the following domain:
728739
- bottom is bottom, obviously.
729740
It is easy but tedious to check that all conditions hold.
730741

731-
The domain allows us to express what we know about a given variable or
732-
value at a given program location; in our example, whether it is zero or not.
733-
The way we use the abstract domain is for each program point, we have a
734-
map from visible variables to elements of the abstract domain,
735-
describing what we know about the values of the variables at this point.
736-
737-
For instance, consider the `factorial` example again. After running the
738-
first basic block, we know that `fac` and `i` both contain 1, so we have
739-
a map that associates both `fac` and `i` to "not 0".
740-
741742
The second ingredient we need are the **abstract state transformers**.
742743
An abstract state transformer describes how a specific expression or
743744
statement processes abstract values. For the example, we need to define

0 commit comments

Comments
 (0)