<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Feb 19, 2014 at 9:30 AM, Zoltan Somogyi <span dir="ltr"><<a href="mailto:zoltan.somogyi@runbox.com" target="_blank">zoltan.somogyi@runbox.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class=""><div class="h5"><br>
</div></div>There is no =\= operator in Mercury, because there is no need for one.<br>
<br>
In Prolog, the unification operator = operates on unevaluated terms. If you give it two<br>
arithmetic expressions, it will tell you whether they have the same structure, but not<br>
whether they evaluate to the same result. Arithmetic expressions are evaluated only<br>
in special contexts, such as the operands of =\= or the right hand side of the "is" operator.<br>
<br>
In Mercury, function calls (such as calls to the arithmetic functions) are evaluated wherever<br>
they happen to be. So in Mercury, you use the usual equality operator = where in Prolog<br>
you would use =\=.<br>
<br>
Note that Mercury is NOT a Prolog dialect. Semantically, it is significantly different from<br>
Prolog in several respects; this is one. Attempts to transliterate nontrivial Prolog programs<br>
into Mercury won't work if the person doing the transliterating doesn't know the differences.<br>
<br>
As for the list of operators in the Mercury language reference manual, some are built-in<br>
constructs of the language, and are explained in the relevant section of that manual,<br>
and some represent functions in the Mercury standard library, and are documented<br>
in the library's reference manual.<br></blockquote><div><br></div><div>It's worth pointing out here that the standard library does include a prolog module, </div><div>that is intended to assist with porting Prolog programs to Mercury. It does define the</div>
<div>=\= operator appropriately for Mercury (i.e. it's just a synonym for '=').</div><div><br></div><div>See: <<a href="http://www.mercurylang.org/information/doc-latest/mercury_library/prolog.html#prolog">http://www.mercurylang.org/information/doc-latest/mercury_library/prolog.html#prolog</a>></div>
<div>for further details.</div><div><br></div><div>Cheers,</div><div>Julien.</div><div><br></div><div><br></div><div><br></div><div> </div></div></div></div>