Zulip Chat Archive

Stream: lean4

Topic: Naive question: safety of tactics


Siddhartha Gadgil (Sep 01 2021 at 11:16):

I was trying to understang some of the source code, specifically liftMetaTactic and have a naive question - what goes wrong if we call this with a tactic that simply maps MVarId to return [], i.e., just declares no goals are left. Is such a function not well-defined for some reason? Or is it the responsibility of the tactic writer, and a failure will happen later?

Thanks.

Mario Carneiro (Sep 01 2021 at 11:17):

this will definitely not be caught at compile time if that's what you mean

Siddhartha Gadgil (Sep 01 2021 at 11:18):

Thanks. That is what I meant.

Mario Carneiro (Sep 01 2021 at 11:18):

You can do the same thing in lean 3 tactics. What happens is that you get no goals so it looks like you finished, but then you get a more low level error saying the tactic didn't actually produce a complete term like it was supposed to

Mario Carneiro (Sep 01 2021 at 11:18):

This is generally considered a bug in the tactic

Siddhartha Gadgil (Sep 01 2021 at 11:20):

Thanks. So I see it is the responsibility while writing a tactic to ensure that MVar is a consequence of the new metavariables returned, and that a proof of this has been added (to the local context?)

Mario Carneiro (Sep 01 2021 at 11:22):

You should ensure that the input MVar is either passed back out as a goal, or assigned to an expression which would be a complete term if all the mvars returned as goals are assigned to complete terms

Siddhartha Gadgil (Sep 01 2021 at 12:17):

What does _assign_ mean here?


Last updated: Dec 20 2023 at 11:08 UTC