Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] implicit arguments

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] implicit arguments


Chronological Thread 
  • From: Jeremy Dawson <Jeremy.Dawson AT anu.edu.au>
  • To: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] implicit arguments
  • Date: Mon, 14 Dec 2020 00:11:07 +1100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=anu.edu.au; dmarc=pass action=none header.from=anu.edu.au; dkim=pass header.d=anu.edu.au; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=niInLU8P0/3thwcH6GXFg7wd/MN0yFt3yUK02xiEFLo=; b=hyVbCVD6o3qrjGnr5NEjcG+YzMVqRMuKX+JSPlRaf4sf3HO3ovvWnkmHyGw/V/11EJIX7qc4N/L3rdpVQnIO2gZpv+YxiLlx8N9JY1JJSdLl87sHhjPxy9tCIAHg4UlFwiMWM/6RI1vW7y7GL8T0Sh+iT4NXsMHrHTh+aA8PdngAB7OcV76uZSMZe4qRy6wBYEbniiVuHimyQo9c/wZaPtx36lsmGIw/sPxn9VuTnQ3BeP4jKQyDw+6A4MxLBxYF35CXc4jyc2JpBHyIUPHRDbvLRmeNu4se7zN7dFSLuvdNk8O5zCRRxPC3XhI31IXoUh8Q777Y6zYvyGmu1/3qbQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bTVq3KyLRnjzpd1XLVIR0dN9cLytxksnHL3vQe3uYbg/bQafXXrFLP4L7g5fWtCheVIXgGvHNBY2UT94TKrVaoQR382Kia2Y/PNpHWHpYVtdCL96GFwMmI8fjREYHWBXbnAg02YSW0rpWBvo0tYCvN+PVjd7v5g9HPy4GxXHk4G535lMFZ7LaOJu6ix9/3LXXIvt3dUNDTnbYKkfJ4TPVEoLiL0skmMxSbDbJRjUoX7hOgXX5HtMZA3INDja2QF0FOPK2kBDGQkFY9XZuhyt5zB37TH6f7fYq+WbVi84+Bu1KcJXz08NWe4Mxv2r2ut95ke/TeSnhnlsunTE/FAOJQ==
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=Jeremy.Dawson AT anu.edu.au; spf=Pass smtp.mailfrom=Jeremy.Dawson AT anu.edu.au; spf=Pass smtp.helo=postmaster AT AUS01-ME3-obe.outbound.protection.outlook.com
  • Ironport-phdr: 9a23:qSMiohwKJMQoaqPXCy+O+j09IxM/srCxBDY+r6Qd2ukUIJqq85mqBkHD//Il1AaPAdyErasU1aGK6OjJYi8p2d65qncMcZhBBVcuqP49uEgeOvODElDxN/XwbiY3T4xoXV5h+GynYwAOQJ6tL1LdrWev4jEMBx7xKRR6JvjvGo7Vks+7y/2+94fcbglVhjexe65+IRa3oAneucQbj5ZpJ7osxBfOvnZGYfldy3lyJVKUkRb858Ow84Bm/i9Npf8v9NNOXLvjcaggQrNWEDopM2Yu5M32rhbDVheA5mEdUmoNjBVFBRXO4QzgUZfwtiv6sfd92DWfMMbrQ704RSiu4qF2QxLulSwJNSM28HvPh8JtkqxbrhKvqR9xzYHaYo6aKPVwfqLSct4BWWpMXdxcWzBdDo6ybYYCCfcKM+ZCr4n6olsDtR+wChe2BOzxzz9JhmL906Mg3OUvCgHG2wogFM8JvXrQstr1LrkdUeW1zaXSwzvMdf1X2Sz66IjOaR0uu/eMXa9qfcXP1EYvChnJgU+NqYH8OT6ey+sCvXSB4eV6SeKvl3Aoqxt3ojW3ycohipTEi58ax13K6Ch13Yg4KNO2RUJmYNOpDpVduj2EO4ZoQs0uX31ktDg6xLAHpJO3YjQGxps5yhPbd/GLbY6F6Q/tWuaWJDd3nnNleLSnihaz90ig0Oz8WdOu3FZEtCpIlMTHuHMV1xHL5cWLVuFx8lq91TuNzQzf9/1ILEMumabGJZMszKY8m5UXvEjZAyP7m1n6gLWUe0gm4OSk9vrrb7bgq5SBLYF7kBv+Pb4rmsGnAeQ3LAwOX2+D9Omg2rLt4FH1TKhTgvMxnafUvonWJcMAqaGnGQNV1Zsj6wqkADehzdQYm2QIIEhdeBKdiIjpJ0/BL+zkDfe+hFSsli1nx/fbPr39BpXNKX/DkLT7cblh7E5czRI/zdFZ551KFrEMOP3+VlPruNDFEhM0MRa4z/v7BNh+zI8SRGyCD6GBPKPXq1CI5+YvI+eWZI8SvTbwM/wr6OD0jXAnnF8cfbOl05UNZ3G2BfRmJEOZbGH2jdcHDGcGpBQxQ/H3iFGYSzFTem6+X7gg6TEjFIKmEYDDS5ixj7yGxSe3B4FZZmRbCl+XCnrobIWFW/IUaC2IOMNhkzoEVaKgS4A7zx2uuhX6mPJbKb/f/TRdvpb+3vB04ffSnFc8729aFcOYhkOAVWxxjyskTiAt26Y39W5w0FqGwO5UiuNDEtp77vVUFAo2KNjV0ropWJjJRgvdc4LRGx6dSdK8DGRpF45j85o1e094Xu6aoFXbxSPzWe0ckaHNCZAptKvBjSCodpRNjk3e3axktGEIB85GNGmonKl6rlKBDojU1UiViuCjaPZFhXOfxCK41WOL+XpgfktwXKHCAS9NT3bt9Y28w26ZCrikBPIgLxdLztOEJu1ScNr1gF5aRfDlftPDf2a2nGT2DhGNlOqB

