April 19th, 2003, 09:43 AM
execute Prolog from C program
I was wondering how I can call a Prolog query from a C program.
The Prolog compiler that I'm using is LPA's WinProlog and I'm using code warrior for the C code.
I would like to be able to query the prolog code and get back a result.
April 19th, 2003, 12:50 PM
My immediate response is to tell you to read WinProlog's documentation for that. I say that, because such capabilities rely more on the implementation than on general language features. For example, my only prolog experience was with Borland's Turbo Prolog; Turbo Prolog could call C functions, but a C program could not call Turbo Prolog.
I just did a quick Google on WinProlog and found this statement at http://www-lp.doc.ic.ac.uk/UserPages.../lpa/lpa1.html :
So that tells me that it can be done. That's half the battle.
At the company's website, http://www.lpa.co.uk/win_det.htm , I read:
So somewhere there has to be an API defined for that DLL and the only place I can think of would be in the documentation somewhere.
Some of the messages in the comp.lang.prolog newsgroup mention WinProlog, so that might be a place to post your question as well. I usually access the newsgroups through Google. Google also has a search engine for the newsgroups, so you can search through past messages.
Last edited by dwise1_aol; April 19th, 2003 at 12:53 PM.