[mercury-users] Using existential quantification?

Fergus Henderson fjh at cs.mu.OZ.AU
Fri Feb 7 01:39:10 AEDT 2003


On 06-Feb-2003, Peter Moulder <pmoulder at csse.monash.edu.au> wrote:
> Incidentally (this is addressed principally to the Mercury developers),
> I don't find that `Implicit quantification' section very clear.  For
> example, it doesn't say what a scope is.

Hmm.  Good point.  Care to propose a patch? ;-)

> When talking about negations, is that before or after applying the
> various transformations mentioned in the `Goals' and (especially)
> `Elimination of double negation' sections?

Another good point.  The intent is that double negation elimination
is done *after* implicit quantification.  I will change the part
where it says that double negation elimination is done "after syntax
analysis" to say "after syntax analysis and implicit quantification".
(The original intent was that the meaning of "syntax analysis" should
include implicit quantification, but I agree that it is better to
spell this out explicitly.)

> Now that we have state variables, DCG notation is less important, so one
> might move the DCG things to about the end of the chapter, for the
> benefit of people who try to read a reference manual as a means of
> learning a language.  (I'm not as sure of this suggestion; there are
> benefits in leaving the DCG where they are at the moment, after state
> variables.)

I think it would be better to leave this where it is, since that is
where it logically belongs (as part of the "Syntax" chapter"),
but perhaps to add something at the start saying that it may be
useful to skip this section on a first reading.
However, right now DCGs are still very prevalent in existing Mercury
code, so I'm not sure if that would be such good advice at this point.

> Another thing I didn't understand when learning Mercury was what the
> scope of `_' variables was, or even whether it was considered a variable
> for purposes of scoping rules.  ... I see in section `Tokens' ...
> the answer ...  [but] someone
> learning Mercury might easily decide to skim/skip that section.  I'm not
> sure where a better place for this semantic information to go, but the
> concept is sufficiently distinct that one might even have a separate
> section `Anonymous variables' somewhere near the `Variable scoping' and
> `Implicit quantification' sections.
> 
> One might be explicit that variables whose name merely begins with an
> underscore (as distinct from the special `_' variable identifier) behave
> just like variables whose name begins with a capital letter except for
> what warnings are produced.  (I.e. multiple occurrences in the same
> scope are considered to refer to the same variable.)

That sounds like another good idea.  Care to propose a patch for that too? ;-)

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list