Compiling symbolic execution with staging and algebraic effects
Guannan Wei, Oliver Bracevac, Shangyin Tan, Tiark Rompf
Abstract
Building effective symbolic execution engines poses challenges in multiple dimensions: an engine must correctly model the program semantics, provide flexibility in symbolic execution strategies, and execute them efficiently. This paper proposes a principled approach to building correct, flexible, and efficient symbolic execution engines, directly rooted in the semantics of the underlying language in terms of a high-level definitional interpreter. The definitional interpreter induces algebraic effects to abstract over semantic variants of symbolic execution, e.g., collecting path conditions as a state effect and path exploration as a nondeterminism effect. Different handlers of these effects give rise to different symbolic execution strategies, making execution strategies orthogonal to the symbolic execution semantics, thus improving flexibility. Furthermore, by annotating the symbolic definitional interpreter with binding-times and specializing it to the input program via the first Futamura projection, we obtain a "symbolic compiler", generating efficient instrumented code having the symbolic execution semantics. Our work reconciles the interpretation- and instrumentation-based approaches to building symbolic execution engines in a uniform framework. We illustrate our approach on a simple imperative language step-by-step and then scale up to a significant subset of LLVM IR. We also show effect handlers for common path selection strategies. Evaluating our prototype's performance shows speedups of 10 30x over the unstaged counterpart, and 2x over KLEE, a state-of-the-art symbolic interpreter for LLVM IR.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 43ee455e-3956-4a3e-b247-7be73def17eaCited by top-tier papers4
- Graph IRs for Impure Higher-Order Languages: Making Aggressive Optimizations Affordable with Precise Effect DependenciesOliver Bracevac, Guannan Wei, Songlin Jia, Supun Abeysinghe et al.OOPSLA 2023 · 14 citations
- Compiling Parallel Symbolic Execution with ContinuationsGuannan Wei, Songlin Jia, Ruiqi Gao, Haotian Deng et al.ICSE 2023 · 10 citations
- Flan: An Expressive and Efficient Datalog Compiler for Program AnalysisSupun Abeysinghe, Anxhelo Xhebraj, Tiark RompfPOPL 2024 · 9 citations
- Compiling WebAssembly Concolic Execution with Staging, Continuations, and SnapshotsDinghong Zhong, Alexander Y. Bai, Mikail Khan, Guannan WeiOOPSLA 2026
Builds on2
Related papers
- Learning to Explore Paths for Symbolic ExecutionJingxuan He, Gishor Sivanrupan, Petar Tsankov, Martin T. VechevCCS 2021 · 39 citations
- When Compiler Optimizations Meet Symbolic Execution: An Empirical StudyYue Zhang, Melih Sirlanci, Ruoyu Wang, Zhiqiang LinCCS 2024 · 2 citations
- Neuro-Symbolic Execution: Augmenting Symbolic Execution with Neural ConstraintsShiqi Shen, Shweta Shinde, Soundarya Ramesh, Abhik Roychoudhury et al.NDSS 2019 · 43 citations
- Concrete Constraint Guided Symbolic ExecutionYue Sun, Guowei Yang, Shichao Lv, Zhi Li et al.ICSE 2024 · 3 citations
- SYMTUNER: Maximizing the Power of Symbolic Execution by Adaptively Tuning External ParametersSooyoung Cha, Myungho Lee, Seokhyun Lee, Hakjoo OhICSE 2022 · 4 citations
