Newbie Question: Reading older grammar rule code...



Hi all-

Hope this isn't too much of an RTFM question: I'm pretty new to Prolog
and Grammar Rules, trying to get a piece of code from the mid-80s to
run with GNU-Prolog. The excerpts below come from Louis Odette's
"Compiling Prolog to Forth" published in JFAR, 4/4.

Also, the xerox I have of his paper is not the best, so my ability to
distinguish square "[" from curly "{" braces is quite compromised.

GNU-Prolog gives a compliation error, for example, here at the
asterisked line:

args(Vars, Old, New, Num0, Num1) -->
simple_term(Vars, Old, N1),
* ([','], [Num is Num0+1], args(Vars, N1, New, Num, Num1) |
[New = N1, Num1 is Num0+1]).

which seems fair, considering GNU-Prolog doesn't support "|" as the
disjunction operator. But later on in the code, Odette wrote this:

variable(Vars, Old, ['VAR', Num |Old]) -->
[Var], [char(1, Var, L), ascii(L, M),
(ascii('_', M) ;
ascii('A', _a), ascii('Z', _z), _a =< M, M =< _z),
memberchkN(Var, Vars, 0, Num)], !.

where a ";" is used explicitly: the only instance.

I suppose this could be some sort of typo, but I'm hoping someone might
clarify the use of these operators. Perhaps "|" meant something other
than disjunction for some Prolog(s) in the mid-80s?

Many thanks! Charles Turner

.



Relevant Pages

  • Re: Newbie Question: Reading older grammar rule code...
    ... Hope this isn't too much of an RTFM question: I'm pretty new to Prolog ... trying to get a piece of code from the mid-80s to ... GNU-Prolog gives a compliation error, for example, here at the ... [Var], [char, ascii, ...
    (comp.lang.prolog)
  • Re: WAM Vs. TOAM
    ... at half the speed of SICStus Prolog 3.12 ... GNU Prolog, XSB, SICStus, Yap and hProlog are all WAM based. ... All these systems are emulators - except GNU-Prolog which is a hybrid ...
    (comp.lang.prolog)
  • Re: A few questions about Prolog...
    ... few Prolog implementations, and would appreciate if the community ... SWI-Prolog uses a lot of memory for stacks? ... could find in favor of GNU-Prolog is a good choice of GUI. ...
    (comp.lang.prolog)