Algorithm Search⌘K

Dataflow analysis and abstract interpretation

Problems

  • Available expressions

    For each program point, find the expressions computed on every path to it with no later change to their operands.

    intro
  • Live variable analysis

    For each program point, find the variables whose current value may be read on some path before being overwritten.

    intro
  • Reaching definitions

    For each program point, find the definitions of variables that can reach it along some path without being overwritten.

    intro
  • Constant propagation

    For each program point, find the variables that hold the same known value on every path, using a flat lattice that is monotone but not distributive.

    core
  • Program slicing

    Given a program point and a set of variables, find the statements that may affect their values there.

    O(n + e) dependence-slicecore
  • Very busy expressions

    For each program point, find the expressions that every path from it computes before any of their operands change.

    core
  • Shape analysis

    Infer the shape of heap data structures a program builds, such as acyclic lists or trees, to prove memory safety and data invariants.

    advanced

Algorithms

  • Slicing by dependence graph reachability

    Computes a backward slice as the set of nodes that reach the criterion in the program dependence graph, in linear time in its size.

    O(n + e) worst1 languagescore
  • Sparse conditional constant propagation

    Propagates constants over SSA edges and executable flow edges together, so it ignores branches that constants prove dead.

    O(n + m + s d) worst · average1 languagescore
  • Weiser's slicing algorithm

    Computes a backward slice by iterating relevant-variable sets over the flow graph and adding the branches that control included statements.

    O((c + 1) ((n + m) v^2 + c n)) worst1 languagescore
  • Worklist dataflow algorithm

    Solves dataflow equations by keeping a worklist of nodes whose input changed and applying their transfer functions until nothing changes.

    O((n + m)(h + 1)) worst · average1 languagescore
  • Dynamic slicing

    Finds the statements that affected a value in one execution, from a trace of the dependences that actually occurred.

    O(T n) worst1 languagesadvanced
  • IFDS framework

    Solves interprocedural, finite, distributive, subset problems exactly in O(E D^3) time by graph reachability on an exploded supergraph.

    O(E D^3) worst · average1 languagesadvanced
  • Strictness analysis

    Finds functions of a lazy language that surely evaluate an argument, by abstract interpretation over a two-point domain, so it can be passed by value.

    O(4^k n) worst · average1 languagesadvanced
  • System dependence graph slicing

    Slices across procedures with a system dependence graph and summary edges, in two passes that respect calling context.

    O(N + E) worst1 languagesadvanced
  • Weak topological ordering

    Orders the nodes of a flow graph as nested components with heads, giving the points where to widen and a good order of iteration.

    O((k + 1)(n + m)) worst · average1 languagesadvanced
  • IDE framework

    Extends IFDS to environment problems, such as linear constant propagation, by labeling exploded edges with distributive value functions.

    O(E D^3) worst · average1 languagesresearch
  • Three-valued logic shape analysis

    Represents heaps by logical structures with a third value for unknown and merges nodes by abstraction predicates, for shape properties.

    O(E M v^2 N^5) worst1 languagesresearch

Techniques

  • Datalog-based program analysis

    Writes an analysis as Datalog rules over facts taken from the program, and runs it on a Datalog engine, often with BDDs or semi-naive evaluation.

    advanced
  • Elimination methods for dataflow analysis

    Solve dataflow equations by substitution, like Gaussian elimination, with functions as coefficients and a loop closure in place of division.

    advanced
  • Functional approach to interprocedural analysis

    Computes for each procedure a summary function from input facts to output facts and applies it at each call site.

    advanced
  • Reduced product

    Combines two abstract domains into a product where each component is refined by the facts of the other, as precise as both.

    advanced
  • Taint analysis

    Tracks data from untrusted sources through a program and reports when it reaches a sensitive sink without passing a sanitizer.

    advanced
  • Bi-abduction

    Infers the missing precondition and the leftover frame of a call in separation logic, which makes heap analysis compositional.

    research

Concepts

  • Dataflow analysis

    Computes facts that hold at each program point on all paths, by propagating them along the control flow graph to a fixed point.

    intro
  • Context sensitivity

    Whether an analysis keeps the facts of different calls to the same procedure apart, by call strings, objects or summaries.

    core
  • Flow sensitivity

    Whether an analysis takes the order of statements into account and computes a fact per program point, or one fact for the whole program.

    core
  • Interprocedural dataflow analysis

    Dataflow analysis across procedure calls, which must match each return with its call to avoid facts from paths that cannot occur.

    core

Definitions

  • Abstract domain

    A lattice of abstract properties with a concretization map and sound abstract versions of the program operations, join and widening.

    core
  • Collecting semantics

    The semantics that maps each program point to the set of all states that reach it, the most precise property an analysis can compute.

    core
  • Distributive dataflow framework

    A monotone framework whose transfer functions distribute over the meet, f(x meet y) = f(x) meet f(y), as gen-kill problems do.

    core
  • Galois connection

    A pair of monotone maps alpha and gamma between concrete and abstract posets with alpha(x) <= y exactly when x <= gamma(y).

    core
  • Gen-kill dataflow problem

    A dataflow problem whose transfer functions have the form f(x) = gen union (x minus kill), solved fast with bit vectors.

    core
  • Interval abstract domain

    Abstracts each numeric variable by a lower and an upper bound, a non-relational domain of infinite height that needs widening.

    core
  • Maximal fixed-point solution

    The greatest solution of the dataflow equations of a monotone framework, which iterative algorithms compute and which is below the MOP.

    core
  • Meet-over-all-paths solution

    The meet, over all paths from the entry to a point, of the composed transfer functions of the path, which is the ideal dataflow answer.

    core
  • Monotone dataflow framework

    A dataflow problem given by a semilattice of facts of finite height, a direction and monotone transfer functions for the nodes.

    core
  • Widening operator

    An upper bound operator whose iteration stabilizes in finitely many steps, used to force fixed-point iteration on infinite height domains to end.

    core
  • Convex polyhedra abstract domain

    A relational domain of conjunctions of linear inequalities between variables, precise but exponential in the worst case.

    advanced
  • Narrowing operator

    An operator applied after widening that refines a post-fixed point downward while staying sound, in finitely many steps.

    advanced
  • Octagon abstract domain

    A relational domain of constraints plus or minus x plus or minus y <= c, kept in a difference-bound matrix with cubic time closure.

    advanced

Theorems

  • Kleene fixed-point theorem

    A continuous function on a complete partial order with a bottom has a least fixed point, the limit of the iterates from bottom.

    core
  • MOP-MFP coincidence theorem

    In a distributive framework the maximal fixed-point solution equals the meet-over-all-paths solution; in a monotone one it is below it.

    core
  • Kam-Ullman iteration bound

    Round-robin dataflow iteration in reverse postorder stops after d + 2 passes for rapid distributive frameworks, where d is the loop-connectedness depth.

    advanced