Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

...Unix, MS-DOS, and Windows NT (also known as the Good, the Bad, and the Ugly). -- Matt Welsh


devel / comp.lang.prolog / Re: Request for comments, Novacore the sequel to ISO modules

SubjectAuthor
* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
+* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|`* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
| `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|  `- Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
+* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|`- Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
+- Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
+* Request for comments, Novacore the sequel to ISO modulesMild Shock
|`* Request for comments, Novacore the sequel to ISO modulesMild Shock
| `* Request for comments, Novacore the sequel to ISO modulesMild Shock
|  `* Request for comments, Novacore the sequel to ISO modulesMild Shock
|   `- Request for comments, Novacore the sequel to ISO modulesMild Shock
+* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|`* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
| `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|  `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|   `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|    `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|     `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|      `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|       `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|        `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|         `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|          `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|           `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|            `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|             `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|              `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|               +- Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|               +- Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|               +- Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|               +- Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|               +- Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|               +- Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|               +- Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|               +- Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|               +- Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|               +- Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|               `- Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
+* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|`* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
| +- Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
| `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|  `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|   `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|    `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|     `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|      `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|       `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|        `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|         `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|          `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|           `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|            `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|             `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|              `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|               `- Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
+* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|`* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
| `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|  `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|   `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|    +- Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|    `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|     `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|      `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|       `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|        `* Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
|         `- Request for comments, Novacore the sequel to ISO modulesMostowski Collapse
`- Request for comments, Novacore the sequel to ISO modulesMild Shock

Pages:123
Re: Request for comments, Novacore the sequel to ISO modules

<280a2595-de7f-4f2e-91d8-ad592c975dbbn@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=2688&group=comp.lang.prolog#2688

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a37:4646:0:b0:6e4:ed82:a3ac with SMTP id t67-20020a374646000000b006e4ed82a3acmr21352609qka.57.1665596817985;
Wed, 12 Oct 2022 10:46:57 -0700 (PDT)
X-Received: by 2002:a05:6830:b8d:b0:65f:22fb:be09 with SMTP id
a13-20020a0568300b8d00b0065f22fbbe09mr13138788otv.38.1665596817721; Wed, 12
Oct 2022 10:46:57 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Wed, 12 Oct 2022 10:46:57 -0700 (PDT)
In-Reply-To: <46c2e79d-6e27-4e84-9f99-d0d097583b5an@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=80.218.40.218; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 80.218.40.218
References: <db8a6771-3e54-485b-b391-310658dd6f52n@googlegroups.com>
<e8c4866e-0d21-4722-8666-f388ed9c5c46n@googlegroups.com> <0b92ca64-dbd2-4950-9745-376705c45031n@googlegroups.com>
<186e6dd6-b34f-44b5-bc41-df084bcf67f3n@googlegroups.com> <db69596d-ee5a-4e27-a774-2d0f1c299378n@googlegroups.com>
<294c86a9-182f-471b-a598-ebd907eb5e4fn@googlegroups.com> <176a76a2-52a6-4234-ad19-64df49e2a635n@googlegroups.com>
<c7f25359-555f-45ce-8b50-772eae97af94n@googlegroups.com> <236a4356-a625-4492-b74f-d5c668be5e96n@googlegroups.com>
<0ee1718d-cd2f-4c97-900b-e2a350923373n@googlegroups.com> <9ed0edba-9284-40fd-b782-8f625a598befn@googlegroups.com>
<167c040e-ff33-4d8f-bd94-5e80c08e3e99n@googlegroups.com> <d2a1c956-5911-423e-990c-f0cd5ca0b5b0n@googlegroups.com>
<6f272d59-612c-4186-b02d-a2b089156a17n@googlegroups.com> <446f792c-7447-4a9c-8902-7db9c87a577cn@googlegroups.com>
<46c2e79d-6e27-4e84-9f99-d0d097583b5an@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <280a2595-de7f-4f2e-91d8-ad592c975dbbn@googlegroups.com>
Subject: Re: Request for comments, Novacore the sequel to ISO modules
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Wed, 12 Oct 2022 17:46:57 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2934
 by: Mostowski Collapse - Wed, 12 Oct 2022 17:46 UTC

Some suspicion about the random number skewing.
Mostlikely #define MAX_URANDOMM_ITER is too low. See
here what GMP does. And it then falls back to low quality result:

if (count == 0)
/* Too many iterations; return result mod n == result - n */
mpn_sub_n (rp, rp, np, size);
https://salsa.debian.org/science-team/gmp/-/blob/master/mpz/urandomm.c

Note that the example interval [0…2^n+1) is a very nasty non power
of 2 interval. That I was using a nasty interval was rather not planned,
when writing the fuzzer, just some accident.

In my implementation I have no MAX_URANDOMM_ITER limit.
My suspiciion, therefore it generates a better probability shaping
on my side, which can be even measured,

already for 100 bits? Is this the reason? Or its some other bug
in mpz_urandomm() caused by the last limb cmp juggling?

Re: Request for comments, Novacore the sequel to ISO modules

<ff88401c-9f7a-423d-a19e-f4854481967dn@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=2689&group=comp.lang.prolog#2689

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:6214:f2b:b0:4b1:7b01:6de2 with SMTP id iw11-20020a0562140f2b00b004b17b016de2mr23986844qvb.122.1665596884561;
Wed, 12 Oct 2022 10:48:04 -0700 (PDT)
X-Received: by 2002:a05:6870:f2a6:b0:136:6442:4b52 with SMTP id
u38-20020a056870f2a600b0013664424b52mr3149599oap.282.1665596884245; Wed, 12
Oct 2022 10:48:04 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Wed, 12 Oct 2022 10:48:04 -0700 (PDT)
In-Reply-To: <280a2595-de7f-4f2e-91d8-ad592c975dbbn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=80.218.40.218; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 80.218.40.218
References: <db8a6771-3e54-485b-b391-310658dd6f52n@googlegroups.com>
<e8c4866e-0d21-4722-8666-f388ed9c5c46n@googlegroups.com> <0b92ca64-dbd2-4950-9745-376705c45031n@googlegroups.com>
<186e6dd6-b34f-44b5-bc41-df084bcf67f3n@googlegroups.com> <db69596d-ee5a-4e27-a774-2d0f1c299378n@googlegroups.com>
<294c86a9-182f-471b-a598-ebd907eb5e4fn@googlegroups.com> <176a76a2-52a6-4234-ad19-64df49e2a635n@googlegroups.com>
<c7f25359-555f-45ce-8b50-772eae97af94n@googlegroups.com> <236a4356-a625-4492-b74f-d5c668be5e96n@googlegroups.com>
<0ee1718d-cd2f-4c97-900b-e2a350923373n@googlegroups.com> <9ed0edba-9284-40fd-b782-8f625a598befn@googlegroups.com>
<167c040e-ff33-4d8f-bd94-5e80c08e3e99n@googlegroups.com> <d2a1c956-5911-423e-990c-f0cd5ca0b5b0n@googlegroups.com>
<6f272d59-612c-4186-b02d-a2b089156a17n@googlegroups.com> <446f792c-7447-4a9c-8902-7db9c87a577cn@googlegroups.com>
<46c2e79d-6e27-4e84-9f99-d0d097583b5an@googlegroups.com> <280a2595-de7f-4f2e-91d8-ad592c975dbbn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <ff88401c-9f7a-423d-a19e-f4854481967dn@googlegroups.com>
Subject: Re: Request for comments, Novacore the sequel to ISO modules
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Wed, 12 Oct 2022 17:48:04 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 3603
 by: Mostowski Collapse - Wed, 12 Oct 2022 17:48 UTC

I didn’t test the random/1 evaluable function in Trealla and Cliao yet.
Cannot run the same test case in Trealla Prolog or Ciao Prolog,
too much stuff missing:

- Trealla Prolog: Didn’t find bigint random.

- Ciao Prolog: Found some random, with an incompatible
protocol to SWI-Prolog, different meaning of the parameters,
but there is so much other stuff missing, like
msb/1, aggregate_all/3, etc…

Mostowski Collapse schrieb am Mittwoch, 12. Oktober 2022 um 19:46:58 UTC+2:
> Some suspicion about the random number skewing.
> Mostlikely #define MAX_URANDOMM_ITER is too low. See
> here what GMP does. And it then falls back to low quality result:
>
> if (count == 0)
> /* Too many iterations; return result mod n == result - n */
> mpn_sub_n (rp, rp, np, size);
> https://salsa.debian.org/science-team/gmp/-/blob/master/mpz/urandomm.c
>
> Note that the example interval [0…2^n+1) is a very nasty non power
> of 2 interval. That I was using a nasty interval was rather not planned,
> when writing the fuzzer, just some accident.
>
> In my implementation I have no MAX_URANDOMM_ITER limit.
> My suspiciion, therefore it generates a better probability shaping
> on my side, which can be even measured,
>
> already for 100 bits? Is this the reason? Or its some other bug
> in mpz_urandomm() caused by the last limb cmp juggling?

Re: Request for comments, Novacore the sequel to ISO modules

<64343265-4453-4ce3-b638-a3b0e27149e6n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=2690&group=comp.lang.prolog#2690

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:ae9:f006:0:b0:6e4:9fd5:bf5c with SMTP id l6-20020ae9f006000000b006e49fd5bf5cmr21358471qkg.139.1665606148881;
Wed, 12 Oct 2022 13:22:28 -0700 (PDT)
X-Received: by 2002:a05:6871:68b:b0:132:9af1:62fb with SMTP id
l11-20020a056871068b00b001329af162fbmr3400440oao.23.1665606148632; Wed, 12
Oct 2022 13:22:28 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Wed, 12 Oct 2022 13:22:28 -0700 (PDT)
In-Reply-To: <ff88401c-9f7a-423d-a19e-f4854481967dn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=80.218.40.218; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 80.218.40.218
References: <db8a6771-3e54-485b-b391-310658dd6f52n@googlegroups.com>
<e8c4866e-0d21-4722-8666-f388ed9c5c46n@googlegroups.com> <0b92ca64-dbd2-4950-9745-376705c45031n@googlegroups.com>
<186e6dd6-b34f-44b5-bc41-df084bcf67f3n@googlegroups.com> <db69596d-ee5a-4e27-a774-2d0f1c299378n@googlegroups.com>
<294c86a9-182f-471b-a598-ebd907eb5e4fn@googlegroups.com> <176a76a2-52a6-4234-ad19-64df49e2a635n@googlegroups.com>
<c7f25359-555f-45ce-8b50-772eae97af94n@googlegroups.com> <236a4356-a625-4492-b74f-d5c668be5e96n@googlegroups.com>
<0ee1718d-cd2f-4c97-900b-e2a350923373n@googlegroups.com> <9ed0edba-9284-40fd-b782-8f625a598befn@googlegroups.com>
<167c040e-ff33-4d8f-bd94-5e80c08e3e99n@googlegroups.com> <d2a1c956-5911-423e-990c-f0cd5ca0b5b0n@googlegroups.com>
<6f272d59-612c-4186-b02d-a2b089156a17n@googlegroups.com> <446f792c-7447-4a9c-8902-7db9c87a577cn@googlegroups.com>
<46c2e79d-6e27-4e84-9f99-d0d097583b5an@googlegroups.com> <280a2595-de7f-4f2e-91d8-ad592c975dbbn@googlegroups.com>
<ff88401c-9f7a-423d-a19e-f4854481967dn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <64343265-4453-4ce3-b638-a3b0e27149e6n@googlegroups.com>
Subject: Re: Request for comments, Novacore the sequel to ISO modules
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Wed, 12 Oct 2022 20:22:28 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 4440
 by: Mostowski Collapse - Wed, 12 Oct 2022 20:22 UTC

On Ciao Prolog its:
random(0,M,...)

On SWI-Prolog its:
random(0,M+1,...)

Should there be a discussion about random/3, its protocoll?
I don’t know, what are the plans of Ciao Prolog and SWI-Prolog?
I don’t know? Is there a road map? I don’t know.

Recently SWI-Prolog deprecated random/3 and introduced
random_between/3 with a different protocoll. Maybe this can
point the way forward? I am more interested about the

skewness here, and not the protcoll of some random API.
Skewed shouldn’t mean screwed. Its quite possible that a
skewed random generator can be fixed.

Mostowski Collapse schrieb am Mittwoch, 12. Oktober 2022 um 19:48:05 UTC+2:
> I didn’t test the random/1 evaluable function in Trealla and Cliao yet.
> Cannot run the same test case in Trealla Prolog or Ciao Prolog,
> too much stuff missing:
>
> - Trealla Prolog: Didn’t find bigint random.
>
> - Ciao Prolog: Found some random, with an incompatible
> protocol to SWI-Prolog, different meaning of the parameters,
> but there is so much other stuff missing, like
> msb/1, aggregate_all/3, etc…
> Mostowski Collapse schrieb am Mittwoch, 12. Oktober 2022 um 19:46:58 UTC+2:
> > Some suspicion about the random number skewing.
> > Mostlikely #define MAX_URANDOMM_ITER is too low. See
> > here what GMP does. And it then falls back to low quality result:
> >
> > if (count == 0)
> > /* Too many iterations; return result mod n == result - n */
> > mpn_sub_n (rp, rp, np, size);
> > https://salsa.debian.org/science-team/gmp/-/blob/master/mpz/urandomm.c
> >
> > Note that the example interval [0…2^n+1) is a very nasty non power
> > of 2 interval. That I was using a nasty interval was rather not planned,
> > when writing the fuzzer, just some accident.
> >
> > In my implementation I have no MAX_URANDOMM_ITER limit.
> > My suspiciion, therefore it generates a better probability shaping
> > on my side, which can be even measured,
> >
> > already for 100 bits? Is this the reason? Or its some other bug
> > in mpz_urandomm() caused by the last limb cmp juggling?

Re: Request for comments, Novacore the sequel to ISO modules

<423358e0-13e3-4d6d-92c7-c6d67d361b66n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=2691&group=comp.lang.prolog#2691

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:620a:44c9:b0:6ed:81ba:667f with SMTP id y9-20020a05620a44c900b006ed81ba667fmr12966418qkp.92.1665665625330;
Thu, 13 Oct 2022 05:53:45 -0700 (PDT)
X-Received: by 2002:a05:6808:308c:b0:354:99ec:bbb7 with SMTP id
bl12-20020a056808308c00b0035499ecbbb7mr4689755oib.68.1665665625010; Thu, 13
Oct 2022 05:53:45 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Thu, 13 Oct 2022 05:53:44 -0700 (PDT)
In-Reply-To: <64343265-4453-4ce3-b638-a3b0e27149e6n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=80.218.40.218; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 80.218.40.218
References: <db8a6771-3e54-485b-b391-310658dd6f52n@googlegroups.com>
<e8c4866e-0d21-4722-8666-f388ed9c5c46n@googlegroups.com> <0b92ca64-dbd2-4950-9745-376705c45031n@googlegroups.com>
<186e6dd6-b34f-44b5-bc41-df084bcf67f3n@googlegroups.com> <db69596d-ee5a-4e27-a774-2d0f1c299378n@googlegroups.com>
<294c86a9-182f-471b-a598-ebd907eb5e4fn@googlegroups.com> <176a76a2-52a6-4234-ad19-64df49e2a635n@googlegroups.com>
<c7f25359-555f-45ce-8b50-772eae97af94n@googlegroups.com> <236a4356-a625-4492-b74f-d5c668be5e96n@googlegroups.com>
<0ee1718d-cd2f-4c97-900b-e2a350923373n@googlegroups.com> <9ed0edba-9284-40fd-b782-8f625a598befn@googlegroups.com>
<167c040e-ff33-4d8f-bd94-5e80c08e3e99n@googlegroups.com> <d2a1c956-5911-423e-990c-f0cd5ca0b5b0n@googlegroups.com>
<6f272d59-612c-4186-b02d-a2b089156a17n@googlegroups.com> <446f792c-7447-4a9c-8902-7db9c87a577cn@googlegroups.com>
<46c2e79d-6e27-4e84-9f99-d0d097583b5an@googlegroups.com> <280a2595-de7f-4f2e-91d8-ad592c975dbbn@googlegroups.com>
<ff88401c-9f7a-423d-a19e-f4854481967dn@googlegroups.com> <64343265-4453-4ce3-b638-a3b0e27149e6n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <423358e0-13e3-4d6d-92c7-c6d67d361b66n@googlegroups.com>
Subject: Re: Request for comments, Novacore the sequel to ISO modules
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Thu, 13 Oct 2022 12:53:45 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Mostowski Collapse - Thu, 13 Oct 2022 12:53 UTC

So maybe the requirement is eclectic? A non skewed
random ganerator for bigints. Often power of 2 is only
required or smallint is enough.

Ha Ha, a Casino website could be interested that their
random generators are not skewed. Or maybe they even
go for a particular skewed random generator?

What if the users of the Casino website figure out the
skewing and play accordingly? I am thinking of games
like roulette or card games. So its in their own interest?

Legitimacy & Regulation of the RNG
There are a number of independent companies which specialise in iGaming testing.
https://www.casinoguardian.co.uk/casino-guide/random-number-generator/

Mostowski Collapse schrieb am Mittwoch, 12. Oktober 2022 um 22:22:29 UTC+2:
> On Ciao Prolog its:
> random(0,M,...)
>
> On SWI-Prolog its:
> random(0,M+1,...)
>
> Should there be a discussion about random/3, its protocoll?
> I don’t know, what are the plans of Ciao Prolog and SWI-Prolog?
> I don’t know? Is there a road map? I don’t know.
>
> Recently SWI-Prolog deprecated random/3 and introduced
> random_between/3 with a different protocoll. Maybe this can
> point the way forward? I am more interested about the
>
> skewness here, and not the protcoll of some random API.
> Skewed shouldn’t mean screwed. Its quite possible that a
> skewed random generator can be fixed.
> Mostowski Collapse schrieb am Mittwoch, 12. Oktober 2022 um 19:48:05 UTC+2:
> > I didn’t test the random/1 evaluable function in Trealla and Cliao yet.
> > Cannot run the same test case in Trealla Prolog or Ciao Prolog,
> > too much stuff missing:
> >
> > - Trealla Prolog: Didn’t find bigint random.
> >
> > - Ciao Prolog: Found some random, with an incompatible
> > protocol to SWI-Prolog, different meaning of the parameters,
> > but there is so much other stuff missing, like
> > msb/1, aggregate_all/3, etc…
> > Mostowski Collapse schrieb am Mittwoch, 12. Oktober 2022 um 19:46:58 UTC+2:
> > > Some suspicion about the random number skewing.
> > > Mostlikely #define MAX_URANDOMM_ITER is too low. See
> > > here what GMP does. And it then falls back to low quality result:
> > >
> > > if (count == 0)
> > > /* Too many iterations; return result mod n == result - n */
> > > mpn_sub_n (rp, rp, np, size);
> > > https://salsa.debian.org/science-team/gmp/-/blob/master/mpz/urandomm.c
> > >
> > > Note that the example interval [0…2^n+1) is a very nasty non power
> > > of 2 interval. That I was using a nasty interval was rather not planned,
> > > when writing the fuzzer, just some accident.
> > >
> > > In my implementation I have no MAX_URANDOMM_ITER limit.
> > > My suspiciion, therefore it generates a better probability shaping
> > > on my side, which can be even measured,
> > >
> > > already for 100 bits? Is this the reason? Or its some other bug
> > > in mpz_urandomm() caused by the last limb cmp juggling?

Re: Request for comments, Novacore the sequel to ISO modules

<99bca2a2-a17f-4724-aae7-20122c1c4a65n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=2692&group=comp.lang.prolog#2692

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a37:5f05:0:b0:6ec:59fe:1ab4 with SMTP id t5-20020a375f05000000b006ec59fe1ab4mr145439qkb.111.1665671528206;
Thu, 13 Oct 2022 07:32:08 -0700 (PDT)
X-Received: by 2002:aca:4303:0:b0:354:cbc8:d269 with SMTP id
q3-20020aca4303000000b00354cbc8d269mr25531oia.115.1665671527745; Thu, 13 Oct
2022 07:32:07 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Thu, 13 Oct 2022 07:32:07 -0700 (PDT)
In-Reply-To: <423358e0-13e3-4d6d-92c7-c6d67d361b66n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=80.218.40.218; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 80.218.40.218
References: <db8a6771-3e54-485b-b391-310658dd6f52n@googlegroups.com>
<e8c4866e-0d21-4722-8666-f388ed9c5c46n@googlegroups.com> <0b92ca64-dbd2-4950-9745-376705c45031n@googlegroups.com>
<186e6dd6-b34f-44b5-bc41-df084bcf67f3n@googlegroups.com> <db69596d-ee5a-4e27-a774-2d0f1c299378n@googlegroups.com>
<294c86a9-182f-471b-a598-ebd907eb5e4fn@googlegroups.com> <176a76a2-52a6-4234-ad19-64df49e2a635n@googlegroups.com>
<c7f25359-555f-45ce-8b50-772eae97af94n@googlegroups.com> <236a4356-a625-4492-b74f-d5c668be5e96n@googlegroups.com>
<0ee1718d-cd2f-4c97-900b-e2a350923373n@googlegroups.com> <9ed0edba-9284-40fd-b782-8f625a598befn@googlegroups.com>
<167c040e-ff33-4d8f-bd94-5e80c08e3e99n@googlegroups.com> <d2a1c956-5911-423e-990c-f0cd5ca0b5b0n@googlegroups.com>
<6f272d59-612c-4186-b02d-a2b089156a17n@googlegroups.com> <446f792c-7447-4a9c-8902-7db9c87a577cn@googlegroups.com>
<46c2e79d-6e27-4e84-9f99-d0d097583b5an@googlegroups.com> <280a2595-de7f-4f2e-91d8-ad592c975dbbn@googlegroups.com>
<ff88401c-9f7a-423d-a19e-f4854481967dn@googlegroups.com> <64343265-4453-4ce3-b638-a3b0e27149e6n@googlegroups.com>
<423358e0-13e3-4d6d-92c7-c6d67d361b66n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <99bca2a2-a17f-4724-aae7-20122c1c4a65n@googlegroups.com>
Subject: Re: Request for comments, Novacore the sequel to ISO modules
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Thu, 13 Oct 2022 14:32:08 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 4078
 by: Mostowski Collapse - Thu, 13 Oct 2022 14:32 UTC

2 out of 3 Prolog system cannot generate uniform random
bigints? Don't know yet, have to dig deeper. Strange that
the below result has always 100.0:

The error in Ciao Prolog is much larger than in SWI-Prolog,
i.e. the distance to the expected value. Was using this query,
taking into account the different random/3 protocoll, and

manually compensating for the missing aggregate_all/3
and msb/1 evaluable function:

$ ciaosh
Ciao 1.22.0 (2022-09-28 21:20:35 +0200) [LINUXx86_64]
?- use_module(library(between)).

?- ['aggregate.p'].

?- E is (1<<100), M is (1<<101), K is (1<<20),
between(1,10,_), aggregate_all(sum(X),
(between(1,K,_), random(0,M,X)), S),
H is abs(S-E*K), msb(H,J), N is J-20, write(N), nl, fail; true.
100.0
100.0
100.0
100.0
100.0
100.0
100.0
100.0
100.0
100.0

And this helper code (file aggregate.p):

:- use_module(library(numlists)).
:- use_module(library(random)).

aggregate_all(sum(X), G, S) :-
findall(X, G, L),
sum_list(L, S).

msb(X, Y) :- Y is log(X)/log(2).

Mostowski Collapse schrieb am Donnerstag, 13. Oktober 2022 um 14:53:46 UTC+2:
> So maybe the requirement is eclectic? A non skewed
> random ganerator for bigints. Often power of 2 is only
> required or smallint is enough.
>
> Ha Ha, a Casino website could be interested that their
> random generators are not skewed. Or maybe they even
> go for a particular skewed random generator?
>
> What if the users of the Casino website figure out the
> skewing and play accordingly? I am thinking of games
> like roulette or card games. So its in their own interest?
>
> Legitimacy & Regulation of the RNG
> There are a number of independent companies which specialise in iGaming testing.
> https://www.casinoguardian.co.uk/casino-guide/random-number-generator/

Re: Request for comments, Novacore the sequel to ISO modules

<03bec9e5-01a4-4e78-abc9-6b2dfd01e52cn@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=2693&group=comp.lang.prolog#2693

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:6214:27ce:b0:4b1:92c9:611c with SMTP id ge14-20020a05621427ce00b004b192c9611cmr815239qvb.115.1665684961371;
Thu, 13 Oct 2022 11:16:01 -0700 (PDT)
X-Received: by 2002:a05:6870:f629:b0:136:b5dd:8717 with SMTP id
ek41-20020a056870f62900b00136b5dd8717mr571827oab.33.1665684961068; Thu, 13
Oct 2022 11:16:01 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Thu, 13 Oct 2022 11:16:00 -0700 (PDT)
In-Reply-To: <99bca2a2-a17f-4724-aae7-20122c1c4a65n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=80.218.40.218; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 80.218.40.218
References: <db8a6771-3e54-485b-b391-310658dd6f52n@googlegroups.com>
<e8c4866e-0d21-4722-8666-f388ed9c5c46n@googlegroups.com> <0b92ca64-dbd2-4950-9745-376705c45031n@googlegroups.com>
<186e6dd6-b34f-44b5-bc41-df084bcf67f3n@googlegroups.com> <db69596d-ee5a-4e27-a774-2d0f1c299378n@googlegroups.com>
<294c86a9-182f-471b-a598-ebd907eb5e4fn@googlegroups.com> <176a76a2-52a6-4234-ad19-64df49e2a635n@googlegroups.com>
<c7f25359-555f-45ce-8b50-772eae97af94n@googlegroups.com> <236a4356-a625-4492-b74f-d5c668be5e96n@googlegroups.com>
<0ee1718d-cd2f-4c97-900b-e2a350923373n@googlegroups.com> <9ed0edba-9284-40fd-b782-8f625a598befn@googlegroups.com>
<167c040e-ff33-4d8f-bd94-5e80c08e3e99n@googlegroups.com> <d2a1c956-5911-423e-990c-f0cd5ca0b5b0n@googlegroups.com>
<6f272d59-612c-4186-b02d-a2b089156a17n@googlegroups.com> <446f792c-7447-4a9c-8902-7db9c87a577cn@googlegroups.com>
<46c2e79d-6e27-4e84-9f99-d0d097583b5an@googlegroups.com> <280a2595-de7f-4f2e-91d8-ad592c975dbbn@googlegroups.com>
<ff88401c-9f7a-423d-a19e-f4854481967dn@googlegroups.com> <64343265-4453-4ce3-b638-a3b0e27149e6n@googlegroups.com>
<423358e0-13e3-4d6d-92c7-c6d67d361b66n@googlegroups.com> <99bca2a2-a17f-4724-aae7-20122c1c4a65n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <03bec9e5-01a4-4e78-abc9-6b2dfd01e52cn@googlegroups.com>
Subject: Re: Request for comments, Novacore the sequel to ISO modules
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Thu, 13 Oct 2022 18:16:01 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3119
 by: Mostowski Collapse - Thu, 13 Oct 2022 18:16 UTC

Does the C floating point API have HALF_EVEN default?
Maybe, maybe not. Is there a test case to figure out
what rounding a system, Prolog or not, does, for its

floating point numbers, independent of some bigint
conversion issues? Was trying the folllowing test and got
some surprise. There was first quite some agreement:

/* SWI-Prolog 8.5.18 */
?- X is 665723957508124892951320985600.0+26388279066624.0.
X = 6.65723957508125e+29.

/* Ciao Prolog 1.22.0 */
?- X is 665723957508124892951320985600.0+26388279066624.0.
X = 6.65723957508125e29 ?

/* Trealla Prolog 2.4.3 */
?- X is 665723957508124892951320985600.0+26388279066624.0.
X = 6.65723957508125e+29.

/* Jekejeke Prolog 1.5.5 */
?- X is 665723957508124892951320985600.0+26388279066624.0.
X = 6.65723957508125E29.

Re: Request for comments, Novacore the sequel to ISO modules

<2a145e4f-4c95-4240-946e-e351fdc6d754n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=2694&group=comp.lang.prolog#2694

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:6214:21e6:b0:4af:a811:6c69 with SMTP id p6-20020a05621421e600b004afa8116c69mr878507qvj.40.1665685083537;
Thu, 13 Oct 2022 11:18:03 -0700 (PDT)
X-Received: by 2002:aca:4303:0:b0:354:cbc8:d269 with SMTP id
q3-20020aca4303000000b00354cbc8d269mr533837oia.115.1665685083247; Thu, 13 Oct
2022 11:18:03 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Thu, 13 Oct 2022 11:18:03 -0700 (PDT)
In-Reply-To: <03bec9e5-01a4-4e78-abc9-6b2dfd01e52cn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=80.218.40.218; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 80.218.40.218
References: <db8a6771-3e54-485b-b391-310658dd6f52n@googlegroups.com>
<e8c4866e-0d21-4722-8666-f388ed9c5c46n@googlegroups.com> <0b92ca64-dbd2-4950-9745-376705c45031n@googlegroups.com>
<186e6dd6-b34f-44b5-bc41-df084bcf67f3n@googlegroups.com> <db69596d-ee5a-4e27-a774-2d0f1c299378n@googlegroups.com>
<294c86a9-182f-471b-a598-ebd907eb5e4fn@googlegroups.com> <176a76a2-52a6-4234-ad19-64df49e2a635n@googlegroups.com>
<c7f25359-555f-45ce-8b50-772eae97af94n@googlegroups.com> <236a4356-a625-4492-b74f-d5c668be5e96n@googlegroups.com>
<0ee1718d-cd2f-4c97-900b-e2a350923373n@googlegroups.com> <9ed0edba-9284-40fd-b782-8f625a598befn@googlegroups.com>
<167c040e-ff33-4d8f-bd94-5e80c08e3e99n@googlegroups.com> <d2a1c956-5911-423e-990c-f0cd5ca0b5b0n@googlegroups.com>
<6f272d59-612c-4186-b02d-a2b089156a17n@googlegroups.com> <446f792c-7447-4a9c-8902-7db9c87a577cn@googlegroups.com>
<46c2e79d-6e27-4e84-9f99-d0d097583b5an@googlegroups.com> <280a2595-de7f-4f2e-91d8-ad592c975dbbn@googlegroups.com>
<ff88401c-9f7a-423d-a19e-f4854481967dn@googlegroups.com> <64343265-4453-4ce3-b638-a3b0e27149e6n@googlegroups.com>
<423358e0-13e3-4d6d-92c7-c6d67d361b66n@googlegroups.com> <99bca2a2-a17f-4724-aae7-20122c1c4a65n@googlegroups.com>
<03bec9e5-01a4-4e78-abc9-6b2dfd01e52cn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <2a145e4f-4c95-4240-946e-e351fdc6d754n@googlegroups.com>
Subject: Re: Request for comments, Novacore the sequel to ISO modules
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Thu, 13 Oct 2022 18:18:03 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3897
 by: Mostowski Collapse - Thu, 13 Oct 2022 18:18 UTC

But then suddently:

/* Scryer Prolog 0.9.0 */
?- X is 665723957508124892951320985600.0+26388279066624.0.
X = 6.657239575081248e29.

/* ECLiPSe Prolog 7.0.61 */
?- X is 665723957508124892951320985600.0+26388279066624.0.
X = 6.6572395750812482e+29

?- X is 6.6572395750812482e+29-6.65723957508125E29.
X = -140737488355328.0.

Maybe this also explains the divergence in bigint to float conversion.
Maybe they have by accident a misconfigured FPU? Some init call
to the runtime system missing? Or a cheap floating point library?

But one is WSL2 and the other Windows!

Mostowski Collapse schrieb am Donnerstag, 13. Oktober 2022 um 20:16:02 UTC+2:
> Does the C floating point API have HALF_EVEN default?
> Maybe, maybe not. Is there a test case to figure out
> what rounding a system, Prolog or not, does, for its
>
> floating point numbers, independent of some bigint
> conversion issues? Was trying the folllowing test and got
> some surprise. There was first quite some agreement:
>
> /* SWI-Prolog 8.5.18 */
> ?- X is 665723957508124892951320985600.0+26388279066624.0.
> X = 6.65723957508125e+29.
>
> /* Ciao Prolog 1.22.0 */
> ?- X is 665723957508124892951320985600.0+26388279066624.0.
> X = 6.65723957508125e29 ?
>
> /* Trealla Prolog 2.4.3 */
> ?- X is 665723957508124892951320985600.0+26388279066624.0.
> X = 6.65723957508125e+29.
>
> /* Jekejeke Prolog 1.5.5 */
> ?- X is 665723957508124892951320985600.0+26388279066624.0.
> X = 6.65723957508125E29.

Re: Request for comments, Novacore the sequel to ISO modules

<769a059a-1df8-48ad-9342-41b9861a35f0n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=2695&group=comp.lang.prolog#2695

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:6214:5cc5:b0:4b3:e05a:bbb9 with SMTP id lk5-20020a0562145cc500b004b3e05abbb9mr924859qvb.42.1665686210299;
Thu, 13 Oct 2022 11:36:50 -0700 (PDT)
X-Received: by 2002:a05:6870:960b:b0:132:e9d6:ea39 with SMTP id
d11-20020a056870960b00b00132e9d6ea39mr624535oaq.257.1665686209998; Thu, 13
Oct 2022 11:36:49 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Thu, 13 Oct 2022 11:36:49 -0700 (PDT)
In-Reply-To: <2a145e4f-4c95-4240-946e-e351fdc6d754n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=80.218.40.218; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 80.218.40.218
References: <db8a6771-3e54-485b-b391-310658dd6f52n@googlegroups.com>
<e8c4866e-0d21-4722-8666-f388ed9c5c46n@googlegroups.com> <0b92ca64-dbd2-4950-9745-376705c45031n@googlegroups.com>
<186e6dd6-b34f-44b5-bc41-df084bcf67f3n@googlegroups.com> <db69596d-ee5a-4e27-a774-2d0f1c299378n@googlegroups.com>
<294c86a9-182f-471b-a598-ebd907eb5e4fn@googlegroups.com> <176a76a2-52a6-4234-ad19-64df49e2a635n@googlegroups.com>
<c7f25359-555f-45ce-8b50-772eae97af94n@googlegroups.com> <236a4356-a625-4492-b74f-d5c668be5e96n@googlegroups.com>
<0ee1718d-cd2f-4c97-900b-e2a350923373n@googlegroups.com> <9ed0edba-9284-40fd-b782-8f625a598befn@googlegroups.com>
<167c040e-ff33-4d8f-bd94-5e80c08e3e99n@googlegroups.com> <d2a1c956-5911-423e-990c-f0cd5ca0b5b0n@googlegroups.com>
<6f272d59-612c-4186-b02d-a2b089156a17n@googlegroups.com> <446f792c-7447-4a9c-8902-7db9c87a577cn@googlegroups.com>
<46c2e79d-6e27-4e84-9f99-d0d097583b5an@googlegroups.com> <280a2595-de7f-4f2e-91d8-ad592c975dbbn@googlegroups.com>
<ff88401c-9f7a-423d-a19e-f4854481967dn@googlegroups.com> <64343265-4453-4ce3-b638-a3b0e27149e6n@googlegroups.com>
<423358e0-13e3-4d6d-92c7-c6d67d361b66n@googlegroups.com> <99bca2a2-a17f-4724-aae7-20122c1c4a65n@googlegroups.com>
<03bec9e5-01a4-4e78-abc9-6b2dfd01e52cn@googlegroups.com> <2a145e4f-4c95-4240-946e-e351fdc6d754n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <769a059a-1df8-48ad-9342-41b9861a35f0n@googlegroups.com>
Subject: Re: Request for comments, Novacore the sequel to ISO modules
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Thu, 13 Oct 2022 18:36:50 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 4480
 by: Mostowski Collapse - Thu, 13 Oct 2022 18:36 UTC

Have to dig deeper, could be a parsing problem.
For the first summand, I get:

/* SWI-Prolog */
?- X is 665723957508124892951320985600.0.
X = 6.65723957508125e+29.

/* ECLiPSe Prolog */
X is 665723957508124892951320985600.0.
X = 6.6572395750812482e+29

I am not yet at a test case, which would give me
some information about rounding.

Mostowski Collapse schrieb am Donnerstag, 13. Oktober 2022 um 20:18:04 UTC+2:
> But then suddently:
>
> /* Scryer Prolog 0.9.0 */
> ?- X is 665723957508124892951320985600.0+26388279066624.0.
> X = 6.657239575081248e29.
>
> /* ECLiPSe Prolog 7.0.61 */
> ?- X is 665723957508124892951320985600.0+26388279066624.0.
> X = 6.6572395750812482e+29
>
> ?- X is 6.6572395750812482e+29-6.65723957508125E29.
> X = -140737488355328.0.
>
> Maybe this also explains the divergence in bigint to float conversion.
> Maybe they have by accident a misconfigured FPU? Some init call
> to the runtime system missing? Or a cheap floating point library?
>
> But one is WSL2 and the other Windows!
> Mostowski Collapse schrieb am Donnerstag, 13. Oktober 2022 um 20:16:02 UTC+2:
> > Does the C floating point API have HALF_EVEN default?
> > Maybe, maybe not. Is there a test case to figure out
> > what rounding a system, Prolog or not, does, for its
> >
> > floating point numbers, independent of some bigint
> > conversion issues? Was trying the folllowing test and got
> > some surprise. There was first quite some agreement:
> >
> > /* SWI-Prolog 8.5.18 */
> > ?- X is 665723957508124892951320985600.0+26388279066624.0.
> > X = 6.65723957508125e+29.
> >
> > /* Ciao Prolog 1.22.0 */
> > ?- X is 665723957508124892951320985600.0+26388279066624.0.
> > X = 6.65723957508125e29 ?
> >
> > /* Trealla Prolog 2.4.3 */
> > ?- X is 665723957508124892951320985600.0+26388279066624.0.
> > X = 6.65723957508125e+29.
> >
> > /* Jekejeke Prolog 1.5.5 */
> > ?- X is 665723957508124892951320985600.0+26388279066624.0.
> > X = 6.65723957508125E29.

Re: Request for comments, Novacore the sequel to ISO modules

<bee38b60-6094-418f-a0bf-072c45e1da6dn@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=2696&group=comp.lang.prolog#2696

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:620a:48e:b0:6ec:fe1d:c7c with SMTP id 14-20020a05620a048e00b006ecfe1d0c7cmr1412250qkr.651.1665692932905;
Thu, 13 Oct 2022 13:28:52 -0700 (PDT)
X-Received: by 2002:aca:4303:0:b0:354:cbc8:d269 with SMTP id
q3-20020aca4303000000b00354cbc8d269mr775995oia.115.1665692932644; Thu, 13 Oct
2022 13:28:52 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Thu, 13 Oct 2022 13:28:52 -0700 (PDT)
In-Reply-To: <769a059a-1df8-48ad-9342-41b9861a35f0n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=80.218.40.218; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 80.218.40.218
References: <db8a6771-3e54-485b-b391-310658dd6f52n@googlegroups.com>
<e8c4866e-0d21-4722-8666-f388ed9c5c46n@googlegroups.com> <0b92ca64-dbd2-4950-9745-376705c45031n@googlegroups.com>
<186e6dd6-b34f-44b5-bc41-df084bcf67f3n@googlegroups.com> <db69596d-ee5a-4e27-a774-2d0f1c299378n@googlegroups.com>
<294c86a9-182f-471b-a598-ebd907eb5e4fn@googlegroups.com> <176a76a2-52a6-4234-ad19-64df49e2a635n@googlegroups.com>
<c7f25359-555f-45ce-8b50-772eae97af94n@googlegroups.com> <236a4356-a625-4492-b74f-d5c668be5e96n@googlegroups.com>
<0ee1718d-cd2f-4c97-900b-e2a350923373n@googlegroups.com> <9ed0edba-9284-40fd-b782-8f625a598befn@googlegroups.com>
<167c040e-ff33-4d8f-bd94-5e80c08e3e99n@googlegroups.com> <d2a1c956-5911-423e-990c-f0cd5ca0b5b0n@googlegroups.com>
<6f272d59-612c-4186-b02d-a2b089156a17n@googlegroups.com> <446f792c-7447-4a9c-8902-7db9c87a577cn@googlegroups.com>
<46c2e79d-6e27-4e84-9f99-d0d097583b5an@googlegroups.com> <280a2595-de7f-4f2e-91d8-ad592c975dbbn@googlegroups.com>
<ff88401c-9f7a-423d-a19e-f4854481967dn@googlegroups.com> <64343265-4453-4ce3-b638-a3b0e27149e6n@googlegroups.com>
<423358e0-13e3-4d6d-92c7-c6d67d361b66n@googlegroups.com> <99bca2a2-a17f-4724-aae7-20122c1c4a65n@googlegroups.com>
<03bec9e5-01a4-4e78-abc9-6b2dfd01e52cn@googlegroups.com> <2a145e4f-4c95-4240-946e-e351fdc6d754n@googlegroups.com>
<769a059a-1df8-48ad-9342-41b9861a35f0n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <bee38b60-6094-418f-a0bf-072c45e1da6dn@googlegroups.com>
Subject: Re: Request for comments, Novacore the sequel to ISO modules
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Thu, 13 Oct 2022 20:28:52 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Mostowski Collapse - Thu, 13 Oct 2022 20:28 UTC

Looks like my system belongs to the 2 system that
cannot generate good random numbers? I guess the
system with a smaller value is possible the less good

random generator, because some periodicity was hit.
Java uses a Lehmer algorithm which has a very short
period and uses very few bits in its state. On the other

hand the Twister uses quite some bits I guess, and has
a much larger periodicity. Twister would be therefore the
better randum number generator.

Mostowski Collapse schrieb am Donnerstag, 13. Oktober 2022 um 20:36:51 UTC+2:
> Have to dig deeper, could be a parsing problem.
> For the first summand, I get:
>
> /* SWI-Prolog */
> ?- X is 665723957508124892951320985600.0.
> X = 6.65723957508125e+29.
>
> /* ECLiPSe Prolog */
> X is 665723957508124892951320985600.0.
> X = 6.6572395750812482e+29
>
> I am not yet at a test case, which would give me
> some information about rounding.
> Mostowski Collapse schrieb am Donnerstag, 13. Oktober 2022 um 20:18:04 UTC+2:
> > But then suddently:
> >
> > /* Scryer Prolog 0.9.0 */
> > ?- X is 665723957508124892951320985600.0+26388279066624.0.
> > X = 6.657239575081248e29.
> >
> > /* ECLiPSe Prolog 7.0.61 */
> > ?- X is 665723957508124892951320985600.0+26388279066624.0.
> > X = 6.6572395750812482e+29
> >
> > ?- X is 6.6572395750812482e+29-6.65723957508125E29.
> > X = -140737488355328.0.
> >
> > Maybe this also explains the divergence in bigint to float conversion.
> > Maybe they have by accident a misconfigured FPU? Some init call
> > to the runtime system missing? Or a cheap floating point library?
> >
> > But one is WSL2 and the other Windows!
> > Mostowski Collapse schrieb am Donnerstag, 13. Oktober 2022 um 20:16:02 UTC+2:
> > > Does the C floating point API have HALF_EVEN default?
> > > Maybe, maybe not. Is there a test case to figure out
> > > what rounding a system, Prolog or not, does, for its
> > >
> > > floating point numbers, independent of some bigint
> > > conversion issues? Was trying the folllowing test and got
> > > some surprise. There was first quite some agreement:
> > >
> > > /* SWI-Prolog 8.5.18 */
> > > ?- X is 665723957508124892951320985600.0+26388279066624.0.
> > > X = 6.65723957508125e+29.
> > >
> > > /* Ciao Prolog 1.22.0 */
> > > ?- X is 665723957508124892951320985600.0+26388279066624.0.
> > > X = 6.65723957508125e29 ?
> > >
> > > /* Trealla Prolog 2.4.3 */
> > > ?- X is 665723957508124892951320985600.0+26388279066624.0.
> > > X = 6.65723957508125e+29.
> > >
> > > /* Jekejeke Prolog 1.5.5 */
> > > ?- X is 665723957508124892951320985600.0+26388279066624.0.
> > > X = 6.65723957508125E29.

Re: Request for comments, Novacore the sequel to ISO modules

<581786e6-7758-4217-b5c8-f5eb6c367f54n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=2697&group=comp.lang.prolog#2697

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:ac8:5a8c:0:b0:35b:b2f7:7e96 with SMTP id c12-20020ac85a8c000000b0035bb2f77e96mr3236606qtc.659.1665736904212;
Fri, 14 Oct 2022 01:41:44 -0700 (PDT)
X-Received: by 2002:a05:6808:140b:b0:355:1cdb:b074 with SMTP id
w11-20020a056808140b00b003551cdbb074mr763335oiv.122.1665736903926; Fri, 14
Oct 2022 01:41:43 -0700 (PDT)
Path: i2pn2.org!rocksolid2!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Fri, 14 Oct 2022 01:41:43 -0700 (PDT)
In-Reply-To: <bee38b60-6094-418f-a0bf-072c45e1da6dn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=80.218.40.218; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 80.218.40.218
References: <db8a6771-3e54-485b-b391-310658dd6f52n@googlegroups.com>
<e8c4866e-0d21-4722-8666-f388ed9c5c46n@googlegroups.com> <0b92ca64-dbd2-4950-9745-376705c45031n@googlegroups.com>
<186e6dd6-b34f-44b5-bc41-df084bcf67f3n@googlegroups.com> <db69596d-ee5a-4e27-a774-2d0f1c299378n@googlegroups.com>
<294c86a9-182f-471b-a598-ebd907eb5e4fn@googlegroups.com> <176a76a2-52a6-4234-ad19-64df49e2a635n@googlegroups.com>
<c7f25359-555f-45ce-8b50-772eae97af94n@googlegroups.com> <236a4356-a625-4492-b74f-d5c668be5e96n@googlegroups.com>
<0ee1718d-cd2f-4c97-900b-e2a350923373n@googlegroups.com> <9ed0edba-9284-40fd-b782-8f625a598befn@googlegroups.com>
<167c040e-ff33-4d8f-bd94-5e80c08e3e99n@googlegroups.com> <d2a1c956-5911-423e-990c-f0cd5ca0b5b0n@googlegroups.com>
<6f272d59-612c-4186-b02d-a2b089156a17n@googlegroups.com> <446f792c-7447-4a9c-8902-7db9c87a577cn@googlegroups.com>
<46c2e79d-6e27-4e84-9f99-d0d097583b5an@googlegroups.com> <280a2595-de7f-4f2e-91d8-ad592c975dbbn@googlegroups.com>
<ff88401c-9f7a-423d-a19e-f4854481967dn@googlegroups.com> <64343265-4453-4ce3-b638-a3b0e27149e6n@googlegroups.com>
<423358e0-13e3-4d6d-92c7-c6d67d361b66n@googlegroups.com> <99bca2a2-a17f-4724-aae7-20122c1c4a65n@googlegroups.com>
<03bec9e5-01a4-4e78-abc9-6b2dfd01e52cn@googlegroups.com> <2a145e4f-4c95-4240-946e-e351fdc6d754n@googlegroups.com>
<769a059a-1df8-48ad-9342-41b9861a35f0n@googlegroups.com> <bee38b60-6094-418f-a0bf-072c45e1da6dn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <581786e6-7758-4217-b5c8-f5eb6c367f54n@googlegroups.com>
Subject: Re: Request for comments, Novacore the sequel to ISO modules
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Fri, 14 Oct 2022 08:41:44 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3055
 by: Mostowski Collapse - Fri, 14 Oct 2022 08:41 UTC

Now turning my attention to (/)/2. SWI-Prolog wants me
to use set_prolog_flag(iso, true), to get the semantics
of the ISO core standard, page 116.

But the fuzzer still finds the needle in the haystack.
Using more bits to the numerator, and I find:

/* Jekejeke Prolog 1.5.5 */
?- X is -15915286457581575168 / -238455449856.
X = 6.674322800000001E7.

/* SWI-Prolog 8.5.18 */
?- current_prolog_flag(iso, X).
X = true.

?- X is -15915286457581575168 / -238455449856.
X = 66743227.99999999.

Re: Request for comments, Novacore the sequel to ISO modules

<76b12926-c1d6-4471-92ce-259794febf09n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=2698&group=comp.lang.prolog#2698

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:6214:29c9:b0:4b3:fcfe:3731 with SMTP id gh9-20020a05621429c900b004b3fcfe3731mr3021141qvb.29.1665737011156;
Fri, 14 Oct 2022 01:43:31 -0700 (PDT)
X-Received: by 2002:a05:6808:148f:b0:354:b8c5:495d with SMTP id
e15-20020a056808148f00b00354b8c5495dmr6711038oiw.108.1665737010930; Fri, 14
Oct 2022 01:43:30 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Fri, 14 Oct 2022 01:43:30 -0700 (PDT)
In-Reply-To: <581786e6-7758-4217-b5c8-f5eb6c367f54n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=80.218.40.218; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 80.218.40.218
References: <db8a6771-3e54-485b-b391-310658dd6f52n@googlegroups.com>
<e8c4866e-0d21-4722-8666-f388ed9c5c46n@googlegroups.com> <0b92ca64-dbd2-4950-9745-376705c45031n@googlegroups.com>
<186e6dd6-b34f-44b5-bc41-df084bcf67f3n@googlegroups.com> <db69596d-ee5a-4e27-a774-2d0f1c299378n@googlegroups.com>
<294c86a9-182f-471b-a598-ebd907eb5e4fn@googlegroups.com> <176a76a2-52a6-4234-ad19-64df49e2a635n@googlegroups.com>
<c7f25359-555f-45ce-8b50-772eae97af94n@googlegroups.com> <236a4356-a625-4492-b74f-d5c668be5e96n@googlegroups.com>
<0ee1718d-cd2f-4c97-900b-e2a350923373n@googlegroups.com> <9ed0edba-9284-40fd-b782-8f625a598befn@googlegroups.com>
<167c040e-ff33-4d8f-bd94-5e80c08e3e99n@googlegroups.com> <d2a1c956-5911-423e-990c-f0cd5ca0b5b0n@googlegroups.com>
<6f272d59-612c-4186-b02d-a2b089156a17n@googlegroups.com> <446f792c-7447-4a9c-8902-7db9c87a577cn@googlegroups.com>
<46c2e79d-6e27-4e84-9f99-d0d097583b5an@googlegroups.com> <280a2595-de7f-4f2e-91d8-ad592c975dbbn@googlegroups.com>
<ff88401c-9f7a-423d-a19e-f4854481967dn@googlegroups.com> <64343265-4453-4ce3-b638-a3b0e27149e6n@googlegroups.com>
<423358e0-13e3-4d6d-92c7-c6d67d361b66n@googlegroups.com> <99bca2a2-a17f-4724-aae7-20122c1c4a65n@googlegroups.com>
<03bec9e5-01a4-4e78-abc9-6b2dfd01e52cn@googlegroups.com> <2a145e4f-4c95-4240-946e-e351fdc6d754n@googlegroups.com>
<769a059a-1df8-48ad-9342-41b9861a35f0n@googlegroups.com> <bee38b60-6094-418f-a0bf-072c45e1da6dn@googlegroups.com>
<581786e6-7758-4217-b5c8-f5eb6c367f54n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <76b12926-c1d6-4471-92ce-259794febf09n@googlegroups.com>
Subject: Re: Request for comments, Novacore the sequel to ISO modules
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Fri, 14 Oct 2022 08:43:31 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3769
 by: Mostowski Collapse - Fri, 14 Oct 2022 08:43 UTC

Now I have test cases so nasty, even Ciao Prolog and
SICStus Prolog are stumbling. Interestingly Ciao Prolog
and SICStus Prolog stumble at the exact same test cases.

/* Ciao Prolog 1.22.0 */
?- case4(N, P, Q, Y), Z is P/Q, Y =\= Z.
N = 3,
P = -138732791312937296168,
Q = 70775453,
Y = -1960182315087.9346,
Z = -1960182315087.9343 ? ;
no

/* SICStus Prolog 4.7.1 */
?- case4(N, P, Q, Y), Z is P/Q, Y =\= Z.
N = 3,
P = -138732791312937296168,
Q = 70775453,
Y = -1960182315087.9346,
Z = -1960182315087.9343 ? ;
no

Mostowski Collapse schrieb am Freitag, 14. Oktober 2022 um 10:41:45 UTC+2:
> Now turning my attention to (/)/2. SWI-Prolog wants me
> to use set_prolog_flag(iso, true), to get the semantics
> of the ISO core standard, page 116.
>
> But the fuzzer still finds the needle in the haystack.
> Using more bits to the numerator, and I find:
> /* Jekejeke Prolog 1.5.5 */
> ?- X is -15915286457581575168 / -238455449856.
> X = 6.674322800000001E7.
>
> /* SWI-Prolog 8.5.18 */
> ?- current_prolog_flag(iso, X).
> X = true.
>
> ?- X is -15915286457581575168 / -238455449856.
> X = 66743227.99999999.

Re: Request for comments, Novacore the sequel to ISO modules

<de6697e9-80b8-4501-a953-e71cc17df6ddn@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=2699&group=comp.lang.prolog#2699

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a37:a996:0:b0:6ec:59da:a72 with SMTP id s144-20020a37a996000000b006ec59da0a72mr4030692qke.676.1665758501280;
Fri, 14 Oct 2022 07:41:41 -0700 (PDT)
X-Received: by 2002:a05:6808:140b:b0:355:1cdb:b074 with SMTP id
w11-20020a056808140b00b003551cdbb074mr1496489oiv.122.1665758501028; Fri, 14
Oct 2022 07:41:41 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Fri, 14 Oct 2022 07:41:40 -0700 (PDT)
In-Reply-To: <76b12926-c1d6-4471-92ce-259794febf09n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=80.218.40.218; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 80.218.40.218
References: <db8a6771-3e54-485b-b391-310658dd6f52n@googlegroups.com>
<e8c4866e-0d21-4722-8666-f388ed9c5c46n@googlegroups.com> <0b92ca64-dbd2-4950-9745-376705c45031n@googlegroups.com>
<186e6dd6-b34f-44b5-bc41-df084bcf67f3n@googlegroups.com> <db69596d-ee5a-4e27-a774-2d0f1c299378n@googlegroups.com>
<294c86a9-182f-471b-a598-ebd907eb5e4fn@googlegroups.com> <176a76a2-52a6-4234-ad19-64df49e2a635n@googlegroups.com>
<c7f25359-555f-45ce-8b50-772eae97af94n@googlegroups.com> <236a4356-a625-4492-b74f-d5c668be5e96n@googlegroups.com>
<0ee1718d-cd2f-4c97-900b-e2a350923373n@googlegroups.com> <9ed0edba-9284-40fd-b782-8f625a598befn@googlegroups.com>
<167c040e-ff33-4d8f-bd94-5e80c08e3e99n@googlegroups.com> <d2a1c956-5911-423e-990c-f0cd5ca0b5b0n@googlegroups.com>
<6f272d59-612c-4186-b02d-a2b089156a17n@googlegroups.com> <446f792c-7447-4a9c-8902-7db9c87a577cn@googlegroups.com>
<46c2e79d-6e27-4e84-9f99-d0d097583b5an@googlegroups.com> <280a2595-de7f-4f2e-91d8-ad592c975dbbn@googlegroups.com>
<ff88401c-9f7a-423d-a19e-f4854481967dn@googlegroups.com> <64343265-4453-4ce3-b638-a3b0e27149e6n@googlegroups.com>
<423358e0-13e3-4d6d-92c7-c6d67d361b66n@googlegroups.com> <99bca2a2-a17f-4724-aae7-20122c1c4a65n@googlegroups.com>
<03bec9e5-01a4-4e78-abc9-6b2dfd01e52cn@googlegroups.com> <2a145e4f-4c95-4240-946e-e351fdc6d754n@googlegroups.com>
<769a059a-1df8-48ad-9342-41b9861a35f0n@googlegroups.com> <bee38b60-6094-418f-a0bf-072c45e1da6dn@googlegroups.com>
<581786e6-7758-4217-b5c8-f5eb6c367f54n@googlegroups.com> <76b12926-c1d6-4471-92ce-259794febf09n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <de6697e9-80b8-4501-a953-e71cc17df6ddn@googlegroups.com>
Subject: Re: Request for comments, Novacore the sequel to ISO modules
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Fri, 14 Oct 2022 14:41:41 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 4415
 by: Mostowski Collapse - Fri, 14 Oct 2022 14:41 UTC

Last chapter of the testing campaign. Testing (**)/2 now.

BTW, this is a little cringe what the fuzzer found for Dogelog
Player on Python. One can try Python 3.11 and will get:

Python 3.11.0rc1 (main, Aug 8 2022, 11:30:54)
>>> 396** -1
0.002525252525252525
>>> 1/396
0.0025252525252525255

Same test case that makes SICStus Prolog tumbling. Such
surprises lower the pain of testing, make it rather addictive.

Mostowski Collapse schrieb am Freitag, 14. Oktober 2022 um 10:43:32 UTC+2:
> Now I have test cases so nasty, even Ciao Prolog and
> SICStus Prolog are stumbling. Interestingly Ciao Prolog
> and SICStus Prolog stumble at the exact same test cases.
> /* Ciao Prolog 1.22.0 */
> ?- case4(N, P, Q, Y), Z is P/Q, Y =\= Z.
> N = 3,
> P = -138732791312937296168,
> Q = 70775453,
> Y = -1960182315087.9346,
> Z = -1960182315087.9343 ? ;
> no
>
> /* SICStus Prolog 4.7.1 */
> ?- case4(N, P, Q, Y), Z is P/Q, Y =\= Z.
> N = 3,
> P = -138732791312937296168,
> Q = 70775453,
> Y = -1960182315087.9346,
> Z = -1960182315087.9343 ? ;
> no
> Mostowski Collapse schrieb am Freitag, 14. Oktober 2022 um 10:41:45 UTC+2:
> > Now turning my attention to (/)/2. SWI-Prolog wants me
> > to use set_prolog_flag(iso, true), to get the semantics
> > of the ISO core standard, page 116.
> >
> > But the fuzzer still finds the needle in the haystack.
> > Using more bits to the numerator, and I find:
> > /* Jekejeke Prolog 1.5.5 */
> > ?- X is -15915286457581575168 / -238455449856.
> > X = 6.674322800000001E7.
> >
> > /* SWI-Prolog 8.5.18 */
> > ?- current_prolog_flag(iso, X).
> > X = true.
> >
> > ?- X is -15915286457581575168 / -238455449856.
> > X = 66743227.99999999.

Re: Request for comments, Novacore the sequel to ISO modules

<tie952$ame0$1@solani.org>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=2700&group=comp.lang.prolog#2700

  copy link   Newsgroups: comp.lang.prolog
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From: janburse@fastmail.fm (Mostowski Collapse)
Newsgroups: comp.lang.prolog
Subject: Re: Request for comments, Novacore the sequel to ISO modules
Date: Sat, 15 Oct 2022 14:30:26 +0200
Message-ID: <tie952$ame0$1@solani.org>
References: <db8a6771-3e54-485b-b391-310658dd6f52n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 15 Oct 2022 12:30:26 -0000 (UTC)
Injection-Info: solani.org;
logging-data="350656"; mail-complaints-to="abuse@news.solani.org"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101
Firefox/68.0 SeaMonkey/2.53.14
Cancel-Lock: sha1:sPB3BD02tFpEw+KBBVizpWfaLKs=
X-User-ID: eJwFwQkBACAIA8BKvFPqwKR/BO/SoZgTSERubsAvEY4ezWH1655uY5X6kZS3YqbOgb57jbI81WK0KRN+VhoVgg==
In-Reply-To: <db8a6771-3e54-485b-b391-310658dd6f52n@googlegroups.com>
 by: Mostowski Collapse - Sat, 15 Oct 2022 12:30 UTC

Next challenge, how to keep my comparison matrice
small. There are so many JavaScript platforms, nodeJS,
browsers, and WTF they differ:

/* Chrome Windows Nok */
?- X is 1889**29.
X = 1.0250068783051206E95.

/* FireFox Windows Ok */
?- X is 1889**29.
X = 1.0250068783051207E95.

Re: Request for comments, Novacore the sequel to ISO modules

<74ce10e6-d711-44cb-9767-4c5f6ce45117n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=2711&group=comp.lang.prolog#2711

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:ac8:5b51:0:b0:39a:ea24:2c6 with SMTP id n17-20020ac85b51000000b0039aea2402c6mr6862244qtw.490.1666190556489;
Wed, 19 Oct 2022 07:42:36 -0700 (PDT)
X-Received: by 2002:a05:6870:c146:b0:131:6110:a456 with SMTP id
g6-20020a056870c14600b001316110a456mr21610810oad.136.1666190556207; Wed, 19
Oct 2022 07:42:36 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Wed, 19 Oct 2022 07:42:35 -0700 (PDT)
In-Reply-To: <tie952$ame0$1@solani.org>
Injection-Info: google-groups.googlegroups.com; posting-host=80.218.40.218; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 80.218.40.218
References: <db8a6771-3e54-485b-b391-310658dd6f52n@googlegroups.com> <tie952$ame0$1@solani.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <74ce10e6-d711-44cb-9767-4c5f6ce45117n@googlegroups.com>
Subject: Re: Request for comments, Novacore the sequel to ISO modules
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Wed, 19 Oct 2022 14:42:36 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 1944
 by: Mostowski Collapse - Wed, 19 Oct 2022 14:42 UTC

Whats the Novacore bigint versus float mantra? The difference
between the two notions “less precise and more speed” versus
“more precise and less speed” can be maybe capture as follows:

- Less Precise and More Speed: Even if the arguments are bigint, and
have potentially more than 52 bit mantissa, they are always first
converted to float. So that the operation is only performed with 52
bit arguments, allow for faster processing.

- More Precise and Less Speed: If the arguments are bigint or if
the arguments are rational numbers or arbitrary floats, all bits are
taken into account. So that the operation is performed with more bits
than only 52 bits, resulting in slower processing.

Re: Request for comments, Novacore the sequel to ISO modules

<46035b13-cf74-4242-98cb-6ffa622511b4n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=2712&group=comp.lang.prolog#2712

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:6214:1c85:b0:4af:7393:3d91 with SMTP id ib5-20020a0562141c8500b004af73933d91mr6953751qvb.74.1666191023387;
Wed, 19 Oct 2022 07:50:23 -0700 (PDT)
X-Received: by 2002:a05:6871:68b:b0:132:9af1:62fb with SMTP id
l11-20020a056871068b00b001329af162fbmr21774020oao.23.1666191023044; Wed, 19
Oct 2022 07:50:23 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Wed, 19 Oct 2022 07:50:22 -0700 (PDT)
In-Reply-To: <74ce10e6-d711-44cb-9767-4c5f6ce45117n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=80.218.40.218; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 80.218.40.218
References: <db8a6771-3e54-485b-b391-310658dd6f52n@googlegroups.com>
<tie952$ame0$1@solani.org> <74ce10e6-d711-44cb-9767-4c5f6ce45117n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <46035b13-cf74-4242-98cb-6ffa622511b4n@googlegroups.com>
Subject: Re: Request for comments, Novacore the sequel to ISO modules
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Wed, 19 Oct 2022 14:50:23 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2600
 by: Mostowski Collapse - Wed, 19 Oct 2022 14:50 UTC

Theoretically in the intersection, when the arguments are already
52 bit mantissa, there should be no difference in speed and also
no difference in accuracy, except if the second mode is

also required to return more bits. So we also have for the
first mode the result is **always** required to be only a float.
Then there is mostlikely always a speed difference, and the

first mode is always faster and less accurate.

Mostowski Collapse schrieb am Mittwoch, 19. Oktober 2022 um 16:42:37 UTC+2:
> Whats the Novacore bigint versus float mantra? The difference
> between the two notions “less precise and more speed” versus
> “more precise and less speed” can be maybe capture as follows:
>
> - Less Precise and More Speed: Even if the arguments are bigint, and
> have potentially more than 52 bit mantissa, they are always first
> converted to float. So that the operation is only performed with 52
> bit arguments, allow for faster processing.
>
> - More Precise and Less Speed: If the arguments are bigint or if
> the arguments are rational numbers or arbitrary floats, all bits are
> taken into account. So that the operation is performed with more bits
> than only 52 bits, resulting in slower processing.

Re: Request for comments, Novacore the sequel to ISO modules

<1cb5210f-5f27-4c03-8d05-8e43a03f9ff7n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=2713&group=comp.lang.prolog#2713

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:622a:11c9:b0:39c:dce3:280b with SMTP id n9-20020a05622a11c900b0039cdce3280bmr6656485qtk.376.1666191104899;
Wed, 19 Oct 2022 07:51:44 -0700 (PDT)
X-Received: by 2002:a05:6808:148f:b0:354:b8c5:495d with SMTP id
e15-20020a056808148f00b00354b8c5495dmr19080729oiw.108.1666191104687; Wed, 19
Oct 2022 07:51:44 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Wed, 19 Oct 2022 07:51:44 -0700 (PDT)
In-Reply-To: <74ce10e6-d711-44cb-9767-4c5f6ce45117n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=80.218.40.218; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 80.218.40.218
References: <db8a6771-3e54-485b-b391-310658dd6f52n@googlegroups.com>
<tie952$ame0$1@solani.org> <74ce10e6-d711-44cb-9767-4c5f6ce45117n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <1cb5210f-5f27-4c03-8d05-8e43a03f9ff7n@googlegroups.com>
Subject: Re: Request for comments, Novacore the sequel to ISO modules
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Wed, 19 Oct 2022 14:51:44 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 3036
 by: Mostowski Collapse - Wed, 19 Oct 2022 14:51 UTC

Ok did some performance measurement. Basically used this harness.
Was reusing the test data, that was used for accuracy testing, so its
based on the same cases.p file:

% swi_perf
swi_perf :-
write('case, swi: '), time((between(1,20000,_),
case(_, X, Y), Y =\= float(X), fail; true)),
write('case2, swi: '), time((between(1,20000,_),
case2(_, X, Y), Y =\= float(X), fail; true)),
write('case3, swi: '), time((between(1,20000,_),
case3(_, X, Y), Y =\= float(X), fail; true)),
write('case4, swi: '), time((between(1,20000,_),
case4(_, P, Q, Y), Y =\= P/Q, fail; true)),
write('case5, swi: '), time((between(1,20000,_),
case5(_, P, Q, Y), Y =\= P/Q, fail; true)),
write('case6, swi: '), time((between(1,20000,_),
case6(_, P, Q, Y), Y =\= P**Q, fail; true)).

Mostowski Collapse schrieb am Mittwoch, 19. Oktober 2022 um 16:42:37 UTC+2:
> Whats the Novacore bigint versus float mantra? The difference
> between the two notions “less precise and more speed” versus
> “more precise and less speed” can be maybe capture as follows:
>
> - Less Precise and More Speed: Even if the arguments are bigint, and
> have potentially more than 52 bit mantissa, they are always first
> converted to float. So that the operation is only performed with 52
> bit arguments, allow for faster processing.
>
> - More Precise and Less Speed: If the arguments are bigint or if
> the arguments are rational numbers or arbitrary floats, all bits are
> taken into account. So that the operation is performed with more bits
> than only 52 bits, resulting in slower processing.

Re: Request for comments, Novacore the sequel to ISO modules

<799d38ba-4849-4d0a-b751-826bce048b48n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=2714&group=comp.lang.prolog#2714

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:620a:271f:b0:6d4:56aa:4385 with SMTP id b31-20020a05620a271f00b006d456aa4385mr5796071qkp.175.1666191160996;
Wed, 19 Oct 2022 07:52:40 -0700 (PDT)
X-Received: by 2002:a05:6808:308c:b0:354:99ec:bbb7 with SMTP id
bl12-20020a056808308c00b0035499ecbbb7mr4450822oib.68.1666191160790; Wed, 19
Oct 2022 07:52:40 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Wed, 19 Oct 2022 07:52:40 -0700 (PDT)
In-Reply-To: <1cb5210f-5f27-4c03-8d05-8e43a03f9ff7n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=80.218.40.218; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 80.218.40.218
References: <db8a6771-3e54-485b-b391-310658dd6f52n@googlegroups.com>
<tie952$ame0$1@solani.org> <74ce10e6-d711-44cb-9767-4c5f6ce45117n@googlegroups.com>
<1cb5210f-5f27-4c03-8d05-8e43a03f9ff7n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <799d38ba-4849-4d0a-b751-826bce048b48n@googlegroups.com>
Subject: Re: Request for comments, Novacore the sequel to ISO modules
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Wed, 19 Oct 2022 14:52:40 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 3771
 by: Mostowski Collapse - Wed, 19 Oct 2022 14:52 UTC

Woa! My Jekejeke Prolog (was using JDK 1.8) is quite a number cruncher,
on the other hand Dogelog Player (was using nodeJS) is lacking behind.
Inbetween the result of Prolog systems that I tested, results in milliseconds.

System case case2 case3 case4 case5 case6
jekejeke 270 266 255 305 361 539
ciao 344 343 343 386 386 544
eclipse 414 388 396 518 541 939
trealla 553 547 549 569 565 605
swi 989 941 979 528 532 861
scryer 889 857 872 1177 1188 1147
sicstus 1087 1083 1104 1221 1218 1226
dogelog 1171 1163 1171 1241 1300 1330

Mostowski Collapse schrieb am Mittwoch, 19. Oktober 2022 um 16:51:45 UTC+2:
> Ok did some performance measurement. Basically used this harness.
> Was reusing the test data, that was used for accuracy testing, so its
> based on the same cases.p file:
>
> % swi_perf
> swi_perf :-
> write('case, swi: '), time((between(1,20000,_),
> case(_, X, Y), Y =\= float(X), fail; true)),
> write('case2, swi: '), time((between(1,20000,_),
> case2(_, X, Y), Y =\= float(X), fail; true)),
> write('case3, swi: '), time((between(1,20000,_),
> case3(_, X, Y), Y =\= float(X), fail; true)),
> write('case4, swi: '), time((between(1,20000,_),
> case4(_, P, Q, Y), Y =\= P/Q, fail; true)),
> write('case5, swi: '), time((between(1,20000,_),
> case5(_, P, Q, Y), Y =\= P/Q, fail; true)),
> write('case6, swi: '), time((between(1,20000,_),
> case6(_, P, Q, Y), Y =\= P**Q, fail; true)).
> Mostowski Collapse schrieb am Mittwoch, 19. Oktober 2022 um 16:42:37 UTC+2:
> > Whats the Novacore bigint versus float mantra? The difference
> > between the two notions “less precise and more speed” versus
> > “more precise and less speed” can be maybe capture as follows:
> >
> > - Less Precise and More Speed: Even if the arguments are bigint, and
> > have potentially more than 52 bit mantissa, they are always first
> > converted to float. So that the operation is only performed with 52
> > bit arguments, allow for faster processing.
> >
> > - More Precise and Less Speed: If the arguments are bigint or if
> > the arguments are rational numbers or arbitrary floats, all bits are
> > taken into account. So that the operation is performed with more bits
> > than only 52 bits, resulting in slower processing.

Re: Request for comments, Novacore the sequel to ISO modules

<97c037bd-bfe2-42de-847f-4698f7219915n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=2715&group=comp.lang.prolog#2715

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:620a:2909:b0:6ee:6c83:9769 with SMTP id m9-20020a05620a290900b006ee6c839769mr8016523qkp.732.1666230946485;
Wed, 19 Oct 2022 18:55:46 -0700 (PDT)
X-Received: by 2002:a05:6870:d349:b0:136:9a09:572f with SMTP id
h9-20020a056870d34900b001369a09572fmr7414781oag.262.1666230946167; Wed, 19
Oct 2022 18:55:46 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Wed, 19 Oct 2022 18:55:45 -0700 (PDT)
In-Reply-To: <799d38ba-4849-4d0a-b751-826bce048b48n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=80.218.40.218; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 80.218.40.218
References: <db8a6771-3e54-485b-b391-310658dd6f52n@googlegroups.com>
<tie952$ame0$1@solani.org> <74ce10e6-d711-44cb-9767-4c5f6ce45117n@googlegroups.com>
<1cb5210f-5f27-4c03-8d05-8e43a03f9ff7n@googlegroups.com> <799d38ba-4849-4d0a-b751-826bce048b48n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <97c037bd-bfe2-42de-847f-4698f7219915n@googlegroups.com>
Subject: Re: Request for comments, Novacore the sequel to ISO modules
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Thu, 20 Oct 2022 01:55:46 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 4542
 by: Mostowski Collapse - Thu, 20 Oct 2022 01:55 UTC

Code inspection sometimes helps find defects:

/* Jekejeke Prolog Ok */
?- X is (2^53+1)*2^64+1, Y is float(X).
X = 166153499473114502559719956244594689, Y = 1.6615349947311452E35.

/* SWI-Prolog 8.5.20 Ok */
?- X is float(166153499473114502559719956244594689).
X = 1.6615349947311452e+35.

/* Ciao Prolog Nok */
?- X is float(166153499473114502559719956244594689).
X = 1.661534994731145e35 ?

Pitty my fuzzer didn't find it. But I guess I will manually add it.

Mostowski Collapse schrieb am Mittwoch, 19. Oktober 2022 um 16:52:41 UTC+2:
> Woa! My Jekejeke Prolog (was using JDK 1.8) is quite a number cruncher,
> on the other hand Dogelog Player (was using nodeJS) is lacking behind.
> Inbetween the result of Prolog systems that I tested, results in milliseconds.
>
> System case case2 case3 case4 case5 case6
> jekejeke 270 266 255 305 361 539
> ciao 344 343 343 386 386 544
> eclipse 414 388 396 518 541 939
> trealla 553 547 549 569 565 605
> swi 989 941 979 528 532 861
> scryer 889 857 872 1177 1188 1147
> sicstus 1087 1083 1104 1221 1218 1226
> dogelog 1171 1163 1171 1241 1300 1330
> Mostowski Collapse schrieb am Mittwoch, 19. Oktober 2022 um 16:51:45 UTC+2:
> > Ok did some performance measurement. Basically used this harness.
> > Was reusing the test data, that was used for accuracy testing, so its
> > based on the same cases.p file:
> >
> > % swi_perf
> > swi_perf :-
> > write('case, swi: '), time((between(1,20000,_),
> > case(_, X, Y), Y =\= float(X), fail; true)),
> > write('case2, swi: '), time((between(1,20000,_),
> > case2(_, X, Y), Y =\= float(X), fail; true)),
> > write('case3, swi: '), time((between(1,20000,_),
> > case3(_, X, Y), Y =\= float(X), fail; true)),
> > write('case4, swi: '), time((between(1,20000,_),
> > case4(_, P, Q, Y), Y =\= P/Q, fail; true)),
> > write('case5, swi: '), time((between(1,20000,_),
> > case5(_, P, Q, Y), Y =\= P/Q, fail; true)),
> > write('case6, swi: '), time((between(1,20000,_),
> > case6(_, P, Q, Y), Y =\= P**Q, fail; true)).
> > Mostowski Collapse schrieb am Mittwoch, 19. Oktober 2022 um 16:42:37 UTC+2:
> > > Whats the Novacore bigint versus float mantra? The difference
> > > between the two notions “less precise and more speed” versus
> > > “more precise and less speed” can be maybe capture as follows:
> > >
> > > - Less Precise and More Speed: Even if the arguments are bigint, and
> > > have potentially more than 52 bit mantissa, they are always first
> > > converted to float. So that the operation is only performed with 52
> > > bit arguments, allow for faster processing.
> > >
> > > - More Precise and Less Speed: If the arguments are bigint or if
> > > the arguments are rational numbers or arbitrary floats, all bits are
> > > taken into account. So that the operation is performed with more bits
> > > than only 52 bits, resulting in slower processing.

Re: Request for comments, Novacore the sequel to ISO modules

<df7aeaac-d76f-4231-a7d3-85b2c24dc99dn@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=2716&group=comp.lang.prolog#2716

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:ac8:5902:0:b0:39c:e440:6adb with SMTP id 2-20020ac85902000000b0039ce4406adbmr9096223qty.18.1666231117303;
Wed, 19 Oct 2022 18:58:37 -0700 (PDT)
X-Received: by 2002:a05:6870:f2a6:b0:136:6442:4b52 with SMTP id
u38-20020a056870f2a600b0013664424b52mr23885722oap.282.1666231117024; Wed, 19
Oct 2022 18:58:37 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Wed, 19 Oct 2022 18:58:36 -0700 (PDT)
In-Reply-To: <97c037bd-bfe2-42de-847f-4698f7219915n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=80.218.40.218; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 80.218.40.218
References: <db8a6771-3e54-485b-b391-310658dd6f52n@googlegroups.com>
<tie952$ame0$1@solani.org> <74ce10e6-d711-44cb-9767-4c5f6ce45117n@googlegroups.com>
<1cb5210f-5f27-4c03-8d05-8e43a03f9ff7n@googlegroups.com> <799d38ba-4849-4d0a-b751-826bce048b48n@googlegroups.com>
<97c037bd-bfe2-42de-847f-4698f7219915n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <df7aeaac-d76f-4231-a7d3-85b2c24dc99dn@googlegroups.com>
Subject: Re: Request for comments, Novacore the sequel to ISO modules
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Thu, 20 Oct 2022 01:58:37 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 5379
 by: Mostowski Collapse - Thu, 20 Oct 2022 01:58 UTC

Explanation of the defect:

Mostly based on code from Torbjorn Granlund, Johan Andersson,
and Mats Carlsson (Ref: Knuth vol. 2 sec. 4.3.1)

flt64_t bn_to_float(bignum_t *bn) {
while (i > 1) {
f = f*norm2 + u;
https://github.com/ciao -lang/ciao/blob/master/core/engine/eng_bignum.c#L1043

I think a defect could be if HALF_EVEN prematurely
rounds down the value of f, and then later a value of u,
would indicate that this rounding down was not legit,

but float addition cannot help it.

Mostowski Collapse schrieb am Donnerstag, 20. Oktober 2022 um 03:55:47 UTC+2:
> Code inspection sometimes helps find defects:
>
> /* Jekejeke Prolog Ok */
> ?- X is (2^53+1)*2^64+1, Y is float(X).
> X = 166153499473114502559719956244594689, Y = 1.6615349947311452E35.
>
> /* SWI-Prolog 8.5.20 Ok */
> ?- X is float(166153499473114502559719956244594689).
> X = 1.6615349947311452e+35.
>
> /* Ciao Prolog Nok */
> ?- X is float(166153499473114502559719956244594689).
> X = 1.661534994731145e35 ?
>
> Pitty my fuzzer didn't find it. But I guess I will manually add it.
> Mostowski Collapse schrieb am Mittwoch, 19. Oktober 2022 um 16:52:41 UTC+2:
> > Woa! My Jekejeke Prolog (was using JDK 1.8) is quite a number cruncher,
> > on the other hand Dogelog Player (was using nodeJS) is lacking behind.
> > Inbetween the result of Prolog systems that I tested, results in milliseconds.
> >
> > System case case2 case3 case4 case5 case6
> > jekejeke 270 266 255 305 361 539
> > ciao 344 343 343 386 386 544
> > eclipse 414 388 396 518 541 939
> > trealla 553 547 549 569 565 605
> > swi 989 941 979 528 532 861
> > scryer 889 857 872 1177 1188 1147
> > sicstus 1087 1083 1104 1221 1218 1226
> > dogelog 1171 1163 1171 1241 1300 1330
> > Mostowski Collapse schrieb am Mittwoch, 19. Oktober 2022 um 16:51:45 UTC+2:
> > > Ok did some performance measurement. Basically used this harness.
> > > Was reusing the test data, that was used for accuracy testing, so its
> > > based on the same cases.p file:
> > >
> > > % swi_perf
> > > swi_perf :-
> > > write('case, swi: '), time((between(1,20000,_),
> > > case(_, X, Y), Y =\= float(X), fail; true)),
> > > write('case2, swi: '), time((between(1,20000,_),
> > > case2(_, X, Y), Y =\= float(X), fail; true)),
> > > write('case3, swi: '), time((between(1,20000,_),
> > > case3(_, X, Y), Y =\= float(X), fail; true)),
> > > write('case4, swi: '), time((between(1,20000,_),
> > > case4(_, P, Q, Y), Y =\= P/Q, fail; true)),
> > > write('case5, swi: '), time((between(1,20000,_),
> > > case5(_, P, Q, Y), Y =\= P/Q, fail; true)),
> > > write('case6, swi: '), time((between(1,20000,_),
> > > case6(_, P, Q, Y), Y =\= P**Q, fail; true)).
> > > Mostowski Collapse schrieb am Mittwoch, 19. Oktober 2022 um 16:42:37 UTC+2:
> > > > Whats the Novacore bigint versus float mantra? The difference
> > > > between the two notions “less precise and more speed” versus
> > > > “more precise and less speed” can be maybe capture as follows:
> > > >
> > > > - Less Precise and More Speed: Even if the arguments are bigint, and
> > > > have potentially more than 52 bit mantissa, they are always first
> > > > converted to float. So that the operation is only performed with 52
> > > > bit arguments, allow for faster processing.
> > > >
> > > > - More Precise and Less Speed: If the arguments are bigint or if
> > > > the arguments are rational numbers or arbitrary floats, all bits are
> > > > taken into account. So that the operation is performed with more bits
> > > > than only 52 bits, resulting in slower processing.

Re: Request for comments, Novacore the sequel to ISO modules

<6d14e757-37ee-4d49-94fe-fb52f02a3104n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=2717&group=comp.lang.prolog#2717

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:ad4:5ccf:0:b0:4b1:c372:ba79 with SMTP id iu15-20020ad45ccf000000b004b1c372ba79mr9227707qvb.14.1666234008430;
Wed, 19 Oct 2022 19:46:48 -0700 (PDT)
X-Received: by 2002:a05:6870:c146:b0:131:6110:a456 with SMTP id
g6-20020a056870c14600b001316110a456mr23579744oad.136.1666234008230; Wed, 19
Oct 2022 19:46:48 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border-2.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Wed, 19 Oct 2022 19:46:48 -0700 (PDT)
In-Reply-To: <df7aeaac-d76f-4231-a7d3-85b2c24dc99dn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=80.218.40.218; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 80.218.40.218
References: <db8a6771-3e54-485b-b391-310658dd6f52n@googlegroups.com>
<tie952$ame0$1@solani.org> <74ce10e6-d711-44cb-9767-4c5f6ce45117n@googlegroups.com>
<1cb5210f-5f27-4c03-8d05-8e43a03f9ff7n@googlegroups.com> <799d38ba-4849-4d0a-b751-826bce048b48n@googlegroups.com>
<97c037bd-bfe2-42de-847f-4698f7219915n@googlegroups.com> <df7aeaac-d76f-4231-a7d3-85b2c24dc99dn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <6d14e757-37ee-4d49-94fe-fb52f02a3104n@googlegroups.com>
Subject: Re: Request for comments, Novacore the sequel to ISO modules
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Thu, 20 Oct 2022 02:46:48 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 110
 by: Mostowski Collapse - Thu, 20 Oct 2022 02:46 UTC

I added some hand picked test cases, from the
Ciao Prolog blooper, including some negative bigints.
Interestingly other Prolog systems are also pray to the

same blooper. In total I found that 3 Prolog systems have
this blooper, whereas Trealla only for 50%. Here are now
the number of failures from the new test cases:

% case3, trealla: 5
% case3, ciao: 10
% case3, sicstus: 10

Mostowski Collapse schrieb am Donnerstag, 20. Oktober 2022 um 03:58:38 UTC+2:
> Explanation of the defect:
>
> Mostly based on code from Torbjorn Granlund, Johan Andersson,
> and Mats Carlsson (Ref: Knuth vol. 2 sec. 4.3.1)
>
> flt64_t bn_to_float(bignum_t *bn) {
> while (i > 1) {
> f = f*norm2 + u;
> https://github.com/ciao -lang/ciao/blob/master/core/engine/eng_bignum.c#L1043
>
> I think a defect could be if HALF_EVEN prematurely
> rounds down the value of f, and then later a value of u,
> would indicate that this rounding down was not legit,
>
> but float addition cannot help it.
> Mostowski Collapse schrieb am Donnerstag, 20. Oktober 2022 um 03:55:47 UTC+2:
> > Code inspection sometimes helps find defects:
> >
> > /* Jekejeke Prolog Ok */
> > ?- X is (2^53+1)*2^64+1, Y is float(X).
> > X = 166153499473114502559719956244594689, Y = 1.6615349947311452E35..
> >
> > /* SWI-Prolog 8.5.20 Ok */
> > ?- X is float(166153499473114502559719956244594689).
> > X = 1.6615349947311452e+35.
> >
> > /* Ciao Prolog Nok */
> > ?- X is float(166153499473114502559719956244594689).
> > X = 1.661534994731145e35 ?
> >
> > Pitty my fuzzer didn't find it. But I guess I will manually add it.
> > Mostowski Collapse schrieb am Mittwoch, 19. Oktober 2022 um 16:52:41 UTC+2:
> > > Woa! My Jekejeke Prolog (was using JDK 1.8) is quite a number cruncher,
> > > on the other hand Dogelog Player (was using nodeJS) is lacking behind..
> > > Inbetween the result of Prolog systems that I tested, results in milliseconds.
> > >
> > > System case case2 case3 case4 case5 case6
> > > jekejeke 270 266 255 305 361 539
> > > ciao 344 343 343 386 386 544
> > > eclipse 414 388 396 518 541 939
> > > trealla 553 547 549 569 565 605
> > > swi 989 941 979 528 532 861
> > > scryer 889 857 872 1177 1188 1147
> > > sicstus 1087 1083 1104 1221 1218 1226
> > > dogelog 1171 1163 1171 1241 1300 1330
> > > Mostowski Collapse schrieb am Mittwoch, 19. Oktober 2022 um 16:51:45 UTC+2:
> > > > Ok did some performance measurement. Basically used this harness.
> > > > Was reusing the test data, that was used for accuracy testing, so its
> > > > based on the same cases.p file:
> > > >
> > > > % swi_perf
> > > > swi_perf :-
> > > > write('case, swi: '), time((between(1,20000,_),
> > > > case(_, X, Y), Y =\= float(X), fail; true)),
> > > > write('case2, swi: '), time((between(1,20000,_),
> > > > case2(_, X, Y), Y =\= float(X), fail; true)),
> > > > write('case3, swi: '), time((between(1,20000,_),
> > > > case3(_, X, Y), Y =\= float(X), fail; true)),
> > > > write('case4, swi: '), time((between(1,20000,_),
> > > > case4(_, P, Q, Y), Y =\= P/Q, fail; true)),
> > > > write('case5, swi: '), time((between(1,20000,_),
> > > > case5(_, P, Q, Y), Y =\= P/Q, fail; true)),
> > > > write('case6, swi: '), time((between(1,20000,_),
> > > > case6(_, P, Q, Y), Y =\= P**Q, fail; true)).
> > > > Mostowski Collapse schrieb am Mittwoch, 19. Oktober 2022 um 16:42:37 UTC+2:
> > > > > Whats the Novacore bigint versus float mantra? The difference
> > > > > between the two notions “less precise and more speed” versus
> > > > > “more precise and less speed” can be maybe capture as follows:
> > > > >
> > > > > - Less Precise and More Speed: Even if the arguments are bigint, and
> > > > > have potentially more than 52 bit mantissa, they are always first
> > > > > converted to float. So that the operation is only performed with 52
> > > > > bit arguments, allow for faster processing.
> > > > >
> > > > > - More Precise and Less Speed: If the arguments are bigint or if
> > > > > the arguments are rational numbers or arbitrary floats, all bits are
> > > > > taken into account. So that the operation is performed with more bits
> > > > > than only 52 bits, resulting in slower processing.

Re: Request for comments, Novacore the sequel to ISO modules

<cacb5abd-5ea4-4d15-90b1-2b49bd99148dn@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=2722&group=comp.lang.prolog#2722

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:620a:28cd:b0:6cf:93b3:a78 with SMTP id l13-20020a05620a28cd00b006cf93b30a78mr26807913qkp.11.1666702559888;
Tue, 25 Oct 2022 05:55:59 -0700 (PDT)
X-Received: by 2002:a05:6870:562a:b0:13b:e58a:4ac1 with SMTP id
m42-20020a056870562a00b0013be58a4ac1mr2435233oao.196.1666702559462; Tue, 25
Oct 2022 05:55:59 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Tue, 25 Oct 2022 05:55:59 -0700 (PDT)
In-Reply-To: <6d14e757-37ee-4d49-94fe-fb52f02a3104n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=80.218.40.218; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 80.218.40.218
References: <db8a6771-3e54-485b-b391-310658dd6f52n@googlegroups.com>
<tie952$ame0$1@solani.org> <74ce10e6-d711-44cb-9767-4c5f6ce45117n@googlegroups.com>
<1cb5210f-5f27-4c03-8d05-8e43a03f9ff7n@googlegroups.com> <799d38ba-4849-4d0a-b751-826bce048b48n@googlegroups.com>
<97c037bd-bfe2-42de-847f-4698f7219915n@googlegroups.com> <df7aeaac-d76f-4231-a7d3-85b2c24dc99dn@googlegroups.com>
<6d14e757-37ee-4d49-94fe-fb52f02a3104n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <cacb5abd-5ea4-4d15-90b1-2b49bd99148dn@googlegroups.com>
Subject: Re: Request for comments, Novacore the sequel to ISO modules
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Tue, 25 Oct 2022 12:55:59 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2090
 by: Mostowski Collapse - Tue, 25 Oct 2022 12:55 UTC

Woa! My testing campaign has not yet ended. Now I
found a test case, where the Unix platform also fails.
Was increasing the bits in the case6/3 fuzzer:

pow2(B, E, X) :- E < 0, integer(E), !, X is 1/(B^(-E)).
pow2(B, E, X) :- X is B^E.

?- current_prolog_flag(iso, X).
X = false.

/* SWI-Prolog 8.5.20 WLS2 Nok */
?- repeat, L is -(1<<15), H is (1<<15)+1,
M is -(1<<3), J is (1<<3)+1, random(L, H, P),
random(M, J, Q), pow2(P, Q, A), B is P**Q, A=\=B.
P = -18573,
Q = -7,
A = -1.3116730299820406e-30,
B = -1.3116730299820408e-30 .

Re: Request for comments, Novacore the sequel to ISO modules

<9e03edc7-d3e6-4c1a-8ae8-a034ccbd3bdan@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=2723&group=comp.lang.prolog#2723

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:ac8:7c44:0:b0:39c:cbe1:2787 with SMTP id o4-20020ac87c44000000b0039ccbe12787mr31660619qtv.214.1666702751077;
Tue, 25 Oct 2022 05:59:11 -0700 (PDT)
X-Received: by 2002:aca:4303:0:b0:354:cbc8:d269 with SMTP id
q3-20020aca4303000000b00354cbc8d269mr18483659oia.115.1666702750803; Tue, 25
Oct 2022 05:59:10 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Tue, 25 Oct 2022 05:59:10 -0700 (PDT)
In-Reply-To: <cacb5abd-5ea4-4d15-90b1-2b49bd99148dn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=80.218.40.218; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 80.218.40.218
References: <db8a6771-3e54-485b-b391-310658dd6f52n@googlegroups.com>
<tie952$ame0$1@solani.org> <74ce10e6-d711-44cb-9767-4c5f6ce45117n@googlegroups.com>
<1cb5210f-5f27-4c03-8d05-8e43a03f9ff7n@googlegroups.com> <799d38ba-4849-4d0a-b751-826bce048b48n@googlegroups.com>
<97c037bd-bfe2-42de-847f-4698f7219915n@googlegroups.com> <df7aeaac-d76f-4231-a7d3-85b2c24dc99dn@googlegroups.com>
<6d14e757-37ee-4d49-94fe-fb52f02a3104n@googlegroups.com> <cacb5abd-5ea4-4d15-90b1-2b49bd99148dn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <9e03edc7-d3e6-4c1a-8ae8-a034ccbd3bdan@googlegroups.com>
Subject: Re: Request for comments, Novacore the sequel to ISO modules
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Tue, 25 Oct 2022 12:59:11 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2974
 by: Mostowski Collapse - Tue, 25 Oct 2022 12:59 UTC

I have SWIPL on Unix platform only since weekend,
could not do this testing beforehand, so I guess I
need to update case6/3 test cases,

because they showed Unix platform completely
passing, which seems to be wrong. I used in the old
fuzzer 12 bits + 6 bits, the above uses 15 bits + 3 bits,

and new nasty test cases pop up. Its a test case where
JDK 19 non-strict also fails. Cool! I couldn’t believe that
it is that good. It was too good to be true.

So its also not that good!

/* Jekejeke Prolog 1.5.5, JDK 19 non-strict Nok */
?- X is -18573** -7.
X = -1.3116730299820408E-30.

Mostowski Collapse schrieb am Dienstag, 25. Oktober 2022 um 14:56:11 UTC+2:
> Woa! My testing campaign has not yet ended. Now I
> found a test case, where the Unix platform also fails.
> Was increasing the bits in the case6/3 fuzzer:
>
> pow2(B, E, X) :- E < 0, integer(E), !, X is 1/(B^(-E)).
> pow2(B, E, X) :- X is B^E.
>
> ?- current_prolog_flag(iso, X).
> X = false.
>
> /* SWI-Prolog 8.5.20 WLS2 Nok */
> ?- repeat, L is -(1<<15), H is (1<<15)+1,
> M is -(1<<3), J is (1<<3)+1, random(L, H, P),
> random(M, J, Q), pow2(P, Q, A), B is P**Q, A=\=B.
> P = -18573,
> Q = -7,
> A = -1.3116730299820406e-30,
> B = -1.3116730299820408e-30 .

Re: Request for comments, Novacore the sequel to ISO modules

<fbfc0989-0bb3-4978-837a-8dc1e0302401n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=2724&group=comp.lang.prolog#2724

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:ac8:5acf:0:b0:39c:d4d8:3f75 with SMTP id d15-20020ac85acf000000b0039cd4d83f75mr32084140qtd.579.1666712205773;
Tue, 25 Oct 2022 08:36:45 -0700 (PDT)
X-Received: by 2002:a05:6870:8306:b0:13c:c80:6cbd with SMTP id
p6-20020a056870830600b0013c0c806cbdmr113141oae.68.1666712205469; Tue, 25 Oct
2022 08:36:45 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Tue, 25 Oct 2022 08:36:45 -0700 (PDT)
In-Reply-To: <9e03edc7-d3e6-4c1a-8ae8-a034ccbd3bdan@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=80.218.40.218; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 80.218.40.218
References: <db8a6771-3e54-485b-b391-310658dd6f52n@googlegroups.com>
<tie952$ame0$1@solani.org> <74ce10e6-d711-44cb-9767-4c5f6ce45117n@googlegroups.com>
<1cb5210f-5f27-4c03-8d05-8e43a03f9ff7n@googlegroups.com> <799d38ba-4849-4d0a-b751-826bce048b48n@googlegroups.com>
<97c037bd-bfe2-42de-847f-4698f7219915n@googlegroups.com> <df7aeaac-d76f-4231-a7d3-85b2c24dc99dn@googlegroups.com>
<6d14e757-37ee-4d49-94fe-fb52f02a3104n@googlegroups.com> <cacb5abd-5ea4-4d15-90b1-2b49bd99148dn@googlegroups.com>
<9e03edc7-d3e6-4c1a-8ae8-a034ccbd3bdan@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <fbfc0989-0bb3-4978-837a-8dc1e0302401n@googlegroups.com>
Subject: Re: Request for comments, Novacore the sequel to ISO modules
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Tue, 25 Oct 2022 15:36:45 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 3493
 by: Mostowski Collapse - Tue, 25 Oct 2022 15:36 UTC

Nope the JDK 19 is correct here. Bug in long division?

/* SWI-Prolog 8.5.20 WSL2 */
?- current_prolog_flag(iso, X).
X = false.

?- X is 1/(18573^7).
X = 1.3116730299820406e-30.

?- X is float(1 rdiv (18573^7)).
X = 1.3116730299820408e-30.

the Mostowski Collapse schrieb am Dienstag, 25. Oktober 2022 um 14:59:11 UTC+2:
> I have SWIPL on Unix platform only since weekend,
> could not do this testing beforehand, so I guess I
> need to update case6/3 test cases,
>
> because they showed Unix platform completely
> passing, which seems to be wrong. I used in the old
> fuzzer 12 bits + 6 bits, the above uses 15 bits + 3 bits,
>
> and new nasty test cases pop up. Its a test case where
> JDK 19 non-strict also fails. Cool! I couldn’t believe that
> it is that good. It was too good to be true.
>
> So its also not that good!
>
> /* Jekejeke Prolog 1.5.5, JDK 19 non-strict Nok */
> ?- X is -18573** -7.
> X = -1.3116730299820408E-30.
> Mostowski Collapse schrieb am Dienstag, 25. Oktober 2022 um 14:56:11 UTC+2:
> > Woa! My testing campaign has not yet ended. Now I
> > found a test case, where the Unix platform also fails.
> > Was increasing the bits in the case6/3 fuzzer:
> >
> > pow2(B, E, X) :- E < 0, integer(E), !, X is 1/(B^(-E)).
> > pow2(B, E, X) :- X is B^E.
> >
> > ?- current_prolog_flag(iso, X).
> > X = false.
> >
> > /* SWI-Prolog 8.5.20 WLS2 Nok */
> > ?- repeat, L is -(1<<15), H is (1<<15)+1,
> > M is -(1<<3), J is (1<<3)+1, random(L, H, P),
> > random(M, J, Q), pow2(P, Q, A), B is P**Q, A=\=B.
> > P = -18573,
> > Q = -7,
> > A = -1.3116730299820406e-30,
> > B = -1.3116730299820408e-30 .

Re: Request for comments, Novacore the sequel to ISO modules

<dded5a94-a85d-4647-9081-8f7ddc353aa5n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=2726&group=comp.lang.prolog#2726

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:6214:1c4d:b0:4b1:7a21:e26f with SMTP id if13-20020a0562141c4d00b004b17a21e26fmr32998694qvb.81.1666720399589;
Tue, 25 Oct 2022 10:53:19 -0700 (PDT)
X-Received: by 2002:a05:6871:58a:b0:13b:6698:6da9 with SMTP id
u10-20020a056871058a00b0013b66986da9mr10147902oan.23.1666720399299; Tue, 25
Oct 2022 10:53:19 -0700 (PDT)
Path: i2pn2.org!i2pn.org!news.niel.me!glou.org!news.glou.org!usenet-fr.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Tue, 25 Oct 2022 10:53:19 -0700 (PDT)
In-Reply-To: <fbfc0989-0bb3-4978-837a-8dc1e0302401n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=80.218.40.218; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 80.218.40.218
References: <db8a6771-3e54-485b-b391-310658dd6f52n@googlegroups.com>
<tie952$ame0$1@solani.org> <74ce10e6-d711-44cb-9767-4c5f6ce45117n@googlegroups.com>
<1cb5210f-5f27-4c03-8d05-8e43a03f9ff7n@googlegroups.com> <799d38ba-4849-4d0a-b751-826bce048b48n@googlegroups.com>
<97c037bd-bfe2-42de-847f-4698f7219915n@googlegroups.com> <df7aeaac-d76f-4231-a7d3-85b2c24dc99dn@googlegroups.com>
<6d14e757-37ee-4d49-94fe-fb52f02a3104n@googlegroups.com> <cacb5abd-5ea4-4d15-90b1-2b49bd99148dn@googlegroups.com>
<9e03edc7-d3e6-4c1a-8ae8-a034ccbd3bdan@googlegroups.com> <fbfc0989-0bb3-4978-837a-8dc1e0302401n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <dded5a94-a85d-4647-9081-8f7ddc353aa5n@googlegroups.com>
Subject: Re: Request for comments, Novacore the sequel to ISO modules
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Tue, 25 Oct 2022 17:53:19 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Mostowski Collapse - Tue, 25 Oct 2022 17:53 UTC

Enhanced test cases, new viewpoint. Now WASM is
the more accurate platform, both for SWI and Ciao.
JDK 19 is still ultra accurate. But I cant say that it

is always correctly rounded. For non-integer arguments
I found a faulty example for (**)/2, but the below test
cases only test integer arguments of (**)/2:

System (=:=)/2 (/)/2 (**)/2 Total Variant
jekejeke 0 0 0 0 JDK 19
dogelog 0 0 2 2 PyPy
swi 0 0 4 4 WASM
sicstus 10 0 2 12 Windows
trealla 5 0 11 16 WSL2
ciao 10 0 10 20 WASM
scryer 33 46 11 90 WSL2
eclipse 33 45 68 146 Windows

Mostowski Collapse schrieb am Dienstag, 25. Oktober 2022 um 17:36:46 UTC+2:
> Nope the JDK 19 is correct here. Bug in long division?
>
> /* SWI-Prolog 8.5.20 WSL2 */
> ?- current_prolog_flag(iso, X).
> X = false.
> ?- X is 1/(18573^7).
> X = 1.3116730299820406e-30.
>
> ?- X is float(1 rdiv (18573^7)).
> X = 1.3116730299820408e-30.
> the Mostowski Collapse schrieb am Dienstag, 25. Oktober 2022 um 14:59:11 UTC+2:
> > I have SWIPL on Unix platform only since weekend,
> > could not do this testing beforehand, so I guess I
> > need to update case6/3 test cases,
> >
> > because they showed Unix platform completely
> > passing, which seems to be wrong. I used in the old
> > fuzzer 12 bits + 6 bits, the above uses 15 bits + 3 bits,
> >
> > and new nasty test cases pop up. Its a test case where
> > JDK 19 non-strict also fails. Cool! I couldn’t believe that
> > it is that good. It was too good to be true.
> >
> > So its also not that good!
> >
> > /* Jekejeke Prolog 1.5.5, JDK 19 non-strict Nok */
> > ?- X is -18573** -7.
> > X = -1.3116730299820408E-30.
> > Mostowski Collapse schrieb am Dienstag, 25. Oktober 2022 um 14:56:11 UTC+2:
> > > Woa! My testing campaign has not yet ended. Now I
> > > found a test case, where the Unix platform also fails.
> > > Was increasing the bits in the case6/3 fuzzer:
> > >
> > > pow2(B, E, X) :- E < 0, integer(E), !, X is 1/(B^(-E)).
> > > pow2(B, E, X) :- X is B^E.
> > >
> > > ?- current_prolog_flag(iso, X).
> > > X = false.
> > >
> > > /* SWI-Prolog 8.5.20 WLS2 Nok */
> > > ?- repeat, L is -(1<<15), H is (1<<15)+1,
> > > M is -(1<<3), J is (1<<3)+1, random(L, H, P),
> > > random(M, J, Q), pow2(P, Q, A), B is P**Q, A=\=B.
> > > P = -18573,
> > > Q = -7,
> > > A = -1.3116730299820406e-30,
> > > B = -1.3116730299820408e-30 .

Re: Request for comments, Novacore the sequel to ISO modules

<3485b2a1-1d18-4533-96e0-ef99141ccd5dn@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=2728&group=comp.lang.prolog#2728

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a0c:9a4e:0:b0:4b1:d537:c6b9 with SMTP id q14-20020a0c9a4e000000b004b1d537c6b9mr36619946qvd.3.1666792860898;
Wed, 26 Oct 2022 07:01:00 -0700 (PDT)
X-Received: by 2002:a05:6870:63aa:b0:13a:fe6c:5ed0 with SMTP id
t42-20020a05687063aa00b0013afe6c5ed0mr2340468oap.257.1666792860560; Wed, 26
Oct 2022 07:01:00 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Wed, 26 Oct 2022 07:01:00 -0700 (PDT)
In-Reply-To: <dded5a94-a85d-4647-9081-8f7ddc353aa5n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=80.218.40.218; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 80.218.40.218
References: <db8a6771-3e54-485b-b391-310658dd6f52n@googlegroups.com>
<tie952$ame0$1@solani.org> <74ce10e6-d711-44cb-9767-4c5f6ce45117n@googlegroups.com>
<1cb5210f-5f27-4c03-8d05-8e43a03f9ff7n@googlegroups.com> <799d38ba-4849-4d0a-b751-826bce048b48n@googlegroups.com>
<97c037bd-bfe2-42de-847f-4698f7219915n@googlegroups.com> <df7aeaac-d76f-4231-a7d3-85b2c24dc99dn@googlegroups.com>
<6d14e757-37ee-4d49-94fe-fb52f02a3104n@googlegroups.com> <cacb5abd-5ea4-4d15-90b1-2b49bd99148dn@googlegroups.com>
<9e03edc7-d3e6-4c1a-8ae8-a034ccbd3bdan@googlegroups.com> <fbfc0989-0bb3-4978-837a-8dc1e0302401n@googlegroups.com>
<dded5a94-a85d-4647-9081-8f7ddc353aa5n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <3485b2a1-1d18-4533-96e0-ef99141ccd5dn@googlegroups.com>
Subject: Re: Request for comments, Novacore the sequel to ISO modules
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Wed, 26 Oct 2022 14:01:00 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2812
 by: Mostowski Collapse - Wed, 26 Oct 2022 14:01 UTC

Here is a trick to force Python compatibility mode, I guess
works for SWI-Prolog 8.5.20 which has improved rational
number rounding? Thats the incorrectly rounded result:

/* incorrectly rounded of the real number quotient */
?- X is 1267650600228229401496703205376 /
762385119722780192080867194597.
X = 1.662743103759914.
Now do switch on Python compatibility mode, and
watch the result getting correctly rounded:

/* Use this combo for Python compatibility:
prefer_rationals=true,
max_rational_size=0,
max_rational_size_action=float */
?- set_prolog_flag(prefer_rationals, true).
true.

?- set_prolog_flag(max_rational_size, 0).
true.

?- set_prolog_flag(max_rational_size_action, float).
true.

/* Correctly rounded of the real number quotient, via
detour over rational numbers, which are correctly
rounded since release 8.5.20 of SWI-Prolog? */
?- X is 1267650600228229401496703205376 /
762385119722780192080867194597.
X = 1.6627431037599143.


devel / comp.lang.prolog / Re: Request for comments, Novacore the sequel to ISO modules

Pages:123
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor