Architecture & Major Components
This page describes the high-level modular structure of the Lotus framework: how source directories are organized, what each major subsystem does, and how the subsystems depend on each other. It is the right starting point for understanding the codebase before diving into a specific component.
Repository Layout
The repository is organized into a small number of top-level directories. Every analysis capability is implemented in lib/, exposed through a command-line driver in tools/, and covered by tests under tests/.
Directory |
Purpose |
|---|---|
|
All analysis and solver libraries |
|
Command-line tool drivers (one binary per tool) |
|
Public headers mirroring |
|
Unit and integration tests |
|
Bundled third-party libraries (CUDD, WPDS, spdlog) |
|
Benchmark programs for internal evaluation |
|
Optional example programs (controlled by |
|
Python helper scripts (organized by subsystem under |
|
CMake helper modules for finding LLVM, Z3, Boost, GTest |
|
Sphinx documentation source |
Library Subdirectories (lib/)
The lib/ directory is divided into 16 CMake subdirectories, each of which compiles to one or more static libraries that are linked into the tool binaries.
Subdirectory |
Key Libraries / Modules |
Purpose |
|---|---|---|
|
|
Pointer and alias analysis engines |
|
|
Graph-based intermediate representations |
|
|
Interprocedural dataflow solvers |
|
Call graph construction (CHA, RTA, VTA, FPA, OTF), CFG, control dependence, memory, null pointer, purity, SCCP, type hierarchy, feature extraction ( |
Foundational analysis utilities |
|
|
Bug detection engines and linters |
|
Z3 SMT wrapper, CUDD BDD wrapper, WPDS weights |
Constraint and reachability solvers |
|
|
Formal verification backends |
|
CFL-reachability graph engines (CSR) |
Core CFL and pushdown logic |
|
LLVM IR transformation passes |
Code canonicalization and lowering |
|
|
Optimization implementations |
|
|
Concurrency and parallelism analyses |
|
|
Security-oriented static analyses |
|
|
Fuzzing support on top of |
|
|
Symbolic execution engine |
|
Shared helper utilities |
Graph traits, logging, utilities |
|
Source-level annotation support |
Parsers for API specs, taint rules |
Tools Directory (tools/)
Each subdirectory under tools/ contains the main() entry points that link against the lib/ libraries and expose them as standalone executables.
Subdirectory |
Executables produced |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Intermediate Representations (lib/IR/)
Lotus constructs several graph-based IRs on top of LLVM IR. These IRs are typically built once and then consumed by multiple analyses.
IR |
Main Classes |
Purpose |
|---|---|---|
ICFG |
|
Interprocedural control flow; backbone for IFDS/IDE/WPDS |
PDG |
|
Data + control dependence graph |
SVFG |
|
Sparse value-flow graph with Memory SSA integration |
DyckVFG |
|
Value-flow graph used by DyckAA (located in |
GSA |
|
Gated SSA with gamma/mu/eta nodes |
Optional Modules and CMake Flags
The main optional integrations and build surfaces are controlled by these CMake options:
CMake Flag |
Default |
Enables |
Requires |
|---|---|---|---|
|
|
CLAM abstract interpreter |
Boost, CRAB |
|
|
SeaHorn Horn-clause engine |
Boost |
|
|
SVF pointer analysis integration |
SVF install |
|
|
CclyzerAA Datalog alias analysis |
Boost |
|
|
Unit tests under |
GTest |
|
|
Example programs under |
None |
|
|
CFL reachability tools |
None |
Third-Party Libraries
Core libraries under third-party/ added in standard builds include:
CUDD: BDD-based symbolic computations used heavily in
lib/Solvers/.WPDS: Weighted pushdown systems; used by the
lib/Dataflow/WPDS engine.spdlog: A fast C++ logging library used for framework diagnostics.
Additional vendored packages (such as Seal, CLAM, SeaHorn, SMACK, FPsolve, WALi/OpenNWA,
PDAAAL, Horn-ICE, and FlowCutter) are managed as opt-in components gated by their respective
LOTUS_ENABLE_* configuration toggles.