Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

6 May, 2024: The networking issue during the past two days has been identified and fixed.


devel / comp.lang.prolog / Re: About the Operator '|' and the DCG Draft

SubjectAuthor
* About the Operator '|' and the DCG DraftMostowski Collapse
`* About the Operator '|' and the DCG DraftMostowski Collapse
 +- About the Operator '|' and the DCG DraftMostowski Collapse
 +- About the Operator '|' and the DCG DraftMostowski Collapse
 +- About the Operator '|' and the DCG DraftMostowski Collapse
 +- About the Operator '|' and the DCG DraftMostowski Collapse
 +- About the Operator '|' and the DCG DraftMostowski Collapse
 +- About the Operator '|' and the DCG DraftMostowski Collapse
 +- About the Operator '|' and the DCG DraftMostowski Collapse
 +- About the Operator '|' and the DCG DraftMostowski Collapse
 +- About the Operator '|' and the DCG DraftMostowski Collapse
 +- About the Operator '|' and the DCG DraftMostowski Collapse
 +- About the Operator '|' and the DCG DraftMostowski Collapse
 +- About the Operator '|' and the DCG DraftMostowski Collapse
 +- About the Operator '|' and the DCG DraftMostowski Collapse
 +- About the Operator '|' and the DCG DraftMostowski Collapse
 +- About the Operator '|' and the DCG DraftMostowski Collapse
 +- About the Operator '|' and the DCG DraftMostowski Collapse
 +- About the Operator '|' and the DCG DraftMostowski Collapse
 +- About the Operator '|' and the DCG DraftMostowski Collapse
 +- About the Operator '|' and the DCG DraftMostowski Collapse
 +- About the Operator '|' and the DCG DraftMostowski Collapse
 +- About the Operator '|' and the DCG DraftMostowski Collapse
 +- About the Operator '|' and the DCG DraftMostowski Collapse
 +- About the Operator '|' and the DCG DraftMostowski Collapse
 `- About the Operator '|' and the DCG DraftMostowski Collapse

Pages:12
Re: About the Operator '|' and the DCG Draft

<13feb23a-5af2-403a-ae04-de846eef0135n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:620a:2993:b0:67d:7119:9f19 with SMTP id r19-20020a05620a299300b0067d71199f19mr20893549qkp.494.1649667031191;
Mon, 11 Apr 2022 01:50:31 -0700 (PDT)
X-Received: by 2002:a5b:f83:0:b0:63d:a251:2c51 with SMTP id
q3-20020a5b0f83000000b0063da2512c51mr20424165ybh.594.1649667030944; Mon, 11
Apr 2022 01:50:30 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.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, 11 Apr 2022 01:50:30 -0700 (PDT)
In-Reply-To: <ed1a10f3-0abf-4ca9-8dce-fe2fe99a58c4n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.53.70; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.53.70
References: <27a911c0-3a2f-4054-81e5-bad9d8320750n@googlegroups.com>
<6ed26ce6-eaca-44f4-8c47-ff065227259bn@googlegroups.com> <2f729e39-7a7c-4079-9b34-08e080c6b242n@googlegroups.com>
<1a2d52b2-52ae-41c8-ad97-07dd4d07c264n@googlegroups.com> <296a2193-cea2-4aa1-a6de-eee173404568n@googlegroups.com>
<1f6e60c8-e8b2-42b8-9ca8-d1688ab1da26n@googlegroups.com> <b73e5ef2-93d6-4d30-ab36-d5fcb45531b8n@googlegroups.com>
<163a9271-9d06-4fbc-8d3c-1903bd8733bdn@googlegroups.com> <c07fe58b-ca4d-44d1-a716-1790a2033be0n@googlegroups.com>
<82d76042-37a3-44ab-addc-3784060038ccn@googlegroups.com> <9f1d1d60-7c54-4c2d-a655-04b651565d0bn@googlegroups.com>
<0d15e64d-f537-4313-b637-cdd0f66a1761n@googlegroups.com> <52b84705-714c-4248-b85b-a643413b7ff3n@googlegroups.com>
<0152c446-3e8e-4e4f-807c-51e913f95708n@googlegroups.com> <c7ee2838-d75c-4807-982a-fd3567d82374n@googlegroups.com>
<a0dd0b5f-b459-48d3-842b-675f9712c902n@googlegroups.com> <7950d178-a688-4122-ab3a-c5105359632cn@googlegroups.com>
<d8530517-401e-46ec-84f3-7f09c8dd70f5n@googlegroups.com> <870d9bb1-4c0f-41a2-8430-99abd733eed1n@googlegroups.com>
<8f5f92be-4fbe-4093-8ee9-a4796618e0can@googlegroups.com> <adcb7512-f998-4843-bab4-f1b2c7342b40n@googlegroups.com>
<ed1a10f3-0abf-4ca9-8dce-fe2fe99a58c4n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <13feb23a-5af2-403a-ae04-de846eef0135n@googlegroups.com>
Subject: Re: About the Operator '|' and the DCG Draft
From: burse...@gmail.com (Mostowski Collapse)
Injection-Date: Mon, 11 Apr 2022 08:50:31 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 59
 by: Mostowski Collapse - Mon, 11 Apr 2022 08:50 UTC

Is it a sign, that the SWI-Prolog parser/unparser wasn’t built
from a master class in test driven development? Well testing
input/output in Prolog system can be a headache.

I have a new take on a corresponding harness. This is quite
interesting. It is a harness tailored towards Dogelog Player,
which unlike formerly Jekejeke Prolog does NOT ASSUME:

- Memory Files: For Dogelog Player we do NOT ASSUME
to have access as we did in formerly Jekejeke Prolog. So
a memory file is simulated by memory.txt, ordinary file.

- setup_call_cleanup/3: For Dogelog Player we currently do
NOT ASSUME, although such a predicate might come later.
In formerly Jekejeke Prolog the harness uses this.

So how do we check with output to? Here is our new take:

/**
* with_text_to(A, G):
* The predicate succeeds whenever the goal G succeeds and
* unifies A with its text output.
*/
% with_text_to(-Atom, +Goal)
with_text_to(A, G) :-
current_output(S),
try_call_finally(
redirect_text_output,
G,
fetch_text_output(S, A)).

% redirect_text_output
redirect_text_output :-
open('memory.txt', write, S),
set_output(S).

% fetch_text_output(+Stream, -Atom)
fetch_text_output(S, A) :-
current_output(T),
close(T),
open('memory.txt', read, R),
get_atom(R, -1, A),
close(R),
set_output(S).

And then:

/**
* try_call_finally(T, G, F):
* The predicate succeeds whenever G succeeds. The goal T is
* called for the call and redo port. The goal F is called for
* the exit, fail and error port.
*/
% try_call_finally(+Goal, +Goal, +Goal)
try_call_finally(T, G, F) :-
(T; F, fail),
'$MARK'(X),
catch(G, E, (F, throw(E))),
'$MARK'(Y),
(X == Y -> !, F; (F; T, fail)).

Re: About the Operator '|' and the DCG Draft

<t30qfn$o195$1@solani.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From: janbu...@fastmail.fm (Mostowski Collapse)
Newsgroups: comp.lang.prolog
Subject: Re: About the Operator '|' and the DCG Draft
Date: Mon, 11 Apr 2022 10:56:25 +0200
Message-ID: <t30qfn$o195$1@solani.org>
References: <27a911c0-3a2f-4054-81e5-bad9d8320750n@googlegroups.com>
<163a9271-9d06-4fbc-8d3c-1903bd8733bdn@googlegroups.com>
<c07fe58b-ca4d-44d1-a716-1790a2033be0n@googlegroups.com>
<82d76042-37a3-44ab-addc-3784060038ccn@googlegroups.com>
<9f1d1d60-7c54-4c2d-a655-04b651565d0bn@googlegroups.com>
<0d15e64d-f537-4313-b637-cdd0f66a1761n@googlegroups.com>
<52b84705-714c-4248-b85b-a643413b7ff3n@googlegroups.com>
<0152c446-3e8e-4e4f-807c-51e913f95708n@googlegroups.com>
<c7ee2838-d75c-4807-982a-fd3567d82374n@googlegroups.com>
<a0dd0b5f-b459-48d3-842b-675f9712c902n@googlegroups.com>
<7950d178-a688-4122-ab3a-c5105359632cn@googlegroups.com>
<d8530517-401e-46ec-84f3-7f09c8dd70f5n@googlegroups.com>
<870d9bb1-4c0f-41a2-8430-99abd733eed1n@googlegroups.com>
<8f5f92be-4fbe-4093-8ee9-a4796618e0can@googlegroups.com>
<adcb7512-f998-4843-bab4-f1b2c7342b40n@googlegroups.com>
<ed1a10f3-0abf-4ca9-8dce-fe2fe99a58c4n@googlegroups.com>
<13feb23a-5af2-403a-ae04-de846eef0135n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 11 Apr 2022 08:56:23 -0000 (UTC)
Injection-Info: solani.org;
logging-data="787749"; mail-complaints-to="abuse@news.solani.org"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101
Firefox/68.0 SeaMonkey/2.53.11.1
Cancel-Lock: sha1:59wt13c2yLq2hEBjXzAhx8KBl/c=
X-User-ID: eJwFwYEBwCAIA7CXZEqp5yDQ/09Y4huGigPHcbki1svhu9YK62+USe5KFXit6KVLDJq5euy8RdmwpzZp8wN7exaf
In-Reply-To: <13feb23a-5af2-403a-ae04-de846eef0135n@googlegroups.com>
 by: Mostowski Collapse - Mon, 11 Apr 2022 08:56 UTC

It should be noted that we added a new built-in
to Dogelog Player, get_atom/3. This is a kind of
read_line/2, but with a different semantic than the

