coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Jeremy Dawson <Jeremy.Dawson AT anu.edu.au>
- To: "coq-club AT inria.fr" <coq-club AT inria.fr>
- Subject: Re: [Coq-Club] rewriting without instantiating
- Date: Mon, 3 Dec 2018 09:38:04 +0000
- Accept-language: en-US
- Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=Jeremy.Dawson AT anu.edu.au; spf=Pass smtp.mailfrom=Jeremy.Dawson AT anu.edu.au; spf=Pass smtp.helo=postmaster AT AUS01-ME1-obe.outbound.protection.outlook.com
- Ironport-phdr: 9a23:ejeKURFU8j8CupB8HnJ1JZ1GYnF86YWxBRYc798ds5kLTJ7zoMiwAkXT6L1XgUPTWs2DsrQY07qQ6/iocFdDyK7JiGoFfp1IWk1NouQttCtkPvS4D1bmJuXhdS0wEZcKflZk+3amLRodQ56mNBXdrXKo8DEdBAj0OxZrKeTpAI7SiNm82/yv95HJbAhEmDmwbaluIBmqsA7cqtQYjYx+J6gr1xDHuGFIe+NYxWNpIVKcgRPx7dqu8ZBg7ipdpesv+9ZPXqvmcas4S6dYDCk9PGAu+MLrrxjDQhCR6XYaT24bjwBHAwnB7BH9Q5fxri73vfdz1SWGIcH7S60/VDK/5KlpVRDokj8KOT4n/m/Klsx+gqFVoByjqBx+34Hab46aOeFifqzGZ94WWXZNUtpTWiFHH4iyb5EPD+0EPetAq4fyuUEOogW7BQisGejhxCVHh3Ht3a091eQqDAbL0gg+ENIUrnvUqdX0OL0cX++vwqjI1jLDb/VN1Djn7ojIbwotru+RUrJta8be01QvGhrDg16NqoLlJyuY2+sRv2SB8uZsSeCih3Q6pwx/ozWj3NoghpXUio4NxV3J8T91zJs2KNGlUkJ3fNypHIdKuy2EOIZ7TdsuQ292tys51rELvJu2cSkWx5klxxPSbuaIfouK7x3+UeuePCt3iXxhdb+6nBm960etx+76W8KpylhFtDBFncPJtn0V1xzc9MyHSvxl80q91zmByhzf5vxdLU4zmqTXNoctwrkrmZUNq0jDGTL2mFntg6+Ra0Uk/PWn5/7/YrX8oZ+cK5F7hR3iMqQvncy/B/40Mg8TX2iH/eS807rj/U7jTLpWif02l7HVsJHcJcsFuq60GwBY3po55xqiEzur0s4UkWQJIV9EYh6LkpTlN0zWLPD9F/i/glCskDlxx/DBO73sGpHDIWbZkLj/eLZ861RQxgQpwtFR/JJUDbcBLenpVU/3qdzUFAE2PBGpw+r9Etp9y5sSWXiTDa+BLKPSrViI6/ozLOmLfY8ZoSryK/w45/H1lnI5gl8cfayx3ZQNcny4H/JmI1+YYXX2mNsBH30K7UICS7mgg1qbFDVXenyaXqQm5zh9BpjsRdPIQZnoi7ic1g+6GIdXbyZIEAbfP23vctCmVu0BbTPaDsZ+iTsCHeyDRpUs0ADomAbl0L1hBuPS52sVuY+l3cUjtL6brg076TEhV5fV6GqKVWwhxjpZFQ9z57h2pAlG8nnG1KF5h/JCEtkKvaFAVBp8OJLBieVnWYmrBlDxO+yRQVPjee2IRCkrR4trkdYIfgBwF8jkhw2Rh3P3UY9QrKSCAdkPyoyZ33X1IJoimV/77/F4ynwLG45IP2DggbNj/Q/OAYKPi1+ei6uhaaUb2mjK6XuHym2N+kpfVVwpXA==
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
Hi Dominique,
Thanks for your answer, I just want it to rewrite ?Φ1 ++ [] ++ ?Φ2 to
?Φ1 ++ ?Φ2.
There would be only one possible spot to rewrite if it did not
instantiate ?Φ1 to [].
So how do I stop it instantiating variables in the goal? (Obviously I
want it to instantiate variables in the rule being used for rewriting,
ie the variable l in the app_nil_l rule). Experimenting with numbering
locations where it might rewrite would be very inconvenient, since I
will have dozens of goals I would be using my tactic on.
Cheers,
Jeremy
On 12/03/2018 07:04 PM, Dominique Larchey-Wendling wrote:
>
>
> ----- Mail original -----
>> De: "Jeremy Dawson"
>> <Jeremy.Dawson AT anu.edu.au>
>> À: "coq-club"
>> <coq-club AT inria.fr>
>> Envoyé: Lundi 3 Décembre 2018 07:16:55
>> Objet: [Coq-Club] rewriting without instantiating
>
>> Hi coq-club,
>>
>> when I have a subterm like ?Φ1 ++ [] ++ ?Φ2 in a goal,
>> and I want to rewrite using app_nil_l (ie, [] ++ l = l)
>> how to I tell coq to rewrite without instantiating?
>>
>> When I just say rewrite app_nil_l it instantiates ?Φ1 to []
>> and then removes "[] ++ ", which is not what I want at all.
>
> Hi Jeremy,
>
> It is not clear to me want you want to obtain here...
> l++[]++m is the term l++([]++m) because contrary to + (nat),
> ++ (app) is right associative in Coq (to be compatible
> with cons which can only be associated to the right).
>
> It you want to be precise about which instance to rewrite,
> you can write something like
>
> rewrite app_nil_l at 1 3 ...
>
> but if there are several ways to unify the rewrite rule
> (ie several values of l in this case), the numbers above only
> match the instances that correspond to the first unification
> match Coq finds: unification comes before instance finding.
>
> You can partially specify a rewrite rule with something like
>
> rewrite app_nil_l with (l := _::_::nil)
>
> for instance which lets Coq find (hopefully) the instance you
> want but still avoids typing all the term, or the variables
> it contains (which is bad for stability if you do not control
> the names introduced by "intros").
>
> In the case of
>
> l++[]++m
>
> there is only one thing you can do with
> rewrite app_nil_l here. Btw, []++m reduces to
> m and thus "simpl" would also change the goal into l++m.
>
> Best,
>
> Dominique
>
- [Coq-Club] rewriting without instantiating, Jeremy Dawson, 12/03/2018
- Re: [Coq-Club] rewriting without instantiating, Dominique Larchey-Wendling, 12/03/2018
- Re: [Coq-Club] rewriting without instantiating, Jeremy Dawson, 12/03/2018
- Re: [Coq-Club] rewriting without instantiating, Robbert Krebbers, 12/03/2018
- Re: [Coq-Club] rewriting without instantiating, Emilio Jesús Gallego Arias, 12/03/2018
- Re: [Coq-Club] rewriting without instantiating, Jason Gross, 12/04/2018
- Re: [Coq-Club] rewriting without instantiating, Emilio Jesús Gallego Arias, 12/03/2018
- Re: [Coq-Club] rewriting without instantiating, Armaël Guéneau, 12/03/2018
- Re: [Coq-Club] rewriting without instantiating, Robbert Krebbers, 12/03/2018
- Re: [Coq-Club] rewriting without instantiating, Jeremy Dawson, 12/03/2018
- RE: [Coq-Club] rewriting without instantiating, Soegtrop, Michael, 12/03/2018
- Re: [Coq-Club] rewriting without instantiating, Dominique Larchey-Wendling, 12/03/2018
Archive powered by MHonArc 2.6.18.