[mercury-users] choicepoint IDs in the C interface

Julien Fischer juliensf at csse.unimelb.edu.au
Wed Apr 29 20:14:36 AEST 2009


On Tue, 28 Apr 2009, Peter Biener wrote:

> I have a question about the foreign interface with C. The reference manual 
> says that the MR_current_choicepoint_id() function returns the ID of the most 
> recent choicepoint. I tried it with a very simple code, just wrote a 
> predicate in C that writes the id to the output. If this predicate called 
> several times, it writes different choicepoint IDs each time. Since in this 
> code every predicate, including print/3 and nl/2 are deterministic, I think I 
> should always get the same id. Instead I got this output:
>
> a1
> b1: 21
> a2
> b2: 25
> b3: 26
> a3
>
> Can you help me on what I think wrong?

It appears to be a bug; the choicepoint id is not being reset
correctly after the execution of some if-then-elses inside io.print/3.

We will take a look at it.

Cheers,
Julien.
--------------------------------------------------------------------------
mercury-users mailing list
Post messages to:       mercury-users at csse.unimelb.edu.au
Administrative Queries: owner-mercury-users at csse.unimelb.edu.au
Subscriptions:          mercury-users-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the users mailing list