Sysop: | Amessyroom |
---|---|
Location: | Fayetteville, NC |
Users: | 26 |
Nodes: | 6 (0 / 6) |
Uptime: | 58:43:54 |
Calls: | 632 |
Files: | 1,188 |
D/L today: |
31 files (20,038K bytes) |
Messages: | 180,226 |
and now I am implementing a new Prolog
Prolog, ISO Prolog, and the whole indecent compartment, 50 years
of logic programming and never ever getting it right, just a pile
of substandard crap: meanwhile the language spec costs re4350 part 1
only (read, a closed academic and then corporative game), to just
mention the tip of the iceberg, and these parasites and abusive
cheats are even giving prices to each other...
Indeed, with the exception of some niche, people have absolutely
no clue how fundamental logic programming actually is: and now I am implementing a new Prolog, the Prolog everybody has been dreaming
of but couldn't even ask about, and completely for free: besides
shaming you and your bullshit, about what is possible or impossible
to begin with, I do hope you and the whole incorporated gang go out
of business, to put it lightly.
-Julio
Hi,
and now I am implementing a new Prolog
Mind then gap, there might be a <NEWLINE> lurking!
LoL
On 11/10/2025 10:35, Mild Shock wrote:
Hi,
and now I am implementing a new Prolog
Mind then gap, there might be a <NEWLINE> lurking!
LoL
LOL indeed, as that's the level of the discussion.
I have the lexer mostly ready, just missing full Unicode support:
design, implementation, and testing, but I need to improve on the
testing, for which I am taking a detour and building a Regex
analyser and string generator.
The implementation is in C#.Net, which I find great for prototyping,
anyway what I mean is a *specification and reference implementation*,
then anybody can rewrite it in Java or ANSI C or anything (I am being
careful in the constructs I am using to make that seamless), and sell
that if they like...
You are a good tester: I would gladly keep you in the loop if you
are seriously interested.
-Julio
Hi,
Only morons waste time with regex when they have Prolog!
Its amazing, since Alain Colmerauer was already
juggling with a kind of transducers:
"We present some very general grammars in which
each re-writing rule is of the type: replace such
and such sequence of trees by such and such another
sequence of trees."
https://www.researchgate.net/publication/225124810
Still the Prolog community is to stupid to
transduce CR, CR LF and LF into LF. Thats quite a
feat. BTW, this should do using DCG semi-contexts:
replace, [0'\n] --> [0'\r, 0'\n], replace.
replace, [0'\n] --> [0'\r], replace.
replace, [0'\n] --> [0'\n], replace.
replace, [X] --> [X], replace.
replace --> [].
Works on my side:
?- replace("foo\rbar\r\nbaz", _L), atom_codes(A, _L).
A = 'foo\nbar\nbaz'
Now optimize it to produce 0'\n as early as
possible and use a state machine, so that you
can implement it low level in your streams.
Have Fun!
Bye
Julio Di Egidio schrieb:
On 11/10/2025 10:35, Mild Shock wrote:
Hi,
and now I am implementing a new Prolog
Mind then gap, there might be a <NEWLINE> lurking!
LoL
LOL indeed, as that's the level of the discussion.
I have the lexer mostly ready, just missing full Unicode support:
design, implementation, and testing, but I need to improve on the
testing, for which I am taking a detour and building a Regex
analyser and string generator.
The implementation is in C#.Net, which I find great for prototyping,
anyway what I mean is a *specification and reference implementation*,
then anybody can rewrite it in Java or ANSI C or anything (I am being
careful in the constructs I am using to make that seamless), and sell
that if they like...
You are a good tester: I would gladly keep you in the loop if you
are seriously interested.
-Julio
Hi,
You can compare the generated plain Prolog code
for replace/2. It varies among Prolog systems.
A translation that moves the semi-context into
the head could cause steadfastness problems,
on the other hand moving the first terminal in
the body of the grammar into the head is ok:
/* Dogelog Player, SWI-Prolog */
replace([13, 10|A], B) :-
-a-a-a replace(A, C),
-a-a-a B=[10|C].
replace([13|A], B) :-
-a-a-a replace(A, C),
-a-a-a B=[10|C].
replace([10|A], B) :-
-a-a-a replace(A, C),
-a-a-a B=[10|C].
replace([A|B], C) :-
-a-a-a replace(B, D),
-a-a-a C=[A|D].
replace(A, B) :-
-a-a-a A=B.
Some Prolog systems cannot do the head movement:
/* Trealla Prolog, Scryer Prolog */
replace(A,B) :-
-a-a (A=[13,10|C],replace(C,D)),B=[10|D].
replace(A,B) :-
-a-a (A=[13|C],replace(C,D)),B=[10|D].
replace(A,B) :-
-a-a (A=[10|C],replace(C,D)),B=[10|D].
replace(A,B) :-
-a-a (A=[C|D],replace(D,E)),B=[C|E].
replace(A,B) :-
-a-a A=B.
Bye
Mild Shock schrieb:
Hi,
Only morons waste time with regex when they have Prolog!
Its amazing, since Alain Colmerauer was already
juggling with a kind of transducers:
"We present some very general grammars in which
each re-writing rule is of the type: replace such
and such sequence of trees by such and such another
sequence of trees."
https://www.researchgate.net/publication/225124810
Still the Prolog community is to stupid to
transduce CR, CR LF and LF into LF. Thats quite a
feat. BTW, this should do using DCG semi-contexts:
replace, [0'\n] --> [0'\r, 0'\n], replace.
replace, [0'\n] --> [0'\r], replace.
replace, [0'\n] --> [0'\n], replace.
replace, [X] --> [X], replace.
replace --> [].
Works on my side:
?- replace("foo\rbar\r\nbaz", _L), atom_codes(A, _L).
A = 'foo\nbar\nbaz'
Now optimize it to produce 0'\n as early as
possible and use a state machine, so that you
can implement it low level in your streams.
Have Fun!
Bye
Julio Di Egidio schrieb:
On 11/10/2025 10:35, Mild Shock wrote:
Hi,
and now I am implementing a new Prolog
Mind then gap, there might be a <NEWLINE> lurking!
LoL
LOL indeed, as that's the level of the discussion.
I have the lexer mostly ready, just missing full Unicode support:
design, implementation, and testing, but I need to improve on the
testing, for which I am taking a detour and building a Regex
analyser and string generator.
The implementation is in C#.Net, which I find great for prototyping,
anyway what I mean is a *specification and reference implementation*,
then anybody can rewrite it in Java or ANSI C or anything (I am being
careful in the constructs I am using to make that seamless), and sell
that if they like...
You are a good tester: I would gladly keep you in the loop if you
are seriously interested.
-Julio
Only morons waste time with regex when they have Prolog!
On 12/10/2025 00:35, Mild Shock wrote:
Only morons waste time with regex when they have Prolog!
You are just so fucking clueless.-a Keep eating mud.
*Plonk*
Julio
Prolog, ISO Prolog, and the whole indecent compartment, 50 years
of logic programming and never ever getting it right, just a pile
of substandard crap: meanwhile the language spec costs re4350 part 1
only (read, a closed academic and then corporative game), to just
mention the tip of the iceberg, and these parasites and abusive
cheats are even giving prices to each other...
Indeed, with the exception of some niche, people have absolutely
no clue how fundamental logic programming actually is: and now I am implementing a new Prolog, the Prolog everybody has been dreaming
of but couldn't even ask about, and completely for free: besides
shaming you and your bullshit, about what is possible or impossible
to begin with, I do hope you and the whole incorporated gang go out
of business, to put it lightly.
-Julio
Hi,--- Synchronet 3.21a-Linux NewsLink 1.2
Only morons waste time with regex when they have Prolog!
Its amazing, since Alain Colmerauer was already
juggling with a kind of transducers:
"We present some very general grammars in which
each re-writing rule is of the type: replace such
and such sequence of trees by such and such another
sequence of trees."
https://www.researchgate.net/publication/225124810
Still the Prolog community is to stupid to
transduce CR, CR LF and LF into LF. Thats quite a
feat. BTW, this should do using DCG semi-contexts:
replace, [0'\n] --> [0'\r, 0'\n], replace.
replace, [0'\n] --> [0'\r], replace.
replace, [0'\n] --> [0'\n], replace.
replace, [X] --> [X], replace.
replace --> [].
Works on my side:
?- replace("foo\rbar\r\nbaz", _L), atom_codes(A, _L).
A = 'foo\nbar\nbaz'
Now optimize it to produce 0'\n as early as
possible and use a state machine, so that you
can implement it low level in your streams.
Have Fun!
Bye
Hi,--- Synchronet 3.21a-Linux NewsLink 1.2
Only morons waste time with regex when they have Prolog!
Its amazing, since Alain Colmerauer was already
juggling with a kind of transducers:
"We present some very general grammars in which
each re-writing rule is of the type: replace such
and such sequence of trees by such and such another
sequence of trees."
https://www.researchgate.net/publication/225124810
Still the Prolog community is to stupid to
transduce CR, CR LF and LF into LF. Thats quite a
feat. BTW, this should do using DCG semi-contexts:
replace, [0'\n] --> [0'\r, 0'\n], replace.
replace, [0'\n] --> [0'\r], replace.
replace, [0'\n] --> [0'\n], replace.
replace, [X] --> [X], replace.
replace --> [].
Works on my side:
?- replace("foo\rbar\r\nbaz", _L), atom_codes(A, _L).
A = 'foo\nbar\nbaz'
Now optimize it to produce 0'\n as early as
possible and use a state machine, so that you
can implement it low level in your streams.
Have Fun!
Bye
Hi,
I only rediscovered a little bit that DCG has
also semi-context, and that when using non-terminals
in semi-contexts, these act like what
was Meta-Grammars in W-Grammar, 1967rCo1968.
W-Grammars with Meta-Grammars were basically
Semi-Thue systems, but one needs to pay attention,
the todays DCG cannot directly implement them:
From natural language processing to Prolog http://alain.colmerauer.free.fr/alcol/ArchivesTransparents/ChinaApril2011/NatLanguageProlog.pdf
What later came was Q-System, 1968rCo1970, French,
1971rCo1973, Prolog, 1973rCo1976 and Prolog II,
1977rCo1982. An early shift to CLP(X) was dif/2
which already appeared in Prolog II. That todays
Prolog commmunity is clueless about the grammar
and transform aspect is really sad.
Bye
Mild Shock schrieb:
Hi,
Only morons waste time with regex when they have Prolog!
Its amazing, since Alain Colmerauer was already
juggling with a kind of transducers:
"We present some very general grammars in which
each re-writing rule is of the type: replace such
and such sequence of trees by such and such another
sequence of trees."
https://www.researchgate.net/publication/225124810
Still the Prolog community is to stupid to
transduce CR, CR LF and LF into LF. Thats quite a
feat. BTW, this should do using DCG semi-contexts:
replace, [0'\n] --> [0'\r, 0'\n], replace.
replace, [0'\n] --> [0'\r], replace.
replace, [0'\n] --> [0'\n], replace.
replace, [X] --> [X], replace.
replace --> [].
Works on my side:
?- replace("foo\rbar\r\nbaz", _L), atom_codes(A, _L).
A = 'foo\nbar\nbaz'
Now optimize it to produce 0'\n as early as
possible and use a state machine, so that you
can implement it low level in your streams.
Have Fun!
Bye
Hi,
I didn't unlock the Metamorphoses Paper yet,
its still behind a paywall for me. But
a Paper about W-Grammars is available.
The Paper about W-Grammars is from
Alain Colmerauers website again.
While a W-Grammar rule of the form:
X |-> Y
Leads mathematically to a rewrite rule:
V,X,W ==> V,Y,W
A DCG Transform of the form:
P,Y --> X,P
Leads mathematically to a rewrite rule:
V,*,X,W ==> V,Y,*,W
Where * is a kind of replacement cursor.
So in DCG Transform there is no comming back
to match and replace a previous position again.
Thats why in my NetFish Transducer, I need
"cascading", basically repeatedly applying
the DCG Transforms by iteration,
until a kind of fixpoint is reached.
Bye
See also:
W-Grammar, Chastellier & Colmerauer (1968) http://alain.colmerauer.free.fr/alcol/ArchivesPublications/Wgrammar/Wgrammar.pdf
Mild Shock schrieb:
Hi,
I only rediscovered a little bit that DCG has
also semi-context, and that when using non-terminals
in semi-contexts, these act like what
was Meta-Grammars in W-Grammar, 1967rCo1968.
W-Grammars with Meta-Grammars were basically
Semi-Thue systems, but one needs to pay attention,
the todays DCG cannot directly implement them:
-aFrom natural language processing to Prolog
http://alain.colmerauer.free.fr/alcol/ArchivesTransparents/ChinaApril2011/NatLanguageProlog.pdf
What later came was Q-System, 1968rCo1970, French,
1971rCo1973, Prolog, 1973rCo1976 and Prolog II,
1977rCo1982. An early shift to CLP(X) was dif/2
which already appeared in Prolog II. That todays
Prolog commmunity is clueless about the grammar
and transform aspect is really sad.
Bye
Mild Shock schrieb:
Hi,
Only morons waste time with regex when they have Prolog!
Its amazing, since Alain Colmerauer was already
juggling with a kind of transducers:
"We present some very general grammars in which
each re-writing rule is of the type: replace such
and such sequence of trees by such and such another
sequence of trees."
https://www.researchgate.net/publication/225124810
Still the Prolog community is to stupid to
transduce CR, CR LF and LF into LF. Thats quite a
feat. BTW, this should do using DCG semi-contexts:
replace, [0'\n] --> [0'\r, 0'\n], replace.
replace, [0'\n] --> [0'\r], replace.
replace, [0'\n] --> [0'\n], replace.
replace, [X] --> [X], replace.
replace --> [].
Works on my side:
?- replace("foo\rbar\r\nbaz", _L), atom_codes(A, _L).
A = 'foo\nbar\nbaz'
Now optimize it to produce 0'\n as early as
possible and use a state machine, so that you
can implement it low level in your streams.
Have Fun!
Bye