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).
27 lines
475 B
Text
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]
|