Newsgroups: comp.lang.prolog
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!news.mathworks.com!news.alpha.net!uwm.edu!lll-winken.llnl.gov!enews.sgi.com!decwrl!tribune.usask.ca!sue!borealis!smithd
From: smithd@borealis.cs.uregina.ca (Donald Smith)
Subject: Re: Prolog + C
Sender: news@sue.cc.uregina.ca
Message-ID: <smithd.783229291@borealis>
Date: Thu, 27 Oct 1994 03:41:31 GMT
References: <1994Oct20.224147.13672@wisipc.weizmann.ac.il>
Organization: University of Regina
Lines: 28

lcmeri@dapsas1 (Meri Tania) writes:

>Hi All

>I'm in a need to connect a prolog function into a C program.
>I'm working on a PC platform useing Borlands Turbo Prolog v2
>and Borland C 4.02
>How can this be donw ? I went over the Prolog books and didnt find nothing
>on this subject. I want a function that will get some parms and return
>one parm. anyone ?

>Bye


 Look for a Warren Abstract Machine (WAM).  Most implementations can
take Prolog code and covert it into a intermediate C code.  You
could then simply port the C code into your program.
 There are a couple of dis-advantages though.  First, there is a lot
of overhead in a WAM, and second, the WAM is pretty confusing and
depending on the implementation may be difficult to configure the way
you want to.

 I'm working on a WAM, but it's very rudimentary right now, and wouldn't 
be much help.  But, there are plenty on the net if you look.

 Of course, there may be a much easier way that I don't know about :)


