Ulrich Neumerkel schrieb:
> Here you consider what is known as preparation for
> execution (7.5.1). This phase is entirely implementation
> dependent.
Yes and no. I guess it a little unclear, but I doubt
that it allows for an "entirely" implementation dependent
realization. Since we have the following phrase in
section 7.5.1:
... This process converts the read-terms in a
Prolog text to the clauses of user-defined
procedures in the database.
There is no explicit forward reference to 7.6.2, the
conversion. But applying exemplar reasoning, should
suffice to show that 7.6.2 is intended. Namely in
Section 8.8 we have given a Prolog text:
...
legs(A, 7) :- A, call(A).
...
And then the following example in Section
8.8.1.4:
...
clause(legs(C, 7), Body).
Succeeds, unifying Body with (call(C), call(C)).
...
So there is evidence that the preparation 7.5.1 needs
at least to follow part of 7.6.2., namely the wrapping
of a naked goals X to call(X).
An "entirely" implementation dependent realization would
render Prolog systems quite arbitrarily, and would make
Prolog texts as an exchange medium for what they stand
for useless.
I think the more important sections of 7.5.1 are:
... The means by which a Prolog processor is asked to
prepare standard-conforming Prolog texts (6.2) to
execution shall be implementation defined. ...
Which I read the Prolog systems is free to provide a
[user] or a consult... menu entry etc..
And then:
... The manner in which a Prolog processor prepares
standard-conforming Proog texts for executio shall
be implementation dependent. ...
Here I am not 100% sure what the intention is. I guess
it has to do with the moment by when the Prolog text is
converted, and the amount of Prolog text that is converted.
For example when one tries the p :- write(3),3 clause
example, one sees that not all Prolog systems immediately
display an error message.
I am not refering to lazy vs. non-lazy. But for the example
some Prolog systems start only showing an error when
encontering ^D resp. ^Z (eof).
Also I see that Prolog systems sometimes refuse the
whole Prolog text when a single error occurs in the
Prolog text, and some just continue with the rest.
And it might be difficult to get an error term, since
errors during Prolog text preperation usually don't
permeate to the call site. I cannot do:
?- catch([user],E,true).
So this might be a reason also why there is no negative
example for it. It would be simple to add:
legs(A, 8) :- write(3), 1.
And then say at least: If the a Prolog text is accepted,
then it should not have included the above clause for
execution, or the whole Prolog text might be rejected.
Bye