Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

Before Xerox, five carbons were the maximum extension of anybody's ego.


devel / comp.lang.prolog / 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

<a5dd3385-1b15-4405-b8cd-0b14ea733ec3n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:ac8:434b:0:b0:3d1:2d3:6656 with SMTP id a11-20020ac8434b000000b003d102d36656mr2523898qtn.8.1679144120829;
Sat, 18 Mar 2023 05:55:20 -0700 (PDT)
X-Received: by 2002:ac8:5dd1:0:b0:3d4:63fa:3db4 with SMTP id
e17-20020ac85dd1000000b003d463fa3db4mr2319807qtx.5.1679144120559; Sat, 18 Mar
2023 05:55:20 -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: Sat, 18 Mar 2023 05:55:20 -0700 (PDT)
In-Reply-To: <db8a6771-3e54-485b-b391-310658dd6f52n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.53.44; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.53.44
References: <db8a6771-3e54-485b-b391-310658dd6f52n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <a5dd3385-1b15-4405-b8cd-0b14ea733ec3n@googlegroups.com>
Subject: Re: Request for comments, Novacore the sequel to ISO modules
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Sat, 18 Mar 2023 12:55:20 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Mostowski Collapse - Sat, 18 Mar 2023 12:55 UTC

Inside Novacore we could reinvent Prolog Dicts. JavaScript
has a primitive data type for Symbols, so you can call
Symbol.for(“key”), which will internalize the string, so that

you can use pointer equality on the result:

> Symbol is a built-in object whose constructor returns a symbol primitive
> https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol

It wouldn’t match JSON usage, since the keys are not supposed
to be Symbols, only Strings. But maybe this is only superficially,
and internally they are Symbols. One could do the same for

Novacore Prolog Dicts. On the surface Novacore Prolog
Dicts would use Strings:

?- X = {"abc" : 123.45, "def": 67}.
But under the hood there would be a transition from String to Atom:

