Newsgroups: comp.lang.prolog
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!satisfied.apocalypse.org!news.mathworks.com!uunet!world!amzi
From: amzi@world.std.com (Amzi!)
Subject: Re: C<>Prolog Interfacing.
Message-ID: <D67swB.2p1@world.std.com>
Keywords: Prolog, C
Organization: The World Public Access UNIX, Brookline, MA
References: <3l9997$1r0@bright.ecs.soton.ac.uk>
Date: Wed, 29 Mar 1995 18:33:46 GMT
Lines: 38

pwg92@ecs.soton.ac.uk (Peter Gibbs) writes:

>I'm trying to get a prolog compiler that will allow me to use a 
>C program to interface it. We already have sicstus here which would
>appear to do the job, but unfortunately it is no longer very reliable
>(i'm told its been patched too much, so its all a bit of a mess).
>Although many systems have C-Prolog interfaces, most of them rely on
>the C containing most or all of the prolog program.
>What i require (for my final project incidentally), is a system where
>the C can be used to 'call' and pass information to and from a Prolog
>program. The prime example of this is the Runtime System capability
>of SICStus prolog.

>Anyone have any ideas?

Cogent Prolog provides a C calling interface that looks very much like a 
listener session.  You call a term (which can be a string) and then get 
the arguments, which is trivial for strings and numbers, and a little 
more work for structures and lists.  You can redo the call to retrieve
subsequent results.

There is a small sample of code in http://world.std.com/~amzi/ -- look 
in the Cogent Prolog description.  There is also an extensive Visual 
Basic and Cogent Prolog demo referenced there.

Cogent runs under Windows, DOS, NT, OpenVMS and OSF/1.  If you'd like more 
information, please contact us.

Regards,
Mary Kroening
amzi@world.std.com


-- 

    Amzi! inc.                             Cogent Prolog
    40 Samuel Prescott Drive          + Logic Server API
    Stow, MA 01775                   Active Prolog Tutor
