<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Nov 29, 2013 at 10:56 PM, Paul Bone <span dir="ltr"><<a href="mailto:paul@bone.id.au" target="_blank">paul@bone.id.au</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
On Google+ an entity named JekejekeLogicProgramming asked the following.<br>
<br>
    Dear All,<br>
<br>
    I am just reading:<br>
    <a href="http://www.mercurylang.org/information/doc-latest/mercury_ref/Trailing.html#Trailing" target="_blank">http://www.mercurylang.org/information/doc-latest/mercury_ref/Trailing.html#Trailing</a><br>
<br>
    Is there a Prolog API for the trailing. So that I can use functional<br>
    trailing  from within Prolog without much C programming. I only need to be<br>
    able to install a Prolog goal which is called once when the trail does an<br>
    undo.<br>
<br>
    Best Regards<br>
<br>
I asked him to confirm what he meant by Prolog, he meant Mercury.<br>
<br>
It should be possible to make this accessible through Mercury, provided that<br>
trail predicates are either allowed to be impure, or take an io state pair.<br>
Registering such predicates should have similar rules, which won't be<br>
onerous as the programmer will already need the io state or impurity for<br>
trailing to make sense at all.<br>
<br>
Is anyone aware of any problems with this?<br></blockquote><div><br></div><div>We've had a module in G12 platform that provides exactly this interface to the trail</div><div>for about six years now ;-)  I'm happy to make this available to others if there</div>
<div>is some need for it -- it requires some minor editing to detach it from the rest of</div><div>G12, but that shouldn't take long.</div><div><br></div><div>Cheers,</div><div>Julien.  </div><div><br></div><div><br></div>
<div><br></div><div><br></div><div><br></div><div> </div></div></div></div>