?- X = {"abc" : 123.45, "def": 67}, X =.. L.
L = [C'novacore_dict, abc, 123.45, def, 67]

The rational would be: The keys usually form a limited vocabulary.

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

<aecea3c0-4eec-41c0-a62a-d9ea4a2b53ban@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:ac8:4599:0:b0:3d6:7a8:bc58 with SMTP id l25-20020ac84599000000b003d607a8bc58mr2529001qtn.13.1679144182675;
Sat, 18 Mar 2023 05:56:22 -0700 (PDT)
X-Received: by 2002:a05:6214:9a1:b0:56b:ee5a:89f0 with SMTP id
du1-20020a05621409a100b0056bee5a89f0mr5976850qvb.7.1679144182436; Sat, 18 Mar
2023 05:56:22 -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: Sat, 18 Mar 2023 05:56:22 -0700 (PDT)
In-Reply-To: <a5dd3385-1b15-4405-b8cd-0b14ea733ec3n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.53.44; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.53.44
References: <db8a6771-3e54-485b-b391-310658dd6f52n@googlegroups.com> <a5dd3385-1b15-4405-b8cd-0b14ea733ec3n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <aecea3c0-4eec-41c0-a62a-d9ea4a2b53ban@googlegroups.com>
Subject: Re: Request for comments, Novacore the sequel to ISO modules
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Sat, 18 Mar 2023 12:56:22 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Mostowski Collapse - Sat, 18 Mar 2023 12:56 UTC

Interestingly with the above trick, a Prolog parser can
recognize Novacore Prolog Dicts. Since it would see this
production at the head of a Novacore Prolog Dict:

novacore_dict :== "{" string ":" term ... "}"

Which is unlike the ISO core definition of “{}”, since in
ISO core there are no strings, and even a qualified call in
ISO module assumes that we have atom “:” term. So

there would be no collision with this production:

set :== "{" term "}"

Mostowski Collapse schrieb am Samstag, 18. März 2023 um 13:55:21 UTC+1:
> Inside Novacore we could reinvent Prolog Dicts. JavaScript
> has a primitive data type for Symbols, so you can call
> Symbol.for(“key”), which will internalize the string, so that
>
> you can use pointer equality on the result:
>
> > Symbol is a built-in object whose constructor returns a symbol primitive
> > https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol
>
> It wouldn’t match JSON usage, since the keys are not supposed
> to be Symbols, only Strings. But maybe this is only superficially,
> and internally they are Symbols. One could do the same for
>
> Novacore Prolog Dicts. On the surface Novacore Prolog
> Dicts would use Strings:
>
> ?- X = {"abc" : 123.45, "def": 67}.
> But under the hood there would be a transition from String to Atom:
>
> ?- X = {"abc" : 123.45, "def": 67}, X =.. L.
> L = [C'novacore_dict, abc, 123.45, def, 67]
>
> The rational would be: The keys usually form a limited vocabulary.

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

<2cc7ddbd-2f65-4703-a701-da22b769a8abn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:6214:14f0:b0:5b0:c989:d1d8 with SMTP id k16-20020a05621414f000b005b0c989d1d8mr2782912qvw.10.1679144494536;
Sat, 18 Mar 2023 06:01:34 -0700 (PDT)
X-Received: by 2002:a05:620a:13ea:b0:745:7098:a7b4 with SMTP id
h10-20020a05620a13ea00b007457098a7b4mr6199890qkl.9.1679144494262; Sat, 18 Mar
2023 06:01:34 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!peer03.ams1!peer.ams1.xlned.com!news.xlned.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: Sat, 18 Mar 2023 06:01:33 -0700 (PDT)
In-Reply-To: <aecea3c0-4eec-41c0-a62a-d9ea4a2b53ban@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.53.44; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.53.44
References: <db8a6771-3e54-485b-b391-310658dd6f52n@googlegroups.com>
<a5dd3385-1b15-4405-b8cd-0b14ea733ec3n@googlegroups.com> <aecea3c0-4eec-41c0-a62a-d9ea4a2b53ban@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <2cc7ddbd-2f65-4703-a701-da22b769a8abn@googlegroups.com>
Subject: Re: Request for comments, Novacore the sequel to ISO modules
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Sat, 18 Mar 2023 13:01:34 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 3719
 by: Mostowski Collapse - Sat, 18 Mar 2023 13:01 UTC

Currently I get an error when I use string keys:

/* SWI-Prolog 9.1.4 */
?- current_prolog_flag(double_quotes, X).
X = string.

?- X = _{"abc": 123.46, "def": 67}.
ERROR: Syntax error: key_expected
Also there is the annoying need for an underscore functor.

With string keys I could directly embed JSON?
In this case null, false and true could be easily an atom.
Thats kind of solving the constant problem from another angle.

Mostowski Collapse schrieb am Samstag, 18. März 2023 um 13:56:23 UTC+1:
> Interestingly with the above trick, a Prolog parser can
> recognize Novacore Prolog Dicts. Since it would see this
> production at the head of a Novacore Prolog Dict:
>
> novacore_dict :== "{" string ":" term ... "}"
>
> Which is unlike the ISO core definition of “{}”, since in
> ISO core there are no strings, and even a qualified call in
> ISO module assumes that we have atom “:” term. So
>
> there would be no collision with this production:
>
> set :== "{" term "}"
> Mostowski Collapse schrieb am Samstag, 18. März 2023 um 13:55:21 UTC+1:
> > Inside Novacore we could reinvent Prolog Dicts. JavaScript
> > has a primitive data type for Symbols, so you can call
> > Symbol.for(“key”), which will internalize the string, so that
> >
> > you can use pointer equality on the result:
> >
> > > Symbol is a built-in object whose constructor returns a symbol primitive
> > > https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol
> >
> > It wouldn’t match JSON usage, since the keys are not supposed
> > to be Symbols, only Strings. But maybe this is only superficially,
> > and internally they are Symbols. One could do the same for
> >
> > Novacore Prolog Dicts. On the surface Novacore Prolog
> > Dicts would use Strings:
> >
> > ?- X = {"abc" : 123.45, "def": 67}.
> > But under the hood there would be a transition from String to Atom:
> >
> > ?- X = {"abc" : 123.45, "def": 67}, X =.. L.
> > L = [C'novacore_dict, abc, 123.45, def, 67]
> >
> > The rational would be: The keys usually form a limited vocabulary.

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

<682b88b8-98ff-40c3-9eed-308a494ba0d9n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:6214:9a1:b0:56e:9089:a447 with SMTP id du1-20020a05621409a100b0056e9089a447mr5956253qvb.0.1679144795532;
Sat, 18 Mar 2023 06:06:35 -0700 (PDT)
X-Received: by 2002:ae9:f819:0:b0:746:b32:a43d with SMTP id
x25-20020ae9f819000000b007460b32a43dmr2631280qkh.11.1679144794839; Sat, 18
Mar 2023 06:06:34 -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: Sat, 18 Mar 2023 06:06:34 -0700 (PDT)
In-Reply-To: <2cc7ddbd-2f65-4703-a701-da22b769a8abn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.53.44; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.53.44
References: <db8a6771-3e54-485b-b391-310658dd6f52n@googlegroups.com>
<a5dd3385-1b15-4405-b8cd-0b14ea733ec3n@googlegroups.com> <aecea3c0-4eec-41c0-a62a-d9ea4a2b53ban@googlegroups.com>
<2cc7ddbd-2f65-4703-a701-da22b769a8abn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <682b88b8-98ff-40c3-9eed-308a494ba0d9n@googlegroups.com>
Subject: Re: Request for comments, Novacore the sequel to ISO modules
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Sat, 18 Mar 2023 13:06:35 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 4134
 by: Mostowski Collapse - Sat, 18 Mar 2023 13:06 UTC

But this other angle would only work inside JSON.
There is still a problem with ordinary Prolog code, and
for example the disabled setter. If we want to avoid some

bottle neck of translating structures back and forth.

Mostowski Collapse schrieb am Samstag, 18. März 2023 um 14:01:35 UTC+1:
> Currently I get an error when I use string keys:
>
> /* SWI-Prolog 9.1.4 */
> ?- current_prolog_flag(double_quotes, X).
> X = string.
>
> ?- X = _{"abc": 123.46, "def": 67}.
> ERROR: Syntax error: key_expected
> Also there is the annoying need for an underscore functor.
>
> With string keys I could directly embed JSON?
> In this case null, false and true could be easily an atom.
> Thats kind of solving the constant problem from another angle.
> Mostowski Collapse schrieb am Samstag, 18. März 2023 um 13:56:23 UTC+1:
> > Interestingly with the above trick, a Prolog parser can
> > recognize Novacore Prolog Dicts. Since it would see this
> > production at the head of a Novacore Prolog Dict:
> >
> > novacore_dict :== "{" string ":" term ... "}"
> >
> > Which is unlike the ISO core definition of “{}”, since in
> > ISO core there are no strings, and even a qualified call in
> > ISO module assumes that we have atom “:” term. So
> >
> > there would be no collision with this production:
> >
> > set :== "{" term "}"
> > Mostowski Collapse schrieb am Samstag, 18. März 2023 um 13:55:21 UTC+1:
> > > Inside Novacore we could reinvent Prolog Dicts. JavaScript
> > > has a primitive data type for Symbols, so you can call
> > > Symbol.for(“key”), which will internalize the string, so that
> > >
> > > you can use pointer equality on the result:
> > >
> > > > Symbol is a built-in object whose constructor returns a symbol primitive
> > > > https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol
> > >
> > > It wouldn’t match JSON usage, since the keys are not supposed
> > > to be Symbols, only Strings. But maybe this is only superficially,
> > > and internally they are Symbols. One could do the same for
> > >
> > > Novacore Prolog Dicts. On the surface Novacore Prolog
> > > Dicts would use Strings:
> > >
> > > ?- X = {"abc" : 123.45, "def": 67}.
> > > But under the hood there would be a transition from String to Atom:
> > >
> > > ?- X = {"abc" : 123.45, "def": 67}, X =.. L.
> > > L = [C'novacore_dict, abc, 123.45, def, 67]
> > >
> > > The rational would be: The keys usually form a limited vocabulary.

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

<47c1a406-0a80-4f55-89d5-9e1c62c3c0c3n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:620a:3715:b0:746:9016:1eb0 with SMTP id de21-20020a05620a371500b0074690161eb0mr9111580qkb.2.1683984963780;
Sat, 13 May 2023 06:36:03 -0700 (PDT)
X-Received: by 2002:a25:d18a:0:b0:ba7:29a9:a471 with SMTP id
i132-20020a25d18a000000b00ba729a9a471mr2514456ybg.0.1683984963404; Sat, 13
May 2023 06:36:03 -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: Sat, 13 May 2023 06:36:03 -0700 (PDT)
In-Reply-To: <db8a6771-3e54-485b-b391-310658dd6f52n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.53.44; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.53.44
References: <db8a6771-3e54-485b-b391-310658dd6f52n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <47c1a406-0a80-4f55-89d5-9e1c62c3c0c3n@googlegroups.com>
Subject: Re: Request for comments, Novacore the sequel to ISO modules
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Sat, 13 May 2023 13:36:03 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 26
 by: Mostowski Collapse - Sat, 13 May 2023 13:36 UTC

Now I have already removed the following predicates from
Novacore, they landed in library(compat):

- numbervars/2
- subsumes/2
- subsumes_term/2

Now wonder where variant/2 would land? SWI-Prolog wants to tell me
that variant/2 might need library(compat), because of numbervars/2.
Assuming A and B have already distinct variables I get the following solution:

A =@= B :-
\+ \+ (numbervars(Ac, 0, N),
numbervars(Bc, 0, N),
Ac == Bc).
https://www.swi-prolog.org/pldoc/doc_for?object=%28%3D@%3D%29/2

On the other hand this solution gives me also a library(compat)
dependency, since its based on subsumes_term/2. Again assuming A and
B have already distinct variables I get the following solution:

A =@= B :-
subsumes_term(A, B),
subsumes_term(B, A).
https://www.complang.tuwien.ac.at/ulrich/iso-prolog/built-in_predicates

Isn't there something simpler?

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

<15c0b31a-b1fe-4d42-93a0-04a4d71d35aan@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:620a:1a11:b0:759:3687:e259 with SMTP id bk17-20020a05620a1a1100b007593687e259mr302066qkb.13.1683985269878;
Sat, 13 May 2023 06:41:09 -0700 (PDT)
X-Received: by 2002:a81:a9ca:0:b0:55d:d860:7247 with SMTP id
g193-20020a81a9ca000000b0055dd8607247mr14471219ywh.1.1683985269611; Sat, 13
May 2023 06:41:09 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.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: Sat, 13 May 2023 06:41:09 -0700 (PDT)
In-Reply-To: <47c1a406-0a80-4f55-89d5-9e1c62c3c0c3n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.53.44; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.53.44
References: <db8a6771-3e54-485b-b391-310658dd6f52n@googlegroups.com> <47c1a406-0a80-4f55-89d5-9e1c62c3c0c3n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <15c0b31a-b1fe-4d42-93a0-04a4d71d35aan@googlegroups.com>
Subject: Re: Request for comments, Novacore the sequel to ISO modules
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Sat, 13 May 2023 13:41:09 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2551
 by: Mostowski Collapse - Sat, 13 May 2023 13:41 UTC

This is cute, has quite some different dependencies,
inspired by the use of term_variables/3 in bagof/3,
again assuming that A and B have already disjoint variables:

A =@= B :-
term_variables(A, L),
term_variables(B, R),
\+ \+ (L=R, A==B).

Can be bootstrapped from a much smaler Novacore.

Mostowski Collapse schrieb am Samstag, 13. Mai 2023 um 15:36:04 UTC+2:
> Now I have already removed the following predicates from
> Novacore, they landed in library(compat):
>
> - numbervars/2
> - subsumes/2
> - subsumes_term/2
>
> Now wonder where variant/2 would land? SWI-Prolog wants to tell me
> that variant/2 might need library(compat), because of numbervars/2.
> Assuming A and B have already distinct variables I get the following solution:
>
> A =@= B :-
> \+ \+ (numbervars(A, 0, N),
> numbervars(B, 0, N),
> A == B).
> https://www.swi-prolog.org/pldoc/doc_for?object=%28%3D@%3D%29/2
>
> On the other hand this solution gives me also a library(compat)
> dependency, since its based on subsumes_term/2. Again assuming A and
> B have already distinct variables I get the following solution:
>
> A =@= B :-
> subsumes_term(A, B),
> subsumes_term(B, A).
> https://www.complang.tuwien.ac.at/ulrich/iso-prolog/built-in_predicates
>
> Isn't there something simpler?

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

<aa869ef6-7f90-405b-a84a-2c11ac7979a3n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:ac8:5a55:0:b0:3f5:e8f:47b2 with SMTP id o21-20020ac85a55000000b003f50e8f47b2mr2485582qta.11.1684666481695;
Sun, 21 May 2023 03:54:41 -0700 (PDT)
X-Received: by 2002:a25:aaad:0:b0:ba8:93c3:331a with SMTP id
t42-20020a25aaad000000b00ba893c3331amr4547599ybi.5.1684666481479; Sun, 21 May
2023 03:54:41 -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: Sun, 21 May 2023 03:54:41 -0700 (PDT)
In-Reply-To: <db8a6771-3e54-485b-b391-310658dd6f52n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.53.44; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.53.44
References: <db8a6771-3e54-485b-b391-310658dd6f52n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <aa869ef6-7f90-405b-a84a-2c11ac7979a3n@googlegroups.com>
Subject: Re: Request for comments, Novacore the sequel to ISO modules
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Sun, 21 May 2023 10:54:41 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 33
 by: Mostowski Collapse - Sun, 21 May 2023 10:54 UTC

Now I have implemented the new open/4 options method/1,
headers/1 and body/1 also for Dogelog Player. There is a first
take that works in the browser. More platforms to follow.

Its such a thin extension, API wise, want to have it as part of
Novacore. What do other Prolog systems do? Here is what
SWI-Prolog in their offering.

- method/1: Accepts the method name in lower case,
so far I use the option with an upper case value.
- headers/1: Doesn't use our Key-Value pair format,
instead the format is Key(Value). Has separate option
for auth/1 and inside auth/1 for bearer/1.
- body/1: Not available in SWI-Prolog, must use post/1,
and post/1 accepts quite a bulk of formats.

and then I find that Trealla Prolog does something else
Signature wise:

- offers some convenience like http_post/4, http_delete/3,
bootstrapped from http_get/3.
- http_get/3 has options method/1, post/1 and header/2,
quite amazing, mostly written in 100% Prolog!
- might also support HTTPS, depends on client/5.
- this was checked into GitHub 9 months ago

and Scryer Prolog does again something else
Signature wise:

- http_open/3 had a 100% Prolog solution in 2020,
but became something else 12 months ago.
- http_open/3 has options method/1, data/1 and
request_headers/1, goes into CallHttpOpen instruction,
which then uses hyper_tls.

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

<d9588b9c-edcc-4f8b-85d2-7487b5556798n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:6214:9c8:b0:63c:fb61:1a4a with SMTP id dp8-20020a05621409c800b0063cfb611a4amr16728qvb.4.1690631471609;
Sat, 29 Jul 2023 04:51:11 -0700 (PDT)
X-Received: by 2002:a9d:7cc3:0:b0:6b9:b8fd:9ebb with SMTP id
r3-20020a9d7cc3000000b006b9b8fd9ebbmr5721831otn.4.1690631471385; Sat, 29 Jul
2023 04:51:11 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.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: Sat, 29 Jul 2023 04:51:11 -0700 (PDT)
In-Reply-To: <db8a6771-3e54-485b-b391-310658dd6f52n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.50.239; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.50.239
References: <db8a6771-3e54-485b-b391-310658dd6f52n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <d9588b9c-edcc-4f8b-85d2-7487b5556798n@googlegroups.com>
Subject: Re: Request for comments, Novacore the sequel to ISO modules
From: bursejan@gmail.com (Mild Shock)
Injection-Date: Sat, 29 Jul 2023 11:51:11 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2442
 by: Mild Shock - Sat, 29 Jul 2023 11:51 UTC

The new multilingual strings are also an exercise in
Novacore. There were a few issues that needed novel
Prolog solutions, to make a Novacore solution.

One problem was I didn't want to use library(format)
and format/3 to format multilingual strings when
generating error messages. This addresses more

the later multilingual strings processing than the
multilingual strings store itself. So how resolve this
paradox? Here is my take, a mini format/3 boostraped

from the Dogelog Player specific atom_split/3:

% sys_inter_polate(+Stream, +Atom, +List)
sys_inter_polate(Stream, Template, Args) :-
atom_split(Template, '~', [Head|Tail]),
put_atom(Stream, Head),
sys_zipper_output(Args, Tail, Stream).

% sys_zipper_output(+List, +List, +Stream)
sys_zipper_output([Arg|Args], [Head|Tail], Stream) :-
writeq(Stream, Arg),
put_atom(Stream, Head),
sys_zipper_output(Args, Tail, Stream).
sys_zipper_output([], [], _).

It only understands format specifier '~', but is sufficient:

/* German Text */
strings('syntax_error.singleton_var', de, 'Alleinstehende Variable(n) ~, anonyme Variable(n) (_) benutzen.').

/* English and Fallback Text */
strings('syntax_error.singleton_var', '', 'Singleton variable(s) ~, use anonymous variable(s) (_).').

LoL

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

<07e4e441-f981-4034-998b-c665ee434501n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:622a:2c6:b0:412:1318:9d4f with SMTP id a6-20020a05622a02c600b0041213189d4fmr24370qtx.2.1694132121191;
Thu, 07 Sep 2023 17:15:21 -0700 (PDT)
X-Received: by 2002:a17:90a:ab8c:b0:26b:b78:c94f with SMTP id
n12-20020a17090aab8c00b0026b0b78c94fmr311067pjq.7.1694132120886; Thu, 07 Sep
2023 17:15:20 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.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, 7 Sep 2023 17:15:20 -0700 (PDT)
In-Reply-To: <d9588b9c-edcc-4f8b-85d2-7487b5556798n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.50.239; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.50.239
References: <db8a6771-3e54-485b-b391-310658dd6f52n@googlegroups.com> <d9588b9c-edcc-4f8b-85d2-7487b5556798n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <07e4e441-f981-4034-998b-c665ee434501n@googlegroups.com>
Subject: Re: Request for comments, Novacore the sequel to ISO modules
From: bursejan@gmail.com (Mild Shock)
Injection-Date: Fri, 08 Sep 2023 00:15:21 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1663
 by: Mild Shock - Fri, 8 Sep 2023 00:15 UTC

Did you know that Novacore has change_arg/3?
Works for Dogelog Player and formerly Jekejeke Prolog.
It is similar like nb_linkarg/3 in SWI-Prolog.

So we can implement countall/3 in a blink:

countall(G, N) :-
functor(Holder, v, 1),
change_arg(1, Holder, 0),
(G,
arg(1, Holder, H),
J is H+1,
change_arg(1, Holder, J),
fail; true),
arg(1, Holder, N).

Works find:

?- countall(between(10,20,_), N).
N = 11.

Request for comments, Novacore the sequel to ISO modules

<db8a6771-3e54-485b-b391-310658dd6f52n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a0c:8107:0:b0:496:a715:dc8c with SMTP id 7-20020a0c8107000000b00496a715dc8cmr2237330qvc.96.1660738704938;
Wed, 17 Aug 2022 05:18:24 -0700 (PDT)
X-Received: by 2002:a25:c2c5:0:b0:682:2eda:b5ae with SMTP id
s188-20020a25c2c5000000b006822edab5aemr19195402ybf.466.1660738704714; Wed, 17
Aug 2022 05:18:24 -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, 17 Aug 2022 05:18:24 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=80.218.40.218; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 80.218.40.218
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <db8a6771-3e54-485b-b391-310658dd6f52n@googlegroups.com>
Subject: Request for comments, Novacore the sequel to ISO modules
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Wed, 17 Aug 2022 12:18:24 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2871
 by: Mostowski Collapse - Wed, 17 Aug 2022 12:18 UTC

Now I have an idea for a novell Prolog core, called Novacore.
What should it be able to do? A few features from JavaScript:

a) Renaming Module Import
The have even renaming module import. For example one
can do in JavaScript:

const emitter = require('events');

But is there a Prolog system that has a renaming module import?
Like for example this here:

:- use_module(events as emitter).

b) Polyfills
In JavaScript new functionality can be added to old versions
via so called polyfills. On the module/class level, this requires
that you can do code injections, later mixins.

Although Prolog would be in a good position here, since for
example it has multifile predicates. But does this work for a
module system of a Prolog system? And how would a polyfill

exactly be done?

I tried this in Ciao Prolog playground, but there seems a couple
of other problems:

:- use_module(library(lists)).

lists:subtract([], _, R) :- !,
R = [].
lists:subtract([E|T], D, R) :- !,
( memberchk(E, D)
-> lists:subtract(T, D, R)
; R = [E|R1],
lists:subtract(T, D, R1)
).

I get quite a funny bouquet of errors:

ERROR: (lns 6-11) Predicate memberchk/2 undefined in source
ERROR: (lns 6-11) Bad module qualification of subtract/3,
predicate not imported from module lists
ERROR: (lns 6-11) Bad module qualification of subtract/3,
predicate not imported from module lists
ERROR: Aborted module compilation

If I am not totally mistaken the subtract/3 mixing works in SWI-Prolog
and in Jekejeke Prolog. Have to try again. But there could be issues
with reconsult, in general it makes a few things more complicated

concerning the Prolog system tooling. But frankly I didn’t use it so
often, there were a few use cases though.

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

<e8c4866e-0d21-4722-8666-f388ed9c5c46n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:ac8:57d5:0:b0:344:51fd:6b4a with SMTP id w21-20020ac857d5000000b0034451fd6b4amr16584376qta.214.1660743437923;
Wed, 17 Aug 2022 06:37:17 -0700 (PDT)
X-Received: by 2002:a25:b9c3:0:b0:668:a418:13c with SMTP id
y3-20020a25b9c3000000b00668a418013cmr18712210ybj.498.1660743437633; Wed, 17
Aug 2022 06:37:17 -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, 17 Aug 2022 06:37:17 -0700 (PDT)
In-Reply-To: <db8a6771-3e54-485b-b391-310658dd6f52n@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>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <e8c4866e-0d21-4722-8666-f388ed9c5c46n@googlegroups.com>
Subject: Re: Request for comments, Novacore the sequel to ISO modules
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Wed, 17 Aug 2022 13:37:17 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 4566
 by: Mostowski Collapse - Wed, 17 Aug 2022 13:37 UTC

So what would be the benefit of Novacore? It would solve
some of the bottlenecks in Prolog systems. Somebody wrote:

"Surely if SWI-Prolog is the outlier I’m happy to change that,
considering that the impact is most likely low."

How can you do **widescale change** and semantic confluence
without waiting for every Prolog system, even without waiting
for SWI-Prolog? Thats what Polyfills do in JavaScript. But I don’t

know how popular they are right now. In the past there
was Babel, and it is still there:

Babel is a JavaScript compiler
Use next generation JavaScript, today.
https://babeljs.io/

Logtalk is kind of the Prolog Babel, with the difference that
Logtalk doesn’t do existing Prolog system module system
injection. But the Bable toolchain consists of more than only

Polyfills, some are similar to Logtalk again (codemods):

- Transform syntax
- Polyfill features that are missing in your target environment
(through a third-party polyfill such as core-js)
^- Source code transformations (codemods)
- And more!

To some extend there is also a third option besides the alternative
of if-then-else conditional Prolog compilation. You could also
use goal_expansion/2 to do some things.

Mostowski Collapse schrieb am Mittwoch, 17. August 2022 um 14:18:25 UTC+2:
> Now I have an idea for a novell Prolog core, called Novacore.
> What should it be able to do? A few features from JavaScript:
>
> a) Renaming Module Import
> The have even renaming module import. For example one
> can do in JavaScript:
>
> const emitter = require('events');
>
> But is there a Prolog system that has a renaming module import?
> Like for example this here:
>
> :- use_module(events as emitter).
>
> b) Polyfills
> In JavaScript new functionality can be added to old versions
> via so called polyfills. On the module/class level, this requires
> that you can do code injections, later mixins.
>
> Although Prolog would be in a good position here, since for
> example it has multifile predicates. But does this work for a
> module system of a Prolog system? And how would a polyfill
>
> exactly be done?
>
> I tried this in Ciao Prolog playground, but there seems a couple
> of other problems:
>
> :- use_module(library(lists)).
>
> lists:subtract([], _, R) :- !,
> R = [].
> lists:subtract([E|T], D, R) :- !,
> ( memberchk(E, D)
> -> lists:subtract(T, D, R)
> ; R = [E|R1],
> lists:subtract(T, D, R1)
> ).
>
> I get quite a funny bouquet of errors:
>
> ERROR: (lns 6-11) Predicate memberchk/2 undefined in source
> ERROR: (lns 6-11) Bad module qualification of subtract/3,
> predicate not imported from module lists
> ERROR: (lns 6-11) Bad module qualification of subtract/3,
> predicate not imported from module lists
> ERROR: Aborted module compilation
>
> If I am not totally mistaken the subtract/3 mixing works in SWI-Prolog
> and in Jekejeke Prolog. Have to try again. But there could be issues
> with reconsult, in general it makes a few things more complicated
>
> concerning the Prolog system tooling. But frankly I didn’t use it so
> often, there were a few use cases though.

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

