KIT | KIT-Bibliothek | Impressum | Datenschutz

Beyond Notations: Hygienic Macro Expansion for Theorem Proving Languages

Ullrich, Sebastian ORCID iD icon 1; de Moura, Leonardo 2
1 Institut für Programmstrukturen und Datenorganisation (IPD), Karlsruher Institut für Technologie (KIT)
2 Karlsruher Institut für Technologie (KIT)

Abstract:

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. ... mehr


Verlagsausgabe §
DOI: 10.5445/IR/1000146558
Veröffentlicht am 18.05.2022
Originalveröffentlichung
DOI: 10.46298/lmcs-18(2:1)2022
Scopus
Zitationen: 1
Dimensions
Zitationen: 1
Cover der Publikation
Zugehörige Institution(en) am KIT Institut für Programmstrukturen und Datenorganisation (IPD)
Publikationstyp Zeitschriftenaufsatz
Publikationsjahr 2022
Sprache Englisch
Identifikator ISSN: 1860-5974
KITopen-ID: 1000146558
Erschienen in Logical Methods in Computer Science
Verlag Logical Methods in Computer Science
Band 18
Heft 2
Vorab online veröffentlicht am 13.04.2022
Nachgewiesen in Dimensions
Scopus
Web of Science
Relationen in KITopen
KIT – Die Forschungsuniversität in der Helmholtz-Gemeinschaft
KITopen Landing Page