Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Simplification for typeclass instances

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Simplification for typeclass instances


Chronological Thread 
  • From: Daniel Schepler <dschepler AT gmail.com>
  • To: Coq Club <coq-club AT inria.fr>
  • Subject: Re: [Coq-Club] Simplification for typeclass instances
  • Date: Fri, 9 Sep 2016 12:08:37 -0700
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=dschepler AT gmail.com; spf=Pass smtp.mailfrom=dschepler AT gmail.com; spf=None smtp.helo=postmaster AT mail-vk0-f43.google.com
  • Ironport-phdr: 9a23:eUbC1x0w77sOd6NfsmDT+DRfVm0co7zxezQtwd8ZsegfK/ad9pjvdHbS+e9qxAeQG96KsrQa16GP6fGoGTRZp83Q6DZaKN0EfiRGoP1epxYnDs+BBB+zB9/RRAt+Iv5/UkR49WqwK0lfFZW2TVTTpnqv8WxaQU2nZkJLL+j4UrTfk96wn7jrvcaCOkMW2HHkO+I6bE3v616A7o9O2coqA51y4yOBmmFPdeVSyDEgDnOotDG42P2N+oV++T9bofMr+p0Ie6z7e6MlUe4QV2x+YCgdrffmvhjbTAaJ+mBUEiBPykIJUED560TRWY65mS/nvKIp0y6DeMbyULocWDK47q4tRgW+2wkdMDts3GjRi8F0xJlQoB+5oxFli9rYe4qVOeJ6c7n1ctYTRG4HVcFUAX8SSrigZpcCWrJSdd1TqJPw8h5X9UOz

On Fri, Sep 9, 2016 at 10:47 AM, Gaetan Gilbert
<gaetan.gilbert AT ens-lyon.fr>
wrote:
> If you do
>
> Arguments plus {A Plus} !_ !_ /.
>
> then simpl on
>
> 0 + (a, b) == (a, b)
>
> reduces to
>
> prod_equiv A B (0 + a, 0 + b) (a, b)
>
> without reducing 0 + x == x for x : A * B
>
> I don't know that it would do the right thing (whatever that means) in other
> situations though.

I don't know if it would always be "the right thing", but as a first
cut I'd be happy with something like (ltac pseudocode):

Ltac class_simpl :=
repeat match goal with
|- context [?f ?x] =>
is_class_proj f; is_nonatom_instance x;
change (f T1 ... Tn x) with (eval red in x) at context
end.

For now, I haven't found an "Arguments" command that would make this work:
set (x := 0 : A*B). (* x = @zero (A*B) (@prod_zero A B H H3) *)
simpl in x. (* want x := (0, 0) : A * B, or without notation
x := @pair A B (@zero A H) (@zero B H3) *)

(So in the pseudocode above, is_class_proj would match f = @zero
(A*B); but I don't want is_nonatom_instance to match subsequently with
f = @zero A, x = H.)
--
Daniel



Archive powered by MHonArc 2.6.18.

Top of Page