Subject: Re: [SWIPL] Calling more than one predicate

From: Jan Wielemaker <[email-masked]>
Date: Thu, 27 Sep 2001 10:06:39 +0200

On Tue, 07 Aug 2001, Nissim Broudo wrote:
>I've been using SWI-Prolog for a short amount of time and I completed one
>small project in inductive logic programming using SWI.  I'm very impressed
>with the package and its ease of use and extendibility with C.
>
>What's the feasibility of being able to call more than one predicate in
>future versions of SWI-Prolog ?  I would like to have 2 open predicates
>
>qid1 = PL_open_query(NULL, PL_Q_NORMAL, my_predicate_1, term1);
>qid2 = PL_open_query(NULL, PL_Q_NORMAL, my_predicate_2, term2);
>
>PL_next_solution(qid1);
>PL_next_solution(qid2);
>
>PL_close_query(qid1);
>PL_close_query(qid2);
>
>Nissim Broudo
>
>Department of Mathematics &
>Department of Molecular Genetics and Microbiology
>University of Florida

Trying this results in undefined behaviour.  The system is prepared to
have  multiple solving engines as used in the multi-threading version. 
It wouldn't be hard to launch a second solving engine in the same
thread, except many of the foreign function won't know what engine
you're talking about (there is no argument to specify this).  The
multi-threaded uses `thread-local data' to find out, but this is not
an option for the single threaded version.

	Regards --- Jan