bug in scoping for higher order terms
Lee Naish
lee at cs.mu.OZ.AU
Tue Mar 9 12:23:13 AEDT 1999
Fergus Henderson <fjh at cs.mu.OZ.AU> writes:
> > The standard Prolog solution is to treat as quantified all variables
> > appearing in the first argument of setof. [...]
>Actually it's more complicated than that.
>(Perhaps that's what you mean by saying that it is
>"not done properly and its all not quite logical" ;-)
Yes.
>My point here is that Prolog sometimes locally quantifies the arguments and
>sometimes doesn't, depending on the instantiation of variables at runtime,
>so it doesn't set any clear precedent.
I believe its normally a mistake to use variables in the first argument
of setof/3 or '^'/2 (existential quantification in DEC10 Prolog) which
also appear in a wider scope. The quantification problems are just one
of many reasons why setof/3 is not logical. If you are interested, see
@inproceedings{naish:solns:85,
author = {Naish, Lee},
title = {All solutions predicates in {Prolog}},
booktitle = {Proceedings of the Second IEEE Symposium on
Logic Programming},
address = {Boston, Massachusetts},
year = {July 1985},
pages = {73--77},
comment = {Technical report 84/4, Department of Computer Science,
University of Melbourne}
}
> > Its cleaned up in NU-Prolog's solutions/3,
>Actually this is only true of the NU-Prolog compiler.
>The NU-Prolog interpreter
... has various (documented) bugs and limitations. Perhaps this is a
precedent for a Mercury "bug in scoping for higher order terms"! Or
perhaps its just irrelevant.
lee
More information about the developers
mailing list