Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Types in patterns

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Types in patterns


Chronological Thread 
  • From: Jim Fehrle <jim.fehrle AT gmail.com>
  • To: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] Types in patterns
  • Date: Thu, 6 Aug 2020 19:03:49 -0700
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=jim.fehrle AT gmail.com; spf=Pass smtp.mailfrom=jim.fehrle AT gmail.com; spf=None smtp.helo=postmaster AT mail-il1-f193.google.com
  • Ironport-phdr: 9a23:qWEYlhedRbBAz+eN5QdSaSDOlGMj4u6mDksu8pMizoh2WeGdxcS4YB7h7PlgxGXEQZ/co6odzbaP7eawACddut6oizMrSNR0TRgLiMEbzUQLIfWuLgnFFsPsdDEwB89YVVVorDmROElRH9viNRWJ+iXhpTEdFQ/iOgVrO+/7BpDdj9it1+C15pbffxhEiCCybL9vLRi6twbcutQZjYZiJKs61wfErGZPd+lK321jOEidnwz75se+/Z5j9zpftvc8/MNeUqv0Yro1Q6VAADspL2466svrtQLeTQSU/XsTTn8WkhtTDAfb6hzxQ4r8vTH7tup53ymaINH2QLUpUjms86tnVBnlgzoBOjUk8m/Yl9ZwgbpUrxKvpRNxw4DaboKIOvRgYqzQZskVSXZbU8tLSyBNHoGxYo0SBOQBJ+ZYqIz9qkMKoxu/AAmnGePhxSFIhn/s2a01zfkqHAbE3AwhGtICqnrUo8v1NKcIVeC60rLFzTrGb/xM2Df97JLEfQwmofGJRL99d9faxkYzGQ3flFqQtZDlMC2P1uQLq2WW7fRtWOKuhmMopQ98oSWjy8Mvh4fJmo8Z1k3J+Dl2zYsxKtO1Vk92bNyqHpZMuCyXNIh7TM0iTmxmtis216MKtJimdyYEz5QnwgTQa/2Bc4WQ4xLjUvyRITZii35/drK/nRC/+lWjxO3kTsS4zkpGoy5fntTPtn0BzQHf58mGR/dn40us3TiC2gbO4e9eO080j7DUK5s5z74wiJUTtUPDEzfzmErsja+Wclwo+ums6+j6e7nmqIKQOot6hw3kPaQuncu/Aes8MgcQRWSU5eO81Lj78U34RrVFkOE2n7HHvJzGIckXvK20Dg9P3oo+6huyDi2q3MkckHQJNF5FfQiIj4ntO1HAOvD4CvK/jkyukDdqwvDKJLPhDYvNLnjZlLfuY61w60FZyAUpzNBf44hYBa0GIPL2QkPxrsDXDgclMwyoxObqEMly1oQHWW6WHqCZNL7SvkST6+I0I+iMYZcVtyznJ/gk4f7ul345lkUHcamnx5tEIEy/S/9hOgCSZWfmqtYHC2YD+AQkH8Lwj1jXcz9WL1i/X7g463lvCoOjS4nORpqpjZSO2S66GttdYWUQWQPEKmvha4jRA6REUymVOMI0ymVZB4jkcJco0FSVjCG/y7djKbCKqCgRtJam1dwsouOKxEp0+jtzAMCQlWqKSjMsxzJad3oNxKl65HdF5BKG2Kl8jeZfEIUKtfxMWwY+c5Xbyr4jUoygakf6Zt6MDW2ebJC+GzhoF4A+xtYPZwB2HNDw1h0=

>  I believe the documentation is incorrect and should not include that syntax.

No, the grammar is correct.  It's not a syntax error at all (Ex: "Syntax error: illegal begin of vernac."), it's a semantic restriction, which should be documented.

Note that "pattern" is not just used in match, it's also used in let-in definitions: https://coq.inria.fr/refman/language/core/definitions.html#let-in-definitions.

The source code says this about the message:
(* We raise an error if the pattern contains a cast, due to
current restrictions on casts in patterns. Cast in patterns
are supported only in local binders and only at top level.
The only reason they are in the [cases_pattern_expr] type
is that the parser needs to factor the "c : t" notation
with user defined notations. In the long term, we will try to
support such casts everywhere, and perhaps use them to print
the domains of lambdas in the encoding of match in constr.
This check is here and not in the parser because it would require
   duplicating the levels of the [pattern] rule. *)

Jim




Archive powered by MHonArc 2.6.19+.

Top of Page