users-prolog
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to get the return value from gprolog in C?


From: daveti
Subject: How to get the return value from gprolog in C?
Date: Sat, 23 Nov 2013 15:29:55 -0800 (PST)

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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]