Skip to Content.
Sympa Menu

coq-club - RE: [Coq-Club] Easy question re: implicit parameters

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

RE: [Coq-Club] Easy question re: implicit parameters


Chronological Thread 
  • From: "Soegtrop, Michael" <michael.soegtrop AT intel.com>
  • To: "coq-club AT inria.fr" <coq-club AT inria.fr>
  • Subject: RE: [Coq-Club] Easy question re: implicit parameters
  • Date: Fri, 15 Sep 2017 12:54:06 +0000
  • Accept-language: de-DE, en-US
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=michael.soegtrop AT intel.com; spf=Pass smtp.mailfrom=michael.soegtrop AT intel.com; spf=None smtp.helo=postmaster AT mga06.intel.com
  • Dlp-product: dlpe-windows
  • Dlp-reaction: no-action
  • Dlp-version: 11.0.0.116
  • Ironport-phdr: 9a23:BmCu0hT95Jw91BuDgabSmHNykdpsv+yvbD5Q0YIujvd0So/mwa67bRWN2/xhgRfzUJnB7Loc0qyN7PCmBDRIyK3CmU5BWaQEbwUCh8QSkl5oK+++Imq/EsTXaTcnFt9JTl5v8iLzG0FUHMHjew+a+SXqvnZBUin4YEB+If2wEYrPhey20fqz8tvdeU8A0DG6ePZ5KAi8hQTXrMgfx4V4fPUf0BzM9zFzfOlZ2XlvPRbbuhf35s69+NQrpyFRsPIo+soGSqL3cLgiSqRwDTI6PmRz78ru40qQBTCT72cRBz1F2iFDBBLIuUn3

Dear Pierre,

 

I thought about using the curly brace notation for implicit arguments in the standard library:

 

Inductive sig2 {A:Type} (P:A -> Prop) : Type :=

    exist2 : forall x:A, P x -> sig2 P.

 

I think this is the most readable option for beginners and advanced users. But it leads to a slightly different definition (see below), first regarding the “maximally inserted” property – not sure why this is different for “explicitly implicit” arguments and “Implicitly implicit” arguments. There don’t seem to be any “Set/Unset Maximal Implicit Insertion” directives in the code.

 

More interestingly the second argument of sig2 has a different scope (type_scope for sig vs function_scope for sig2). No idea why this is so.

 

Such context dependent differences make it sometimes difficult to understand definitions in the standard library.

 

Best regards,

 

Michael

 

Inductive sig (A : Type) (P : A -> Prop) : Type :=

    exist : forall x : A, P x -> {x : A | P x}.

 

For sig: Argument A is implicit

For exist: Argument A is implicit

For sig: Argument scopes are [type_scope type_scope]

For exist: Argument scopes are [type_scope function_scope _ _]

 

Inductive sig2 (A : Type) (P : A -> Prop) : Type :=

    exist2 : forall x : A, P x -> sig2 P

 

For sig2: Argument A is implicit and maximally inserted

For exist2: Argument A is implicit and maximally inserted

For sig2: Argument scopes are [type_scope function_scope]

For exist2: Argument scopes are [type_scope function_scope _ _]

 

Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Christian Lamprechter
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928




Archive powered by MHonArc 2.6.18.

Top of Page