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

Knowledge Representation and Reasoning: Description LogicsConstraint Satisfaction and Optimization: Satisfiability Modulo TheoriesNatural Language Processing: Code Generation / Program Synthesis from Natural Language

Application Category

Semantics and Knowledge: Data modeling to support human-machine intelligence, including LLMs agents, intelligent system behavior, explanations, and user-friendly interactionsSystems and Infrastructure for Web, Mobile and WoT: Applied ML and AI for Web-based mobile applicationsSearch and Retrieval-Augmented AI: Vertical and domain-specific search
📝 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
2024-03-20Conference on Empirical Methods in Natural Language ProcessingCitations: 1