read line we had so far. get_atom/3 can be used
to read line via get_atom(S, 0'\n, X), and it can
be also used to read full files get_atom(S, -1, X).

The difference to our old read line, when using
get_atom(S, 0'\n, X) it will include the 0'\n in
the result. A big surprise was now the harness

for with input from. It uses change_arg/3 !!!

/**
* with_text_from(A, G):
* The predicate succeeds whenever the goal G succeeds and
* provides A as its text input.
*/
% with_text_from(+Atom, +Goal)
with_text_from(A, G) :-
current_input(S),
H = v(A),
try_call_finally(
redirect_text_input(H),
G,
advance_text_input(S, H)).

% redirect_text_input(+Compound)
redirect_text_input(H) :-
arg(1, H, A),
open('memory.txt', write, S),
put_atom(S, A),
close(S),
open('memory.txt', read, T),
set_input(T).

% advance_text_input(+Stream, +Compound)
advance_text_input(S, H) :-
current_input(T),
get_atom(T, -1, A),
close(T),
change_arg(1, H, A),
set_input(S).

The source code of these Dogelog Player testing utilities
is open sourced in a new folder dogelog_comply:

Prolog Text "charsio" - Compliance Dogelog Spieler
http://pages.xlog.ch/littab/doclet/docs/10_samples/04_doge_comply/reference/harness/charsio.html

Mostowski Collapse schrieb:
> Is it a sign, that the SWI-Prolog parser/unparser wasn’t built
> from a master class in test driven development? Well testing
> input/output in Prolog system can be a headache.
>
> I have a new take on a corresponding harness. This is quite
> interesting. It is a harness tailored towards Dogelog Player,
> which unlike formerly Jekejeke Prolog does NOT ASSUME:
>
> - Memory Files: For Dogelog Player we do NOT ASSUME
> to have access as we did in formerly Jekejeke Prolog. So
> a memory file is simulated by memory.txt, ordinary file.
>
> - setup_call_cleanup/3: For Dogelog Player we currently do
> NOT ASSUME, although such a predicate might come later.
> In formerly Jekejeke Prolog the harness uses this.
>
> So how do we check with output to? Here is our new take:
>
> /**
> * with_text_to(A, G):
> * The predicate succeeds whenever the goal G succeeds and
> * unifies A with its text output.
> */
> % with_text_to(-Atom, +Goal)
> with_text_to(A, G) :-
> current_output(S),
> try_call_finally(
> redirect_text_output,
> G,
> fetch_text_output(S, A)).
>
> % redirect_text_output
> redirect_text_output :-
> open('memory.txt', write, S),
> set_output(S).
>
> % fetch_text_output(+Stream, -Atom)
> fetch_text_output(S, A) :-
> current_output(T),
> close(T),
> open('memory.txt', read, R),
> get_atom(R, -1, A),
> close(R),
> set_output(S).
>
> And then:
>
> /**
> * try_call_finally(T, G, F):
> * The predicate succeeds whenever G succeeds. The goal T is
> * called for the call and redo port. The goal F is called for
> * the exit, fail and error port.
> */
> % try_call_finally(+Goal, +Goal, +Goal)
> try_call_finally(T, G, F) :-
> (T; F, fail),
> '$MARK'(X),
> catch(G, E, (F, throw(E))),
> '$MARK'(Y),
> (X == Y -> !, F; (F; T, fail)).
>

Re: About the Operator '|' and the DCG Draft

<5bb791dd-1870-4d3e-ab5f-144960a0f16en@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:620a:6cc:b0:69b:dd1b:3235 with SMTP id 12-20020a05620a06cc00b0069bdd1b3235mr9602886qky.374.1649671495760;
Mon, 11 Apr 2022 03:04:55 -0700 (PDT)
X-Received: by 2002:a81:5c86:0:b0:2ea:6d45:fea6 with SMTP id
q128-20020a815c86000000b002ea6d45fea6mr25442368ywb.421.1649671495552; Mon, 11
Apr 2022 03:04:55 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.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, 11 Apr 2022 03:04:55 -0700 (PDT)
In-Reply-To: <t30qfn$o195$1@solani.org>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.53.70; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.53.70
References: <27a911c0-3a2f-4054-81e5-bad9d8320750n@googlegroups.com>
<163a9271-9d06-4fbc-8d3c-1903bd8733bdn@googlegroups.com> <c07fe58b-ca4d-44d1-a716-1790a2033be0n@googlegroups.com>
<82d76042-37a3-44ab-addc-3784060038ccn@googlegroups.com> <9f1d1d60-7c54-4c2d-a655-04b651565d0bn@googlegroups.com>
<0d15e64d-f537-4313-b637-cdd0f66a1761n@googlegroups.com> <52b84705-714c-4248-b85b-a643413b7ff3n@googlegroups.com>
<0152c446-3e8e-4e4f-807c-51e913f95708n@googlegroups.com> <c7ee2838-d75c-4807-982a-fd3567d82374n@googlegroups.com>
<a0dd0b5f-b459-48d3-842b-675f9712c902n@googlegroups.com> <7950d178-a688-4122-ab3a-c5105359632cn@googlegroups.com>
<d8530517-401e-46ec-84f3-7f09c8dd70f5n@googlegroups.com> <870d9bb1-4c0f-41a2-8430-99abd733eed1n@googlegroups.com>
<8f5f92be-4fbe-4093-8ee9-a4796618e0can@googlegroups.com> <adcb7512-f998-4843-bab4-f1b2c7342b40n@googlegroups.com>
<ed1a10f3-0abf-4ca9-8dce-fe2fe99a58c4n@googlegroups.com> <13feb23a-5af2-403a-ae04-de846eef0135n@googlegroups.com>
<t30qfn$o195$1@solani.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <5bb791dd-1870-4d3e-ab5f-144960a0f16en@googlegroups.com>
Subject: Re: About the Operator '|' and the DCG Draft
From: burse...@gmail.com (Mostowski Collapse)
Injection-Date: Mon, 11 Apr 2022 10:04:55 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 35
 by: Mostowski Collapse - Mon, 11 Apr 2022 10:04 UTC

This is probably not the canary in the coal mine for the
suspected bugs. One can check by himself/herself, not
a single use of fy or yfx operator:

ALE – Attribute Logic Engine
http://www.cs.toronto.edu/~gpenn/ale/files/ale.pl

Maybe I can dig out an TPTP example, currently working
with the normal test cases that circulate, that are more abstract.
The trouble maker is this here from Phil Zucker:

:- op( 500, fy, !). % universal quantifier: ![X]:
:- op( 500, fy, ?). % existential quantifier: ?[X]:
:- op( 500,xfy, :).

If you change the later into:

:- op( 500,yfx, :).

You get a difference in SWI-Prolog and SICStus Prolog:

/* SWI-Prolog (threaded, 64 bits, version 8.5.8) */
?- X = (![Y]:p(Y)), write_canonical(X), nl.
:(!([A]),p(A))
X = ![Y]:p(Y).

/* SICStus 4.7.1 (x86_64-win32-nt-4) */
?- X = (![Y]:p(Y)), write_canonical(X), nl.
!(:('.'(_953,[]),p(_953)))
X = ![Y]:p(Y) ?

Note the difference, SWI-Prolog gives :(!(...) whereas SICStus Prolog
gives !(:(...). So the same SICStus Prolog code that would use a !_
pattern somewhere in his Prolog clauses, doesn’t run in SWI-Prolog.

There are LeanTap variants that use such patterns

Re: About the Operator '|' and the DCG Draft

<87694357-6814-462c-985e-b4dac5464de0n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:ac8:75d1:0:b0:2ed:161f:1f0a with SMTP id z17-20020ac875d1000000b002ed161f1f0amr5602998qtq.173.1649672245509;
Mon, 11 Apr 2022 03:17:25 -0700 (PDT)
X-Received: by 2002:a25:6652:0:b0:641:25c9:9c04 with SMTP id
z18-20020a256652000000b0064125c99c04mr6281497ybm.94.1649672245282; Mon, 11
Apr 2022 03:17:25 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.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, 11 Apr 2022 03:17:25 -0700 (PDT)
In-Reply-To: <5bb791dd-1870-4d3e-ab5f-144960a0f16en@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.53.70; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.53.70
References: <27a911c0-3a2f-4054-81e5-bad9d8320750n@googlegroups.com>
<163a9271-9d06-4fbc-8d3c-1903bd8733bdn@googlegroups.com> <c07fe58b-ca4d-44d1-a716-1790a2033be0n@googlegroups.com>
<82d76042-37a3-44ab-addc-3784060038ccn@googlegroups.com> <9f1d1d60-7c54-4c2d-a655-04b651565d0bn@googlegroups.com>
<0d15e64d-f537-4313-b637-cdd0f66a1761n@googlegroups.com> <52b84705-714c-4248-b85b-a643413b7ff3n@googlegroups.com>
<0152c446-3e8e-4e4f-807c-51e913f95708n@googlegroups.com> <c7ee2838-d75c-4807-982a-fd3567d82374n@googlegroups.com>
<a0dd0b5f-b459-48d3-842b-675f9712c902n@googlegroups.com> <7950d178-a688-4122-ab3a-c5105359632cn@googlegroups.com>
<d8530517-401e-46ec-84f3-7f09c8dd70f5n@googlegroups.com> <870d9bb1-4c0f-41a2-8430-99abd733eed1n@googlegroups.com>
<8f5f92be-4fbe-4093-8ee9-a4796618e0can@googlegroups.com> <adcb7512-f998-4843-bab4-f1b2c7342b40n@googlegroups.com>
<ed1a10f3-0abf-4ca9-8dce-fe2fe99a58c4n@googlegroups.com> <13feb23a-5af2-403a-ae04-de846eef0135n@googlegroups.com>
<t30qfn$o195$1@solani.org> <5bb791dd-1870-4d3e-ab5f-144960a0f16en@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <87694357-6814-462c-985e-b4dac5464de0n@googlegroups.com>
Subject: Re: About the Operator '|' and the DCG Draft
From: burse...@gmail.com (Mostowski Collapse)
Injection-Date: Mon, 11 Apr 2022 10:17:25 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 44
 by: Mostowski Collapse - Mon, 11 Apr 2022 10:17 UTC

Basically you get a **silent error**. Everything parses
fine, the Prolog text can be prepared for execution,
your code just stops working correctly, when

migrating from SICStus Prolog to SWI-Prolog.

Mostowski Collapse schrieb am Montag, 11. April 2022 um 12:04:56 UTC+2:
> This is probably not the canary in the coal mine for the
> suspected bugs. One can check by himself/herself, not
> a single use of fy or yfx operator:
>
> ALE – Attribute Logic Engine
> http://www.cs.toronto.edu/~gpenn/ale/files/ale.pl
>
> Maybe I can dig out an TPTP example, currently working
> with the normal test cases that circulate, that are more abstract.
> The trouble maker is this here from Phil Zucker:
>
> :- op( 500, fy, !). % universal quantifier: ![X]:
> :- op( 500, fy, ?). % existential quantifier: ?[X]:
> :- op( 500,xfy, :).
>
> If you change the later into:
>
> :- op( 500,yfx, :).
>
> You get a difference in SWI-Prolog and SICStus Prolog:
>
> /* SWI-Prolog (threaded, 64 bits, version 8.5.8) */
> ?- X = (![Y]:p(Y)), write_canonical(X), nl.
> :(!([A]),p(A))
> X = ![Y]:p(Y).
>
> /* SICStus 4.7.1 (x86_64-win32-nt-4) */
> ?- X = (![Y]:p(Y)), write_canonical(X), nl.
> !(:('.'(_953,[]),p(_953)))
> X = ![Y]:p(Y) ?
>
> Note the difference, SWI-Prolog gives :(!(...) whereas SICStus Prolog
> gives !(:(...). So the same SICStus Prolog code that would use a !_
> pattern somewhere in his Prolog clauses, doesn’t run in SWI-Prolog.
>
> There are LeanTap variants that use such patterns

Re: About the Operator '|' and the DCG Draft

<8b9def0e-c75b-49e2-9604-578e96616518n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:ad4:44b4:0:b0:444:45d6:ec25 with SMTP id n20-20020ad444b4000000b0044445d6ec25mr11468434qvt.24.1649816640313;
Tue, 12 Apr 2022 19:24:00 -0700 (PDT)
X-Received: by 2002:a25:8c01:0:b0:634:712d:3def with SMTP id
k1-20020a258c01000000b00634712d3defmr28908747ybl.343.1649816640159; Tue, 12
Apr 2022 19:24:00 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.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: Tue, 12 Apr 2022 19:23:59 -0700 (PDT)
In-Reply-To: <87694357-6814-462c-985e-b4dac5464de0n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.53.70; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.53.70
References: <27a911c0-3a2f-4054-81e5-bad9d8320750n@googlegroups.com>
<163a9271-9d06-4fbc-8d3c-1903bd8733bdn@googlegroups.com> <c07fe58b-ca4d-44d1-a716-1790a2033be0n@googlegroups.com>
<82d76042-37a3-44ab-addc-3784060038ccn@googlegroups.com> <9f1d1d60-7c54-4c2d-a655-04b651565d0bn@googlegroups.com>
<0d15e64d-f537-4313-b637-cdd0f66a1761n@googlegroups.com> <52b84705-714c-4248-b85b-a643413b7ff3n@googlegroups.com>
<0152c446-3e8e-4e4f-807c-51e913f95708n@googlegroups.com> <c7ee2838-d75c-4807-982a-fd3567d82374n@googlegroups.com>
<a0dd0b5f-b459-48d3-842b-675f9712c902n@googlegroups.com> <7950d178-a688-4122-ab3a-c5105359632cn@googlegroups.com>
<d8530517-401e-46ec-84f3-7f09c8dd70f5n@googlegroups.com> <870d9bb1-4c0f-41a2-8430-99abd733eed1n@googlegroups.com>
<8f5f92be-4fbe-4093-8ee9-a4796618e0can@googlegroups.com> <adcb7512-f998-4843-bab4-f1b2c7342b40n@googlegroups.com>
<ed1a10f3-0abf-4ca9-8dce-fe2fe99a58c4n@googlegroups.com> <13feb23a-5af2-403a-ae04-de846eef0135n@googlegroups.com>
<t30qfn$o195$1@solani.org> <5bb791dd-1870-4d3e-ab5f-144960a0f16en@googlegroups.com>
<87694357-6814-462c-985e-b4dac5464de0n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <8b9def0e-c75b-49e2-9604-578e96616518n@googlegroups.com>
Subject: Re: About the Operator '|' and the DCG Draft
From: burse...@gmail.com (Mostowski Collapse)
Injection-Date: Wed, 13 Apr 2022 02:24:00 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 11
 by: Mostowski Collapse - Wed, 13 Apr 2022 02:23 UTC

Suddently, in a flash of light, thanks to Mr Peter Ludemann,
my guardian angle, the good shepherd, I saw that my whole
life was a lie. Why did I become so deeply absorbed with

the parsing problem? Ok, I will stop from now on. LoL

Mostowski Collapse schrieb am Montag, 11. April 2022 um 12:17:26 UTC+2:
> Basically you get a **silent error**. Everything parses
> fine, the Prolog text can be prepared for execution,
> your code just stops working correctly, when
>
> migrating from SICStus Prolog to SWI-Prolog.

Re: About the Operator '|' and the DCG Draft

<0c65ee8a-05e5-48c1-a15f-7357f8f4a3can@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:ac8:7ca2:0:b0:2eb:db4c:1b53 with SMTP id z2-20020ac87ca2000000b002ebdb4c1b53mr5512364qtv.307.1649816841200;
Tue, 12 Apr 2022 19:27:21 -0700 (PDT)
X-Received: by 2002:a05:6902:727:b0:641:c583:df4b with SMTP id
l7-20020a056902072700b00641c583df4bmr2052781ybt.592.1649816841026; Tue, 12
Apr 2022 19:27:21 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.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: Tue, 12 Apr 2022 19:27:20 -0700 (PDT)
In-Reply-To: <8b9def0e-c75b-49e2-9604-578e96616518n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.53.70; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.53.70
References: <27a911c0-3a2f-4054-81e5-bad9d8320750n@googlegroups.com>
<163a9271-9d06-4fbc-8d3c-1903bd8733bdn@googlegroups.com> <c07fe58b-ca4d-44d1-a716-1790a2033be0n@googlegroups.com>
<82d76042-37a3-44ab-addc-3784060038ccn@googlegroups.com> <9f1d1d60-7c54-4c2d-a655-04b651565d0bn@googlegroups.com>
<0d15e64d-f537-4313-b637-cdd0f66a1761n@googlegroups.com> <52b84705-714c-4248-b85b-a643413b7ff3n@googlegroups.com>
<0152c446-3e8e-4e4f-807c-51e913f95708n@googlegroups.com> <c7ee2838-d75c-4807-982a-fd3567d82374n@googlegroups.com>
<a0dd0b5f-b459-48d3-842b-675f9712c902n@googlegroups.com> <7950d178-a688-4122-ab3a-c5105359632cn@googlegroups.com>
<d8530517-401e-46ec-84f3-7f09c8dd70f5n@googlegroups.com> <870d9bb1-4c0f-41a2-8430-99abd733eed1n@googlegroups.com>
<8f5f92be-4fbe-4093-8ee9-a4796618e0can@googlegroups.com> <adcb7512-f998-4843-bab4-f1b2c7342b40n@googlegroups.com>
<ed1a10f3-0abf-4ca9-8dce-fe2fe99a58c4n@googlegroups.com> <13feb23a-5af2-403a-ae04-de846eef0135n@googlegroups.com>
<t30qfn$o195$1@solani.org> <5bb791dd-1870-4d3e-ab5f-144960a0f16en@googlegroups.com>
<87694357-6814-462c-985e-b4dac5464de0n@googlegroups.com> <8b9def0e-c75b-49e2-9604-578e96616518n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <0c65ee8a-05e5-48c1-a15f-7357f8f4a3can@googlegroups.com>
Subject: Re: About the Operator '|' and the DCG Draft
From: burse...@gmail.com (Mostowski Collapse)
Injection-Date: Wed, 13 Apr 2022 02:27:21 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 20
 by: Mostowski Collapse - Wed, 13 Apr 2022 02:27 UTC

Just joking, the business is basically finished, I have now:

Dogelog Player is now at 80% of Testing its Predicates
https://twitter.com/dogelogch/status/1514036461968015362

Dogelog Player is now at 80% of Testing its Predicates
https://www.facebook.com/groups/dogelog

Mostowski Collapse schrieb am Mittwoch, 13. April 2022 um 04:24:01 UTC+2:
> Suddently, in a flash of light, thanks to Mr Peter Ludemann,
> my guardian angle, the good shepherd, I saw that my whole
> life was a lie. Why did I become so deeply absorbed with
>
> the parsing problem? Ok, I will stop from now on. LoL
> Mostowski Collapse schrieb am Montag, 11. April 2022 um 12:17:26 UTC+2:
> > Basically you get a **silent error**. Everything parses
> > fine, the Prolog text can be prepared for execution,
> > your code just stops working correctly, when
> >
> > migrating from SICStus Prolog to SWI-Prolog.

Re: About the Operator '|' and the DCG Draft

<1d23bf74-8e21-40dd-964b-394714380030n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:ac8:5c85:0:b0:2e2:3211:92e9 with SMTP id r5-20020ac85c85000000b002e2321192e9mr5906521qta.386.1649824217607;
Tue, 12 Apr 2022 21:30:17 -0700 (PDT)
X-Received: by 2002:a5b:f83:0:b0:63d:a251:2c51 with SMTP id
q3-20020a5b0f83000000b0063da2512c51mr27247010ybh.594.1649824217449; Tue, 12
Apr 2022 21:30:17 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.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: Tue, 12 Apr 2022 21:30:17 -0700 (PDT)
In-Reply-To: <0c65ee8a-05e5-48c1-a15f-7357f8f4a3can@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.53.70; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.53.70
References: <27a911c0-3a2f-4054-81e5-bad9d8320750n@googlegroups.com>
<163a9271-9d06-4fbc-8d3c-1903bd8733bdn@googlegroups.com> <c07fe58b-ca4d-44d1-a716-1790a2033be0n@googlegroups.com>
<82d76042-37a3-44ab-addc-3784060038ccn@googlegroups.com> <9f1d1d60-7c54-4c2d-a655-04b651565d0bn@googlegroups.com>
<0d15e64d-f537-4313-b637-cdd0f66a1761n@googlegroups.com> <52b84705-714c-4248-b85b-a643413b7ff3n@googlegroups.com>
<0152c446-3e8e-4e4f-807c-51e913f95708n@googlegroups.com> <c7ee2838-d75c-4807-982a-fd3567d82374n@googlegroups.com>
<a0dd0b5f-b459-48d3-842b-675f9712c902n@googlegroups.com> <7950d178-a688-4122-ab3a-c5105359632cn@googlegroups.com>
<d8530517-401e-46ec-84f3-7f09c8dd70f5n@googlegroups.com> <870d9bb1-4c0f-41a2-8430-99abd733eed1n@googlegroups.com>
<8f5f92be-4fbe-4093-8ee9-a4796618e0can@googlegroups.com> <adcb7512-f998-4843-bab4-f1b2c7342b40n@googlegroups.com>
<ed1a10f3-0abf-4ca9-8dce-fe2fe99a58c4n@googlegroups.com> <13feb23a-5af2-403a-ae04-de846eef0135n@googlegroups.com>
<t30qfn$o195$1@solani.org> <5bb791dd-1870-4d3e-ab5f-144960a0f16en@googlegroups.com>
<87694357-6814-462c-985e-b4dac5464de0n@googlegroups.com> <8b9def0e-c75b-49e2-9604-578e96616518n@googlegroups.com>
<0c65ee8a-05e5-48c1-a15f-7357f8f4a3can@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <1d23bf74-8e21-40dd-964b-394714380030n@googlegroups.com>
Subject: Re: About the Operator '|' and the DCG Draft
From: burse...@gmail.com (Mostowski Collapse)
Injection-Date: Wed, 13 Apr 2022 04:30:17 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 12
 by: Mostowski Collapse - Wed, 13 Apr 2022 04:30 UTC

Thats quite some news:

I see the problem corner cases as ones than can be easily avoided
through judicious operator definitions. Any DSL’s that use such cases
are asking for trouble IMO.

Do I understand you correctly. You say avoid certain operator combinations?
How would a normal end-user or DSL designer notice them?

Do they have some special characteristics? Or do you have an explicit list of
those operator combinations that should be avoided?

Re: About the Operator '|' and the DCG Draft

<70ec78de-68d5-4f2f-b02f-27e217354547n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:622a:c3:b0:2e3:4bd0:16c2 with SMTP id p3-20020a05622a00c300b002e34bd016c2mr5784794qtw.575.1649824347639;
Tue, 12 Apr 2022 21:32:27 -0700 (PDT)
X-Received: by 2002:a05:6902:727:b0:641:c583:df4b with SMTP id
l7-20020a056902072700b00641c583df4bmr2287909ybt.592.1649824347502; Tue, 12
Apr 2022 21:32:27 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.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: Tue, 12 Apr 2022 21:32:27 -0700 (PDT)
In-Reply-To: <1d23bf74-8e21-40dd-964b-394714380030n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.53.70; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.53.70
References: <27a911c0-3a2f-4054-81e5-bad9d8320750n@googlegroups.com>
<163a9271-9d06-4fbc-8d3c-1903bd8733bdn@googlegroups.com> <c07fe58b-ca4d-44d1-a716-1790a2033be0n@googlegroups.com>
<82d76042-37a3-44ab-addc-3784060038ccn@googlegroups.com> <9f1d1d60-7c54-4c2d-a655-04b651565d0bn@googlegroups.com>
<0d15e64d-f537-4313-b637-cdd0f66a1761n@googlegroups.com> <52b84705-714c-4248-b85b-a643413b7ff3n@googlegroups.com>
<0152c446-3e8e-4e4f-807c-51e913f95708n@googlegroups.com> <c7ee2838-d75c-4807-982a-fd3567d82374n@googlegroups.com>
<a0dd0b5f-b459-48d3-842b-675f9712c902n@googlegroups.com> <7950d178-a688-4122-ab3a-c5105359632cn@googlegroups.com>
<d8530517-401e-46ec-84f3-7f09c8dd70f5n@googlegroups.com> <870d9bb1-4c0f-41a2-8430-99abd733eed1n@googlegroups.com>
<8f5f92be-4fbe-4093-8ee9-a4796618e0can@googlegroups.com> <adcb7512-f998-4843-bab4-f1b2c7342b40n@googlegroups.com>
<ed1a10f3-0abf-4ca9-8dce-fe2fe99a58c4n@googlegroups.com> <13feb23a-5af2-403a-ae04-de846eef0135n@googlegroups.com>
<t30qfn$o195$1@solani.org> <5bb791dd-1870-4d3e-ab5f-144960a0f16en@googlegroups.com>
<87694357-6814-462c-985e-b4dac5464de0n@googlegroups.com> <8b9def0e-c75b-49e2-9604-578e96616518n@googlegroups.com>
<0c65ee8a-05e5-48c1-a15f-7357f8f4a3can@googlegroups.com> <1d23bf74-8e21-40dd-964b-394714380030n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <70ec78de-68d5-4f2f-b02f-27e217354547n@googlegroups.com>
Subject: Re: About the Operator '|' and the DCG Draft
From: burse...@gmail.com (Mostowski Collapse)
Injection-Date: Wed, 13 Apr 2022 04:32:27 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 59
 by: Mostowski Collapse - Wed, 13 Apr 2022 04:32 UTC

Here is a funny example in the wild, the authors seems not to have known
the ridgeworks rules, since he used:

% Christophe Meudec
% Eclipse 6.0 program
:- op(30, fy, [not]). % must be fy for 'not not a' expressions
:- op(30, yfx, [**, abs]). % must be left to right for 'a ** b ** c' expressions

https://github.com/echancrure/PTC-Solver/blob/f02c64925fbc06a9f2cbbef252684ebccd5bd217/source/util__post_precedence.pl#L12

Which is an attempt to model ADA programming language. The poor guy will have
quite a surprise when mirgating from ECLiPSe to SWI-Prolog:

/* ECLiPSe Prolog */
[eclipse 2]: X = (not not not 2 ** 3 ** 4), write_canonical(X), nl.
not(not(not(**(**(2, 3), 4))))

X = not not not 2 ** 3 ** 4
Yes (0.00s cpu)

And then:

/* SWI-Prolog */
?- op(30, fy, not), op(30, yfx, **).
true.

?- X = (not not not 2 ** 3 ** 4), write_canonical(X), nl.
**(**(not(not(not(2))),3),4)
X = not not not 2**3**4.

If you evaluate the two expressions with bitwise arithmetic you get different results:

[eclipse 6]: X is \(\(\((2^3)^4))).
X = -4097

[eclipse 7]: X is (\(\(\(2)))^3)^4.
X = 531441

For ADA operators:
https://www.adaic.org/resources/add_content/standards/05rm/html/RM-4-5.html

Mostowski Collapse schrieb am Mittwoch, 13. April 2022 um 06:30:18 UTC+2:
> Thats quite some news:
>
> I see the problem corner cases as ones than can be easily avoided
> through judicious operator definitions. Any DSL’s that use such cases
> are asking for trouble IMO.
>
> Do I understand you correctly. You say avoid certain operator combinations?
> How would a normal end-user or DSL designer notice them?
>
> Do they have some special characteristics? Or do you have an explicit list of
> those operator combinations that should be avoided?

Re: About the Operator '|' and the DCG Draft

<ecf60f58-e711-41a1-8d69-cff4cbe8abacn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a37:5e42:0:b0:69a:eac:d843 with SMTP id s63-20020a375e42000000b0069a0eacd843mr5979828qkb.526.1649842996022;
Wed, 13 Apr 2022 02:43:16 -0700 (PDT)
X-Received: by 2002:a81:9c06:0:b0:2eb:d9a7:7f80 with SMTP id
m6-20020a819c06000000b002ebd9a77f80mr22473879ywa.464.1649842995882; Wed, 13
Apr 2022 02:43:15 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Wed, 13 Apr 2022 02:43:15 -0700 (PDT)
In-Reply-To: <70ec78de-68d5-4f2f-b02f-27e217354547n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.53.70; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.53.70
References: <27a911c0-3a2f-4054-81e5-bad9d8320750n@googlegroups.com>
<163a9271-9d06-4fbc-8d3c-1903bd8733bdn@googlegroups.com> <c07fe58b-ca4d-44d1-a716-1790a2033be0n@googlegroups.com>
<82d76042-37a3-44ab-addc-3784060038ccn@googlegroups.com> <9f1d1d60-7c54-4c2d-a655-04b651565d0bn@googlegroups.com>
<0d15e64d-f537-4313-b637-cdd0f66a1761n@googlegroups.com> <52b84705-714c-4248-b85b-a643413b7ff3n@googlegroups.com>
<0152c446-3e8e-4e4f-807c-51e913f95708n@googlegroups.com> <c7ee2838-d75c-4807-982a-fd3567d82374n@googlegroups.com>
<a0dd0b5f-b459-48d3-842b-675f9712c902n@googlegroups.com> <7950d178-a688-4122-ab3a-c5105359632cn@googlegroups.com>
<d8530517-401e-46ec-84f3-7f09c8dd70f5n@googlegroups.com> <870d9bb1-4c0f-41a2-8430-99abd733eed1n@googlegroups.com>
<8f5f92be-4fbe-4093-8ee9-a4796618e0can@googlegroups.com> <adcb7512-f998-4843-bab4-f1b2c7342b40n@googlegroups.com>
<ed1a10f3-0abf-4ca9-8dce-fe2fe99a58c4n@googlegroups.com> <13feb23a-5af2-403a-ae04-de846eef0135n@googlegroups.com>
<t30qfn$o195$1@solani.org> <5bb791dd-1870-4d3e-ab5f-144960a0f16en@googlegroups.com>
<87694357-6814-462c-985e-b4dac5464de0n@googlegroups.com> <8b9def0e-c75b-49e2-9604-578e96616518n@googlegroups.com>
<0c65ee8a-05e5-48c1-a15f-7357f8f4a3can@googlegroups.com> <1d23bf74-8e21-40dd-964b-394714380030n@googlegroups.com>
<70ec78de-68d5-4f2f-b02f-27e217354547n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <ecf60f58-e711-41a1-8d69-cff4cbe8abacn@googlegroups.com>
Subject: Re: About the Operator '|' and the DCG Draft
From: burse...@gmail.com (Mostowski Collapse)
Injection-Date: Wed, 13 Apr 2022 09:43:16 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 17
 by: Mostowski Collapse - Wed, 13 Apr 2022 09:43 UTC

Woke up in the morning and my brain only produced new challenges.

I am still trying to find a case in the wild in favor of SWI-Prolog. For
example if ADA would effectively parse:

abs x ** y

As this here:

**(abs(x), y)

Then the ISO core standard is somehow not “right”, or lets say more “arbitrary” than
I tought. Which could be an interesting turn of events.

The problem with my suggested fix, using “fx” instead “fy”, it does not work when you
you want to support multiple braketless occurences of an operator.

Re: About the Operator '|' and the DCG Draft

<1ce7789e-d26d-4fb0-bbac-b4eb036838c9n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:ac8:7ca2:0:b0:2eb:db4c:1b53 with SMTP id z2-20020ac87ca2000000b002ebdb4c1b53mr6278130qtv.307.1649843060136;
Wed, 13 Apr 2022 02:44:20 -0700 (PDT)
X-Received: by 2002:a05:690c:113:b0:2ef:260b:3801 with SMTP id
bd19-20020a05690c011300b002ef260b3801mr7635483ywb.49.1649843059954; Wed, 13
Apr 2022 02:44:19 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Wed, 13 Apr 2022 02:44:19 -0700 (PDT)
In-Reply-To: <ecf60f58-e711-41a1-8d69-cff4cbe8abacn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.53.70; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.53.70
References: <27a911c0-3a2f-4054-81e5-bad9d8320750n@googlegroups.com>
<163a9271-9d06-4fbc-8d3c-1903bd8733bdn@googlegroups.com> <c07fe58b-ca4d-44d1-a716-1790a2033be0n@googlegroups.com>
<82d76042-37a3-44ab-addc-3784060038ccn@googlegroups.com> <9f1d1d60-7c54-4c2d-a655-04b651565d0bn@googlegroups.com>
<0d15e64d-f537-4313-b637-cdd0f66a1761n@googlegroups.com> <52b84705-714c-4248-b85b-a643413b7ff3n@googlegroups.com>
<0152c446-3e8e-4e4f-807c-51e913f95708n@googlegroups.com> <c7ee2838-d75c-4807-982a-fd3567d82374n@googlegroups.com>
<a0dd0b5f-b459-48d3-842b-675f9712c902n@googlegroups.com> <7950d178-a688-4122-ab3a-c5105359632cn@googlegroups.com>
<d8530517-401e-46ec-84f3-7f09c8dd70f5n@googlegroups.com> <870d9bb1-4c0f-41a2-8430-99abd733eed1n@googlegroups.com>
<8f5f92be-4fbe-4093-8ee9-a4796618e0can@googlegroups.com> <adcb7512-f998-4843-bab4-f1b2c7342b40n@googlegroups.com>
<ed1a10f3-0abf-4ca9-8dce-fe2fe99a58c4n@googlegroups.com> <13feb23a-5af2-403a-ae04-de846eef0135n@googlegroups.com>
<t30qfn$o195$1@solani.org> <5bb791dd-1870-4d3e-ab5f-144960a0f16en@googlegroups.com>
<87694357-6814-462c-985e-b4dac5464de0n@googlegroups.com> <8b9def0e-c75b-49e2-9604-578e96616518n@googlegroups.com>
<0c65ee8a-05e5-48c1-a15f-7357f8f4a3can@googlegroups.com> <1d23bf74-8e21-40dd-964b-394714380030n@googlegroups.com>
<70ec78de-68d5-4f2f-b02f-27e217354547n@googlegroups.com> <ecf60f58-e711-41a1-8d69-cff4cbe8abacn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <1ce7789e-d26d-4fb0-bbac-b4eb036838c9n@googlegroups.com>
Subject: Re: About the Operator '|' and the DCG Draft
From: burse...@gmail.com (Mostowski Collapse)
Injection-Date: Wed, 13 Apr 2022 09:44:20 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 34
 by: Mostowski Collapse - Wed, 13 Apr 2022 09:44 UTC

Take the pPEG parsers rule:

op_associativityEq(fy,yfx,left).

Change it into this:

op_associativityEq(fy,yfx,left) :- current_prolog_flag(iso, false).
op_associativityEq(fy,yfx,right) :- current_prolog_flag(iso, true).

What will the pPEG parser do now? Is there also a pPEG unparser?

https://swi-prolog.discourse.group/t/parsing-text-using-a-formal-grammar/5086

Mostowski Collapse schrieb am Mittwoch, 13. April 2022 um 11:43:16 UTC+2:
> Woke up in the morning and my brain only produced new challenges.
>
> I am still trying to find a case in the wild in favor of SWI-Prolog. For
> example if ADA would effectively parse:
>
> abs x ** y
>
> As this here:
>
> **(abs(x), y)
>
> Then the ISO core standard is somehow not “right”, or lets say more “arbitrary” than
> I tought. Which could be an interesting turn of events.
>
> The problem with my suggested fix, using “fx” instead “fy”, it does not work when you
> you want to support multiple braketless occurences of an operator.

Re: About the Operator '|' and the DCG Draft

<87653350-350a-4527-9848-ac609c1a64abn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a37:b442:0:b0:69a:fc75:ca52 with SMTP id d63-20020a37b442000000b0069afc75ca52mr7825995qkf.730.1649874652634;
Wed, 13 Apr 2022 11:30:52 -0700 (PDT)
X-Received: by 2002:a81:234b:0:b0:2eb:718b:c824 with SMTP id
j72-20020a81234b000000b002eb718bc824mr187261ywj.520.1649874652465; Wed, 13
Apr 2022 11:30:52 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!news.freedyn.de!newsreader4.netcologne.de!news.netcologne.de!peer03.ams1!peer.ams1.xlned.com!news.xlned.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Wed, 13 Apr 2022 11:30:52 -0700 (PDT)
In-Reply-To: <1ce7789e-d26d-4fb0-bbac-b4eb036838c9n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.53.70; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.53.70
References: <27a911c0-3a2f-4054-81e5-bad9d8320750n@googlegroups.com>
<163a9271-9d06-4fbc-8d3c-1903bd8733bdn@googlegroups.com> <c07fe58b-ca4d-44d1-a716-1790a2033be0n@googlegroups.com>
<82d76042-37a3-44ab-addc-3784060038ccn@googlegroups.com> <9f1d1d60-7c54-4c2d-a655-04b651565d0bn@googlegroups.com>
<0d15e64d-f537-4313-b637-cdd0f66a1761n@googlegroups.com> <52b84705-714c-4248-b85b-a643413b7ff3n@googlegroups.com>
<0152c446-3e8e-4e4f-807c-51e913f95708n@googlegroups.com> <c7ee2838-d75c-4807-982a-fd3567d82374n@googlegroups.com>
<a0dd0b5f-b459-48d3-842b-675f9712c902n@googlegroups.com> <7950d178-a688-4122-ab3a-c5105359632cn@googlegroups.com>
<d8530517-401e-46ec-84f3-7f09c8dd70f5n@googlegroups.com> <870d9bb1-4c0f-41a2-8430-99abd733eed1n@googlegroups.com>
<8f5f92be-4fbe-4093-8ee9-a4796618e0can@googlegroups.com> <adcb7512-f998-4843-bab4-f1b2c7342b40n@googlegroups.com>
<ed1a10f3-0abf-4ca9-8dce-fe2fe99a58c4n@googlegroups.com> <13feb23a-5af2-403a-ae04-de846eef0135n@googlegroups.com>
<t30qfn$o195$1@solani.org> <5bb791dd-1870-4d3e-ab5f-144960a0f16en@googlegroups.com>
<87694357-6814-462c-985e-b4dac5464de0n@googlegroups.com> <8b9def0e-c75b-49e2-9604-578e96616518n@googlegroups.com>
<0c65ee8a-05e5-48c1-a15f-7357f8f4a3can@googlegroups.com> <1d23bf74-8e21-40dd-964b-394714380030n@googlegroups.com>
<70ec78de-68d5-4f2f-b02f-27e217354547n@googlegroups.com> <ecf60f58-e711-41a1-8d69-cff4cbe8abacn@googlegroups.com>
<1ce7789e-d26d-4fb0-bbac-b4eb036838c9n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <87653350-350a-4527-9848-ac609c1a64abn@googlegroups.com>
Subject: Re: About the Operator '|' and the DCG Draft
From: burse...@gmail.com (Mostowski Collapse)
Injection-Date: Wed, 13 Apr 2022 18:30:52 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 4444
 by: Mostowski Collapse - Wed, 13 Apr 2022 18:30 UTC

Ok it wurks. I changed pl_parser.pl accordingly, and I now get:

?- string_termList("fy 1 yfx 2.", [T]), write_canonical(T), nl.
yfx(fy(1),2)
T = fy 1 yfx 2.

?- set_prolog_flag(iso, true).
true.

?- string_termList("fy 1 yfx 2.", [T]), write_canonical(T), nl.
fy(yfx(1,2))
T = fy 1 yfx 2.

Eh voila SWI-Prolog has become member of the ISO core standard club.
Maybe it can even apply for V.I.P. membership, because its so important?

Mostowski Collapse schrieb am Mittwoch, 13. April 2022 um 11:44:20 UTC+2:
> Take the pPEG parsers rule:
>
> op_associativityEq(fy,yfx,left).
>
> Change it into this:
>
> op_associativityEq(fy,yfx,left) :- current_prolog_flag(iso, false).
> op_associativityEq(fy,yfx,right) :- current_prolog_flag(iso, true).
>
> What will the pPEG parser do now? Is there also a pPEG unparser?
>
> https://swi-prolog.discourse.group/t/parsing-text-using-a-formal-grammar/5086
> Mostowski Collapse schrieb am Mittwoch, 13. April 2022 um 11:43:16 UTC+2:
> > Woke up in the morning and my brain only produced new challenges.
> >
> > I am still trying to find a case in the wild in favor of SWI-Prolog. For
> > example if ADA would effectively parse:
> >
> > abs x ** y
> >
> > As this here:
> >
> > **(abs(x), y)
> >
> > Then the ISO core standard is somehow not “right”, or lets say more “arbitrary” than
> > I tought. Which could be an interesting turn of events.
> >
> > The problem with my suggested fix, using “fx” instead “fy”, it does not work when you
> > you want to support multiple braketless occurences of an operator.

Re: About the Operator '|' and the DCG Draft

<01c67652-6887-42e5-a533-f72722d92870n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:6214:5199:b0:446:1be8:abf with SMTP id kl25-20020a056214519900b004461be80abfmr1963000qvb.24.1649874770651;
Wed, 13 Apr 2022 11:32:50 -0700 (PDT)
X-Received: by 2002:a81:5607:0:b0:2db:c245:5ff4 with SMTP id
k7-20020a815607000000b002dbc2455ff4mr226678ywb.244.1649874770462; Wed, 13 Apr
2022 11:32:50 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Wed, 13 Apr 2022 11:32:50 -0700 (PDT)
In-Reply-To: <87653350-350a-4527-9848-ac609c1a64abn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.53.70; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.53.70
References: <27a911c0-3a2f-4054-81e5-bad9d8320750n@googlegroups.com>
<163a9271-9d06-4fbc-8d3c-1903bd8733bdn@googlegroups.com> <c07fe58b-ca4d-44d1-a716-1790a2033be0n@googlegroups.com>
<82d76042-37a3-44ab-addc-3784060038ccn@googlegroups.com> <9f1d1d60-7c54-4c2d-a655-04b651565d0bn@googlegroups.com>
<0d15e64d-f537-4313-b637-cdd0f66a1761n@googlegroups.com> <52b84705-714c-4248-b85b-a643413b7ff3n@googlegroups.com>
<0152c446-3e8e-4e4f-807c-51e913f95708n@googlegroups.com> <c7ee2838-d75c-4807-982a-fd3567d82374n@googlegroups.com>
<a0dd0b5f-b459-48d3-842b-675f9712c902n@googlegroups.com> <7950d178-a688-4122-ab3a-c5105359632cn@googlegroups.com>
<d8530517-401e-46ec-84f3-7f09c8dd70f5n@googlegroups.com> <870d9bb1-4c0f-41a2-8430-99abd733eed1n@googlegroups.com>
<8f5f92be-4fbe-4093-8ee9-a4796618e0can@googlegroups.com> <adcb7512-f998-4843-bab4-f1b2c7342b40n@googlegroups.com>
<ed1a10f3-0abf-4ca9-8dce-fe2fe99a58c4n@googlegroups.com> <13feb23a-5af2-403a-ae04-de846eef0135n@googlegroups.com>
<t30qfn$o195$1@solani.org> <5bb791dd-1870-4d3e-ab5f-144960a0f16en@googlegroups.com>
<87694357-6814-462c-985e-b4dac5464de0n@googlegroups.com> <8b9def0e-c75b-49e2-9604-578e96616518n@googlegroups.com>
<0c65ee8a-05e5-48c1-a15f-7357f8f4a3can@googlegroups.com> <1d23bf74-8e21-40dd-964b-394714380030n@googlegroups.com>
<70ec78de-68d5-4f2f-b02f-27e217354547n@googlegroups.com> <ecf60f58-e711-41a1-8d69-cff4cbe8abacn@googlegroups.com>
<1ce7789e-d26d-4fb0-bbac-b4eb036838c9n@googlegroups.com> <87653350-350a-4527-9848-ac609c1a64abn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <01c67652-6887-42e5-a533-f72722d92870n@googlegroups.com>
Subject: Re: About the Operator '|' and the DCG Draft
From: burse...@gmail.com (Mostowski Collapse)
Injection-Date: Wed, 13 Apr 2022 18:32:50 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 61
 by: Mostowski Collapse - Wed, 13 Apr 2022 18:32 UTC

Interestingly the standard unparser of SWI-Prolog doesn’t give a damn.
But this is another defect which I have posted about already in some thread..

aLSO who_ever wrote this code of pPEG deserves to burn in hell,
for mixing underscore and camelcase. Took me quite a while to run the query..

Mostowski Collapse schrieb am Mittwoch, 13. April 2022 um 20:30:53 UTC+2:
> Ok it wurks. I changed pl_parser.pl accordingly, and I now get:
>
> ?- string_termList("fy 1 yfx 2.", [T]), write_canonical(T), nl.
> yfx(fy(1),2)
> T = fy 1 yfx 2.
>
> ?- set_prolog_flag(iso, true).
> true.
>
> ?- string_termList("fy 1 yfx 2.", [T]), write_canonical(T), nl.
> fy(yfx(1,2))
> T = fy 1 yfx 2.
>
> Eh voila SWI-Prolog has become member of the ISO core standard club.
> Maybe it can even apply for V.I.P. membership, because its so important?
> Mostowski Collapse schrieb am Mittwoch, 13. April 2022 um 11:44:20 UTC+2:
> > Take the pPEG parsers rule:
> >
> > op_associativityEq(fy,yfx,left).
> >
> > Change it into this:
> >
> > op_associativityEq(fy,yfx,left) :- current_prolog_flag(iso, false).
> > op_associativityEq(fy,yfx,right) :- current_prolog_flag(iso, true).
> >
> > What will the pPEG parser do now? Is there also a pPEG unparser?
> >
> > https://swi-prolog.discourse.group/t/parsing-text-using-a-formal-grammar/5086
> > Mostowski Collapse schrieb am Mittwoch, 13. April 2022 um 11:43:16 UTC+2:
> > > Woke up in the morning and my brain only produced new challenges.
> > >
> > > I am still trying to find a case in the wild in favor of SWI-Prolog. For
> > > example if ADA would effectively parse:
> > >
> > > abs x ** y
> > >
> > > As this here:
> > >
> > > **(abs(x), y)
> > >
> > > Then the ISO core standard is somehow not “right”, or lets say more “arbitrary” than
> > > I tought. Which could be an interesting turn of events.
> > >
> > > The problem with my suggested fix, using “fx” instead “fy”, it does not work when you
> > > you want to support multiple braketless occurences of an operator.

Re: About the Operator '|' and the DCG Draft

<a2bcd077-a0e6-49e6-ad96-81494fed07cbn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:620a:4455:b0:69c:6124:21fe with SMTP id w21-20020a05620a445500b0069c612421femr2186074qkp.680.1649876743616;
Wed, 13 Apr 2022 12:05:43 -0700 (PDT)
X-Received: by 2002:a5b:f83:0:b0:63d:a251:2c51 with SMTP id
q3-20020a5b0f83000000b0063da2512c51mr285429ybh.594.1649876743392; Wed, 13 Apr
2022 12:05:43 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!1.us.feeder.erje.net!3.us.feeder.erje.net!feeder.erje.net!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Wed, 13 Apr 2022 12:05:43 -0700 (PDT)
In-Reply-To: <01c67652-6887-42e5-a533-f72722d92870n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.53.70; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.53.70
References: <27a911c0-3a2f-4054-81e5-bad9d8320750n@googlegroups.com>
<163a9271-9d06-4fbc-8d3c-1903bd8733bdn@googlegroups.com> <c07fe58b-ca4d-44d1-a716-1790a2033be0n@googlegroups.com>
<82d76042-37a3-44ab-addc-3784060038ccn@googlegroups.com> <9f1d1d60-7c54-4c2d-a655-04b651565d0bn@googlegroups.com>
<0d15e64d-f537-4313-b637-cdd0f66a1761n@googlegroups.com> <52b84705-714c-4248-b85b-a643413b7ff3n@googlegroups.com>
<0152c446-3e8e-4e4f-807c-51e913f95708n@googlegroups.com> <c7ee2838-d75c-4807-982a-fd3567d82374n@googlegroups.com>
<a0dd0b5f-b459-48d3-842b-675f9712c902n@googlegroups.com> <7950d178-a688-4122-ab3a-c5105359632cn@googlegroups.com>
<d8530517-401e-46ec-84f3-7f09c8dd70f5n@googlegroups.com> <870d9bb1-4c0f-41a2-8430-99abd733eed1n@googlegroups.com>
<8f5f92be-4fbe-4093-8ee9-a4796618e0can@googlegroups.com> <adcb7512-f998-4843-bab4-f1b2c7342b40n@googlegroups.com>
<ed1a10f3-0abf-4ca9-8dce-fe2fe99a58c4n@googlegroups.com> <13feb23a-5af2-403a-ae04-de846eef0135n@googlegroups.com>
<t30qfn$o195$1@solani.org> <5bb791dd-1870-4d3e-ab5f-144960a0f16en@googlegroups.com>
<87694357-6814-462c-985e-b4dac5464de0n@googlegroups.com> <8b9def0e-c75b-49e2-9604-578e96616518n@googlegroups.com>
<0c65ee8a-05e5-48c1-a15f-7357f8f4a3can@googlegroups.com> <1d23bf74-8e21-40dd-964b-394714380030n@googlegroups.com>
<70ec78de-68d5-4f2f-b02f-27e217354547n@googlegroups.com> <ecf60f58-e711-41a1-8d69-cff4cbe8abacn@googlegroups.com>
<1ce7789e-d26d-4fb0-bbac-b4eb036838c9n@googlegroups.com> <87653350-350a-4527-9848-ac609c1a64abn@googlegroups.com>
<01c67652-6887-42e5-a533-f72722d92870n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <a2bcd077-a0e6-49e6-ad96-81494fed07cbn@googlegroups.com>
Subject: Re: About the Operator '|' and the DCG Draft
From: burse...@gmail.com (Mostowski Collapse)
Injection-Date: Wed, 13 Apr 2022 19:05:43 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 75
 by: Mostowski Collapse - Wed, 13 Apr 2022 19:05 UTC

Maybe they should organize the ISO core standard club like here:

Platin Sponsor
Gold Sponsor
Silver Sponsor
https://www.jug.ch/sponsors.php

Then you can buy different grades of VIPness with Mamon.
Sad Story: Any poor John Doe Prolog system will be non-VIP.

Mostowski Collapse schrieb am Mittwoch, 13. April 2022 um 20:32:51 UTC+2:
> Interestingly the standard unparser of SWI-Prolog doesn’t give a damn.
> But this is another defect which I have posted about already in some thread.
>
> aLSO who_ever wrote this code of pPEG deserves to burn in hell,
> for mixing underscore and camelcase. Took me quite a while to run the query.
> Mostowski Collapse schrieb am Mittwoch, 13. April 2022 um 20:30:53 UTC+2:
> > Ok it wurks. I changed pl_parser.pl accordingly, and I now get:
> >
> > ?- string_termList("fy 1 yfx 2.", [T]), write_canonical(T), nl.
> > yfx(fy(1),2)
> > T = fy 1 yfx 2.
> >
> > ?- set_prolog_flag(iso, true).
> > true.
> >
> > ?- string_termList("fy 1 yfx 2.", [T]), write_canonical(T), nl.
> > fy(yfx(1,2))
> > T = fy 1 yfx 2.
> >
> > Eh voila SWI-Prolog has become member of the ISO core standard club.
> > Maybe it can even apply for V.I.P. membership, because its so important?
> > Mostowski Collapse schrieb am Mittwoch, 13. April 2022 um 11:44:20 UTC+2:
> > > Take the pPEG parsers rule:
> > >
> > > op_associativityEq(fy,yfx,left).
> > >
> > > Change it into this:
> > >
> > > op_associativityEq(fy,yfx,left) :- current_prolog_flag(iso, false).
> > > op_associativityEq(fy,yfx,right) :- current_prolog_flag(iso, true).
> > >
> > > What will the pPEG parser do now? Is there also a pPEG unparser?
> > >
> > > https://swi-prolog.discourse.group/t/parsing-text-using-a-formal-grammar/5086
> > > Mostowski Collapse schrieb am Mittwoch, 13. April 2022 um 11:43:16 UTC+2:
> > > > Woke up in the morning and my brain only produced new challenges.
> > > >
> > > > I am still trying to find a case in the wild in favor of SWI-Prolog.. For
> > > > example if ADA would effectively parse:
> > > >
> > > > abs x ** y
> > > >
> > > > As this here:
> > > >
> > > > **(abs(x), y)
> > > >
> > > > Then the ISO core standard is somehow not “right”, or lets say more “arbitrary” than
> > > > I tought. Which could be an interesting turn of events.
> > > >
> > > > The problem with my suggested fix, using “fx” instead “fy”, it does not work when you
> > > > you want to support multiple braketless occurences of an operator.

Re: About the Operator '|' and the DCG Draft

<9e3e77c4-04a3-4552-9f51-6600eb648720n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:ac8:75d1:0:b0:2ed:161f:1f0a with SMTP id z17-20020ac875d1000000b002ed161f1f0amr2057185qtq.173.1649948329121;
Thu, 14 Apr 2022 07:58:49 -0700 (PDT)
X-Received: by 2002:a05:690c:113:b0:2ef:260b:3801 with SMTP id
bd19-20020a05690c011300b002ef260b3801mr2557177ywb.49.1649948328943; Thu, 14
Apr 2022 07:58:48 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!1.us.feeder.erje.net!feeder.erje.net!border1.nntp.dca1.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: Thu, 14 Apr 2022 07:58:48 -0700 (PDT)
In-Reply-To: <a2bcd077-a0e6-49e6-ad96-81494fed07cbn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.53.70; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.53.70
References: <27a911c0-3a2f-4054-81e5-bad9d8320750n@googlegroups.com>
<163a9271-9d06-4fbc-8d3c-1903bd8733bdn@googlegroups.com> <c07fe58b-ca4d-44d1-a716-1790a2033be0n@googlegroups.com>
<82d76042-37a3-44ab-addc-3784060038ccn@googlegroups.com> <9f1d1d60-7c54-4c2d-a655-04b651565d0bn@googlegroups.com>
<0d15e64d-f537-4313-b637-cdd0f66a1761n@googlegroups.com> <52b84705-714c-4248-b85b-a643413b7ff3n@googlegroups.com>
<0152c446-3e8e-4e4f-807c-51e913f95708n@googlegroups.com> <c7ee2838-d75c-4807-982a-fd3567d82374n@googlegroups.com>
<a0dd0b5f-b459-48d3-842b-675f9712c902n@googlegroups.com> <7950d178-a688-4122-ab3a-c5105359632cn@googlegroups.com>
<d8530517-401e-46ec-84f3-7f09c8dd70f5n@googlegroups.com> <870d9bb1-4c0f-41a2-8430-99abd733eed1n@googlegroups.com>
<8f5f92be-4fbe-4093-8ee9-a4796618e0can@googlegroups.com> <adcb7512-f998-4843-bab4-f1b2c7342b40n@googlegroups.com>
<ed1a10f3-0abf-4ca9-8dce-fe2fe99a58c4n@googlegroups.com> <13feb23a-5af2-403a-ae04-de846eef0135n@googlegroups.com>
<t30qfn$o195$1@solani.org> <5bb791dd-1870-4d3e-ab5f-144960a0f16en@googlegroups.com>
<87694357-6814-462c-985e-b4dac5464de0n@googlegroups.com> <8b9def0e-c75b-49e2-9604-578e96616518n@googlegroups.com>
<0c65ee8a-05e5-48c1-a15f-7357f8f4a3can@googlegroups.com> <1d23bf74-8e21-40dd-964b-394714380030n@googlegroups.com>
<70ec78de-68d5-4f2f-b02f-27e217354547n@googlegroups.com> <ecf60f58-e711-41a1-8d69-cff4cbe8abacn@googlegroups.com>
<1ce7789e-d26d-4fb0-bbac-b4eb036838c9n@googlegroups.com> <87653350-350a-4527-9848-ac609c1a64abn@googlegroups.com>
<01c67652-6887-42e5-a533-f72722d92870n@googlegroups.com> <a2bcd077-a0e6-49e6-ad96-81494fed07cbn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <9e3e77c4-04a3-4552-9f51-6600eb648720n@googlegroups.com>
Subject: Re: About the Operator '|' and the DCG Draft
From: burse...@gmail.com (Mostowski Collapse)
Injection-Date: Thu, 14 Apr 2022 14:58:49 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 16
 by: Mostowski Collapse - Thu, 14 Apr 2022 14:58 UTC

Transfering pPEG results back to C code is not self
evident. The pPEG parser could be a blessing, but it
could be also a further curse.

We don’t know what the pPEG parser does. For example
I don’t find the op_associativityEq/3 table in pl-read.c.
Where it you get it from? Also very simple examples

don’t work in the pPEG parser:

?- string_termList("(- -1).", [T]), write_canonical(T), nl.
-(-,1)
T = (-)-1.

?- X = (- -1), write_canonical(X), nl.
-(-1)
X = - -1.

Re: About the Operator '|' and the DCG Draft

<daa565e1-5cf8-4c2d-bb5c-6eeb7290b92an@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:6214:3e3:b0:444:3f84:d230 with SMTP id cf3-20020a05621403e300b004443f84d230mr14382782qvb.4.1649960333291;
Thu, 14 Apr 2022 11:18:53 -0700 (PDT)
X-Received: by 2002:a25:c884:0:b0:633:7961:8a06 with SMTP id
y126-20020a25c884000000b0063379618a06mr2871948ybf.38.1649960332976; Thu, 14
Apr 2022 11:18:52 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.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: Thu, 14 Apr 2022 11:18:52 -0700 (PDT)
In-Reply-To: <9e3e77c4-04a3-4552-9f51-6600eb648720n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.53.70; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.53.70
References: <27a911c0-3a2f-4054-81e5-bad9d8320750n@googlegroups.com>
<163a9271-9d06-4fbc-8d3c-1903bd8733bdn@googlegroups.com> <c07fe58b-ca4d-44d1-a716-1790a2033be0n@googlegroups.com>
<82d76042-37a3-44ab-addc-3784060038ccn@googlegroups.com> <9f1d1d60-7c54-4c2d-a655-04b651565d0bn@googlegroups.com>
<0d15e64d-f537-4313-b637-cdd0f66a1761n@googlegroups.com> <52b84705-714c-4248-b85b-a643413b7ff3n@googlegroups.com>
<0152c446-3e8e-4e4f-807c-51e913f95708n@googlegroups.com> <c7ee2838-d75c-4807-982a-fd3567d82374n@googlegroups.com>
<a0dd0b5f-b459-48d3-842b-675f9712c902n@googlegroups.com> <7950d178-a688-4122-ab3a-c5105359632cn@googlegroups.com>
<d8530517-401e-46ec-84f3-7f09c8dd70f5n@googlegroups.com> <870d9bb1-4c0f-41a2-8430-99abd733eed1n@googlegroups.com>
<8f5f92be-4fbe-4093-8ee9-a4796618e0can@googlegroups.com> <adcb7512-f998-4843-bab4-f1b2c7342b40n@googlegroups.com>
<ed1a10f3-0abf-4ca9-8dce-fe2fe99a58c4n@googlegroups.com> <13feb23a-5af2-403a-ae04-de846eef0135n@googlegroups.com>
<t30qfn$o195$1@solani.org> <5bb791dd-1870-4d3e-ab5f-144960a0f16en@googlegroups.com>
<87694357-6814-462c-985e-b4dac5464de0n@googlegroups.com> <8b9def0e-c75b-49e2-9604-578e96616518n@googlegroups.com>
<0c65ee8a-05e5-48c1-a15f-7357f8f4a3can@googlegroups.com> <1d23bf74-8e21-40dd-964b-394714380030n@googlegroups.com>
<70ec78de-68d5-4f2f-b02f-27e217354547n@googlegroups.com> <ecf60f58-e711-41a1-8d69-cff4cbe8abacn@googlegroups.com>
<1ce7789e-d26d-4fb0-bbac-b4eb036838c9n@googlegroups.com> <87653350-350a-4527-9848-ac609c1a64abn@googlegroups.com>
<01c67652-6887-42e5-a533-f72722d92870n@googlegroups.com> <a2bcd077-a0e6-49e6-ad96-81494fed07cbn@googlegroups.com>
<9e3e77c4-04a3-4552-9f51-6600eb648720n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <daa565e1-5cf8-4c2d-bb5c-6eeb7290b92an@googlegroups.com>
Subject: Re: About the Operator '|' and the DCG Draft
From: burse...@gmail.com (Mostowski Collapse)
Injection-Date: Thu, 14 Apr 2022 18:18:53 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 33
 by: Mostowski Collapse - Thu, 14 Apr 2022 18:18 UTC

I will not touch pPEG anymore, even not with tweezers,
until it comes with a test suite, in the same folder like where the
source code is housed. At least this is what Ulrich Neumerkel did

for ISO core standard prolog, and which serves as a point of orientation.
Now we have for SWI-Prolog dialect nor the pPEG dialect any point of
orientation. Its just arbitary code uploaded to the internet. Although I think

SWI-Prolog might be in a better situation. Not sure, it has plunit and maybe
it has somewhere read test cases? But it has only with_output_to/2, and
no with_input_from/2. How is parsing tested? I never did dig up some

SWI-Prolog read test cases, maybe there are some? Thats of course my fault.

Mostowski Collapse schrieb am Donnerstag, 14. April 2022 um 16:58:50 UTC+2:
> Transfering pPEG results back to C code is not self
> evident. The pPEG parser could be a blessing, but it
> could be also a further curse.
>
> We don’t know what the pPEG parser does. For example
> I don’t find the op_associativityEq/3 table in pl-read.c.
> Where it you get it from? Also very simple examples
>
> don’t work in the pPEG parser:
>
> ?- string_termList("(- -1).", [T]), write_canonical(T), nl.
> -(-,1)
> T = (-)-1.
>
> ?- X = (- -1), write_canonical(X), nl.
> -(-1)
> X = - -1.

Re: About the Operator '|' and the DCG Draft

<0844414b-5c96-4d23-bc26-48b579b41714n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:620a:24c7:b0:69c:2751:3932 with SMTP id m7-20020a05620a24c700b0069c27513932mr3533387qkn.689.1649975725662;
Thu, 14 Apr 2022 15:35:25 -0700 (PDT)
X-Received: by 2002:a81:2f17:0:b0:2ca:9e14:d664 with SMTP id
v23-20020a812f17000000b002ca9e14d664mr3920327ywv.29.1649975725472; Thu, 14
Apr 2022 15:35:25 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.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: Thu, 14 Apr 2022 15:35:25 -0700 (PDT)
In-Reply-To: <daa565e1-5cf8-4c2d-bb5c-6eeb7290b92an@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.53.70; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.53.70
References: <27a911c0-3a2f-4054-81e5-bad9d8320750n@googlegroups.com>
<163a9271-9d06-4fbc-8d3c-1903bd8733bdn@googlegroups.com> <c07fe58b-ca4d-44d1-a716-1790a2033be0n@googlegroups.com>
<82d76042-37a3-44ab-addc-3784060038ccn@googlegroups.com> <9f1d1d60-7c54-4c2d-a655-04b651565d0bn@googlegroups.com>
<0d15e64d-f537-4313-b637-cdd0f66a1761n@googlegroups.com> <52b84705-714c-4248-b85b-a643413b7ff3n@googlegroups.com>
<0152c446-3e8e-4e4f-807c-51e913f95708n@googlegroups.com> <c7ee2838-d75c-4807-982a-fd3567d82374n@googlegroups.com>
<a0dd0b5f-b459-48d3-842b-675f9712c902n@googlegroups.com> <7950d178-a688-4122-ab3a-c5105359632cn@googlegroups.com>
<d8530517-401e-46ec-84f3-7f09c8dd70f5n@googlegroups.com> <870d9bb1-4c0f-41a2-8430-99abd733eed1n@googlegroups.com>
<8f5f92be-4fbe-4093-8ee9-a4796618e0can@googlegroups.com> <adcb7512-f998-4843-bab4-f1b2c7342b40n@googlegroups.com>
<ed1a10f3-0abf-4ca9-8dce-fe2fe99a58c4n@googlegroups.com> <13feb23a-5af2-403a-ae04-de846eef0135n@googlegroups.com>
<t30qfn$o195$1@solani.org> <5bb791dd-1870-4d3e-ab5f-144960a0f16en@googlegroups.com>
<87694357-6814-462c-985e-b4dac5464de0n@googlegroups.com> <8b9def0e-c75b-49e2-9604-578e96616518n@googlegroups.com>
<0c65ee8a-05e5-48c1-a15f-7357f8f4a3can@googlegroups.com> <1d23bf74-8e21-40dd-964b-394714380030n@googlegroups.com>
<70ec78de-68d5-4f2f-b02f-27e217354547n@googlegroups.com> <ecf60f58-e711-41a1-8d69-cff4cbe8abacn@googlegroups.com>
<1ce7789e-d26d-4fb0-bbac-b4eb036838c9n@googlegroups.com> <87653350-350a-4527-9848-ac609c1a64abn@googlegroups.com>
<01c67652-6887-42e5-a533-f72722d92870n@googlegroups.com> <a2bcd077-a0e6-49e6-ad96-81494fed07cbn@googlegroups.com>
<9e3e77c4-04a3-4552-9f51-6600eb648720n@googlegroups.com> <daa565e1-5cf8-4c2d-bb5c-6eeb7290b92an@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <0844414b-5c96-4d23-bc26-48b579b41714n@googlegroups.com>
Subject: Re: About the Operator '|' and the DCG Draft
From: burse...@gmail.com (Mostowski Collapse)
Injection-Date: Thu, 14 Apr 2022 22:35:25 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 24
 by: Mostowski Collapse - Thu, 14 Apr 2022 22:35 UTC

What I could exclude as a source of error, is ordering of
the operator table itself. At least for SWI-Prolog C code it does not
have an impact, which sequence of operator definitions I use:

This sequence of op/3 calls:

?- op(9, fy, fy), op(9, yfx, yfx).
true.

?- X = (fy 1 yfx 2), write_canonical(X), nl.
yfx(fy(1),2)
X = fy 1 yfx 2.

And this sequence of op/3 calls, give the same:

?- op(9, yfx, yfx), op(9, fy, fy).
true.

?- X = (fy 1 yfx 2), write_canonical(X), nl.
yfx(fy(1),2)
X = fy 1 yfx 2.

This does not exclude the possibility, that reordering the
operator table, inside SWI-Prolog C code, wouldn’t give
another result. It only shows that op/3 cannot confuse the parser.

Re: About the Operator '|' and the DCG Draft

<21a52b1d-464a-48c3-b1f8-21bb1d4de772n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:6214:240f:b0:445:d728:dd49 with SMTP id fv15-20020a056214240f00b00445d728dd49mr12520387qvb.118.1649975937824;
Thu, 14 Apr 2022 15:38:57 -0700 (PDT)
X-Received: by 2002:a81:78c9:0:b0:2eb:469b:e788 with SMTP id
t192-20020a8178c9000000b002eb469be788mr3725785ywc.34.1649975937652; Thu, 14
Apr 2022 15:38:57 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.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: Thu, 14 Apr 2022 15:38:57 -0700 (PDT)
In-Reply-To: <0844414b-5c96-4d23-bc26-48b579b41714n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.53.70; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.53.70
References: <27a911c0-3a2f-4054-81e5-bad9d8320750n@googlegroups.com>
<163a9271-9d06-4fbc-8d3c-1903bd8733bdn@googlegroups.com> <c07fe58b-ca4d-44d1-a716-1790a2033be0n@googlegroups.com>
<82d76042-37a3-44ab-addc-3784060038ccn@googlegroups.com> <9f1d1d60-7c54-4c2d-a655-04b651565d0bn@googlegroups.com>
<0d15e64d-f537-4313-b637-cdd0f66a1761n@googlegroups.com> <52b84705-714c-4248-b85b-a643413b7ff3n@googlegroups.com>
<0152c446-3e8e-4e4f-807c-51e913f95708n@googlegroups.com> <c7ee2838-d75c-4807-982a-fd3567d82374n@googlegroups.com>
<a0dd0b5f-b459-48d3-842b-675f9712c902n@googlegroups.com> <7950d178-a688-4122-ab3a-c5105359632cn@googlegroups.com>
<d8530517-401e-46ec-84f3-7f09c8dd70f5n@googlegroups.com> <870d9bb1-4c0f-41a2-8430-99abd733eed1n@googlegroups.com>
<8f5f92be-4fbe-4093-8ee9-a4796618e0can@googlegroups.com> <adcb7512-f998-4843-bab4-f1b2c7342b40n@googlegroups.com>
<ed1a10f3-0abf-4ca9-8dce-fe2fe99a58c4n@googlegroups.com> <13feb23a-5af2-403a-ae04-de846eef0135n@googlegroups.com>
<t30qfn$o195$1@solani.org> <5bb791dd-1870-4d3e-ab5f-144960a0f16en@googlegroups.com>
<87694357-6814-462c-985e-b4dac5464de0n@googlegroups.com> <8b9def0e-c75b-49e2-9604-578e96616518n@googlegroups.com>
<0c65ee8a-05e5-48c1-a15f-7357f8f4a3can@googlegroups.com> <1d23bf74-8e21-40dd-964b-394714380030n@googlegroups.com>
<70ec78de-68d5-4f2f-b02f-27e217354547n@googlegroups.com> <ecf60f58-e711-41a1-8d69-cff4cbe8abacn@googlegroups.com>
<1ce7789e-d26d-4fb0-bbac-b4eb036838c9n@googlegroups.com> <87653350-350a-4527-9848-ac609c1a64abn@googlegroups.com>
<01c67652-6887-42e5-a533-f72722d92870n@googlegroups.com> <a2bcd077-a0e6-49e6-ad96-81494fed07cbn@googlegroups.com>
<9e3e77c4-04a3-4552-9f51-6600eb648720n@googlegroups.com> <daa565e1-5cf8-4c2d-bb5c-6eeb7290b92an@googlegroups.com>
<0844414b-5c96-4d23-bc26-48b579b41714n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <21a52b1d-464a-48c3-b1f8-21bb1d4de772n@googlegroups.com>
Subject: Re: About the Operator '|' and the DCG Draft
From: burse...@gmail.com (Mostowski Collapse)
Injection-Date: Thu, 14 Apr 2022 22:38:57 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 58
 by: Mostowski Collapse - Thu, 14 Apr 2022 22:38 UTC

Here is an example where operator table ordering, respective
reduction rules ordering, influence the reduction result.
Reduction rules ordered like this:

[fy,X] ~> [fy(X)].
[X,yfx,Y] ~> [yfx(X,Y)].

?- reduce([fy,1,yfx,2],X), write_canonical(X), nl.
[yfx(fy(1),2)]
X = [fy 1 yfx 2].

Or the same reduction rules ordered like this, gives a different result:

[X,yfx,Y] ~> [yfx(X,Y)].
[fy,X] ~> [fy(X)].

?- reduce([fy,1,yfx,2],X), write_canonical(X), nl.
[fy(yfx(1,2))]
X = [fy 1 yfx 2].

The reducer code itself is here below, it has a cut (!), so its
sensitive to the reduction rule ordering:

:- op(1200,xfx,~>).

reduce(X, Y) :-
(A ~> B),
append(U, V, X),
append(A, H, V),
append(B, H, W),
append(U, W, Z), !, reduce(Z, Y).
reduce(X, X).

Mostowski Collapse schrieb am Freitag, 15. April 2022 um 00:35:26 UTC+2:
> What I could exclude as a source of error, is ordering of
> the operator table itself. At least for SWI-Prolog C code it does not
> have an impact, which sequence of operator definitions I use:
>
> This sequence of op/3 calls:
>
> ?- op(9, fy, fy), op(9, yfx, yfx).
> true.
>
> ?- X = (fy 1 yfx 2), write_canonical(X), nl.
> yfx(fy(1),2)
> X = fy 1 yfx 2.
>
> And this sequence of op/3 calls, give the same:
>
> ?- op(9, yfx, yfx), op(9, fy, fy).
> true.
>
> ?- X = (fy 1 yfx 2), write_canonical(X), nl.
> yfx(fy(1),2)
> X = fy 1 yfx 2.
>
> This does not exclude the possibility, that reordering the
> operator table, inside SWI-Prolog C code, wouldn’t give
> another result. It only shows that op/3 cannot confuse the parser.

Re: About the Operator '|' and the DCG Draft

<f4d33919-35bb-44c3-bd1c-5786541c3671n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a0c:c788:0:b0:444:2c7f:4126 with SMTP id k8-20020a0cc788000000b004442c7f4126mr6853656qvj.50.1650019108788;
Fri, 15 Apr 2022 03:38:28 -0700 (PDT)
X-Received: by 2002:a05:690c:39d:b0:2ef:5629:4ec7 with SMTP id
bh29-20020a05690c039d00b002ef56294ec7mr5627593ywb.125.1650019108618; Fri, 15
Apr 2022 03:38:28 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.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: Fri, 15 Apr 2022 03:38:28 -0700 (PDT)
In-Reply-To: <21a52b1d-464a-48c3-b1f8-21bb1d4de772n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.53.70; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.53.70
References: <27a911c0-3a2f-4054-81e5-bad9d8320750n@googlegroups.com>
<163a9271-9d06-4fbc-8d3c-1903bd8733bdn@googlegroups.com> <c07fe58b-ca4d-44d1-a716-1790a2033be0n@googlegroups.com>
<82d76042-37a3-44ab-addc-3784060038ccn@googlegroups.com> <9f1d1d60-7c54-4c2d-a655-04b651565d0bn@googlegroups.com>
<0d15e64d-f537-4313-b637-cdd0f66a1761n@googlegroups.com> <52b84705-714c-4248-b85b-a643413b7ff3n@googlegroups.com>
<0152c446-3e8e-4e4f-807c-51e913f95708n@googlegroups.com> <c7ee2838-d75c-4807-982a-fd3567d82374n@googlegroups.com>
<a0dd0b5f-b459-48d3-842b-675f9712c902n@googlegroups.com> <7950d178-a688-4122-ab3a-c5105359632cn@googlegroups.com>
<d8530517-401e-46ec-84f3-7f09c8dd70f5n@googlegroups.com> <870d9bb1-4c0f-41a2-8430-99abd733eed1n@googlegroups.com>
<8f5f92be-4fbe-4093-8ee9-a4796618e0can@googlegroups.com> <adcb7512-f998-4843-bab4-f1b2c7342b40n@googlegroups.com>
<ed1a10f3-0abf-4ca9-8dce-fe2fe99a58c4n@googlegroups.com> <13feb23a-5af2-403a-ae04-de846eef0135n@googlegroups.com>
<t30qfn$o195$1@solani.org> <5bb791dd-1870-4d3e-ab5f-144960a0f16en@googlegroups.com>
<87694357-6814-462c-985e-b4dac5464de0n@googlegroups.com> <8b9def0e-c75b-49e2-9604-578e96616518n@googlegroups.com>
<0c65ee8a-05e5-48c1-a15f-7357f8f4a3can@googlegroups.com> <1d23bf74-8e21-40dd-964b-394714380030n@googlegroups.com>
<70ec78de-68d5-4f2f-b02f-27e217354547n@googlegroups.com> <ecf60f58-e711-41a1-8d69-cff4cbe8abacn@googlegroups.com>
<1ce7789e-d26d-4fb0-bbac-b4eb036838c9n@googlegroups.com> <87653350-350a-4527-9848-ac609c1a64abn@googlegroups.com>
<01c67652-6887-42e5-a533-f72722d92870n@googlegroups.com> <a2bcd077-a0e6-49e6-ad96-81494fed07cbn@googlegroups.com>
<9e3e77c4-04a3-4552-9f51-6600eb648720n@googlegroups.com> <daa565e1-5cf8-4c2d-bb5c-6eeb7290b92an@googlegroups.com>
<0844414b-5c96-4d23-bc26-48b579b41714n@googlegroups.com> <21a52b1d-464a-48c3-b1f8-21bb1d4de772n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <f4d33919-35bb-44c3-bd1c-5786541c3671n@googlegroups.com>
Subject: Re: About the Operator '|' and the DCG Draft
From: burse...@gmail.com (Mostowski Collapse)
Injection-Date: Fri, 15 Apr 2022 10:38:28 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 30
 by: Mostowski Collapse - Fri, 15 Apr 2022 10:38 UTC

Using a fuzzer, I find differences what SWI-Prolog native C code
considers an operator clash and what the pPEG SWIPL examples
considers an operator clash. It seems pPEG is more tolerant.

There are also some fundamental differences in what
Prolog terms the SWI-Prolog native C code builds, and what
the pPEG SWIPL example builds.

This is how I used the fuzzer:

?- between(1,100,_), random_expr(0, _, A), swi_parse(A, X),
ppeg_parse(A, Y), X \== Y, write('expr: '), write(A), write('\nswi: '),
write_canonical(X), write('\nppeg: '), write_canonical(Y), nl, nl, fail.

expr: 0 xfx fy 1 yfx 2 yfx 3
swi: syntax_error(operator_clash)
ppeg: xfx(0,yfx(yfx(fy(1),2),3))

expr: fy fx fx 0
swi: syntax_error(operator_clash)
ppeg: fy(fx(fx(0)))

expr: fy fx 0 yf yf yf
swi: yf(yf(yf(fy(fx(0)))))
ppeg: fy(yf(yf(yf(fx(0)))))

expr: fy 0 xf yfx 1 yfx 2 yf
swi: yf(yfx(yfx(fy(xf(0)),1),2))
ppeg: fy(yf(yfx(yfx(xf(0),1),2)))

false.

Re: About the Operator '|' and the DCG Draft

<bf591281-ea4d-4d63-ab24-18fe60160eean@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:ac8:7614:0:b0:2ed:c70:604c with SMTP id t20-20020ac87614000000b002ed0c70604cmr4847082qtq.391.1650019158662;
Fri, 15 Apr 2022 03:39:18 -0700 (PDT)
X-Received: by 2002:a25:ba0c:0:b0:61a:79a6:fd0 with SMTP id
t12-20020a25ba0c000000b0061a79a60fd0mr4975350ybg.45.1650019158479; Fri, 15
Apr 2022 03:39:18 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.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: Fri, 15 Apr 2022 03:39:18 -0700 (PDT)
In-Reply-To: <f4d33919-35bb-44c3-bd1c-5786541c3671n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.53.70; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.53.70
References: <27a911c0-3a2f-4054-81e5-bad9d8320750n@googlegroups.com>
<163a9271-9d06-4fbc-8d3c-1903bd8733bdn@googlegroups.com> <c07fe58b-ca4d-44d1-a716-1790a2033be0n@googlegroups.com>
<82d76042-37a3-44ab-addc-3784060038ccn@googlegroups.com> <9f1d1d60-7c54-4c2d-a655-04b651565d0bn@googlegroups.com>
<0d15e64d-f537-4313-b637-cdd0f66a1761n@googlegroups.com> <52b84705-714c-4248-b85b-a643413b7ff3n@googlegroups.com>
<0152c446-3e8e-4e4f-807c-51e913f95708n@googlegroups.com> <c7ee2838-d75c-4807-982a-fd3567d82374n@googlegroups.com>
<a0dd0b5f-b459-48d3-842b-675f9712c902n@googlegroups.com> <7950d178-a688-4122-ab3a-c5105359632cn@googlegroups.com>
<d8530517-401e-46ec-84f3-7f09c8dd70f5n@googlegroups.com> <870d9bb1-4c0f-41a2-8430-99abd733eed1n@googlegroups.com>
<8f5f92be-4fbe-4093-8ee9-a4796618e0can@googlegroups.com> <adcb7512-f998-4843-bab4-f1b2c7342b40n@googlegroups.com>
<ed1a10f3-0abf-4ca9-8dce-fe2fe99a58c4n@googlegroups.com> <13feb23a-5af2-403a-ae04-de846eef0135n@googlegroups.com>
<t30qfn$o195$1@solani.org> <5bb791dd-1870-4d3e-ab5f-144960a0f16en@googlegroups.com>
<87694357-6814-462c-985e-b4dac5464de0n@googlegroups.com> <8b9def0e-c75b-49e2-9604-578e96616518n@googlegroups.com>
<0c65ee8a-05e5-48c1-a15f-7357f8f4a3can@googlegroups.com> <1d23bf74-8e21-40dd-964b-394714380030n@googlegroups.com>
<70ec78de-68d5-4f2f-b02f-27e217354547n@googlegroups.com> <ecf60f58-e711-41a1-8d69-cff4cbe8abacn@googlegroups.com>
<1ce7789e-d26d-4fb0-bbac-b4eb036838c9n@googlegroups.com> <87653350-350a-4527-9848-ac609c1a64abn@googlegroups.com>
<01c67652-6887-42e5-a533-f72722d92870n@googlegroups.com> <a2bcd077-a0e6-49e6-ad96-81494fed07cbn@googlegroups.com>
<9e3e77c4-04a3-4552-9f51-6600eb648720n@googlegroups.com> <daa565e1-5cf8-4c2d-bb5c-6eeb7290b92an@googlegroups.com>
<0844414b-5c96-4d23-bc26-48b579b41714n@googlegroups.com> <21a52b1d-464a-48c3-b1f8-21bb1d4de772n@googlegroups.com>
<f4d33919-35bb-44c3-bd1c-5786541c3671n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <bf591281-ea4d-4d63-ab24-18fe60160eean@googlegroups.com>
Subject: Re: About the Operator '|' and the DCG Draft
From: burse...@gmail.com (Mostowski Collapse)
Injection-Date: Fri, 15 Apr 2022 10:39:18 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 80
 by: Mostowski Collapse - Fri, 15 Apr 2022 10:39 UTC

The fuzzer code is here:

:- op(9, xfx, xfx).
:- op(9, yfx, yfx).
:- op(9, xfy, xfy).
:- op(9, fx, fx).
:- op(9, fy, fy).
:- op(9, xf, xf).
:- op(9, yf, yf).

% random_expr(+Integer, -Integer, -Atom)
random_expr(N, M, A) :-
K is 10+N*5,
random(0, K, I),
random_action(I, N, M, A).

% random_expr(+Integer, +Integer, -Integer, -Atom)
random_action(0, N, M, A) :- !,
random_expr(N, H, B),
random_expr(H, M, C),
atom_concat(B, ' xfx ', D),
atom_concat(D, C, A).
random_action(1, N, M, A) :- !,
random_expr(N, H, B),
random_expr(H, M, C),
atom_concat(B, ' yfx ', D),
atom_concat(D, C, A).
random_action(2, N, M, A) :- !,
random_expr(N, H, B),
random_expr(H, M, C),
atom_concat(B, ' xfy ', D),
atom_concat(D, C, A).
random_action(3, N, M, A) :- !,
random_expr(N, M, B),
atom_concat('fx ', B, A).
random_action(4, N, M, A) :- !,
random_expr(N, M, B),
atom_concat('fy ', B, A).
random_action(5, N, M, A) :- !,
random_expr(N, M, B),
atom_concat(B, ' xf', A).
random_action(6, N, M, A) :- !,
random_expr(N, M, B),
atom_concat(B, ' yf', A).
random_action(_, N, M, A) :-
number_codes(N, L),
atom_codes(A, L),
M is N+1.

Mostowski Collapse schrieb am Freitag, 15. April 2022 um 12:38:29 UTC+2:
> Using a fuzzer, I find differences what SWI-Prolog native C code
> considers an operator clash and what the pPEG SWIPL examples
> considers an operator clash. It seems pPEG is more tolerant.
>
> There are also some fundamental differences in what
> Prolog terms the SWI-Prolog native C code builds, and what
> the pPEG SWIPL example builds.
>
> This is how I used the fuzzer:
>
> ?- between(1,100,_), random_expr(0, _, A), swi_parse(A, X),
> ppeg_parse(A, Y), X \== Y, write('expr: '), write(A), write('\nswi: '),
> write_canonical(X), write('\nppeg: '), write_canonical(Y), nl, nl, fail.
>
> expr: 0 xfx fy 1 yfx 2 yfx 3
> swi: syntax_error(operator_clash)
> ppeg: xfx(0,yfx(yfx(fy(1),2),3))
>
> expr: fy fx fx 0
> swi: syntax_error(operator_clash)
> ppeg: fy(fx(fx(0)))
>
> expr: fy fx 0 yf yf yf
> swi: yf(yf(yf(fy(fx(0)))))
> ppeg: fy(yf(yf(yf(fx(0)))))
>
> expr: fy 0 xf yfx 1 yfx 2 yf
> swi: yf(yfx(yfx(fy(xf(0)),1),2))
> ppeg: fy(yf(yfx(yfx(xf(0),1),2)))
>
> false.

Re: About the Operator '|' and the DCG Draft

<ff4cc00d-8ac4-4c20-ba57-288cdd7eb831n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:6214:29c2:b0:444:9d4f:4ed0 with SMTP id gh2-20020a05621429c200b004449d4f4ed0mr3680154qvb.90.1650156200255;
Sat, 16 Apr 2022 17:43:20 -0700 (PDT)
X-Received: by 2002:a05:690c:113:b0:2ef:260b:3801 with SMTP id
bd19-20020a05690c011300b002ef260b3801mr5286840ywb.49.1650156200069; Sat, 16
Apr 2022 17:43:20 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Sat, 16 Apr 2022 17:43:19 -0700 (PDT)
In-Reply-To: <bf591281-ea4d-4d63-ab24-18fe60160eean@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.53.70; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.53.70
References: <27a911c0-3a2f-4054-81e5-bad9d8320750n@googlegroups.com>
<163a9271-9d06-4fbc-8d3c-1903bd8733bdn@googlegroups.com> <c07fe58b-ca4d-44d1-a716-1790a2033be0n@googlegroups.com>
<82d76042-37a3-44ab-addc-3784060038ccn@googlegroups.com> <9f1d1d60-7c54-4c2d-a655-04b651565d0bn@googlegroups.com>
<0d15e64d-f537-4313-b637-cdd0f66a1761n@googlegroups.com> <52b84705-714c-4248-b85b-a643413b7ff3n@googlegroups.com>
<0152c446-3e8e-4e4f-807c-51e913f95708n@googlegroups.com> <c7ee2838-d75c-4807-982a-fd3567d82374n@googlegroups.com>
<a0dd0b5f-b459-48d3-842b-675f9712c902n@googlegroups.com> <7950d178-a688-4122-ab3a-c5105359632cn@googlegroups.com>
<d8530517-401e-46ec-84f3-7f09c8dd70f5n@googlegroups.com> <870d9bb1-4c0f-41a2-8430-99abd733eed1n@googlegroups.com>
<8f5f92be-4fbe-4093-8ee9-a4796618e0can@googlegroups.com> <adcb7512-f998-4843-bab4-f1b2c7342b40n@googlegroups.com>
<ed1a10f3-0abf-4ca9-8dce-fe2fe99a58c4n@googlegroups.com> <13feb23a-5af2-403a-ae04-de846eef0135n@googlegroups.com>
<t30qfn$o195$1@solani.org> <5bb791dd-1870-4d3e-ab5f-144960a0f16en@googlegroups.com>
<87694357-6814-462c-985e-b4dac5464de0n@googlegroups.com> <8b9def0e-c75b-49e2-9604-578e96616518n@googlegroups.com>
<0c65ee8a-05e5-48c1-a15f-7357f8f4a3can@googlegroups.com> <1d23bf74-8e21-40dd-964b-394714380030n@googlegroups.com>
<70ec78de-68d5-4f2f-b02f-27e217354547n@googlegroups.com> <ecf60f58-e711-41a1-8d69-cff4cbe8abacn@googlegroups.com>
<1ce7789e-d26d-4fb0-bbac-b4eb036838c9n@googlegroups.com> <87653350-350a-4527-9848-ac609c1a64abn@googlegroups.com>
<01c67652-6887-42e5-a533-f72722d92870n@googlegroups.com> <a2bcd077-a0e6-49e6-ad96-81494fed07cbn@googlegroups.com>
<9e3e77c4-04a3-4552-9f51-6600eb648720n@googlegroups.com> <daa565e1-5cf8-4c2d-bb5c-6eeb7290b92an@googlegroups.com>
<0844414b-5c96-4d23-bc26-48b579b41714n@googlegroups.com> <21a52b1d-464a-48c3-b1f8-21bb1d4de772n@googlegroups.com>
<f4d33919-35bb-44c3-bd1c-5786541c3671n@googlegroups.com> <bf591281-ea4d-4d63-ab24-18fe60160eean@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <ff4cc00d-8ac4-4c20-ba57-288cdd7eb831n@googlegroups.com>
Subject: Re: About the Operator '|' and the DCG Draft
From: burse...@gmail.com (Mostowski Collapse)
Injection-Date: Sun, 17 Apr 2022 00:43:20 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 18
 by: Mostowski Collapse - Sun, 17 Apr 2022 00:43 UTC

Everybody knows that Prolog doesn't parse
(a = b = c), this is what operator icon xfx is made
for. But what is the operator icon fx made for?

Oh my god, SICStus Prolog tolerates this?

/* SICStus Prolog 4.7.1 */
?- X = (:- :- x0).
X = ((:-):-x0) ?

SWI-Prolog and Scryer Prolog are more thight:

/* Scryer Prolog */
?- X = (:- :- x0).
caught: error(syntax_error(incomplete_reduction),read_term/3:1)

/* SWI-Prolog */
?- X = (:- :- x0).
ERROR: Syntax error: Operator priority clash

Re: About the Operator '|' and the DCG Draft

<ece8ebd1-4068-4f7d-8b86-48b4bd6ce56dn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:ac8:110a:0:b0:2f1:ea84:b84 with SMTP id c10-20020ac8110a000000b002f1ea840b84mr3426472qtj.463.1650156639212;
Sat, 16 Apr 2022 17:50:39 -0700 (PDT)
X-Received: by 2002:a5b:f83:0:b0:63d:a251:2c51 with SMTP id
q3-20020a5b0f83000000b0063da2512c51mr4544099ybh.594.1650156639050; Sat, 16
Apr 2022 17:50:39 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Sat, 16 Apr 2022 17:50:38 -0700 (PDT)
In-Reply-To: <ff4cc00d-8ac4-4c20-ba57-288cdd7eb831n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.53.70; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.53.70
References: <27a911c0-3a2f-4054-81e5-bad9d8320750n@googlegroups.com>
<163a9271-9d06-4fbc-8d3c-1903bd8733bdn@googlegroups.com> <c07fe58b-ca4d-44d1-a716-1790a2033be0n@googlegroups.com>
<82d76042-37a3-44ab-addc-3784060038ccn@googlegroups.com> <9f1d1d60-7c54-4c2d-a655-04b651565d0bn@googlegroups.com>
<0d15e64d-f537-4313-b637-cdd0f66a1761n@googlegroups.com> <52b84705-714c-4248-b85b-a643413b7ff3n@googlegroups.com>
<0152c446-3e8e-4e4f-807c-51e913f95708n@googlegroups.com> <c7ee2838-d75c-4807-982a-fd3567d82374n@googlegroups.com>
<a0dd0b5f-b459-48d3-842b-675f9712c902n@googlegroups.com> <7950d178-a688-4122-ab3a-c5105359632cn@googlegroups.com>
<d8530517-401e-46ec-84f3-7f09c8dd70f5n@googlegroups.com> <870d9bb1-4c0f-41a2-8430-99abd733eed1n@googlegroups.com>
<8f5f92be-4fbe-4093-8ee9-a4796618e0can@googlegroups.com> <adcb7512-f998-4843-bab4-f1b2c7342b40n@googlegroups.com>
<ed1a10f3-0abf-4ca9-8dce-fe2fe99a58c4n@googlegroups.com> <13feb23a-5af2-403a-ae04-de846eef0135n@googlegroups.com>
<t30qfn$o195$1@solani.org> <5bb791dd-1870-4d3e-ab5f-144960a0f16en@googlegroups.com>
<87694357-6814-462c-985e-b4dac5464de0n@googlegroups.com> <8b9def0e-c75b-49e2-9604-578e96616518n@googlegroups.com>
<0c65ee8a-05e5-48c1-a15f-7357f8f4a3can@googlegroups.com> <1d23bf74-8e21-40dd-964b-394714380030n@googlegroups.com>
<70ec78de-68d5-4f2f-b02f-27e217354547n@googlegroups.com> <ecf60f58-e711-41a1-8d69-cff4cbe8abacn@googlegroups.com>
<1ce7789e-d26d-4fb0-bbac-b4eb036838c9n@googlegroups.com> <87653350-350a-4527-9848-ac609c1a64abn@googlegroups.com>
<01c67652-6887-42e5-a533-f72722d92870n@googlegroups.com> <a2bcd077-a0e6-49e6-ad96-81494fed07cbn@googlegroups.com>
<9e3e77c4-04a3-4552-9f51-6600eb648720n@googlegroups.com> <daa565e1-5cf8-4c2d-bb5c-6eeb7290b92an@googlegroups.com>
<0844414b-5c96-4d23-bc26-48b579b41714n@googlegroups.com> <21a52b1d-464a-48c3-b1f8-21bb1d4de772n@googlegroups.com>
<f4d33919-35bb-44c3-bd1c-5786541c3671n@googlegroups.com> <bf591281-ea4d-4d63-ab24-18fe60160eean@googlegroups.com>
<ff4cc00d-8ac4-4c20-ba57-288cdd7eb831n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <ece8ebd1-4068-4f7d-8b86-48b4bd6ce56dn@googlegroups.com>
Subject: Re: About the Operator '|' and the DCG Draft
From: burse...@gmail.com (Mostowski Collapse)
Injection-Date: Sun, 17 Apr 2022 00:50:39 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 67
 by: Mostowski Collapse - Sun, 17 Apr 2022 00:50 UTC

Now I posted already a tight Prolog reader on SWI-Prolog
discourse. Here is it in all its glory. It doesn't handle negative
numbers, but its cute to play around with operator parsing,

like for example:

/* SICStus 4.7.1 */
?- consult('reader.p').

?- reader(T,1200,[:-,x0],[]).
T = (:-x0) ?

?- reader(T,1200,[:-,:-,x0],[]).
error(syntax_error(operator_clash),_415)

The code is only one page:

reader(X, L) -->
reader_primary(Z, L, K), reader_secondary(Z, X, L, K).

reader_primary(H, L, R) --> [A], {current_op(R, M, A), is_prefix(M, E)}, !,
{L < R -> throw(error(syntax_error(operator_clash),_)); true},
{T is R-E}, reader(Z, T), {H =.. [A,Z]}.
reader_primary(X, _, 0) --> [X].

reader_secondary(H, X, L, C) --> [A],
{current_op(R, M, A), is_infix(M, D, E), L >= R}, !,
{R-D < C -> throw(error(syntax_error(operator_clash),_)); true},
{T is R-E}, reader(Z, T),
{J =.. [A,H,Z]},
reader_secondary(J, X, L, R).
reader_secondary(H, X, L, C) --> [A],
{current_op(R, M, A), is_postfix(M, D), L >= R}, !,
{R-D < C -> throw(error(syntax_error(operator_clash),_)); true},
{J =.. [A,H]},
reader_secondary(J, X, L, R).
reader_secondary(H, H, _, _) --> [].

is_infix(xfx, 1, 1).
is_infix(yfx, 0, 1).
is_infix(xfy, 1, 0).

is_prefix(fx, 1).
is_prefix(fy, 0).

is_postfix(xf, 1).
is_postfix(yf, 0).

Mostowski Collapse schrieb am Sonntag, 17. April 2022 um 02:43:21 UTC+2:
> Everybody knows that Prolog doesn't parse
> (a = b = c), this is what operator icon xfx is made
> for. But what is the operator icon fx made for?
>
> Oh my god, SICStus Prolog tolerates this?
>
> /* SICStus Prolog 4.7.1 */
> ?- X = (:- :- x0).
> X = ((:-):-x0) ?
>
> SWI-Prolog and Scryer Prolog are more thight:
>
> /* Scryer Prolog */
> ?- X = (:- :- x0).
> caught: error(syntax_error(incomplete_reduction),read_term/3:1)
>
> /* SWI-Prolog */
> ?- X = (:- :- x0).
> ERROR: Syntax error: Operator priority clash

Re: About the Operator '|' and the DCG Draft

<d8d94dc3-6266-426f-8c5d-01e4de3a21d3n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a0c:f8ca:0:b0:444:41e8:89b1 with SMTP id h10-20020a0cf8ca000000b0044441e889b1mr9451189qvo.22.1650317240188;
Mon, 18 Apr 2022 14:27:20 -0700 (PDT)
X-Received: by 2002:a25:7653:0:b0:641:d2fd:ae79 with SMTP id
r80-20020a257653000000b00641d2fdae79mr11989175ybc.453.1650317239914; Mon, 18
Apr 2022 14:27:19 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.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, 18 Apr 2022 14:27:19 -0700 (PDT)
In-Reply-To: <ece8ebd1-4068-4f7d-8b86-48b4bd6ce56dn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.53.70; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.53.70
References: <27a911c0-3a2f-4054-81e5-bad9d8320750n@googlegroups.com>
<163a9271-9d06-4fbc-8d3c-1903bd8733bdn@googlegroups.com> <c07fe58b-ca4d-44d1-a716-1790a2033be0n@googlegroups.com>
<82d76042-37a3-44ab-addc-3784060038ccn@googlegroups.com> <9f1d1d60-7c54-4c2d-a655-04b651565d0bn@googlegroups.com>
<0d15e64d-f537-4313-b637-cdd0f66a1761n@googlegroups.com> <52b84705-714c-4248-b85b-a643413b7ff3n@googlegroups.com>
<0152c446-3e8e-4e4f-807c-51e913f95708n@googlegroups.com> <c7ee2838-d75c-4807-982a-fd3567d82374n@googlegroups.com>
<a0dd0b5f-b459-48d3-842b-675f9712c902n@googlegroups.com> <7950d178-a688-4122-ab3a-c5105359632cn@googlegroups.com>
<d8530517-401e-46ec-84f3-7f09c8dd70f5n@googlegroups.com> <870d9bb1-4c0f-41a2-8430-99abd733eed1n@googlegroups.com>
<8f5f92be-4fbe-4093-8ee9-a4796618e0can@googlegroups.com> <adcb7512-f998-4843-bab4-f1b2c7342b40n@googlegroups.com>
<ed1a10f3-0abf-4ca9-8dce-fe2fe99a58c4n@googlegroups.com> <13feb23a-5af2-403a-ae04-de846eef0135n@googlegroups.com>
<t30qfn$o195$1@solani.org> <5bb791dd-1870-4d3e-ab5f-144960a0f16en@googlegroups.com>
<87694357-6814-462c-985e-b4dac5464de0n@googlegroups.com> <8b9def0e-c75b-49e2-9604-578e96616518n@googlegroups.com>
<0c65ee8a-05e5-48c1-a15f-7357f8f4a3can@googlegroups.com> <1d23bf74-8e21-40dd-964b-394714380030n@googlegroups.com>
<70ec78de-68d5-4f2f-b02f-27e217354547n@googlegroups.com> <ecf60f58-e711-41a1-8d69-cff4cbe8abacn@googlegroups.com>
<1ce7789e-d26d-4fb0-bbac-b4eb036838c9n@googlegroups.com> <87653350-350a-4527-9848-ac609c1a64abn@googlegroups.com>
<01c67652-6887-42e5-a533-f72722d92870n@googlegroups.com> <a2bcd077-a0e6-49e6-ad96-81494fed07cbn@googlegroups.com>
<9e3e77c4-04a3-4552-9f51-6600eb648720n@googlegroups.com> <daa565e1-5cf8-4c2d-bb5c-6eeb7290b92an@googlegroups.com>
<0844414b-5c96-4d23-bc26-48b579b41714n@googlegroups.com> <21a52b1d-464a-48c3-b1f8-21bb1d4de772n@googlegroups.com>
<f4d33919-35bb-44c3-bd1c-5786541c3671n@googlegroups.com> <bf591281-ea4d-4d63-ab24-18fe60160eean@googlegroups.com>
<ff4cc00d-8ac4-4c20-ba57-288cdd7eb831n@googlegroups.com> <ece8ebd1-4068-4f7d-8b86-48b4bd6ce56dn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <d8d94dc3-6266-426f-8c5d-01e4de3a21d3n@googlegroups.com>
Subject: Re: About the Operator '|' and the DCG Draft
From: burse...@gmail.com (Mostowski Collapse)
Injection-Date: Mon, 18 Apr 2022 21:27:20 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 22
 by: Mostowski Collapse - Mon, 18 Apr 2022 21:27 UTC

Holy Cow, ECLiPSe Prolog is somewhere between SWI-Prolog
and SICStus Prolog, concerning tolerating extra syntax.

SICStus Prolog, quite tolerant:

?- X = (- :- x0).
X = ((-):-x0) ?
?- X = (:- :- x0).
X = ((:-):-x0) ?

ECLIPSe Prolog, half way tolerant:

[eclipse 36]: X = (- :- x0).
X = ((-) :- x0)
[eclipse 37]: X = (:- :- x0).
syntax error: postfix/infix operator expected

SWI-Prolog, intolerant, good!!!

?- X = (- :- x0).
ERROR: Syntax error: Operator priority clash
?- X = (:- :- x0).
ERROR: Syntax error: Operator priority clash

Re: About the Operator '|' and the DCG Draft

<3e62b88d-b551-4a01-a938-987d33dd3950n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:ac8:4e46:0:b0:2e1:b933:ec06 with SMTP id e6-20020ac84e46000000b002e1b933ec06mr8502962qtw.684.1650317599568;
Mon, 18 Apr 2022 14:33:19 -0700 (PDT)
X-Received: by 2002:a81:78d:0:b0:2e5:d440:d921 with SMTP id
135-20020a81078d000000b002e5d440d921mr11836893ywh.251.1650317599441; Mon, 18
Apr 2022 14:33:19 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.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, 18 Apr 2022 14:33:19 -0700 (PDT)
In-Reply-To: <d8d94dc3-6266-426f-8c5d-01e4de3a21d3n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.53.70; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.53.70
References: <27a911c0-3a2f-4054-81e5-bad9d8320750n@googlegroups.com>
<163a9271-9d06-4fbc-8d3c-1903bd8733bdn@googlegroups.com> <c07fe58b-ca4d-44d1-a716-1790a2033be0n@googlegroups.com>
<82d76042-37a3-44ab-addc-3784060038ccn@googlegroups.com> <9f1d1d60-7c54-4c2d-a655-04b651565d0bn@googlegroups.com>
<0d15e64d-f537-4313-b637-cdd0f66a1761n@googlegroups.com> <52b84705-714c-4248-b85b-a643413b7ff3n@googlegroups.com>
<0152c446-3e8e-4e4f-807c-51e913f95708n@googlegroups.com> <c7ee2838-d75c-4807-982a-fd3567d82374n@googlegroups.com>
<a0dd0b5f-b459-48d3-842b-675f9712c902n@googlegroups.com> <7950d178-a688-4122-ab3a-c5105359632cn@googlegroups.com>
<d8530517-401e-46ec-84f3-7f09c8dd70f5n@googlegroups.com> <870d9bb1-4c0f-41a2-8430-99abd733eed1n@googlegroups.com>
<8f5f92be-4fbe-4093-8ee9-a4796618e0can@googlegroups.com> <adcb7512-f998-4843-bab4-f1b2c7342b40n@googlegroups.com>
<ed1a10f3-0abf-4ca9-8dce-fe2fe99a58c4n@googlegroups.com> <13feb23a-5af2-403a-ae04-de846eef0135n@googlegroups.com>
<t30qfn$o195$1@solani.org> <5bb791dd-1870-4d3e-ab5f-144960a0f16en@googlegroups.com>
<87694357-6814-462c-985e-b4dac5464de0n@googlegroups.com> <8b9def0e-c75b-49e2-9604-578e96616518n@googlegroups.com>
<0c65ee8a-05e5-48c1-a15f-7357f8f4a3can@googlegroups.com> <1d23bf74-8e21-40dd-964b-394714380030n@googlegroups.com>
<70ec78de-68d5-4f2f-b02f-27e217354547n@googlegroups.com> <ecf60f58-e711-41a1-8d69-cff4cbe8abacn@googlegroups.com>
<1ce7789e-d26d-4fb0-bbac-b4eb036838c9n@googlegroups.com> <87653350-350a-4527-9848-ac609c1a64abn@googlegroups.com>
<01c67652-6887-42e5-a533-f72722d92870n@googlegroups.com> <a2bcd077-a0e6-49e6-ad96-81494fed07cbn@googlegroups.com>
<9e3e77c4-04a3-4552-9f51-6600eb648720n@googlegroups.com> <daa565e1-5cf8-4c2d-bb5c-6eeb7290b92an@googlegroups.com>
<0844414b-5c96-4d23-bc26-48b579b41714n@googlegroups.com> <21a52b1d-464a-48c3-b1f8-21bb1d4de772n@googlegroups.com>
<f4d33919-35bb-44c3-bd1c-5786541c3671n@googlegroups.com> <bf591281-ea4d-4d63-ab24-18fe60160eean@googlegroups.com>
<ff4cc00d-8ac4-4c20-ba57-288cdd7eb831n@googlegroups.com> <ece8ebd1-4068-4f7d-8b86-48b4bd6ce56dn@googlegroups.com>
<d8d94dc3-6266-426f-8c5d-01e4de3a21d3n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <3e62b88d-b551-4a01-a938-987d33dd3950n@googlegroups.com>
Subject: Re: About the Operator '|' and the DCG Draft
From: burse...@gmail.com (Mostowski Collapse)
Injection-Date: Mon, 18 Apr 2022 21:33:19 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 41
 by: Mostowski Collapse - Mon, 18 Apr 2022 21:33 UTC

My reader prototype sides with SWI-Prolog. Also
Dogelog Player and formerly Jekejeke Prolog side
with SWI-Prolog. Dogelog Player can be tried online:

?- X = (- :- x0).
error(syntax_error(operator_clash), [user:0])
error(syntax_error(cannot_start_term), [user:1])
?- X = (:- :- x0).
error(syntax_error(operator_clash), [user:1])
error(syntax_error(cannot_start_term), [user:2])
http://www.xlog.ch/izytab/moblet/docs/18_live/10_reference/example01/package.html

Unfortunately resyncing after an error is not yet
implemented, so there are two errors. But we got
already line numbers for Dogelog Player,

this is quite a gas!!!

Mostowski Collapse schrieb am Montag, 18. April 2022 um 23:27:20 UTC+2:
> Holy Cow, ECLiPSe Prolog is somewhere between SWI-Prolog
> and SICStus Prolog, concerning tolerating extra syntax.
>
> SICStus Prolog, quite tolerant:
>
> ?- X = (- :- x0).
> X = ((-):-x0) ?
> ?- X = (:- :- x0).
> X = ((:-):-x0) ?
> ECLIPSe Prolog, half way tolerant:
>
> [eclipse 36]: X = (- :- x0).
> X = ((-) :- x0)
> [eclipse 37]: X = (:- :- x0).
> syntax error: postfix/infix operator expected
>
> SWI-Prolog, intolerant, good!!!
>
> ?- X = (- :- x0).
> ERROR: Syntax error: Operator priority clash
> ?- X = (:- :- x0).
> ERROR: Syntax error: Operator priority clash

Re: About the Operator '|' and the DCG Draft

<7e2d04f5-d6f7-4bf4-a8b8-b525f6b396ccn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:ad4:5bc1:0:b0:42c:3700:a6df with SMTP id t1-20020ad45bc1000000b0042c3700a6dfmr27436508qvt.94.1651228940378;
Fri, 29 Apr 2022 03:42:20 -0700 (PDT)
X-Received: by 2002:a05:6902:1026:b0:649:2735:afc8 with SMTP id
x6-20020a056902102600b006492735afc8mr1400261ybt.251.1651228940173; Fri, 29
Apr 2022 03:42:20 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.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: Fri, 29 Apr 2022 03:42:19 -0700 (PDT)
In-Reply-To: <3e62b88d-b551-4a01-a938-987d33dd3950n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.53.70; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.53.70
References: <27a911c0-3a2f-4054-81e5-bad9d8320750n@googlegroups.com>
<163a9271-9d06-4fbc-8d3c-1903bd8733bdn@googlegroups.com> <c07fe58b-ca4d-44d1-a716-1790a2033be0n@googlegroups.com>
<82d76042-37a3-44ab-addc-3784060038ccn@googlegroups.com> <9f1d1d60-7c54-4c2d-a655-04b651565d0bn@googlegroups.com>
<0d15e64d-f537-4313-b637-cdd0f66a1761n@googlegroups.com> <52b84705-714c-4248-b85b-a643413b7ff3n@googlegroups.com>
<0152c446-3e8e-4e4f-807c-51e913f95708n@googlegroups.com> <c7ee2838-d75c-4807-982a-fd3567d82374n@googlegroups.com>
<a0dd0b5f-b459-48d3-842b-675f9712c902n@googlegroups.com> <7950d178-a688-4122-ab3a-c5105359632cn@googlegroups.com>
<d8530517-401e-46ec-84f3-7f09c8dd70f5n@googlegroups.com> <870d9bb1-4c0f-41a2-8430-99abd733eed1n@googlegroups.com>
<8f5f92be-4fbe-4093-8ee9-a4796618e0can@googlegroups.com> <adcb7512-f998-4843-bab4-f1b2c7342b40n@googlegroups.com>
<ed1a10f3-0abf-4ca9-8dce-fe2fe99a58c4n@googlegroups.com> <13feb23a-5af2-403a-ae04-de846eef0135n@googlegroups.com>
<t30qfn$o195$1@solani.org> <5bb791dd-1870-4d3e-ab5f-144960a0f16en@googlegroups.com>
<87694357-6814-462c-985e-b4dac5464de0n@googlegroups.com> <8b9def0e-c75b-49e2-9604-578e96616518n@googlegroups.com>
<0c65ee8a-05e5-48c1-a15f-7357f8f4a3can@googlegroups.com> <1d23bf74-8e21-40dd-964b-394714380030n@googlegroups.com>
<70ec78de-68d5-4f2f-b02f-27e217354547n@googlegroups.com> <ecf60f58-e711-41a1-8d69-cff4cbe8abacn@googlegroups.com>
<1ce7789e-d26d-4fb0-bbac-b4eb036838c9n@googlegroups.com> <87653350-350a-4527-9848-ac609c1a64abn@googlegroups.com>
<01c67652-6887-42e5-a533-f72722d92870n@googlegroups.com> <a2bcd077-a0e6-49e6-ad96-81494fed07cbn@googlegroups.com>
<9e3e77c4-04a3-4552-9f51-6600eb648720n@googlegroups.com> <daa565e1-5cf8-4c2d-bb5c-6eeb7290b92an@googlegroups.com>
<0844414b-5c96-4d23-bc26-48b579b41714n@googlegroups.com> <21a52b1d-464a-48c3-b1f8-21bb1d4de772n@googlegroups.com>
<f4d33919-35bb-44c3-bd1c-5786541c3671n@googlegroups.com> <bf591281-ea4d-4d63-ab24-18fe60160eean@googlegroups.com>
<ff4cc00d-8ac4-4c20-ba57-288cdd7eb831n@googlegroups.com> <ece8ebd1-4068-4f7d-8b86-48b4bd6ce56dn@googlegroups.com>
<d8d94dc3-6266-426f-8c5d-01e4de3a21d3n@googlegroups.com> <3e62b88d-b551-4a01-a938-987d33dd3950n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <7e2d04f5-d6f7-4bf4-a8b8-b525f6b396ccn@googlegroups.com>
Subject: Re: About the Operator '|' and the DCG Draft
From: burse...@gmail.com (Mostowski Collapse)
Injection-Date: Fri, 29 Apr 2022 10:42:20 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 18
 by: Mostowski Collapse - Fri, 29 Apr 2022 10:42 UTC

More proof that Logtalk is utter nonsense. What
does the Logtalk test suite even test concerning
the various "adapters" it has, like Trealla?

This is a nice gem:

$ ./tpl -v
Trealla Prolog (c) Infradig 2020-2022, v1.27.12-31-g3575df
$ ./tpl
?- X = (:- (:- x0)).
Error: operator clash, line 1
false.
?-

There is something wrong with Ulrich Neumerkels
compliance test suite, and maybe some QuickCheck
resp. Fuzzer approach is needed,

to chop of all heads of the hydra.

Re: About the Operator '|' and the DCG Draft

<0a83d42e-d555-4c54-af9b-433f55b57a95n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:a05:6214:519b:b0:456:48f2:a1b1 with SMTP id kl27-20020a056214519b00b0045648f2a1b1mr12493310qvb.4.1651229149280;
Fri, 29 Apr 2022 03:45:49 -0700 (PDT)
X-Received: by 2002:a25:b08f:0:b0:646:5312:bffb with SMTP id
f15-20020a25b08f000000b006465312bffbmr29481518ybj.274.1651229149106; Fri, 29
Apr 2022 03:45:49 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.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: Fri, 29 Apr 2022 03:45:48 -0700 (PDT)
In-Reply-To: <7e2d04f5-d6f7-4bf4-a8b8-b525f6b396ccn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.53.70; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.53.70
References: <27a911c0-3a2f-4054-81e5-bad9d8320750n@googlegroups.com>
<163a9271-9d06-4fbc-8d3c-1903bd8733bdn@googlegroups.com> <c07fe58b-ca4d-44d1-a716-1790a2033be0n@googlegroups.com>
<82d76042-37a3-44ab-addc-3784060038ccn@googlegroups.com> <9f1d1d60-7c54-4c2d-a655-04b651565d0bn@googlegroups.com>
<0d15e64d-f537-4313-b637-cdd0f66a1761n@googlegroups.com> <52b84705-714c-4248-b85b-a643413b7ff3n@googlegroups.com>
<0152c446-3e8e-4e4f-807c-51e913f95708n@googlegroups.com> <c7ee2838-d75c-4807-982a-fd3567d82374n@googlegroups.com>
<a0dd0b5f-b459-48d3-842b-675f9712c902n@googlegroups.com> <7950d178-a688-4122-ab3a-c5105359632cn@googlegroups.com>
<d8530517-401e-46ec-84f3-7f09c8dd70f5n@googlegroups.com> <870d9bb1-4c0f-41a2-8430-99abd733eed1n@googlegroups.com>
<8f5f92be-4fbe-4093-8ee9-a4796618e0can@googlegroups.com> <adcb7512-f998-4843-bab4-f1b2c7342b40n@googlegroups.com>
<ed1a10f3-0abf-4ca9-8dce-fe2fe99a58c4n@googlegroups.com> <13feb23a-5af2-403a-ae04-de846eef0135n@googlegroups.com>
<t30qfn$o195$1@solani.org> <5bb791dd-1870-4d3e-ab5f-144960a0f16en@googlegroups.com>
<87694357-6814-462c-985e-b4dac5464de0n@googlegroups.com> <8b9def0e-c75b-49e2-9604-578e96616518n@googlegroups.com>
<0c65ee8a-05e5-48c1-a15f-7357f8f4a3can@googlegroups.com> <1d23bf74-8e21-40dd-964b-394714380030n@googlegroups.com>
<70ec78de-68d5-4f2f-b02f-27e217354547n@googlegroups.com> <ecf60f58-e711-41a1-8d69-cff4cbe8abacn@googlegroups.com>
<1ce7789e-d26d-4fb0-bbac-b4eb036838c9n@googlegroups.com> <87653350-350a-4527-9848-ac609c1a64abn@googlegroups.com>
<01c67652-6887-42e5-a533-f72722d92870n@googlegroups.com> <a2bcd077-a0e6-49e6-ad96-81494fed07cbn@googlegroups.com>
<9e3e77c4-04a3-4552-9f51-6600eb648720n@googlegroups.com> <daa565e1-5cf8-4c2d-bb5c-6eeb7290b92an@googlegroups.com>
<0844414b-5c96-4d23-bc26-48b579b41714n@googlegroups.com> <21a52b1d-464a-48c3-b1f8-21bb1d4de772n@googlegroups.com>
<f4d33919-35bb-44c3-bd1c-5786541c3671n@googlegroups.com> <bf591281-ea4d-4d63-ab24-18fe60160eean@googlegroups.com>
<ff4cc00d-8ac4-4c20-ba57-288cdd7eb831n@googlegroups.com> <ece8ebd1-4068-4f7d-8b86-48b4bd6ce56dn@googlegroups.com>
<d8d94dc3-6266-426f-8c5d-01e4de3a21d3n@googlegroups.com> <3e62b88d-b551-4a01-a938-987d33dd3950n@googlegroups.com>
<7e2d04f5-d6f7-4bf4-a8b8-b525f6b396ccn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <0a83d42e-d555-4c54-af9b-433f55b57a95n@googlegroups.com>
Subject: Re: About the Operator '|' and the DCG Draft
From: burse...@gmail.com (Mostowski Collapse)
Injection-Date: Fri, 29 Apr 2022 10:45:49 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 56
 by: Mostowski Collapse - Fri, 29 Apr 2022 10:45 UTC

I am little bit behind schedule of a Fuzzer that also
does parenthesis. So this was my sixth sense. Was also
working on another front, resyncing after errors.

I found a solution today: Have a grammer that covers non-errorneous
sentences and errorneous sentences. How to do this simply?
Its more difficult to resync the tokenization, then to resync the

parsing. For parsing I found this useful, since Prolog has the
concept of terminating period. Take the very simplified
prototype posted elsewhere:

reader_secondary(H, X, L, C) --> [A],
{current_op(R, M, A), is_infix(M, D, E), L >= R}, !,
{R-D < C -> throw(error(syntax_error(operator_clash),_)); true},
{T is R-E}, reader(Z, T),
{J =.. [A,H,Z]},
reader_secondary(J, X, L, R).

It throws an exception inside an auxiliary action {}/1 of DCG. But
you can define throw//1, i.e. make throw itself a DCG non-terminal:

throw(T) --> read_sync, {throw(T)}.

And then replace the infix parsing, its only an example, works also
for all other parser errors:

reader_secondary(H, X, L, C) --> [A],
{current_op(R, M, A), is_infix(M, D, E), L >= R}, !,
({R-D < C} -> throw(error(syntax_error(operator_clash),_)); {true}),
{T is R-E}, reader(Z, T),
{J =.. [A,H,Z]},
reader_secondary(J, X, L, R).

The parser is now calling throw//1 instead of throw/1. And throw//1
can do some syncing.

Mostowski Collapse schrieb am Freitag, 29. April 2022 um 12:42:21 UTC+2:
> More proof that Logtalk is utter nonsense. What
> does the Logtalk test suite even test concerning
> the various "adapters" it has, like Trealla?
>
> This is a nice gem:
>
> $ ./tpl -v
> Trealla Prolog (c) Infradig 2020-2022, v1.27.12-31-g3575df
> $ ./tpl
> ?- X = (:- (:- x0)).
> Error: operator clash, line 1
> false.
> ?-
>
> There is something wrong with Ulrich Neumerkels
> compliance test suite, and maybe some QuickCheck
> resp. Fuzzer approach is needed,
>
> to chop of all heads of the hydra.

Pages:12
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor