embedded prolog in C 
Author Message
 embedded prolog in C

Hi guys,

I am just getting started on this so I can't really go into too much
detail, but I need to build an expert system in prolog, and do the user
interface for it in C.  Building the expert system is not that big of a
deal and I am pretty sure on the prolog code, but I don't know much at all
about embedding that to C.  I AM a much much better in C than in prolog,
but I can't seem to find much on the web about this.
After doing some research, I found that I need the include file

SWI-Prolog.h

but SWI's sight only has the object oriented version, SWI-cpp.h

Does anybody know a good source of info on this, or even better, give me
an overview of how to go about embedding the prolog code into C?  The
biggest thing that's baffeling me is which program is responsible for the
actual compiliation of code, my C compiler, or SWI?
Any help about this is greatly appreciated. thank you.

Arie



Mon, 10 May 2004 09:38:03 GMT  
 embedded prolog in C

Quote:

>Hi guys,

>I am just getting started on this so I can't really go into too much
>detail, but I need to build an expert system in prolog, and do the user
>interface for it in C.  Building the expert system is not that big of a
>deal and I am pretty sure on the prolog code, but I don't know much at all
>about embedding that to C.  I AM a much much better in C than in prolog,
>but I can't seem to find much on the web about this.
>After doing some research, I found that I need the include file

>SWI-Prolog.h

SWI-Prolog.h is distributed with each copy of the system in the
include subdirectory.  SWI-cpp.h is the C++ wrapper and used to
be distributed as a seperate package (actually a real C++ programmer
(Volker Wysk) is currently revising the C++ interface).

Quote:
>but SWI's sight only has the object oriented version, SWI-cpp.h

>Does anybody know a good source of info on this, or even better, give me
>an overview of how to go about embedding the prolog code into C?  The
>biggest thing that's baffeling me is which program is responsible for the
>actual compiliation of code, my C compiler, or SWI?

Whichever you prefer.  You can do everything yourself using your standard
C tools or you can give part of the job to plld, a front-end that knows
how to call the C-compiler and linker.  The C-compiler is quite trivial
(plld justs add a -I to the include directory, so the correct SWI-Prolog.h
is found).  The linker is a bit more hairy.  The manual gives an overview.
The twiki web reachable through the home-page adds details on a number
of platforms.  You can run plld -v ... to see what it is doing.

Quote:
>Any help about this is greatly appreciated. thank you.

        --- Jan


Mon, 10 May 2004 18:19:30 GMT  
 embedded prolog in C
You might look at http://www.trolltech.com
They might (no guarantees though), have what you need.
Quote:

> Hi guys,

> I am just getting started on this so I can't really go into too much
> detail, but I need to build an expert system in prolog, and do the user
> interface for it in C.  Building the expert system is not that big of a
> deal and I am pretty sure on the prolog code, but I don't know much at all
> about embedding that to C.  I AM a much much better in C than in prolog,
> but I can't seem to find much on the web about this.
> After doing some research, I found that I need the include file

> SWI-Prolog.h

> but SWI's sight only has the object oriented version, SWI-cpp.h

> Does anybody know a good source of info on this, or even better, give me
> an overview of how to go about embedding the prolog code into C?  The
> biggest thing that's baffeling me is which program is responsible for the
> actual compiliation of code, my C compiler, or SWI?
> Any help about this is greatly appreciated. thank you.

> Arie



Mon, 10 May 2004 19:21:51 GMT  
 embedded prolog in C
plld seems to be what I'm looking for!
I spent many hours last night trying to compile a sample program from my
home computer, but ran into many problems with vc++'s enviromental
variables setup, but it seems to be working now. now all I need is to
learn how to do the actual coding =\  

thank you for your response!



Tue, 11 May 2004 02:36:37 GMT  
 embedded prolog in C
I have a similar problem (I think)...

I'm using Visual C++ 6. In refman to SWI Prolog I've found that SWI-prolog.h
must be included, and several functions can be used (PL_query_open, ...).
The problem occures when I'm linking my project. There are no code for these
functions. What should I do? Should Prolog be working while linking or
running C application?
Please help.
Mike



Thu, 20 May 2004 18:36:26 GMT  
 embedded prolog in C

Quote:

>I have a similar problem (I think)...

>I'm using Visual C++ 6. In refman to SWI Prolog I've found that SWI-prolog.h
>must be included, and several functions can be used (PL_query_open, ...).
>The problem occures when I'm linking my project. There are no code for these
>functions. What should I do? Should Prolog be working while linking or
>running C application?

You should link against libpl.dll, which can be found in the lib
directory of the distribution. When running you should make sure the
DLL's of the bin-directories can be found. Best add this directory to
%PATH%, the include directory to %INCLUDE% and the lib directory to
%LIB%.  See also plld.exe and the SWI-Prolog twiki web.

        Cheers --- Jan



Fri, 21 May 2004 18:19:25 GMT  
 embedded prolog in C



Quote:
> See also (...) the SWI-Prolog twiki web.

Thanks for help, but I still need more information :(
Where can I find theat "SWI-Prolog twiki web" ? Is  it a www site?

Greets Mike.



Sat, 22 May 2004 17:27:36 GMT  
 embedded prolog in C

Quote:



>> See also (...) the SWI-Prolog twiki web.

>Thanks for help, but I still need more information :(
>Where can I find theat "SWI-Prolog twiki web" ? Is  it a www site?

http://gollem.swi.psy.uva.nl/twiki/pl/bin/view/Main/WebHome

(linked from the SWI-Prolog home page)

        --- Jan



Sat, 22 May 2004 18:34:39 GMT  
 
 [ 10 post ] 

 Relevant Pages 

1. Prolog as Intro CS Language

2. to CS: or not to CS: in F-PC assembler

3. SWI Prolog Chatterbot Embedded in HTML??

4. Embedded Application: C++ and SWI-Prolog

5. Embedded prolog in c++

6. Embedded Prolog?

7. looking for embedded prolog engine in Java

8. embedding a prolog interpreter

9. Embedding Prolog into DLLs

10. ?Prolog and embedded systems

11. assert and retract in embedded prolog systems

12. Prolog in embedded control

 

 
Powered by phpBB® Forum Software