<0b92ca64-dbd2-4950-9745-376705c45031n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:6214:248a:b0:476:93ab:b35e with SMTP id gi10-20020a056214248a00b0047693abb35emr21961421qvb.60.1660744841266;
Wed, 17 Aug 2022 07:00:41 -0700 (PDT)
X-Received: by 2002:a81:349:0:b0:324:d932:1362 with SMTP id
70-20020a810349000000b00324d9321362mr20200748ywd.281.1660744840512; Wed, 17
Aug 2022 07:00:40 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!1.us.feeder.erje.net!feeder.erje.net!border-1.nntp.ord.giganews.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, 17 Aug 2022 07:00:40 -0700 (PDT)
In-Reply-To: <e8c4866e-0d21-4722-8666-f388ed9c5c46n@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>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <0b92ca64-dbd2-4950-9745-376705c45031n@googlegroups.com>
Subject: Re: Request for comments, Novacore the sequel to ISO modules
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Wed, 17 Aug 2022 14:00:41 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 103
 by: Mostowski Collapse - Wed, 17 Aug 2022 14:00 UTC

In as far the pure modules by Ciao Prolog are a good exercise.
Now imagine a pure+common module, which uses totally different
library than Ciao does currently have as a status quo. No changes

needed to the libraries that Ciao Prolog has, only a common context,
where the name space looks different and some common libraries
are provided. So the Ciao Prolog system would see the current

