Re: [eclipse-users] eclipse C API

From: Kish Shen <kisshen_at_cisco.com>
Date: Thu, 13 Sep 2007 14:29:48 +0100
Hi Carlos,

It is probably going to be a lot of work to try to embed ECLiPSe into 
Python. The proper way to do this is to implement a Python to ECLiPSe 
high-level interface (i.e. a variation of the Java/Tcl interface).

Without this interface, my guess is that it would actually be easier for 
you to use the Java interface to ECLiPSe, rather than the much lower 
level C interface, assuming Python does have a Java interface.

Carlos Gonzalez-Cadenas wrote:
> Hi,
>
> I'm trying to use the C API to embed ECLIPSE in Python. After reading 
> the embedding documentation on the website, it's not clear to me what 
> functions I have to call to do the following, as examples are mostly C++:
>
I think there are some C examples in the examples directory 
(<ECLiPSe>/doc/examples). Also, the ECLiPSe libraries which does not do 
everything in ECLiPSe also uses C (e.g. ic, eplex, dbi, ...), and you 
may want to also take a look at those (I think some of them do `cheat' 
and uses things not in the official interface, though).
> 1) install modules containing my predicates in ECLIPSe (¿do i have to 
> do this by API or simply deploying these modules somewhere in eclipse?)
In general, you should try to do as much as possible in each language, 
and keep the communication between them as simple as possible. In 
particular, you should not try to construct complex data structures of 
one language in the other (doubly so for you as you need to map them 
from C/Java to Phyton)
> 2) query ECLIPSE with some goal based on the predicates I've deployed 
> before.

In C, you would probably use something like ec_post_goal() to post your 
goal to ECLiPSe for evulation. I repeat: you should keep this as simple 
as possible, and do as much as you can in the ECLiPSe code you write 
(and which you load into ECLiPSe before you make your calls).
> 3) obtain more results (delayed goals)
>
How does the delay goals represent your result? It would be rather 
difficult to transfer delayed goals out of ECLiPSe, as they are part of 
the ECLiPSe state, and is pretty meaningless outside of ECLiPSe. Rather, 
you should have more ECLiPSe code that will decode what your delayed 
goals represent, and transfer this information out, rather than the 
delayed goals.
> Can you help me with that? Do you have some C examples?
>
> Thank you very much in advance
>
> Carlos
> ------------------------------------------------------------------------
>
> _______________________________________________
> ECLiPSe-Users mailing list
> ECLiPSe-Users_at_crosscoreop.com
> http://www.crosscoreop.com/mailman/options/eclipse-users
>   
Cheers,

Kish
Received on Thu Sep 13 2007 - 14:30:32 CEST

This archive was generated by hypermail 2.2.0 : Thu Feb 02 2012 - 02:31:58 CET