[mercury-users] boolean expressions from semidet predicates

Nicholas Nethercote njn at csse.unimelb.edu.au
Sat May 13 02:02:27 AEST 2006


On Fri, 12 May 2006, Mark Brown wrote:

>>> It's only concrete syntax.  `X and Y' means the same thing as `and(X, Y)'.
>>
>> Which and/2 is this?  The one from bool.m?
>
> It's just a name, like `write_int', `++' or `foo'.  The meaning will of
> course depend on the context in which it is used, following the same
> overloading resolution rules as any other name.
>
>>> As for what they "are": `/\' is ISO-Prolog and `and' is an NU-Prolog
>>> extension.
>>
>> What are their types?
>
> The types, if they even have them, are determined from the context.  But
> these names can also be defined as typeclass names or user defined insts,
> for example, in which case the concept of type does not apply.  Again,
> they are just like any other names -- the fact that these particular names
> can be written in infix operator form is only concrete syntax, and is
> entirely orthogonal to the type system.

I'll try a different tack.  The following page of the Ref Manual lists 
Mercury's built-in operators:
http://www.cs.mu.oz.au/research/mercury/information/doc-latest/mercury_ref/Builtin-Operators.html#Builtin%20Operators

What does this table represent?  It has operators like '+', '++' and 'and', 
but then there are functions int.+/2 and string.++/2 and bool.and/2.  Is 
this table a relic from Mercury's Prolog heritage?

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