Data Flow Analysis Frameworks

Lotus implements several distinct dataflow analysis frameworks, each optimized for different problem classes and precision/performance trade-offs. This page provides an architectural overview of the frameworks, explains when to use each, and documents their core abstractions.

Framework Overview

Lotus provides several compiled libraries under lib/Dataflow/, each implementing a distinct algorithmic approach:

Dataflow Engines

CMake Target

Namespace

Primary Solver Classes

Key Headers

Scope

IFDS

ifds::

IFDSSolver, IDESolver, PathAwareIDESolver

IFDSSolver.h, IDESolver.h

Interprocedural

MONODataFlow

mono::

IntraMonoSolver, InterMonoSolver

IntraSolver.h, InterSolver.h

Intra/Interprocedural

WPDSDataFlow

wpds::

InterProceduralDataFlowEngine

InterProceduralDataFlow.h

Interprocedural

APADataFlow

elimination::

IntraEliminationSolver, InterEliminationSolver

IntraSolver.h

Intra/Interprocedural

NPADataFlow

npa::

BitVectorSolver, ForwardInterEngine, BackwardInterEngine

NPALLVMDriver.h, IntraEngine.h

Intra/Interprocedural

VASCODataFlow

vasco::

ForwardInterProceduralAnalysis, BackwardInterProceduralAnalysis

ForwardInterProceduralAnalysis.h

Interprocedural

When to Use Each Framework

Selecting the right framework depends heavily on the properties of the dataflow problem being solved:

Framework Selection Guide

Framework

Problem Class

Context Sensitivity

Typical Use Cases

IFDS

Distributive (gen-kill, set-union)

Call-string (implicit)

Taint analysis, uninitialized variables, reaching definitions.

IDE

Distributive + value

Tabulation + edge

Linear analysis, type-state.

Mono (Intra)

Arbitrary monotone lattice

None (Intraprocedural)

Simple lattice problems, worklist fixpoint iteration.

Mono (Inter)

Arbitrary monotone lattice

K-call-string

Constant-prop, context-sensitive analyses.

WPDS

Weighted pushdown reachability

CFL-reachability

Stack-aware analyses, demand-driven queries.

APA

Arbitrary meet/transfer

None (Intraprocedural)

Meet-over-all-paths, path expressions, elimination benchmarks.

The lotus-dfa tool (located in tools/dataflow/ and built from lotus-dfa-diff.cpp) can be used to perform differential testing across these different engines for a given problem class.

Detailed Engine Documentation