Skip to main content
QUICK REVIEW

[Paper 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 systemsComputer Science0 citations
TL;DR

The paper presents Gordian, a hybrid symbolic execution framework that uses LLM-generated ghost code to aid SMT solvers in handling solver-hostile code, improving coverage significantly over baselines and reducing LLM token usage.

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.

Motivation & Objective

  • Motivate the limitations of traditional symbolic execution on solver-hostile code, complex numerical reasoning, and unbounded heap structures.
  • Propose a hybrid framework that selectively uses LLMs to generate lightweight ghost code that aids SMT solving without sacrificing global reasoning.
  • Introduce three ghost code variants (inversion, surrogates, semantic heap partitioning) and integrate them with KLEE.
  • Demonstrate improved coverage on synthetic logic-bombs, fdlibm, and real-world structured-input programs.

Proposed method

  • Identify solver-hostile fragments with an LLM and generate ghost code that plugs into the SMT-based workflow.
  • Three ghost code types are proposed: fragment inversion via forward/backward constraint propagation, solver-friendly surrogates, and semantic heap topology constraints.
  • Integrate ghost code into Gordian’s symbolic execution engine (built atop KLEE) to propagate constraints and prune path explosion.
  • Provide bidirectional constraint propagation to reconcile prefix and suffix path constraints around transformed fragments.
  • Concretely implement in KLEE and evaluate on LogicBombs, fdlibm, and projects like libexpat, jq, and 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

Experimental results

Research questions

  • RQ1Can LLM-generated ghost code enable SMT solvers to reason about solver-hostile fragments more effectively than traditional symbolic execution alone?
  • RQ2Do the three ghost code variants (inversion, surrogates, semantic heap constraints) contribute to performance gains across diverse benchmarks?
  • RQ3How does Gordian perform in terms of coverage and LLM token usage compared with traditional symbolic execution and pure LLM-based methods?
  • RQ4Is soundness preserved when ghost code is used to aid solving, given that inputs from ghost code are checked against the original program?
  • RQ5What is the practical impact of Gordian on real-world codebases with complex dynamic data structures?

Key findings

  • Gordian achieves 52–84% higher coverage than traditional symbolic execution baselines across benchmarks.
  • Gordian achieves 86–419% higher coverage than state-of-the-art LLM-based symbolic execution techniques.
  • Gordian reduces LLM token usage by 90–96% on average.
  • Each ghost code type contributes to performance improvements as shown by ablation studies.
  • Gordian proves effective on synthetic LogicBombs, the fdlibm math library, and structured-input programs like libexpat, jq, and bc.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.