English

Implementing backjumping by means of exception handling

Programming Languages 2025-08-25 v3 Logic in Computer Science

Abstract

We discuss how to implement backjumping (or intelligent backtracking) in Prolog by using the built-ins throw/1 and catch/3. We show that it is impossible in a general case, contrary to a claim that ``backjumping is exception handling". We provide two solutions. One works for binary programs; in a general case it imposes a restriction on where backjumping may originate. The other restricts the class of backjump targets. We also discuss implementing backjumping by using backtracking and the Prolog database. Additionally, we explain the semantics of Prolog exception handling in the presence of coroutining.

Cite

@article{arxiv.2305.16137,
  title  = {Implementing backjumping by means of exception handling},
  author = {Włodzimierz Drabent},
  journal= {arXiv preprint arXiv:2305.16137},
  year   = {2025}
}

Comments

14 pages, 2 figures. Accepted for ICLP 2023. A former version of this paper is arxiv:2008.09610

R2 v1 2026-06-28T10:46:08.843Z