Re: Non-determinant foreign predicate
Daniel Diaz <[email protected]>
| Newsgroups | gmane.comp.gnu.prolog.general |
|---|---|
| Message-ID | <[email protected]> |
Hi, Le 5 janv. 2013 à 17:07, mcculloch <[email protected]> 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.