首页    期刊浏览 2024年10月07日 星期一
登录注册

文章基本信息

  • 标题:BEYOND NOTATIONS: HYGIENIC MACRO EXPANSION FOR THEOREM PROVING LANGUAGES
  • 本地全文:下载
  • 作者:Sebastian Ullrich ; Leonardo de Moura
  • 期刊名称:Logical Methods in Computer Science
  • 印刷版ISSN:1860-5974
  • 电子版ISSN:1860-5974
  • 出版年度:2022
  • 卷号:18
  • 期号:2
  • 页码:1-21
  • DOI:10.46298/lmcs-18(2:1)2022
  • 语种:English
  • 出版社:Technical University of Braunschweig
  • 摘要:In interactive theorem provers (ITPs), extensible syntax is not only crucial to lower the cognitive burden of manipulating complex mathematical objects, but plays a critical role in developing reusable abstractions in libraries. Most ITPs support such extensions in the form of restrictive "syntax sugar" substitutions and other ad hoc mechanisms, which are too rudimentary to support many desirable abstractions. As a result, libraries are littered with unnecessary redundancy. Tactic languages in these systems are plagued by a seemingly unrelated issue: accidental name capture, which often produces unexpected and counterintuitive behavior. We take ideas from the Scheme family of programming languages and solve these two problems simultaneously by proposing a novel hygienic macro system custom-built for ITPs. We further describe how our approach can be extended to cover type-directed macro expansion resulting in a single, uniform system offering multiple abstraction levels that range from supporting simplest syntax sugars to elaboration of formerly baked-in syntax. We have implemented our new macro system and integrated it into the new version of the Lean theorem prover, Lean 4. Despite its expressivity, the macro system is simple enough that it can easily be integrated into other systems.
  • 关键词:lean macro hygiene
国家哲学社会科学文献中心版权所有