A Uni ed Framework for Interval Constraints and Interval ... - CiteSeerX

0 downloads 0 Views 198KB Size Report
putes intervals such that all solutions, if any, are contained within the computed intervals. Complex constraints such as occur in the rst formula of interval constraint system (1) ... As each of the variables is regarded as an unknown real, ...... BNR Prolog user guide and reference manual. ... Schaum's Outline Series, 1965. 15.
A Uni ed Framework for Interval Constraints and Interval Arithmetic T.J. Hickey1, M.H. van Emden2, H. Wu2 1

Brandeis University, Waltham, MA 02254, USA University of Victoria, Victoria, BC, Canada

2

Abstract. We are concerned with interval constraints: solving constraints among real unknowns in such a way that soundness is not a ected by rounding errors. The contraction operator for the constraint x + y = z can simply be expressed in terms of interval arithmetic. An attempt to use the analogous de nition for x  y = z fails if the usual de nitions of interval arithmetic are used. We propose an alternative to the interval arithmetic de nition of interval division so that the two constraints can be handled in an analogous way. This leads to a uni ed treatment of both interval constraints and interval arithmetic that makes it easy to derive formulas for other constraint contraction operators. We present a theorem that justi es simulating interval arithmetic evaluation of complex expressions by means of constraint propagation. A naive implementation of this simulation is inecient. We present a theorem that justi es what we call the totality optimization. It makes simulation of expression evaluation by means of constraint propagation as ecient as in interval arithmetic. It also speeds up the contraction operators for primitive constraints.

1 Introduction This paper is about the interplay between interval constraints and interval arithmetic. The contraction operators of interval constraints can be succinctly expressed in terms of interval arithmetic, provided that the de nition of division in interval arithmetic is suitably modi ed. Constraint propagation in interval constraints generalizes interval evaluation in interval arithmetic. The totality optimization of interval constraints ensures that in the special case of interval arithmetic no additional computational cost is incurred. The contributions of this paper are the following: A uni ed framework for interval constraints and interval arithmetic. An advantage of this framework is that it becomes a routine method to derive formulas for a new contraction operator. Examples are the min and max operators treated in [17]. A simple de nition of interval division in its full generality. Lack of such a de nition has given rise to awkward problems in interval arithmetic. The totality optimization. Complex constraints can be decomposed into sets of primitive constraints, if the original constraint is total in one of its variables, then this information can be used to more eciently solve the constraint.

2 Informal Account of Interval Constraints In this section we give a brief introduction to interval constraints, beginning with an example. Let us consider the problem of computing the x and y coordinates of the intersection of a circle and a parabola. If we want the solution with nonnegative x-coordinates, then we consider the interval constraint system: x2 + y 2 = 1 ^ y = x 2 ^ 0  x

(1)

This is a conjunction of three logical formulas related by sharing x and y, which denote unknown reals. The logical formulas are regarded as constraints on the possible values of the unknowns. An interval constraint implementation computes intervals such that all solutions, if any, are contained within the computed intervals. Complex constraints such as occur in the rst formula of interval constraint system (1) are translated to primitive constraints, as shown in formula (2). The translation process introduces the auxiliary variables x2 and y2 : x2 = x 2 ^ y 2 = y 2 ^ x2 + y 2 = 1 ^ x 2 = y ^ 0  x

(2)

The most commonly used primitive constraints are x + y = z; x  y = z; xn = y; x = y; x  y where n is an integer. As each of the variables is regarded as an unknown real, it is associated with an interval containing all values of this real that might occur in a solution. To solve such a system according to interval constraints, one starts with intervals large enough to contain all solutions of interest. Then one iterates among the primitive constraints, reducing intervals to subintervals as far as necessary to remove values that are inconsistent with the constraint under consideration. Consider, for example, constraints of the form u + v = w, which is the form of the third constraint in (2). Suppose that the intervals for u; v and w are [0; 2]; [0; 2] and [3; 5] respectively. Then all three intervals contain inconsistent values. For example, v  2 and w  3 imply that u = w ? v  1. Hence the values less than 1 for u are inconsistent, in the conventional sense of the word: it is inconsistent to believe the negation of the conclusion of a logical implication if one accepts the premise. Similar considerations rule out values less than 1 for v and values greater than 4 for w. Removing all inconsistent values from the a priori given intervals leaves the intervals [1; 2] for u and v and [3; 4] for w. To obtain the new intervals from the old ones is to apply the constraint contraction operator associated with the constraint, in this case x + y = z. The new bounds 1 and 4 are computed according to the rules of interval arithmetic and require the rounding direction to be set appropriately. Thus interval constraints depend on interval arithmetic. Some standard references on interval arithmetic are [1, 9, 15].

