Re: [eclipse-users] Any way to handle breal in the Java interface?

From: Kish Shen <kisshen_at_...5...>
Date: Tue, 14 Aug 2007 00:22:26 +0100
Hi Chuck,

One of the design aims of the generic high-level external language 
interface (of which Java is one instance) is that only simple data 
should be passed between the external language and ECLiPSe -- you should 
keep both complex data structures, and ECLiPSe specific data types such 
as bounded reals on the ECLiPSe side.

The idea is that you do not call ECLiPSe goals from the external 
language the same way you would in the interactive toplevel. You should 
instead write some code in ECLiPSe that will translate such ECLiPSe 
specific data type into more standard data types (e.g. the two bounds of 
a bounded real), before passing this back to Java.

(On a related topic, we often get questions about how complex data 
structures, such as complex constraints, could be built using the Java 
interface. This can be done, but the better way is to *not* build such 
data structures on the Java side at all, but instead do it on the 
ECLiPSe side, and call a simple goal from Java side to invoke the 
ECLiPSe code that will be used to build the constraints)

Some of the design choices for the external language interface was 
described in a paper: "A High-Level Generic Interface to External 
Programming Languages for ECLiPSe" in PADL 2002. A postscript version of 
this paper is available at:

http://eclipse.crosscoreop.com/reports/index.html

(under the Prolog and Tools section)

There are some examples of how to use the interface (Tcl/Tk is used as 
the example external language, but the general principles applies to 
Java as well) in the paper.

Cheers,

Kish


Lutz, Charles D wrote:
>
> Hi folks,
>
> I’m working with the Java-ECLiPSe interface to try to parse data returned
>
> from posted goals. I am using calculations involving reals with the ic 
> library
>
> as described in Chapter 9, “Working with real numbers and variables.”
>
> I understand that breal does not have a corresponding Java data type nor
>
> a representation in the EXDR format. Since I can’t use rpc to get the 
> values
>
> of instantiated breal variables, I’m thinking that the only recourse 
> is to grab
>
> ECLiPSe’s raw output and parse it for variable value reports, but I 
> figured I
>
> should ask first!
>
>
> Thanks,
>
> **Chuck Lutz**
>
> Lockheed Martin
>
> Systems of Systems Engineering
>
> BMC4I Modeling and Simulation
>
> Moorestown, NJ
>
> (856)638-7234 (office)
>
> charles.d.lutz_at_...53... <mailto:charles.d.lutz@...53...>
>
> “A graphic is never an end in itself; it is a moment
>
> in the process of decision making.”
> - Jacques Bertin
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> ECLiPSe-Users mailing list
> ECLiPSe-Users_at_...2...
> http://www.crosscoreop.com/mailman/options/eclipse-users
>   
Received on Tue Aug 14 2007 - 00:22:45 CEST

This archive was generated by hypermail 2.3.0 : Tue Apr 16 2024 - 09:13:19 CEST