Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Clothes make the man. Naked people have little or no influence on society. -- Mark Twain


devel / comp.lang.prolog / setof/3 ---> We are all doomed!!!

SubjectAuthor
* setof/3 ---> We are all doomed!!!Mostowski Collapse
+* Re: setof/3 ---> We are all doomed!!!Mostowski Collapse
|`* Re: setof/3 ---> We are all doomed!!!Mostowski Collapse
| `* Re: setof/3 ---> We are all doomed!!!Mostowski Collapse
|  `* Re: setof/3 ---> We are all doomed!!!Mostowski Collapse
|   `* Re: setof/3 ---> We are all doomed!!!Mostowski Collapse
|    `* Re: setof/3 ---> We are all doomed!!!Mostowski Collapse
|     `* Re: setof/3 ---> We are all doomed!!!Mostowski Collapse
|      `* Re: setof/3 ---> We are all doomed!!!Mostowski Collapse
|       +* Re: setof/3 ---> We are all doomed!!!Mostowski Collapse
|       |`* Re: setof/3 ---> We are all doomed!!!Mostowski Collapse
|       | `* Re: setof/3 ---> We are all doomed!!!Mostowski Collapse
|       |  `* Re: setof/3 ---> We are all doomed!!!Mostowski Collapse
|       |   `* Re: setof/3 ---> We are all doomed!!!Mostowski Collapse
|       |    +- Re: setof/3 ---> We are all doomed!!!Mostowski Collapse
|       |    `* Re: setof/3 ---> We are all doomed!!!Mostowski Collapse
|       |     +* Re: setof/3 ---> We are all doomed!!!Mostowski Collapse
|       |     |`* Re: setof/3 ---> We are all doomed!!!Mostowski Collapse
|       |     | +- Re: setof/3 ---> We are all doomed!!!Mostowski Collapse
|       |     | `- Re: setof/3 ---> We are all doomed!!!Mostowski Collapse
|       |     `- Re: setof/3 ---> We are all doomed!!!Mostowski Collapse
|       +- Re: setof/3 ---> We are all doomed!!!Mostowski Collapse
|       `* Re: setof/3 ---> We are all doomed!!!Mostowski Collapse
|        `* Re: setof/3 ---> We are all doomed!!!Mostowski Collapse
|         `* Re: setof/3 ---> We are all doomed!!!Mostowski Collapse
|          `- Re: setof/3 ---> We are all doomed!!!Mostowski Collapse
+* Re: setof/3 ---> We are all doomed!!!Mostowski Collapse
|`* Re: setof/3 ---> We are all doomed!!!Mostowski Collapse
| `* Re: setof/3 ---> We are all doomed!!!Mostowski Collapse
|  `- Re: setof/3 ---> We are all doomed!!!Mostowski Collapse
`* Re: setof/3 ---> We are all doomed!!!Mostowski Collapse
 `- Re: setof/3 ---> We are all doomed!!!Mostowski Collapse

Pages:12
setof/3 ---> We are all doomed!!!

<26510ae4-0332-4804-af7b-dff4085cbd18n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1636&group=comp.lang.prolog#1636

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:620a:2806:b0:6b8:eced:ba3a with SMTP id f6-20020a05620a280600b006b8ecedba3amr1010199qkp.462.1660258815809;
Thu, 11 Aug 2022 16:00:15 -0700 (PDT)
X-Received: by 2002:a81:48c8:0:b0:328:d332:c392 with SMTP id
v191-20020a8148c8000000b00328d332c392mr1502015ywa.263.1660258815526; Thu, 11
Aug 2022 16:00:15 -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: Thu, 11 Aug 2022 16:00:15 -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: <26510ae4-0332-4804-af7b-dff4085cbd18n@googlegroups.com>
Subject: setof/3 ---> We are all doomed!!!
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Thu, 11 Aug 2022 23:00:15 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1739
 by: Mostowski Collapse - Thu, 11 Aug 2022 23:00 UTC

I had a discussion with Sloof Lirpa on Discord. He agrees
with Markus Triskas analysis of aggregate_all/3, an
analysis which can be transmutate to setof/3 from the

ISO core standard: So we would for example:

?- setof(X, member(X, [b,a,c]), [a]).
false.

But adding a constraint (X = a) would make the query succeed:

?- X=a, setof(X, member(X, [b,a,c]), [a]).
X = a.

This non-monotonic behaviour complicates reasoning
about programs considerably, and also makes declarative
debugging (library(debug)) inapplicable. Are there

monotonic alternatives that would be useful in at least
some of the cases in which this non-monotonic construct is
commonly used? It would be great to establish a more

declarative alternative.

Re: setof/3 ---> We are all doomed!!!

<9daa6fd9-5222-4d6d-8f46-349b78a681dbn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1637&group=comp.lang.prolog#1637

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:6214:4017:b0:476:6229:bbf8 with SMTP id kd23-20020a056214401700b004766229bbf8mr1523224qvb.14.1660267323035;
Thu, 11 Aug 2022 18:22:03 -0700 (PDT)
X-Received: by 2002:a81:48c8:0:b0:328:d332:c392 with SMTP id
v191-20020a8148c8000000b00328d332c392mr1885688ywa.263.1660267322826; Thu, 11
Aug 2022 18:22:02 -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: Thu, 11 Aug 2022 18:22:02 -0700 (PDT)
In-Reply-To: <26510ae4-0332-4804-af7b-dff4085cbd18n@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: <26510ae4-0332-4804-af7b-dff4085cbd18n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <9daa6fd9-5222-4d6d-8f46-349b78a681dbn@googlegroups.com>
Subject: Re: setof/3 ---> We are all doomed!!!
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Fri, 12 Aug 2022 01:22:03 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2603
 by: Mostowski Collapse - Fri, 12 Aug 2022 01:22 UTC

Same problem with negation as failure, credits go
to Elias Whitlow. So we would for example have:

?- \+ X = b.
false.
But adding a constraint (X = a) would make the query succeed:

?- X=a, \+ X = b.
X = a.

This non-monotonic behaviour complicates reasoning
about programs considerably, and also makes declarative
debugging (library(debug)) inapplicable. Are there

monotonic alternatives that would be useful in at least
some of the cases in which this non-monotonic construct is
commonly used? It would be great to establish a more

declarative alternative.

Mostowski Collapse schrieb am Freitag, 12. August 2022 um 01:00:22 UTC+2:
> I had a discussion with Sloof Lirpa on Discord. He agrees
> with Markus Triskas analysis of aggregate_all/3, an
> analysis which can be transmutate to setof/3 from the
>
> ISO core standard: So we would for example:
>
> ?- setof(X, member(X, [b,a,c]), [a]).
> false.
>
> But adding a constraint (X = a) would make the query succeed:
>
> ?- X=a, setof(X, member(X, [b,a,c]), [a]).
> X = a.
>
> This non-monotonic behaviour complicates reasoning
> about programs considerably, and also makes declarative
> debugging (library(debug)) inapplicable. Are there
>
> monotonic alternatives that would be useful in at least
> some of the cases in which this non-monotonic construct is
> commonly used? It would be great to establish a more
>
> declarative alternative.

Re: setof/3 ---> We are all doomed!!!

<82d413d1-9235-4a83-94ba-b713c681b690n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1638&group=comp.lang.prolog#1638

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:6214:1c8c:b0:473:408f:ddd6 with SMTP id ib12-20020a0562141c8c00b00473408fddd6mr1768133qvb.74.1660267487069;
Thu, 11 Aug 2022 18:24:47 -0700 (PDT)
X-Received: by 2002:a81:1214:0:b0:324:68f0:9b3a with SMTP id
20-20020a811214000000b0032468f09b3amr2007681yws.140.1660267486852; Thu, 11
Aug 2022 18:24:46 -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: Thu, 11 Aug 2022 18:24:46 -0700 (PDT)
In-Reply-To: <9daa6fd9-5222-4d6d-8f46-349b78a681dbn@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: <26510ae4-0332-4804-af7b-dff4085cbd18n@googlegroups.com> <9daa6fd9-5222-4d6d-8f46-349b78a681dbn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <82d413d1-9235-4a83-94ba-b713c681b690n@googlegroups.com>
Subject: Re: setof/3 ---> We are all doomed!!!
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Fri, 12 Aug 2022 01:24:47 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3132
 by: Mostowski Collapse - Fri, 12 Aug 2022 01:24 UTC

Because of the problems, as long as there are no declarative
solutions around, maybe move these into a new Scryer
Prolog library(iso_impure)? At least the following ISO core

standard predicates would land there:

- (\+)/1
- (->)/2
- (\=)/2
- findall/3
- setof/3
- bagof/3

What else?

Mostowski Collapse schrieb am Freitag, 12. August 2022 um 03:22:03 UTC+2:
> Same problem with negation as failure, credits go
> to Elias Whitlow. So we would for example have:
>
> ?- \+ X = b.
> false.
>
> But adding a constraint (X = a) would make the query succeed:
>
> ?- X=a, \+ X = b.
> X = a.
>
> This non-monotonic behaviour complicates reasoning
> about programs considerably, and also makes declarative
> debugging (library(debug)) inapplicable. Are there
>
> monotonic alternatives that would be useful in at least
> some of the cases in which this non-monotonic construct is
> commonly used? It would be great to establish a more
>
> declarative alternative.
> Mostowski Collapse schrieb am Freitag, 12. August 2022 um 01:00:22 UTC+2:
> > I had a discussion with Sloof Lirpa on Discord. He agrees
> > with Markus Triskas analysis of aggregate_all/3, an
> > analysis which can be transmutate to setof/3 from the
> >
> > ISO core standard: So we would for example:
> >
> > ?- setof(X, member(X, [b,a,c]), [a]).
> > false.
> >
> > But adding a constraint (X = a) would make the query succeed:
> >
> > ?- X=a, setof(X, member(X, [b,a,c]), [a]).
> > X = a.
> >
> > This non-monotonic behaviour complicates reasoning
> > about programs considerably, and also makes declarative
> > debugging (library(debug)) inapplicable. Are there
> >
> > monotonic alternatives that would be useful in at least
> > some of the cases in which this non-monotonic construct is
> > commonly used? It would be great to establish a more
> >
> > declarative alternative.

Re: setof/3 ---> We are all doomed!!!

<cbfe4bf4-f752-469d-ac5c-087557c24c8an@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1639&group=comp.lang.prolog#1639

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:ac8:7d01:0:b0:343:5914:6419 with SMTP id g1-20020ac87d01000000b0034359146419mr2264490qtb.538.1660285478286;
Thu, 11 Aug 2022 23:24:38 -0700 (PDT)
X-Received: by 2002:a05:6902:1148:b0:67b:7301:62f4 with SMTP id
p8-20020a056902114800b0067b730162f4mr2317197ybu.570.1660285478091; Thu, 11
Aug 2022 23:24:38 -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: Thu, 11 Aug 2022 23:24:37 -0700 (PDT)
In-Reply-To: <82d413d1-9235-4a83-94ba-b713c681b690n@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: <26510ae4-0332-4804-af7b-dff4085cbd18n@googlegroups.com>
<9daa6fd9-5222-4d6d-8f46-349b78a681dbn@googlegroups.com> <82d413d1-9235-4a83-94ba-b713c681b690n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <cbfe4bf4-f752-469d-ac5c-087557c24c8an@googlegroups.com>
Subject: Re: setof/3 ---> We are all doomed!!!
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Fri, 12 Aug 2022 06:24:38 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1719
 by: Mostowski Collapse - Fri, 12 Aug 2022 06:24 UTC

Looks like its dooms day for most of ISO core standard and that the
language is completely wrecked. That (==)/2, ground/1 and nonvar/1
are also suspicious is seen here:

(==)/2 is non-monotonoic:
```
?- X == a.
false.

?- X = a, X == a.
X = a.
```
Further ground/1 is non-monotonoic:
```
?- ground(f(X)).
false.

?- X = a, ground(f(X)).
X = a.
```
Finally nonvar/1 is non-monotonic:
```
?- nonvar(X).
false.

?- X = a, nonvar(X).
X = a.
```

Re: setof/3 ---> We are all doomed!!!

