[mercury-users] New to mercury: structure reuse and efficiency

Maurizio Colucci seguso.forever at tin.it
Sat Jul 10 06:47:05 AEST 2004


On Monday 05 July 2004 15:57, Ralph Becket wrote:
> Maurizio Colucci, Monday,  5 July 2004:
> > On Monday 05 July 2004 01:49, Ralph Becket wrote:
> > > The intention is that the user will be able to write something like
> > >
> > > :- prolog type foo ---> bar ; baz(foo) ; quux(foo, foo).
> > >
> > > where unification of foo values will work just the way you'd expect
> > > them to if you were writing Prolog. ?This way the performance costs
> > > associated with "prolog" types are confined purely to those parts of
> > > your program that use them.
> >
> > Will this make the "term" type (in the mercury library) obsolete? Should
> > I still "invest" in it?
>
> The term type will still be useful.  Use of the new "Prolog types" will
> carry with it all the usual determinism-related problems associated with
> Prolog programs. 

I confess I am _dying_ to know what these determinism-related problems are. 
You also mention the existence of such problems in the tutorial, but I 
couldn't find any document which explains what they are...

> If your code is largely deterministic, use term.m.  If 
> your code is not, "Prolog types" may be a neater option.

Let me see if I get the difference: term.m requires you to bring along the 
bindings of variables, whereas the prolog style term will make that implicit.
Is that so?

Thanks!

Mau
--------------------------------------------------------------------------
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