🤖 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.
📝 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.