An interval constraint system performs a constraint contraction for each of the primitive constraints. Because typically constraints share variables, contraction usually has to be performed multiple times on any given constraint: every time another constraint causes the interval for a variable to contract, all constraints containing that variable have to have their contraction operators applied again. Because changes are always contractions and because interval bounds are

oating-point numbers, a nite number of contractions suces to reach a state where all constraints yield a null contraction. A constraint propagation algorithm terminates when this is found to be the case. As interval constraints only remove inconsistent values and may not remove all such values, it may be that the resulting intervals contain no solution. Thus results in interval constraints have the meaning: if a solution exists, then it is in the intervals found. Some references to interval constraints are [4, 5, 18, 10].

3 Machine Numbers and Intervals In numerical analysis, algorithms are studied in an idealized setting, where the operations are applied to real numbers and yield the correct real-valued results. The theorems that are proved in numerical analysis concern properties of the idealized algorithms such as convergence, stability, condition, etc. It is accepted as inevitable that these theorems are no longer valid when the algorithms are executed on actual hardware. The correct real results have to be approximated by oating-point numbers. Not only are there approximation errors, but even the familiar algebraic laws such as associativity and distributivity fail with oatingpoint numbers. In interval constraints the situation is di erent. Here the computation itself is a proof that the reals that are removed from the intervals during the computation do not belong to a solution. An extreme case is that an interval becomes empty, and then it has been proved that no solution exists. Such a proof is done by means of computations on oating-point numbers on actual hardware. These computations are subject to rounding errors. Ways have been found to make such proofs valid, in spite of the unavoidable rounding errors. As we have the potential of each interval constraint computation being a proof, it is important to realize that potential. This can only be done if machine arithmetic is considered to a sucient level of detail. For interval methods these details are more important than for numerical analysis. At the same time it is important to avoid unnecessary detail. One therefore has to nd the right abstraction of oating-point arithmetic in terms of real numbers. There are several ways of doing this. As none is universally accepted, we make this paper a selfcontained mathematical treatment. Hence the following de nitions and lemmas. Lemma 1. Let a  b be reals. The following are closed connected sets of reals: ;; R; fx 2 R j a  x  bg; fx 2 R j a  xg; fx 2 R j x  bg; where the last three are written as [a; b]; [a;+1];[?1; b], respectively. There are no other closed connected sets of reals.

This lemma is a well-known result in topology; see for example [14]. Note that the fact that we write, say, fx 2 R j x  bg as [?1; b] does not imply that ?1 is a real number. The same notation suggests that we write [?1; +1] for R. From the above lemma, we can de ne real intervals, a fundamental concept in this paper. De nition2 Real intervals. A set of reals is de ned to be a real interval i the set is closed and connected. 2 Since the computations are applied to the oating-point numbers on actual hardware, it is important that we have an explicit de nition for the set of the

oating-point numbers of the machine. We call the set of these numbers machine numbers. De nition3 Machine numbers. The set M contains the real number 0 as well as nitely many other reals. In addition it contains two elements that are not reals that we denote by ?1 and +1. M is totally ordered. Any two real elements in M are ordered as in R. Moreover, for all real x 2 M; ?1 < x < +1:2 De nition4. For any x 2 R, x? is the greatest machine number not greater than x; x+ is the smallest machine number not smaller than x. Obtaining x? from x is called rounding down, and obtaining x+ from x is called rounding up. 3

We can obtain a machine interval (de ned below) from a real interval [a; b] by rounding down its lower bound a and rounding up its upper bound b. De nition5 Machine intervals. A machine interval is one of the following: ;; R; fx 2 R j a  x  bg; fx 2 R j a  xg; fx 2 R j x  bg; where a and b are machine numbers. The last three are written as [a; b]; [a; +1]; [?1;b], respectively, and [?1; +1] is an acceptable notation for R. 2 Let us denote the set of machine intervals as I . I is nite. I is a subset of the real intervals. Machine intervals are representable sets of reals. The types of intervals (real or machine) refer to the nature of the end points (in so far as they exist). Both types of intervals are sets of reals. De nition6. An n-ary relation ( n is a positive integer ) is a set of n-tuples of reals.2 For example: f< x; y; z > 2 R3 j x  y = z g is a ternary relation, where  is a binary operation. 3

In interval arithmetic there is no such error as over ow. If an operation yields a real with an absolute value that exceeds that of all nite machine numbers, then rounding towards the applicable in nity yields an in nity and rounding towards 0 yields a nite machine number. No problem either way.

De nition7. An n-ary real box (machine box) is the Cartesian product of n

real intervals (machine intervals). 2 For n = 1, we will not distinguish an n-ary real box (machine box) from a real interval (machine interval).

Lemma 8. For every n-ary relation, there is a unique least n-ary machine box containing it. This existence and uniqueness suggest the de nition of a function: De nition9. Let r be an n-ary relation. Then bx(r) is de ned to be the smallest n-ary machine box containing r. 2 Lemma 10. For all reals a and b, bx([a; b])  [a? ; b+]. Inequality holds i b < a and there are zero or one machine numbers k such that b  k  a. 2 As we will see, inequality will translate to deviation from optimality. This happens rarely. To start with, we have equality if a  b. Otherwise we also have equality, unless a and b are quite close, compared to their magnitude. Computing the intersection of two intervals is straightforward in principle. Here also rounding introduces some subtlety. Lemma 11. For all real intervals [r; s] and [t; u] we have that bx([r; s] \ [t; u])  [max(r?; t? ); min(s+ ; u+ )]. Inequality hold i (a) s < t and s+  t? or (b) u < r and u+  r? . 2 As noted before, inequality will translate to deviation from optimality. This happens rarely. To start with, we have equality when the left-hand side is nonempty. If there is inequality, then the right-hand side is almost empty: it contains at most two machine numbers. Moreover, it often happens that, say, [r; s] is a machine interval, and then the spuriously non-empty right-hand side contains at most one machine number, which is either r or s. Similarly for [t; u]. Lemma 12. 8r; s  Rn; we have r  s ) bx(r)  bx(s) (monotonicity of bx). 8r  Rn ; we have bx(r) = bx(bx(r)) (idempotence of bx). (See [4].) We have now the tools to describe sets of reals in a way that is practical on a computer: as a pair of machine numbers. A great advantage of the IEEE

oating-point numbers is that they are machine numbers in our sense because they include the in nities.

4 Interval Constraint Systems It is the purpose of an interval constraint system to provide information about the unknowns. In the initial state there is no information. Information is gained by applying contraction operators, which cause contraction of the intervals associated with the unknowns.

Information about an unknown is given in the form of a set of reals to which the unknown belongs. These sets are restricted to intervals with machine numbers as bounds. For all unknowns simultaneously, the state is a machine box. The previous section was devoted to de ne boxes, as well as the necessary preliminary de nitions. We can now de ne an interval constraint system. It is a system with the following components. 1. A set of primitive relations This is the set of relations that occurs in the elements of the set of constraints. The following is a typical set of such relations: sum def = f(x; y; z) 2 R3 j x + y = z g prod def = f(x; y; z) 2 R3 j x  y = z g eq def = f(x; y) 2 R2 j x = yg leq def = f(x; y) 2 R2 j x  yg powern def = f(x; y) 2 R2 j xn = yg for integer n: 2. A set of constraints Each constraint is a formula of the form p(x1; : : :; xn) where p names a relation and x1; : : :; xn are real numbers. They may be known (0, and 1 are typical rational examples) or they may be unknown. In the latter case xi is an identi er, which may occur in another constraint, where it denotes the same unknown real. The relation p is a primitive relation; see the applicable component of interval constraint systems. 3. A sequence of unknowns This is a sequence of the unknowns occurring in the elements of the set of constraints. In interval constraint systems, the unknowns are usually shared by two or more of the constraints. 4. A state A state is a sequence of machine intervals (as de ned earlier). For i = 1; : : :; n, the i-th machine interval is the set of real values that are not inconsistent (in this state) as value for the i-th unknown. A state should be thought as a state of information about the sequence of unknowns. The set of states is partially ordered by pointwise inclusion: S1  S2 i each element of S2 is included (as a set) in the corresponding element of S1 . The symbol is chosen to re ect that in S2 one has more information about the unknowns than in S1 . The relation  is a partial order. There is one bottom in the partial order: the sequence where all the elements are [?1; +1]. There is a single top in the partial order: the sequence where all the elements are the empty interval ;. Now that the concept of interval constraint systems is de ned, we can come back to the purpose of such systems: to contract the intervals of the state as much as possible by applying contraction operators. There is one such operator associated with each of the primitive relations of the system.

The main purpose of this paper is to de ne these operators in terms of interval arithmetic, and to adapt, as far as necessary, the de nitions of interval arithmetic to simplify the connection with interval constraints.

