# Synthesizing Datalog Programs Using Numerical Relaxation

arXiv: https://arxiv.org/abs/1906.00163 · HTML: https://mlsanity.com/paper/1906.00163/

## Key facts

- Cited by 23 papers in the map (data through 14 Oct 2026).
- First posted on arXiv 1 Jun 2019.

## Built on by (most cited first, 23 of 23)

- [From Statistical Relational to Neurosymbolic Artificial Intelligence: a Survey](https://mlsanity.com/paper/2108.11451/) (2021)
- [Scallop: A Language for Neurosymbolic Programming](https://mlsanity.com/paper/2304.04812/) (2023)
- [DeepStochLog: Neural Stochastic Logic Programming](https://mlsanity.com/paper/2106.12574/) (2021)
- [Towards Data-and Knowledge-Driven Artificial Intelligence: A Survey on Neuro-Symbolic Computing](https://mlsanity.com/paper/2210.15889/) (2022)
- [Differentiable Inductive Logic Programming for Structured Examples](https://mlsanity.com/paper/2103.01719/) (2021)
- [Neuro-Symbolic Forward Reasoning](https://mlsanity.com/paper/2110.09383/) (2021)
- [Learning MDL logic programs from noisy data](https://mlsanity.com/paper/2308.09393/) (2023)
- [From Perception to Programs: Regularize, Overparameterize, and Amortize](https://mlsanity.com/paper/2206.05922/) (2022)
- [Learning Symbolic Rules for Reasoning in Quasi-Natural Language](https://mlsanity.com/paper/2111.12038/) (2021)
- [LogiCity: Advancing Neuro-Symbolic AI with Abstract Urban Simulation](https://mlsanity.com/paper/2411.00773/) (2024)
- [Learning logic programs by combining programs](https://mlsanity.com/paper/2206.01614/) (2022)
- [Generalisation Through Negation and Predicate Invention](https://mlsanity.com/paper/2301.07629/) (2023)
- [The DeepLog Neurosymbolic Machine](https://mlsanity.com/paper/2508.13697/) (2025)
- [Learning big logical rules by joining small rules](https://mlsanity.com/paper/2401.16215/) (2024)
- [Interpretable Hierarchical Concept Reasoning through Attention-Guided Graph Learning](https://mlsanity.com/paper/2506.21102/) (2025)
- [Meta-Interpretive Learning as Metarule Specialisation](https://mlsanity.com/paper/2106.07464/) (2021)
- [Learning programs with magic values](https://mlsanity.com/paper/2208.03238/) (2022)
- [Synthesizing Programs with Continuous Optimization](https://mlsanity.com/paper/2211.00828/) (2022)
- [PRIMA: Planner-Reasoner Inside a Multi-task Reasoning Agent](https://mlsanity.com/paper/2202.00531/) (2022)
- [On the Complexity of Inductively Learning Guarded Rules](https://mlsanity.com/paper/2110.03624/) (2021)
- [Example-based Synthesis of Static Analysis Rules](https://mlsanity.com/paper/2204.08643/) (2022)
- [Neurosymbolic Decision Trees](https://mlsanity.com/paper/2503.08762/) (2025)
- [DatalogBench: Evaluating Large Language Models on Text-to-Datalog Synthesis](https://mlsanity.com/paper/2609.37233/) (2026)

## Abstract (arXiv)

The problem of learning logical rules from examples arises in diverse fields, including program synthesis, logic programming, and machine learning. Existing approaches either involve solving computationally difficult combinatorial problems, or performing parameter estimation in complex statistical models. In this paper, we present Difflog, a technique to extend the logic programming language Datalog to the continuous setting. By attaching real-valued weights to individual rules of a Datalog program, we naturally associate numerical values with individual conclusions of the program. Analogous to the strategy of numerical relaxation in optimization problems, we can now first determine the rule weights which cause the best agreement between the training labels and the induced values of output tuples, and subsequently recover the classical discrete-valued target program from the continuous optimum. We evaluate Difflog on a suite of 34 benchmark problems from recent literature in knowledge discovery, formal verification, and database query-by-example, and demonstrate significant improvements in learning complex programs with recursive rules, invented predicates, and relations of arbitrary arity.
