Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Issues with the dcgsdraft-2021-08-16.pdf

87 views
Skip to first unread message

Mostowski Collapse

unread,
Aug 30, 2021, 11:48:55 AM8/30/21
to
Here is a link for those interested:
https://www.complang.tuwien.ac.at/ulrich/iso-prolog/dcgs/dcgsdraft-2021-08-16.pdf

This new draft has 2 problems. Just check back for example with
https://www.complang.tuwien.ac.at/ulrich/iso-prolog/dcgs/dcgsdin100401.pdf
To see that they couldn’t bake it even in this iteration:

Insufficient Specification

It describes DCG via phrase/[2,3], like for example (;)/2.
But unfortunately phrase/[2,3] isn’t cut transparent:

phrase((A;B), S) is true iff ( phrase(A, S) ; phrase(B, S) ) is true.

This wont give a semantic to the cut inside DCG. But the cut is
allowed. The old draft did it much simpler, they simply stated:

Ebody((GREither; GROr), S0, S) ≡ Either; Or
where:
Ebody(GREither, S0, S) ≡ Either
Ebody(GROr, S0, S) ≡ Or

Semantic Shift

There is yet a new semantic shift in terminology. The first
semantic shift was when the push back was not anymore
called push back, but semi context.

The new semantic shift in this draft is that S0 is called semi
context. The new draft uses, which is utter nonsense:

More precisely, taking semicontext into account, phrase((A;B), S0,S), is true
iff ( phrase(A, S0,S) ; phrase(B, S0,S) ) is true.

One has only to check their own glossary to see that S0 is
not the semi-context:

3.22 semicontext: A terminal-sequence occurring optionally after the nonterminal of a grammar-rule-head, constraining parsing (respectively generation) by this grammar rule.

So the old draft used this terminology:

EType(T, Si, Si+1) the comprehensive and remaining
terminal-sequences Si and Si+1

Mostowski Collapse

unread,
Aug 30, 2021, 11:53:47 AM8/30/21
to
In general renaming the push back to semi context should be
anyway rolled back. Since it expresses more clearly what the push
back does. The push back pushes the terminal sequence on
the remaining sequences.

The push back aka semi context doesn't do what their glossary 3.22
says. Its not constraining the parsing, i.e. what happens in the grammar
body. It is applied after what happens in the grammar body.

Mostowski Collapse

unread,
Aug 30, 2021, 1:45:11 PM8/30/21
to
There is a further issue why the inventions of Ulrich Neumerkel don't work.
One cannot define DCG via the following new idea:
```
phrase((A,B), S) is true if S is the concatenation of S1 and S2
where phrase(A, S1) and phrase(B, S2) are true.
```
The reason is the look ahead in DCG `(\+)/1`. `phrase/1` would give
false positives and by the above much more would be parsed,
than what a DCG usually would parse. Its not so difficult to

create an example, that violates the above illconceived specification.
The counter example in this case is not cut related, i.e. not related
in that phrase/1 isn't cut transparent, but in that DCG `(\+)/1`

introduces some non-monotonicity, similar like the ordinary
negation as failure in Prolog. So one cannot trade the monadic
behaviour of difference lists with the monadic behaviour of append,

since the difference lists in DCG do more, they can also provide
some look ahead, the same essential look ahead that is used in
many other parser formalizations.

Mostowski Collapse

unread,
Aug 30, 2021, 1:48:08 PM8/30/21
to
Ulrich Neumerkel or who ever genius who had the idea to botch
the DCG draft. If I had to pay for that I would ask my money back.

Mostowski Collapse

unread,
Aug 30, 2021, 3:19:34 PM8/30/21
to
I offer 0.0001 Bitcoins for every test case that shows some flaw in
the specification as done by Ulrich Neumerkel via phrase/2 or phrase/3.

But this offer is only valid for 30 days, who knows what Bitcoin
rate will be towards the end of the year.

Mostowski Collapse

unread,
Aug 30, 2021, 3:29:16 PM8/30/21
to
The offer also ends when I have uploaded test
cases on gist, and marked those which would
not pass Ulrich Neumerkels world:

Example:
```
/* Violates Ulrich Neumerkels phrase((A;B), S) is true
iff ( phrase(A, S) ; phrase(B, S) ) is true. */
?- phrase((!, [a]; []), []).
false.
?- phrase((!, [a]), []); phrase([], []).
true.
```
But I am busy with other stuff, on the other hand Dogelog still
has a DCG ticket, so chances are nevertheless that will work
on DCG next days.