status quo of Ciao, and the user would see the common. Would this
be possible, such a Chimera Prolog? Or can Ciao Prolog remove
built-ins (for pure) but not add built-ins (for pure+common)?

Mostowski Collapse schrieb am Mittwoch, 17. August 2022 um 15:37:18 UTC+2:
> So what would be the benefit of Novacore? It would solve
> some of the bottlenecks in Prolog systems. Somebody wrote:
>
> "Surely if SWI-Prolog is the outlier I’m happy to change that,
> considering that the impact is most likely low."
>
> How can you do **widescale change** and semantic confluence
> without waiting for every Prolog system, even without waiting
> for SWI-Prolog? Thats what Polyfills do in JavaScript. But I don’t
>
> know how popular they are right now. In the past there
> was Babel, and it is still there:
>
> Babel is a JavaScript compiler
> Use next generation JavaScript, today.
> https://babeljs.io/
>
> Logtalk is kind of the Prolog Babel, with the difference that
> Logtalk doesn’t do existing Prolog system module system
> injection. But the Bable toolchain consists of more than only
>
> Polyfills, some are similar to Logtalk again (codemods):
>
> - Transform syntax
> - Polyfill features that are missing in your target environment
> (through a third-party polyfill such as core-js)
> ^- Source code transformations (codemods)
> - And more!
>
> To some extend there is also a third option besides the alternative
> of if-then-else conditional Prolog compilation. You could also
> use goal_expansion/2 to do some things.
> Mostowski Collapse schrieb am Mittwoch, 17. August 2022 um 14:18:25 UTC+2:
> > Now I have an idea for a novell Prolog core, called Novacore.
> > What should it be able to do? A few features from JavaScript:
> >
> > a) Renaming Module Import
> > The have even renaming module import. For example one
> > can do in JavaScript:
> >
> > const emitter = require('events');
> >
> > But is there a Prolog system that has a renaming module import?
> > Like for example this here:
> >
> > :- use_module(events as emitter).
> >
> > b) Polyfills
> > In JavaScript new functionality can be added to old versions
> > via so called polyfills. On the module/class level, this requires
> > that you can do code injections, later mixins.
> >
> > Although Prolog would be in a good position here, since for
> > example it has multifile predicates. But does this work for a
> > module system of a Prolog system? And how would a polyfill
> >
> > exactly be done?
> >
> > I tried this in Ciao Prolog playground, but there seems a couple
> > of other problems:
> >
> > :- use_module(library(lists)).
> >
> > lists:subtract([], _, R) :- !,
> > R = [].
> > lists:subtract([E|T], D, R) :- !,
> > ( memberchk(E, D)
> > -> lists:subtract(T, D, R)
> > ; R = [E|R1],
> > lists:subtract(T, D, R1)
> > ).
> >
> > I get quite a funny bouquet of errors:
> >
> > ERROR: (lns 6-11) Predicate memberchk/2 undefined in source
> > ERROR: (lns 6-11) Bad module qualification of subtract/3,
> > predicate not imported from module lists
> > ERROR: (lns 6-11) Bad module qualification of subtract/3,
> > predicate not imported from module lists
> > ERROR: Aborted module compilation
> >
> > If I am not totally mistaken the subtract/3 mixing works in SWI-Prolog
> > and in Jekejeke Prolog. Have to try again. But there could be issues
> > with reconsult, in general it makes a few things more complicated
> >
> > concerning the Prolog system tooling. But frankly I didn’t use it so
> > often, there were a few use cases though.

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

<186e6dd6-b34f-44b5-bc41-df084bcf67f3n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:6214:2aac:b0:474:8b64:8f56 with SMTP id js12-20020a0562142aac00b004748b648f56mr24213544qvb.0.1660768137324;
Wed, 17 Aug 2022 13:28:57 -0700 (PDT)
X-Received: by 2002:a25:c013:0:b0:671:8102:eb2 with SMTP id
c19-20020a25c013000000b0067181020eb2mr21606792ybf.316.1660768136857; Wed, 17
Aug 2022 13:28:56 -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, 17 Aug 2022 13:28:56 -0700 (PDT)
In-Reply-To: <0b92ca64-dbd2-4950-9745-376705c45031n@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>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <186e6dd6-b34f-44b5-bc41-df084bcf67f3n@googlegroups.com>
Subject: Re: Request for comments, Novacore the sequel to ISO modules
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Wed, 17 Aug 2022 20:28:57 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 28
 by: Mostowski Collapse - Wed, 17 Aug 2022 20:28 UTC

Since I have already a prototype running, but it needs a little
bit more preparation, here is a new term coined. We have
already the new term Novacore, and now comes the following:

One could pursue a new approach, based on a Novacore
with what could be coined Liblets. A Liblet would be kind of package,
that would switch in what is normally more cohesively connected

inside a Prolog system. But the Prolog systems that would aim at
supporting Novacore and Liblets, would need some refactoring
and deossification. So that the Prolog system specific Liblet

becomes switchable. One way to do it, is to have the Prolog
system depend on an internal Liblet not visible to the outside, so
that the switchable Liblets become possible. One could then

