[m-dev.] Solver types: non-canonical types, `any' insts, equality

Fergus Henderson fjh at cs.mu.OZ.AU
Tue May 4 20:19:53 AEST 2004

On 29-Apr-2004, Zoltan Somogyi <zs at cs.mu.OZ.AU> wrote:
> Fergus and I agreed then that
> the right way to solve the problem is to add to Mercury a new syntactic
> construct that effectively does what the promise_only_solution wrapper does
> in Fergus's code above, but with a much more lightweight syntax (similar to
> quantification) and implemented as a compiler builtin (the implementation is
> after all trivial: a noop).

Just to add a little bit to Zoltan's comment: the sort of syntax that
I was thinking of is something that Lee Naish suggested to me a long
time ago.  Lee proposed something that was a bit like a Prolog if-then
or if-then-else, but with a slightly different syntax (I think it used
a different operator, maybe "=->", instead of "->".)  Declaratively,
it had the same meaning semantics as Mercury/NU-Prolog if-then-else,
but with an additional promise that for every solution of the condition,
there was exactly one solution for the "then" part.  This promise would
allow the compiler to prune away subsequent solutions to the condition,
for example by compiling it like a Prolog if-then-else.

Fergus Henderson                    |  "I have always known that the pursuit
                                    |  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