Mostowski Collapse

unread,
Aug 30, 2021, 3:37:09 PM8/30/21
to
My suspicion Ulrich Neumerkel was guided by some idea of
pure DCG. But DCG was never pure. It translates into Prolog,
not necessarely pure Prolog. Also a TS that would start with

some “pure” would be strange, since the ISO core standard
doesn’t talk about “pure”. It has a much wider scope.

Mostowski Collapse

unread,
Aug 30, 2021, 4:48:39 PM8/30/21
to
A good vendor intent approaches also the many clients intents. Maybe
Ulrich Neumerkel has been left behind by all the vendors, since his
idea of DCG seems to be text parsing and text generation as in 1975.

Vendor Reflected
Intent Intent
\ ^
v / ----> Intent Drift due to some Bias
DCG
Implementations

But already Richard O’Keefs book mentions accumulators,
and there is also the programming pattern of an accumulator
agument and a result argument. Such pairs can be modeled via

DCG and they can do other stuff than only parsing or generation.
Markus Triska even devotes a section on state threading.
In the Mercury programming language there is even a special

type constructor for that. Further EDCG, an extension of
DCG, has among its application domains also compiler
construction and the like.

Mostowski Collapse

unread,
Aug 30, 2021, 8:07:56 PM8/30/21
to
From https://www.complang.tuwien.ac.at/ulrich/iso-prolog/dcgs/dcgsdraft-2021-08-16.pdf:

phrase((A,B), S) is true if S is the concatenation of S1 and S2
where phrase(A, S1) and phrase(B, S2) are true.

Here is a test case that violates the above claim by Ulrich Neumerkel:

run --> [X], run(X).

run(X) --> [X], run(X).
run(X) --> \+ [X].

runs([*|L]) --> run, runs(L).
runs([]) --> [].

When I try Ulrich Neumerkels law, even in its formulation with “if”,
as he does, and not with “iff”, I can violate it:

/* SWI-Prolog 8.3.26 */
?- phrase((run, runs(L)), "0001111").
L = [*] ;
false.

?- append(S1, S2, "0001111"), phrase(run, S1), phrase(runs(L), S2).
S1 = [48],
S2 = [48, 48, 49, 49, 49, 49],
L = [*, *] ;
S1 = [48, 48],
S2 = [48, 49, 49, 49, 49],
L = [*, *] ;
S1 = [48, 48, 48],
S2 = [49, 49, 49, 49],
L = [*] ;
false.

If the law would hold then the first query would also return [*,*], but
it only returns [*]. This shows that the specification is nonsense.

Open Source:
https://gist.github.com/jburse/00d14dee1582a131a52bdddf1ffb9dcb#file-run-pl

Screen Shot:
https://gist.github.com/jburse/00d14dee1582a131a52bdddf1ffb9dcb#gistcomment-3877306

Mostowski Collapse

unread,
Aug 30, 2021, 9:17:05 PM8/30/21
to
Maybe Ulrich Neumerkels specification is from fuzzy
logic programming, and not from logic programming,
so his "if" such as:

P if Q

could effectively mean:

if Q then P with 85% confidence

But I am more worried about my incentive engineering.
0.0001 Bitcoin wasn't enough to get a response. But
I am afraid 1 Bitcoin would be too much, Ulrich Neumerkels

idea breaks for so many DCG applications. With runs/3,
determining running groups of the same terminal, I tried
something from parsing and which makes use of DCG (\+)/1,

pretty sure there are a couple of further counter examples.

Ulrich Neumerkel

unread,
Sep 1, 2021, 2:33:15 PM9/1/21
to
Mostowski Collapse <burs...@gmail.com> writes:
>It describes DCG via phrase/[2,3], like for example (;)/2.
>But unfortunately phrase/[2,3] isn't cut transparent:
>
>phrase((A;B), S) is true iff ( phrase(A, S) ; phrase(B, S) ) is true.
>
>This wont give a semantic to the cut inside DCG. But the cut is
>allowed.

This definition is similar to 7.8 where each construct first has
its logical meaning defined (7.14). Also in e.g. 7.8.6.1, the
first description does not cover cut.

This is the current working draft towards a TS - it seems someone
has forgotten to add this remark.

