On Bridging Prolog and Python to Enhance an Inductive Logic Programming System
summary
A Prolog–Python bridge implements a C++ middle layer and SWIG type maps plus C glue to convert terms bidirectionally, exporting C++ classes (up_term, up_engine, up_atom, up_error) as Python classes; error objects are language-neutral and term conversions preserve numeric types. Demonstrations include an XML reader adapted in about one week and an ILP enhancement that turns bottom clause → graph and renders it with visualization with pandas+D3, working well if data moves in bulk to avoid per-call overhead.
AI-written summary · about
chapters (14)
- 0:00Bridging Prolog and Python
- 2:13Interface architecture design
- 5:24C++ interface classes
- 8:38Swig and type mapping
- 11:49Handling terms and strings
- 13:15Atoms versus strings decision
- 15:20Prolog to Python calls
- 16:26Visualizing ILP results
- 19:57Python Prolog interpreter
- 21:02ILP use cases
- 23:36Number handling
- 25:02Potential applications with large language models
- 26:29Interactive ILP integration
- 27:31Performance for data transfer
related talks
01h 01mExtend and Embed Python with C++
25mHow to bring your C++ project to Python land
36mPython, C, C++, and Fortran Relationship Status: It’s Not That Complicated
33mParens for Python
36mA lightweight approach for accessing Python modules from Gambit Scheme
43mPL/Python -- Python inside the PostgreSQL RDBMS
30mDemystifying Python’s Internals: Diving into CPython by implementing...
21mHiPy: Extracting High-Level Semantics From Python Code For Data Processing
