Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Line numbers in list printing?

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Line numbers in list printing?


Chronological Thread 
  • From: Ralf Jung <jung AT mpi-sws.org>
  • To: coq-club AT inria.fr, Samuel Gruetter <gruetter AT mit.edu>
  • Subject: Re: [Coq-Club] Line numbers in list printing?
  • Date: Fri, 21 Jun 2019 19:20:02 +0200
  • Authentication-results: mail3-smtp-sop.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 juno.mpi-klsb.mpg.de
  • Ironport-phdr: 9a23:kZS/gRDKwPc2WhgGCb+qUyQJP3N1i/DPJgcQr6AfoPdwSPT8pMbcNUDSrc9gkEXOFd2Cra4d0ayO7eu5ADdIoc7Y9ixbKdoUD15NoP5VtjRoONSCB0z/IayiRA0BN+MGamVY+WqmO1NeAsf0ag6aiHSz6TkPBke3blItdaz6FYHIksu4yf259YHNbAVUnjq9Zq55IAmroQnLucQanJVuJrwtxhbIrXdEZvlayG11Ll6Xgxrw+9288ZF+/yhNof4t69JMXaDndKkkULJUCygrPXoo78PxrxnDSgWP5noYUmoIlxdDHhbI4hLnUJrvqyX2ruVy1jWUMs3wVrA0RC+t77x3Rx/yiScILCA2/WfKgcFtlq1boRahpxtiw47IZYyeKfRzcr/Bcd4cWGFMRdhaWTBfDYygbosPF+sBMvher4nhvFsFsB+yCRCxCO/z1jNEg3n71rA43es8CwHLxBEuEcwAsHrUr9v7OqkdXu+3w6bUwjvOdO9W1DTn5YTUbhwsr/OBULRtesTR00kvEAbFg02Mp4P/OzOV2PkGvWyG7+pmWuKklmkqqwNsojipycchkYzJhpoUylzd7iV4zp01Kce/SE5hbt6pCZ1dvDyUOYtxR8MtWWBouCAix70DoZ67fTEGyI8pxh7EcfCHdJKI4h37WOaeIDd4mHJleK+kiBqo7Uegzej8W8+p21hJtipIisTAu34J2hDJ98SKTuFx80Sg1DqV2A3f9vlILEI2mKbBNpIt3KQ8mocQvEnMBCP6hkv7gayQe0454Oan8f7nba/jppKEN497lAX+MqM2l8y9HOQ4NA8OU3Ke+eSk1b3v5E75QLFRjvItiKXZtYjaJcsBqqGkHQBZyocj6xChADe6yNkUgHcKIVZfdB6ai4XlIVLDLfHiAfqwn1igiDJryOrHPr3lDJXNNH/DkLL5cLZ/9k5czgUzwMta55JMC7ENOenzW0HqtNDCCR85KQO0z/79CNphzoMeRX6PAqiBPazOtl+I//sjLPWIZI8IoznwMOMl5v7rjX8hg1ARZ6ip3Z0NaHC5BPtqOUuZYWC/yusGRGwNp081SPHgoFyESz9aIXioG+oH7zQmBYbuIp3eS5yxjabJiCihA5BKem1cIlWNDTHle5jSCNkWbyfHGMZlnHQmSL6uA9sjyBehnAriyv98MfGS/TcX48GwnONp7vHewElhvQd/CN6QhiTUFzktwzE4AgQu1aU6mnRTj1eO1a8i2a5aCNpUofZRU0I5MYXWieliBJb+V1CZJ4vbeBOdWtyjRAoJYJcp2dZXOBR4A9TnlQ/YmS2wDO1Nzu3ZNNkP6qvZmkPJCYN4wnfC2rMmigB9EM5XNCi9mbU58BLcVdfE

Hi,

On 21.06.19 18:52, Samuel Gruetter wrote:
> I'd like to have the same in bedrock2! I didn't try anything zip-with-index
> related yet, but we have a notation for separation logic equivalences, which
> prints (P1 * P2 * ... Pn <==> Q1 * Q2 * ... * Qn) as
>
> [P1; P2; ... Pn]
> === seps iff ===
> [Q1; Q2; ... Qn]
>
> https://github.com/mit-plv/bedrock2/blob/ce3f6ee55351d89e0c5091a4e5af98b3ae778dae/bedrock2/src/Map/SeparationLogic.v#L218
>
> which is probably similar to what you already have.
>
> Another ingredient you'd need would be to print each element of a list on a
> new
> line. I haven't managed to do this within a notation for lists, but instead
> I
> had to insert a newline for each possible element of the list, see here:
> https://github.com/mit-plv/riscv-coq/blob/ab9adb6ce5c104886a3a435d16b0cd78c7d1a64f/src/Utility/InstructionNotations.v

We are doing something like "one element of a list per line" in the Iris /
Separation Logic Proof Mode, you can find the Notation for that at
<https://gitlab.mpi-sws.org/iris/iris/blob/472aa3bcb129182fd6fc9aca241a38340c9ceafd/theories/proofmode/notation.v>.
Basically, you can add the newline to the notation for "cons".

We don't have line numbers, though.

Kind regards,
Ralf

>
> Please let us know if you make progress on this :)
>
>
> On Sat, 2019-06-15 at 15:28 -0400, Joshua Gancher wrote:
>> Hi all,
>>
>> I am mechanizing a program logic, and have an equivalence judgement
>> (written
>> as an Inductive) of the form Equiv xs xs', where xs and xs' are of the type
>> list Cmd. 
>>
>> My current way of displaying this goal looks something like [:: p1; p2; p3;
>> p4] <~~> [:: p5; p6; p7] (using ssreflect's notation for lists.) I would
>> like
>> to instead display something like:
>>
>> 0 : p1;
>> 1 : p2;
>> 2 : p3;
>> 4 : p4
>>
>> <~~>
>>
>> 0 : p5;
>> 1 : p6;
>> 2 : p7.
>>
>> Is there a simple programmatic way of doing this, akin to defining a
>> pprint_equiv : forall xs xs', Equiv xs xs' -> string? I think I could also
>> achieve this by zipping each list with an increasing sequence of nats, and
>> doing something special with this list of pairs, but this seems overkill if
>> there is a more natural solution.
>>
>> Thanks,
>>
>> Joshua
>>
>>

--
Website: https://people.mpi-sws.org/~jung/



Archive powered by MHonArc 2.6.18.

Top of Page