- Ulrich Neumerkel,
2014-06-12
Remark on the timeliness of these comments: The new DIN draft was
scheduled for 2013-11-15 (Istanbul Resolution A4) but appeared 5
months later which reduced considerably the time for comments.
Comments on previous versions:
N218 2010-04-01,
N218 2010-07-18,
N232 2012-07-13,
N238 2012-11-20.
N249 2013-08-20.
While there is some progress compared to N249, there are still
many open issues, and the previous comments must still be taken
into account.
- 7.14.2 Replace
SemiContext
by Semicontext
. It is one word like semigroup.
- 7.14.3 Semicontexts replace by Semicontext (it is 7.9.4 cut
and not cuts, 7.8.5 conjunction etc)
- ...as an optional second argument ... . A semicontext is not
an argument.
- ... after successful application of the grammar rule... This
is an operational description.
- 7.14.3.2 Examples:
nt(S0, [word|S]) :- S0 = S.
should read nt(S0,S) :- S = [word|S0].
or
introduce further equations.
- 7.15: Many of the comments
of N249 2013-08-20
have not been integrated: In particular, there is no presentation
comparable to 7.8 Control constructs. Also, it is not visible
which cases are considered implementation dependent. There are
still far too many enumerations. In fact only two are needed the
concrete constructs 7.15.1 etc and the reference
implementation.
Since, there has not been any attempt to
define when constructs are well defined and when they are
implementation dependent, maybe the best would be to define this
formally only.
- 7.15.2 ('|')//2 - list separator. This has to be '.'//2.
- 7.15.4 (;)//2 - alternative. Here, the special case of
if-then-else has to be mentioned similarly to 7.8.6.
- 7.15.5
->//2
- if-then-else. This is an if-then,
not an if-then else. If-then-else is (;)//2. The remarks make
this somewhat clear, but the present form is unsuited for a
definition.
- 7.15.6:
( a -> b | c)
needs to be implementation
dependent.
- 7.15.7: ... If G immediately contains a cut, ... This needs
to be clearer that cuts within {}//1 extend outside of {}//1.
- 7.15.9: phrase//1: There is a further use: a single
variable
Goal
is expanded to phrase//1 and
respectively phrase/3.
- 7.15.11:
(\+)//1
: It seems the entire construct
is rather disputed: At least it should be left as a dummy that
must not be used otherwise.
- Cases like
[] --> [a].
\+ a --> [].
a --> [_|_].
a --> (b --> c).
a, b --> c.
! --> [].
Must be left implementation dependent. But where is this
defined?
- Should (\+)//1 be retained, the rule for (\+)//1 would be
rather:
dcg_cbody(\+ GRBody, S0, S, ( \+ phrase(GRBody,S0,_), S0 = S )).
Implementations still may translate things more efficiently,
however, the observable semantics, particularly with respect to
cuts and errors must be retained.
As an example, consider the query phrase(([a],\+1),[])
which
always should fail and not produce an error.
- Renumber 8.1 to 8.18 (again!)
- Added 2014-06-27: The original DECsystem 10 manual of 1978
read: (Similarly SICStus)
A grammar rule takes the general form:-
LHS --> RHS.
meaning "a possible form for LHS is RHS".
- Standard way to see what phrase/3 translates
- DCG Expansion: Is Steadfastness ignored?
- DCG for idiomatic phrase preference
Validated HTML