Flora-2 in Python, and a graphical IDE for Flora-2

12 views
Skip to first unread message

Jason Morris

unread,
Mar 28, 2019, 2:45:54 PM3/28/19
to ErgoAI, Flora-2, and XSB Users Forum

Just came across this paper my Markus Schatten from 2007 on integrating Flora-2 with Python, making it possible to express facts, rules, and queries directly in Python code, and translate Python objects to Flora-2 primitives.

https://www.academia.edu/459408/Reasonable_Python_or_How_to_Integrate_F-Logic

Also discovered pyxf, by the same author, which is a simple wrapper for accessing the Flora-2 reasoner from inside Python code.


I have a need for something like is described in "Reasonable Python" for generating Flora-2 primitives out of Python objects.  That, plus pyxf, would make it a lot easier to integrate Flora-2 into my Python projects.

Does anyone have something like what is described in the paper that they could share?

Also, I'm working, occasionally in my limited free time, on a graphical IDE based on Google's Blockly for Flora-2 development, aimed at non-technical legal users. It is at www.blawx.com.

If anyone on the list is interested in taking a look at it and giving me some feedback, I'd appreciate it. There is a demo video, and a working proof of concept.

Jason

Michael Kifer

unread,
Mar 28, 2019, 3:29:16 PM3/28/19
to ErgoAI, Flora-2, and XSB Users Forum
Hi Jason,
Ergo has an interface to Python called pyergo. It is described in the Guide to Ergo Packages. Check if it meets your requirements.
Your IDE project looks interesting - will take a look, thanks.
Best
Michael

Jason Morris

unread,
Mar 28, 2019, 3:36:15 PM3/28/19
to Michael Kifer, ErgoAI, Flora-2, and XSB Users Forum
Thanks, Michael: I was looking for something for Ergo-Lite, not ErgoAI. I presume pyergo is licensed with ErgoAI, but let me know if I'm wrong.

I managed to contact the author of the paper, who pointed me at https://sourceforge.net/projects/reasonablepy/

The code for reasonable python is there, which he admits is well out of date at this point. But if you're looking for a way to use Ergo Lite from inside Python, it looks like a good starting place.

Jason


--
You received this message because you are subscribed to the Google Groups "ErgoAI, Flora-2, and XSB Users Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ErgoAI-Flora2-XSB...@coherentknowledge.com.
To post to this group, send email to ErgoAI-Flor...@coherentknowledge.com.
Visit this group at https://groups.google.com/a/coherentknowledge.com/group/ErgoAI-Flora2-XSB-forum/.
To view this discussion on the web visit https://groups.google.com/a/coherentknowledge.com/d/msgid/ErgoAI-Flora2-XSB-forum/c6ccd85f-6c88-4587-8685-b9b26c7c6429%40coherentknowledge.com.

Michael Kifer

unread,
Mar 28, 2019, 3:40:41 PM3/28/19
to Jason Morris, ErgoAI, Flora-2, and XSB Users Forum

Yes, we have not released pyergo for Flora-2.

Try Reasonable Python.


We believe pyergo is much more polished and complete, but maybe RP will be enough for your purposes and you will be able to make it work.

--

       --- michael


Jason Morris

unread,
Apr 1, 2019, 11:12:24 AM4/1/19
to Michael Kifer, ErgoAI, Flora-2, and XSB Users Forum
Hi, Michael:

I actually ended up getting further, faster, with pyxf. Reasonable Python was helpful in an abstract sense, but I didn't end up using any of it's code.

Should have a proof of concept demo up by later this morning. Anyone interested in checking it out, let me know I'll pass along the link.

Regards,

 

Jason Morris
Round Table Law
ja...@roundtablelaw.ca


15C, 2016 Sherwood Drive
Sherwood Park, AB T8A 3X3 (map)
Phone: 1.855.803.1785 Ext: 100 (toll-free)
Fax: 1.855.803.1785 (toll-free)
OpenPGP signature
www.roundtablelaw.ca


Jason Morris

unread,
Apr 1, 2019, 2:37:19 PM4/1/19
to Michael Kifer, ErgoAI, Flora-2, and XSB Users Forum

Regards,

 

Jason Morris
Round Table Law
ja...@roundtablelaw.ca


15C, 2016 Sherwood Drive
Sherwood Park, AB T8A 3X3 (map)
Phone: 1.855.803.1785 Ext: 100 (toll-free)
Fax: 1.855.803.1785 (toll-free)
OpenPGP signature
www.roundtablelaw.ca


Michael Kifer

unread,
Apr 1, 2019, 10:33:27 PM4/1/19
to ErgoAI-Flor...@coherentknowledge.com

thanks Jason,


This looks good. Interesting to see how far you can get with this graphical approach.


Also good to know that pyxf has been fixed and now works with Flora-2.

I took another look at it and it seems pretty good.

However, it can exchange only strings between Python and logic engines -- not numbers, function terms, or other data types. So, the user has to do conversion manually, which limits the usability.


Also, talking to spawned shells is going to be slow for queries with large numbers of answers and when there are many queries.


ErgoAI's Python interface solves these problems.

--

       --- michael


Reply all
Reply to author
Forward
0 new messages