On the Potential of Quantum Computing in Classical Program Analysis
Yicheng Guang, Pietro Zanotta, Kai Zhou, Yueqi Chen, Ramin Ayanzadeh
TL;DR
This work investigates using quantum computing to advance classical program analysis by introducing QEX, a framework that encodes program states in quantum superposition and uses entanglement to track data dependencies, enabling simultaneous exploration of the entire state space. It demonstrates a proof-of-concept on 22 benchmark programs and extends to QEX-H, a hybrid quantum-classical design to reduce hardware requirements for fault-tolerant quantum computing. Empirical results show that QEX can eliminate over- and under-approximation relative to classical methods, with advantages over conventional tools like Frama-C and Angr, albeit within bounded loop unrolling and current hardware limits. The proposed QEX-H approach further enhances practicality by bounding state spaces with classical analysis and handling pointer-related features through hybridization, aiming to bring quantum-assisted program analysis closer to real-world applicability in FTQC.
Abstract
Classical program analysis techniques, such as abstract interpretation and symbolic execution, are essential for ensuring software correctness, optimizing performance, and enabling compiler optimizations. However, these techniques face computational limitations when analyzing programs with large or exponential state spaces, limiting their effectiveness in ensuring system reliability. Quantum computing, with its parallelism and ability to process superposed states, offers a promising solution to these challenges. In this work, we present QEX, a design that uses quantum computing to analyze classical programs. By synthesizing quantum circuits that encode program states in superposition and trace data dependency between program variables through entanglement, QEX enables the simultaneous exploration of program behaviors, significantly improving scalability and precision. This advancement has broad applications, from debugging and security verification to optimizing compilers for next-generation hardware. As a proof-of-concept, we evaluated QEX on 22 benchmark programs, demonstrating its effectiveness in analyzing program states. To support more language features and make QEX realized sooner in Fault-Tolerant Quantum Computing (FTQC), we propose QEX-H which hybridizes QEX with classical analysis techniques. To our knowledge, this work is the first proposal to use quantum computing for classical program analysis.
