lean4-htt/tests/run/12048.lean
Sebastian Graf 36eaa68744
fix: make all VCs emitted by mvcgen synthetic opaque (#12048)
This PR fixes a bug where `mvcgen` loses VCs, resulting in unassigned
metavariables. It is fixed by making all emitted VCs synthetic opaque.

The bug was reported by [Alexander Bentkamp on the community
Zulip](https://leanprover.zulipchat.com/#narrow/channel/236449-Program-verification/topic/mvcgen.20bug.3F.20.22declaration.20has.20metavariables.22).
2026-01-19 16:51:10 +00:00

27 lines
475 B
Text

import Std.Tactic.Do
open Std.Do
set_option mvcgen.warning false
axiom myfun : Except String Unit
@[spec]
axiom myfun_spec (h : True) :
⦃ ⌜ True ⌝ ⦄
myfun
⦃ ⇓ _ => ⌜ True ⌝ ⦄
@[spec]
def anotherfun : Except String Unit :=
if true then pure () else pure ()
noncomputable def program : Except String Unit := do
anotherfun
myfun
@[spec]
theorem spec :
⦃ ⌜ True ⌝ ⦄
program
⦃ ⇓ _ => ⌜ True ⌝ ⦄ := by
mvcgen [program]