<899f99f6-f6b6-4cf4-8f7b-1ad240007995n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1640&group=comp.lang.prolog#1640

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a0c:a88a:0:b0:474:7f16:f272 with SMTP id x10-20020a0ca88a000000b004747f16f272mr2219629qva.4.1660286393655;
Thu, 11 Aug 2022 23:39:53 -0700 (PDT)
X-Received: by 2002:a81:9245:0:b0:31f:4e3e:363d with SMTP id
j66-20020a819245000000b0031f4e3e363dmr2635213ywg.119.1660286393410; Thu, 11
Aug 2022 23:39:53 -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: Thu, 11 Aug 2022 23:39:53 -0700 (PDT)
In-Reply-To: <cbfe4bf4-f752-469d-ac5c-087557c24c8an@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: <26510ae4-0332-4804-af7b-dff4085cbd18n@googlegroups.com>
<9daa6fd9-5222-4d6d-8f46-349b78a681dbn@googlegroups.com> <82d413d1-9235-4a83-94ba-b713c681b690n@googlegroups.com>
<cbfe4bf4-f752-469d-ac5c-087557c24c8an@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <899f99f6-f6b6-4cf4-8f7b-1ad240007995n@googlegroups.com>
Subject: Re: setof/3 ---> We are all doomed!!!
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Fri, 12 Aug 2022 06:39:53 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2329
 by: Mostowski Collapse - Fri, 12 Aug 2022 06:39 UTC

Possibly sort/2 is also non-monotonic. Although the situation is
slightly different. In Scryer Prolog the predicate, when used in
a conjunction, can switch from false to error:

?- sort([1,2,3], X), X = [].
false.

?- X = a, sort([1,2,3], X), X = [].
error(type_error(list,a),sort/2).

So I guess Markus Triskas observation also applies to sort/2?
And possibly also to keysort/2?

Mostowski Collapse schrieb am Freitag, 12. August 2022 um 08:24:39 UTC+2:
> Looks like its dooms day for most of ISO core standard and that the
> language is completely wrecked. That (==)/2, ground/1 and nonvar/1
> are also suspicious is seen here:
>
> (==)/2 is non-monotonoic:
> ```
> ?- X == a.
> false.
>
> ?- X = a, X == a.
> X = a.
> ```
> Further ground/1 is non-monotonoic:
> ```
> ?- ground(f(X)).
> false.
>
> ?- X = a, ground(f(X)).
> X = a.
> ```
> Finally nonvar/1 is non-monotonic:
> ```
> ?- nonvar(X).
> false.
>
> ?- X = a, nonvar(X).
> X = a.
> ```

Re: setof/3 ---> We are all doomed!!!

<ab32f3f7-8b59-48bb-890e-a45c683efd21n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1641&group=comp.lang.prolog#1641

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:622a:1646:b0:33c:cecc:96e4 with SMTP id y6-20020a05622a164600b0033ccecc96e4mr2418168qtj.350.1660287039115;
Thu, 11 Aug 2022 23:50:39 -0700 (PDT)
X-Received: by 2002:a81:48c8:0:b0:328:d332:c392 with SMTP id
v191-20020a8148c8000000b00328d332c392mr2647051ywa.263.1660287038888; Thu, 11
Aug 2022 23:50:38 -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: Thu, 11 Aug 2022 23:50:38 -0700 (PDT)
In-Reply-To: <899f99f6-f6b6-4cf4-8f7b-1ad240007995n@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: <26510ae4-0332-4804-af7b-dff4085cbd18n@googlegroups.com>
<9daa6fd9-5222-4d6d-8f46-349b78a681dbn@googlegroups.com> <82d413d1-9235-4a83-94ba-b713c681b690n@googlegroups.com>
<cbfe4bf4-f752-469d-ac5c-087557c24c8an@googlegroups.com> <899f99f6-f6b6-4cf4-8f7b-1ad240007995n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <ab32f3f7-8b59-48bb-890e-a45c683efd21n@googlegroups.com>
Subject: Re: setof/3 ---> We are all doomed!!!
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Fri, 12 Aug 2022 06:50:39 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3037
 by: Mostowski Collapse - Fri, 12 Aug 2022 06:50 UTC

The is a real abyss in Prolog of non-monotonic predicates.
Same problem with length/2 from library(lists) in Scryer Prolog,
also non-monotonic:

?- use_module(library(lists)).
true.

?- length([1,2,3], X), X = a.
false.

?- X = a, length([1,2,3], X), X = a.
error(type_error(integer,a),length/2).

It would be maybe better if Prolog had no exceptions, and
would simply fail in such situations where it expects an integer,
and receives something else instead.

Mostowski Collapse schrieb am Freitag, 12. August 2022 um 08:39:54 UTC+2:
> Possibly sort/2 is also non-monotonic. Although the situation is
> slightly different. In Scryer Prolog the predicate, when used in
> a conjunction, can switch from false to error:
>
> ?- sort([1,2,3], X), X = [].
> false.
>
> ?- X = a, sort([1,2,3], X), X = [].
> error(type_error(list,a),sort/2).
>
> So I guess Markus Triskas observation also applies to sort/2?
> And possibly also to keysort/2?
> Mostowski Collapse schrieb am Freitag, 12. August 2022 um 08:24:39 UTC+2:
> > Looks like its dooms day for most of ISO core standard and that the
> > language is completely wrecked. That (==)/2, ground/1 and nonvar/1
> > are also suspicious is seen here:
> >
> > (==)/2 is non-monotonoic:
> > ```
> > ?- X == a.
> > false.
> >
> > ?- X = a, X == a.
> > X = a.
> > ```
> > Further ground/1 is non-monotonoic:
> > ```
> > ?- ground(f(X)).
> > false.
> >
> > ?- X = a, ground(f(X)).
> > X = a.
> > ```
> > Finally nonvar/1 is non-monotonic:
> > ```
> > ?- nonvar(X).
> > false.
> >
> > ?- X = a, nonvar(X).
> > X = a.
> > ```

Re: setof/3 ---> We are all doomed!!!

<86884d18-6cfd-4b96-84e2-83ff7097e283n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1642&group=comp.lang.prolog#1642

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:620a:2909:b0:6b6:a94:a988 with SMTP id m9-20020a05620a290900b006b60a94a988mr1945888qkp.350.1660287417424;
Thu, 11 Aug 2022 23:56:57 -0700 (PDT)
X-Received: by 2002:a25:c2c5:0:b0:682:2eda:b5ae with SMTP id
s188-20020a25c2c5000000b006822edab5aemr2336636ybf.466.1660287413923; Thu, 11
Aug 2022 23:56:53 -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: Thu, 11 Aug 2022 23:56:53 -0700 (PDT)
In-Reply-To: <ab32f3f7-8b59-48bb-890e-a45c683efd21n@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: <26510ae4-0332-4804-af7b-dff4085cbd18n@googlegroups.com>
<9daa6fd9-5222-4d6d-8f46-349b78a681dbn@googlegroups.com> <82d413d1-9235-4a83-94ba-b713c681b690n@googlegroups.com>
<cbfe4bf4-f752-469d-ac5c-087557c24c8an@googlegroups.com> <899f99f6-f6b6-4cf4-8f7b-1ad240007995n@googlegroups.com>
<ab32f3f7-8b59-48bb-890e-a45c683efd21n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <86884d18-6cfd-4b96-84e2-83ff7097e283n@googlegroups.com>
Subject: Re: setof/3 ---> We are all doomed!!!
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Fri, 12 Aug 2022 06:56:57 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2016
 by: Mostowski Collapse - Fri, 12 Aug 2022 06:56 UTC

For better declarativity, possibly some predicates need to be
made to fail, instead of throw an error, if they receive an
argument of the wrong type, like here:

?- length([1,2,3], a).
error(type_error(integer,a),length/2).

More declarative behaviour, based on Markus Triskas
observation, would be:

?- length([1,2,3], a).
false

Does Scryer Prolog already have a switch to switch off exceptions?
SWI-Prolog discourse had a long discussion errors considered
harmful dealing with this issue.

https://swi-prolog.discourse.group/t/errors-considered-harmful/3574/88

Re: setof/3 ---> We are all doomed!!!

<c0be3dea-ac4e-4c7c-8e0e-5b12c6bf09c2n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1643&group=comp.lang.prolog#1643

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a37:43d4:0:b0:6b8:e3ba:ddfc with SMTP id q203-20020a3743d4000000b006b8e3baddfcmr1971385qka.192.1660290812247;
Fri, 12 Aug 2022 00:53:32 -0700 (PDT)
X-Received: by 2002:a25:c2c5:0:b0:682:2eda:b5ae with SMTP id
s188-20020a25c2c5000000b006822edab5aemr2453546ybf.466.1660290812094; Fri, 12
Aug 2022 00:53:32 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Fri, 12 Aug 2022 00:53:31 -0700 (PDT)
In-Reply-To: <86884d18-6cfd-4b96-84e2-83ff7097e283n@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: <26510ae4-0332-4804-af7b-dff4085cbd18n@googlegroups.com>
<9daa6fd9-5222-4d6d-8f46-349b78a681dbn@googlegroups.com> <82d413d1-9235-4a83-94ba-b713c681b690n@googlegroups.com>
<cbfe4bf4-f752-469d-ac5c-087557c24c8an@googlegroups.com> <899f99f6-f6b6-4cf4-8f7b-1ad240007995n@googlegroups.com>
<ab32f3f7-8b59-48bb-890e-a45c683efd21n@googlegroups.com> <86884d18-6cfd-4b96-84e2-83ff7097e283n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <c0be3dea-ac4e-4c7c-8e0e-5b12c6bf09c2n@googlegroups.com>
Subject: Re: setof/3 ---> We are all doomed!!!
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Fri, 12 Aug 2022 07:53:32 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2652
 by: Mostowski Collapse - Fri, 12 Aug 2022 07:53 UTC

> I had a discussion with Sloof Lirpa on Discord.

Anyway, who cares about non-monotonicity? Why would
one want to shoehorne declarativity into Prolog, when
it is a procedural and declarative language?

Just use a theorem prover if you want more extended
declarativity, covering more logical constructs than
those that Prolog offers.

Maybe this theorem prover is even written in Prolog!

Sloof Lirpa = April Fools

Have a nice Weekend everybody!

Mostowski Collapse schrieb am Freitag, 12. August 2022 um 08:56:58 UTC+2:
> For better declarativity, possibly some predicates need to be
> made to fail, instead of throw an error, if they receive an
> argument of the wrong type, like here:
>
> ?- length([1,2,3], a).
> error(type_error(integer,a),length/2).
>
> More declarative behaviour, based on Markus Triskas
> observation, would be:
>
> ?- length([1,2,3], a).
> false
>
> Does Scryer Prolog already have a switch to switch off exceptions?
> SWI-Prolog discourse had a long discussion errors considered
> harmful dealing with this issue.
>
> https://swi-prolog.discourse.group/t/errors-considered-harmful/3574/88

Re: setof/3 ---> We are all doomed!!!

<c900eb05-48b8-4fe9-8ce7-625a245c3138n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1653&group=comp.lang.prolog#1653

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:ac8:590a:0:b0:343:8c4:1db9 with SMTP id 10-20020ac8590a000000b0034308c41db9mr8801438qty.465.1660428187914;
Sat, 13 Aug 2022 15:03:07 -0700 (PDT)
X-Received: by 2002:a25:db50:0:b0:671:75aa:bf47 with SMTP id
g77-20020a25db50000000b0067175aabf47mr7263433ybf.20.1660428187587; Sat, 13
Aug 2022 15:03:07 -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: Sat, 13 Aug 2022 15:03:07 -0700 (PDT)
In-Reply-To: <c0be3dea-ac4e-4c7c-8e0e-5b12c6bf09c2n@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: <26510ae4-0332-4804-af7b-dff4085cbd18n@googlegroups.com>
<9daa6fd9-5222-4d6d-8f46-349b78a681dbn@googlegroups.com> <82d413d1-9235-4a83-94ba-b713c681b690n@googlegroups.com>
<cbfe4bf4-f752-469d-ac5c-087557c24c8an@googlegroups.com> <899f99f6-f6b6-4cf4-8f7b-1ad240007995n@googlegroups.com>
<ab32f3f7-8b59-48bb-890e-a45c683efd21n@googlegroups.com> <86884d18-6cfd-4b96-84e2-83ff7097e283n@googlegroups.com>
<c0be3dea-ac4e-4c7c-8e0e-5b12c6bf09c2n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <c900eb05-48b8-4fe9-8ce7-625a245c3138n@googlegroups.com>
Subject: Re: setof/3 ---> We are all doomed!!!
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Sat, 13 Aug 2022 22:03:07 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1701
 by: Mostowski Collapse - Sat, 13 Aug 2022 22:03 UTC