experiment with a least common multiple (LCM) Liblet in
each Prolog system that has a Novacore. The LCM Liblet
would be the fusion of various Liblets or even a totally different

setup concerning the name space of this LCM Liblet and the
content of this LCM Liblet. LCM Liblet would be the new name
for Common Prolog. Why is a Novacore needed, and not the

ISO core standard suitable. Various reasons, a) intollerant syntax of
some ISO core implementations, b) other intollerant features of some
ISO core implementations, that prohibit Liblets modelled after or

directly loaded from existing more tollerant Prolog systems.

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

<db69596d-ee5a-4e27-a774-2d0f1c299378n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:620a:4709:b0:6bb:331b:5f6a with SMTP id bs9-20020a05620a470900b006bb331b5f6amr14926051qkb.96.1661939977015;
Wed, 31 Aug 2022 02:59:37 -0700 (PDT)
X-Received: by 2002:a25:8744:0:b0:695:a01b:f0fd with SMTP id
e4-20020a258744000000b00695a01bf0fdmr14535478ybn.570.1661939976784; Wed, 31
Aug 2022 02:59:36 -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, 31 Aug 2022 02:59:36 -0700 (PDT)
In-Reply-To: <186e6dd6-b34f-44b5-bc41-df084bcf67f3n@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>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <db69596d-ee5a-4e27-a774-2d0f1c299378n@googlegroups.com>
Subject: Re: Request for comments, Novacore the sequel to ISO modules
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Wed, 31 Aug 2022 09:59:37 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3165
 by: Mostowski Collapse - Wed, 31 Aug 2022 09:59 UTC

Was refactoring Dogelog Player. It has now a couple
of libraries, making use of the new system_url to fetch them.

- library(compat): New idea of a library, has things like tab/1.
- library(sequence): Reduced library(adanced/sequence) from formerly Jekejeke Prolog.
- library(aggregate): Reduced library(adanced/aggregate) from formerly Jekejeke Prolog.
- library(lists): Like library(basic/lists) from formerly Jekejeke Prolog.

library(sequence) and library(aggregate) are implemented via
the new change_arg/3 in Dogelog Player, unlike Jekejeke Prolog
which uses some Java pivot datastructure.

The new system_url to fetch does not change Dogelog Player
performance. Dogelog Player is still not an extremly fast
Prolog system, it might beat Tau Prolog but otherwise it has

rather modest performance. But change_arg/3 gives nice
performance. Its the better solution than bb_put/2 and bb_get/2,
which is module local, and BTW will not work in multi-threading,

if it has SICStus semantics it is for "blackboard" communication
between multiple threads. The bb_ stands for "blackboard". So its
not thread-local. What is Scryer Prolog thinking?

Anyway, here some performance:

/* Scryer Prolog "v0.9.0-175-g6b8e6204" */
?- use_module(library(iso_ext)).
true.
?- time((call_nth((between(1,1000,_),call_nth(between(1,1000,_),_)),_), fail; true)).
% CPU time: 4.719s
true.

/* Dogelog Player 1.0.2, nodejs */
?- ensure_loaded(library(sequence)).
true.
?- time((call_nth((between(1,1000,_),call_nth(between(1,1000,_),_)),_), fail; true)).
% Wall 1763 ms, gc 4 ms, 6250971 lips
true.

/* SWI-Prolog, 8.5.14 */
?- time((call_nth((between(1,1000,_),call_nth(between(1,1000,_),_)),_), fail; true)).
% 5,002,004 inferences, 0.484 CPU in 0.473 seconds (102% CPU, 10326718 Lips)
true.

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

<294c86a9-182f-471b-a598-ebd907eb5e4fn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:622a:1986:b0:343:225d:f9e1 with SMTP id u6-20020a05622a198600b00343225df9e1mr18516611qtc.651.1661940275826;
Wed, 31 Aug 2022 03:04:35 -0700 (PDT)
X-Received: by 2002:a81:6f87:0:b0:33d:a780:e08a with SMTP id
k129-20020a816f87000000b0033da780e08amr18157644ywc.38.1661940275520; Wed, 31
Aug 2022 03:04:35 -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, 31 Aug 2022 03:04:35 -0700 (PDT)
In-Reply-To: <db69596d-ee5a-4e27-a774-2d0f1c299378n@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>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <294c86a9-182f-471b-a598-ebd907eb5e4fn@googlegroups.com>
Subject: Re: Request for comments, Novacore the sequel to ISO modules
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Wed, 31 Aug 2022 10:04:35 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3701
 by: Mostowski Collapse - Wed, 31 Aug 2022 10:04 UTC

The implementation goes:

bb_put(Key, Value) :-
( atom(Key) ->
'$store_global_var'(Key, Value)
; type_error(atom, Key, bb_put/2)
).

And then bb_put/2 is used in Scryer Prologs call_nth/2.
How do you want to use this in a multi-threaded Prolog system?

LMAO!

Mostowski Collapse schrieb am Mittwoch, 31. August 2022 um 11:59:37 UTC+2:
> Was refactoring Dogelog Player. It has now a couple
> of libraries, making use of the new system_url to fetch them.
>
> - library(compat): New idea of a library, has things like tab/1.
> - library(sequence): Reduced library(adanced/sequence) from formerly Jekejeke Prolog.
> - library(aggregate): Reduced library(adanced/aggregate) from formerly Jekejeke Prolog.
> - library(lists): Like library(basic/lists) from formerly Jekejeke Prolog.
>
> library(sequence) and library(aggregate) are implemented via
> the new change_arg/3 in Dogelog Player, unlike Jekejeke Prolog
> which uses some Java pivot datastructure.
>
> The new system_url to fetch does not change Dogelog Player
> performance. Dogelog Player is still not an extremly fast
> Prolog system, it might beat Tau Prolog but otherwise it has
>
> rather modest performance. But change_arg/3 gives nice
> performance. Its the better solution than bb_put/2 and bb_get/2,
> which is module local, and BTW will not work in multi-threading,
>
> if it has SICStus semantics it is for "blackboard" communication
> between multiple threads. The bb_ stands for "blackboard". So its
> not thread-local. What is Scryer Prolog thinking?
>
> Anyway, here some performance:
>
> /* Scryer Prolog "v0.9.0-175-g6b8e6204" */
> ?- use_module(library(iso_ext)).
> true.
> ?- time((call_nth((between(1,1000,_),call_nth(between(1,1000,_),_)),_), fail; true)).
> % CPU time: 4.719s
> true.
>
> /* Dogelog Player 1.0.2, nodejs */
> ?- ensure_loaded(library(sequence)).
> true.
> ?- time((call_nth((between(1,1000,_),call_nth(between(1,1000,_),_)),_), fail; true)).
> % Wall 1763 ms, gc 4 ms, 6250971 lips
> true.
>
> /* SWI-Prolog, 8.5.14 */
> ?- time((call_nth((between(1,1000,_),call_nth(between(1,1000,_),_)),_), fail; true)).
> % 5,002,004 inferences, 0.484 CPU in 0.473 seconds (102% CPU, 10326718 Lips)
> true.

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

<176a76a2-52a6-4234-ad19-64df49e2a635n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:6214:20e9:b0:496:f8c2:bd4c with SMTP id 9-20020a05621420e900b00496f8c2bd4cmr18941948qvk.60.1661940629434;
Wed, 31 Aug 2022 03:10:29 -0700 (PDT)
X-Received: by 2002:a81:d353:0:b0:31e:2888:93a1 with SMTP id
d19-20020a81d353000000b0031e288893a1mr16964010ywl.498.1661940629034; Wed, 31
Aug 2022 03:10:29 -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, 31 Aug 2022 03:10:28 -0700 (PDT)
In-Reply-To: <294c86a9-182f-471b-a598-ebd907eb5e4fn@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>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <176a76a2-52a6-4234-ad19-64df49e2a635n@googlegroups.com>
Subject: Re: Request for comments, Novacore the sequel to ISO modules
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Wed, 31 Aug 2022 10:10:29 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 4567
 by: Mostowski Collapse - Wed, 31 Aug 2022 10:10 UTC

I guess the SWI-Prolog implementation of call_nth/2 can
be used with multi-threading. So does the formerly Jekejeke
Prolog implementation, can be used with multi-threading

as well. Performance for formerly Jekejeke Prolog with
JDK 1.8, even bettern than that for SWI-Prolog:

?- time((call_nth((between(1,1000,_),call_nth(between(1,1000,_),_)),_), fail; true)).
% Threads 359 ms, GC 6 ms, Up 372 ms (Current 08/31/22 12:07:16)
true.

Cannot test Ciao Prolog since it doesn't have call_nth/2.
Same for ECLiPSe Prolog, I don't find a predicate that goes
exactly by the name call_nth/2,

maybe there is a substitute?

