• ISO Prolog and yet another stinking pile of crap

    From Julio Di Egidio@julio@diegidio.name to comp.lang.prolog on Fri Oct 10 23:33:20 2025
    From Newsgroup: comp.lang.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
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Mild Shock@janburse@fastmail.fm to comp.lang.prolog on Sat Oct 11 10:35:21 2025
    From Newsgroup: comp.lang.prolog

    Hi,

    and now I am implementing a new Prolog

    Mind then gap, there might be a <NEWLINE> lurking!

    LoL

    Bye

    Julio Di Egidio schrieb:
    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

    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Julio Di Egidio@julio@diegidio.name to comp.lang.prolog on Sat Oct 11 13:08:28 2025
    From Newsgroup: comp.lang.prolog

    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

    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Mild Shock@janburse@fastmail.fm to comp.lang.prolog on Sun Oct 12 00:35:03 2025
    From Newsgroup: comp.lang.prolog

    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


    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Mild Shock@janburse@fastmail.fm to comp.lang.prolog on Sun Oct 12 00:55:57 2025
    From Newsgroup: comp.lang.prolog

    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) :-
    replace(A, C),
    B=[10|C].
    replace([13|A], B) :-
    replace(A, C),
    B=[10|C].
    replace([10|A], B) :-
    replace(A, C),
    B=[10|C].
    replace([A|B], C) :-
    replace(B, D),
    C=[A|D].
    replace(A, B) :-
    A=B.

    Some Prolog systems cannot do the head movement:

    /* Trealla Prolog, Scryer Prolog */
    replace(A,B) :-
    (A=[13,10|C],replace(C,D)),B=[10|D].
    replace(A,B) :-
    (A=[13|C],replace(C,D)),B=[10|D].
    replace(A,B) :-
    (A=[10|C],replace(C,D)),B=[10|D].
    replace(A,B) :-
    (A=[C|D],replace(D,E)),B=[C|E].
    replace(A,B) :-
    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



    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Mild Shock@janburse@fastmail.fm to comp.lang.prolog on Sun Oct 12 01:06:41 2025
    From Newsgroup: comp.lang.prolog

    Hi,

    Actually I have no explanation why the new DCG
    standard is so bad. That it sees semi-contexts
    only being terminals. Non-terminals are great:

    seq([c|L]) --> [c], seq(L).
    seq([]) --> [].

    example3, [x], seq(L) --> [a], seq(L), [b], example3.
    example3, [X] --> [X], example3.
    example3 --> [].

    /* Transformation */
    ?- example3([a,a,c,b,b], X).
    X = [a, x, c, b]

    ?- example3([a,a,c,c,c,b,b], X).
    X = [a, x, c, c, c, b]

    Why did the whole Prolog community lost touch
    with the roots of Prolog, namely Alain Colmerauers
    Metamorphosis Grammars.

    My only explanation is a dumbing down by
    aspirations such as Picta, Minizinc, etc.. the
    whole useless CLP(X) nonsense.

    Bye

    Mild Shock schrieb:
    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




    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Julio Di Egidio@julio@diegidio.name to comp.lang.prolog on Sun Oct 12 01:28:47 2025
    From Newsgroup: comp.lang.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. Keep eating mud.

    *Plonk*

    Julio

    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Mild Shock@janburse@fastmail.fm to comp.lang.prolog on Sun Oct 12 04:28:56 2025
    From Newsgroup: comp.lang.prolog

    Hi,

    You are just too lazy to ever build a Prolog
    system, especially a Self Hosting System.
    This is mostlikely out of reach.

    Most people fall back to RegEx and a couple
    of other compiler generators. Since they don't
    now how to Bootstrap a Prolog system B,

    with the help of a Prolog system A. But
    its not so difficult. Ultimately starting with
    any existing Prolog system, like for example

    SWI-Prolog, etc.., you can bootstrap another Prolog
    system Target-X. Its especially simply if
    you have the intention that Target-X has a

    high amount of facilities written in Prolog
    itself. i.e. a 100% Prolog Prolog. Such a
    100% Prolog Prolog would make a good reference

    implementation. But I doubt that anybody
    currently in the Prolog community can do it.
    The result could a so called Self-Hosting

    system, thats the moment when the Target-X
    has progressed so far that it can "compile"
    itself. Thats the best moment of such a

    Bootstrapping, because then you can forget
    the Prolog parent system, such as SWI-Prolog,
    etc... From then on your system is independent

    of another Prolog system.

    Bye

    Julio Di Egidio schrieb:
    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


    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Mild Shock@janburse@fastmail.fm to comp.lang.prolog on Sun Oct 12 05:00:06 2025
    From Newsgroup: comp.lang.prolog

    Hi,

    The first historical event of a self hosting
    compiler, was LISP 1.5, as documented here:

    "This memo introduces the brand new LISP 1.5
    Compiler designed and programmed by Tim Hart
    and Mike Levin. It is written entirely in LISP
    and is the first compiler that has ever compiled
    itself by being executed interpretively." http://www.bitsavers.org/pdf/mit/ai/aim/AIM-039.pdf

    It also shows an interesting twist of
    bootstrapping tricks. You can bootstrap a
    series of gradual refinements. Like start

    only with a primitive Prolog interpreter, and
    then gradually add features to make it more
    advanced. This can also involved cross compilation,

    until a stage is reached where the next plateau
    can be climbed in a self-hosting manner. You have
    to build at least twice. Take the LISP 1.5 example,

    the first time you build the system, you use
    the interpreter machine M_I and the compiler code C,
    to derive a compiler machine M_C:

    M_C := M_I(C)

    With above step you didn't arrive yet at a self
    hosting system, the above is not a fixpoint. The
    proof of the pudding is yet another run:

    M_C' := M_C(C)

    And hopefully you have M_C' = M_C.

    Bye

    Julio Di Egidio schrieb:
    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

    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Mild Shock@janburse@fastmail.fm to comp.lang.prolog on Mon Oct 13 09:11:01 2025
    From Newsgroup: comp.lang.prolog

    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/

    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
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Mild Shock@janburse@fastmail.fm to comp.lang.prolog on Mon Oct 13 09:11:47 2025
    From Newsgroup: comp.lang.prolog

    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
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Mild Shock@janburse@fastmail.fm to comp.lang.prolog on Mon Oct 13 09:23:13 2025
    From Newsgroup: comp.lang.prolog

    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:

    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

    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Mild Shock@janburse@fastmail.fm to comp.lang.prolog on Mon Oct 13 09:34:46 2025
    From Newsgroup: comp.lang.prolog

    Hi,

    What makes the Prolog community probably so
    dumbed down, concerning parsing and language theory.
    Is possibly the blunder of focusing on

    rCLconstraint programmingrCY in the 80s and 90s.
    So the Gen-X and later generations has become
    clueless about parsing and language theory.

    Alain Colmerauer lists in his China talk:

    - PrologIA
    - ILOG
    - COSYTEC

    But maybe dumbos like Julio Di Egidio
    <julio@diegidio.name> are the exception? The
    problem roots deeper. Not only has the Prolog

    community become dumbed down, about to
    use DCGs in production, it also doesn't trust
    a single Prolog system to do it efficiently

    to have it used in production, like the realization
    of a Prolog system itself. Somehow methods and
    tools to realize efficient DCGs in Prolog are

    missing. Most DCG attempts that one sees succumb
    to some declarative nonsense, creating exponentially
    many spurious choice points, you find rarely

    somebody mastering the Art.

    Bye

    Mild Shock schrieb:
    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


    --- Synchronet 3.21a-Linux NewsLink 1.2