We discuss how to implement backjumping (or intelligent backtracking) in Prolog programs by means of exception handling. This seems impossible in a general case. 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 a class of backjump targets. We also show how to simulate backjumping by means of backtracking and the Prolog database.
翻译:我们讨论如何通过例外处理方式在Prolog 方案中执行回跳(或智能回溯跟踪) 。 这在一般情况下似乎是不可能的。 我们提供两种解决方案。 一个为二进制程序工作, 一个为二进制程序工作, 一个对回跳的起源施加限制。 另一个限制回跳目标类别。 我们还展示如何通过回溯跟踪和Prolog 数据库模拟回跳。