Mostowski Collapse schrieb am Mittwoch, 31. August 2022 um 12:04:36 UTC+2:
> The implementation goes:
>
> bb_put(Key, Value) :-
> ( atom(Key) ->
> '$store_global_var'(Key, Value)
> ; type_error(atom, Key, bb_put/2)
> ).
>
> And then bb_put/2 is used in Scryer Prologs call_nth/2.
> How do you want to use this in a multi-threaded Prolog system?
>
> LMAO!
> Mostowski Collapse schrieb am Mittwoch, 31. August 2022 um 11:59:37 UTC+2:
> > Was refactoring Dogelog Player. It has now a couple
> > of libraries, making use of the new system_url to fetch them.
> >
> > - library(compat): New idea of a library, has things like tab/1.
> > - library(sequence): Reduced library(adanced/sequence) from formerly Jekejeke Prolog.
> > - library(aggregate): Reduced library(adanced/aggregate) from formerly Jekejeke Prolog.
> > - library(lists): Like library(basic/lists) from formerly Jekejeke Prolog.
> >
> > library(sequence) and library(aggregate) are implemented via
> > the new change_arg/3 in Dogelog Player, unlike Jekejeke Prolog
> > which uses some Java pivot datastructure.
> >
> > The new system_url to fetch does not change Dogelog Player
> > performance. Dogelog Player is still not an extremly fast
> > Prolog system, it might beat Tau Prolog but otherwise it has
> >
> > rather modest performance. But change_arg/3 gives nice
> > performance. Its the better solution than bb_put/2 and bb_get/2,
> > which is module local, and BTW will not work in multi-threading,
> >
> > if it has SICStus semantics it is for "blackboard" communication
> > between multiple threads. The bb_ stands for "blackboard". So its
> > not thread-local. What is Scryer Prolog thinking?
> >
> > Anyway, here some performance:
> >
> > /* Scryer Prolog "v0.9.0-175-g6b8e6204" */
> > ?- use_module(library(iso_ext)).
> > true.
> > ?- time((call_nth((between(1,1000,_),call_nth(between(1,1000,_),_)),_), fail; true)).
> > % CPU time: 4.719s
> > true.
> >
> > /* Dogelog Player 1.0.2, nodejs */
> > ?- ensure_loaded(library(sequence)).
> > true.
> > ?- time((call_nth((between(1,1000,_),call_nth(between(1,1000,_),_)),_), fail; true)).
> > % Wall 1763 ms, gc 4 ms, 6250971 lips
> > true.
> >
> > /* SWI-Prolog, 8.5.14 */
> > ?- time((call_nth((between(1,1000,_),call_nth(between(1,1000,_),_)),_), fail; true)).
> > % 5,002,004 inferences, 0.484 CPU in 0.473 seconds (102% CPU, 10326718 Lips)
> > true.

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

<c7f25359-555f-45ce-8b50-772eae97af94n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:622a:1986:b0:343:225d:f9e1 with SMTP id u6-20020a05622a198600b00343225df9e1mr20247196qtc.651.1661966307517;
Wed, 31 Aug 2022 10:18:27 -0700 (PDT)
X-Received: by 2002:a25:d046:0:b0:695:cef7:4f2c with SMTP id
h67-20020a25d046000000b00695cef74f2cmr16207237ybg.245.1661966307255; Wed, 31
Aug 2022 10:18: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, 31 Aug 2022 10:18:27 -0700 (PDT)
In-Reply-To: <176a76a2-52a6-4234-ad19-64df49e2a635n@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>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <c7f25359-555f-45ce-8b50-772eae97af94n@googlegroups.com>
Subject: Re: Request for comments, Novacore the sequel to ISO modules
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Wed, 31 Aug 2022 17:18:27 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2318
 by: Mostowski Collapse - Wed, 31 Aug 2022 17:18 UTC

End-users have really problems with embeding
Prolog into HTML pages by themself. For example
an simple advice as follows from Tau Prolog:

get_by_id(writeme, WriteMe),
open(WriteMe, write, Stream),
set_output(Stream),
...
write(Formula)

doesn't work, when the stream does a
innerHTML += for the writeme element. What
would then be needed is:

get_by_id(writeme, WriteMe),
open(WriteMe, write, Stream),
set_output(Stream),
...
term_atom(Formula, FormulaAtom),
xml_ecape(FormulaAtom, FormulaEscaped),
write(FormulaEscaped)

I guess xml_escape/2 exists already since
1990's when the world's first web server, was
developed and implemented by Berners-Lee

on a NeXTcube computer. But its even
worse, does Tau Prolog have a term_atom/2?

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

<236a4356-a625-4492-b74f-d5c668be5e96n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:620a:4442:b0:6b2:844e:ee67 with SMTP id w2-20020a05620a444200b006b2844eee67mr16527208qkp.625.1661966551098;
Wed, 31 Aug 2022 10:22:31 -0700 (PDT)
X-Received: by 2002:a81:a18d:0:b0:341:2437:f7c7 with SMTP id
y135-20020a81a18d000000b003412437f7c7mr13207580ywg.69.1661966550916; Wed, 31
Aug 2022 10:22:30 -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, 31 Aug 2022 10:22:30 -0700 (PDT)
In-Reply-To: <c7f25359-555f-45ce-8b50-772eae97af94n@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>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <236a4356-a625-4492-b74f-d5c668be5e96n@googlegroups.com>
Subject: Re: Request for comments, Novacore the sequel to ISO modules
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Wed, 31 Aug 2022 17:22:31 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3146
 by: Mostowski Collapse - Wed, 31 Aug 2022 17:22 UTC

So a Code Playground where you can
simply do the following, as currently
available from dogelog.js:

<script type="application/x-dogelog">
... Dogelog Player code goes here ...
</script>

Is much simpler. Thanks to the Novacore,
if I have time, I will maybe provide also:

<script type="application/x-swi">
... SWI-Prolog code goes here ...
</script>
<script type="application/x-ciao">
... Ciao Prolog code goes here ...
</script>

And if in 100 years from now, the stubborn
Prolog community has decided on some PEPs,
could maybe even do:

<script type="application/x-prolog">
... Prolog code goes here ...
</script>

Mostowski Collapse schrieb am Mittwoch, 31. August 2022 um 19:18:28 UTC+2:
> End-users have really problems with embeding
> Prolog into HTML pages by themself. For example
> an simple advice as follows from Tau Prolog:
>
> get_by_id(writeme, WriteMe),
> open(WriteMe, write, Stream),
> set_output(Stream),
> ...
> write(Formula)
>
> doesn't work, when the stream does a
> innerHTML += for the writeme element. What
> would then be needed is:
>
> get_by_id(writeme, WriteMe),
> open(WriteMe, write, Stream),
> set_output(Stream),
> ...
> term_atom(Formula, FormulaAtom),
> xml_ecape(FormulaAtom, FormulaEscaped),
> write(FormulaEscaped)
>
> I guess xml_escape/2 exists already since
> 1990's when the world's first web server, was
> developed and implemented by Berners-Lee
>
> on a NeXTcube computer. But its even
> worse, does Tau Prolog have a term_atom/2?

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

<0ee1718d-cd2f-4c97-900b-e2a350923373n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a37:b586:0:b0:6df:fd18:386d with SMTP id e128-20020a37b586000000b006dffd18386dmr11024043qkf.114.1665356768177;
Sun, 09 Oct 2022 16:06:08 -0700 (PDT)
X-Received: by 2002:a05:6870:568f:b0:136:6cd3:e59a with SMTP id
p15-20020a056870568f00b001366cd3e59amr2845964oao.115.1665356767834; Sun, 09
Oct 2022 16:06:07 -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: Sun, 9 Oct 2022 16:06:07 -0700 (PDT)
In-Reply-To: <236a4356-a625-4492-b74f-d5c668be5e96n@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>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <0ee1718d-cd2f-4c97-900b-e2a350923373n@googlegroups.com>
Subject: Re: Request for comments, Novacore the sequel to ISO modules
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Sun, 09 Oct 2022 23:06:08 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2576
 by: Mostowski Collapse - Sun, 9 Oct 2022 23:06 UTC

I would like to have nice test cases for Novacore.
For sure floats would be part of Novacore. SWI-Prolog
publish its new release 8.5.18. And it says it does now

do to_nearest rouding more consequently. What does
that mean? Wiki tells me there are at least two “to nearest”:

- Round to nearest, ties to even – rounds to the nearest value;
if the number falls midway, it is rounded to the nearest value
with an even least significant digit.

- Round to nearest, ties away from zero (or ties to away) – rounds
to the nearest value; if the number falls midway, it is rounded to
the nearest value above (for positive numbers) or below (for negative numbers).

https://en.wikipedia.org/wiki/IEEE_754#Roundings_to_nearest 1

But then in Java BigDecimal there are even 3 “to nearest”,
HALF_EVEN, HALF_UP and HALF_DOWN.

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