Mostowski Collapse

unread,
Sep 1, 2021, 4:39:11 PM9/1/21
to
Didn't check. Maybe the ISO core already proceeds this way.
First presenting a declarative ideal view. And later giving
more details about the procedural details.

Mostowski Collapse

unread,
Sep 2, 2021, 9:52:16 AM9/2/21
to
SWI-Prolog does the same nonsense as well in its documentation:

Goal1 ; _Goal2 :- Goal1.
_Goal1 ; Goal2 :- Goal2.

https://www.swi-prolog.org/pldoc/doc_for?object=%28%3B%29/2

This doesn’t work in practice. And this is also not what SWI-Prolog
implements, for example because of cut transparency. If you would
try adding such clauses, you would internally get, since A and B are
naked goals in the input, they will be wrapped with call/1:

A; _:- call(A).
_; B:- call(B).

call/1 isn’t cut transparent. But even if it were cut transparent, this
would only scratch the surface of the semantics of (;)/2. A further
problem is that the cut cuts through all surrounding control constructs
such as (,)/2, (;)/2 and (->)/2, but a clauses for (;)/2

would bar reaching that far.

Mostowski Collapse

unread,
Sep 2, 2021, 9:53:37 AM9/2/21
to
Sometimes a better view of (;)/2 would be even to say that:

?- A(X); B(X)

Is replaced by a fresh predicate p(X), with a definition:

p(X) :- A(X).
p(X) :- B(X).
?- p(X).

This would explain why ECLiPSe Prolog
has no spurious choice point here:

[eclipse 3]: [user].
test(X) :- X=baz; X=bar.
^Z
[eclipse 4]: test(baz).
Yes (0.00s cpu) %%%% No Choice Point

Whereas SWI-Prolog has a spurious choice
point here, although it can index (=)/2 already:

?- [user].
test(X) :- X=baz; X=bar.
^D
?- test(baz).
true ; %%%% Spurious Choice Point
false.

Mostowski Collapse

unread,
Sep 9, 2021, 5:41:30 PM9/9/21
to
I just found out that the word nonsense is censored now.
Also here is a nice sycophantic behaviour:

First before the Identity of the Moderator was known:

I did read your post about calling Logtalk nonsense, I firmly believe
that this is perfectly fine since it is obviously your opinion and it can
be argued, so, moderating it was definitely an overreaction.

Then after the Identity of the Moderator was known:

Fair enough. It was indeed impolite. It is terribly difficult to make those
judgements and I am glad I don’t have to make those calls
at least here on this forum.

Mostowski Collapse schrieb am Donnerstag, 2. September 2021 um 15:52:16 UTC+2:

Mostowski Collapse

unread,
Sep 9, 2021, 5:43:34 PM9/9/21
to
Dont know what a sycophant is? Well the world has
always many of them. You can look it up:

someone who praises powerful or rich people in a
way that is not sincere, usually in order to get some
advantage from them:
- The prime minister is surrounded by sycophants.

https://www.thefreedictionary.com/bootlicking

Mostowski Collapse

unread,
Sep 9, 2021, 5:54:39 PM9/9/21
to
The term was in use in 2020:

What is a Trump Sycophant?
https://www.youtube.com/watch?v=PueBqqizTNY

Mostowski Collapse

unread,
Sep 9, 2021, 6:02:19 PM9/9/21
to
History of People who wanted to turn me into a Sycophant:
- Bart Demoen, years ago attacked me on comp.lang.prolog
- Paulo Moura, Logtalk Creator, must be worshipped
- Ulrich Neumerkel, annoyed me with minus sign in numbers
- Jan Wielemaker, new/old? addition to my collection
- Who else? (I know more)

Well I am not Sycophant, and never will be. Got it? If you want
to deal with Sycophants I can refer you to those that are
around plenty. But for gods sake stick it up your ass.

Mostowski Collapse

unread,
Sep 9, 2021, 6:17:16 PM9/9/21
to
Sycophantic behaviour is needed in certain circles, for example
to get project funding. So its quite understandable for me
that people from such circles have a kind of automatism and

expect the same behaviour from other people. But they forget
that the world has also other corners, and that not everything
is project funding and stuff. So stick it up your ass.

Mostowski Collapse

unread,
Sep 10, 2021, 11:25:20 AM9/10/21
to
Interesting observation, the DCG proposal doesn't talk
about modules. How DCG work when the Prolog system
has also modules. Does anybody know that?

