Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] option to print only certain implicits

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] option to print only certain implicits


Chronological Thread 
  • From: Ralf Jung <jung AT mpi-sws.org>
  • To: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] option to print only certain implicits
  • Date: Fri, 24 Jun 2016 19:08:11 +0200
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=jung AT mpi-sws.org; spf=Pass smtp.mailfrom=jung AT mpi-sws.org; spf=None smtp.helo=postmaster AT hera.mpi-klsb.mpg.de
  • Ironport-phdr: 9a23:L8hwJRGtr6nCCsG1/jEPrZ1GYnF86YWxBRYc798ds5kLTJ75pcmwAkXT6L1XgUPTWs2DsrQf2rKQ6/CrADRYqb+681k6OKRWUBEEjchE1ycBO+WiTXPBEfjxciYhF95DXlI2t1uyMExSBdqsLwaK+i760zceF13FOBZvIaytQ8iJ3pzxj7D5osWLKyxzxxOFKYtoKxu3qQiD/uI3uqBFbpgL9x3Sv3FTcP5Xz247bXianhL7+9vitMU7q3cY6Lod8JtLVry/dKAlR5RZCi4nOiY7/p7Frx7GGDGG4nVUcHgQnVIcARXD4zn/Rpa0qTTh8O1n13/JboXNUbkoVGH6vO9QQxjyhXJfOg==

Hi,

> Is there anything like an Arguments command that will allow only
> specifically chosen implicits to print? I know I can do Arguments :
> clear implicits, but I don't want parsing impacted, and only temporarily
> want printing impacted. Set Printing Implicit is a blunt instrument.
> The Defensive modifier is also too blunt. I'm hoping maybe there is an
> undocumented Argument command that already does this...
>
> The use case is: a particular function where the implicits work very
> well parsing-wise, but often become confusing during proving, as when
> one sees a conclusion like "foo x = foo x", but reflexivity fails due to
> differences in the implicits (even f_equal fails to progress). And
> there are many other implicits in other functions around working very
> nicely to make the goals easy to read, so using Set Printing Implicit,
> Defenisve or not, is not a good idea. In such a case, it would be nice
> to do something like "Arguments foo : {no}print implicits" to turn them
> on and off, so that foo would always print as @foo.

One thing you could do is not have that argument implicit, and then
define a parsing only notation that adds the underscore to trigger
inference. Like

Definition foo (n : nat) := n.
Notation foo' := (foo _) (only parsing).

This means you have to use foo' when writing but will see foo in the
proof state; but other than that, I think the implicits should behave
the way you want.

Kind regards,
Ralf



Archive powered by MHonArc 2.6.18.

Top of Page