[HAL-dev] Re: [m-dev.] Solver types in Mercury - meeting notes and comments

Fergus Henderson fjh at cs.mu.OZ.AU
Mon Feb 16 14:00:00 AEDT 2004

On 16-Feb-2004, Zoltan Somogyi <zs at cs.mu.OZ.AU> wrote:
> On 16-Feb-2004, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> > So the correct example is
> > 
> >  	:- pred p is semidet.
> >  	p :- 1 >= list.length(std_util.solutions(
> >  		(pred(Term::out) is nondet :- Term = f(c), q(Term)))).
> I don't see how that could be replaced with true with or without solver
> types being involved.

It can be replaced with true because it is a law of logic that Term = f(c)
can have at most one distinct ground solution.

(I presume you meant "why", not "how".  If you really meant "how", then
my answer is that it could be either by a special pattern match in the
compiler that detects exactly that pattern, or as a consequence of some
more general optimization.)

> I think one disconnect between you two is that in this context, asking
> "what is the declarative semantics" is a in a sense the wrong question.

I don't agree.  Unless the code is impure, it should always have a
declarative semantics.

> We are providing facilities for building solvers, and it is up to the
> *programmer of the solver* to ensure that the implementation of the
> solver faithfully implements a declarative semantics.

I agree; however, we must provide the facilities in such a way as to make
it *possible* for the programmer of the solver to do that, and I don't think
Ralph's proposal satisfies that requirement.

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-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au

More information about the developers mailing list