Stream: Mirror: Isabelle Development Mailing List

Topic: [isabelle-dev] Word sessions and theories


view this post on Zulip Email Gateway (Oct 08 2020 at 13:22):

From: Florian Haftmann <florian.haftmann@informatik.tu-muenchen.de>
Hi all,

in the course of iterating through the accumulated theories on words, I
came to the conclusion that it is high time to write up a guide to the
existing material.

Currently, this resides in theory Guide in session Word_Lib; find a
document excerpt here:
http://isabelle.in.tum.de/~haftmann/bits_and_word/primer.pdf

I want to excite feedback:

Currently, the guide resides in theory Word_Lib. Nevertheless IMHO it
should cover the important library in session Native_Word also. But to
move it to Native_Word seems to be the wrong choice.

A possible solution would be a dedicated overview session in the AFP.
But this would be a precedence case.

Cheers,
Florian
signature.asc

view this post on Zulip Email Gateway (Oct 08 2020 at 23:39):

From: "Klein, Gerwin (Data61, Kensington NSW)" <Gerwin.Klein@data61.csiro.au>
Hi Florian,

Thanks for making a start with this, an overview for the Word libraries is long overdue.

I’m happy to add a bit of material and design rationale to the document for parts of Word_Lib that seem unclear. Is there a repo I should contribute to?

There are a few bits I disagree with, though, in particular the desire to replace operations like lsb, msb, etc with existing operations. That would be counter productive. If they can be made abbreviations on the word type, that is fine, and should probably be done, but the names are important. Programmers know what “lsb" ist, but will have to really think about this being equivalent to “odd”. If you’re writing theorem statements or specifications that other people need to be able to understand, familiarity is important.

Minor points: the tagging for word types with signedness (or not) is useful in program verification where you sometimes want to track what the compiler understands the type to be, so that you can later pick corresponding transformations based on that understanding. It doesn’t have any relevance to theorems you’d prove manually.

Misc_Typedef: not sure it deserves the attribute “invasive”. I haven’t checked how it has developed, but it used to be a simple constant definition. I remember Jeremy introducing it to get simpler isomorphism results or something along that line. If it is not necessary any more, it’d be perfectly fine to eliminate.

Reversed_Bit_Lists: they are rarely used for algebraic properties, but they are useful for more complex append and slicing operations as you sometimes find in hardware specs. In general, I wouldn’t make too many comments on use in the overview. Takes too long to explain and is very dependent on application.

As for location: I’d be fine with the overview living in Word_Lib. From there it can reference everything in Word_Lib and HOL-Word, and it can provide a few comments on + a pointer to the Native_Word entry, which could contain its own overview.

Cheers,
Gerwin
signature.asc

view this post on Zulip Email Gateway (Oct 09 2020 at 11:41):

From: Lawrence Paulson <lp15@cam.ac.uk>
I totally agree with this point.
Larry


isabelle-dev mailing list
isabelle-dev@in.tum.de
https://mailman46.in.tum.de/mailman/listinfo/isabelle-dev

view this post on Zulip Email Gateway (Oct 09 2020 at 11:47):

From: Florian Haftmann <florian.haftmann@informatik.tu-muenchen.de>
Hi Gerwin,

There are a few bits I disagree with, though, in particular the desire to replace operations like lsb, msb, etc with existing operations. That would be counter productive. If they can be made abbreviations on the word type, that is fine, and should probably be done, but the names are important. Programmers know what “lsb" ist, but will have to really think about this being equivalent to “odd”. If you’re writing theorem statements or specifications that other people need to be able to understand, familiarity is important.

I am happy to converge into that direction. The critical question
remains whether they should be full or only input abbreviations. In the
former cases, it would be better to have them restricted to word,
otherwise you would end up with ‹lsb (2 * k + 1)› for k :: int, which
will not do. If restricted to word, ‹msb› might even remain a dedicated
operation.

Minor points: the tagging for word types with signedness (or not) is useful in program verification where you sometimes want to track what the compiler understands the type to be, so that you can later pick corresponding transformations based on that understanding. It doesn’t have any relevance to theorems you’d prove manually.

Thanks, that makes the situation clear.

Misc_Typedef: not sure it deserves the attribute “invasive”. I haven’t checked how it has developed, but it used to be a simple constant definition. I remember Jeremy introducing it to get simpler isomorphism results or something along that line. If it is not necessary any more, it’d be perfectly fine to eliminate.

The morphisms in general can be exploited using the transfer method
nowadays. This should indeed be the core message about Misc_Typedef.

