WAMpy: Efficient Synthesis of Prolog Programs in Python

📅 2026-10-02
📈 Citations: 0
✨ Influential: 0
📄 PDF
🤖 AI Summary
This work addresses the efficiency bottleneck of repeatedly generating and evaluating small candidate Prolog programs within Python by proposing an execution framework optimized for Prolog program synthesis. The core innovation lies in compiling Prolog clauses into NumPy array-based Warren Abstract Machine (WAM) instructions, coupled with a partial recompilation mechanism that supports fixed background knowledge. Furthermore, Numba just-in-time (JIT) compilation is integrated to accelerate performance-critical routines. Experimental results demonstrate that, on benchmarks involving repeated compilation and evaluation, the proposed framework achieves significantly superior end-to-end performance compared to SWI-Prolog invoked via the Janus interface.
📝 Abstract
We present WAMpy, a Python framework optimized for synthesizing Prolog programs. Unlike general-purpose Prolog systems, WAMpy targets workloads that repeatedly generate and evaluate small candidate programs. WAMpy compiles Prolog clauses into NumPy array-based WAM instructions and supports partial recompilation of hypotheses against fixed background knowledge. Performance-critical routines are accelerated using Numba just-in-time (JIT) compilation. In a benchmark of repeated compilation-and-evaluation workloads, WAMpy improves end-to-end performance compared with SWI-Prolog accessed from Python using Janus.
Problem

Research questions and friction points this paper is trying to address.

Prolog synthesis
program evaluation
WAM instructions
inductive logic programming
Python framework
Innovation

Methods, ideas, or system contributions that make the work stand out.

Program Synthesis
Prolog
WAM
NumPy
Numba JIT
🔎 Similar Papers
2024-08-22arXiv.orgCitations: 2
D
Dominik Magiera
Centre for Cognitive Science & Institute of Psychology, Technische Universität Darmstadt, Germany
L
Lukas Röhrig
Centre for Cognitive Science & Institute of Psychology, Technische Universität Darmstadt, Germany
Frank Jäkel
Frank Jäkel
TU Darmstadt