Skip to main content
QUICK REVIEW

[论文解读] Defusing Logic Bombs in Symbolic Execution with LLM-Generated Ghost Code

Dimitrios Stamatios Bouras, Sergey Mechtaev|arXiv (Cornell University)|Jan 31, 2026
Logic, programming, and type systems被引用 0
一句话总结

该论文提出 Gordian,一种混合符号执行框架,利用 LLM 生成的鬼代码来帮助 SMT 求解器处理求解器不友好代码,从而显著提升覆盖率并减少 LLM 令牌使用。

ABSTRACT

Symbolic execution is a powerful program analysis technique, but its effectiveness is fundamentally limited by solver-hostile program fragments, complex numerical reasoning, and unbounded heap structures. Recent work proposed replacing constraint solvers with large language models (LLMs) to bypass these limitations, but such approaches struggle to analyze real-world codebases, where deep execution paths require globally consistent reasoning across many interacting constraints. We present Gordian, a hybrid symbolic execution framework that uses LLMs selectively to generate lightweight ghost code that aids an SMT solver in handling solver-hostile code fragments, while preserving its precise, global reasoning capability. In particular, we propose three types of ghost code: (1) inversion of difficult code fragments with iterative bidirectional constraint propagation, (2) modeling via solver-friendly surrogates while preserving relevant behavior, and (3) semantic partitioning of unbounded heap spaces. We implemented Gordian on top of the KLEE symbolic execution engine and evaluated it on synthetic "logic bombs" capturing distinct symbolic reasoning challenges, a popular mathematical library FDLibM, and three structured-input programs (libexpat, jq, and bc). Across all benchmarks, Gordian improves coverage on average by 52-84% over traditional symbolic execution baselines, and by 86-419% over LLM-based techniques, while reducing LLM token usage by an average of 90-96%. This highlights the practicality and effectiveness of this approach in real-world settings.

研究动机与目标

  • 动机传统符号执行在求解器不友好代码、复杂数值推理与无限堆结构上的局限性。
  • 提出一种混合框架,选择性使用 LLM 生成轻量鬼代码以辅助 SMT 求解而不牺牲全局推理。
  • 引入三种鬼代码变体(反演、代理、语义堆分区)并将其与 KLEE 集成。
  • 在合成逻辑炸弹、fdlibm 以及真实世界结构化输入程序上展示覆盖率提升。

提出的方法

  • 用 LLM 识别对求解器不友好的片段并生成可插入到基于 SMT 的工作流中的鬼代码。
  • 提出三种鬼代码类型:通过前向/后向约束传播实现的片段反演、对求解器友好的代理,以及语义堆拓扑约束。
  • 将鬼代码集成到以 KLEE 为基础的 Gordian 符号执行引擎中,以传播约束并抑制路径爆炸。
  • 提供双向约束传播以调和变换片段周围的前缀与后缀路径约束。
  • 在 KLEE 中具体实现,并在 LogicBombs、fdlibm 以及 libexpat、jq、bc 等工程上评估。
Figure 7 . Coverage across different combinations of tool components. Dots indicate enabled techniques, while bars report the number of logic bombs triggered. Black rows show individual techniques, purple rows show intersections (AND), blue rows show unions (OR), and the green row highlights the uni
Figure 7 . Coverage across different combinations of tool components. Dots indicate enabled techniques, while bars report the number of logic bombs triggered. Black rows show individual techniques, purple rows show intersections (AND), blue rows show unions (OR), and the green row highlights the uni

实验结果

研究问题

  • RQ1LLM 生成的鬼代码是否能让 SMT 求解器比传统符号执行更有效地推理求解器不友好片段?
  • RQ2三种鬼代码变体(反演、代理、语义堆约束)是否在多样基准上带来性能提升?
  • RQ3与传统符号执行和纯 LLM 方法相比,Gordian 在覆盖率和 LLM 令牌使用方面的表现如何?
  • RQ4在鬼代码用于辅助求解时,给定鬼代码输入会被与原始程序对照检查,是否仍能保持正确性?
  • RQ5Gordian 对具有复杂动态数据结构的真实代码库的实际影响如何?

主要发现

  • Gordian 在基准测试上实现了比传统符号执行基线高 52–84% 的覆盖率。
  • Gordian 在比最新的基于 LLM 的符号执行技术上实现了 86–419% 的覆盖率提升。
  • Gordian 平均将 LLM 令牌使用减少 90–96%。
  • 每种鬼代码类型都对性能提升做出贡献,见消融研究。
  • Gordian 在合成的 LogicBombs、fdlibm 数学库,以及像 libexpat、jq、bc 这样的结构化输入程序上均证明有效。

更好的研究,从现在开始

从论文设计到论文写作,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。