Reversed_Bit_Lists: they are rarely used for algebraic properties, but they are useful for more complex append and slicing operations as you sometimes find in hardware specs. In general, I wouldn’t make too many comments on use in the overview. Takes too long to explain and is very dependent on application.

Yes, but the reverse order makes it painful to prove anything about it,
The definitions of append and slicing operations on word use the direct
formulation without any reversal already.

As for location: I’d be fine with the overview living in Word_Lib. From there it can reference everything in Word_Lib and HOL-Word, and it can provide a few comments on + a pointer to the Native_Word entry, which could contain its own overview.

OK.

Cheers,
Florian

signature.asc

view this post on Zulip Email Gateway (Oct 17 2020 at 17:36):

From: Florian Haftmann <florian.haftmann@informatik.tu-muenchen.de>
Hi all,

I’m happy to add a bit of material and design rationale to the document for parts of Word_Lib that seem unclear. Is there a repo I should contribute to?

I forgot to answer: Guide.thy resides just in the regular AFP
development repository, session Word_Lib.

There are a few bits I disagree with, though, in particular the desire to replace operations like lsb, msb, etc with existing operations. That would be counter productive. If they can be made abbreviations on the word type, that is fine, and should probably be done, but the names are important. Programmers know what “lsb" ist, but will have to really think about this being equivalent to “odd”. If you’re writing theorem statements or specifications that other people need to be able to understand, familiarity is important.

Minor points: the tagging for word types with signedness (or not) is useful in program verification where you sometimes want to track what the compiler understands the type to be, so that you can later pick corresponding transformations based on that understanding. It doesn’t have any relevance to theorems you’d prove manually.

Misc_Typedef: not sure it deserves the attribute “invasive”. I haven’t checked how it has developed, but it used to be a simple constant definition. I remember Jeremy introducing it to get simpler isomorphism results or something along that line. If it is not necessary any more, it’d be perfectly fine to eliminate.

Reversed_Bit_Lists: they are rarely used for algebraic properties, but they are useful for more complex append and slicing operations as you sometimes find in hardware specs. In general, I wouldn’t make too many comments on use in the overview. Takes too long to explain and is very dependent on application.

I updated the guide with recent feedback.

What seems worth further discussion is the lsb / msb issue. Since there
are strong arguments / desires to keep them in the long run, currently
my proposal would be:

Cheers,
Florian
signature.asc

view this post on Zulip Email Gateway (Oct 18 2020 at 22:44):

From: "Klein, Gerwin (Data61, Kensington NSW)" <Gerwin.Klein@data61.csiro.au>

On 18 Oct 2020, at 03:35, Florian Haftmann <florian.haftmann@informatik.tu-muenchen.de> wrote:

I’m happy to add a bit of material and design rationale to the document for parts of Word_Lib that seem unclear. Is there a repo I should contribute to?

I forgot to answer: Guide.thy resides just in the regular AFP
development repository, session Word_Lib.

Thanks, I should have another look at it this week. (Sorry for the slowness, my employer has found it opportune to majorly distract me from proof work these past months)

There are a few bits I disagree with, though, in particular the desire to replace operations like lsb, msb, etc with existing operations. That would be counter productive. If they can be made abbreviations on the word type, that is fine, and should probably be done, but the names are important. Programmers know what “lsb" ist, but will have to really think about this being equivalent to “odd”. If you’re writing theorem statements or specifications that other people need to be able to understand, familiarity is important.

Minor points: the tagging for word types with signedness (or not) is useful in program verification where you sometimes want to track what the compiler understands the type to be, so that you can later pick corresponding transformations based on that understanding. It doesn’t have any relevance to theorems you’d prove manually.

Misc_Typedef: not sure it deserves the attribute “invasive”. I haven’t checked how it has developed, but it used to be a simple constant definition. I remember Jeremy introducing it to get simpler isomorphism results or something along that line. If it is not necessary any more, it’d be perfectly fine to eliminate.

Reversed_Bit_Lists: they are rarely used for algebraic properties, but they are useful for more complex append and slicing operations as you sometimes find in hardware specs. In general, I wouldn’t make too many comments on use in the overview. Takes too long to explain and is very dependent on application.

I updated the guide with recent feedback.

Cool, thanks.

What seems worth further discussion is the lsb / msb issue. Since there
are strong arguments / desires to keep them in the long run, currently
my proposal would be:

I’d be happy with that, yes.

Cheers,
Gerwin
signature.asc


Last updated: Apr 23 2024 at 20:15 UTC