cs.PLOct 2, 2026

WAMpy: Efficient Synthesis of Prolog Programs in Python

Authors: Dominik Magiera, Lukas Röhrig, Frank Jäkel

Organizations: Centre for Cognitive Science & Institute of Psychology, Technische Universität Darmstadt, Germany

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.

Figures & tables

Explore similar work

CardsList
  1. Program-as-Weights: A Programming Paradigm for Fuzzy Functions

    Jul 2, 2026Wentao Zhang, Liliana Hotsko, Woojeong Kim +3LLM-Based Program SynthesisEfficient Language Model Inference

  2. Property-Guided LLM Program Synthesis for Planning

    May 15, 2026André G. Pereira, Augusto B. Corrêa, Jendrik SeippSymbolic PlanningCounterexample-Guided Refinement

  3. ReaComp: Compiling LLM Reasoning into Symbolic Solvers for Efficient Program Synthesis

    May 6, 2026Atharva Naik, Yash Mathur, Prakam +2Symbolic ReasoningLLM-Based Program Synthesis