DSLean: A Framework for Type-Correct Interoperability Between Lean 4 and External DSLs

📅 2026-02-20
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
This work addresses the challenges of integrating external domain-specific languages (DSLs) into interactive proof assistants—namely, the tedious, type-unsafe, and error-prone nature of expression translation. We propose DSLean, a framework built on Lean 4’s metaprogramming system that enables type-safe, bidirectional translation between external DSLs and their Lean equivalents through declarative syntax definitions. DSLean introduces a lightweight, syntax-directed bidirectional transformation mechanism coupled with type-driven semantic alignment, substantially reducing the integration overhead for external automated reasoning tools. We demonstrate the framework’s generality and practicality by successfully connecting solvers for interval arithmetic, ordinary differential equations, and ideal membership in polynomial rings, showcasing its effectiveness across diverse domains.

Technology Category

Application Category

📝 Abstract
Domain-specific languages (DSLs) mediate interactions between interactive proof assistants and external automation, but translating between the prover's internal representation and such DSLs is a tedious engineering chore. To simplify this task, we present DSLean, a framework for bidirectional translation between expressions in the Lean proof assistant and external syntax. DSLean requires only a specification of an external language and its Lean equivalents, abstracting away meta-level implementation details. We demonstrate DSLean's capabilities by implementing three new automation tactics, providing access to external solvers for interval arithmetic, ordinary differential equations, and ring ideal membership.
Problem

Research questions and friction points this paper is trying to address.

interoperability
domain-specific languages
proof assistants
type correctness
translation
Innovation

Methods, ideas, or system contributions that make the work stand out.

DSLean
bidirectional translation
type-correct interoperability
external DSLs
Lean 4
🔎 Similar Papers
No similar papers found.
T
Tate Rowney
Carnegie Mellon University, Pittsburgh, PA
R
Riyaz Ahuja
Carnegie Mellon University, Pittsburgh, PA
Jeremy Avigad
Jeremy Avigad
Professor of Philosophy and Mathematical Sciences, Carnegie Mellon University
Mathematical logicproof theoryphilosophy of mathematicsformal verificationautomated reasoning
S
Sean Welleck
Carnegie Mellon University, Pittsburgh, PA