Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Unification Bug?

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Unification Bug?


Chronological Thread 
  • From: Eddy Westbrook <westbrook AT galois.com>
  • To: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] Unification Bug?
  • Date: Fri, 2 Dec 2016 12:50:53 -0800
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=westbrook AT galois.com; spf=Pass smtp.mailfrom=westbrook AT galois.com; spf=None smtp.helo=postmaster AT mail-pf0-f177.google.com
  • Ironport-phdr: 9a23:qcTA+h05axtAb0ILsmDT+DRfVm0co7zxezQtwd8Zse0SLPad9pjvdHbS+e9qxAeQG96KsLQY0KGI4+jJYi8p2d65qncMcZhBBVcuqP49uEgeOvODElDxN/XwbiY3T4xoXV5h+GynYwAOQJ6tL1LdrWev4jEMBx7xKRR6JvjvGo7Vks+7y/2+94fdbghMijexe7x/IRu5oQjQtcQdnJdvJLs2xhbVuHVDZv5YxXlvJVKdnhb84tm/8Zt++ClOuPwv6tBNX7zic6s3UbJXAjImM3so5MLwrhnMURGP5noHXWoIlBdDHhXI4wv7Xpf1tSv6q/Z91SyHNsD4Ubw4RTKv5LptRRT1iikIKiQ5/XnLhcN/kaxVoBCuqRJwzYDXboGbKv1wc7jBfdMDQGpNQsZRWzBDD466coABD/ABPeFdr4TlqFUBsAaxBAmxD+zv1DBInWP20rYg0+QmFgHG3xErEtUAsXvKt9X1KLwdUfqyzKnPzjXOdPxW1i356IjPcxAhuuuAUq53ccrU0EQiER7OgFaIqYH9IT+ZyuAAv3KY4udgT+6jlmoqpx9rrjSyxMohiJHFi4IJxlze6Cl0zoI4Kce2RUN1e9KoDYZcui+cOoBrWM0tWXtotzw/yrAeuZ60YiwKyJM/yh7acfOHcoyI7gv7VOafPTt0nXxldK+9ihuw60Sgxer8Vs670FZOsCVJiMXDtncI1xDL68iHTOVy/lu51DqRywze7vtILEM0mKbBNpIsxqA8moAOvUnBHCL6gED2g7WXdkUg9Oio8ePnYrD+q56SKYB0kR3+Pb80msy4BuQ4MRMDX2eB9uS4073j/Fb5TK9Wgf0xl6nVqIraKtgDpq6lHw9V1Z4u5Aq4Dze/ydgXgX0HLE9edx+clIjoO1TOIOjiAvulglSsli1rx/HcMbH7DJXNNCuLrLC0drFkrkVY1QAbzNZF5psSBKtSDuj0XxrcuNDJRiA0KBC+2eHgC50pyY4FRWiVBaiaGKzbtViJ/aQkJOzaN9xdgyr0N/Vwv62mtnQ+g1JIJaQ=

Hi Jonathan,

Thanks for the reply, and for the suggested workaround. I’ll see if I can get
something like that to work.

The reason this looks like a bug to me, though, is that I think, if I’m not
mistaken, that what I am actually trying solve is the problem

?T2 x = ?B

(Technically, I think Coq writes the left-hand side as something like
?T2@{__:=x}, but it’s the same thing.) This problem has the solution ?T2 =
(fun _ => ?B). It falls into the higher-order pattern fragment, since ?T2 is
fully applied to distinct bound variables, and I thought Coq would solve this
fragment.

Also, either way, the fact that the unify tactic is not commutative also
seems like a bug...

-Eddy

> On Dec 2, 2016, at 12:22 PM, Jonathan Leivent
> <jonikelee AT gmail.com>
> wrote:
>
>
>
> On 12/02/2016 02:50 PM, Eddy Westbrook wrote:
>> Dear Coq club list,
>>
>> I feel like the following should work, but it doesn’t, and something like
>> it keeps coming up in some typeclass programming I am trying to do:
>>
>> Definition foo A B : (A -> B) = (A -> B) := eq_refl.
>>
>> Goal { T:Type | T=T }.
>> refine (exist _ (forall (x:?[T1]), ?[T2]) _).
>> apply foo.
>>
>>
>> Somehow, it seems like Coq does not want to apply foo because it works on
>> non-dependent function types, even though all it has to do is to unify
>> ?T2, which depends on x, with the B argument of foo, which does not.
>
> Wait - what? You want unification to remove the dependency of ?T2 on x?
> That's unifying a function of one var with a constant (function of 0 vars).
> They don't have the same type.
>
> However, you can explicitly remove the dependency yourself, like this:
>
> Definition foo A B : (A -> B) = (A -> B) := eq_refl.
>
> Goal { T:Type | T=T }.
> refine (exist _ (forall (x:?[T1]), ?[T2]) _).
> instantiate (T2:=ltac:(clear x)). (*remove dependency of ?T2 on x*)
> apply foo.
>
> Note that using the instantiate tactic this way is considered a bit of a
> hack...
>
> -- Jonathan
>
>




Archive powered by MHonArc 2.6.18.

Top of Page