Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

Think of it! With VLSI we can pack 100 ENIACs in 1 sq. cm.!


devel / comp.lang.prolog / Re: 50 Years of Prolog Nonsense

SubjectAuthor
* 50 Years of Prolog NonsenseMostowski Collapse
`* 50 Years of Prolog NonsenseMostowski Collapse
 `* 50 Years of Prolog NonsenseMostowski Collapse
  `* 50 Years of Prolog NonsenseMostowski Collapse
   `* 50 Years of Prolog NonsenseMostowski Collapse
    +* 50 Years of Prolog NonsenseMostowski Collapse
    |`- 50 Years of Prolog NonsenseMostowski Collapse
    +* 50 Years of Prolog NonsenseMostowski Collapse
    |`- 50 Years of Prolog NonsenseMostowski Collapse
    `- 50 Years of Prolog NonsenseMostowski Collapse

1
Re: 50 Years of Prolog Nonsense

<tgq9jr$3jvn$1@solani.org>

  copy mid

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

  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: 50 Years of Prolog Nonsense
Date: Sun, 25 Sep 2022 21:19:23 +0200
Message-ID: <tgq9jr$3jvn$1@solani.org>
References: <db903ba2-8ccd-418e-bd18-a9eb381cd222n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 25 Sep 2022 19:19:23 -0000 (UTC)
Injection-Info: solani.org;
logging-data="118775"; 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.13
Cancel-Lock: sha1:2Nx15E7eZmbzkRcj/fNL9k4KhiA=
In-Reply-To: <db903ba2-8ccd-418e-bd18-a9eb381cd222n@googlegroups.com>
X-User-ID: eJwFwQkBwDAIA0BL5UkAObQM/xJ2B6PwhRN0LJYJfQhrBZFZEkHXd7ecX9y2kRxSR4XHGUdzs21vTbFVfhu+FC4=
 by: Mostowski Collapse - Sun, 25 Sep 2022 19:19 UTC

One more question. Do SWI-Prolog have a smallint
fast path for A/B, or does it always detour over
some kind of mpq_get_d_nearest?

The advantage of float(A)/float(B) is, it is already
a smallint fastpath for A and B smallint. That
is a smallint fastpath, seen that this has count C=0:

?- between(1,1000000,N), (33*33*N)/33
=\= float(33*N).

Some results concerning timing:

/* SWI-Prolog 8.5.17, Windows */
% 2,000,003 inferences, 0.297 CPU in 0.290 seconds (102% CPU, 6736852 Lips)

/* SWI-Prolog 8.4.2, Unix WSL2 */
% 2,000,003 inferences, 0.337 CPU in 0.337 seconds (100% CPU, 5929587 Lips)

/* Jekejeke Prolog 1.5.4, JDK 19 */
% Threads 297 ms, GC 3 ms, Up 290 ms (Current 09/25/22 18:38:00)

/* Jekejeke Prolog 1.5.4, JDK 1.8 */
% Threads 188 ms, GC 2 ms, Up 186 ms (Current 09/25/22 18:39:33)

Re: 50 Years of Prolog Nonsense

<tgq9n9$3jvn$2@solani.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
Path: i2pn2.org!i2pn.org!aioe.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: 50 Years of Prolog Nonsense
Date: Sun, 25 Sep 2022 21:21:13 +0200
Message-ID: <tgq9n9$3jvn$2@solani.org>
References: <db903ba2-8ccd-418e-bd18-a9eb381cd222n@googlegroups.com>
<tgq9jr$3jvn$1@solani.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 25 Sep 2022 19:21:13 -0000 (UTC)
Injection-Info: solani.org;
logging-data="118775"; 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.13
Cancel-Lock: sha1:mXjQL0EKelX0tU+vRbxpRa14pbQ=
In-Reply-To: <tgq9jr$3jvn$1@solani.org>
X-User-ID: eJwFwYEBACAEBMCVwuONU8r+I3TnFhKdCA/4+OSSsWU4KZWXfZsT+irP8KVCEhu7o20R0DcsupfWQbEDHzzHFJ0=
 by: Mostowski Collapse - Sun, 25 Sep 2022 19:21 UTC

Smalint fastpath results for (/)/2 and for other Prolog
systems, only the timing, otherwise they all agree C=0:

/* Trealla Prolog 2.2.6 */
% Time elapsed 0.151s

/* ECLiPSe Prolog 7.0.61 */
% Yes (0.75s cpu)

/* Ciao Playground 1.21.0 */
% Wall time 784.0 ms

/* Scryer Prolog 0.9.0 */
% CPU time: 1.314s

The only good result is by Trealla Prolog.

Mostowski Collapse schrieb:
> One more question. Do SWI-Prolog have a smallint
> fast path for A/B, or does it always detour over
> some kind of mpq_get_d_nearest?
>
> The advantage of float(A)/float(B) is, it is already
> a smallint fastpath for A and B smallint. That
> is a smallint fastpath, seen that this has count C=0:
>
> ?- between(1,1000000,N), (33*33*N)/33
> =\= float(33*N).
>
> Some results concerning timing:
>
> /* SWI-Prolog 8.5.17, Windows */
> % 2,000,003 inferences, 0.297 CPU in 0.290 seconds (102% CPU, 6736852 Lips)
>
> /* SWI-Prolog 8.4.2, Unix WSL2 */
> % 2,000,003 inferences, 0.337 CPU in 0.337 seconds (100% CPU, 5929587 Lips)
>
> /* Jekejeke Prolog 1.5.4, JDK 19 */
> % Threads 297 ms, GC 3 ms, Up 290 ms (Current 09/25/22 18:38:00)
>
> /* Jekejeke Prolog 1.5.4, JDK 1.8 */
> % Threads 188 ms, GC 2 ms, Up 186 ms (Current 09/25/22 18:39:33)

Re: 50 Years of Prolog Nonsense

<a838c2e4-c0dd-4297-9eec-f96418aab309n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:620a:17a8:b0:6ce:99f0:7626 with SMTP id ay40-20020a05620a17a800b006ce99f07626mr18696201qkb.194.1664298682498;
Tue, 27 Sep 2022 10:11:22 -0700 (PDT)
X-Received: by 2002:a05:6870:3398:b0:113:7f43:d0e9 with SMTP id
w24-20020a056870339800b001137f43d0e9mr2799739oae.33.1664298682239; Tue, 27
Sep 2022 10:11:22 -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, 27 Sep 2022 10:11:21 -0700 (PDT)
In-Reply-To: <tgq9n9$3jvn$2@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: <db903ba2-8ccd-418e-bd18-a9eb381cd222n@googlegroups.com>
<tgq9jr$3jvn$1@solani.org> <tgq9n9$3jvn$2@solani.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <a838c2e4-c0dd-4297-9eec-f96418aab309n@googlegroups.com>
Subject: Re: 50 Years of Prolog Nonsense
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Tue, 27 Sep 2022 17:11:22 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1791
 by: Mostowski Collapse - Tue, 27 Sep 2022 17:11 UTC

Here is a 100% pure Prolog implementation of HALF_EVEN, without
any materialization, it assumes that the current float/1 does only mpz_get_d:

float_half_even(X,Y) :-
(getbit(X, msb(X)-53) =:= 0;
getbit(X, msb(X)-52) =:= 0, msb(X)-53 =:= lsb(X)), !, Y is float(X).
float_half_even(X,Y) :-
Y is nexttoward(float(X), 1E300).

Was using 1E300 for infinity, is there something else that would work?
float_half_even/2 is just a translation of the following into Prolog:

public double doubleValue() {
https://hg.openjdk.java.net/jdk8/jdk8/jdk/file/tip/src/share/classes/java/math/BigInteger.java#l3871

Re: 50 Years of Prolog Nonsense

<tgvb0b$68gl$1@solani.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
Path: i2pn2.org!i2pn.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: 50 Years of Prolog Nonsense
Date: Tue, 27 Sep 2022 19:13:49 +0200
Message-ID: <tgvb0b$68gl$1@solani.org>
References: <db903ba2-8ccd-418e-bd18-a9eb381cd222n@googlegroups.com>
<tgq9jr$3jvn$1@solani.org> <tgq9n9$3jvn$2@solani.org>
<a838c2e4-c0dd-4297-9eec-f96418aab309n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 27 Sep 2022 17:13:47 -0000 (UTC)
Injection-Info: solani.org;
logging-data="205333"; 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:vpbKh74HLuQK44VHWbaB5Vs/zLg=
In-Reply-To: <a838c2e4-c0dd-4297-9eec-f96418aab309n@googlegroups.com>
X-User-ID: eJwNx0kBwDAIBEBLXEtADiHgX0I7v4E6ex9zuGGxJ/ORDvWShN1HgTr1/jBKrkbRBMSSUli8FcXbrEY9s8kfN40UvA==
 by: Mostowski Collapse - Tue, 27 Sep 2022 17:13 UTC

Here some test whether it agrees with BigInteger.
doubleValue(), first testing the old version of
SWI-Prolog, where float is mpz_get_d:

/* SWI-Prolog 8.5.17 */
?- between(1,10,N), X is 10^20+N*2^13,
float_half_even(X,Y), write(Y), nl, fail; true.
1.0e+20
1.0000000000000002e+20
1.0000000000000003e+20
1.0000000000000003e+20
1.0000000000000003e+20
1.0000000000000005e+20
1.0000000000000007e+20
1.0000000000000007e+20
1.0000000000000007e+20
1.0000000000000008e+20

Comparing with a Prolog system that calls
BigInteger.doubleValue():

/* Jekejeke Prolog 1.5.4 */
?- between(1,10,N), X is 10^20+N*2^13,
Y is float(X), write(Y), nl, fail; true.
1.0E20
1.0000000000000002E20
1.0000000000000003E20
1.0000000000000003E20
1.0000000000000003E20
1.0000000000000005E20
1.0000000000000007E20
1.0000000000000007E20
1.0000000000000007E20
1.0000000000000008E20

Yeah, they agree! Riddle solved, the misterious
veil of the secret souce behind an ultrafast
float/1 for bigint has been lifted.

Mostowski Collapse wrote:
> Here is a 100% pure Prolog implementation of HALF_EVEN, without
> any materialization, it assumes that the current float/1 does only mpz_get_d:
>
> float_half_even(X,Y) :-
> (getbit(X, msb(X)-53) =:= 0;
> getbit(X, msb(X)-52) =:= 0, msb(X)-53 =:= lsb(X)), !, Y is float(X).
> float_half_even(X,Y) :-
> Y is nexttoward(float(X), 1E300).
>
> Was using 1E300 for infinity, is there something else that would work?
> float_half_even/2 is just a translation of the following into Prolog:
>
> public double doubleValue() {
> https://hg.openjdk.java.net/jdk8/jdk8/jdk/file/tip/src/share/classes/java/math/BigInteger.java#l3871
>

Re: 50 Years of Prolog Nonsense

<0aa4b385-4fcd-4624-a888-32619eb2c8e1n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:ad4:5caa:0:b0:4af:9655:5214 with SMTP id q10-20020ad45caa000000b004af96555214mr2770631qvh.122.1664361201320;
Wed, 28 Sep 2022 03:33:21 -0700 (PDT)
X-Received: by 2002:a9d:24c4:0:b0:658:c487:e9a3 with SMTP id
z62-20020a9d24c4000000b00658c487e9a3mr14172443ota.38.1664361201044; Wed, 28
Sep 2022 03:33:21 -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, 28 Sep 2022 03:33:20 -0700 (PDT)
In-Reply-To: <tgvb0b$68gl$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: <db903ba2-8ccd-418e-bd18-a9eb381cd222n@googlegroups.com>
<tgq9jr$3jvn$1@solani.org> <tgq9n9$3jvn$2@solani.org> <a838c2e4-c0dd-4297-9eec-f96418aab309n@googlegroups.com>
<tgvb0b$68gl$1@solani.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <0aa4b385-4fcd-4624-a888-32619eb2c8e1n@googlegroups.com>
Subject: Re: 50 Years of Prolog Nonsense
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Wed, 28 Sep 2022 10:33:21 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1483
 by: Mostowski Collapse - Wed, 28 Sep 2022 10:33 UTC

Quite some disagreement concerning (**)/2:

/* Ciao Playground 1.21.0 */
?- Z is 51**10.
Z = 119042423827613000.0 ?

/* ECLiPSe Prolog 7.0.61 */
?- X is 51**10.
X = 1.1904242382761301e+17

Guess which one corresponds to HALF_EVEN ?

Re: 50 Years of Prolog Nonsense

<4f47fb19-4cf2-4891-b611-ba63ccc02bbcn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:ac8:7d10:0:b0:35c:d519:545 with SMTP id g16-20020ac87d10000000b0035cd5190545mr25593624qtb.537.1664361283599;
Wed, 28 Sep 2022 03:34:43 -0700 (PDT)
X-Received: by 2002:a05:6871:783:b0:12d:4b84:352d with SMTP id
o3-20020a056871078300b0012d4b84352dmr4822818oap.179.1664361283308; Wed, 28
Sep 2022 03:34:43 -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, 28 Sep 2022 03:34:43 -0700 (PDT)
In-Reply-To: <0aa4b385-4fcd-4624-a888-32619eb2c8e1n@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: <db903ba2-8ccd-418e-bd18-a9eb381cd222n@googlegroups.com>
<tgq9jr$3jvn$1@solani.org> <tgq9n9$3jvn$2@solani.org> <a838c2e4-c0dd-4297-9eec-f96418aab309n@googlegroups.com>
<tgvb0b$68gl$1@solani.org> <0aa4b385-4fcd-4624-a888-32619eb2c8e1n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <4f47fb19-4cf2-4891-b611-ba63ccc02bbcn@googlegroups.com>
Subject: Re: 50 Years of Prolog Nonsense
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Wed, 28 Sep 2022 10:34:43 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2084
 by: Mostowski Collapse - Wed, 28 Sep 2022 10:34 UTC

Whats also funny when a Prolog system disagrees internally:

/* SWI-Prolog 8.5.17, Windows 10 */
?- X is 51^10, Z is float(X), Y is nexttoward(Z, 1E300).
X = 119042423827613001,
Z = 1.1904242382761301e+17,
Y = 1.1904242382761302e+17.

?- Z is float(51^10), Y is nexttoward(Z, 1E300).
Z = 1.19042423827613e+17,
Y = 1.1904242382761301e+17.

The above "bug" makes it hard for me to test float_half_even/2.

Mostowski Collapse schrieb am Mittwoch, 28. September 2022 um 12:33:22 UTC+2:
> Quite some disagreement concerning (**)/2:
> /* Ciao Playground 1.21.0 */
> ?- Z is 51**10.
> Z = 119042423827613000.0 ?
> /* ECLiPSe Prolog 7.0.61 */
> ?- X is 51**10.
> X = 1.1904242382761301e+17
>
> Guess which one corresponds to HALF_EVEN ?

Re: 50 Years of Prolog Nonsense

<fdab5060-0438-433d-b827-98f1239a7477n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:6214:c29:b0:4aa:b050:5ed7 with SMTP id a9-20020a0562140c2900b004aab0505ed7mr24812018qvd.15.1664361443748;
Wed, 28 Sep 2022 03:37:23 -0700 (PDT)
X-Received: by 2002:a05:6808:30a0:b0:34f:656c:1909 with SMTP id
bl32-20020a05680830a000b0034f656c1909mr3850565oib.115.1664361443494; Wed, 28
Sep 2022 03:37:23 -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, 28 Sep 2022 03:37:23 -0700 (PDT)
In-Reply-To: <4f47fb19-4cf2-4891-b611-ba63ccc02bbcn@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: <db903ba2-8ccd-418e-bd18-a9eb381cd222n@googlegroups.com>
<tgq9jr$3jvn$1@solani.org> <tgq9n9$3jvn$2@solani.org> <a838c2e4-c0dd-4297-9eec-f96418aab309n@googlegroups.com>
<tgvb0b$68gl$1@solani.org> <0aa4b385-4fcd-4624-a888-32619eb2c8e1n@googlegroups.com>
<4f47fb19-4cf2-4891-b611-ba63ccc02bbcn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <fdab5060-0438-433d-b827-98f1239a7477n@googlegroups.com>
Subject: Re: 50 Years of Prolog Nonsense
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Wed, 28 Sep 2022 10:37:23 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3146
 by: Mostowski Collapse - Wed, 28 Sep 2022 10:37 UTC

If I do nothing, I cannot make mistakes. Could be
the motto that Ciao Prolog doesn't support (^)/2
as an evaluable predicate.

But among those Prolog systems that take the
risk (clap clap!!) and support (^)/2 the situation
is a little immature, I find:

Scryer Prolog and Trealla Prolog, they both do wrong
float/1 rounding (1.19042423827613e+17
instead 1.1904242382761301E17):

/* Scryer Prolog 0.9.0 */
?- X is 51^10, Z is float(X).
X = 119042423827613001, Z = 1.19042423827613e17.
?- Z is float(51^10).
Z = 1.19042423827613e17.

But Trealla Prolog has a problem with (^)/2, wrong
result of bigint pow() (i.e. 119042423827613008 instead
119042423827613001):

/* Trealla Prolog 2.2.10 */
?- X is 51^10, Z is float(X).
X = 119042423827613008, Z = 1.19042423827613e+17.
?- Z is float(51^10).
Z = 1.19042423827613e+17.

Mostowski Collapse schrieb am Mittwoch, 28. September 2022 um 12:34:44 UTC+2:
> Whats also funny when a Prolog system disagrees internally:
>
> /* SWI-Prolog 8.5.17, Windows 10 */
> ?- X is 51^10, Z is float(X), Y is nexttoward(Z, 1E300).
> X = 119042423827613001,
> Z = 1.1904242382761301e+17,
> Y = 1.1904242382761302e+17.
>
> ?- Z is float(51^10), Y is nexttoward(Z, 1E300).
> Z = 1.19042423827613e+17,
> Y = 1.1904242382761301e+17.
>
> The above "bug" makes it hard for me to test float_half_even/2.
> Mostowski Collapse schrieb am Mittwoch, 28. September 2022 um 12:33:22 UTC+2:
> > Quite some disagreement concerning (**)/2:
> > /* Ciao Playground 1.21.0 */
> > ?- Z is 51**10.
> > Z = 119042423827613000.0 ?
> > /* ECLiPSe Prolog 7.0.61 */
> > ?- X is 51**10.
> > X = 1.1904242382761301e+17
> >
> > Guess which one corresponds to HALF_EVEN ?

Re: 50 Years of Prolog Nonsense

<f934efb4-69f4-4c27-8b33-0d0b4c31d97dn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:622a:1441:b0:35c:da34:d5dc with SMTP id v1-20020a05622a144100b0035cda34d5dcmr26660915qtx.338.1664362589743;
Wed, 28 Sep 2022 03:56:29 -0700 (PDT)
X-Received: by 2002:a05:6871:201:b0:10d:ef43:a205 with SMTP id
t1-20020a056871020100b0010def43a205mr4773161oad.115.1664362588644; Wed, 28
Sep 2022 03:56:28 -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, 28 Sep 2022 03:56:28 -0700 (PDT)
In-Reply-To: <0aa4b385-4fcd-4624-a888-32619eb2c8e1n@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: <db903ba2-8ccd-418e-bd18-a9eb381cd222n@googlegroups.com>
<tgq9jr$3jvn$1@solani.org> <tgq9n9$3jvn$2@solani.org> <a838c2e4-c0dd-4297-9eec-f96418aab309n@googlegroups.com>
<tgvb0b$68gl$1@solani.org> <0aa4b385-4fcd-4624-a888-32619eb2c8e1n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <f934efb4-69f4-4c27-8b33-0d0b4c31d97dn@googlegroups.com>
Subject: Re: 50 Years of Prolog Nonsense
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Wed, 28 Sep 2022 10:56:29 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2142
 by: Mostowski Collapse - Wed, 28 Sep 2022 10:56 UTC

To judge that ECLiPSe Prolog is correct, one
needs to think in binary representation. We find,
using a precise float to bigint conversion:

?- X is integer(1.1904242382761301E17).
X = 119042423827613008.

?- X is integer(1.19042423827613E17).
X = 119042423827612992.

Now which one is closer?

?- X is 119042423827613001-119042423827613008.
X = -7.

?- X is 119042423827613001-119042423827612992.
X = 9.

So 1.1904242382761301E17 is the correct float.

Mostowski Collapse schrieb am Mittwoch, 28. September 2022 um 12:33:22 UTC+2:
> Quite some disagreement concerning (**)/2:
> /* Ciao Playground 1.21.0 */
> ?- Z is 51**10.
> Z = 119042423827613000.0 ?
> /* ECLiPSe Prolog 7.0.61 */
> ?- X is 51**10.
> X = 1.1904242382761301e+17
>
> Guess which one corresponds to HALF_EVEN ?

Re: 50 Years of Prolog Nonsense

<e4880877-e92a-4945-9ebd-9be5c9628baan@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:ac8:5851:0:b0:35b:ab32:3bbe with SMTP id h17-20020ac85851000000b0035bab323bbemr27076418qth.175.1664366502065;
Wed, 28 Sep 2022 05:01:42 -0700 (PDT)
X-Received: by 2002:a05:6808:1a29:b0:34f:face:c73c with SMTP id
bk41-20020a0568081a2900b0034ffacec73cmr4322100oib.122.1664366501283; Wed, 28
Sep 2022 05:01: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: Wed, 28 Sep 2022 05:01:41 -0700 (PDT)
In-Reply-To: <f934efb4-69f4-4c27-8b33-0d0b4c31d97dn@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: <db903ba2-8ccd-418e-bd18-a9eb381cd222n@googlegroups.com>
<tgq9jr$3jvn$1@solani.org> <tgq9n9$3jvn$2@solani.org> <a838c2e4-c0dd-4297-9eec-f96418aab309n@googlegroups.com>
<tgvb0b$68gl$1@solani.org> <0aa4b385-4fcd-4624-a888-32619eb2c8e1n@googlegroups.com>
<f934efb4-69f4-4c27-8b33-0d0b4c31d97dn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <e4880877-e92a-4945-9ebd-9be5c9628baan@googlegroups.com>
Subject: Re: 50 Years of Prolog Nonsense
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Wed, 28 Sep 2022 12:01:42 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2906
 by: Mostowski Collapse - Wed, 28 Sep 2022 12:01 UTC

Be careful, integer/1 isn't in the ISO core standard, thats
my take in one system to make it a precise conversion from
float to bigint. Maybe not reproducable in other Prolog systems.

It works also in Dogelog player:

/* Dogelog Player, JavaScript */
?- X is integer(1.1904242382761301E17).
X = 119042423827613008.
?- X is integer(1.19042423827613E17).
X = 119042423827612992.

/* Dogelog Player, Python */
?- X is integer(1.1904242382761301E17).
X = 119042423827613008.
?- X is integer(1.19042423827613E17).
X = 119042423827612992.

Mostowski Collapse schrieb am Mittwoch, 28. September 2022 um 12:56:30 UTC+2:
> To judge that ECLiPSe Prolog is correct, one
> needs to think in binary representation. We find,
> using a precise float to bigint conversion:
>
> ?- X is integer(1.1904242382761301E17).
> X = 119042423827613008.
>
> ?- X is integer(1.19042423827613E17).
> X = 119042423827612992.
>
> Now which one is closer?
>
> ?- X is 119042423827613001-119042423827613008.
> X = -7.
>
> ?- X is 119042423827613001-119042423827612992.
> X = 9.
>
> So 1.1904242382761301E17 is the correct float.
> Mostowski Collapse schrieb am Mittwoch, 28. September 2022 um 12:33:22 UTC+2:
> > Quite some disagreement concerning (**)/2:
> > /* Ciao Playground 1.21.0 */
> > ?- Z is 51**10.
> > Z = 119042423827613000.0 ?
> > /* ECLiPSe Prolog 7.0.61 */
> > ?- X is 51**10.
> > X = 1.1904242382761301e+17
> >
> > Guess which one corresponds to HALF_EVEN ?

Re: 50 Years of Prolog Nonsense

<d50b1ba9-2937-48ac-a14f-bf8923a0553dn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:620a:b88:b0:6ce:ec98:e7f8 with SMTP id k8-20020a05620a0b8800b006ceec98e7f8mr22025669qkh.338.1664372667679;
Wed, 28 Sep 2022 06:44:27 -0700 (PDT)
X-Received: by 2002:a05:6830:1e4c:b0:659:eca3:2c70 with SMTP id
e12-20020a0568301e4c00b00659eca32c70mr14451589otj.210.1664372667414; Wed, 28
Sep 2022 06:44:27 -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, 28 Sep 2022 06:44:27 -0700 (PDT)
In-Reply-To: <0aa4b385-4fcd-4624-a888-32619eb2c8e1n@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: <db903ba2-8ccd-418e-bd18-a9eb381cd222n@googlegroups.com>
<tgq9jr$3jvn$1@solani.org> <tgq9n9$3jvn$2@solani.org> <a838c2e4-c0dd-4297-9eec-f96418aab309n@googlegroups.com>
<tgvb0b$68gl$1@solani.org> <0aa4b385-4fcd-4624-a888-32619eb2c8e1n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <d50b1ba9-2937-48ac-a14f-bf8923a0553dn@googlegroups.com>
Subject: Re: 50 Years of Prolog Nonsense
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Wed, 28 Sep 2022 13:44:27 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2417
 by: Mostowski Collapse - Wed, 28 Sep 2022 13:44 UTC

Warning, possibly this ticket can be closed. Its not necessarily
a display problem. For example many Math.pow(double,double)
implementations cannot do the problem correctly.

They cannot or do not round to the theoretical optimum, they
have inherently a higher error than only one Unit in the last place (ULP).
So a certain error is to expect. You see this here:

/* Dogelog Player, JavaScript */
?- X is 51**10.
X = 1.19042423827613E17.

?- X is float(51^10).
X = 119042423827613010.0.

In the above the (**)/2 is Math.pow(double,double) and the
(^)/2 is exact bigint exponentiation. I took the pair (51,10)
from a list of pairs where (**)/2 and (^)/2 often disagree

based on Math.pow(double,double) typically being weak.

Mostowski Collapse schrieb am Mittwoch, 28. September 2022 um 12:33:22 UTC+2:
> Quite some disagreement concerning (**)/2:
> /* Ciao Playground 1.21.0 */
> ?- Z is 51**10.
> Z = 119042423827613000.0 ?
> /* ECLiPSe Prolog 7.0.61 */
> ?- X is 51**10.
> X = 1.1904242382761301e+17
>
> Guess which one corresponds to HALF_EVEN ?

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor