Academia.eduAcademia.edu

Intelligent backtracking in CLP(ℜ)

1996, Annals of Mathematics and Artificial Intelligence

CLP(~) is a constraint logic programming language in which constraints can be expressed in the domain of real numbers. Computation in this specialized domain gives access to information useful in intelligent backtracking. In this paper, we present an efficient constraint satisfaction algorithm for linear constraints in the real number domain and show that our algorithm directly generates minimal sets of conflicting constraints when failures occur. We demonstrate how information gleaned during constraint satisfaction can be integrated with unification failure analysis. The resulting intelligent backtracking method works in the context of a two-sorted domain, where variables can be bound to either structured terms or real number expressions. We discuss the implementation of backtracking and show examples where the benefit of pruning the search tree outweighs the overhead of failure analysis.

Annals of Mathematics and Artificial Intelligence 17 (1996) 189-2I 1 189 Intelligent backtracking in CLP( ) Jennifer J. Burg Wake Forest Universit3; Winston-&,lem, NC 27109, USA E-mail: [email protected] Sheau-Dong Lang and Charles E. Hughes Uniters'it3., of Central Florida, Orlando. FL 32816, USA E-naail: {lang,ceh} @cs.ucf.edu CLP(~) is a constraint logic programming language in which constraints can be expressed in the domain of real numbers. Computation in this specialized domain gives access to information useful in intelligent backtracking. In this paper, we present an efficient constraint satisfaction algorithm for linear constraints in the real number domain and show that our algorithm directly generates minimal sets of conflicting constraints when failures occur. We demonstrate how information gleaned during constraint satisfaction can be integrated with unification failure analysis. The resulting intelligent backtracking method works in the context of a two-sorted domain, where variables can be bound to either structured terms or real number expressions. We discuss the implementation of backtracking and show examples where the benefit of pruning the search tree outweighs the overhead of failure analysis. 1. Introduction Early in the development of logic programming languages, SLD-resolution and the left-right-depth-first (LRDF) search and computation rule were adopted as a practical approach to implementation [16]. In this model, execution is represented by the L R D F traversal of a search tree such as the one in Fig. 1. When failure occurs at a leaf node. or when a solution is found, naive backtracking directs the retreat to the last choice point passed. As is apparent in the example, the naive backtracking method does not have the intelligence to recognize obvious failure paths. At the first failure node, there is no point in going back to re-execute r, since the failure can be traced back to the execution of q. Intelligent backtracking should recognize such a situation. Early work in intelligent backtracking for logic programming offered methods for tracing the source of bindings during unification in order to guide backtracking more effectively [1, 5, 7, 13, 14, 18, I9]. These methods were limited by the significant overhead involved in a complete failure analysis. However, less precise forms of failure analysis offered the promise of increased efficiency and were shown to be easily incorporated into compilation-based versions of Prolog [6]. © J.C. Baltzer AG, Science Publishers 190 J.J. Burg et al., Intelligent backtracking in CLP(~) p(X,Y) :q(X,Y), r(Z), s(Y,Z). q(2,4). q(2,3). r(5). s(3,5). S FAIL FAIL SUCCEED FAIL Fig, 1. The generalization of logic programming to constraint logic programming opened new possibilities for intelligent backtracking, since the ability to do computation in a specialized domain gave more direct access to information useful in intelligent backtracking. DeBacker and Beringer showed that the depth-first intelligent backtracking algorithm which was current in logic programming could be generalized to any constraint logic programming language in which conflict sets could be identified at failure nodes in the search tree [8]. They went on to show that constraint satisfaction in CLP(N) directly yields minimal conflict sets upon failure, making it a prime candidate for intelligent backtracking. Concurrently, Burg et al. [2, 3] and Hogger and Kotzamanidis [10] were developing their own constraint satisfaction algorithms, resulting in similar observations about the potential for intelligent backtracking in CLP(~:). In this paper, we present a sound and complete method for intelligent backtracking in CLP(~) built upon an efficient simplex-based method for constraint satisfaction. Our results differ from those reported in [8] and [10] in a number of ways. First, we begin with an original constraint satisfaction method which is easy to describe and prove correct, and which we have fully implemented in a CLP(~) interpreter. DeBacker and Beringer base their observations about the collection of conflict sets on the quasi-dual algorithm for constraint satisfaction, an algorithm which has the advantage of identifying implicit equalities, but which is costly to execute. Hogger and Kotzamanidis work from a constraint satisfaction algorithm which expresses all equations in terms of two inequalities, thus requiring an expansion of the constraint set. Our own constraint satisfaction algorithm is practical and efficient, and our corresponding proof that minimal conflict sets can be generated is clean and concise. We also extend our intelligent backtracking method beyond earlier results, recognizing that CLP(N) is in fact a language with a two-sorted domain, where variables can be bound to either structured terms or real number expressions. DeBacker and Beringer pose two sub-problems to be considered - finding a conflict set among the