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


Groups > comp.lang.prolog > #14537

DCGs are dead: ROKs transformation from FGCS 1982

From Mild Shock <janburse@fastmail.fm>
Newsgroups comp.lang.prolog
Subject DCGs are dead: ROKs transformation from FGCS 1982
Date 2025-06-04 16:50 +0200
Message-ID <101pmga$ccd2$1@solani.org> (permalink)

Show all headers | View raw


 > Parse the lines using a DCG

This was a quite popular subject around the time
Fifth Generation Computer Systems (FGCS) in 1982
and made it into a couple of Prolog books from
the same decade. It was before the relaunch of

FGCS in the form of Stargate in 2025, and from
the time were people reading books and not simply
asking ChatGPT. One of these Prolog books
is THE BOOK by ROK:

The Craft of Prolog
Richard O’Keefe - 1990
https://mitpress.mit.edu/9780262512275/the-craft-of-prolog/

His DCG somehow assumes there are already tokens,
and he then starts discussing these DCG productions:

command(delete(File)) -->  [rm], file(File).
command(copy(From,To)) -->  [cp], file(From), file(To).
command(print(File)) -->  [lpr], file(File).

He then basically goes into head scratching rampage
about the current state of DCGs at that time, ultimately
suggesting some workaround by a cleaner technique
that promotes the first token

/* ROKs transformation */
command(Cmd) --> [Token], command(Token, Cmd).

command(rm, delete(File)) -->  file(File).
command(cp, copy(From,To)) -->  file(From), file(To).
command(lpr, print(File)) -->  file(File).

into argument indexing. Basically obviating the very idea to
use the input DCGs in the first place.

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


Thread

DCGs are dead: ROKs transformation from FGCS 1982 Mild Shock <janburse@fastmail.fm> - 2025-06-04 16:50 +0200
  long live DGCs: Prolog systems before Stargate LLC in 2025 (Was: DCGs are dead: ROKs transformation from FGCS 1982) Mild Shock <janburse@fastmail.fm> - 2025-06-04 16:57 +0200
    Stargate LLC is a "shovel" project [Great Ocean Road?] (Was: long live DGCs: Prolog systems before Stargate LLC in 2025) Mild Shock <janburse@fastmail.fm> - 2025-06-04 23:00 +0200

csiph-web