[Flora-users] Calling Java from Flora-2

2 views
Skip to first unread message

Rangarajan Krishnamoorthy

unread,
Nov 9, 2018, 2:24:08 PM11/9/18
to flora...@lists.sourceforge.net
Hi,
Is there a way to call Java code (or C/C++ code) from Flora-2 (on Windows 64 bit)? ErgoAI appears to support this through the \e2j package.

Regards,
Rangarajan

_______________________________________________
Flora-users mailing list
Flora...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flora-users
Message has been deleted
Message has been deleted

Michael Kifer

unread,
Nov 9, 2018, 4:18:45 PM11/9/18
to flora...@lists.sourceforge.net, ergoai...@coherentknowledge.com



On 11/9/18 6:47 AM, Rangarajan Krishnamoorthy wrote:
Hi,
Is there a way to call Java code (or C/C++ code) from Flora-2 (on Windows 64 bit)? ErgoAI appears to support this through the \e2j package.

Regards,
Rangarajan


Flora-2 cannot call Java -- this feature is available only in ErgoAI. (But Java can call Flora-2 and Ergo, of course.)


Both Ergo and Flora-2 can call C/C++.  What you need to do is to create a C-module of XSB and then call its functions using @\prolog.

To write XSB's C-module, one needs to know XSB's C API, which is described in the XSB Manual, vol. 1, Chapter "Foreign Language Interface".

Being a C interface, it is quite low-level, one should add.

--

       --- michael


Michael Kifer

unread,
Nov 9, 2018, 6:26:22 PM11/9/18
to flora...@lists.sourceforge.net, ergoai...@coherentknowledge.com

I don't believe XSB currently can call Java. The needed code is not public at present, as far as I know (although this might change soon).

But XSB and Flora-2 can **call Java back** ie, call back the Java process that previously invoked XSB or Flora-2.



On 11/9/18 6:17 PM, Marc Hadfield wrote:

You may also want to look at the Java <--> XSB interfaces.  In this way you can have Java calling Flora2 as well as Flora2 calling Java via Flora2-->XSB-->Java.

================
Marc C. Hadfield
@MarcHadfield



On Fri, Nov 9, 2018 at 5:43 PM Rangarajan Krishnamoorthy <ra...@mmsindia.com> wrote:
Thanks. I got it.

Regards,
Rangarajan

_______________________________________________
Flora-users mailing list
Flora...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flora-users
_______________________________________________
Flora-users mailing list
Flora...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flora-users
Reply all
Reply to author
Forward
0 new messages