Here is the Scryer Prolog challenge:

fCube: an efficient prover for Intuitionistic propositional Logic
https://rextester.com/SEOO25214

Can you make it run?

Re: setof/3 ---> We are all doomed!!!

<a11e9978-0239-4df4-a5fa-fdeb622a2a23n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1654&group=comp.lang.prolog#1654

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:620a:2889:b0:6b6:5410:b2c7 with SMTP id j9-20020a05620a288900b006b65410b2c7mr7095663qkp.697.1660428970248;
Sat, 13 Aug 2022 15:16:10 -0700 (PDT)
X-Received: by 2002:a81:d353:0:b0:31e:2888:93a1 with SMTP id
d19-20020a81d353000000b0031e288893a1mr8201865ywl.498.1660428970004; Sat, 13
Aug 2022 15:16:10 -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: Sat, 13 Aug 2022 15:16:09 -0700 (PDT)
In-Reply-To: <c900eb05-48b8-4fe9-8ce7-625a245c3138n@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: <26510ae4-0332-4804-af7b-dff4085cbd18n@googlegroups.com>
<9daa6fd9-5222-4d6d-8f46-349b78a681dbn@googlegroups.com> <82d413d1-9235-4a83-94ba-b713c681b690n@googlegroups.com>
<cbfe4bf4-f752-469d-ac5c-087557c24c8an@googlegroups.com> <899f99f6-f6b6-4cf4-8f7b-1ad240007995n@googlegroups.com>
<ab32f3f7-8b59-48bb-890e-a45c683efd21n@googlegroups.com> <86884d18-6cfd-4b96-84e2-83ff7097e283n@googlegroups.com>
<c0be3dea-ac4e-4c7c-8e0e-5b12c6bf09c2n@googlegroups.com> <c900eb05-48b8-4fe9-8ce7-625a245c3138n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <a11e9978-0239-4df4-a5fa-fdeb622a2a23n@googlegroups.com>
Subject: Re: setof/3 ---> We are all doomed!!!
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Sat, 13 Aug 2022 22:16:10 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2034
 by: Mostowski Collapse - Sat, 13 Aug 2022 22:16 UTC

The struggle is real, possibly a result of Fastfood McDonald
approach to Prolog? Dunno. Call the language BigMacLog then?

https://github.com/mthom/scryer-prolog/issues/1564

Mostowski Collapse schrieb am Sonntag, 14. August 2022 um 00:03:08 UTC+2:
> Here is the Scryer Prolog challenge:
>
> fCube: an efficient prover for Intuitionistic propositional Logic
> https://rextester.com/SEOO25214
>
> Can you make it run?

Re: setof/3 ---> We are all doomed!!!

<da91ed38-a6ec-4e53-9144-5eea1b9c88f7n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1655&group=comp.lang.prolog#1655

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:622a:86:b0:342:f620:dc7a with SMTP id o6-20020a05622a008600b00342f620dc7amr8875650qtw.594.1660429409305;
Sat, 13 Aug 2022 15:23:29 -0700 (PDT)
X-Received: by 2002:a25:2f53:0:b0:67c:26ee:2aff with SMTP id
v80-20020a252f53000000b0067c26ee2affmr6961231ybv.281.1660429409034; Sat, 13
Aug 2022 15:23:29 -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: Sat, 13 Aug 2022 15:23:28 -0700 (PDT)
In-Reply-To: <a11e9978-0239-4df4-a5fa-fdeb622a2a23n@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: <26510ae4-0332-4804-af7b-dff4085cbd18n@googlegroups.com>
<9daa6fd9-5222-4d6d-8f46-349b78a681dbn@googlegroups.com> <82d413d1-9235-4a83-94ba-b713c681b690n@googlegroups.com>
<cbfe4bf4-f752-469d-ac5c-087557c24c8an@googlegroups.com> <899f99f6-f6b6-4cf4-8f7b-1ad240007995n@googlegroups.com>
<ab32f3f7-8b59-48bb-890e-a45c683efd21n@googlegroups.com> <86884d18-6cfd-4b96-84e2-83ff7097e283n@googlegroups.com>
<c0be3dea-ac4e-4c7c-8e0e-5b12c6bf09c2n@googlegroups.com> <c900eb05-48b8-4fe9-8ce7-625a245c3138n@googlegroups.com>
<a11e9978-0239-4df4-a5fa-fdeb622a2a23n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <da91ed38-a6ec-4e53-9144-5eea1b9c88f7n@googlegroups.com>
Subject: Re: setof/3 ---> We are all doomed!!!
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Sat, 13 Aug 2022 22:23:29 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2540
 by: Mostowski Collapse - Sat, 13 Aug 2022 22:23 UTC

For example subtract/3 has complexity

O(n*m)

And ord_subtract/3, if you do it wrong, and
insert sort/2 everywhere, has complexity:

O(n*log n + m*log m)

subtract/3 is better than ord_subtract/3 for m<<n.
But if you manage to elminate the sort/2,

then ord_subtract/2 is only O(n+m) and better again.
So there is a lot to deliberate.

Mostowski Collapse schrieb am Sonntag, 14. August 2022 um 00:16:11 UTC+2:
> The struggle is real, possibly a result of Fastfood McDonald
> approach to Prolog? Dunno. Call the language BigMacLog then?
>
> https://github.com/mthom/scryer-prolog/issues/1564
> Mostowski Collapse schrieb am Sonntag, 14. August 2022 um 00:03:08 UTC+2:
> > Here is the Scryer Prolog challenge:
> >
> > fCube: an efficient prover for Intuitionistic propositional Logic
> > https://rextester.com/SEOO25214
> >
> > Can you make it run?

Re: setof/3 ---> We are all doomed!!!

<5019ab73-8f4c-4ef0-9c3e-d57f396aa1e8n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1656&group=comp.lang.prolog#1656

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:620a:2b86:b0:6b9:4a51:98f6 with SMTP id dz6-20020a05620a2b8600b006b94a5198f6mr7082365qkb.36.1660432173331;
Sat, 13 Aug 2022 16:09:33 -0700 (PDT)
X-Received: by 2002:a25:2f53:0:b0:67c:26ee:2aff with SMTP id
v80-20020a252f53000000b0067c26ee2affmr7024403ybv.281.1660432173119; Sat, 13
Aug 2022 16:09:33 -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: Sat, 13 Aug 2022 16:09:32 -0700 (PDT)
In-Reply-To: <da91ed38-a6ec-4e53-9144-5eea1b9c88f7n@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: <26510ae4-0332-4804-af7b-dff4085cbd18n@googlegroups.com>
<9daa6fd9-5222-4d6d-8f46-349b78a681dbn@googlegroups.com> <82d413d1-9235-4a83-94ba-b713c681b690n@googlegroups.com>
<cbfe4bf4-f752-469d-ac5c-087557c24c8an@googlegroups.com> <899f99f6-f6b6-4cf4-8f7b-1ad240007995n@googlegroups.com>
<ab32f3f7-8b59-48bb-890e-a45c683efd21n@googlegroups.com> <86884d18-6cfd-4b96-84e2-83ff7097e283n@googlegroups.com>
<c0be3dea-ac4e-4c7c-8e0e-5b12c6bf09c2n@googlegroups.com> <c900eb05-48b8-4fe9-8ce7-625a245c3138n@googlegroups.com>
<a11e9978-0239-4df4-a5fa-fdeb622a2a23n@googlegroups.com> <da91ed38-a6ec-4e53-9144-5eea1b9c88f7n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <5019ab73-8f4c-4ef0-9c3e-d57f396aa1e8n@googlegroups.com>
Subject: Re: setof/3 ---> We are all doomed!!!
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Sat, 13 Aug 2022 23:09:33 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3967
 by: Mostowski Collapse - Sat, 13 Aug 2022 23:09 UTC

Why Aprils Fool? Well this here was 10 Apr 2021, almost Aprils Fool day:

How it started:

Scryer Prolog sets a new standard for efficient encoding of lists of
characters, which we mean when we say "strings" in the context of
Scryer Prolog. A key advantage of the efficient encoding is that

DCGs can be used for describing the string, since it is simply a list.
A good infrastructure for processing JSON with Scryer Prolog uses
this representation, and describes JSON format with a DCG.
https://github.com/mthom/scryer-prolog/discussions/892

How its going:

$ target/release/scryer-prolog -v
"v0.9.0-181-g8e9302ea"
$ target/release/scryer-prolog
?- time((between(1,1000,_), data(X), json_chars(Y,X,[]), fail; true)).
% CPU time: 1.953s
true.

/* SWI-Prolog (threaded, 64 bits, version 8.5.14) */
?- time((between(1,1000,_), data(X), atom_json_term(X,Y,[]), fail; true)).
% 48,000 inferences, 0.000 CPU in 0.007 seconds (0% CPU, Infinite Lips)
true.

The test data was simply:

data("{ \"a\":123 }").

I got the idea for this nasty test data, after inspecting the source code
of the new library(serialization/json). Just compare to what Jan W. is doing.

Mostowski Collapse schrieb am Sonntag, 14. August 2022 um 00:23:30 UTC+2:
> For example subtract/3 has complexity
>
> O(n*m)
>
> And ord_subtract/3, if you do it wrong, and
> insert sort/2 everywhere, has complexity:
>
> O(n*log n + m*log m)
>
> subtract/3 is better than ord_subtract/3 for m<<n.
> But if you manage to elminate the sort/2,
>
> then ord_subtract/2 is only O(n+m) and better again.
> So there is a lot to deliberate.
> Mostowski Collapse schrieb am Sonntag, 14. August 2022 um 00:16:11 UTC+2:
> > The struggle is real, possibly a result of Fastfood McDonald
> > approach to Prolog? Dunno. Call the language BigMacLog then?
> >
> > https://github.com/mthom/scryer-prolog/issues/1564
> > Mostowski Collapse schrieb am Sonntag, 14. August 2022 um 00:03:08 UTC+2:
> > > Here is the Scryer Prolog challenge:
> > >
> > > fCube: an efficient prover for Intuitionistic propositional Logic
> > > https://rextester.com/SEOO25214
> > >
> > > Can you make it run?

Re: setof/3 ---> We are all doomed!!!

<c06d4179-ce34-48e8-80da-c345f0926157n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1657&group=comp.lang.prolog#1657

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:622a:306:b0:343:416d:76ae with SMTP id q6-20020a05622a030600b00343416d76aemr9064354qtw.337.1660432687714;
Sat, 13 Aug 2022 16:18:07 -0700 (PDT)
X-Received: by 2002:a0d:ea85:0:b0:31f:4a57:24e8 with SMTP id
t127-20020a0dea85000000b0031f4a5724e8mr8581112ywe.20.1660432687286; Sat, 13
Aug 2022 16:18:07 -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: Sat, 13 Aug 2022 16:18:07 -0700 (PDT)
In-Reply-To: <5019ab73-8f4c-4ef0-9c3e-d57f396aa1e8n@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: <26510ae4-0332-4804-af7b-dff4085cbd18n@googlegroups.com>
<9daa6fd9-5222-4d6d-8f46-349b78a681dbn@googlegroups.com> <82d413d1-9235-4a83-94ba-b713c681b690n@googlegroups.com>
<cbfe4bf4-f752-469d-ac5c-087557c24c8an@googlegroups.com> <899f99f6-f6b6-4cf4-8f7b-1ad240007995n@googlegroups.com>
<ab32f3f7-8b59-48bb-890e-a45c683efd21n@googlegroups.com> <86884d18-6cfd-4b96-84e2-83ff7097e283n@googlegroups.com>
<c0be3dea-ac4e-4c7c-8e0e-5b12c6bf09c2n@googlegroups.com> <c900eb05-48b8-4fe9-8ce7-625a245c3138n@googlegroups.com>
<a11e9978-0239-4df4-a5fa-fdeb622a2a23n@googlegroups.com> <da91ed38-a6ec-4e53-9144-5eea1b9c88f7n@googlegroups.com>
<5019ab73-8f4c-4ef0-9c3e-d57f396aa1e8n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <c06d4179-ce34-48e8-80da-c345f0926157n@googlegroups.com>
Subject: Re: setof/3 ---> We are all doomed!!!
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Sat, 13 Aug 2022 23:18:07 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 4290
 by: Mostowski Collapse - Sat, 13 Aug 2022 23:18 UTC

