Zulip Chat Archive

Stream: lean4

Topic: Getting ASTs of Lean file


Jaeboum Kim (Apr 05 2024 at 14:52):

Hi! How can I get Abstract Syntax Trees of Lean file?
I saw the following command of Lean 3. However, it does not work in Lean 4.
"lean --make --ast computability/ackermann.lean"

Henrik Böving (Apr 05 2024 at 14:58):

The process is quite a lot more involved than that, why are you looking into getting the Lean AST?

Jaeboum Kim (Apr 05 2024 at 15:03):

I would like to get structural embedding via Lean AST. ( ex. Lean AST -> graph -> graph embedding) Are there any better ways?

Henrik Böving (Apr 05 2024 at 15:05):

Okay so you are interested in doing AI things yes? We usually point people interested in interacting with lean through AI here: https://github.com/leanprover-community/repl

Jaeboum Kim (Apr 05 2024 at 15:08):

Thanks for your kind and quick reply! Would it be a good idea to leave a question in that repo? or parse info from the output of repl?

Henrik Böving (Apr 05 2024 at 15:16):

You can ask there if you want, the authors are also here on the Zulip, most notably @Scott Morrison (they are probably asleep right now but will be around in a few hours)

Kim Morrison (Apr 06 2024 at 03:30):

We don't really have a great pure text representation of Lean.Syntax. You should look at that type, and then if you can tell us something about how you would like it represented probably we can give some pointers.


Last updated: May 02 2025 at 03:31 UTC