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: Gaetan Gilbert <gaetan.gilbert AT ens-lyon.fr>
  • To: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] Simplification for typeclass instances
  • Date: Fri, 9 Sep 2016 21:17:12 +0200
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=gaetan.gilbert AT ens-lyon.fr; spf=Pass smtp.mailfrom=gaetan.gilbert AT ens-lyon.fr; spf=None smtp.helo=postmaster AT labbe.ens-lyon.fr
  • Ironport-phdr: 9a23:KZ7HLRXXos7/X5X799ZRqzKb9q3V8LGtZVwlr6E/grcLSJyIuqrYZhKDt8tkgFKBZ4jH8fUM07OQ6PG5HzJcqs/b4ThCKMUKDE5dz51O3kQJO42sMQXDNvnkbig3ToxpdWRO2DWFC3VTA9v0fFbIo3e/vnY4ExT7MhdpdKyuQtaBx/q+2+36wZDPeQIA3GP7OuIrakvq5lyL54FW2dIkcfdpjEOR4zNhQKd//StQP1WdnhLxtI+b3aVI1GBugc8n7NNKSq7gfq41HvRyBTUiNH0ptoWw7UGQBVjH2nxJWWIP1xFMHgLt7RfgX563vDGpmPB63Xy1NMDqRLZ8djWm5apxVFe8hy4KKzc/tm7WjsZ9lr5zrRS64hhuxIiSbpvDZ6k2Rb/UYd5PHTkJZc1WTSEUWo4=

How about

Arguments prod_zero A B {_ _} /.
Arguments zero {_ !_} /.

?

Gaëtan Gilbert

On 09/09/2016 21:08, Daniel Schepler wrote:
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.)




Archive powered by MHonArc 2.6.18.

Top of Page