3 ms·
This article introduces a macro expansion algorithm for Interactive Theorem Provers based on Scheme's hygienic macros and adapted for use in proof contexts. Wi
by ykonstant 2y ago
This article introduces a macro expansion algorithm for Interactive Theorem Provers based on Scheme's hygienic macros and adapted for use in proof contexts.
With some improvements and modifications, this algorithm is part of the meta-programming system of Lean 4; it is what allows complex syntactic transformations in a context where safety/correctness is crucial.
A more broad overview of Lean's metaprogramming can be found in [0], but the algorithm is of independent interest and language developers may be interested in studying it.
[0] https://leanprover-community.github.io/lean4-metaprogramming-book/ https://leanprover-community.github.io/lean4-metaprogramming...