Zulip Chat Archive
Stream: metaprogramming / tactics
Topic: namespace, alias and open_locale
Huajian Xin (Oct 13 2022 at 03:14):
I'm working with building interface between LEAN and Python for automated theorem proving and trying to extract information and setting the proving environment, but many difficulties emerge.
- Is there any metaprogramming method to declare that "the current proof is within a specific namespace" like we declare "namespace" and "end" in lean file? To my knowledge there is only
tactic.set_env (env.execute_open some_namespaces)
ininit/meta/tactic.lean
with seems behave likeopen
. - Is there any metaprogramming method to make declaration
open_locale
? - Is there any metaprogramming method to collect declared alias information?
Any reply or explaination would be appreciated! And if anyone want to build this project with me please contact mexinhj@mail2.sysu.edu.cn
, thanks!
Jannis Limperg (Oct 13 2022 at 13:52):
You might want to do your interface for Lean 4 instead of Lean 3. Both because Lean 3 will be obsolete soon-ish and because the metaprogramming API of Lean 4 is a lot more expressive than that of Lean 3.
Huajian Xin (Oct 14 2022 at 02:32):
Jannis Limperg said:
You might want to do your interface for Lean 4 instead of Lean 3. Both because Lean 3 will be obsolete soon-ish and because the metaprogramming API of Lean 4 is a lot more expressive than that of Lean 3.
Thanks! Good suggestions
Patrick Massot (Oct 14 2022 at 07:31):
My recommended path is:
- Read https://leanprover.github.io/functional_programming_in_lean/
- Read https://github.com/arthurpaulino/lean4-metaprogramming-book
- Have a look at https://github.com/PatrickMassot/lean4-game-server for inspiration about how to interact with Lean 4 in a non-editor way
Of course this includes asking tons of questions in https://leanprover.zulipchat.com/#narrow/stream/270676-lean4 when needed
Last updated: Dec 20 2023 at 11:08 UTC