Mobius: Synthesizing Relational Queries with Recursive and Invented Predicates

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 id...

Full description

Saved in:
Bibliographic Details
Published in:Proceedings of ACM on programming languages Vol. 7; no. OOPSLA2; pp. 1394 - 1417
Main Authors: Thakkar, Aalok, Sands, Nathaniel, Petrou, George, Alur, Rajeev, Naik, Mayur, Raghothaman, Mukund
Format: Journal Article
Language:English
Published: New York, NY, USA ACM 16.10.2023
Subjects:
ISSN:2475-1421, 2475-1421
Online Access:Get full text
Tags: Add Tag
No Tags, Be the first to tag this record!
Description
Summary: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.
ISSN:2475-1421
2475-1421
DOI:10.1145/3622847