Saved in:
Bibliographic Details
Main Author: Shahin, Ramy
Format: Preprint
Published: 2026
Subjects:
Online Access:https://arxiv.org/abs/2605.02113
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866913085163307008
author Shahin, Ramy
author_facet Shahin, Ramy
contents Datalog is a lightweight logic programming language, based on the logic of Horn clauses. Lean, on the other hand, is a proof assistant system and language based on the Calculus of Inductive Constructions (CIC). Datalog is more constrained and less expressive than Lean but has a long history of established deduction algorithms. Writing definitions and queries in the Datalog fragment of Lean would be more succinct and understandable than writing them in Lean itself. This paper outlines the design and implementation of a shallow embedding of Datalog as a Domain Specific Language (DSL) on top of Lean. Bidirectional interoperability between the Datalog DSL and Lean is a primary goal of this design. In addition to rules and facts, backward chaining queries are automatically translated into theorems with tactic-based proofs. The paper also includes three simple examples of how the DSL can be used.
format Preprint
id arxiv_https___arxiv_org_abs_2605_02113
institution arXiv
publishDate 2026
record_format arxiv
spellingShingle A Shallow Embedding of Datalog in Lean
Shahin, Ramy
Software Engineering
Programming Languages
Datalog is a lightweight logic programming language, based on the logic of Horn clauses. Lean, on the other hand, is a proof assistant system and language based on the Calculus of Inductive Constructions (CIC). Datalog is more constrained and less expressive than Lean but has a long history of established deduction algorithms. Writing definitions and queries in the Datalog fragment of Lean would be more succinct and understandable than writing them in Lean itself. This paper outlines the design and implementation of a shallow embedding of Datalog as a Domain Specific Language (DSL) on top of Lean. Bidirectional interoperability between the Datalog DSL and Lean is a primary goal of this design. In addition to rules and facts, backward chaining queries are automatically translated into theorems with tactic-based proofs. The paper also includes three simple examples of how the DSL can be used.
title A Shallow Embedding of Datalog in Lean
topic Software Engineering
Programming Languages
url https://arxiv.org/abs/2605.02113