How to get the return value from gprolog in C?

daveti <[email protected]>
Newsgroups gmane.comp.gnu.prolog.general
Message-ID <[email protected]>
Hi there,

I am trying to call gprolog in my C code. Instead of getting the solutions,
wonder if I could get the gprolog function output (true/false) directly in
my C code. Below is the example:
Based on - 
http://gprolog.univ-paris1.fr/manual/html_node/gprolog072.html

Given the pl file:
parent(bob,   mary).
parent(jane,  mary).
parent(mary,  peter).
parent(paul,  peter).
parent(peter, john).

anc(X, Y):-
        parent(X, Y).

anc(X, Z) :-
        parent(X, Y),
        anc(Y, Z).

I know how to retrieve the solution from anc(X,john). However, if the query
is anc(bob,john), then how could I retrieve the return value (true) from the
gprolog in my C code? I have gone thru gprolog.h for a while. But it seems
there is not such a func used to get the return value...


Thanks,
Dave




--
View this message in context: http://gnu-prolog.996310.n3.nabble.com/How-to-get-the-return-value-from-gprolog-in-C-tp1166.html
Sent from the Users mailing list archive at Nabble.com.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.