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: John M Grosen <jmgrosen AT mit.edu>
  • To: "coq-club AT inria.fr" <coq-club AT inria.fr>, "michael.soegtrop AT intel.com" <michael.soegtrop AT intel.com>
  • Subject: RE: [Coq-Club] Is it possible to perform tactics in an existential's context from Ltac?
  • Date: Fri, 29 Jun 2018 19:20:42 +0000
  • Accept-language: en-US
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=jmgrosen AT mit.edu; spf=Pass smtp.mailfrom=jmgrosen AT mit.edu; spf=None smtp.helo=postmaster AT dmz-mailsec-scanner-6.mit.edu
  • Ironport-phdr: 9a23:lVpughRQ8Rt7dAsU4R66DGR9mtpsv+yvbD5Q0YIujvd0So/mwa6yYBON2/xhgRfzUJnB7Loc0qyK6/6mATRIyK3CmUhKSIZLWR4BhJdetC0bK+nBN3fGKuX3ZTcxBsVIWQwt1Xi6NU9IBJS2PAWK8TW94jEIBxrwKxd+KPjrFY7OlcS30P2594HObwlSizexfbJ/IA+qoQnNq8IbnZZsJqEtxxXTv3BGYf5WxWRmJVKSmxbz+MK994N9/ipTpvws6ddOXb31cKokQ7NYCi8mM30u683wqRbDVwqP6WACXWgQjxFFHhLK7BD+Xpf2ryv6qu9w0zSUMMHqUbw5Xymp4qF2QxHqlSgHLSY0/mHJhMJtkKJVrhGvpxJ9zI7VfI6bO/Vxc7jBfdMDQWdNQtpdWzBfDo66coABD/ABPeFdr4Tlo1UOqhu+BQ+xD+3o1zRGh2X23aoh0+s/FwHNwQstH9ALsHTbttX1M7wSXv6zzKTTyDXDbu9W1S3j54fVbxAsuPeBVq9+f8rWzEkgDQLFjlOIpIzkOTOVyvoCs2yB4+V9S+2ijXMspQJpojW328shiZPFi4APxl3F9ih12og4KN2gREJmYtOoCplduzuYOodrWM8vQmNltD4nxrAHvZO3ZjYGxZQoyhLFdfCLaZWE7xD9WOuXPDx2nmhqeKiliBa36UWgyvPzVs2z0FtSsyVFl9jNumkI1xPJ68iHTuB98Vm91jqWzADc9vtLIUYylaXFMZ4t2789moAWsUTCAi/6glv5g7KLdkk8++io7froYqn+q5OBNIJ4kAPzPr4vl8G8G+g1PAgDU3Ce+eum1b3j+UP5QK9Njv0ziqTZspXaJcsBpq6+GA9azIAj5g26DzenzNQUh2cII09YeB6flYjmJ0nOIOzkDfe4m1mjjDBrx+nfMrL9BpXNM2PMnaz6fbd97k5c0BA8wcpe55JSELEBIej8VlX/tNzCXVcFNFn+yOH+Td55y4k2WGSVA6bfPrmY+QuD4ftqKO2RbqcUviz8Ir4r/aiqxTU8mFQddKStm4AQZX+kBPN+C0SffXfoxNwGFC1C6g8/R+zjhVnESjleaGqoWLoU5zcnBYbgBoDGENODmruEiQW8HpseQyhpEFeXHHGgI4eBVO0Lcy+UCspgjnoJWaX3GNxp7g2nqAKvk+kvFeHT4CBN7cuyhugw3PXakFQJzRIxCs2c12+XSGQlzGYJW3k70L0t+BUhmGfG6rBxhrljLfIW/+lAA1U/NIKawuBnWYirB1DxO+yRQVPjee2IRDE8StVqmo0CZlQ4HtyjigvO1G+xCLYTkbGRQcJy96PAmXX9OpQlxg==

Thanks for all your help.

Unfortunately, the instantiate + refine trick doesn't help in my scenario. In
particular, I don't know the index of the existential variable I want to
instantiate. Trying it with the expression directly doesn't work:

Goal exists (n : nat), n = 2.
eexists.
match goal with
| [ |- ?x = _ ] =>
instantiate (x := 0)
end.

fails with error "Ltac variable x is bound to ?n which cannot be coerced to a
fresh identifier.". I could imagine using some fancy Ltac to figure out the
index of the evar I want to instantiate, but given that this doesn't work:

let x := 1 in instantiate (x := 0).

(failing in a similar manner), I don't think that approach would succeed
either.

The unshelve suggestions are appreciated, but I don't think it solves my
grander issue: I want to essentially extend Coq's unification procedure for
existential variables depending on what the current goal looks like, but this
could be many proof steps down the line from the initial creation of the
evar, so just having the evar as a proof goal somewhere doesn't help much
automation-wise.

It could be the case that my situation is too complicated to use Coq's
existential variables, and instead I should do some explicit reasoning with
sigma types. That would be unfortunate, though...
________________________________________
From:
coq-club-request AT inria.fr

[coq-club-request AT inria.fr]
on behalf of Ralf Jung
[jung AT mpi-sws.org]
Sent: Thursday, June 28, 2018 1:36 AM
To:
coq-club AT inria.fr;
Soegtrop, Michael
Subject: Re: [Coq-Club] Is it possible to perform tactics in an existential's
context from Ltac?

Hi,

> isn't the problem of John that he can't instantiate the evar in the context
> of the current goal? It was stated before that an evar can be unified with
> any term of the same type. But this might not work in practice, because the
> resulting term might not be well typed in the context, in which the evar
> was created.
>
> John suggested to focus on the evar itself as goal, because then obviously
> one would be in the right context to construct a well typed term for the
> evar. Are there other methods? If not, how can one focus an unnamed evar?

John was asking about something like `only [n]: refine (S _)` for unnamed
evars,
and the answer is `instantiate (1 := ltac:(refine (S _)))`.
Admittedly, that's still not focusing in the sense of actually bringing the
context on the screen in CoqIDE/ProofGeneral. I don't know how to do that
even
for named evars...

Kind regards,
Ralf

>
> Best regards,
>
> Michael
> Intel Deutschland GmbH
> Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
> Tel: +49 89 99 8853-0, www.intel.de
> Managing Directors: Christin Eisenschmid, Christian Lamprechter
> Chairperson of the Supervisory Board: Nicole Lau
> Registered Office: Munich
> Commercial Register: Amtsgericht Muenchen HRB 186928
>



Archive powered by MHonArc 2.6.18.

Top of Page