Algorithmadvanced
One-level flow analysis
Also called Das one level flow.
Points-to analysis with subset constraints at the top pointer level and unification below. Das measured it nearly as precise as Andersen and nearly as fast as Steensgaard.
- Solves
- Points-to analysis
- Time
- O(n (n + m)) worstO((n + m) α(n + m)) unification-phase
- Space
- O(n^2 + m) extra
- Where
- m = the number of pointer statements; n = the number of variables; α = the inverse Ackermann function
- Model
- Word RAM
- Properties
- not context sensitivedeterministicnot flow sensitiveofflineiterative
- Evidence
- Full proofCode in 1 languages
- Origin
- Manuvir Das, 2000
One-level flow is a points-to analysis that sits between Steensgaard's analysis and Andersen's analysis. It reads each assignment as a subset constraint on the values that the assignment moves, as Andersen does, but only at that one level. The things those values point to are unified, as Steensgaard does. Das proposed it in 2000 after he saw that in C programs, most of the precision that Andersen's analysis gains over Steensgaard's comes from copies of top-level pointers. The unification phase runs in almost linear time; the final sets come from one reachability pass over the flow edges.
In plain words
Steensgaard's method is fast but merges too much: after p = q, the two pointers share all their targets, in both directions. Andersen's method keeps the direction, so only p gains the targets of q, but it is slow. One-level flow keeps the direction for the value that the assignment copies, and merges everything under it. So after p = q, the pointer p gets the targets of q, and not the other way around. The cells that those targets point to are merged into one group, as Steensgaard would do. In C, most copies are of plain pointers, so this keeps most of the precision of the slow method. The merges are cheap, and one walk along the arrows at the end gives the sets.
The problem
The input and the output are those of Andersen's analysis: statements p = &a, p = q, p = *q and *p = q over variables, each also a location, with p = alloc at site read as p = &h_k; the output is a set for each variable that meets all the subset constraints. One-level flow gives a set between the two others in precision on most programs, at a cost much lower than Andersen's. The analysis in the terms of a data-flow framework:
| item | value |
|---|---|
| direction | none: flow-insensitive, one answer for the whole program |
| may or must | may |
| domain | a partition of value nodes, each class with a base set of locations, at most one deref class and flow edges |
| order | coarser partitions, larger base sets and more edges (bottom is precise) |
| join | merging classes; union of base sets and edges |
| bottom and top | each node alone, empty base sets, no edges; one class holding everything |
| boundary value | none |
| initial value | one value node per location, alone, with an empty base set |
| transfer | monotone, not distributive |
The algorithm
Each location has a value node , which stands for the values stored in . The value nodes are in a union-find forest. A class has a base set (the addresses stored in it directly), at most one deref node (the value node of the locations that its values point to) and flow edges to other classes. An assignment adds a flow edge from the value node of its right side to the value node of its left side, and unifies the deref nodes of the two ends. Unifying two classes also unifies their deref nodes. This page writes the method with explicit nodes and edges; Das writes it as a type system in the style of Steensgaard, with flow edges between the outermost types.
ONE-LEVEL-FLOW(S)- 1
make a value node V(a) for each variable a, alone, with an empty base set - 2
for each statement of S, in any order do - 3
x = &a: add a to base(V(x)); UNIFY(V(a), DEREF(V(x))) - 4
x = y: FLOW(V(y), V(x)) - 5
x = *y: FLOW(DEREF(V(y)), V(x)) - 6
*x = y: FLOW(V(y), DEREF(V(x))) return CLOSURE()FLOW(u, v)- 7
add the flow edge u -> v - 8
UNIFY(DEREF(u), DEREF(v)) DEREF(u)- 9
if the class of u has no deref node then give it a new one return the class of its deref nodeUNIFY(x, y)- 10
while a pair (x, y) of classes waits to be unified do - 11
merge x and y into one class c - 12
base(c) <- base(x) + base(y); the edges of c are those of x and y - 13
if both had deref nodes then queue the pair of the two deref nodes; else c keeps the one it has CLOSURE()- 14
for each location a do - 15
add a to the set of every class that a class with a in its base set reaches along flow edges - 16
return S(v) = the set of the class of V(v), for each v
Lines L1 to L13 are phase 1, and CLOSURE is phase 2. Each statement adds at most one flow edge, and each edge is directional, so the top level keeps Andersen's precision. Everything that DEREF reaches is unified. Phase 2 is a graph reachability pass, one search per location. Unlike Andersen's analysis, phase 1 never adds an edge because a set grew: the deref node of a class stands for all its targets at once, so loads and stores need one edge each.
Example
entry:
a = &x
b = &y
p = &a
q = &b
p = q
ret 0
Phase 1:
| statement | what happens |
|---|---|
a = &x |
goes into ; is unified with the deref node of |
b = &y |
goes into ; is unified with the deref node of |
p = &a |
goes into ; is unified with the deref node of |
q = &b |
goes into ; is unified with the deref node of |
p = q |
flow edge ; the deref nodes of and , which are and , are unified, so and form one class with base set , and their deref nodes and are unified too |
Phase 2 sends along the edge . The three analyses give:
| variable | Andersen | one-level flow | Steensgaard |
|---|---|---|---|
At the top level, one-level flow keeps the direction of p = q, so does not get . One level down, it merges what and hold, as Steensgaard does.
Correctness
The full proof is in the proof file. Its steps:
- Merges keep derefs together. When two classes merge, their deref nodes are unified in the same call, so the deref class of a node at any moment stays the deref class of its class at the end.
- Two invariants. At the end, if is in the base set of a class , then is in the deref class of ; and the two ends of each flow edge have the same deref class.
- Sets share one deref class. Following a path of flow edges, every location in the set of a class has its value node in the deref class of .
- The result is a solution. For
x = *yand in , step 3 puts in the deref class of , which has the edge to that line L5 added, so . The store is the same, and the other forms are direct. - It contains Andersen's result. Andersen's sets are the least solution.
When the program has only address and copy statements and no target of an address is ever assigned, the result is exactly Andersen's: the proof file shows this, and a test checks it on random programs.
Proof: One-level flow gives a solution of the subset constraints, so its sets contain Andersen's, in O(n (n + m)) timefull
Setting. The program is a set of statements in the four forms over variables, each variable also a location. is the least solution of the subset constraints of Andersen's analysis; it lies inside every solution. The algorithm keeps a union-find forest of value nodes. At the end, for a node write for its root, for the base set of , and for the root of the deref node of , when there is one. The flow edges are read on the roots: an edge recorded as is the edge . The result is
the union of the base sets of all roots that reach along flow edges, included.
Lemma 1 (merges keep derefs together). If two nodes and end in one class and both classes had a deref node at some moment, those deref nodes end in one class. If had a deref node at some moment, then has a deref node at the end and .
Proof. A deref is set only on a root with none (line L9), or in UNIFY. When UNIFY merges roots and with derefs and , the new root keeps (or if had none), and if both are set it queues the pair in line L13, which the same call of UNIFY merges before it returns. So, by induction on the merges, the deref of a class stays in the class of every deref that any of its nodes had.
Lemma 2 (the two invariants). At the end:
- if for a root , then has a deref node and ;
- for every flow edge , both ends have deref nodes and .
Proof. Line L3 puts into the base set of the root of and unifies with the deref node of that root, which line L9 makes if needed. Base sets move to the new root when classes merge (line L12), and by Lemma 1 the deref node of the new root is in the class of the old one. So part 1 holds at the end. Each flow edge is added by FLOW (line L7), which unifies the deref nodes of its two ends in line L8, and Lemma 1 again carries this to the end.
Lemma 3 (sets in a closure share one deref class). If , then .
Proof. There is a path of flow edges with . By part 1, , and by part 2, .
Theorem 1 (the result is a solution). meets every subset constraint.
Proof. Take each statement form.
x = &a. Line L3 puts into , so .x = y. Line L4 adds the edge , and every root that reaches also reaches , so .x = *y. Line L5 adds the edge , where is the deref node of at that time; by Lemma 1, at the end. Let . By Lemma 3, , so .*x = y. Line L6 adds the edge , with at the end. Let . By Lemma 3, , so .
Corollary (containment). for every variable , since is the least solution. So the result is sound for every run that executes the statements in any order.
Equality on one level. Suppose the program has only statements x = &a and x = y, and no variable whose address is taken is on the left of a statement. Call such variables targets and the others pointers. UNIFY only ever merges deref nodes and value nodes of targets, so the value node of each pointer stays alone in its class, and the flow edges join only pointer nodes. A target node has no base set and no incoming edge, so for a target , and for a pointer is the set of addresses that reach along copy edges, which is . So in this case the result is exactly Andersen's, and the loss of precision comes from the levels below the top.
Theorem 2 (time). Phase 1 (lines L1 to L13) takes time if base sets are merged in , for example as linked lists; phase 2 (lines L14 to L16) takes time. The space is for phase 1 and for the sets.
Proof. There are value nodes for the variables, and line L9 makes at most one node per call of DEREF, at most in total, so there are nodes. Each statement makes calls of UNIFY and at most one flow edge. Each pair that UNIFY takes from its queue either finds one class, or merges two classes and queues at most one more pair, and there are at most merges. So phase 1 does finds and unions, which cost , and other work. In phase 2, each location starts one search from the roots whose base set holds it; the search visits each root and each of the at most edges once. With at most locations, phase 2 costs .
The implementation merges base sets as Python sets, at a cost of the size of the moved set at each merge, so its phase 1 can cost in the worst case, the same order as phase 2.
Complexity
Proved. Phase 1 makes at most nodes and union-find operations, so it takes time if base sets join in , with the inverse Ackermann function. Phase 2 runs one search per location over at most nodes and edges, so time, and the sets take space. A client that asks only some queries can run phase 2 for them alone.
Stated in the paper, not proved here. Das reports that on his C benchmarks the analysis was nearly as precise as Andersen's and its running time was close to Steensgaard's.
Measured, not proved. In the seeded tests, on 400 random programs of up to 30 statements, every set contained Andersen's. In a separate seeded run of 5,000 random programs, the result equalled Andersen's on 3,686 of them.
Properties
- Between the two classic analyses, mostly. The sets always contain Andersen's. They usually lie inside Steensgaard's, but not always: in the seeded run above, 48 of the 5,000 programs had some set that was not inside Steensgaard's. The smallest such program found is
v1 = *v1,v0 = *v1,v0 = &v0. This formulation unifies the deref nodes at once, even for a pointer that never gets a target, while Steensgaard's analysis waits with its pending lists. - Directional at one level. A copy
p = qmoves addresses from to only. A load or a store moves values directionally between a pointer and the class of its targets. - Two phases. The unification phase is online and cheap; the closure phase is the only part that can be quadratic.
- Order independent. The tests found no case where the order of the statements changed the result.
Variants and improvements
- More levels. Keeping the direction for levels gives analyses between one-level flow and Andersen's. Das's measurements suggest that one level already gives most of the gain on C programs.
- Conditional unification. Unifying deref nodes only once both sides can hold an address, as Steensgaard's pending lists do, would avoid the extra merges in the small example of the Properties section.
- Context sensitivity. The flow edges can be labelled with the calls and returns they cross, and a path then counts only if its calls and returns match like brackets. This gives context sensitivity as a form of CFL-reachability.
- Fields. As with the other analyses, structures can be split into fields; see field sensitivity.
When to use it
Use it for C programs of millions of lines when Steensgaard's sets are too coarse and Andersen's analysis is too slow. It is a good fit for clients that care about top-level pointers, such as call graphs through function pointers held in variables. For programs where most pointer traffic goes through the heap, such as Java programs with many objects that point to objects, the unified levels lose more, and an optimized Andersen's analysis is the better choice.
Pitfalls
- Forgetting to unify the derefs of a flow edge. If FLOW adds the edge but does not unify the deref nodes of its ends, a load through a pointer that got its targets by a copy misses facts. Step 2 of the proof needs this unification.
- Unifying the two ends of a copy. Merging and for
p = qgives Steensgaard's analysis, not one-level flow. Only the deref nodes are unified. - Reading the classes as sets. Two variables whose value nodes are in one class have equal sets, but the sets of the others come from the closure in phase 2, not from the classes.
- Treating the closure as cheap. Phase 2 is a reachability pass and can be quadratic. Compute it once and store it, or compute it per query.
Implementations
Each implementation follows the pseudocode above. A comment @line links a line of code to a line of the pseudocode. Point at a line of the pseudocode to see the matching code. The build runs the native tests of each language.
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/das-one-level-flow/. The authors are listed in prov/ADSKYW.jsonl.
"""Das's one-level flow points-to analysis.
das(stmts) takes statements in the four forms of ptsgen and returns a dict
from each variable to the set of variables it may point to.
Each location a has a value node V(a), which stands for the values stored in
a. Value nodes are kept in a union-find forest. A root has a base set of
locations (the addresses stored there directly), at most one deref node
(the value node of the locations that those values point to) and flow edges.
An assignment adds a flow edge from the value node of its right side to the
value node of its left side: this one level is directional, as in
Andersen's analysis. The deref nodes at the two ends of the edge are
unified, as in Steensgaard's analysis, so every level below the top is
shared. At the end, the set of a value node is the union of the base sets of
all nodes that reach it along flow edges.
"""
from collections import deque
import ptsgen
def _build(stmts):
names = ptsgen.variables(stmts)
parent, rank, base, deref = [], [], [], []
def new():
parent.append(len(parent))
rank.append(0)
base.append(set())
deref.append(None)
return len(parent) - 1
def find(x):
root = x
while parent[root] != root:
root = parent[root]
while parent[x] != root:
parent[x], x = root, parent[x]
return root
def get_deref(u):
u = find(u)
if deref[u] is None:
deref[u] = new() # @line L9
return find(deref[u])
def unify(x, y):
work = deque([(x, y)])
while work: # @line L10
x, y = work.popleft()
x, y = find(x), find(y)
if x == y:
continue
if rank[x] < rank[y]:
x, y = y, x
parent[y] = x # @line L11
if rank[x] == rank[y]:
rank[x] += 1
base[x] |= base[y] # @line L12
dx, dy = deref[x], deref[y]
if dx is None:
deref[x] = dy
elif dy is not None:
work.append((dx, dy)) # @line L13
edges = []
def flow(u, v):
edges.append((u, v)) # @line L7
unify(get_deref(u), get_deref(v)) # @line L8
V = {a: new() for a in names} # @line L1
for kind, x, y in stmts: # @line L2
if kind == "addr":
base[find(V[x])].add(y) # @line L3
unify(V[y], get_deref(V[x]))
elif kind == "copy":
flow(V[y], V[x]) # @line L4
elif kind == "load":
flow(get_deref(V[y]), V[x]) # @line L5
else:
flow(V[y], get_deref(V[x])) # @line L6
return names, V, find, base, edges
def das(stmts):
names, V, find, base, edges = _build(stmts)
succ = {}
for u, v in edges:
u, v = find(u), find(v)
if u != v:
succ.setdefault(u, set()).add(v)
# Phase 2: for each location, a search along the flow edges from the
# nodes whose base set holds it.
holders = {}
for r in {find(i) for i in range(len(base))}:
for a in base[r]:
holders.setdefault(a, []).append(r)
sets = {}
for a, starts in holders.items(): # @line L14
seen = set(starts)
stack = list(starts)
while stack:
u = stack.pop()
sets.setdefault(u, set()).add(a) # @line L15
for w in succ.get(u, ()):
if w not in seen:
seen.add(w)
stack.append(w)
return {v: set(sets.get(find(V[v]), ())) for v in names} # @line L16
def value_classes(stmts):
"""The groups of variables whose value nodes were unified, as sorted
lists. Variables in one group have equal sets."""
names, V, find, _, _ = _build(stmts)
groups = {}
for v in names:
groups.setdefault(find(V[v]), []).append(v)
return sorted(sorted(g) for g in groups.values())
def points_to(text):
return das(ptsgen.parse(text))
ptsgen.py 177 lines
# SPDX-License-Identifier: MIT
# Shared helper of the compilers and program analysis pages of https://algorithm.tamnd.com/. The authors are listed in prov/.
"""Points-to constraints in the four basic forms, for the pointer analysis pages.
A program is a list of statements. Each statement is a tuple with the same
shape as the pointer instructions of the toy IR (toyir.py):
("addr", p, a) p = &a
("copy", p, q) p = q
("load", p, q) p = *q
("store", p, q) *p = q
Every name is a pointer variable, and every variable is also a memory
location whose address the program may take. A points-to solution is a dict
from each variable to a set of variables. The order of the statements does
not matter to a flow-insensitive analysis.
parse(text) and show(stmts) convert to and from the toy IR notation.
random_program(rng, nvars, nstmts) builds a random program.
least_solution(stmts) is a slow reference: it applies the four rules to
every statement, round after round, until nothing changes.
is_solution(stmts, pts) checks that pts meets every constraint.
concrete_facts(stmts, rng, runs, steps) runs the program concretely, with
the statements in random order, and returns the facts (p, a) that some run
saw: p held the address of a.
"""
import re
_NAME = r"[A-Za-z_][A-Za-z0-9_]*"
_FORMS = [
("addr", re.compile(r"(%s) = &(%s)" % (_NAME, _NAME))),
("load", re.compile(r"(%s) = \*(%s)" % (_NAME, _NAME))),
("store", re.compile(r"\*(%s) = (%s)" % (_NAME, _NAME))),
("copy", re.compile(r"(%s) = (%s)" % (_NAME, _NAME))),
]
def parse(text):
"""Parse lines such as "p = &a", "p = q", "p = *q" and "*p = q".
The k-th "p = alloc" becomes "p = &hk", one location per allocation
site. Blank lines, lines that start with #, block labels and the
terminators jump, br and ret are skipped, so a toy IR program with only
pointer instructions can be read as it is. A flow-insensitive analysis
ignores the order of the statements, so the blocks do not matter."""
stmts = []
sites = 0
for raw in text.splitlines():
line = " ".join(raw.split())
if not line or line.startswith("#") or line.endswith(":"):
continue
if line.split()[0] in ("jump", "br", "ret"):
continue
m = re.fullmatch(r"(%s) = alloc" % _NAME, line)
if m:
sites += 1
stmts.append(("addr", m.group(1), "h%d" % sites))
continue
for kind, rx in _FORMS:
m = rx.fullmatch(line)
if m:
stmts.append((kind, m.group(1), m.group(2)))
break
else:
raise ValueError("not a pointer statement: %r" % raw)
return stmts
def show(stmts):
out = []
for kind, x, y in stmts:
if kind == "addr":
out.append("%s = &%s" % (x, y))
elif kind == "copy":
out.append("%s = %s" % (x, y))
elif kind == "load":
out.append("%s = *%s" % (x, y))
else:
out.append("*%s = %s" % (x, y))
return "\n".join(out)
def variables(stmts):
"""All names, in the order of their first use."""
seen = {}
for _, x, y in stmts:
seen.setdefault(x, None)
seen.setdefault(y, None)
return list(seen)
def random_program(rng, nvars=8, nstmts=30, weights=(3, 4, 2, 2)):
"""A random list of nstmts statements over the names v0 .. v(nvars-1).
weights gives the relative number of addr, copy, load and store forms."""
names = ["v%d" % i for i in range(nvars)]
kinds = ["addr", "copy", "load", "store"]
return [
(rng.choices(kinds, weights)[0], rng.choice(names), rng.choice(names))
for _ in range(nstmts)
]
def least_solution(stmts):
"""The least solution of the inclusion constraints, by plain iteration."""
pts = {v: set() for v in variables(stmts)}
changed = True
while changed:
changed = False
for kind, x, y in stmts:
if kind == "addr":
new = {y}
targets = [x]
elif kind == "copy":
new = pts[y]
targets = [x]
elif kind == "load":
new = set()
for a in pts[y]:
new |= pts[a]
targets = [x]
else:
new = pts[y]
targets = list(pts[x])
for t in targets:
if not new <= pts[t]:
pts[t] |= new
changed = True
return pts
def is_solution(stmts, pts):
"""True if pts satisfies every constraint of stmts."""
for kind, x, y in stmts:
if kind == "addr" and y not in pts[x]:
return False
if kind == "copy" and not pts[y] <= pts[x]:
return False
if kind == "load" and any(not pts[a] <= pts[x] for a in pts[y]):
return False
if kind == "store" and any(not pts[y] <= pts[a] for a in pts[x]):
return False
return True
def concrete_facts(stmts, rng, runs=20, steps=120):
"""Run the program concretely. Each variable holds no value at the start.
A run is a sequence of statements in any order, with repeats, which is the
semantics that a flow-insensitive analysis must cover; every path of a
real control flow graph over these statements is such a sequence. A
statement that reads a variable with no value, or goes through one,
cannot run, so the run picks another. Returns the set of pairs (p, a)
such that p held the address of a at some moment of some run."""
seen = set()
for _ in range(runs):
val = {v: None for v in variables(stmts)}
for _ in range(steps):
kind, x, y = stmts[rng.randrange(len(stmts))]
if kind == "addr":
val[x] = y
dst = x
elif kind == "copy":
if val[y] is None:
continue
val[x] = val[y]
dst = x
elif kind == "load":
if val[y] is None or val[val[y]] is None:
continue
val[x] = val[val[y]]
dst = x
else:
if val[x] is None or val[y] is None:
continue
dst = val[x]
val[dst] = val[y]
seen.add((dst, val[dst]))
return seen
test_das_one_level_flow.py 95 lines
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/das-one-level-flow/. The authors are listed in prov/ADSKYW.jsonl.
import random
import ptsgen
from das_one_level_flow import das, points_to, value_classes
PAGE = """
entry:
a = &x
b = &y
p = &a
q = &b
p = q
ret 0
"""
def test_page_example():
pts = points_to(PAGE)
assert pts["p"] == {"a", "b"}
assert pts["q"] == {"b"} # the top level keeps its direction
assert pts["a"] == {"x", "y"} # the level below is unified
assert pts["b"] == {"x", "y"}
assert pts["x"] == set() and pts["y"] == set()
assert ["a", "b"] in value_classes(ptsgen.parse(PAGE))
# Andersen's analysis keeps a and b apart.
least = ptsgen.least_solution(ptsgen.parse(PAGE))
assert least["a"] == {"x"} and least["b"] == {"y"}
def test_store_and_load():
# The store writes into the value node of a; the load reads it back.
pts = points_to("p = &a\nq = &x\n*p = q\nr = *p")
assert pts["a"] == {"x"} and pts["r"] == {"x"}
assert pts["q"] == {"x"} and pts["p"] == {"a"}
def test_copy_direction_at_top_level():
pts = points_to("p = &a\nq = &b\np = q")
assert pts == {"p": {"a", "b"}, "a": set(), "q": {"b"}, "b": set()}
def test_contains_andersen_on_random_programs():
rng = random.Random(2000)
for trial in range(400):
stmts = ptsgen.random_program(rng, rng.randint(2, 12), rng.randint(1, 30))
pts = das(stmts)
least = ptsgen.least_solution(stmts)
for v in least:
assert least[v] <= pts[v], ptsgen.show(stmts)
assert ptsgen.is_solution(stmts, pts)
def test_equals_andersen_with_one_level_of_pointers():
# Pointers p0.. take the addresses of targets t0.., which are never
# assigned, and are copied into each other. Only the top level holds
# addresses, so the unified level below loses nothing.
rng = random.Random(3)
for trial in range(200):
stmts = []
for _ in range(30):
p, q = "p%d" % rng.randrange(8), "p%d" % rng.randrange(8)
if rng.random() < 0.3:
stmts.append(("addr", p, "t%d" % rng.randrange(5)))
else:
stmts.append(("copy", p, q))
assert das(stmts) == ptsgen.least_solution(stmts)
def test_unified_level_can_lose_precision():
# Here the targets a and b are pointers too; p = q unifies the values
# stored in a and in b, which Andersen's analysis keeps apart.
pts = points_to("p = &a\nq = &b\na = &x\nb = &y\np = q")
assert pts["a"] == pts["b"] == {"x", "y"}
def test_sound_against_concrete_runs():
rng = random.Random(77)
for trial in range(150):
stmts = ptsgen.random_program(rng, rng.randint(3, 10), 30)
pts = das(stmts)
for p, a in ptsgen.concrete_facts(stmts, rng, runs=10, steps=150):
assert a in pts[p]
def test_order_of_statements_does_not_change_the_result():
rng = random.Random(19)
for trial in range(200):
stmts = ptsgen.random_program(rng, rng.randint(2, 10), 30)
first = das(stmts)
shuffled = stmts[:]
rng.shuffle(shuffled)
assert das(shuffled) == first
History
Manuvir Das presented one-level flow at PLDI 2000 under the title "Unification-based pointer analysis with directional assignments". His starting point was a measurement: on C programs, the extra precision of Andersen's analysis over Steensgaard's came mostly from assignments of top-level pointers. The method showed that the choice between unification and inclusion need not be made for the whole program, and later analyses mix the two in other ways.
References
- Manuvir Das, Unification-based pointer analysis with directional assignments, Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI 2000), 35 to 46, whole paper (the observation about top-level copies in C, the flow edges between the outer types, the unification below them, and the comparison with Steensgaard's and Andersen's analyses)
- Bjarne Steensgaard, Points-to analysis in almost linear time, Proceedings of the 23rd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL '96), 32 to 41, 1996, the unification-based analysis with union-find that one-level flow keeps below the top level
- Lars Ole Andersen, Program Analysis and Specialization for the C Programming Language, PhD thesis, DIKU, University of Copenhagen, 1994 (DIKU report 94/19), the chapter on pointer analysis, with the inclusion constraints that one-level flow keeps at the top level
- Michael Hind, Pointer analysis, haven't we solved this problem yet?, Proceedings of the ACM SIGPLAN-SIGSOFT Workshop on Program Analysis for Software Tools and Engineering (PASTE '01), 54 to 61, 2001, the place of one-level flow between the unification-based and the inclusion-based analyses
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 | H2 full proof |
|
| Lean | L0 no Lean part |
|
| Code (python) | I0 not checked yet |
|
| Visual | V0 none |
|
| Writing | W2 basic |
|
Tag ADSKYW Edit this page History Report an error Markdown