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:
CMake Target |
Namespace |
Primary Solver Classes |
Key Headers |
Scope |
|---|---|---|---|---|
|
|
|
|
Interprocedural |
|
|
|
|
Intra/Interprocedural |
|
|
|
|
Interprocedural |
|
|
|
|
Intra/Interprocedural |
|
|
|
|
Intra/Interprocedural |
|
|
|
|
Interprocedural |
When to Use Each Framework
Selecting the right framework depends heavily on the properties of the dataflow problem being solved:
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
- Algebraic Program Analysis (APA)
- Demand-Driven APA
- Control Flow Support
- Monotone Dataflow Engine
- Overview
- Implementation Layout
- Core Idea
- Abstract Domain Contract
- Example Analyses
- IFDS / IDE Engine
- Overview
- IFDS: Set-Valued Problems
- IDE: Value-Enriched Problems
- Usage
- Analysis Sessions and Graph Providers
- Sparse Execution
- Command-Line Tool: lotus-check –engine=taint
- VASCO Value-Context Framework
- Overview
- Why VASCO
- Value Contexts
- Algorithm Sketch
- Core API
- Results
- LLVM Instantiation in Lotus
- Parallel Context Scheduling
- Current Scope and Caveats
- Relationship to Other Lotus Engines
- WPDS Dataflow Engine
- Overview
- Core Idea
- Backend selection and prepared sessions
- Example Analyses
- Newtonian Program Analysis (NPA)
- Overview
- Conceptual Background
- Mathematical Foundation
- Examples and Applications
- Distributive vs. Non-Distributive Analyses
- Implementation Layout
- Usage Notes
- Practical notes for numeric domains
- Boolean Program Analysis
- References