New JSON parser is extremly slow
https://github.com/mthom/scryer-prolog/issues/1566

Mostowski Collapse schrieb am Sonntag, 14. August 2022 um 01:09:34 UTC+2:
> Why Aprils Fool? Well this here was 10 Apr 2021, almost Aprils Fool day:
>
> How it started:
>
> Scryer Prolog sets a new standard for efficient encoding of lists of
> characters, which we mean when we say "strings" in the context of
> Scryer Prolog. A key advantage of the efficient encoding is that
>
> DCGs can be used for describing the string, since it is simply a list.
> A good infrastructure for processing JSON with Scryer Prolog uses
> this representation, and describes JSON format with a DCG.
> https://github.com/mthom/scryer-prolog/discussions/892
>
> How its going:
>
> $ target/release/scryer-prolog -v
> "v0.9.0-181-g8e9302ea"
> $ target/release/scryer-prolog
> ?- time((between(1,1000,_), data(X), json_chars(Y,X,[]), fail; true)).
> % CPU time: 1.953s
> true.
>
> /* SWI-Prolog (threaded, 64 bits, version 8.5.14) */
> ?- time((between(1,1000,_), data(X), atom_json_term(X,Y,[]), fail; true)).
> % 48,000 inferences, 0.000 CPU in 0.007 seconds (0% CPU, Infinite Lips)
> true.
>
> The test data was simply:
>
> data("{ \"a\":123 }").
>
> I got the idea for this nasty test data, after inspecting the source code
> of the new library(serialization/json). Just compare to what Jan W. is doing.
> Mostowski Collapse schrieb am Sonntag, 14. August 2022 um 00:23:30 UTC+2:
> > For example subtract/3 has complexity
> >
> > O(n*m)
> >
> > And ord_subtract/3, if you do it wrong, and
> > insert sort/2 everywhere, has complexity:
> >
> > O(n*log n + m*log m)
> >
> > subtract/3 is better than ord_subtract/3 for m<<n.
> > But if you manage to elminate the sort/2,
> >
> > then ord_subtract/2 is only O(n+m) and better again.
> > So there is a lot to deliberate.
> > Mostowski Collapse schrieb am Sonntag, 14. August 2022 um 00:16:11 UTC+2:
> > > The struggle is real, possibly a result of Fastfood McDonald
> > > approach to Prolog? Dunno. Call the language BigMacLog then?
> > >
> > > https://github.com/mthom/scryer-prolog/issues/1564
> > > Mostowski Collapse schrieb am Sonntag, 14. August 2022 um 00:03:08 UTC+2:
> > > > Here is the Scryer Prolog challenge:
> > > >
> > > > fCube: an efficient prover for Intuitionistic propositional Logic
> > > > https://rextester.com/SEOO25214
> > > >
> > > > Can you make it run?

Re: setof/3 ---> We are all doomed!!!

<ae14cf17-5652-48f7-96a6-cdc952289145n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1658&group=comp.lang.prolog#1658

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:ac8:5c91:0:b0:31f:2385:3633 with SMTP id r17-20020ac85c91000000b0031f23853633mr8909494qta.674.1660434307659;
Sat, 13 Aug 2022 16:45:07 -0700 (PDT)
X-Received: by 2002:a25:ac46:0:b0:682:fb26:ea39 with SMTP id
r6-20020a25ac46000000b00682fb26ea39mr6257000ybd.91.1660434307289; Sat, 13 Aug
2022 16:45:07 -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: Sat, 13 Aug 2022 16:45:07 -0700 (PDT)
In-Reply-To: <c06d4179-ce34-48e8-80da-c345f0926157n@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: <26510ae4-0332-4804-af7b-dff4085cbd18n@googlegroups.com>
<9daa6fd9-5222-4d6d-8f46-349b78a681dbn@googlegroups.com> <82d413d1-9235-4a83-94ba-b713c681b690n@googlegroups.com>
<cbfe4bf4-f752-469d-ac5c-087557c24c8an@googlegroups.com> <899f99f6-f6b6-4cf4-8f7b-1ad240007995n@googlegroups.com>
<ab32f3f7-8b59-48bb-890e-a45c683efd21n@googlegroups.com> <86884d18-6cfd-4b96-84e2-83ff7097e283n@googlegroups.com>
<c0be3dea-ac4e-4c7c-8e0e-5b12c6bf09c2n@googlegroups.com> <c900eb05-48b8-4fe9-8ce7-625a245c3138n@googlegroups.com>
<a11e9978-0239-4df4-a5fa-fdeb622a2a23n@googlegroups.com> <da91ed38-a6ec-4e53-9144-5eea1b9c88f7n@googlegroups.com>
<5019ab73-8f4c-4ef0-9c3e-d57f396aa1e8n@googlegroups.com> <c06d4179-ce34-48e8-80da-c345f0926157n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <ae14cf17-5652-48f7-96a6-cdc952289145n@googlegroups.com>
Subject: Re: setof/3 ---> We are all doomed!!!
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Sat, 13 Aug 2022 23:45:07 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 5401
 by: Mostowski Collapse - Sat, 13 Aug 2022 23:45 UTC

Here some penny of thought. If Scryer Prolog would:

1. Rethink the notion of pure, and incorporate some
results of logic programming concerning SLDNF

2. Allow (+)//1 in DCG, which was refused here
on dubious grounds:

https://github.com/mthom/scryer-prolog/issues/1479

Then it could abandon the old fashioned DCG, were D is taken
literally as definite, i.e. without negation and pure. And it could
move towards the more modern grammar formalism:

parsing expression grammar (PEG)
https://en.wikipedia.org/wiki/Parsing_expression_grammar

Its quite easy to map PEG to DCG, where D is not interpreted
that strict. And this can give much more efficient parsers, that
are at the same time concise and declarative.

Edit 14.08.2022
Even the Ruby ISO standard uses some PEG inspired formalism
for their grammar. Check it out.

Mostowski Collapse schrieb am Sonntag, 14. August 2022 um 01:18:08 UTC+2:
> New JSON parser is extremly slow
> https://github.com/mthom/scryer-prolog/issues/1566
> Mostowski Collapse schrieb am Sonntag, 14. August 2022 um 01:09:34 UTC+2:
> > Why Aprils Fool? Well this here was 10 Apr 2021, almost Aprils Fool day:
> >
> > How it started:
> >
> > Scryer Prolog sets a new standard for efficient encoding of lists of
> > characters, which we mean when we say "strings" in the context of
> > Scryer Prolog. A key advantage of the efficient encoding is that
> >
> > DCGs can be used for describing the string, since it is simply a list.
> > A good infrastructure for processing JSON with Scryer Prolog uses
> > this representation, and describes JSON format with a DCG.
> > https://github.com/mthom/scryer-prolog/discussions/892
> >
> > How its going:
> >
> > $ target/release/scryer-prolog -v
> > "v0.9.0-181-g8e9302ea"
> > $ target/release/scryer-prolog
> > ?- time((between(1,1000,_), data(X), json_chars(Y,X,[]), fail; true)).
> > % CPU time: 1.953s
> > true.
> >
> > /* SWI-Prolog (threaded, 64 bits, version 8.5.14) */
> > ?- time((between(1,1000,_), data(X), atom_json_term(X,Y,[]), fail; true)).
> > % 48,000 inferences, 0.000 CPU in 0.007 seconds (0% CPU, Infinite Lips)
> > true.
> >
> > The test data was simply:
> >
> > data("{ \"a\":123 }").
> >
> > I got the idea for this nasty test data, after inspecting the source code
> > of the new library(serialization/json). Just compare to what Jan W. is doing.
> > Mostowski Collapse schrieb am Sonntag, 14. August 2022 um 00:23:30 UTC+2:
> > > For example subtract/3 has complexity
> > >
> > > O(n*m)
> > >
> > > And ord_subtract/3, if you do it wrong, and
> > > insert sort/2 everywhere, has complexity:
> > >
> > > O(n*log n + m*log m)
> > >
> > > subtract/3 is better than ord_subtract/3 for m<<n.
> > > But if you manage to elminate the sort/2,
> > >
> > > then ord_subtract/2 is only O(n+m) and better again.
> > > So there is a lot to deliberate.
> > > Mostowski Collapse schrieb am Sonntag, 14. August 2022 um 00:16:11 UTC+2:
> > > > The struggle is real, possibly a result of Fastfood McDonald
> > > > approach to Prolog? Dunno. Call the language BigMacLog then?
> > > >
> > > > https://github.com/mthom/scryer-prolog/issues/1564
> > > > Mostowski Collapse schrieb am Sonntag, 14. August 2022 um 00:03:08 UTC+2:
> > > > > Here is the Scryer Prolog challenge:
> > > > >
> > > > > fCube: an efficient prover for Intuitionistic propositional Logic
> > > > > https://rextester.com/SEOO25214
> > > > >
> > > > > Can you make it run?

Re: setof/3 ---> We are all doomed!!!

<f467279c-09a6-4314-a0e4-8a7e7005f4dbn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1659&group=comp.lang.prolog#1659

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:622a:389:b0:342:f779:ded8 with SMTP id j9-20020a05622a038900b00342f779ded8mr8677919qtx.111.1660434896000;
Sat, 13 Aug 2022 16:54:56 -0700 (PDT)
X-Received: by 2002:a25:c013:0:b0:671:8102:eb2 with SMTP id
c19-20020a25c013000000b0067181020eb2mr7787483ybf.316.1660434895717; Sat, 13
Aug 2022 16:54:55 -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: Sat, 13 Aug 2022 16:54:55 -0700 (PDT)
In-Reply-To: <ae14cf17-5652-48f7-96a6-cdc952289145n@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: <26510ae4-0332-4804-af7b-dff4085cbd18n@googlegroups.com>
<9daa6fd9-5222-4d6d-8f46-349b78a681dbn@googlegroups.com> <82d413d1-9235-4a83-94ba-b713c681b690n@googlegroups.com>
<cbfe4bf4-f752-469d-ac5c-087557c24c8an@googlegroups.com> <899f99f6-f6b6-4cf4-8f7b-1ad240007995n@googlegroups.com>
<ab32f3f7-8b59-48bb-890e-a45c683efd21n@googlegroups.com> <86884d18-6cfd-4b96-84e2-83ff7097e283n@googlegroups.com>
<c0be3dea-ac4e-4c7c-8e0e-5b12c6bf09c2n@googlegroups.com> <c900eb05-48b8-4fe9-8ce7-625a245c3138n@googlegroups.com>
<a11e9978-0239-4df4-a5fa-fdeb622a2a23n@googlegroups.com> <da91ed38-a6ec-4e53-9144-5eea1b9c88f7n@googlegroups.com>
<5019ab73-8f4c-4ef0-9c3e-d57f396aa1e8n@googlegroups.com> <c06d4179-ce34-48e8-80da-c345f0926157n@googlegroups.com>
<ae14cf17-5652-48f7-96a6-cdc952289145n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <f467279c-09a6-4314-a0e4-8a7e7005f4dbn@googlegroups.com>
Subject: Re: setof/3 ---> We are all doomed!!!
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Sat, 13 Aug 2022 23:54:55 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 4976
 by: Mostowski Collapse - Sat, 13 Aug 2022 23:54 UTC