<9ed0edba-9284-40fd-b782-8f625a598befn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:6214:230c:b0:4b1:795c:4e89 with SMTP id gc12-20020a056214230c00b004b1795c4e89mr12635979qvb.18.1665357159050;
Sun, 09 Oct 2022 16:12:39 -0700 (PDT)
X-Received: by 2002:a9d:1b6c:0:b0:661:98df:c3e1 with SMTP id
l99-20020a9d1b6c000000b0066198dfc3e1mr1366870otl.179.1665357158694; Sun, 09
Oct 2022 16:12:38 -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: Sun, 9 Oct 2022 16:12:38 -0700 (PDT)
In-Reply-To: <0ee1718d-cd2f-4c97-900b-e2a350923373n@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>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <9ed0edba-9284-40fd-b782-8f625a598befn@googlegroups.com>
Subject: Re: Request for comments, Novacore the sequel to ISO modules
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Sun, 09 Oct 2022 23:12:39 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 3399
 by: Mostowski Collapse - Sun, 9 Oct 2022 23:12 UTC

I guess the to_nearest should be HALF_EVEN. Was
lazy making manual test cases, so used a fuzzer.
The fuzzer test cases might not be that good, especially

for HALF_EVEN, since they might not pick up the border
cases, but nevertheless its a first start. Might do more
test cases. The test cases are simply:

fuzzer :-
L is -(1<<100),
H is (1<<100)+1,
between(1, 100, N),
random(L, H, X),
Y is float(X),
write(case(N, X, Y)), write('.'), nl,
fail.
fuzzer.

My Prolog systems, formerly Jekejeke Prolog and
Dogelog Player on its various target platforms, all
pass these test cases.

Mostowski Collapse schrieb am Montag, 10. Oktober 2022 um 01:06:09 UTC+2:
> I would like to have nice test cases for Novacore.
> For sure floats would be part of Novacore. SWI-Prolog
> publish its new release 8.5.18. And it says it does now
>
> do to_nearest rouding more consequently. What does
> that mean? Wiki tells me there are at least two “to nearest”:
>
> - Round to nearest, ties to even – rounds to the nearest value;
> if the number falls midway, it is rounded to the nearest value
> with an even least significant digit.
>
> - Round to nearest, ties away from zero (or ties to away) – rounds
> to the nearest value; if the number falls midway, it is rounded to
> the nearest value above (for positive numbers) or below (for negative numbers).
>
> https://en.wikipedia.org/wiki/IEEE_754#Roundings_to_nearest 1
>
> But then in Java BigDecimal there are even 3 “to nearest”,
> HALF_EVEN, HALF_UP and HALF_DOWN.

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

<167c040e-ff33-4d8f-bd94-5e80c08e3e99n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:620a:5310:b0:6e4:8a1a:ffaa with SMTP id oo16-20020a05620a531000b006e48a1affaamr11099246qkn.18.1665357225730;
Sun, 09 Oct 2022 16:13:45 -0700 (PDT)
X-Received: by 2002:a4a:ab0c:0:b0:47f:653f:693e with SMTP id
i12-20020a4aab0c000000b0047f653f693emr5942439oon.86.1665357225445; Sun, 09
Oct 2022 16:13:45 -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: Sun, 9 Oct 2022 16:13:45 -0700 (PDT)
In-Reply-To: <9ed0edba-9284-40fd-b782-8f625a598befn@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>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <167c040e-ff33-4d8f-bd94-5e80c08e3e99n@googlegroups.com>
Subject: Re: Request for comments, Novacore the sequel to ISO modules
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Sun, 09 Oct 2022 23:13:45 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 4277
 by: Mostowski Collapse - Sun, 9 Oct 2022 23:13 UTC

Here are some very first results for other Prolog systems:

/* SWI-Prolog 8.5.18 (Windows and WASM) Ok */
?- case(N, X, Y), Y =\= float(X).
false.

/* Trealla Prolog 2.4.3 Ok */
?- case(N, X, Y), Y =\= float(X).
false.

/* Scryer Prolog 0.9.0 Nok */
?- case(N, X, Y), Y =\= float(X).
N = 1, X = -572504891324561953821040518484, Y = -5.7250489132456196e29
; N = 3, X = 884996183305110611102854483978, Y = 8.849961833051106e29
; N = 4, X = 1251939306673717603656775488197, Y = 1.2519393066737177e30
Etc..

So somehow these test cases already do their job!

Mostowski Collapse schrieb am Montag, 10. Oktober 2022 um 01:12:39 UTC+2:
> I guess the to_nearest should be HALF_EVEN. Was
> lazy making manual test cases, so used a fuzzer.
> The fuzzer test cases might not be that good, especially
>
> for HALF_EVEN, since they might not pick up the border
> cases, but nevertheless its a first start. Might do more
> test cases. The test cases are simply:
>
> fuzzer :-
> L is -(1<<100),
> H is (1<<100)+1,
> between(1, 100, N),
> random(L, H, X),
> Y is float(X),
> write(case(N, X, Y)), write('.'), nl,
> fail.
> fuzzer.
>
> My Prolog systems, formerly Jekejeke Prolog and
> Dogelog Player on its various target platforms, all
> pass these test cases.
> Mostowski Collapse schrieb am Montag, 10. Oktober 2022 um 01:06:09 UTC+2:
> > I would like to have nice test cases for Novacore.
> > For sure floats would be part of Novacore. SWI-Prolog
> > publish its new release 8.5.18. And it says it does now
> >
> > do to_nearest rouding more consequently. What does
> > that mean? Wiki tells me there are at least two “to nearest”:
> >
> > - Round to nearest, ties to even – rounds to the nearest value;
> > if the number falls midway, it is rounded to the nearest value
> > with an even least significant digit.
> >
> > - Round to nearest, ties away from zero (or ties to away) – rounds
> > to the nearest value; if the number falls midway, it is rounded to
> > the nearest value above (for positive numbers) or below (for negative numbers).
> >
> > https://en.wikipedia.org/wiki/IEEE_754#Roundings_to_nearest 1
> >
> > But then in Java BigDecimal there are even 3 “to nearest”,
> > HALF_EVEN, HALF_UP and HALF_DOWN.

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

<d2a1c956-5911-423e-990c-f0cd5ca0b5b0n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:6214:1c85:b0:4af:7393:3d91 with SMTP id ib5-20020a0562141c8500b004af73933d91mr12989573qvb.74.1665357259316;
Sun, 09 Oct 2022 16:14:19 -0700 (PDT)
X-Received: by 2002:a05:6870:6111:b0:132:af5e:36c3 with SMTP id
s17-20020a056870611100b00132af5e36c3mr8408306oae.68.1665357259013; Sun, 09
Oct 2022 16:14:19 -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: Sun, 9 Oct 2022 16:14:18 -0700 (PDT)
In-Reply-To: <167c040e-ff33-4d8f-bd94-5e80c08e3e99n@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>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <d2a1c956-5911-423e-990c-f0cd5ca0b5b0n@googlegroups.com>
Subject: Re: Request for comments, Novacore the sequel to ISO modules
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Sun, 09 Oct 2022 23:14:19 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 4848
 by: Mostowski Collapse - Sun, 9 Oct 2022 23:14 UTC

More results:

/* Ciao Prolog 1.22.0 (WSL and WASM) Ok */
?- case(N, X, Y), Y =\= float(X).
no

/* ECLiPSe Prolog 7.0.61 Nok */
?- case(N, X, Y), Y =\= float(X).
N = 1
X = -572504891324561953821040518484
Y = -5.7250489132456196e+29
Etc..

Mostowski Collapse schrieb am Montag, 10. Oktober 2022 um 01:13:46 UTC+2:
> Here are some very first results for other Prolog systems:
>
> /* SWI-Prolog 8.5.18 (Windows and WASM) Ok */
> ?- case(N, X, Y), Y =\= float(X).
> false.
>
> /* Trealla Prolog 2.4.3 Ok */
> ?- case(N, X, Y), Y =\= float(X).
> false.
>
> /* Scryer Prolog 0.9.0 Nok */
> ?- case(N, X, Y), Y =\= float(X).
> N = 1, X = -572504891324561953821040518484, Y = -5.7250489132456196e29
> ; N = 3, X = 884996183305110611102854483978, Y = 8.849961833051106e29
> ; N = 4, X = 1251939306673717603656775488197, Y = 1.2519393066737177e30
> Etc..
>
> So somehow these test cases already do their job!
> Mostowski Collapse schrieb am Montag, 10. Oktober 2022 um 01:12:39 UTC+2:
> > I guess the to_nearest should be HALF_EVEN. Was
> > lazy making manual test cases, so used a fuzzer.
> > The fuzzer test cases might not be that good, especially
> >
> > for HALF_EVEN, since they might not pick up the border
> > cases, but nevertheless its a first start. Might do more
> > test cases. The test cases are simply:
> >
> > fuzzer :-
> > L is -(1<<100),
> > H is (1<<100)+1,
> > between(1, 100, N),
> > random(L, H, X),
> > Y is float(X),
> > write(case(N, X, Y)), write('.'), nl,
> > fail.
> > fuzzer.
> >
> > My Prolog systems, formerly Jekejeke Prolog and
> > Dogelog Player on its various target platforms, all
> > pass these test cases.
> > Mostowski Collapse schrieb am Montag, 10. Oktober 2022 um 01:06:09 UTC+2:
> > > I would like to have nice test cases for Novacore.
> > > For sure floats would be part of Novacore. SWI-Prolog
> > > publish its new release 8.5.18. And it says it does now
> > >
> > > do to_nearest rouding more consequently. What does
> > > that mean? Wiki tells me there are at least two “to nearest”:
> > >
> > > - Round to nearest, ties to even – rounds to the nearest value;
> > > if the number falls midway, it is rounded to the nearest value
> > > with an even least significant digit.
> > >
> > > - Round to nearest, ties away from zero (or ties to away) – rounds
> > > to the nearest value; if the number falls midway, it is rounded to
> > > the nearest value above (for positive numbers) or below (for negative numbers).
> > >
> > > https://en.wikipedia.org/wiki/IEEE_754#Roundings_to_nearest 1
> > >
> > > But then in Java BigDecimal there are even 3 “to nearest”,
> > > HALF_EVEN, HALF_UP and HALF_DOWN.

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

