Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Is it possible to perform tactics in an existential's context from Ltac?

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Is it possible to perform tactics in an existential's context from Ltac?


Chronological Thread 
  • From: Ralf Jung <jung AT mpi-sws.org>
  • To: coq-club AT inria.fr, John Grosen <jmgrosen AT mit.edu>
  • Subject: Re: [Coq-Club] Is it possible to perform tactics in an existential's context from Ltac?
  • Date: Thu, 28 Jun 2018 07:37:24 +0200
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=jung AT mpi-sws.org; spf=Pass smtp.mailfrom=jung AT mpi-sws.org; spf=None smtp.helo=postmaster AT juno.mpi-klsb.mpg.de
  • Ironport-phdr: 9a23:7GSLbBYUebvd8mIQ2l2dmoL/LSx+4OfEezUN459isYplN5qZoMm/bnLW6fgltlLVR4KTs6sC17KI9fi4EUU7or+5+EgYd5JNUxJXwe43pCcHRPC/NEvgMfTxZDY7FskRHHVs/nW8LFQHUJ2mPw6arXK99yMdFQviPgRpOOv1BpTSj8Oq3Oyu5pHfeQpFiCa8bL9oMBm6sRjau9ULj4dlNqs/0AbCrGFSe+RRy2NoJFaTkAj568yt4pNt8Dletuw4+cJYXqr0Y6o3TbpDDDQ7KG81/9HktQPCTQSU+HQRVHgdnwdSDAjE6BH6WYrxsjf/u+Fg1iSWIdH6QLYpUjm58axlVAHnhzsGNz4h8WHYlMpwjL5AoBm8oxBz2pPYbJ2JOPZ7eK7WYNEUSndbXstJSiJPHI28YYsMAeQPM+lXoIvyqEcBoxalGQmhBvnixiNUinL436A31fkqHwHc3AwnGtIDqGjao8/xNKccTOu7yLTIzTPMb/hL3jr96pXIchYuofyXWLJwacvRxVA0FwLLlVWcs4vlPyma1ukUtWWQ8uluVfq3hmI6pQx8piKjytooh4XThY8Yy0rI+CplzIotJtC1TFR3bcO6HJdKqS2WLZZ6T8ImTmxupS000KcJuYShcygP0JknxwDQa/iAc4WQ4BLjSeCRITBiiHJgYLK/hg++8Uukyu3nTca4ylNKrjJKktXWq38CyQTf6smBSvRj4keswSuD2g7X5+1ePEw5kbDXJp0gz7IqmZcfrVzPHirsl0X3iK+WeF8k+u+t6+n/YLXmu5mcN4BvhwH7KqQum9WzAf82MwgVRWSb/v681LL78U3jXLpKluE2krXesJ3COcsbobe5DxZJ3YYn9hawFCyr0M8YnHkCNFJKYgiLj4nvO1HUIfD3F+2zg1q2kGQj+/eTNbr4R57JM3LrkbH7fL875VQYgCg0zdYXyIhTEbwHaKbxX0Drs8fVCDc8MhDyzur6XoZTzIQbDFiGBqHREr7Uvhfc5P8pLMGJfI5Qoynmbf8/6Ki93jcChVYBcPzxjtMsY3eiE6Ejeh3BOCu+spI6CW4P+zEGYqnvgVyGXyRUYi/pDack53QgF5ngCp3MFNn03O6xmRyjF5gTXVhoT0iWGC6zJYCcWrIXdznUJdVuwGRdCOqRDrQ53BTrjzfUjrpqKu2OoH8aqJTkkt1t5qjQkQo4szlsAIKR3jPVQg==

Hi John,

I was going to suggest something like

Goal exists (n : nat), n = 2.
eexists.
instantiate (1 := refine (S _)).

because "instantiate" can actually run tactics. However, the above does not
work, saying

Instance is not well-typed in the environment of ?n.

I am not sure how to get around that. It's certainly possible to refine an
evar
using new evars, just not this way I guess...

Kind regards,
Ralf

On 27.06.2018 21:58, John Grosen wrote:
> I am currently dealing with a problem in which I have an existential
> variable in the goal and want to apply a lemma to the goal, but Coq's
> unifier is not powerful enough to automatically unify the relevant part
> of the lemma with the evar. However, in this particular case, it is
> programatically obvious how to unify them, so I would like to write some
> Ltac to do so. Imagine this (greatly simplified) example:
>
> Goal exists (n : nat), n = 2.
> evar (n : nat).
> exists n.
> only [n]: refine (S _).
>
> This works, but I usually don't have a name for the existential
> variables I'm dealing with and the automation certainly doesn't know
> about any. So what I'd like to do is this:
>
> Goal exists (n : nat), n = 2.
> eexists.
> match goal with
> | [ |- ?x = _ ] =>
> only [x]: refine (S _)
> end.
>
> However, Coq complains with "No such goal." As far as I can tell, this
> is because the argument in "only [_]" is a syntactic identifier.
>
> Then, is there any way to select a goal with a non-syntactic identifier,
> like I have in this situation?
>
> Thanks,
> John
>



Archive powered by MHonArc 2.6.18.

Top of Page