But with (\+)//1 you might have still spurious choice points,
which slows down a Prolog system. The ultimate fun begins when
you use cut (!)/0 and know its a kind of (\+)//1.

But you could also try to refactor the JSON DCG, find more
common prefixes in the parser, and try something definite, i.e.
pure and without negation. But you then possibly wont get

rid of spurious choice points. Maybe if you do some tricks
with multiple argument indexing, if the indexing also catches
the DCG input? Not sure, maybe?

Mostowski Collapse schrieb am Sonntag, 14. August 2022 um 01:45:08 UTC+2:
> Here some penny of thought. If Scryer Prolog would:
>
> 1. Rethink the notion of pure, and incorporate some
> results of logic programming concerning SLDNF
>
> 2. Allow (+)//1 in DCG, which was refused here
> on dubious grounds:
>
> https://github.com/mthom/scryer-prolog/issues/1479
>
> Then it could abandon the old fashioned DCG, were D is taken
> literally as definite, i.e. without negation and pure. And it could
> move towards the more modern grammar formalism:
>
> parsing expression grammar (PEG)
> https://en.wikipedia.org/wiki/Parsing_expression_grammar
>
> Its quite easy to map PEG to DCG, where D is not interpreted
> that strict. And this can give much more efficient parsers, that
> are at the same time concise and declarative.
>
> Edit 14.08.2022
> Even the Ruby ISO standard uses some PEG inspired formalism
> for their grammar. Check it out.
> Mostowski Collapse schrieb am Sonntag, 14. August 2022 um 01:18:08 UTC+2:
> > New JSON parser is extremly slow
> > https://github.com/mthom/scryer-prolog/issues/1566
> > Mostowski Collapse schrieb am Sonntag, 14. August 2022 um 01:09:34 UTC+2:
> > > Why Aprils Fool? Well this here was 10 Apr 2021, almost Aprils Fool day:
> > >
> > > How it started:
> > >
> > > Scryer Prolog sets a new standard for efficient encoding of lists of
> > > characters, which we mean when we say "strings" in the context of
> > > Scryer Prolog. A key advantage of the efficient encoding is that
> > >
> > > DCGs can be used for describing the string, since it is simply a list.
> > > A good infrastructure for processing JSON with Scryer Prolog uses
> > > this representation, and describes JSON format with a DCG.
> > > https://github.com/mthom/scryer-prolog/discussions/892
> > >
> > > How its going:
> > >
> > > $ target/release/scryer-prolog -v
> > > "v0.9.0-181-g8e9302ea"
> > > $ target/release/scryer-prolog
> > > ?- time((between(1,1000,_), data(X), json_chars(Y,X,[]), fail; true)).
> > > % CPU time: 1.953s
> > > true.
> > >
> > > /* SWI-Prolog (threaded, 64 bits, version 8.5.14) */
> > > ?- time((between(1,1000,_), data(X), atom_json_term(X,Y,[]), fail; true)).
> > > % 48,000 inferences, 0.000 CPU in 0.007 seconds (0% CPU, Infinite Lips)
> > > true.
> > >
> > > The test data was simply:
> > >
> > > data("{ \"a\":123 }").
> > >
> > > I got the idea for this nasty test data, after inspecting the source code

Re: setof/3 ---> We are all doomed!!!

<9d672272-a70c-4573-9dfa-4cdb4adbabf0n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1660&group=comp.lang.prolog#1660

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:620a:808:b0:6ba:fcfa:368b with SMTP id s8-20020a05620a080800b006bafcfa368bmr2907672qks.616.1660465232656;
Sun, 14 Aug 2022 01:20:32 -0700 (PDT)
X-Received: by 2002:a25:9a47:0:b0:680:955c:1487 with SMTP id
r7-20020a259a47000000b00680955c1487mr8742425ybo.359.1660465232433; Sun, 14
Aug 2022 01:20:32 -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, 14 Aug 2022 01:20:32 -0700 (PDT)
In-Reply-To: <c900eb05-48b8-4fe9-8ce7-625a245c3138n@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: <26510ae4-0332-4804-af7b-dff4085cbd18n@googlegroups.com>
<9daa6fd9-5222-4d6d-8f46-349b78a681dbn@googlegroups.com> <82d413d1-9235-4a83-94ba-b713c681b690n@googlegroups.com>
<cbfe4bf4-f752-469d-ac5c-087557c24c8an@googlegroups.com> <899f99f6-f6b6-4cf4-8f7b-1ad240007995n@googlegroups.com>
<ab32f3f7-8b59-48bb-890e-a45c683efd21n@googlegroups.com> <86884d18-6cfd-4b96-84e2-83ff7097e283n@googlegroups.com>
<c0be3dea-ac4e-4c7c-8e0e-5b12c6bf09c2n@googlegroups.com> <c900eb05-48b8-4fe9-8ce7-625a245c3138n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <9d672272-a70c-4573-9dfa-4cdb4adbabf0n@googlegroups.com>
Subject: Re: setof/3 ---> We are all doomed!!!
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Sun, 14 Aug 2022 08:20:32 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2162
 by: Mostowski Collapse - Sun, 14 Aug 2022 08:20 UTC

Ciao Prolog is also some night mare, using the new playground:

?- use_module(library(lists)).
Note: module lists already in executable, just made visible

?- subtract([c,a,b],[a],X).
{ERROR: No handle found for thrown exception
error(existence_error(procedure,'user:subtract'/3),'user:subtract'/3)}

Mostowski Collapse schrieb am Sonntag, 14. August 2022 um 00:03:08 UTC+2:
> Here is the Scryer Prolog challenge:
>
> fCube: an efficient prover for Intuitionistic propositional Logic
> https://rextester.com/SEOO25214
>
> Can you make it run?

Re: setof/3 ---> We are all doomed!!!

<cfbb4a92-b939-446d-a2d8-ac626b4e3e0en@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1668&group=comp.lang.prolog#1668

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:622a:254:b0:343:62fc:219c with SMTP id c20-20020a05622a025400b0034362fc219cmr13573396qtx.595.1660556665181;
Mon, 15 Aug 2022 02:44:25 -0700 (PDT)
X-Received: by 2002:a0d:fac4:0:b0:329:88ec:a09c with SMTP id
k187-20020a0dfac4000000b0032988eca09cmr12030981ywf.175.1660556664741; Mon, 15
Aug 2022 02:44:24 -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: Mon, 15 Aug 2022 02:44:24 -0700 (PDT)
In-Reply-To: <c900eb05-48b8-4fe9-8ce7-625a245c3138n@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: <26510ae4-0332-4804-af7b-dff4085cbd18n@googlegroups.com>
<9daa6fd9-5222-4d6d-8f46-349b78a681dbn@googlegroups.com> <82d413d1-9235-4a83-94ba-b713c681b690n@googlegroups.com>
<cbfe4bf4-f752-469d-ac5c-087557c24c8an@googlegroups.com> <899f99f6-f6b6-4cf4-8f7b-1ad240007995n@googlegroups.com>
<ab32f3f7-8b59-48bb-890e-a45c683efd21n@googlegroups.com> <86884d18-6cfd-4b96-84e2-83ff7097e283n@googlegroups.com>
<c0be3dea-ac4e-4c7c-8e0e-5b12c6bf09c2n@googlegroups.com> <c900eb05-48b8-4fe9-8ce7-625a245c3138n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <cfbb4a92-b939-446d-a2d8-ac626b4e3e0en@googlegroups.com>
Subject: Re: setof/3 ---> We are all doomed!!!
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Mon, 15 Aug 2022 09:44:25 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2121
 by: Mostowski Collapse - Mon, 15 Aug 2022 09:44 UTC

And the winner is:

In the category "muito loco":
- Ciao Prolog: A lot of new tickets and a lot of bla bla

In the category "gets work done":
- SWI-Prolog: Just copy paste the rextester Prolog text to here, it wurks!
https://dev.swi-prolog.org/wasm/shell

Mostowski Collapse schrieb am Sonntag, 14. August 2022 um 00:03:08 UTC+2:
> Here is the Scryer Prolog challenge:
>
> fCube: an efficient prover for Intuitionistic propositional Logic
> https://rextester.com/SEOO25214
>
> Can you make it run?

Re: setof/3 ---> We are all doomed!!!

<544cf3f7-dad5-4b93-a9d8-db153bdbdf2en@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1669&group=comp.lang.prolog#1669

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:6214:d62:b0:474:7ceb:247e with SMTP id 2-20020a0562140d6200b004747ceb247emr15672699qvs.61.1660605458252;
Mon, 15 Aug 2022 16:17:38 -0700 (PDT)
X-Received: by 2002:a25:d80f:0:b0:68d:c3ce:1639 with SMTP id
p15-20020a25d80f000000b0068dc3ce1639mr467276ybg.431.1660605457882; Mon, 15
Aug 2022 16:17:37 -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: Mon, 15 Aug 2022 16:17:37 -0700 (PDT)
In-Reply-To: <cfbb4a92-b939-446d-a2d8-ac626b4e3e0en@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: <26510ae4-0332-4804-af7b-dff4085cbd18n@googlegroups.com>
<9daa6fd9-5222-4d6d-8f46-349b78a681dbn@googlegroups.com> <82d413d1-9235-4a83-94ba-b713c681b690n@googlegroups.com>
<cbfe4bf4-f752-469d-ac5c-087557c24c8an@googlegroups.com> <899f99f6-f6b6-4cf4-8f7b-1ad240007995n@googlegroups.com>
<ab32f3f7-8b59-48bb-890e-a45c683efd21n@googlegroups.com> <86884d18-6cfd-4b96-84e2-83ff7097e283n@googlegroups.com>
<c0be3dea-ac4e-4c7c-8e0e-5b12c6bf09c2n@googlegroups.com> <c900eb05-48b8-4fe9-8ce7-625a245c3138n@googlegroups.com>
<cfbb4a92-b939-446d-a2d8-ac626b4e3e0en@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <544cf3f7-dad5-4b93-a9d8-db153bdbdf2en@googlegroups.com>
Subject: Re: setof/3 ---> We are all doomed!!!
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Mon, 15 Aug 2022 23:17:38 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 34
 by: Mostowski Collapse - Mon, 15 Aug 2022 23:17 UTC

Pay attention! So Logtalk and Scryer struggles with ‘|’?
https://github.com/mthom/scryer-prolog/issues/1571

Its not an issue for the fCube version I posted here. Since it has:

:- op(700, xfy, <=>).
:- op(600, xfy, =>).
:- op(500, xfy, v).
:- op(400, xfy, &).
:- op(300, fy, ~).

fCube: an efficient prover for Intuitionistic propositional Logic
in Rextester - Joseph Vidal-Rosset, 2022
https://rextester.com/SEOO25214

Rextester is funny, it has an integrated version management system,
maybe a wikipedia variant? Will Ciao or SWIPL WASM have the same?

Mostowski Collapse schrieb am Montag, 15. August 2022 um 11:44:26 UTC+2:
> And the winner is:
>
> In the category "muito loco":
> - Ciao Prolog: A lot of new tickets and a lot of bla bla
>
> In the category "gets work done":
> - SWI-Prolog: Just copy paste the rextester Prolog text to here, it wurks!
> https://dev.swi-prolog.org/wasm/shell
> Mostowski Collapse schrieb am Sonntag, 14. August 2022 um 00:03:08 UTC+2:
> > Here is the Scryer Prolog challenge:
> >
> > fCube: an efficient prover for Intuitionistic propositional Logic
> > https://rextester.com/SEOO25214
> >
> > Can you make it run?

Re: setof/3 ---> We are all doomed!!!