<6f272d59-612c-4186-b02d-a2b089156a17n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:ac8:5b51:0:b0:39a:ea24:2c6 with SMTP id n17-20020ac85b51000000b0039aea2402c6mr987282qtw.490.1665385062262;
Sun, 09 Oct 2022 23:57:42 -0700 (PDT)
X-Received: by 2002:a05:6871:68b:b0:132:9af1:62fb with SMTP id
l11-20020a056871068b00b001329af162fbmr14461675oao.23.1665385061506; Sun, 09
Oct 2022 23:57:41 -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: Sun, 9 Oct 2022 23:57:41 -0700 (PDT)
In-Reply-To: <d2a1c956-5911-423e-990c-f0cd5ca0b5b0n@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>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <6f272d59-612c-4186-b02d-a2b089156a17n@googlegroups.com>
Subject: Re: Request for comments, Novacore the sequel to ISO modules
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Mon, 10 Oct 2022 06:57:42 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2380
 by: Mostowski Collapse - Mon, 10 Oct 2022 06:57 UTC

Here is a better fuzzer, it has a higher mean lsb/1 value,
and therefore mostlikely tests more HALF_EVEN:

?- aggregate_all(sum(N), (case(_,X,_), N is lsb(abs(X))), S), A is S/100.
S = 94,
A = 0.94.

?- aggregate_all(sum(N), (case2(_,X,_), N is lsb(abs(X))), S), A is S/100.
S = 5050,
A = 50.5.

The fiuzzer reads as follows:

fuzzer2 :-
between(1, 100, N),
L is -(1<<N),
H is (1<<N)+1,
random(L, H, X),
Z is X<<(100-N),
Y is float(Z),
write(case2(N, Z, Y)), write('.'), nl,
fail.
fuzzer2.

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

<446f792c-7447-4a9c-8902-7db9c87a577cn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:ad4:5bc5:0:b0:4af:b21d:2ad7 with SMTP id t5-20020ad45bc5000000b004afb21d2ad7mr13492991qvt.112.1665385182350;
Sun, 09 Oct 2022 23:59:42 -0700 (PDT)
X-Received: by 2002:a05:6808:308c:b0:354:99ec:bbb7 with SMTP id
bl12-20020a056808308c00b0035499ecbbb7mr510473oib.68.1665385182067; Sun, 09
Oct 2022 23:59:42 -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: Sun, 9 Oct 2022 23:59:41 -0700 (PDT)
In-Reply-To: <6f272d59-612c-4186-b02d-a2b089156a17n@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>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <446f792c-7447-4a9c-8902-7db9c87a577cn@googlegroups.com>
Subject: Re: Request for comments, Novacore the sequel to ISO modules
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Mon, 10 Oct 2022 06:59:42 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 45
 by: Mostowski Collapse - Mon, 10 Oct 2022 06:59 UTC

It indeed trip wires the newest SWI-Prolog:

/* SWI-Prolog 8.5.18 Nok */
?- case2(N, X, Y), Z is float(X), Y =\= Z.
N = 56,
X = -1190359501396335678156200476672,
Y = -1.1903595013963357e+30,
Z = -1.1903595013963356e+30 ;
false.

The test case is ok in all my systems, like formerly
Jekejeke Prolog and Dogelog Player. The test
case is also ok here:

/* Trealla Prolog 2.4.3 Ok */
?- case2(N, X, Y), Y =\= float(X).
false.

/* Ciao Prolog 1.22.0 Ok */
?- case2(N, X, Y), Y =\= float(X).
no

Mostowski Collapse schrieb am Montag, 10. Oktober 2022 um 08:57:43 UTC+2:
> Here is a better fuzzer, it has a higher mean lsb/1 value,
> and therefore mostlikely tests more HALF_EVEN:
>
> ?- aggregate_all(sum(N), (case(_,X,_), N is lsb(abs(X))), S), A is S/100.
> S = 94,
> A = 0.94.
>
> ?- aggregate_all(sum(N), (case2(_,X,_), N is lsb(abs(X))), S), A is S/100.
> S = 5050,
> A = 50.5.
>
> The fiuzzer reads as follows:
>
> fuzzer2 :-
> between(1, 100, N),
> L is -(1<<N),
> H is (1<<N)+1,
> random(L, H, X),
> Z is X<<(100-N),
> Y is float(Z),
> write(case2(N, Z, Y)), write('.'), nl,
> fail.
> fuzzer2.

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

<46c2e79d-6e27-4e84-9f99-d0d097583b5an@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:6214:ca2:b0:4b1:8855:9c8d with SMTP id s2-20020a0562140ca200b004b188559c8dmr22856450qvs.62.1665576675996;
Wed, 12 Oct 2022 05:11:15 -0700 (PDT)
X-Received: by 2002:a05:6870:568f:b0:136:6cd3:e59a with SMTP id
p15-20020a056870568f00b001366cd3e59amr2139983oao.115.1665576675710; Wed, 12
Oct 2022 05:11:15 -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 05:11:15 -0700 (PDT)
In-Reply-To: <446f792c-7447-4a9c-8902-7db9c87a577cn@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>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <46c2e79d-6e27-4e84-9f99-d0d097583b5an@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 12:11:15 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 4474
 by: Mostowski Collapse - Wed, 12 Oct 2022 12:11 UTC

There are much more tripwires, and its not
related to negative bigints per se:

/* SWI-Prolog 8.5.18 */
?- case3(N, X, Y), Y =\= float(X).
N = 12,
X = 548500250785140154065267720192,
Y = 5.485002507851401e+29 ;
N = 37,
X = 503487689179869862254742601728,
Y = 5.034876891798698e+29 ;
N = 44,
X = -828141981914306499269539921920,
Y = -8.281419819143066e+29 ;
N = 69,
X = -124851129191269336172294307840,
Y = -1.2485112919126934e+29 ;
N = 95,
X = 594779305038924597107611402240,
Y = 5.9477930503892456e+29 ;
false.

Interesting? Thats probably some material fur
further analysis. Need to reactivate my SWI-Prolog
based float_half_even/2. If you analyse the

float_half_even/2 you could find the execution
paths that these examples are using and whether
there is something in common. But this only works

if your system uses fast path float/1, if it uses
a rational number based bigint to float conversion,
the analysis possibly not so helpful. Although a

rational number based float conversion might
show some denominator in the form 2^k, for
some k, and yet all its logic could be translated

to getbit/1, lsb/1, etc..

Mostowski Collapse schrieb am Montag, 10. Oktober 2022 um 08:59:43 UTC+2:
> It indeed trip wires the newest SWI-Prolog:
>
> /* SWI-Prolog 8.5.18 Nok */
> ?- case2(N, X, Y), Z is float(X), Y =\= Z.
> N = 56,
> X = -1190359501396335678156200476672,
> Y = -1.1903595013963357e+30,
> Z = -1.1903595013963356e+30 ;
> false.
>
> The test case is ok in all my systems, like formerly
> Jekejeke Prolog and Dogelog Player. The test
> case is also ok here:
> /* Trealla Prolog 2.4.3 Ok */
> ?- case2(N, X, Y), Y =\= float(X).
> false.
>
> /* Ciao Prolog 1.22.0 Ok */
> ?- case2(N, X, Y), Y =\= float(X).
> no
> Mostowski Collapse schrieb am Montag, 10. Oktober 2022 um 08:57:43 UTC+2:
> > Here is a better fuzzer, it has a higher mean lsb/1 value,
> > and therefore mostlikely tests more HALF_EVEN:
> >
> > ?- aggregate_all(sum(N), (case(_,X,_), N is lsb(abs(X))), S), A is S/100.
> > S = 94,
> > A = 0.94.
> >
> > ?- aggregate_all(sum(N), (case2(_,X,_), N is lsb(abs(X))), S), A is S/100.
> > S = 5050,
> > A = 50.5.
> >
> > The fiuzzer reads as follows:
> >
> > fuzzer2 :-
> > between(1, 100, N),
> > L is -(1<<N),
> > H is (1<<N)+1,
> > random(L, H, X),
> > Z is X<<(100-N),
> > Y is float(Z),
> > write(case2(N, Z, Y)), write('.'), nl,
> > fail.
> > fuzzer2.

Pages:123
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor