Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
research-article

Dynamic Transitive Closure-based Static Analysis through the Lens of Quantum Search

Published: 04 June 2024 Publication History

Abstract

Many existing static analysis algorithms suffer from cubic bottlenecks because of the need to compute a dynamic transitive closure (DTC). For the first time, this article studies the quantum speedups on searching subtasks in DTC-based static analysis algorithms using quantum search (e.g., Grover’s algorithm). We first introduce our oracle implementation in Grover’s algorithm for DTC-based static analysis and illustrate our quantum search subroutine. Then, we take two typical DTC-based analysis algorithms: context-free-language reachability and set constraint-based analysis, and show that our quantum approach can reduce the time complexity of these two algorithms to truly subcubic ( \(O(N^2\sqrt {N}{\it polylog}(N))\) ), yielding better results than the upper bound (O(N3/log N)) of existing classical algorithms. Finally, we conducted a classical simulation of Grover’s search to validate our theoretical approach, due to the current quantum hardware limitation of lacking a practical, large-scale, noise-free quantum machine. We evaluated the correctness and efficiency of our approach using IBM Qiskit on nine open-source projects and randomly generated edge-labeled graphs/constraints. The results demonstrate the effectiveness of our approach and shed light on the promising direction of applying quantum algorithms to address the general challenges in static analysis.

References

[1]
Jiawei Ren. 2024. Artifact: “Dynamic Transitive Closure-based Static Analysis through the Lens of Quantum Search.” GitHub. Retrieved from https://github.com/jiawei-95/tosem-QDTCSA-artifact.
[2]
Alfred V. Aho, John E. Hopcroft, and Jeffrey D. Ullman. 1968. Time and tape complexity of pushdown automaton languages. Info. Control 13 (1968), 186–206. DOI:
[3]
A. Aiken and E.L. Wimmers. 1992. Solving systems of set constraints. In Proceedings of the 7th Annual IEEE Symposium on Logic in Computer Science. 329–340. DOI:
[4]
Gadi Aleksandrowicz, Thomas Alexander, Panagiotis Barkoutsos, Luciano Bello, Yael Ben-Haim, David Bucher, Francisco Jose Cabrera-Hernández, Jorge Carballo-Franquis, Adrian Chen, Chun-Fu Chen, Jerry M. Chow, Antonio D. Córcoles-Gonzales, Abigail J. Cross, Andrew Cross, Juan Cruz-Benito, Chris Culver, Salvador De La Puente González, Enrique De La Torre, Delton Ding, Eugene Dumitrescu, Ivan Duran, Pieter Eendebak, Mark Everitt, Ismael Faro Sertage, Albert Frisch, Andreas Fuhrer, Jay GambettaBorja Godoy Gago, Juan Gomez-Mosquera, Donny Greenberg, Ikko Hamamura, Vojtech Havlicek, Joe Hellmers, Łukasz Herok, Hiroshi Horii, Shaohan Hu, Takashi Imamichi, Toshinari Itoko, Ali Javadi-Abhari, Naoki Kanazawa, Anton Karazeev, Kevin Krsulich, Peng Liu, Yang Luh, Yunho Maeng, Manoel Marques, Francisco Jose Martín-Fernández, Douglas T. McClure, David McKay, Srujan Meesala, Antonio Mezzacapo, Nikolaj Moll, Diego Moreda Rodríguez, Giacomo Nannicini, Paul Nation, Pauline Ollitrault, Lee James O’Riordan, Hanhee Paik, Jesús Pérez, Anna Phan, Marco Pistoia, Viktor Prutyanov, Max Reuter, Julia Rice, Abdón Rodríguez Davila, Raymond Harry Putra Rudy, Mingi Ryu, Ninad Sathaye, Chris Schnabel, Eddie Schoute, Kanav Setia, Yunong Shi, Adenilton Silva, Yukio Siraichi, Seyon Sivarajah, John A. Smolin, Mathias Soeken, Hitomi Takahashi, Ivano Tavernelli, Charles Taylor, Pete Taylour, Kenso Trabing, Matthew Treinish, Wes Turner, Desiree Vogt-Lee, Christophe Vuillot, Jonathan A. Wildstrom, Jessica Wilson, Erick Winston, Christopher Wood, Stephen Wood, Stefan Wörner, Ismail Yunus Akhalwaya, and Christa Zoufal. 2019. Qiskit: An Open-source Framework for Quantum Computing. Retrieved from https://zenodo.org/records/2562111. DOI:
[5]
Andris Ambainis. 2005. Quantum Search Algorithms. Retrieved from https://arxiv.org/abs/quant-ph/0504012
[6]
Andris Ambainis, Kaspars Balodis, Jānis Iraids, Martins Kokainis, Krišjānis Prūsis, and Jevgenijs Vihrovs. 2019. Quantum Speedups for Exponential-Time Dynamic Programming Algorithms. In Proceedings of the 30th Annual ACM-SIAM Symposium on Discrete Algorithms.1783–1793. DOI:
[7]
Andris Ambainis and Robert Špalek. 2006. Quantum algorithms for matching and network flows. In Proceedings of the 23rd Annual Conference on Theoretical Aspects of Computer Science (STACS’06). Springer-Verlag, Berlin, Heidelberg, 172183. DOI:
[8]
Lars Ole Andersen. 1994. Program analysis and specialization for the c programming language. Retrieved from https://www.cs.cornell.edu/courses/cs711/2005fa/papers/andersen-thesis94.pdf
[9]
Jacob Biamonte, Peter Wittek, Nicola Pancotti, Patrick Rebentrost, Nathan Wiebe, and Seth Lloyd. 2017. Quantum machine learning. Nature 549, 7671 (2017), 195–202. DOI:
[10]
Rastisalv Bodík and Sadun Anik. 1998. Path-sensitive value-flow analysis. In Proceedings of the 25th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL’98). Association for Computing Machinery, New York, NY, 237–251. DOI:
[11]
Michel Boyer, Gilles Brassard, Peter Hoyer, and Alain Tappa. 2005. Tight bounds on quantum searching. Fortschritte Der Physik 46 (012005), 187–199. DOI:
[12]
Harry Buhrman, Richard Cleve, Ronald de Wolf, and Christof Zalka. 1999. Bounds for small-error and zero-error quantum algorithms. In Proceedings of the 40th Annual Symposium on Foundations of Computer Science (FOCS’99). IEEE Computer Society, Piscataway, NJ, 358. DOI:
[13]
Yudong Cao, Jonathan Romero, Jonathan P. Olson, Matthias Degroote, Peter D. Johnson, Mária Kieferová, Ian D. Kivlichan, Tim Menke, Borja Peropadre, Nicolas P. D. Sawaya, Sukin Sim, Libor Veis, and Alán Aspuru-Guzik. 2019. Quantum chemistry in the age of quantum computing. Chem. Rev. 119, 19 (2019), 10856–10915. DOI:
[14]
Krishnendu Chatterjee, Bhavya Choudhary, and Andreas Pavlogiannis. 2017. Optimal dyck reachability for data-dependence and alias analysis. Proc. ACM Program. Lang. 2, POPL, Article 30 (Dec.2017), 30 pages. DOI:
[15]
Swarat Chaudhuri. 2008. Subcubic algorithms for recursive state machines. In Proceedings of the 35th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL’08). Association for Computing Machinery, New York, NY, 159–169. DOI:
[16]
Xiao Cheng, Xu Nie, Ningke Li, Haoyu Wang, Zheng Zheng, and Yulei Sui. 2022. How about bug-triggering paths? Understanding and characterizing learning-based vulnerability detectors. IEEE Trans. Depend. Secure Comput. (2022). DOI:
[17]
Xiao Cheng, Haoyu Wang, Jiayi Hua, Guoai Xu, and Yulei Sui. 2021. DeepWukong: Statically detecting software vulnerabilities using deep graph neural network. ACM Trans. Softw. Eng. Methodol. 30, 3 (2021), 1–33. DOI:
[18]
Xiao Cheng, Guanqin Zhang, Haoyu Wang, and Yulei Sui. 2022. Path-sensitive code embedding via contrastive learning for software vulnerability detection. In Proceedings of the 31st ACM SIGSOFT International Symposium on Software Testing and Analysis (ISSTA’22). ACM. DOI:
[19]
G. Chiribella, G. M. D’Ariano, and P. Perinotti. 2008. Quantum circuit architecture. Phys. Rev. Lett. 101 (Aug.2008), 060401. Issue 6. DOI:
[20]
Dmitry Chistikov, Rupak Majumdar, and Philipp Schepper. 2022. Subcubic certificates for CFL reachability. Proc. ACM Program. Lang. 6, POPL, Article 41 (Jan.2022), 29 pages. DOI:
[21]
John Cortese and Timothy Braje. 2018. Loading classical data into a quantum computer. Retrieved from https://arxiv.org/abs/1803.01958
[22]
Sebastian Dörn. 2008. Quantum complexity of graph and algebraic problems. Retrieved from https://www.uni-ulm.de/fileadmin/website_uni_ulm/iui.inst.190/Mitarbeiter/doern/Dissertation.pdf
[23]
Christoph Dürr, Mark Heiligman, Peter Hoyer, and Mehdi Mhalla. 2006. Quantum query complexity of some graph problems. SIAM J. Comput. 35, 6 (2006), 1310–1328. DOI:
[24]
Sam Estep, Jenna Wise, Jonathan Aldrich, Éric Tanter, Johannes Bader, and Joshua Sunshine. 2021. Gradual program analysis for null pointers. In Proceedings of the 35th European Conference on Object-Oriented Programming (ECOOP’21) (Leibniz International Proceedings in Informatics (LIPIcs)), Manu Sridharan and Anders Møller (Eds.). Schloss Dagstuhl–Leibniz-Zentrum fuer Informatik, Aarhus, Denmark. DOI:
[25]
Edward Farhi, Jeffrey Goldstone, and Sam Gutmann. 2014. A quantum approximate optimization algorithm. Retrieved from https://arxiv.org/abs/1411.4028.
[26]
Jeanne Ferrante, Karl J. Ottenstein, and Joe D. Warren. 1987. The program dependence graph and its use in optimization. ACM Trans. Program. Lang. Syst. 9, 3 (July1987), 319–349. DOI:
[27]
Jay Gambetta. 2022. Quantum-centric supercomputing: The next wave of computing. IBM Research Blog. Retrieved from https://research.ibm.com/blog/next-wave-quantum-centric-supercomputing
[28]
Craig Gidney and Martin Ekerå. 2021. How to factor 2048 bit RSA integers in 8 hours using 20 million noisy qubits. Quantum 5 (Apr.2021), 433. DOI:
[29]
Vittorio Giovannetti, Seth Lloyd, and Lorenzo Maccone. 2008. Quantum random access memory. Phys. Rev. Lett. 100 (Apr2008), 160501. Issue 16. DOI:
[30]
Lov K. Grover. 1996. A fast quantum mechanical algorithm for database search. In Proceedings of the 28th Annual ACM Symposium on Theory of Computing (STOC’96). Association for Computing Machinery, New York, NY, 212–219. DOI:
[31]
Kathrin Hanauer, Monika Henzinger, and Christian Schulz. 2020. Faster fully dynamic transitive closure in practice. Retrieved from https://arxiv.org/abs/2002.00813.
[32]
Charles Harris, K. Millman, Stéfan Walt, Ralf Gommers, Pauli Virtanen, David Cournapeau, Eric Wieser, Julian Taylor, Sebastian Berg, Nathaniel Smith, Robert Kern, Matti Picus, Stephan Hoyer, Marten Kerkwijk, Matthew Brett, Allan Haldane, Jaime Río, Mark Wiebe, Pearu Peterson, and Travis Oliphant. 2020. Array programming with NumPy. Nature 585 (Sep. 2020), 357–362. DOI:
[33]
Nevin Heintze and Joxan Jaffar. 1994. Set constraints and set-based analysis. In Proceedings of the Second International Workshop on Principles and Practice of Constraint Programming (PPCP’94). Springer-Verlag, Berlin, 281–298.
[34]
Nevin Heintze and David McAllester. 1997. On the cubic bottleneck in subtyping and flow analysis. In Proceedings of the 12th Annual IEEE Symposium on Logic in Computer Science (LICS’97). IEEE Computer Society, 342. DOI:
[35]
Asim Kadav, Matthew J. Renzelmann, and Michael M. Swift. 2009. Tolerating hardware device failures in software. In Proceedings of the ACM SIGOPS 22nd Symposium on Operating Systems Principles (SOSP’09). Association for Computing Machinery, New York, NY, 59–72. DOI:
[36]
Ioannis Krommidas and Christos Zaroliagis. 2008. An experimental study of algorithms for fully dynamic transitive closure. J. Exper. Algor. 12, Article 16 (June2008), 22 pages. DOI:
[37]
Yuxiang Lei, Yulei Sui, Shuo Ding, and Qirun Zhang. 2022. Taming transitive redundancy for context-free language reachability. Proc. ACM Program. Lang. 6, OOPSLA2 (2022). DOI:
[38]
Yuxiang Lei, Yulei Sui, Shin Hwei Tan, and Qirun Zhang. 2023. Recursive state machine guided graph folding for context-free language reachability. Proc. ACM Program. Lang. 7, PLDI (June 2023). DOI:
[39]
Gushu Li, Li Zhou, Nengkun Yu, Yufei Ding, Mingsheng Ying, and Yuan Xie. 2020. Projection-based runtime assertions for testing and debugging quantum programs. Proc. ACM Program. Lang. 4, OOPSLA, Article 150 (Nov.2020), 29 pages. DOI:
[40]
Anders Alnor Mathiasen and Andreas Pavlogiannis. 2021. The fine-grained and parallel complexity of andersen’s pointer analysis. Proc. ACM Program. Lang. 5, POPL, Article 34 (Jan.2021), 29 pages. DOI:
[41]
Olivia Di Matteo, Vlad Gheorghiu, and Michele Mosca. 2020. Fault-tolerant resource estimation of quantum random-access memories. IEEE Trans. Quant. Eng. 1 (2020), 1–13. DOI:
[42]
David Melski and Thomas Reps. 1997. Interconvertbility of set constraints and context-free language reachability. In Proceedings of the ACM SIGPLAN Symposium on Partial Evaluation and Semantics-Based Program Manipulation (PEPM’97). Association for Computing Machinery, New York, NY, 74–89. DOI:
[43]
Michael A. Nielsen and Isaac L. Chuang. 2010. Quantum Computation and Quantum Information: 10th Anniversary Edition. Cambridge University Press. DOI:
[44]
Alexandru Paler, Oumarou Oumarou, and Robert Basmadjian. 2020. Parallelizing the queries in a bucket-brigade quantum random access memory. Phys. Rev. A 102 (Sep.2020), 032608. Issue 3. DOI:
[45]
Yuxiang Peng, Kesha Hietala, Runzhou Tao, Liyi Li, Robert Rand, Michael Hicks, and Xiaodi Wu. 2023. A Formally Certified End-to-End Implementation of Shor’s Factorization Algorithm. Proc. Natl. Acad. Sci. 120, 21 (May 2023) DOI:
[46]
John Preskill. 2018. Quantum computing in the NISQ era and beyond. Quantum 2 (Jan. 2018). DOI:
[47]
Daniel Reitzner and Mark Hillery. 2019. Grover search under localized dephasing. Phys. Rev. A 99 (Jan.2019), 012339. Issue 1. DOI:
[48]
Thomas Reps. 1997. Program analysis via graph reachability. In Proceedings of the 1997 International Symposium on Logic Programming (ILPS’97). MIT Press, Cambridge, MA, 5–19. DOI:
[49]
Qingkai Shi, Xiao Xiao, Rongxin Wu, Jinguo Zhou, Gang Fan, and Charles Zhang. 2018. Pinpoint: Fast and precise sparse value flow analysis for million lines of code. In Proceedings of the 39th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI’18). Association for Computing Machinery, New York, NY, 693–706. DOI:
[50]
Peter W. Shor. 1997. Polynomial-time algorithms for prime factorization and discrete logarithms on a quantum computer. SIAM J. Comput. 26, 5 (Oct.1997), 1484–1509. DOI:
[51]
Bjarne Steensgaard. 1996. Points-to analysis in almost linear time. In Proceedings of the 23rd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL’96). Association for Computing Machinery, New York, NY, 32–41. DOI:
[52]
E. M. Stoudenmire and Xavier Waintal. 2023. Grover’s Algorithm Offers No Quantum Advantage. Retrieved from https://arxiv.org/abs/2303.11317
[53]
Yulei Sui, Xiao Cheng, Guanqin Zhang, and Haoyu Wang. 2020. Flow2Vec: Value-flow-based precise code embedding. Proc. ACM Program. Lang. 4, OOPSLA (2020), 1–27. DOI:
[54]
Yulei Sui and Jingling Xue. 2016. SVF: Interprocedural static value-flow analysis in LLVM. In Proceedings of the 25th International Conference on Compiler Construction (CC’16). Association for Computing Machinery, New York, NY, 265–266. DOI:
[55]
Yulei Sui, Ding Ye, and Jingling Xue. 2012. Static memory leak detection using full-sparse value-flow analysis. In Proceedings of the International Symposium on Software Testing and Analysis (ISSTA’12). Association for Computing Machinery, New York, NY, 254–264. DOI:
[56]
Yulei Sui, Ding Ye, and Jingling Xue. 2014. Detecting memory leaks statically with full-sparse value-flow analysis. IEEE Trans. Softw. Eng. 40, 2 (2014), 107–122. DOI:
[57]
Ewin Tang. 2019. A quantum-inspired classical algorithm for recommendation systems. In Proceedings of the 51st Annual ACM SIGACT Symposium on Theory of Computing (STOC’19). Association for Computing Machinery, New York, NY, 217–228. DOI:
[58]
Thomas Wigren. 2015. The Cauchy-Schwarz inequality: Proofs and applications in various spaces. Retrieved from https://www.diva-portal.org/smash/get/diva2:861242/FULLTEXT02.pdf
[59]
Virginia Vassilevska Williams. 2012. Multiplying matrices faster than coppersmith-winograd. In Proceedings of the 44th Annual ACM Symposium on Theory of Computing (STOC’12). Association for Computing Machinery, New York, NY, 887–898. DOI:
[60]
Cheng Xiao, Wang Jiawei, and Sui Yulei. 2024. Precise sparse abstract execution via cross-domain interaction. In Proceedings of the 46th International Conference on Software Engineering (ICSE’24). ACM/IEEE. DOI:
[61]
Mihalis Yannakakis. 1990. Graph-theoretic methods in database theory. In Proceedings of the 9th ACM SIGACT-SIGMOD-SIGART Symposium on Principles of Database Systems (PODS’90). Association for Computing Machinery, New York, NY, 230–242. DOI:
[62]
Nengkun Yu and Jens Palsberg. 2021. Quantum abstract interpretation. In Proceedings of the 42nd ACM SIGPLAN International Conference on Programming Language Design and Implementation (PLDI’21). Association for Computing Machinery, New York, NY, 542–558. DOI:
[63]
Charles Yuan and Michael Carbin. 2022. Tower: Data structures in quantum superposition. Proc. ACM Program. Lang. 6, OOPSLA2, Article 134 (Oct.2022), 30 pages. DOI:
[64]
Qirun Zhang, Michael R. Lyu, Hao Yuan, and Zhendong Su. 2013. Fast algorithms for dyck-cfl-reachability with applications to alias analysis. In Proceedings of the 34th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI’13). Association for Computing Machinery, New York, NY, 435–446. DOI:
[65]
Xin Zheng and Radu Rugina. 2008. Demand-driven alias analysis for C. In Proceedings of the 35th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. 197–208. DOI:
[66]
Li Zhou, Gilles Barthe, Pierre-Yves Strub, Junyi Liu, and Mingsheng Ying. 2023. CoqQ: Foundational verification of quantum programs. Proc. ACM Program. Lang. 7, POPL, Article 29 (Jan.2023), 33 pages. DOI:
[67]
Yiqing Zhou, E Miles Stoudenmire, and Xavier Waintal. 2020. What limits the simulation of quantum computers? Phys. Rev. X 10, 4 (2020), 041038. DOI:

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Transactions on Software Engineering and Methodology
ACM Transactions on Software Engineering and Methodology  Volume 33, Issue 5
June 2024
952 pages
EISSN:1557-7392
DOI:10.1145/3618079
  • Editor:
  • Mauro Pezzè
Issue’s Table of Contents

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 04 June 2024
Online AM: 05 February 2024
Accepted: 25 January 2024
Revised: 11 January 2024
Received: 18 July 2023
Published in TOSEM Volume 33, Issue 5

Check for updates

Author Tags

  1. CFL-reachability
  2. set constraint-based analysis
  3. grover’s search

Qualifiers

  • Research-article

Funding Sources

  • Australian Research

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • 0
    Total Citations
  • 274
    Total Downloads
  • Downloads (Last 12 months)274
  • Downloads (Last 6 weeks)24
Reflects downloads up to 30 Aug 2024

Other Metrics

Citations

View Options

Get Access

Login options

Full Access

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Full Text

View this article in Full Text.

Full Text

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media