<9dae6c96-3948-44ca-8aa1-ffd26f6f8d06n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1670&group=comp.lang.prolog#1670

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:ad4:5ba1:0:b0:46e:2f1f:9836 with SMTP id 1-20020ad45ba1000000b0046e2f1f9836mr15475032qvq.87.1660605678275;
Mon, 15 Aug 2022 16:21:18 -0700 (PDT)
X-Received: by 2002:a25:c013:0:b0:671:8102:eb2 with SMTP id
c19-20020a25c013000000b0067181020eb2mr13601453ybf.316.1660605677861; Mon, 15
Aug 2022 16:21:17 -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: Mon, 15 Aug 2022 16:21:17 -0700 (PDT)
In-Reply-To: <544cf3f7-dad5-4b93-a9d8-db153bdbdf2en@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: <26510ae4-0332-4804-af7b-dff4085cbd18n@googlegroups.com>
<9daa6fd9-5222-4d6d-8f46-349b78a681dbn@googlegroups.com> <82d413d1-9235-4a83-94ba-b713c681b690n@googlegroups.com>
<cbfe4bf4-f752-469d-ac5c-087557c24c8an@googlegroups.com> <899f99f6-f6b6-4cf4-8f7b-1ad240007995n@googlegroups.com>
<ab32f3f7-8b59-48bb-890e-a45c683efd21n@googlegroups.com> <86884d18-6cfd-4b96-84e2-83ff7097e283n@googlegroups.com>
<c0be3dea-ac4e-4c7c-8e0e-5b12c6bf09c2n@googlegroups.com> <c900eb05-48b8-4fe9-8ce7-625a245c3138n@googlegroups.com>
<cfbb4a92-b939-446d-a2d8-ac626b4e3e0en@googlegroups.com> <544cf3f7-dad5-4b93-a9d8-db153bdbdf2en@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <9dae6c96-3948-44ca-8aa1-ffd26f6f8d06n@googlegroups.com>
Subject: Re: setof/3 ---> We are all doomed!!!
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Mon, 15 Aug 2022 23:21:18 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 3808
 by: Mostowski Collapse - Mon, 15 Aug 2022 23:21 UTC

Oops its the other way around, the Joseph Vidal-Rosset
version is the dangerous version it has:

% operator definitions (TPTP syntax)
:- op( 500, fy, ~). % negation
:- op(1000, xfy, &). % conjunction
:- op(1100, xfy, '|'). % disjunction
:- op(1110, xfy, =>). % conditional
:- op(1120, xfy, <=>). % biconditional

Well I started allowing '|' redefinition in Jekejeke Prolog and
Dogelog Player, SWI-Prolog allows the same, no error here:

/* SWI-Prolog (threaded, 64 bits, version 8.5.14) */
?- op(1100, xfy, '|').
true.

This was done in favor of all the legacy TPTP syntax stuff.

Mostowski Collapse schrieb am Dienstag, 16. August 2022 um 01:17:39 UTC+2:
> Pay attention! So Logtalk and Scryer struggles with ‘|’?
> https://github.com/mthom/scryer-prolog/issues/1571
>
> Its not an issue for the fCube version I posted here. Since it has:
>
> :- op(700, xfy, <=>).
> :- op(600, xfy, =>).
> :- op(500, xfy, v).
> :- op(400, xfy, &).
> :- op(300, fy, ~).
> fCube: an efficient prover for Intuitionistic propositional Logic
> in Rextester - Joseph Vidal-Rosset, 2022
> https://rextester.com/SEOO25214
>
> Rextester is funny, it has an integrated version management system,
> maybe a wikipedia variant? Will Ciao or SWIPL WASM have the same?
> Mostowski Collapse schrieb am Montag, 15. August 2022 um 11:44:26 UTC+2:
> > And the winner is:
> >
> > In the category "muito loco":
> > - Ciao Prolog: A lot of new tickets and a lot of bla bla
> >
> > In the category "gets work done":
> > - SWI-Prolog: Just copy paste the rextester Prolog text to here, it wurks!
> > https://dev.swi-prolog.org/wasm/shell
> > Mostowski Collapse schrieb am Sonntag, 14. August 2022 um 00:03:08 UTC+2:
> > > Here is the Scryer Prolog challenge:
> > >
> > > fCube: an efficient prover for Intuitionistic propositional Logic
> > > https://rextester.com/SEOO25214
> > >
> > > Can you make it run?

Re: setof/3 ---> We are all doomed!!!

<1677acad-8ffe-4541-8bea-9285f36183a0n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1671&group=comp.lang.prolog#1671

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:622a:c7:b0:343:2e72:8416 with SMTP id p7-20020a05622a00c700b003432e728416mr16229261qtw.92.1660605826315;
Mon, 15 Aug 2022 16:23:46 -0700 (PDT)
X-Received: by 2002:a81:1ac9:0:b0:32f:edb7:d592 with SMTP id
a192-20020a811ac9000000b0032fedb7d592mr7763638ywa.119.1660605825956; Mon, 15
Aug 2022 16:23: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: Mon, 15 Aug 2022 16:23:45 -0700 (PDT)
In-Reply-To: <9dae6c96-3948-44ca-8aa1-ffd26f6f8d06n@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: <26510ae4-0332-4804-af7b-dff4085cbd18n@googlegroups.com>
<9daa6fd9-5222-4d6d-8f46-349b78a681dbn@googlegroups.com> <82d413d1-9235-4a83-94ba-b713c681b690n@googlegroups.com>
<cbfe4bf4-f752-469d-ac5c-087557c24c8an@googlegroups.com> <899f99f6-f6b6-4cf4-8f7b-1ad240007995n@googlegroups.com>
<ab32f3f7-8b59-48bb-890e-a45c683efd21n@googlegroups.com> <86884d18-6cfd-4b96-84e2-83ff7097e283n@googlegroups.com>
<c0be3dea-ac4e-4c7c-8e0e-5b12c6bf09c2n@googlegroups.com> <c900eb05-48b8-4fe9-8ce7-625a245c3138n@googlegroups.com>
<cfbb4a92-b939-446d-a2d8-ac626b4e3e0en@googlegroups.com> <544cf3f7-dad5-4b93-a9d8-db153bdbdf2en@googlegroups.com>
<9dae6c96-3948-44ca-8aa1-ffd26f6f8d06n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <1677acad-8ffe-4541-8bea-9285f36183a0n@googlegroups.com>
Subject: Re: setof/3 ---> We are all doomed!!!
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Mon, 15 Aug 2022 23:23:46 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 4318
 by: Mostowski Collapse - Mon, 15 Aug 2022 23:23 UTC

Ciao Prolog can do the same, I get in the current Ciao Prolog Playground:

?- current_op(X,Y,'|').
X = 1105,
Y = xfy ?
yes

?- op(1100, xfy, '|').
yes

?- current_op(X,Y,'|').
X = 1100,
Y = xfy ?
yes

Mostowski Collapse schrieb am Dienstag, 16. August 2022 um 01:21:19 UTC+2:
> Oops its the other way around, the Joseph Vidal-Rosset
> version is the dangerous version it has:
>
> % operator definitions (TPTP syntax)
> :- op( 500, fy, ~). % negation
> :- op(1000, xfy, &). % conjunction
> :- op(1100, xfy, '|'). % disjunction
> :- op(1110, xfy, =>). % conditional
> :- op(1120, xfy, <=>). % biconditional
>
> Well I started allowing '|' redefinition in Jekejeke Prolog and
> Dogelog Player, SWI-Prolog allows the same, no error here:
> /* SWI-Prolog (threaded, 64 bits, version 8.5.14) */
> ?- op(1100, xfy, '|').
> true.
>
> This was done in favor of all the legacy TPTP syntax stuff.
> Mostowski Collapse schrieb am Dienstag, 16. August 2022 um 01:17:39 UTC+2:
> > Pay attention! So Logtalk and Scryer struggles with ‘|’?
> > https://github.com/mthom/scryer-prolog/issues/1571
> >
> > Its not an issue for the fCube version I posted here. Since it has:
> >
> > :- op(700, xfy, <=>).
> > :- op(600, xfy, =>).
> > :- op(500, xfy, v).
> > :- op(400, xfy, &).
> > :- op(300, fy, ~).
> > fCube: an efficient prover for Intuitionistic propositional Logic
> > in Rextester - Joseph Vidal-Rosset, 2022
> > https://rextester.com/SEOO25214
> >
> > Rextester is funny, it has an integrated version management system,
> > maybe a wikipedia variant? Will Ciao or SWIPL WASM have the same?
> > Mostowski Collapse schrieb am Montag, 15. August 2022 um 11:44:26 UTC+2:
> > > And the winner is:
> > >
> > > In the category "muito loco":
> > > - Ciao Prolog: A lot of new tickets and a lot of bla bla
> > >
> > > In the category "gets work done":
> > > - SWI-Prolog: Just copy paste the rextester Prolog text to here, it wurks!
> > > https://dev.swi-prolog.org/wasm/shell
> > > Mostowski Collapse schrieb am Sonntag, 14. August 2022 um 00:03:08 UTC+2:
> > > > Here is the Scryer Prolog challenge:
> > > >
> > > > fCube: an efficient prover for Intuitionistic propositional Logic
> > > > https://rextester.com/SEOO25214
> > > >
> > > > Can you make it run?

Re: setof/3 ---> We are all doomed!!!

<7e516218-8620-48ef-98b5-5f1aa0da9a6fn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1672&group=comp.lang.prolog#1672

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:622a:11d2:b0:343:67a1:85e8 with SMTP id n18-20020a05622a11d200b0034367a185e8mr16176168qtk.11.1660609175193;
Mon, 15 Aug 2022 17:19:35 -0700 (PDT)
X-Received: by 2002:a25:33c5:0:b0:67a:6950:c188 with SMTP id
z188-20020a2533c5000000b0067a6950c188mr13489006ybz.175.1660609174887; Mon, 15
Aug 2022 17:19: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: Mon, 15 Aug 2022 17:19:34 -0700 (PDT)
In-Reply-To: <ae14cf17-5652-48f7-96a6-cdc952289145n@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: <26510ae4-0332-4804-af7b-dff4085cbd18n@googlegroups.com>
<9daa6fd9-5222-4d6d-8f46-349b78a681dbn@googlegroups.com> <82d413d1-9235-4a83-94ba-b713c681b690n@googlegroups.com>
<cbfe4bf4-f752-469d-ac5c-087557c24c8an@googlegroups.com> <899f99f6-f6b6-4cf4-8f7b-1ad240007995n@googlegroups.com>
<ab32f3f7-8b59-48bb-890e-a45c683efd21n@googlegroups.com> <86884d18-6cfd-4b96-84e2-83ff7097e283n@googlegroups.com>
<c0be3dea-ac4e-4c7c-8e0e-5b12c6bf09c2n@googlegroups.com> <c900eb05-48b8-4fe9-8ce7-625a245c3138n@googlegroups.com>
<a11e9978-0239-4df4-a5fa-fdeb622a2a23n@googlegroups.com> <da91ed38-a6ec-4e53-9144-5eea1b9c88f7n@googlegroups.com>
<5019ab73-8f4c-4ef0-9c3e-d57f396aa1e8n@googlegroups.com> <c06d4179-ce34-48e8-80da-c345f0926157n@googlegroups.com>
<ae14cf17-5652-48f7-96a6-cdc952289145n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <7e516218-8620-48ef-98b5-5f1aa0da9a6fn@googlegroups.com>
Subject: Re: setof/3 ---> We are all doomed!!!
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Tue, 16 Aug 2022 00:19:35 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 6675
 by: Mostowski Collapse - Tue, 16 Aug 2022 00:19 UTC

I still don't understand why '|' even landed in DCG,
it only causes problems. Back in the 1980's nobody

used DCG like that:

The first clause on the right-hand side:
verb (change) — >
[c] ; [ch] ; [change] ; [set] .
is satisfied if the token is any one of the four listed
(the ";" is Prolog's way of ex- pressing the OR relation among clauses).
https://archive.org/details/byte-magazine-1987-08/page/n181/mode/2up

And still your own folks nowadays dont use '|':
```
json_ws -->
( parsing ->
json_ws_greedy
; json_ws_lazy
).
```
https://github.com/mthom/scryer-prolog/blob/master/src/lib/serialization/json.pl

Mostowski Collapse schrieb am Sonntag, 14. August 2022 um 01:45:08 UTC+2:
> Here some penny of thought. If Scryer Prolog would:
>
> 1. Rethink the notion of pure, and incorporate some
> results of logic programming concerning SLDNF
>
> 2. Allow (+)//1 in DCG, which was refused here
> on dubious grounds:
>
> https://github.com/mthom/scryer-prolog/issues/1479
>
> Then it could abandon the old fashioned DCG, were D is taken
> literally as definite, i.e. without negation and pure. And it could
> move towards the more modern grammar formalism:
>
> parsing expression grammar (PEG)
> https://en.wikipedia.org/wiki/Parsing_expression_grammar
>
> Its quite easy to map PEG to DCG, where D is not interpreted
> that strict. And this can give much more efficient parsers, that
> are at the same time concise and declarative.
>
> Edit 14.08.2022
> Even the Ruby ISO standard uses some PEG inspired formalism
> for their grammar. Check it out.
> Mostowski Collapse schrieb am Sonntag, 14. August 2022 um 01:18:08 UTC+2:
> > New JSON parser is extremly slow
> > https://github.com/mthom/scryer-prolog/issues/1566
> > Mostowski Collapse schrieb am Sonntag, 14. August 2022 um 01:09:34 UTC+2:
> > > Why Aprils Fool? Well this here was 10 Apr 2021, almost Aprils Fool day:
> > >
> > > How it started:
> > >
> > > Scryer Prolog sets a new standard for efficient encoding of lists of
> > > characters, which we mean when we say "strings" in the context of
> > > Scryer Prolog. A key advantage of the efficient encoding is that
> > >
> > > DCGs can be used for describing the string, since it is simply a list..
> > > A good infrastructure for processing JSON with Scryer Prolog uses
> > > this representation, and describes JSON format with a DCG.
> > > https://github.com/mthom/scryer-prolog/discussions/892
> > >
> > > How its going:
> > >
> > > $ target/release/scryer-prolog -v
> > > "v0.9.0-181-g8e9302ea"
> > > $ target/release/scryer-prolog
> > > ?- time((between(1,1000,_), data(X), json_chars(Y,X,[]), fail; true))..
> > > % CPU time: 1.953s
> > > true.
> > >
> > > /* SWI-Prolog (threaded, 64 bits, version 8.5.14) */
> > > ?- time((between(1,1000,_), data(X), atom_json_term(X,Y,[]), fail; true)).
> > > % 48,000 inferences, 0.000 CPU in 0.007 seconds (0% CPU, Infinite Lips)
> > > true.
> > >
> > > The test data was simply:
> > >
> > > data("{ \"a\":123 }").
> > >
> > > I got the idea for this nasty test data, after inspecting the source code
> > > of the new library(serialization/json). Just compare to what Jan W. is doing.
> > > Mostowski Collapse schrieb am Sonntag, 14. August 2022 um 00:23:30 UTC+2:
> > > > For example subtract/3 has complexity
> > > >
> > > > O(n*m)
> > > >
> > > > And ord_subtract/3, if you do it wrong, and
> > > > insert sort/2 everywhere, has complexity:
> > > >
> > > > O(n*log n + m*log m)
> > > >
> > > > subtract/3 is better than ord_subtract/3 for m<<n.
> > > > But if you manage to elminate the sort/2,
> > > >
> > > > then ord_subtract/2 is only O(n+m) and better again.
> > > > So there is a lot to deliberate.
> > > > Mostowski Collapse schrieb am Sonntag, 14. August 2022 um 00:16:11 UTC+2:
> > > > > The struggle is real, possibly a result of Fastfood McDonald
> > > > > approach to Prolog? Dunno. Call the language BigMacLog then?
> > > > >
> > > > > https://github.com/mthom/scryer-prolog/issues/1564
> > > > > Mostowski Collapse schrieb am Sonntag, 14. August 2022 um 00:03:08 UTC+2:
> > > > > > Here is the Scryer Prolog challenge:
> > > > > >
> > > > > > fCube: an efficient prover for Intuitionistic propositional Logic
> > > > > > https://rextester.com/SEOO25214
> > > > > >
> > > > > > Can you make it run?

Re: setof/3 ---> We are all doomed!!!

<8214d90d-7390-404e-981b-85ce1591de52n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1673&group=comp.lang.prolog#1673

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:ac8:7d90:0:b0:326:b431:6cd3 with SMTP id c16-20020ac87d90000000b00326b4316cd3mr16175158qtd.511.1660610456698;
Mon, 15 Aug 2022 17:40:56 -0700 (PDT)
X-Received: by 2002:a0d:e804:0:b0:333:b8ed:b1f3 with SMTP id
r4-20020a0de804000000b00333b8edb1f3mr34742ywe.69.1660610456326; Mon, 15 Aug
2022 17:40:56 -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: Mon, 15 Aug 2022 17:40:56 -0700 (PDT)
In-Reply-To: <7e516218-8620-48ef-98b5-5f1aa0da9a6fn@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: <26510ae4-0332-4804-af7b-dff4085cbd18n@googlegroups.com>
<9daa6fd9-5222-4d6d-8f46-349b78a681dbn@googlegroups.com> <82d413d1-9235-4a83-94ba-b713c681b690n@googlegroups.com>
<cbfe4bf4-f752-469d-ac5c-087557c24c8an@googlegroups.com> <899f99f6-f6b6-4cf4-8f7b-1ad240007995n@googlegroups.com>
<ab32f3f7-8b59-48bb-890e-a45c683efd21n@googlegroups.com> <86884d18-6cfd-4b96-84e2-83ff7097e283n@googlegroups.com>
<c0be3dea-ac4e-4c7c-8e0e-5b12c6bf09c2n@googlegroups.com> <c900eb05-48b8-4fe9-8ce7-625a245c3138n@googlegroups.com>
<a11e9978-0239-4df4-a5fa-fdeb622a2a23n@googlegroups.com> <da91ed38-a6ec-4e53-9144-5eea1b9c88f7n@googlegroups.com>
<5019ab73-8f4c-4ef0-9c3e-d57f396aa1e8n@googlegroups.com> <c06d4179-ce34-48e8-80da-c345f0926157n@googlegroups.com>
<ae14cf17-5652-48f7-96a6-cdc952289145n@googlegroups.com> <7e516218-8620-48ef-98b5-5f1aa0da9a6fn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <8214d90d-7390-404e-981b-85ce1591de52n@googlegroups.com>
Subject: Re: setof/3 ---> We are all doomed!!!
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Tue, 16 Aug 2022 00:40:56 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 7506
 by: Mostowski Collapse - Tue, 16 Aug 2022 00:40 UTC

I like the quality of the new JSON parser for Scryer Prolog.
Did anybody review the code?

I get for example:

?- number_chars(X, "7.075657757024522e-7").
X = 7.075657757024522e-7.
?- json_chars(X, "7.075657757024522e-7", "").
X = number(7.075657757024521e-7)

The two results are different:

?- C = "7.075657757024522e-7",
number_chars(X, C),
json_chars(number(Y), C, ""),
X == Y.
false.

LoL

Mostowski Collapse schrieb am Dienstag, 16. August 2022 um 02:19:36 UTC+2:
> I still don't understand why '|' even landed in DCG,
> it only causes problems. Back in the 1980's nobody
>
> used DCG like that:
>
> The first clause on the right-hand side:
> verb (change) — >
> [c] ; [ch] ; [change] ; [set] .
> is satisfied if the token is any one of the four listed
> (the ";" is Prolog's way of ex- pressing the OR relation among clauses).
> https://archive.org/details/byte-magazine-1987-08/page/n181/mode/2up
>
> And still your own folks nowadays dont use '|':
> ```
> json_ws -->
> ( parsing ->
> json_ws_greedy
> ; json_ws_lazy
> ).
> ```
> https://github.com/mthom/scryer-prolog/blob/master/src/lib/serialization/json.pl
> Mostowski Collapse schrieb am Sonntag, 14. August 2022 um 01:45:08 UTC+2:
> > Here some penny of thought. If Scryer Prolog would:
> >
> > 1. Rethink the notion of pure, and incorporate some
> > results of logic programming concerning SLDNF
> >
> > 2. Allow (+)//1 in DCG, which was refused here
> > on dubious grounds:
> >
> > https://github.com/mthom/scryer-prolog/issues/1479
> >
> > Then it could abandon the old fashioned DCG, were D is taken
> > literally as definite, i.e. without negation and pure. And it could
> > move towards the more modern grammar formalism:
> >
> > parsing expression grammar (PEG)
> > https://en.wikipedia.org/wiki/Parsing_expression_grammar
> >
> > Its quite easy to map PEG to DCG, where D is not interpreted
> > that strict. And this can give much more efficient parsers, that
> > are at the same time concise and declarative.
> >
> > Edit 14.08.2022
> > Even the Ruby ISO standard uses some PEG inspired formalism
> > for their grammar. Check it out.
> > Mostowski Collapse schrieb am Sonntag, 14. August 2022 um 01:18:08 UTC+2:
> > > New JSON parser is extremly slow
> > > https://github.com/mthom/scryer-prolog/issues/1566
> > > Mostowski Collapse schrieb am Sonntag, 14. August 2022 um 01:09:34 UTC+2:
> > > > Why Aprils Fool? Well this here was 10 Apr 2021, almost Aprils Fool day:
> > > >
> > > > How it started:
> > > >
> > > > Scryer Prolog sets a new standard for efficient encoding of lists of
> > > > characters, which we mean when we say "strings" in the context of
> > > > Scryer Prolog. A key advantage of the efficient encoding is that
> > > >
> > > > DCGs can be used for describing the string, since it is simply a list.
> > > > A good infrastructure for processing JSON with Scryer Prolog uses
> > > > this representation, and describes JSON format with a DCG.
> > > > https://github.com/mthom/scryer-prolog/discussions/892
> > > >
> > > > How its going:
> > > >
> > > > $ target/release/scryer-prolog -v
> > > > "v0.9.0-181-g8e9302ea"
> > > > $ target/release/scryer-prolog
> > > > ?- time((between(1,1000,_), data(X), json_chars(Y,X,[]), fail; true)).
> > > > % CPU time: 1.953s
> > > > true.
> > > >
> > > > /* SWI-Prolog (threaded, 64 bits, version 8.5.14) */
> > > > ?- time((between(1,1000,_), data(X), atom_json_term(X,Y,[]), fail; true)).
> > > > % 48,000 inferences, 0.000 CPU in 0.007 seconds (0% CPU, Infinite Lips)
> > > > true.
> > > >
> > > > The test data was simply:
> > > >
> > > > data("{ \"a\":123 }").
> > > >
> > > > I got the idea for this nasty test data, after inspecting the source code
> > > > of the new library(serialization/json). Just compare to what Jan W. is doing.
> > > > Mostowski Collapse schrieb am Sonntag, 14. August 2022 um 00:23:30 UTC+2:
> > > > > For example subtract/3 has complexity
> > > > >
> > > > > O(n*m)
> > > > >
> > > > > And ord_subtract/3, if you do it wrong, and
> > > > > insert sort/2 everywhere, has complexity:
> > > > >
> > > > > O(n*log n + m*log m)
> > > > >
> > > > > subtract/3 is better than ord_subtract/3 for m<<n.
> > > > > But if you manage to elminate the sort/2,
> > > > >
> > > > > then ord_subtract/2 is only O(n+m) and better again.
> > > > > So there is a lot to deliberate.
> > > > > Mostowski Collapse schrieb am Sonntag, 14. August 2022 um 00:16:11 UTC+2:
> > > > > > The struggle is real, possibly a result of Fastfood McDonald
> > > > > > approach to Prolog? Dunno. Call the language BigMacLog then?
> > > > > >
> > > > > > https://github.com/mthom/scryer-prolog/issues/1564
> > > > > > Mostowski Collapse schrieb am Sonntag, 14. August 2022 um 00:03:08 UTC+2:
> > > > > > > Here is the Scryer Prolog challenge:
> > > > > > >
> > > > > > > fCube: an efficient prover for Intuitionistic propositional Logic
> > > > > > > https://rextester.com/SEOO25214
> > > > > > >
> > > > > > > Can you make it run?

Re: setof/3 ---> We are all doomed!!!

<c884137f-3900-409a-9c9d-b28a39db1d9bn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1674&group=comp.lang.prolog#1674

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:ac8:5889:0:b0:344:57e5:dc54 with SMTP id t9-20020ac85889000000b0034457e5dc54mr7435051qta.465.1660610832082;
Mon, 15 Aug 2022 17:47:12 -0700 (PDT)
X-Received: by 2002:a81:1214:0:b0:324:68f0:9b3a with SMTP id
20-20020a811214000000b0032468f09b3amr15479781yws.140.1660610831747; Mon, 15
Aug 2022 17:47:11 -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: Mon, 15 Aug 2022 17:47:11 -0700 (PDT)
In-Reply-To: <8214d90d-7390-404e-981b-85ce1591de52n@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: <26510ae4-0332-4804-af7b-dff4085cbd18n@googlegroups.com>
<9daa6fd9-5222-4d6d-8f46-349b78a681dbn@googlegroups.com> <82d413d1-9235-4a83-94ba-b713c681b690n@googlegroups.com>
<cbfe4bf4-f752-469d-ac5c-087557c24c8an@googlegroups.com> <899f99f6-f6b6-4cf4-8f7b-1ad240007995n@googlegroups.com>
<ab32f3f7-8b59-48bb-890e-a45c683efd21n@googlegroups.com> <86884d18-6cfd-4b96-84e2-83ff7097e283n@googlegroups.com>
<c0be3dea-ac4e-4c7c-8e0e-5b12c6bf09c2n@googlegroups.com> <c900eb05-48b8-4fe9-8ce7-625a245c3138n@googlegroups.com>
<a11e9978-0239-4df4-a5fa-fdeb622a2a23n@googlegroups.com> <da91ed38-a6ec-4e53-9144-5eea1b9c88f7n@googlegroups.com>
<5019ab73-8f4c-4ef0-9c3e-d57f396aa1e8n@googlegroups.com> <c06d4179-ce34-48e8-80da-c345f0926157n@googlegroups.com>
<ae14cf17-5652-48f7-96a6-cdc952289145n@googlegroups.com> <7e516218-8620-48ef-98b5-5f1aa0da9a6fn@googlegroups.com>
<8214d90d-7390-404e-981b-85ce1591de52n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <c884137f-3900-409a-9c9d-b28a39db1d9bn@googlegroups.com>
Subject: Re: setof/3 ---> We are all doomed!!!
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Tue, 16 Aug 2022 00:47:12 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2781
 by: Mostowski Collapse - Tue, 16 Aug 2022 00:47 UTC

SWI-Prolog doesn't have this error:

?- use_module(library(http/json)).
true.

?- number_chars(X, "7.075657757024522e-7").
X = 7.075657757024522e-7.

?- atom_json_term('7.075657757024522e-7', X, []).
X = 7.075657757024522e-7.

Mostowski Collapse schrieb am Dienstag, 16. August 2022 um 02:40:57 UTC+2:
> I like the quality of the new JSON parser for Scryer Prolog.
> Did anybody review the code?
>
> I get for example:
>
> ?- number_chars(X, "7.075657757024522e-7").
> X = 7.075657757024522e-7.
> ?- json_chars(X, "7.075657757024522e-7", "").
> X = number(7.075657757024521e-7)
>
> The two results are different:
>
> ?- C = "7.075657757024522e-7",
> number_chars(X, C),
> json_chars(number(Y), C, ""),
> X == Y.
> false.
>
> LoL

Re: setof/3 ---> We are all doomed!!!

<880f6ad6-91af-473d-83c7-d276ae3ffac7n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1675&group=comp.lang.prolog#1675

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a0c:df82:0:b0:474:97e5:4951 with SMTP id w2-20020a0cdf82000000b0047497e54951mr15823936qvl.96.1660611027276;
Mon, 15 Aug 2022 17:50:27 -0700 (PDT)
X-Received: by 2002:a25:df88:0:b0:67c:40a3:7501 with SMTP id
w130-20020a25df88000000b0067c40a37501mr13958746ybg.415.1660611026931; Mon, 15
Aug 2022 17:50:26 -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: Mon, 15 Aug 2022 17:50:26 -0700 (PDT)
In-Reply-To: <c884137f-3900-409a-9c9d-b28a39db1d9bn@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: <26510ae4-0332-4804-af7b-dff4085cbd18n@googlegroups.com>
<9daa6fd9-5222-4d6d-8f46-349b78a681dbn@googlegroups.com> <82d413d1-9235-4a83-94ba-b713c681b690n@googlegroups.com>
<cbfe4bf4-f752-469d-ac5c-087557c24c8an@googlegroups.com> <899f99f6-f6b6-4cf4-8f7b-1ad240007995n@googlegroups.com>
<ab32f3f7-8b59-48bb-890e-a45c683efd21n@googlegroups.com> <86884d18-6cfd-4b96-84e2-83ff7097e283n@googlegroups.com>
<c0be3dea-ac4e-4c7c-8e0e-5b12c6bf09c2n@googlegroups.com> <c900eb05-48b8-4fe9-8ce7-625a245c3138n@googlegroups.com>
<a11e9978-0239-4df4-a5fa-fdeb622a2a23n@googlegroups.com> <da91ed38-a6ec-4e53-9144-5eea1b9c88f7n@googlegroups.com>
<5019ab73-8f4c-4ef0-9c3e-d57f396aa1e8n@googlegroups.com> <c06d4179-ce34-48e8-80da-c345f0926157n@googlegroups.com>
<ae14cf17-5652-48f7-96a6-cdc952289145n@googlegroups.com> <7e516218-8620-48ef-98b5-5f1aa0da9a6fn@googlegroups.com>
<8214d90d-7390-404e-981b-85ce1591de52n@googlegroups.com> <c884137f-3900-409a-9c9d-b28a39db1d9bn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <880f6ad6-91af-473d-83c7-d276ae3ffac7n@googlegroups.com>
Subject: Re: setof/3 ---> We are all doomed!!!
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Tue, 16 Aug 2022 00:50:27 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3177
 by: Mostowski Collapse - Tue, 16 Aug 2022 00:50 UTC

BTW: I used this fuzzer to find the number:

?- repeat, random(X), Y is X/1000000,
number_chars(Y,C),
json_chars(number(Z),C,""), Z \== Y.

See also:
https://en.wikipedia.org/wiki/Fuzzing

Mostowski Collapse schrieb am Dienstag, 16. August 2022 um 02:47:12 UTC+2:
> SWI-Prolog doesn't have this error:
>
> ?- use_module(library(http/json)).
> true.
> ?- number_chars(X, "7.075657757024522e-7").
> X = 7.075657757024522e-7.
> ?- atom_json_term('7.075657757024522e-7', X, []).
> X = 7.075657757024522e-7.
> Mostowski Collapse schrieb am Dienstag, 16. August 2022 um 02:40:57 UTC+2:
> > I like the quality of the new JSON parser for Scryer Prolog.
> > Did anybody review the code?
> >
> > I get for example:
> >
> > ?- number_chars(X, "7.075657757024522e-7").
> > X = 7.075657757024522e-7.
> > ?- json_chars(X, "7.075657757024522e-7", "").
> > X = number(7.075657757024521e-7)
> >
> > The two results are different:
> >
> > ?- C = "7.075657757024522e-7",
> > number_chars(X, C),
> > json_chars(number(Y), C, ""),
> > X == Y.
> > false.
> >
> > LoL

Re: setof/3 ---> We are all doomed!!!

<8f9658b0-420c-46a7-bf4f-ffc6f975e1d7n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1676&group=comp.lang.prolog#1676

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:ad4:4eec:0:b0:476:b2b2:1809 with SMTP id dv12-20020ad44eec000000b00476b2b21809mr15952434qvb.40.1660612342996;
Mon, 15 Aug 2022 18:12:22 -0700 (PDT)
X-Received: by 2002:a81:d353:0:b0:31e:2888:93a1 with SMTP id
d19-20020a81d353000000b0031e288893a1mr14584999ywl.498.1660612342676; Mon, 15
Aug 2022 18:12:22 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Mon, 15 Aug 2022 18:12:22 -0700 (PDT)
In-Reply-To: <880f6ad6-91af-473d-83c7-d276ae3ffac7n@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: <26510ae4-0332-4804-af7b-dff4085cbd18n@googlegroups.com>
<9daa6fd9-5222-4d6d-8f46-349b78a681dbn@googlegroups.com> <82d413d1-9235-4a83-94ba-b713c681b690n@googlegroups.com>
<cbfe4bf4-f752-469d-ac5c-087557c24c8an@googlegroups.com> <899f99f6-f6b6-4cf4-8f7b-1ad240007995n@googlegroups.com>
<ab32f3f7-8b59-48bb-890e-a45c683efd21n@googlegroups.com> <86884d18-6cfd-4b96-84e2-83ff7097e283n@googlegroups.com>
<c0be3dea-ac4e-4c7c-8e0e-5b12c6bf09c2n@googlegroups.com> <c900eb05-48b8-4fe9-8ce7-625a245c3138n@googlegroups.com>
<a11e9978-0239-4df4-a5fa-fdeb622a2a23n@googlegroups.com> <da91ed38-a6ec-4e53-9144-5eea1b9c88f7n@googlegroups.com>
<5019ab73-8f4c-4ef0-9c3e-d57f396aa1e8n@googlegroups.com> <c06d4179-ce34-48e8-80da-c345f0926157n@googlegroups.com>
<ae14cf17-5652-48f7-96a6-cdc952289145n@googlegroups.com> <7e516218-8620-48ef-98b5-5f1aa0da9a6fn@googlegroups.com>
<8214d90d-7390-404e-981b-85ce1591de52n@googlegroups.com> <c884137f-3900-409a-9c9d-b28a39db1d9bn@googlegroups.com>
<880f6ad6-91af-473d-83c7-d276ae3ffac7n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <8f9658b0-420c-46a7-bf4f-ffc6f975e1d7n@googlegroups.com>
Subject: Re: setof/3 ---> We are all doomed!!!
From: bursejan@gmail.com (Mostowski Collapse)
Injection-Date: Tue, 16 Aug 2022 01:12:22 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3847
 by: Mostowski Collapse - Tue, 16 Aug 2022 01:12 UTC

This is also extremly cringe:

$ cd scryer-prolog
$ target/release/scryer-prolog
?- use_module(library(serialization/json)).
true.
?- json_chars(X, "{}", "").
X = pairs([])
; ... .
?- json_chars(pairs([]), X, "").
X = "{}"
; X = "{} "
; X = "{} "
; X = "{} "
; X = "{} "
; X = "{} "
; X = "{} "
; X = "{} "
; X = "{} "
; X = "{} "
; X = "{} "

Who wants such a nonsense?

Mostowski Collapse schrieb am Dienstag, 16. August 2022 um 02:50:28 UTC+2:
> BTW: I used this fuzzer to find the number:
>
> ?- repeat, random(X), Y is X/1000000,
> number_chars(Y,C),
> json_chars(number(Z),C,""), Z \== Y.
>
> See also:
> https://en.wikipedia.org/wiki/Fuzzing
> Mostowski Collapse schrieb am Dienstag, 16. August 2022 um 02:47:12 UTC+2:
> > SWI-Prolog doesn't have this error:
> >
> > ?- use_module(library(http/json)).
> > true.
> > ?- number_chars(X, "7.075657757024522e-7").
> > X = 7.075657757024522e-7.
> > ?- atom_json_term('7.075657757024522e-7', X, []).
> > X = 7.075657757024522e-7.
> > Mostowski Collapse schrieb am Dienstag, 16. August 2022 um 02:40:57 UTC+2:
> > > I like the quality of the new JSON parser for Scryer Prolog.
> > > Did anybody review the code?
> > >
> > > I get for example:
> > >
> > > ?- number_chars(X, "7.075657757024522e-7").
> > > X = 7.075657757024522e-7.
> > > ?- json_chars(X, "7.075657757024522e-7", "").
> > > X = number(7.075657757024521e-7)
> > >
> > > The two results are different:
> > >
> > > ?- C = "7.075657757024522e-7",
> > > number_chars(X, C),
> > > json_chars(number(Y), C, ""),
> > > X == Y.
> > > false.
> > >
> > > LoL

Pages:12
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor