Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] [Show Proof] from Ltac?

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] [Show Proof] from Ltac?


Chronological Thread 
  • From: Jonathan Leivent <jonikelee AT gmail.com>
  • To: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] [Show Proof] from Ltac?
  • Date: Tue, 26 Jan 2016 15:27:57 -0500
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=jonikelee AT gmail.com; spf=Pass smtp.mailfrom=jonikelee AT gmail.com; spf=None smtp.helo=postmaster AT mail-qk0-f180.google.com
  • Ironport-phdr: 9a23:3zaCER+2jXO4i/9uRHKM819IXTAuvvDOBiVQ1KB91+scTK2v8tzYMVDF4r011RmSDdqds6oP0rON+4nbGkU+or+5+EgYd5JNUxJXwe43pCcHRPC/NEvgMfTxZDY7FskRHHVs/nW8LFQHUJ2mPw6anHS+4HYoFwnlMkItf6KuStGU15z8jrnps7ToICx2xxOFKYtoKxu3qQiD/uI3uqBFbpgL9x3Sv3FTcP5Xz247bXianhL7+9vitMU7q3cY6Lod8JtLVry/dKAlR5RZCi4nOiY7/p7Frx7GGCmI4HIAUmwQ2j5FAhbI6g2yCpX2tCr5u+5w1QGVOMT3SfY/XjH0vPQjcwPhlCpSb21xy2rQkMEl1K8=



On 01/26/2016 02:45 PM, Jonathan Leivent wrote:


On 01/26/2016 02:13 PM, Jason Gross wrote:
Right, I think I do need the setup. I was mainly wondering if I could get
rid of the Unshelve. I think I saw a comment by you on some bug report
mentioning that instantiate works with named evars? That seems like it'd
be enough to wrap the whole thing up into pre_show_goal, show_goal, and
post_show_goal tactics, with no vernacular needed.

Oh, so you want the "observer" goal to remain hidden after the setup, but to be recoverable later, correct? So you are trying to make the observer goal be a named evar, so that it is recoverable later by name? Here is an Ltac hack that can do that:

Variable F : Type.
Goal F.
(*setup and shelve observer with evar name __Observer*)
lazymatch goal with
|- ?G => simple refine (let x := _ : G in ?[__Observer]); [|shelve]
end.
(*evolution of observed goal*)
pose (x:=1).
destruct x.
(*recovery of observer*)
unshelve instantiate (__Observer := _).

Warning: this type of Ltac hackery is bound to incur the ire of the devs. Use at your own risk.

-- Jonathan


If you also want the observer to be trivially solvable (so you can easily dispose of it later), you can do this:

Variable F : Type.
Goal F.
assert True as _;
[let E:=fresh in (*should have done this above, too*)
simple refine (let E := ?[__Observed] in ?[__Observer])
|exact ?__Observed];
[|shelve].
pose (x:=1).
destruct x.
unshelve instantiate (__Observer := _).

(same warning, only more so)

-- Jonathan




Archive powered by MHonArc 2.6.18.

Top of Page