Hi<div><br></div><div>I'm in the middle of translating into Mercury some simple Prolog from the book "the Art Of Prolog" , namely Program 2.1:  Defining family relationships :<br></div><div><br></div><div><div>
<font class="Apple-style-span" face="'courier new', monospace">        uncle(Uncle,Person) :-</font></div><div><font class="Apple-style-span" face="'courier new', monospace">                brother(Uncle,Parent), parent(Parent,Person).</font></div>
</div><div><br></div><div>And, again, I do not find much help in the documentation.</div><div><br></div><div>First , I put this is interface :</div><div><div><font class="Apple-style-span" face="'courier new', monospace">:- type person.</font></div>
<div><br></div><div>But, then, what to put in the implementation, which would the equivalent of an empty class in Java ?</div><div><br></div><div><br></div><div>A 2nd problem is with pure database predicates (primitives), like brother. I put this :</div>
<div><div><font class="Apple-style-span" face="'courier new', monospace">:- pred brother( person, person) is multi . </font></div><div><font class="Apple-style-span" face="'courier new', monospace">:- mode brother( in, out ) is multi .</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">:- mode brother( out, in ) is multi .</font></div></div><div><br></div><div>But the compiler is not happy :</div><div><div>Error: no clauses for predicate `brother'/2.</div>
</div><div><br></div><div>Let's suppose that brother/2 is provided by external facts .</div><div><br></div>-- <br>Jean-Marc Vanel<br>Consulting, services, training,<br>Rule-based programming, Semantic Web<br><a href="http://jmvanel.free.fr/">http://jmvanel.free.fr/</a><br>
EulerGUI, a turntable GUI for Semantic Web + rules, XML, UML, eCore, Java bytecode<br>+33 (0)6 89 16 29 52 -- +33 (0)1 39 55 58 16<br>( we rarely listen to voice messages, please send a mail instead )<br>
</div>