5 The Constraint Contraction Operator The constraint contraction operator contracts intervals by removing inconsistent values. Suppose the state of an interval constraint system contains inconsistent values. Then these values are inconsistent with at least one primitive relation, say, r. Ideally we only want values in r. For other reasons, values have already been restricted to some box B, which is the state projected on the arguments of r. However, r \ B is not in general a machine box. Hence the best we can do in practice is to reduce B to bx(r \ B). This motivates the following de nition ([4]).

De nition13. The constraint contraction operator associated with an n-ary relation r acting on an n-ary machine box B is de ned as r (B) = bx(r \ B): 2 The operator is sound because its result contains r \ B. It is eciently representable on a computer because of the bx function. We are interested in applications of this de nition where r is sum, prod, eq, leq, or powern , and where B is the machine box abcdef def = [a; b]  [c; d]  [e; f] def or the machine box abcd = [a; b]  [c; d], for a; b; c; d; e; f 2 M and a  b; c  d; e  f. The notations abcd and abcdef used in this paper are based on their de nitions here, unless otherwise speci ed. 5.1 Interval Arithmetic for Constraints Interval division Consider a typical contraction operator: the one that contracts

the interval [0; 2] for x and y and [3; 5] for z taking into account the constraint x+y = z. As we have explained, the result is [1; 2] for x and y and [3; 4] for z. The new interval for x can be succinctly computed by the formula [a; b] \ ([e; f] ? [c;d]) if [a; b], [c; d] and [e; f] are the old intervals for x, y and z respectively. The interval subtraction is as de ned in interval arithmetic. However, in the analogous situation for the x  y = z constraint, we have to compute [a; b] \ ([e; f]=[c; d]). Implementers of interval constraints [5, 3, 10] have learned to ignore the interval arithmetic de nition for [e; f]=[c; d]. According to our de nition [e; f]=[c; d] can be of four di erent forms: a single closed interval, two disjoint closed intervals, a single interval with 0 as open bound, and two disjoint intervals where 0 can occur as an open bound. The rst category is the one of standard interval arithmetic. An example of the second category is [1; 1]=[?1; 1] = [?1; ?1] [ [1; +1]. One can not replace this set by its least surrounding interval; otherwise one will obtain a non-empty result for [? 21 ; 21 ] \ [1; 1]=[?1; 1] and one will not achieve optimal contraction in interval constraints.

An example of the third category is [1; 1]=[1; 1] = (0; 1]. One can not replace this set by its closure, otherwise one will obtain a non-empty result in situations such as [?1; 0] \ ([1; 1]=[1; 1]) and one will not achieve optimal contraction in interval constraints. An example of the fourth category is [1; 1]=[?1;1] = [?1; 0) [ [1; +1]. Again, if one ignores the open bound, then optimality can be lost. To implement the constraint contraction operators, we need to further de ne these operators in terms of interval arithmetic. Therefore, it is important to de ne the primitive interval arithmetic operations and consider them to a sucient level of detail. The operator is optimal in the sense that its result is the smallest representable set that contains all possible values. Thus if our implementation formulas achieve equality to rather than containment of , we will have obtained optimal implementation.

De nition14.

[a; b] + [c; d] def = fz j 9x; y: x + y = z ^ x 2 [a; b] ^ y 2 [c; d]g def [a; b] ? [c; d] = fz j 9x; y: y + z = x ^ x 2 [a; b] ^ y 2 [c; d]g [a; b]  [c; d] def = fz j 9x; y: x  y = z ^ x 2 [a; b] ^ y 2 [c; d]g def [a; b]=[c; d] = fz j 9x; y: y  z = x ^ x 2 [a; b] ^ y 2 [c; d]g

for all real intervals [a; b], [c; d], and [e; f]. Note that the given de nition of [a; b] ? [c; d] is one of the two possibilities: [a; b] ? [c; d] def = fz j 9x; y: z = x ? y ^ x 2 [a; b] ^ y 2 [c; d]g def [a; b] ? [c; d] = fz j 9x; y: y + z = x ^ x 2 [a; b] ^ y 2 [c; d]g The corresponding de nitions for [a; b]=[c; d] would be: [a; b]=[c; d] def = fz j 9x; y: z = x=y ^ x 2 [a; b] ^ y 2 [c; d]g [a; b]=[c; d] def = fz j 9x; y: y  z = x ^ x 2 [a; b] ^ y 2 [c; d]g However, in this case there is an important di erence: x=y is not always de ned. The rst alternative, which is invariably chosen in interval arithmetic, needs xing up. The usual x is to disallow the occurrence of 0 in [c; d]. This has the e ect of making interval arithmetic useless exactly in those cases where one needs it most. The other x in the literature is called \extended interval arithmetic". The reference to this is usually given as [13], which is an elusive publication. Whatever it is, it is unlikely to be as simple as switching to the second formula, as was rst pointed out in [17]. For the sake of uniformity, we use the same method for the de nition of [a; b] ? [c; d], although either alternative will work equally well there.

De nition15.

 ([a; b]) def = fy j 9x: y  x ^ x 2 [a; b]g def  ([a; b]) = fy j 9x: x  y ^ x 2 [a; b]g = ([a; b]) def = fy j 9x: y = x ^ x 2 [a; b]g

for all real intervals [a; b] and [c; d]. The unary functions de ned here are new for interval arithmetic. The idea comes naturally as we are considering the interval arithmetic operations which are necessary for the implementation of the primitive relations like eq, leq. The de nitions above will lead us to a uni ed de nition format for the constraint contraction operators of all the primitive relations, and also simplify the implementation. For example, the unary function  ([a; b]) will just give up the lower bound of the interval, that is  ([a; b]) = [?1; b].

De nition16.

[a; b]n def = fy j 9x: xn = y ^ x 2 [a; b]g 1 [a; b] n def = fy j 9x: yn = x ^ x 2 [a; b]g for all real intervals [a; b] and [c; d] and integers n. 2

Lemma 17.

[a; b] + [c; d] = [a + c; b + d]; [a; b] ? [c; d] = [a ? d; b ? c]; for all real intervals [a; b] and [c; d]. The implementation of interval multiplication and division is complicated compared to that of addition and subtraction. It is given in detail in [11].

5.2 Interval Arithmetic Formulas for the Constraint Contraction Operator The constraint contraction operator requires formulas for bx(r \ B). As this is a box, we only need to compute its projections. We rst consider the projections of r \ B. In the following lemmas, we specify the projections of the primitive relations based on the interval arithmetic operations de ned above. Lemma 18. For all a; b; c; d; e; f 2 M: 1(sum \ abcdef) = [a; b] \ ([e; f] ? [c; d]) 2(sum \ abcdef) = [c; d] \ ([e; f] ? [a; b]) 3(sum \ abcdef) = [e; f] \ ([a; b] + [c; d]) 1(prod \ abcdef) = [a; b] \ ([e; f]=[c; d]) 2(prod \ abcdef) = [c; d] \ ([e; f]=[a; b]) 3(prod \ abcdef) = [e; f] \ ([a; b]  [c; d])

where i(X) is the i-th projection of the relation X. Proof. 1(prod \ abcdef) = 1(f(x; y; z) j x  y = z ^ x 2 [a; b] ^ y 2 [c; d] ^ z 2 [e; f]g)

= fx j 9y; z: x  y = z ^ x 2 [a; b] ^ y 2 [c; d] ^ z 2 [e; f]g = fx j x 2 [a; b] ^ (9y; z: x  y = z ^ y 2 [c; d] ^ z 2 [e; f]g = [a; b] \ fx j 9y; z: x  y = z ^ y 2 [c; d] ^ z 2 [e; f]g = [a; b] \ ([e; f]=[c; d]) Similarly for 2 and 3 and for all projections of the relation sum. Lemma 19. For all a; b; c; d 2 M and all integers n: 1(eq \ abcd) = [a; b]\ = ([c; d]) 2(eq \ abcd) = [c; d]\ = ([a; b]) 1(leq \ abcd) = [a; b]\  ([c; d]) 2(leq \ abcd) = [c; d]\  ([a; b]) 1 (powern \ abcd) = [a; b] \ [c; d] n 2 (powern \ abcd) = [c; d] \ [a; b]n 1

Where i (X) is the i-th projection of the relation X. Proof.

1(leq \ abcd) = 1(f(x; y) j x  y ^ x 2 [a; b] ^ y 2 [c; d]g) = fx j 9y: x  y ^ x 2 [a; b] ^ y 2 [c; d]g = fx j x 2 [a; b] ^ (9y: x  y ^ y 2 [c; d]g = [a; b] \ fx j 9y: x  y ^ y 2 [c; d]g = [a; b]\  ([c; d]) Similarly for 2 , 3 and for all projections of the other relations. Lemma 20. bx(i (r)) = i(bx(r)), where r is an n-ary relation and i = 1; : : :; n. From the above lemma and the de nitions of the projections over the primitive relations, we are now ready to consider the implementation of the constraint contraction operator in detail based on interval arithmetic. Theorem 21. For all a; b; c; d; e; f 2 M: 1 ( sum (abcdef))  [a; b] \ [(e ? d)? ; (f ? c)+ ] 2 ( sum (abcdef))  [c; d] \ [(e ? b)? ; (f ? a)+ ] 3 ( sum (abcdef))  [e; f] \ [(a + c)? ; (b + d)+ ]

where i(X) is the i-th projection of the box X. For 1 there is equality except when (e ? d)?  b < (e ? d) or (f ? c) < a  (f ? c)+ . Similarly for 2 and 3.

2

Proof.

1( sum (abcdef)) = 1(bx(sum \ abcdef)) = bx(1(sum \ abcdef)) = bx([a; b] \ ([e; f] ? [c; d]) = bx([a; b] \ [e ? d; f ? c]) = bx([max(a; e ? d); min(b; f ? c)])  [max(a; (e ? d)? ); min(b; (f ? c)+ )] = [a; b] \ [(e ? d)? ; (f ? c)+ ] Similarly for 2 and 3. The formulas in this theorem are almost always optimal. Non-optimality occurs when the interval should be empty and the formula returns an interval containing exactly one machine number. The de nition of prod in terms of interval arithmetic is di erent from that of

sum . The reason for this, as illustrated in the introduction, is that the interval division [e; f]=[c; d] can be of four di erent forms: a single closed interval, two disjoint closed intervals, a single interval with 0 as open bound, and two disjoint intervals with 0 as open bound(s). One needs to consider the di erent forms separately to achieve optimal contraction in interval constraints.

Theorem22. For all a; b; c; d; e; f 2 M: 1( prod (abcdef)) = bx([a; b] \ (RI1 [ RI2 )) if [e; f]=[c; d] = RI1 [ RI2 = bx([a; b] \ RI3 ) if [e; f]=[c; d] = RI3 3( prod (abcdef)) = [e; f] \ [l?; u+ ] where i(X) is the i-th projection of the box X, and l, u are reals, and where RI1 [ RI2 is a union of two disjoint connected sets of reals, not necessarily closed, and RI3 is a connected, but not necessarily closed, set of reals.

Theorem23. For all a; b; c; d 2 M: 1( eq (abcd)) = 2 ( eq (abcd)) = [a; b] \ [c; d] 1 ( leq (abcd)) = [a; b] \ [?1; d] 2 ( leq (abcd)) = [c; d] \ [a; +1] where i(X) is the i-th projection of the box X.

The implementation of powern requires considerations similar to those for

prod . [a; b]n and [a; b] n1 can be of three di erent forms: a single closed interval, two disjoint closed intervals, and two disjoint intervals with 0 as open bound(s). The mathematical analysis and the implementation details of powern are given in [20]. Theorem 24. For all a; b; c; d 2 M and integer n: 1 ( powern (abcd)) = bx([a; b] \ (RI1 [ RI2)) if [c; d] n1 = RI1 [ RI2  [a; b] \ [l? ; u+] if [c; d] n1 = [l; u] 2 ( powern (abcd)) = bx([c; d] \ (RI1 [ RI2 )) if [a; b]n = RI1 [ RI2 (3)  [c; d] \ [l?; u+ ] if [a; b]n = [l; u] where i (X) is the i-th projection of the box X, l; u 2 R and RI1 [ RI2 is a union

of two disjoint connected sets of reals, not necessarily closed. Considerations concerning departure from optimality are analogous to those in Theorem 21.

An example of [a; b]n = RI1 [ RI2 is [?1; 1]?1 = [?1; 0) [ [1; +1].

6 Beyond Primitive Constraints The primitive constraints allow an interval arithmetic system to express equalities or inequalities between real-valued expressions of any complexity. When a complex constraint is \total" in one of its arguments (as described below) it can sometimes be computed more eciently when treated as a whole, than when viewed as a set of primitive constraints. De nition25. The i-th canonical extension Cr;i of an n-ary relation r is de ned as Cr;i (S1 ; : : :; Si?1 ; Si+1; : : :; Sn ) = fx j 9u1 2 S1 ; : : :; ui?1 2 Si?1 ; ui+1 2 Si+1 ; : : :un 2 Sn : r(u1 ; : : :; ui?1; x; ui+1; : : :; un)g 2 Informally, Cr;i (S1 ; : : :; Si?1; Si+1 ; : : :; Sn ) is the set of all values for the i-th argument of r that are consistent with r and with the other arguments being in S1 ; : : :; Si?1; Si+1 ; : : :; Sn. Canonical extensions can be regarded as generalizations of interval arithmetic operations; at least, if de ned in our way. For example: Cprod;1 ([c; d]; [e; f]) = [e; f]=[c; d] Cprod;2 ([a; b]; [e; f]) = [e; f]=[a; b] Cprod;3 ([a; b]; [c;d]) = [a; b]  [c; d] Canonical extensions allow the following generalization of lemma 18.

Theorem26. Let r be n-ary relation in Rn, and B an n-ary box. For i = 1; : : :; n we have i (r \ B) = Bi \ Cr;i (B1 ; : : :; Bi?1 ; Bi+1; : : :; Bn ), where Bi =

i(B).

Proof. Consider the case i = 1.

1 (r \ B) = 1(f(x1 ; : : :; xn) j r(x1; : : :; xn) ^ x1 2 B1 ^ : : : ^ xn 2 Bn g) = fx1 j 9x2; : : :; xn: r(x1; : : :; xn) ^ x1 2 B1 ^ : : : ^ xn 2 Bn g) = B1 \ fx1 j 9x2; : : :; xn: r(x1; : : :; xn) ^ x2 2 B2 ^ : : : ^ xn 2 Bn g = B1 \ Cr;1 (B2 ; : : :; Bn): The proof is similar for i = 2; : : :; n. De nition27. An n-ary relation r is total in its i-th argument if the set Cr;i (S1 ; : : :; Si?1; Si+1 ; : : :; Sn ) is nonempty whenever all arguments are nonempty. 2 Example: r(x1; : : :; xn) is de ned as f(x1 ; : : :; xn?1) = xn, where f is a function. Then r is total in its n-th argument. Example: prod is total in its third argument. It is not total in its rst and second arguments as can be seen from Cprod;2 ([0; 0]; [1;1]) = ;. Theorem28 The totality theorem. Let S1; : : :; Sn be nonempty sets. If an n-ary relation r is total in its i-th argument (i = 1; : : :; n) and if Cr;i (S1 ; : : :; Si?1; Si+1 ; : : :; Sn )  Si , then Sj  Cr;j (S1 ; : : :; Sj ?1; Sj +1 ; : : :; Sn) for j = 1; : : :; i ? 1; i + 1; : : :; n. Proof. Assume that i = 1. Suppose Cr;1(S2 ; : : :; Sn )  S1 and uj 2 Sj , with j = 2; : : :; n. From the totality of r in its rst argument (see assumption i = 1) we know that Cr;1 (fu2g; : : :; fung) is nonempty. It therefore contains an element, say, u1 , and it is in S1 . As a result we have that (u1 ; : : :; un) 2 r. It follows that uj 2 Cr;j (fu1 g; : : :; fuj ?1g; fuj +1g; : : :; fung); which is contained in Cr;j (S1 ; : : :; Sj ?1; Sj +1; : : :; Sn). The totality optimization Suppose the real valued expression E contains the variables x1; : : :; xn?1 and no others. Suppose E is de ned for all values of its variables. Then the relation r(x1; : : :; xn) that is de ned to hold whenever E = xn, is total in its last argument. We can obtain a short cut when computing the constraint contraction associated with r. According to theorem 26 we can obtain the result by computing i (r \ B) = Bi \ Cr;i (B1 ; : : :; Bi?1; Bi+1 ; : : :; Bn ). Let B be such that Bn = [?1; +1]. Then Cr;n (B1 ; : : :; Bi?1; Bi+1 ; : : :; Bn)  Bn . Hence n (r \ B) is Cr;n (B1 ; : : :; Bi?1; Bi+1 ; : : :; Bn), which is E evaluated in interval arithmetic with Bj substituted for xj , j = 1; : : :; n ? 1. Theorem 28 shows that in this case j (r \ B) = Bj for j = 1; : : :; n ? 1. The theorem says that the entire propagation is e ected by a single interval arithmetic evaluation. This is an instance of what we call the totality optimization. It optimizes constraint propagation. This optimization is also applicable at the level of the

single contraction operator. The constraint sum is total in all its arguments. Therefore, if in the course of evaluating the formulas in lemma 18 the rst (or the second) interval operation is found to give a result strictly contained in the old interval, then the two remaining projections (or one remaining projection) are unchanged. The prod constraint is total only in its third argument. The totality optimization can therefore only be applied there. Because of this, the third projection should be evaluated rst, in case the sole potential opportunity for the totality optimization materializes.

7 Related Work Interval arithmetic One source of interval constraints, interval arithmetic, started

with a bang: almost the rst publication was the 1966 book [15] by Ramon E. Moore, published in a prestigious series. It is still referred to as a source for important ideas. Subsequent developments in interval arithmetic are consolidated in books such as [9, 16, 1].

Interval constraints Interval constraints can be traced to the dissertation by Waltz where constraints were propagated to reduce sets of possible values [19]. The CHIP programming language [8] showed that this idea is more widely applicable. The next development was its application to reals by Davis [7]. BNR Prolog [5] can be regarded as an implementation of Davis's ideas with Prolog as front-end programming language. That is, BNR Prolog is to Davis what CHIP is to Waltz. In actual fact, BNR Prolog was inspired by Cleary's relational interval arithmetic [6], which, however, viewed intervals as generalized reals, a view often taken in the interval arithmetic literature. Thus the BNR Prolog team not only merged Cleary's ideas with constraint propagation, but also made the switch from viewing intervals as generalized reals to viewing them as sets of reals. Davis and the BNR Prolog team were not the only ones to independently discover interval constraints; a third one was Hyvonen [12]. The basic interval constraints method can be enhanced by incorporating Newton's method [2, 10]. In this paper we have developed interval constraints from rst principles and formulated the main results in terms of interval arithmetic. We have found that it is possible to do this in a uniform way, treating constraints uniformly, independently of whether they arise from the arithmetic operations or relations. Moreover, we showed that a recently reported modi cation of interval division [17], allows both interval arithmetic and interval constraints to t in the same framework.

References 1. Gotz Alefeld and Jurgen Herzberger. Introduction to Interval Computations. Academic Press, 1983.

2. F. Benhamou, D. McAllester, and P. Van Hentenryck. CLP(Intervals) revisited. In Logic Programming: Proc. 1994 International Symposium, pages 124{138, 1994. 3. Frederic Benhamou, Pascal Bouvier, Alain Colmerauer, Henri Garetta, Bruno Giletta, Jean-Luc Massat, Guy Alain Narboni, Stephane N'Dong, Robert Pasero, Jean-Francois Pique, Touravane, Michel Van Caneghem, and Eric Vetillard. Le manuel de Prolog IV. Technical report, PrologIA, Parc Technologique de Luminy, Marseille, France, 1996. 4. Frederic Benhamou and William J. Older. Applying interval arithmetic to real, integer, and Boolean constraints. Journal of Logic Programming, 32:1{24, 1997. 5. BNR. BNR Prolog user guide and reference manual. 1988. 6. J.G. Cleary. Logical arithmetic. Future Computing Systems, 2:125{149, 1987. 7. E. Davis. Constraint propagation with labels. Arti cial Intelligence, 32:281{331, 1987. 8. M. Dincbas, P. Van Hentenryck, H. Simonis, A. Aggoun, T. Graf, and F. Berthier. The constraint programming language CHIP. In Proc. Int. Conf. on Fifth Generation Computer Systems, 1988. 9. Eldon Hansen. Global Optimization Using Interval Analysis. Marcel Dekker, 1992. 10. Pascal Van Hentenryck, Laurent Michel, and Yves Deville. Numerica: A Modeling Language for Global Optimization. MIT Press, 1997. 11. T. Hickey and M. van Emden. Using the IEEE oating-point standard for implementing interval arithmetic. In preparation. 12. E. Hyvonen. Constraint reasoning based on interval arithmetic. In Proceedings of the Eleventh International Joint Conference on Arti cial Intelligence, pages 1193{ 1198, Detroit, USA, 1989. 13. W.M. Kahan. A more complete interval arithmetic. Technical report, University of Toronto, Canada, 1968. 14. Seymour Lipschutz. General Topology. Schaum's Outline Series, 1965. 15. Ramon E. Moore. Interval Analysis. Prentice-Hall, 1966. 16. Arnold Neumaier. Interval Methods for Systems of Equations. Cambridge University Press, 1990. 17. M.H. van Emden. Canonical extensions as common basis for interval constraints and interval arithmetic. In Proceedings of the Sixth French Conference on Logic and Constraint Programming, Orleans, France, 1997. 18. M.H. van Emden. Value constraints in the CLP Scheme. Constraints, 2:163{183, 1997. 19. D. Waltz. Understanding line drawings in scenes with shadows. In Patrick Henry Winston, editor, The Psychology of Computer Vision, pages 19{91. McGraw-Hill, 1975. 20. Huan Wu. De ning and implementing a uni ed framework for interval constraints and interval arithmetic. Master's thesis. In preparation.

This article was processed using the LATEX macro package with LLNCS style

Suggest Documents