Last call for comments on SRFI 228: Composing Comparators Arthur A. Gleckler (15 Nov 2022 21:03 UTC)
Re: Last call for comments on SRFI 228: Composing Comparators Marc Nieper-Wißkirchen (16 Nov 2022 12:17 UTC)
Re: Last call for comments on SRFI 228: Composing Comparators Marc Nieper-Wißkirchen (16 Nov 2022 12:34 UTC)
Re: Last call for comments on SRFI 228: Composing Comparators Daphne Preston-Kendal (16 Nov 2022 12:53 UTC)
Re: Last call for comments on SRFI 228: Composing Comparators Marc Nieper-Wißkirchen (16 Nov 2022 13:18 UTC)
Re: Last call for comments on SRFI 228: Composing Comparators Marc Nieper-Wißkirchen (16 Nov 2022 18:44 UTC)
Re: Last call for comments on SRFI 228: Composing Comparators Marc Nieper-Wißkirchen (16 Nov 2022 19:18 UTC)
Re: Last call for comments on SRFI 228: Composing Comparators Marc Nieper-Wißkirchen (16 Nov 2022 17:34 UTC)
Re: Last call for comments on SRFI 228: Composing Comparators Daphne Preston-Kendal (18 Nov 2022 19:06 UTC)
Re: Last call for comments on SRFI 228: Composing Comparators Daphne Preston-Kendal (23 Nov 2022 10:10 UTC)
Re: Last call for comments on SRFI 228: Composing Comparators Daphne Preston-Kendal (26 Nov 2022 10:54 UTC)
Re: Last call for comments on SRFI 228: Composing Comparators Marc Nieper-Wißkirchen (26 Nov 2022 11:22 UTC)
Re: Last call for comments on SRFI 228: Composing Comparators Arthur A. Gleckler (23 Nov 2022 19:43 UTC)

Re: Last call for comments on SRFI 228: Composing Comparators Marc Nieper-Wißkirchen 26 Nov 2022 11:22 UTC

Am Sa., 26. Nov. 2022 um 11:54 Uhr schrieb Daphne Preston-Kendal
<xxxxxx@nonceword.org>:
>
> On 23 Nov 2022, at 15:40, Jakob Wuhrer <xxxxxx@gmail.com> wrote:
>
> > Hi,
> >
> > Daphne Preston-Kendal <xxxxxx@nonceword.org> writes:
> >> On 19 Nov 2022, at 01:35, Shiro Kawai <xxxxxx@gmail.com> wrote:
> >>> That part is resolved by the replies to my post.  Sensible base cases can be defined, and it makes sense to have them taking zero arguments.
> >>
> >> Can you formally define them and show that they are a correct base
> >> case, in the sense of being of null effect if appended to the end of
> >> another arguments list?  I can observe how the sample implementation
> >> behaves (emergently) when given no comparator arguments, but I’m still
> >> far from certain that they’re correct in a compositional sense.
> >
> > I have made an attempt at providing a formal definition for a ``zero''
> > comparator and a ``one'' comparator along with some rudimentary proofs
> > showing that they are neutral elements for ~make-sum-comparator~ and
> > ~make-product-comparator~, respectively.  I've attached both a pdf
> > document and org source code for said document, containing some
> > definitions and proofs.
>
> Wow, thanks so much for this detailed analysis!
>
> The only problem (and it’s a real nitpick) is the hash function of comparator-one. Since it is implementation-defined how a product comparator combines the hash values of each of the comparators it is given, there’s no guarantee that 0 will truly be of null effect.
>
> Possible resolutions:
> 1. ignore the problem – the hash value will still be stable even if it isn’t guaranteed to be exactly same as a comparator without comparator-one mixed in
> 2. actually define how hash values in a product comparator are combined
> 3. simply require that a hash value of 0 from one of the comparators is ignored and has no effect on the output value

1.