How to interface between C and gprolog?
I am in the somewhat unfortunate position of interfacing C and Prolog code. We have some data collection code in C, and some analysis code in Gnu-Prolog. So what is the best method to interface C and gprolog? I am currently trying to use the C library included in the gprolog package to call Prolog from C.
Note: I am working on ubuntu machines.
One of the problems I was facing was how to iterate over a list. I final开发者_高级运维ly realized that though you could make a list out of n elements, you had to iterate over it in Prolog fashion - get the head and get the tail and recurse.
There's an entire chapter called Interfacing Prolog and C in the GNU-Prolog manual. I expect that you've seen this since you mention the manual in your comment, but since you seem to be asking for more information than what's given there, perhaps you could be more specific about where you're having trouble?
精彩评论