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: Sun, 24 Jan 2016 10:52:44 -0500
  • Authentication-results: mail3-smtp-sop.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-qg0-f49.google.com
  • Ironport-phdr: 9a23:1ZbFQBBFMOTTrAI/8gluUyQJP3N1i/DPJgcQr6AfoPdwSP7/psbcNUDSrc9gkEXOFd2CrakU1ayP6/CrCTRIyK3CmU5BWaQEbwUCh8QSkl5oK+++Imq/EsTXaTcnFt9JTl5v8iLzG0FUHMHjew+a+SXqvnYsExnyfTB4Ov7yUtaLyZ/niabro82YM10ArQH+SI0xBS3+lR/WuMgSjNkqAYcK4TyNnEF1ff9Lz3hjP1OZkkW0zM6x+Jl+73YY4Kp5pIYTGZn9Kq8/VPlTCCksG2Ez/szi8xfZHiWV4X5JcGIQmwZICg6NyBz7QJr3rmOutO172SqXOcD7Zb8xUDWmqaxsTUm72288Kzcl/TSP2YRLh6VBrUf5qg==

Hi Jason,

How do you want to select the goal to be shown? Is it the only one in focus? Also, I noticed the delay between the setup of __Goal and the display - do you want that as well, or do you want to be able to show the proof at any point without prior setup? Is that what you meant when saying it would be nice if you didn't need the refine?

Note that you don't need the named evar creation below: "_" works in place of "?[__Goal2]".

Anyway, I do have a way to do this, and can tailor it per your description. See 4468 for some clues.

-- Jonathan

On 01/24/2016 12:42 AM, Jason Gross wrote:
Is there a nice way to execute [Show Proof] from Ltac? That is, I want to
be able to do something like

let G := show_proof_term in
idtac "Some prefix" G.

or

show_proof_term_with_prefix "Some prefix".

The best I've been able to come up with on short notice is:
Goal True /\ False.
let G := match goal with |- ?G => G end in
simple refine (let __Goal := _ : G in ?[__Goal2]); [ | shelve ].
split.
Unshelve.
all: cycle -1.
let G := (eval cbv delta [__Goal] in __Goal) in
idtac "Some prefix" G.

but I'm guessing that there's something fancy I can do with named evars and
[instantiate] to execute the [idtac] in the context of __Goal2, but I'm not
sure what it is. (I'm basically fine with needing the [refine] at the
beginning of the proof, though it'd be nice if I didn't need it; I mostly
want this so I can minimize a bug that depends on the output of [Show
Proof].)

Thanks,
Jason





Archive powered by MHonArc 2.6.18.

Top of Page