Hi Fabian,

Info on which implicit arguments are inferred and inserted.

For example, in my example below, what rule determines the type of no_rpt_same seq_ord (prems:=prems)

In general, f x (y := z) is equivalent to
what (eg @f _ _ x _ _ z _ _ ....)?

I do see that the question is answered in part, in the middle of the document you point to, which is mostly about which arguments are implicit, so it is easy to miss if you are looking for info about when implicit arguments are inserted. But that part of the question is what I refer to below where I say "Check no_rpt_same seq_ord.
>>> no_rpt_same seq_ord
>>> : forall (rules : list (srseq (PropF ?V)) -> srseq (PropF ?V)
>>> -> Type)
>>> (prems0 : srseq (PropF ?V) -> Type) (c0 : srseq (PropF ?V)),
>>> derrec rules prems0 c0 -> Type
>>> which is as I expected (as a matter of fact, I can't find this
>>> documented either, but I've discovered from experience that implicit
>>> arguments (non-maximal) are inserted up to the last explicit argument)"

Do you know whether that information is in the document you point to (or anywhere else for that matter)?

Jeremy

On 13/12/20 7:39 pm, Fabian Kunze wrote:
Dear Jeremy,
What are you missing from
https://coq.inria.fr/distrib/current/refman/language/extensions/implicit-arguments.html
?
In the beginning the page explains all the different kinds of reasons
argument could be made implicit (or better, how some arguments could be
inferred in use), and then the optons/flags are listed which enable/disable
the detection/declaration of those kinds of implicit arguments when defining
new constants.

What more would you expect to be explained there?

Best,
Fabian

12 Dec 2020 12:42:51 Jeremy Dawson <Jeremy.Dawson AT anu.edu.au>:

Hi Jim,

Thanks.  I think the second reference was meant to be
https://coq.inria.fr/distrib/current/refman/language/core/definitions.html#grammar-token-term_let
but that is for a different use of :=

I've found a section on := used as in this case, it's at
https://coq.inria.fr/distrib/current/refman/language/extensions/implicit-arguments.html
under the heading Explicit applications
but it doesn't include info on when implicit argments are implicitly inserted

Whereabouts can I find information about what is happening here?

Thanks,

Jeremy

On 10/12/20 3:32 pm, Jim Fehrle wrote:
Check this section of the manual:
https://coq.inria.fr/distrib/current/refman/language/extensions/arguments-command.html,
that may have what you seek.  Still lots of things in the manual need
improvement.
However, I'm not an expert on implicit arguments.
It's a bit hard to index :=, it's used in 77 places in the grammar.  A few
non-alphabetic items appear in the general index, but what's there is
probably woefully inadequate.  Here is one basic use:
http://localhost:63342/coq2/doc/sphinx/_build/html/language/core/definitions.html#grammar-token-term_let
Jim
On Wed, Dec 9, 2020 at 7:46 PM Jeremy Dawson <Jeremy.Dawson AT anu.edu.au
<mailto:Jeremy.Dawson AT anu.edu.au>> wrote:

Hi,
I have tried to find out when implicit arguments are inserted.  Is this
in the documentation anywhere?
With a function
lja_dd_ord < About no_rpt_same.
no_rpt_same :
forall U : Type,
relationT U ->
forall (rules : list U -> U -> Type) (prems : U -> Type) (c0 : U),
derrec rules prems c0 -> Type
Arguments U, rules, prems, c0 are implicit
I find
lja_dd_ord < Check no_rpt_same seq_ord.
no_rpt_same seq_ord
: forall (rules : list (srseq (PropF ?V)) -> srseq (PropF ?V)
-> Type)
(prems0 : srseq (PropF ?V) -> Type) (c0 : srseq (PropF ?V)),
derrec rules prems0 c0 -> Type
which is as I expected (as a matter of fact, I can't find this
documented either, but I've discovered from experience that implicit
arguments (non-maximal) are inserted up to the last explicit argument)
but
lja_dd_ord < Check no_rpt_same seq_ord (prems:=prems).
no_rpt_same seq_ord (prems:=prems)
: forall c0 : srseq (PropF V), derrec ?rules prems c0 -> Type
ie it seems to have inserted the implicit argument rules also.
What are the rules about this?
And if there are any tips for finding things like this in the
documentation, I'd appreciate it.  For example, the symbol := isn't in
the general index, which I would have expected.
Thanks
Jeremy




Archive powered by MHonArc 2.6.19+.

Top of Page