Hostname: page-component-5db58dd55d-688nx Total loading time: 0 Render date: 2026-07-09T17:38:57.973Z Has data issue: false hasContentIssue false

ProDebug: An Automated Debugging System for Prolog

Published online by Cambridge University Press:  06 July 2026

RICARDO BRANCAS
Affiliation:
Universidade de Lisboa Instituto Superior Técnico, Portugal INESC-ID, Portugal (e-mails: ricardo.brancas@tecnico.ulisboa.pt, vasco.manquinho@inesc-id.pt)
VASCO MANQUINHO
Affiliation:
Universidade de Lisboa Instituto Superior Técnico, Portugal INESC-ID, Portugal (e-mails: ricardo.brancas@tecnico.ulisboa.pt, vasco.manquinho@inesc-id.pt)
RUBEN MARTINS
Affiliation:
Carnegie Mellon University, USA (e-mail: rubenm@andrew.cmu.edu)
Rights & Permissions [Opens in a new window]

Abstract

Prolog is a well-known declarative programming language commonly used in introductory courses on logic and reasoning. However, many students find Prolog challenging because it lacks the familiar debugging mechanisms found in imperative languages. In large classes, this difficulty is exacerbated by the challenge of providing timely and personalized feedback to students. In this work, we introduce ProDebug, the first tool to combine large language models (LLMs) with spectrum-based and mutation-based techniques for automated debugging of Prolog assignments. ProDebug automatically identifies faults and proposes bug repairs for student Git submissions. Faults are detected using three approaches – spectrum-based, mutation-based, and LLM reasoning – while repairs are generated using mutation-based techniques and LLMs. Our evaluation on 1499 buggy student submissions from a bachelor’s level programming class demonstrates the potential of automated, LLM-augmented feedback systems to scale support for declarative programming education.

Information

Type
Original Article
Creative Commons
Creative Common License - CCCreative Common License - BYCreative Common License - NCCreative Common License - SA
This is an Open Access article, distributed under the terms of the Creative Commons Attribution-NonCommercial-ShareAlike licence (https://creativecommons.org/licenses/by-nc-sa/4.0/), which permits non-commercial re-use, distribution, and reproduction in any medium, provided the same Creative Commons licence is used to distribute the re-used or adapted article and the original article is properly cited. The written permission of Cambridge University Press or the rights holder(s) must be obtained prior to any commercial use.
Copyright
© The Author(s), 2026. Published by Cambridge University Press
Figure 0

Fig. 1. Fig. 1 long description.System architecture overview.

Figure 1

Fig. 2. On the left of this figure we show a Prolog program, while on the right we show an execution trace for the query none.

Figure 2

Fig. 3. Example of a program composed of two clauses and possible mutants generated by ProDebug for each of those clauses.

Figure 3

Fig. 4. A buggy Prolog rule, its AST representation, and the SMT encoding for that tree.

Figure 4

Table 1. Different evaluation metrics for each fault localization method split among the practice exercises and the project submissions. Acc@k$k$: percentage of faults ranked within the top k$k$ positions (higher is better); Expense: MinRank divided by the total number of clauses, i.e., the fraction of the program inspected before the first fault is found (lower is better)Table 1 long description.

Figure 5

Table 2. Fault localization performance across SBFL and MBFL formulasTable 2 long description.

Figure 6

Table 3. Evaluation results for ProDebug’s program repair approachesTable 3 long description.

Figure 7

Table 4. Summarized results for fine-tuned and non fine-tuned Large Language Models. The models used for the fault localization were Qwen 3 with sizes 4B, 8B and 14B, while the models used for repair were Qwen 2.5 Coder with sizes 3B, 7B and 14BTable 4 long description.

Supplementary material: File

Brancas et al. supplementary material

Brancas et al. supplementary material
Download Brancas et al. supplementary material(File)
File 506.7 KB