<div dir="ltr">Thanks! I had no idea I should read that.<div><br></div><div>What kind of data structure does Mercury itself use to represent rules? I'd like to be able to search for information in any direction -- i.e., using the terminology of maps, any member of any relationship could be treated as a key or a value.</div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Nov 6, 2018 at 12:41 AM Julien Fischer <<a href="mailto:jfischer@opturion.com">jfischer@opturion.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Hi Jeff,<br>
<br>
On Mon, 5 Nov 2018, Jeffrey Brown wrote:<br>
<br>
> I want to write a program in Mercury that lets a user add (simple<br>
> nonrecursive) rules at runtime, like "Bob knows Mary" or "eukaryotes<br>
> use oxygen". Is it possible?<br>
<br>
If you mean, is it possible to do it as in Prolog, using assert/1 and<br>
retract/1 to modify the clause database, then no.  Mercury does not<br>
support that.<br>
<br>
In Mercury you would need to define your own data structures to hold the<br>
rules added a runtime (or use some of the ones in the standard library.)<br>
<br>
The section "Assert and retract" in the Prolog to Mercury transition<br>
guide has further details.<br>
<br>
Julien.<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Jeff Brown | Jeffrey Benjamin Brown</div><div dir="ltr"><a href="https://msu.edu/~brown202/" style="font-size:12.8px" target="_blank">Website</a>   |   <a href="https://www.facebook.com/mejeff.younotjeff" style="font-size:12.8px" target="_blank">Facebook</a>   |   <a href="https://www.linkedin.com/in/jeffreybenjaminbrown" style="font-size:12.8px" target="_blank">LinkedIn</a><span style="font-size:12.8px">(spammy, so I often miss messages here)   </span><span style="font-size:12.8px">|</span><span style="font-size:12.8px">   </span><a href="https://github.com/jeffreybenjaminbrown" style="font-size:12.8px" target="_blank">Github</a><span style="font-size:12.8px">   </span></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>