Skip to Content.
Sympa Menu

coq-club - RE: [Coq-Club] change uses inferior type inference

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

RE: [Coq-Club] change uses inferior type inference


Chronological Thread 
  • From: John M Grosen <jmgrosen AT mit.edu>
  • To: "coq-club AT inria.fr" <coq-club AT inria.fr>
  • Subject: RE: [Coq-Club] change uses inferior type inference
  • Date: Wed, 27 Feb 2019 23:34:59 +0000
  • Accept-language: en-US
  • Authentication-results: mail3-smtp-sop.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 outgoing-exchange-3.mit.edu
  • Ironport-phdr: 9a23:yCnv+h3ZJEjq01NEsmDT+DRfVm0co7zxezQtwd8Zse0eIvad9pjvdHbS+e9qxAeQG9mDu7Qc06L/iOPJYSQ4+5GPsXQPItRndiQuroEopTEmG9OPEkbhLfTnPGQQFcVGU0J5rTngaRAGUMnxaEfPrXKs8DUcBgvwNRZvJuTyB4Xek9m72/q99pHPYAhEniaxba9vJxiqsAvdsdUbj5F/Iagr0BvJpXVIe+VSxWx2IF+Yggjx6MSt8pN96ipco/0u+dJOXqX8ZKQ4UKdXDC86PGAv5c3krgfMQA2S7XYBSGoWkx5IAw/Y7BHmW5r6ryX3uvZh1CScIMb7S60/Vza/4KdxUBLmiDkJOSMl8G/ZicJwgqBUoBO9qBJwzIHZe52VNON6c6/BYd8WWXRNU8BMXCJBGIO8aI4PAvIFM+Zfr4n9oUYFoxyjDgetHuPvzSRIiWHw3aYn1OkhEwTG3AM6H9IJq3TbstP1ObwXUeC00KnE1yvMYO5L2Trk7oXDbx4vofaJXb1qcMrRz1EiGB/CjlWKr4zqITeV1uAXv2eF8uVgSOSigHMkpQFpujWj28QhhpPNi44P1FzJ9j91zJs7KNGgVUJ2YsSoHZ9Kuy2HLYd7QcwvT3l1tCs7zrAKo4C3cSgFxZg92hLTceGLfoaL7x/lSe2fOy13hGh/d7K6nxuy8Vavyun7VsSs11ZKszZFktbLtnAM0RzT5dGLReVy/0i92TaAzQbT6u5aLkwtm6fXMZshwr8slpYJr0vMAzL2lF33jK+QaEok5vCl5/nkb7n8opKQLZF4hwLkPqgzlMGzGeE4PRIPX2if9+S8zrrj/UjhTbVIi/02nbPZsJfBJcsFoK60GApV0oc/6xqlETipzckYkWEdLF1ZYBKHk5TpO1bWLf/kCve/mk2gnytvx/DbJbLsGY7NL3jGkLf5Z7lx8U9cyAwpzdBe/Z1YEL8BIOigEnP24ZbTCQZ8OAipyc7mDs9838UQQyjHVqSeKebZtUKCzuMpOeiFIoEP7mXTMf8gstzpjXlxvBcyZ66y0J1fPHK9Ee5hOEifSX/tnpEMHXpc7Vl2d/DjlFDXCW0bXH21Ra9pvmhqWrLjNp/KQ8WWuJLE2S66GpNMYWUXWFWNDTHle5jWAq5QOhLXGddol3k/bZbkU5UohEOrtRO8xrZ6fLKNp38o8Kn73d0w3NX90BE/8TsuXpaazn2CSGBykSYFVzQ21aZwrAkmjFKCze51j+EKTdE=

Try using Tactic Notation's uconstr for untyped terms:

Tactic Notation "changee" uconstr(a) "with" uconstr(b) :=
assert (a=b) as XX by reflexivity;
rewrite XX;
clear XX.

Goal inr true = inl 5.
changee (inr true:(nat+bool)) with (inr (negb false)). (* succeeds *)

--
John
________________________________________
From:
coq-club-request AT inria.fr

[coq-club-request AT inria.fr]
on behalf of Abhishek Anand
[abhishek.anand.iitg AT gmail.com]
Sent: Wednesday, February 27, 2019 3:26 PM
To: coq-club
Subject: Re: [Coq-Club] change uses inferior type inference

Here is a minimal example to illustrate the problem:

assert (inl 2 = inr true). (* succeeds *)

change (inr true:(nat+bool)) with (inr true). (* Cannot infer the
implicit parameter A of inr ...*)


-- Abhishek
http://www.cs.cornell.edu/~aa755/


On Wed, Feb 27, 2019 at 3:18 PM Abhishek Anand
<abhishek.anand.iitg AT gmail.com>
wrote:
>
> Many times, the following tactic succeeds:
>
> assert (a=b) by reflexivity.
>
> but the following fails with some type inference error suggesting that
> while inferring types, Coq is not exploiting the fact that `a` and `b`
> must have the same types:
>
> change a with b
>
> Can the `change` tactic be made as smart as `assert (_=_)`?
>
> I thought the following Ltac would work, but it suffers from the same
> problem as `change`.
> Ltac changee a b :=
> assert (a=b) as XX by reflexivity;
> rewrite XX;
> clear XX.
>
> I guess terms are fully typed before being passed to Ltac.
>
> Thanks,
> -- Abhishek
> http://www.cs.cornell.edu/~aa755/



Archive powered by MHonArc 2.6.18.

Top of Page