Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.prolog > #14910

From natural language processing to Prolog [Beijing, April 8, 2011] (Re: Metamorphosis Grammars by Alain Colmerauer (Was: What about the <NEWLINE> ?)

From Mild Shock <janburse@fastmail.fm>
Newsgroups comp.lang.prolog
Subject From natural language processing to Prolog [Beijing, April 8, 2011] (Re: Metamorphosis Grammars by Alain Colmerauer (Was: What about the <NEWLINE> ?)
Date 2025-10-13 09:11 +0200
Message-ID <10ci8nk$vdki$2@solani.org> (permalink)
References <10cbu31$6r9g$1@dont-email.me> <10cd4s8$s7hn$1@solani.org> <10cddrd$kip6$1@dont-email.me> <10cem2m$t6j6$1@solani.org>

Show all headers | View raw


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, 1967–1968.
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, 1968–1970, French,
1971–1973, Prolog, 1973–1976 and Prolog II,
1977–1982. 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

Back to comp.lang.prolog | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

ISO Prolog and yet another stinking pile of crap Julio Di Egidio <julio@diegidio.name> - 2025-10-10 23:33 +0200
  What about the <NEWLINE> ? (Was: ISO Prolog and yet another stinking pile of crap) Mild Shock <janburse@fastmail.fm> - 2025-10-11 10:35 +0200
    Re: What about the <NEWLINE> ? (Was: ISO Prolog and yet another stinking pile of crap) Julio Di Egidio <julio@diegidio.name> - 2025-10-11 13:08 +0200
      Metamorphosis Grammars by Alain Colmerauer (Was: What about the <NEWLINE> ?) Mild Shock <janburse@fastmail.fm> - 2025-10-12 00:35 +0200
        Compact DCG Transducer by Dogelog Player (Was: Metamorphosis Grammars by Alain Colmerauer) Mild Shock <janburse@fastmail.fm> - 2025-10-12 00:55 +0200
          Did Picat, Minizinc, etc.. dumb down Prolog? (Was: Compact DCG Transducer by Dogelog Player) Mild Shock <janburse@fastmail.fm> - 2025-10-12 01:06 +0200
        Re: Metamorphosis Grammars by Alain Colmerauer (Was: What about the <NEWLINE> ?) Julio Di Egidio <julio@diegidio.name> - 2025-10-12 01:28 +0200
          Solve the Bootstrapping Problem: Self Hosting Systems (Was: Metamorphosis Grammars by Alain Colmerauer) Mild Shock <janburse@fastmail.fm> - 2025-10-12 04:28 +0200
        From natural language processing to Prolog [Beijing, April 8, 2011] (Re: Metamorphosis Grammars by Alain Colmerauer (Was: What about the <NEWLINE> ?) Mild Shock <janburse@fastmail.fm> - 2025-10-13 09:11 +0200
        From natural language processing to Prolog [Beijing, April 8, 2011] (Re: Metamorphosis Grammars by Alain Colmerauer (Was: What about the <NEWLINE> ?) Mild Shock <janburse@fastmail.fm> - 2025-10-13 09:11 +0200
          Difference between W-Grammars and DCG Transform (Was: From natural language processing to Prolog [Beijing, April 8, 2011]) Mild Shock <janburse@fastmail.fm> - 2025-10-13 09:23 +0200
            The Blunder: “constraint programming” companies in France 1984–1996 (Was: Difference between W-Grammars and DCG Transform) Mild Shock <janburse@fastmail.fm> - 2025-10-13 09:34 +0200
  Gradual Refinement: AI Memo 39 (Was: ISO Prolog and yet another stinking pile of crap) Mild Shock <janburse@fastmail.fm> - 2025-10-12 05:00 +0200

csiph-web