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 about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 9d848db5-804d-47ab-9d10-1d167651ae9cCited by top-tier papers1
Ask how each one uses itBuilds 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
