Zulip Chat Archive

Stream: Is there code for X?

Topic: simproc equivalent of apply_ite for match statements


Geoffrey Irving (Dec 23 2025 at 20:30):

Often I have expressions like

`f (match e with | Exit.large => x | _ => y)

and I would like to push the f application inside each match branch. Is there a way to do this within a single simp invocation, in the same way that docs#apply_ite can do this for ifs within simp?

I can do this by writing down a version of apply_ite specialised to the particular type I'm matching over, but it is a bit sad to do so. I'm imagining that it would have to be a simproc, since presumably one can't write down a lemma that understands all the different kinds of matches.

Aaron Liu (Dec 23 2025 at 20:33):

does split help?

Ruben Van de Velde (Dec 23 2025 at 20:33):

Not with the question as asked, no

Geoffrey Irving (Dec 23 2025 at 20:34):

I will look into split then, thank you!


Last updated: Feb 28 2026 at 14:05 UTC