Zulip Chat Archive

Stream: Is there code for X?

Topic: access raw proof terms


Andre Graubner (安德) (Dec 14 2022 at 05:36):

Andre Graubner (安德) 1:30 PM
Hello, I hope this is the right place to ask this. I'm curious if there's a way to look at 'raw proof terms' as constructed by using tactics. I'm a bit new to this so I might be misunderstanding something, but can I somehow get the low-level, functional lean code from a higher-level proof? To give some context, I'm interested in pattern mining and analysis of proofs in lean, and for that I would like to explore what existing ways there are to actually access things like syntax trees for existing lean code. I'm not quite sure what I would be searching for in order to find this on google... Thanks!

Junyan Xu (Dec 14 2022 at 06:03):

You can encircle the tactics by show_term { }, or use #print, for example

import tactic.norm_num
lemma test : 2 + 3 = 5 := by show_term { norm_num }
#print test

Andre Graubner (安德) (Dec 14 2022 at 06:04):

I'll try this, thank you very much.

Junyan Xu (Dec 14 2022 at 06:21):

You may also want to read this and maybe the proof artifact co-training paper.

Andre Graubner (安德) (Dec 14 2022 at 06:58):

Thanks, I just came across that paper as well and it seems very relevant. Thank you!

Meow (Dec 17 2022 at 01:01):

Why #print is unable to use in Lean 3?


Last updated: Dec 20 2023 at 11:08 UTC