Whats the conclusion? Prolog will never have modules?
Logtalk nonsense is also dead, no proposal for objects
either? Or if one time a module standard or object

standard would come, this could be quite painful for
any DCG standard around. P.S.: Currently spending some
time again thinking and rethinking about modules

and objects, for upcoming Dogelog runtime.

Mostowski Collapse

unread,
Sep 10, 2021, 11:37:46 AM9/10/21
to
The DCG proposal only states:

NOTE — Examples for additional grammar control constructs
include soft- cuts and control constructs that enable the use
of grammar rules stored on encapsulation units other than
modules, such as objects.

Which is utter nonsense. Modules and objects are usually
invisible. In a good module system I can write:

:- module(foo, []).
foo :- bar.

And bar implicitly refers to foo:bar. Similar things might
happen with objects, or better say classes.

Also its not only control constructs that are affected by
modules. Also predicate indicators change etc.. etc..
Interestingly TauProlog, Scryer-Prolog and Trealla all

layed their hands on modules. What was their experience?
Nobody knows. For Scryer-Prolog it seems that modules
have broken ordinary Prolog, like ensure_loaded/1 etc..

have a couple of tickets. The DCG proposal then says:

"the non-terminal indicators (cf 7.13.4), as arguments of
these directives, shall be used like predicate indicators for
the predicates, resulting from expanding these non-terminals."

NOTE — The directives dynamic/1, multifile/1 and discontiguous/1
are applicable to non-terminal indicators.

Mostowski Collapse

unread,
Sep 10, 2021, 12:16:36 PM9/10/21
to
I also found where the idea of semicontext is constraint comes from:

7.13.3.2 Examples

phrase1, [word] --> phrase2, phrase3.

After preparation for execution this may occur in the database as follows.

phrase1(S0, S):-
phrase2(S0, S1),
phrase3(S1, S2),
S = [word | S2].

NOTES
1 In case of parsing with phrase1, as soon as phrase2 and phrase3
have successfully parsed the comprehensive terminal-sequence (input list),
the terminal word is prefixed to the remaining terminal-sequence. word is
then the first terminal to be consumed in further parsing after phrase1.
Thus further parsing is constrained by the semicontext.

Mostowski Collapse

unread,
Sep 10, 2021, 12:17:44 PM9/10/21
to
S = S2, no push back, would also constrain further parsing. I am not
convinced that the reader can do anything with the claim further parsing
is constrained. Thats a strange view, any non-terminal constrains

its juxtaposed DCG execution to the right. Assume you have a very large
input string "0123456789A0123456789A0123456789A..", you could
then code a DCG producer and consumer:

loop([X|L],[Y|R]) --> producer(X), consumer(Y), loop(L,R).
loop([], []) --> skip.

producer(X) --> [X], !.
producer(X) --> [_], producer(X).

consumer(Y) --> [X], {Y is X-1}.

skip --> [_], !, skip.
skip --> [].

Now the produce constrains the neighbour consumer in that the
producer dictates what the consumer returns.

Without push back!!!

Here is an example run:

?- phrase(loop("638",X), "0123456789A0123456789A0123456789A").
X = [54, 51, 56].

LoL

Mostowski Collapse

unread,
Sep 10, 2021, 12:27:36 PM9/10/21
to
Well I suggest the below sycophant as elected ambassador
of SWI-Prolog. Maybe the Creator of Logtalk nonsense would
then not have left the SWI-Prolog discourse, after all if

I remember well the Creator of Logtalk nonsense left the
SWI-Prolog discourse because of some other struggle not
related to my opinion on Logtalk. As an ambassador he

could play scophant on two sides, maybe he would be
able to bring back the Creator of Logtalk nonsense into
SWI-Prolog discourse? That would be a quite nice feat, like

bringing back Bin Laden to Afghanistan.

Mostowski Collapse schrieb am Donnerstag, 9. September 2021 um 23:41:30 UTC+2:

Mostowski Collapse

unread,
Sep 10, 2021, 12:38:46 PM9/10/21
to
Actually I am pretty sick about these intrigues between creators
with sycophant entourage, which anyway become each dictators
on the long run and do start controlling opinions.

This makes your brain feel like mush, you immediately forget all
of logic programming and start crawling on all fours.

LoL
0 new messages