Polygon: Symbolic Reasoning for SQL using Conflict-Driven Under-Approximation Search
Pinhan Zhao, Yuepeng Wang, Xinyu Wang
Abstract
We present a novel symbolic reasoning engine for SQL which can efficiently generate an input ๐ผ for ๐ queries ๐ 1 , โข โข โข , ๐ ๐ , such that their outputs on ๐ผ satisfy a given property (expressed in SMT). This is useful in different contexts, such as disproving equivalence of two SQL queries and disambiguating a set of queries. Our first idea is to reason about an under-approximation of each ๐ ๐ -that is, a subset of ๐ ๐ 's input-output behaviors. While it makes our approach both semantics-aware and lightweight, this idea alone is incomplete (as a fixed under-approximation might miss some behaviors of interest). Therefore, our second idea is to perform search over an expressive family of under-approximations (which collectively cover all program behaviors of interest), thereby making our approach complete. We have implemented these ideas in a tool, Polygon, and evaluated it on over 30,000 benchmarks across two tasks (namely, SQL equivalence refutation and query disambiguation). Our evaluation results show that Polygon significantly outperforms all prior techniques.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
1 top-tier paper has cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper ยท the top-tier papers that cite it ยท related work
Free to start. No credit card required.
Lineage
- Local Reasoning About the Presence of Bugs: Incorrectness Separation Logic cites Incorrectness logic
- Finding real bugs in big programs with incorrectness logic cites Incorrectness logic
- Finding real bugs in big programs with incorrectness logic cites Local Reasoning About the Presence of Bugs: Incorrectness Separation Logic
Cited by top-tier papers1
Builds on14
- Incorrectness logicPeter W. O'HearnPOPL 2020 ยท 122 citations
- Local Reasoning About the Presence of Bugs: Incorrectness Separation LogicAzalea Raad, Josh Berdine, Hoang-Hai Dang, Derek Dreyer et al.CAV 2020 ยท 70 citations
- Finding real bugs in big programs with incorrectness logicQuang Loc Le, Azalea Raad, Jules Villard, Josh Berdine et al.OOPSLA 2022 ยท 52 citations
- Question selection for interactive program synthesisRuyi Ji, Jingjing Liang, Yingfei Xiong, Lu Zhang et al.PLDI 2020 ยท 33 citations
- Data Migration using Datalog Program SynthesisYuepeng Wang, Rushi Shah, Abby Criswell, Rong Pan et al.VLDB 2020 ยท 30 citations
Related papers
- VeriEQL: Bounded Equivalence Verification for Complex SQL Queries with Integrity ConstraintsYang He, Pinhan Zhao, Xinyu Wang, Yuepeng WangOOPSLA 2024 ยท 12 citations
- SPES: A Symbolic Approach to Proving Query Equivalence Under Bag SemanticsQi Zhou, Joy Arulraj, Shamkant B. Navathe, William Harris et al.ICDE 2022 ยท 19 citations
- Enhancing SQL Query Generation with Neurosymbolic ReasoningHenrijs Princis, Cristina David, Alan MycroftAAAI 2025 ยท 1 citation
- SpotIt: Evaluating Text-to-SQL Evaluation with Formal VerificationRocky Klopfenstein, Yang He, Andrew Tremante, Yuepeng Wang et al.ICLR 2026 ยท 6 citations
- Proving Query Equivalence Using Linear Integer ArithmeticHaoran Ding, Zhaoguo Wang, Yicun Yang, Dexin Zhang et al.SIGMOD 2024 ยท 20 citations
