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

Ralph Becket rafe at cs.mu.OZ.AU
Tue Jul 6 08:57:44 AEST 2004


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.  If your code is largely deterministic, use term.m.  If
your code is not, "Prolog types" may be a neater option.

> (I am asking because find a bit difficult to understand 
> the usage of "term")

In the vernacular, a `term' is either a variable or a functor, where a
functor is a pair consisting of a name and a list of subterms (so terms
describe tree structures with named branch nodes).  We use `term' to
refer to a piece of syntax or concrete representation.

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