Mobius: Synthesizing Relational Queries with Recursive and Invented Predicates
Aalok Thakkar, Nathaniel Sands, George Petrou, Rajeev Alur, Mayur Naik, Mukund Raghothaman
Abstract
Synthesizing relational queries from data is challenging in the presence of recursion and invented predicates. We propose a fully automated approach to synthesize such queries. Our approach comprises of two steps: it first synthesizes a non-recursive query consistent with the given data, and then identifies recursion schemes in it and thereby generalizes to arbitrary data. This generalization is achieved by an iterative predicate unification procedure which exploits the notion of data provenance to accelerate convergence. In each iteration of the procedure, a constraint solver proposes a candidate query, and a query evaluator checks if the proposed program is consistent with the given data. The data provenance for a failed query allows us to construct additional constraints for the constraint solver and refine the search. We have implemented our approach in a tool named Mobius. On a suite of 21 challenging recursive query synthesis tasks, Mobius outperforms three state-of-the-art baselines Gensynth, ILASP, and Popper, both in terms of runtime and accuracy. We also demonstrate that the synthesized queries generalize well to unseen data.
Ask about this paper
Ask your agent about it.
Lune has read the top-tier papers around this one, so every answer names the papers it rests on.
Cited by top-tier papers2
- Inductive Synthesis of Inductive Heap PredicatesZiyi Yang, Ilya SergeyOOPSLA 2025 · 1 citation
- Polygon: Symbolic Reasoning for SQL using Conflict-Driven Under-Approximation SearchPinhan Zhao, Yuepeng Wang, Xinyu WangPLDI 2025
Related papers
- Provenance-guided synthesis of Datalog programsMukund Raghothaman, Jonathan Mendelson, David Zhao, Mayur Naik et al.POPL 2020 · 49 citations
- Optimizing Recursive Queries with Progam SynthesisYisu Remy Wang, Mahmoud Abo Khamis, Hung Q. Ngo, Reinhard Pichler et al.SIGMOD 2022 · 9 citations
- Counterexample-Guided Partial Bounding for Recursive Function SynthesisAzadeh Farzan, Victor NicoletCAV 2021 · 13 citations
- Relational Query Synthesis ⋈ Decision Tree LearningAaditya Naik, Aalok Thakkar, Adam Stein, Rajeev Alur et al.VLDB 2024 · 2 citations
- Data-driven Recurrent Set Learning For Non-termination AnalysisZhilei Han, Fei HeICSE 2023 · 1 citation
