Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] [Type Classes]: avoid duplication of instances

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] [Type Classes]: avoid duplication of instances


chronological Thread 
  • From: Alexandre Pilkiewicz <alexandre.pilkiewicz AT polytechnique.org>
  • To: St�phane Lescuyer <stephane.lescuyer AT polytechnique.org>
  • Cc: Coq Club <coq-club AT inria.fr>
  • Subject: Re: [Coq-Club] [Type Classes]: avoid duplication of instances
  • Date: Fri, 1 Oct 2010 22:21:49 +0200
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; b=DjfgnyTBr7goV6SF6/IqUQJcl1QhHFMqvr7VXR07MRdEIPj9kyATDnd8L8qiXqhKyx GE9W5moTCZv3j26cDKmgdUSkFEa7PUxhfgW1Ieyonc4xYVn0Qc+8PuEYrEWxczRVAreA Vw5tCjNmAIXX6sRXETPP+HpWjqbYx99s5SyWk=

The "solution" I found is to define a new tactic :

<<<
Tactic Notation "dest" constr(X) "==" constr(Y) :=
  match goal with
    | H : context[ @eq_dec ?TYPE ?INST X Y] |- _ =>
      destruct (@eq_dec TYPE INST X Y)
    | |- context[ @eq_dec ?TYPE ?INST X Y] =>
      destruct (@eq_dec TYPE INST X Y)
    | |- _ => destruct (X == Y)

  end.
>>>

It still won't work if I have two occurrences of "x == y" with
different hidden parameters, but for now, it's not bad.


I might also try your solution of putting `{EqDec elt} only on
function that really need it.

Thanks!

Alexandre



Archive powered by MhonArc 2.6.16.

Top of Page