Lune

PLDI2025Top-tier venue

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.

Questions to start from

Lune can draw on

the full paper ยท the top-tier papers that cite it ยท related work

Get the answer

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
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers1

  1. Automated Discovery of Test Oracles for Database Management Systems Using LLMsQiuyang Mang, Runyuan He, Suyang Zhong, Xiaoxuan Liu et al.SIGMOD 2026 ยท 1 citation

Builds on14

  1. Incorrectness logicPeter W. O'HearnPOPL 2020 ยท 122 citations
  2. Local Reasoning About the Presence of Bugs: Incorrectness Separation LogicAzalea Raad, Josh Berdine, Hoang-Hai Dang, Derek Dreyer et al.CAV 2020 ยท 70 citations
  3. Finding real bugs in big programs with incorrectness logicQuang Loc Le, Azalea Raad, Jules Villard, Josh Berdine et al.OOPSLA 2022 ยท 52 citations
  4. Question selection for interactive program synthesisRuyi Ji, Jingjing Liang, Yingfei Xiong, Lu Zhang et al.PLDI 2020 ยท 33 citations
  5. Data Migration using Datalog Program SynthesisYuepeng Wang, Rushi Shah, Abby Criswell, Rong Pan et al.VLDB 2020 ยท 30 citations

Related papers

  1. VeriEQL: Bounded Equivalence Verification for Complex SQL Queries with Integrity ConstraintsYang He, Pinhan Zhao, Xinyu Wang, Yuepeng WangOOPSLA 2024 ยท 12 citations
  2. 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
  3. Enhancing SQL Query Generation with Neurosymbolic ReasoningHenrijs Princis, Cristina David, Alan MycroftAAAI 2025 ยท 1 citation
  4. SpotIt: Evaluating Text-to-SQL Evaluation with Formal VerificationRocky Klopfenstein, Yang He, Andrew Tremante, Yuepeng Wang et al.ICLR 2026 ยท 6 citations
  5. Proving Query Equivalence Using Linear Integer ArithmeticHaoran Ding, Zhaoguo Wang, Yicun Yang, Dexin Zhang et al.SIGMOD 2024 ยท 20 citations
Dusk over the sea between two cliffs drawn in fine vertical lines