[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Non-determinant foreign predicate
From: |
Daniel Diaz |
Subject: |
Re: Non-determinant foreign predicate |
Date: |
Mon, 7 Jan 2013 09:11:54 +0100 |
Hi,
Le 5 janv. 2013 à 17:07, mcculloch <address@hidden> a écrit :
> I am writing an interface to mongoDB from GNU Prolog using mongo's C driver.
> I want a non-determinant predicate to access query data via a C routine that
> takes care of its own pointer called a cursor. The cursor structure is
> defined outside of the foreign function, so I don't need to call
> Pl_Get_Choice_Buffer or Pl_Get_Choice_Counter. I will call
> Pl_No_More_Choice, but only when the cursor has reached the end of its data.
>
> Does anyone know how prolog knows that a foreign predicate is
> non-determinate. Is it the "choice_size" in the foreign command, or is it
> something else? I need my foreign predicate to be non-determinate even if
> it doesn't need to use a buffer.
You are right, you need to specify the choice_size option for a non-det foreign
predicate. You can pass 0 if you don't need an explicit storage.
Daniel
--
Ce message a ete verifie par MailScanner
pour des virus ou des polluriels et rien de
suspect n'a ete trouve.