Solving the multiplication constraint in several ... - Alain Colmerauer

15. Convenient approximation space. 2. About ordered sets: computing minima and maxima. 16. Multi-monotonic function. 17. Computing a maximum, example.
182KB taille 3 téléchargements 274 vues
.

Solving the multiplication constraint in several approximation spaces Alain Colmerauer

November 2001

Laboratoire d’Informatique de Marseille CNRS, Universit´es de Provence et de la M´editerran´ee

1

Contents

28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38.

1. Introducing the problem 1. Starting examples 2. A view of the multiplication 3. Another view of the multiplication 4. Several kinds of intervals 5. Several kinds of intervals, next 6. The general constraint solving problem 7. Visualization of the problem 8. Approximation space 9. Approximation space, next 10. Properties of apx 11. Our approximation spaces 12. Sharper approximation space 13. Sharper approximation space, next 14. Translation of an approximation space 15. Convenient approximation space

Example, next Translation into the aggregated space Moving to machine reals Moving to machine reals, next Discrete multiplication Discrete multiplication, next Discrete division Discrete division, next Solving the multiplication in the machine convex subsets Example of discrete multiplication Example of discrete division

6. Extension of an approximation space 39. 40. 41. 42. 43. 44. 45.

Adherence Translation into an extended space Extension of R Extension of R, next Extended multiplication and division Extended multiplication and division, next Solving the multiplication in the convex subsets

2. About ordered sets: computing minima 7. Complement and maxima 46. Related work 16. Multi-monotonic function 17. Computing a maximum, example

47. About unions and intersections, eventually infinite

3. About ordered sets: convex projections 18. 19. 20. 21. 22.

Moving from dimension n to dimension 2 The dimension 2 case Example of a relation which preserves convexity Other examples of relations which preserve convexity Decomposition of the multiplication

4. About orderded sets: computing projections 23. Good relation 24. Computation of projections 25. Projection of the double corner

5. Aggregated approximation space 26. Aggregated approximation space 27. Example 2

.

Introducing the problem

3

1. Starting examples •





z = xy       ∧ x ∈ [−2, 5]   ↔     ∧ y ∈ [−3, 1]     ∧ z ∈ [−14, 17] •













z = xy       ∧ x ∈ [1, 9]    ↔   ∧ y ∈ [2, 4]      ∧ z ∈ [8, 16] •



z = xy       ∧ x ∈ [−2, 5]      ∧ y ∈ [−3, 1]      ∧ z ∈ [−14, 6]



z = xy        ∧ x ∈ [5, 6]  ↔     ∧ y ∈ [−4, 2]     ∧ z ∈ [−15, 13]





z = xy        ∧ x ∈ [5, 6]      ∧ y ∈ [−3, 2]     ∧ z ∈ [−15, 12] 

z = xy       ∧ x ∈ [2, 8]      ∧ y ∈ [2, 4]      ∧ z ∈ [8, 16]

z = xy       ∧ x ∈ [−1, 1]   =⇒   ∧ y ∈ [−1, 1]      ∧ z ∈ [2, 2]

4









z = xy       ∧ x ∈ ∅      ∧ y ∈ ∅      ∧ z∈∅

2. A view of the multiplication

• times := {(x, y, z) ∈ R3 | z = xy} 5

3. Another view of the multiplication

• times := {(x, y, z) ∈ R3 | z = xy} 6

4. Several kinds of intervals • Let (D, ) be a totally ordered set.

• Definition A (true) interval is a possibly empty subset of D, of the form {x ∈ D | e  x and x  d} with e, d any elements of D. It is written [e, d]

• Definition A convex subset of D is a subset a of D such that, for all x ∈ D and y ∈ D, x ∈ a and y ∈ a → [x, y] ⊆ a.

7

5. Several kinds of intervals, next • Property The set of intervals of (R, ≤) is closed by finite intersection but not by infinite intersection. • Property The set of convex subsets of (R, ≤) is closed by infinite intersection and is equal to the set of generalized intervals of R, that is to say, the set of subsets of R of one of the 10 forms: 1. 2. 3. 4. 5. 6. 7. 8. 9. 10.

∅, {x ∈ R | e ≤ x and x ≤ d}, {x ∈ R | e ≤ x and x < d}, {x ∈ R | e < x and x ≤ d}, {x ∈ R | e < x and x < d}, {x ∈ R | e ≤ x}, {x ∈ R | x ≤ d}, {x ∈ R | e < x}, {x ∈ R | x < d}, R,

written written written written written written written written written

where e, d are elements of R, with e < d, but case 2, where e ≤ d.

8

[e, d], [e, d), (e, d], (e, d), [e, +∞), (−∞, d], (e, +∞), (−∞, d), (−∞, +∞),

6. The general constraint solving problem • Let D be a set and D a set of selected subsets of D. A n-bloc is a Cartesian product of n selected subsets. • Given a subset r of Dn and elements a1, . . . , an of D, we are interested in computing, if they exists, elements a01, . . . , a0n of D such that a01 ×· · ·×a0n is the least n-bloc for which the folowing equivalence of constraints holds:     (x , . . . , x ) ∈ r (x , . . . , x ) ∈ r 1 n 1 n         0      ∧ x1 ∈ a1  ∧ x 1 ∈ a 1   ↔           ... ...         0 ∧ x n ∈ an ∧ x n ∈ an • Thus a01 ×· · ·×a0n is the least n-bloc such that r ∩ a1 ×· · ·×an = r ∩ a01 ×· · ·×a0n, • which is also the least n-bloc such that r ∩ a1 ×· · ·×an ⊆ a01 ×· · ·×a0n.

9

7. Visualization of the problem

10

8. Approximation space

• Definition An approximation space is an ordered pair (D, D), where 1. D is any set, 2. D is a set of selected subsets of D, 3. D and ∅ belong to D. The space is total if for any subset r of D the subset of D, denoted and defined by, apx D (r) :=

\

{x ∈ D | r ⊆ x},

belongs to D.

11

9. Approximation space, next • Remark 1 In the partially ordered set (P(D), ⊆), the set apx D (r) is the greatest lower bound of the set of elements of D which contain r: apx D (r) := inf {x ∈ D | r ⊆ x} D

• Remark 2 If (D, D) is total then, in the partially ordered set (P(D), ⊆), the set apx D (r) is always the greatest element of the set of elements of D which contain r: apx D (r) := min {x ∈ D | r ⊆ x}

• Remark 3 A sufficient condition in order that (D, D) is total, is that D is closed by intersection (finite and infinite)

12

10. Properties of apx • Let (D, D) be an approximation space. We write apx for apx D . • Properties For any subsets r, s of D and any family of subsets ri of D, indexed by a set I: (i) (ii) (iii) (iv)

r ⊆ apx (r), (contraction), apx (apx (r)) = apx (r), (idempotence), r ⊆ s → apx (r) ⊆ apx (s), (weakly increasing), apx (∪i∈I ri) = apx (∪i∈I apx (ri)).

• Let (Dn, D(n)) be the approximation space defined by D(n) := {a1 ×· · ·×an | ai ∈ D, for all i ∈ 1..n}, The elements of D(n) are called n-blocs on D. • Property If r is a subset of Dn then, apx D(n) (r) = apx D (π1(r))×· · ·×apx D (πn(r)). where the i-th projection of r is denoted and defined by πi(r) := {d ∈ D | there exists (d1, . . . , dn) ∈ r with d = di}. • Conclusion Given a subset r of Dn and a n-bloc a on D, we want to compute apx D(n) (r ∩ a) 13

11. Our approximation spaces • Let (R, ≤) be the ordered set of real numbers and let F be a finite subset of R of the form F = {f−k , f−k+1, . . . , f1, f0, f1, . . . , fk−1, fk }, with fi < fi+1 and f−i = −fi • We consider the four approximation spaces of the form (R3, R(3)), with R being successively 1. the set composed of R and the (true) intervals of (R, ≤), 2. the set of convex subsets of (R, ≤), 3. the set composed of R, ∅ and the machine intervals of (R, ≤), that is to say, the non-empty intervals whose endpoints belong to F, 4. the set of convex machine subsets of (R, ≤), that is to say, those intervals whose greatest lower bounds and least upper bounds, if they exist, belong to F. • For each of these spaces, given a ∈ R(3), we want to compute apx R(3) (times ∩ a) with times := {(x1, x2, x3) ∈ R3 | x3 = x1x2}. 14

12. Sharper approximation space

• The following property allow us to replace the apx computations in the approximation spaces 1 and 3 by apx computations in the approximation spaces 2 and 4.

• Property If (D, D) and (D0, D0) are approximation spaces such that D ⊆ D0 , D ⊆ D 0 then, for any r ⊆ D, apx D (r) = apx D (apx D0 (r))

15

13. Sharper approximation space, next

• Proof We must prove that \

{a ∈ D | r ⊆ a} =

\

{a ∈ D | apx D0 (r) ⊆ a}

Thus it is sufficient to prove that for all a ∈ D we have r ⊆ a ↔ apx D0 (r) ⊆ a If r ⊆ a then apx D0 (r) ⊆ apx D0 (a) and, since a ∈ D0, we have apx D0 (r) ⊆ a. Thus r ⊆ a → apx D0 (r) ⊆ a Since r ⊆ apx D0 (r), apx D0 (r) ⊆ a → r ⊆ a

16

14. Translation of an approximation space

• The computations of apx (times ∩a) in the approximation spaces 2 and 4 will be performed by translations and computations into more convenient approximation spaces.

• Definition A translation of a total approximation space (D, D) into an approximation space (D0, D0) is a mapping ϕ, of type P(D) → P(D0), such that, 1. ϕ(apx D (r ∩ a)) = apx D0 (ϕ(r) ∩ ϕ(a)), for all r ⊆ D and a ∈ D, 2. the restriction of ϕ to D defines an injective mapping of type D → D0.

17

15. Convenient approximation space • Let (D, ) be a totally ordered set having a least element min(D) and a greatest element max(D) and let D be the set of intervals of D.

• Property For all intervals ai, even empty, 



max{inf(a1 ), . . . , inf(an )},  . a1 ∩ · · · ∩ an =   min{sup(a1), . . . , sup(an)}

• Property In the approximation space (D, D), for all intervals ai, even empty, 



min{inf(a1 ), . . . , inf(an )},  . apx (a1 ∪ · · · ∪ an) =   max{sup(a1), . . . , sup(an)}

18

.

About ordered sets: computing minima and maxima

19

16. Multi-monotonic function • Let a be a m-box in (D, ), that is to say, a Cartesian product of m intervals of (D, ). • Definition The set of endings of a is denoted and defined by    

∅, if a = ∅, else ends (a) :=  {min(π (a)), max(π (a))}×· · ·×{min(π (a)), max(π (a))}  1 1 m m • Definition A function of type a → D is multi-monotonic, if for all (α1, . . . , αm) ∈ a and all i ∈ 1..m, the mapping x 7→ f (α1, . . . , αi−1, x, αi+1, . . . , αm), of type πi(a) → D, is monotonic, that is to say, weakly increasing or weakly decreasing. • Example of a multi-monotonic function in (R, ≤), with a = [−2, 5] × [−3, 1], f : (x1, x2) 7→ x1x2. • Property of the endings Let a be a non empty m-box in (D, ) and f a multi-monotonic function of type a → D. The elements min{f (x) | x ∈ a}, max{f (x) | x ∈ a} exist and are respectivly equal to min{f (x) | x ∈ ends (a)}, max{f (x) | x ∈ ends (a)}.

20

17. Computing a maximum, example

• In (R, ≤), we want to compute y = max{x1x2 | x1 ∈ [−2, 5] and x2 ∈ [−3, 1]}

• Since multiplication is multi-monotonic, y = max{(−2)(−3), (−2)(+1), (+5)(−3), (+5)(+1)} = max{6, −2, −15, 5} = 6 21

.

About ordered sets: convex projections

22

18. Moving from dimension n to dimension 2 • Let (D, ) be an ordered set.

• Definition The subset r of Dn, with n ≥ 2, preserves convexity if, for all convex subsets ai of (D, ), the projection πn(r ∩ a1 ×· · ·×an−1 ×D) is convex.

• Definition Let r be a subset of Dn, with n ≥ 2. A i-cut of r, is a subset of D2 of the form {(x1, x2) ∈ D2 | (α1, . . . , αi−1, x1, αi+1, . . . , αi−1, x2) ∈ r}, with each αj ∈ πj (r) and i taken between 1 and n−1.

• Theorem A sufficient condition in order that a subset of Dn, with n ≥ 3, preserves convexity, is that each i-cut s of r preserves convexity and is such that π1(s) = πi(r).

23

19. The dimension 2 case

Theorem A sufficient condition in order that a subset r of D2 preserves convexity, is that • the projection π2(r) is convex, • when r is not empty, there exist monotonic mappings r and r, of type π1(r) → D such that, (x1, x2) ∈ r ↔ x2 ∈ [r(x1), r(x2)], for all x1 ∈ π1(r) and x2 ∈ D.

24

20. Example of a relation which preserves convexity

• Consider the subset of R3. 2



2



{(x, y, z) ∈ [−1, 1]×[−1, 0]×R | (x + 1) + z ≤ 4} ∪  corners :=    {(x, y, z) ∈ [−1, 1]×(0, 1]×R | (x − 1)2 + z 2 ≤ 4}

25

• This subset preserves convexity, since its i-cuts are of one of the 4 forms:

26

21. Other examples of relations which preserve convexity • The following relations preserve convexity times ndivision zdivision pdivision

:= := := :=

{(x, y, z) ∈ R3 | z = xy}, {(x, y, z) ∈ R3 | x = yz and y < 0}, {(x, y, z) ∈ R3 | x = yz and y = 0}, {(x, y, z) ∈ R3 | x = yz and y > 0},

• because zdivision = ({0}×{0}×R) ∪ ({R}×{0}×{0}), • the 1-cuts and 2-cuts of times and the 1-cuts of ndivision and pdivision are of one of the two forms,

27

• the 2-cuts of ndivision are of one of the two forms,

• and the 2-cuts of pdivision are of one of the two forms,

28

22. Decomposition of the multiplication • Let a be a Cartesain product of convex subsets of R.

• We have (π1(times ∩ a), π2(times ∩ a), π3(times ∩ a)) = 

 

                         

                       

a1 ∩ π3(ndivision ∩ a3 ×a2 ×D) ∪       a1 ∩ π3(zdivision ∩ a3 ×a2 ×D) ∪   ,    a1 ∩ π3(pdivision ∩ a3 ×a2 ×D)   , a2 ∩ π3(ndivision ∩ a3 ×a1 ×D) ∪ a2 ∩ π3(zdivision ∩ a3 ×a1 ×D) ∪ , a2 ∩ π3(pdivision ∩ a3 ×a1 ×D)

a3 ∩ π3(times ∩ a1 ×a2 ×D)

ai

:= πi(a)),

ndivision := {(u, v, w) ∈ R3 | (w, v, u) ∈ times and v < 0}, zdivision := {(u, v, w) ∈ R3 | (w, v, u) ∈ times and v = 0}, pdivision := {(u, v, w) ∈ R3 | (w, v, u) ∈ times and v > 0}. 29

• and each set of one of the forms ak ∩ π3(times ∩ ai ×aj ×D), ak ∩ π3(ndivision ∩ ai ×aj ×D), ak ∩ π3(zdivision ∩ ai ×aj ×D), ak ∩ π3(pdivision ∩ ai ×aj ×D), is convex.

30

.

About orderded sets: computing projections

31

23. Good relation • Definition A good n-ary relation, with n ≥ 3, is a subset r of Dn whose i-cuts s are all good binary relations and are such that π1(s) = πi(r).

• Definition A good binary relation is a subset r of D2 such that • the projection π1(r) is convex and admits a least element if it is lower bounded, and a greatest element, if it is upper bounded, • the projection π2(r) is convex, • when r is not empty, there exist monotonic mappings r and r, of type π1(r) → D such that, (x1, x2) ∈ r ↔ x2 ∈ [r(x1), r(x2)], for all x1 ∈ π1(r) and x2 ∈ D.

32

24. Computation of projections • Theorem For any good n-ary relation and n-box a in (D, ), with n ≥ 2,       

∅, if ∆ = ∅, else   πn(r ∩ a) =  min{r(x) | x ∈ ends (∆)},    , π (a) ∩  n   max{r(x) | x ∈ ends (∆)} with

∆ := (π1(r) ∩ π1(a))×· · ·×(πn−1(r) ∩ πn−1(a)), r(x1, . . . , xn−1) := min({xn | (x1, . . . , xn) ∈ r}), r(x1, . . . , xn−1) := max({xn | (x1, . . . , xn) ∈ r}), the functions r, r being necessarily defined when the box ∆ is not empty. • Remark If (D, ) admits a least and a greatest element, then the first formula of the theorem simplifies to   inf{rn(x) | x ∈ ends (∆)}, . πn(r ∩ a) = πn(a) ∩  sup{rn(x) | x ∈ ends (∆)}

33

25. Projection of the double corner

• We want to compute π3(corners ∩ a) with a a 3-box of (R, ≤) and 2 2 {(x, y, z) ∈ [−1, 1]×[−1, 0]×R | (x + 1) + z ≤ 4} ∪ 



corners :=   {(x, y, z) ∈ [−1, 1]×(0, 1]×R | (x − 1)2 + z 2 ≤ 4}

• Thus

with

      

∅, if ∆ = ∅, else   π3(corners ∩ a) =  min{ corners (u) | u ∈ ends (∆)},  π (a) ∩      3   max{corners (u) | u ∈ ends (∆)} ∆ := (π1(a) ∩ [−1, 1])×(π2(a) ∩ [−1, 1]), corners (x, y) := 0, r    

r corners (x, y) =    

4 − (x + 1)2, if y ≤ 0, 4 − (x − 1)2, if y > 0. 34

 

• Finally π3(corners ∩ a) =         

∅, if a1 = ∅ ∨ a2 = ∅, else     

[0,

a ∩   [0,

    3    

a1 a2 a3 ai ai

:= := := := :=

r

4 − (a1 + 1)2], if a2 ≤ 0 ∨ (a2 ≤ 0 ∧ −a1 ≥ a1),

r

4 − (a1 − 1)2], if a2 > 0 ∨ (a2 > 0 ∧ −a1 < a1)

π1(a) ∩ [−1, 1], π2(a) ∩ [−1, 1], π3(a), min(ai), when ai 6= ∅, max(ai), when ai 6= ∅.

35

.

Aggregated approximation space

36

26. Aggregated approximation space • Definition Given a total approximation space (D, D) and a subset r of D we denote and define the aggregate of r by agr D (r) := {apx D ({x}) | x ∈ r}

• Definition The agregate of the approximation space (D, D) is then the approximation space (D0, D0) := (agr D (D), {agr D (a) | a ∈ D} The elements of agr D (D) are called atomic elements of D.

n

• Remark If (D0, D0) is the aggregate space of (D, D) then (D0 , D0(n)) is the aggregate space of (Dn, D(n)) and agr D(n) (r1 ×· · ·×rn) = agr D (r1)×· · ·×agr D (rn).

37

27. Example • Let (R, R) be the approximation space, where R is the set of convex subsets of R, whose lower an upper bounds, if they exist, belong to F := {−1, 0, 1}. The aggregate space of (R, R) is (R0, R0), • where

                    

                    

                    

                    

(−∞, −1), h−3i, [−1, −1], h−2i, (−1, 0), h−1i, 0 , :=  R :=  h0i,  [0, 0],                    h1i,  (0, 1),                                  [1, 1], h2i,                     (1, +∞)   h3i  

• and R0 is the set of intervals of (D0, ), with hii  hji ↔ i ≤ j.

38

28. Example, next

• Consider the subset of R2 inverse := {(x, y) ∈ R2 | xy = 1}.

• According to

39

• we get                  

                 

                 

                 

h−3i×h−1i, (−∞, −1)×(−1, 0), h−2i×h−2i, [−1, −1]×[−1, −1], h−1i×h−3i, (−1, 0)×(−∞, −1), = agr R(2) (inverse) =             h1i×h3i, (0, 1)×(1, +∞),                             h2i×h2i, [1, 1]×[1, 1],                          h3i×h1i  (1, +∞)×(0, 1)

40

29. Translation into the aggregated space • Theorem If in an approximation space (D, D) the atomic elements of D are two by two disjoint then, for all r ⊆ D and a ∈ D, apx (r ∩ a) = apx ((∪x∈r apx ({x})) ∩ a)

• Corollary If the atomic elements of D are two by two disjoint, then the mapping agr D is a translation of the total approximation space (D, D) into its aggregate (D0, D0).

• Recalled definition A translation of a total approximation space (D, D) into an approximation space (D0, D0) is a mapping ϕ, of type P(D) → P(D0), such that, 1. ϕ(apx D (r ∩ a)) = apx D0 (ϕ(r) ∩ ϕ(a)), for all r ⊆ D and a ∈ D, 2. the restriction of ϕ to D defines an injective mapping of type D → D0.

41

30. Moving to machine reals • Let (R, R) be the approximation space, where R is the set of convex subsets of R whoses lower and upper bounds, if they exist, belong to F = {f−k , f−k+1, . . . , f1, f0, f1, . . . , fk−1, fk }, with fi < fi+1 and f−i = −fi • The aggregated space of (R, R) is (R0, R0), where                             

                            

                            

                            

(−∞, f−n), h−2n −1i, h−2ni, [f−n, f−n], ... ... (f−1, f0), h−1i, :=  R0 :=  [f0, f0],  h0i,                      (f , f ), h1i,     0 1                             . . . . . .                             h2ni, [f , f ],     n n                    (fn , +∞)    h2n+1i   R0 is the set of intervals of (D0, ), with hii  hji ↔ i ≤ j. • Remark If the fi0s are IEEE floating point numbers then fi is coded as i.

42

31. Moving to machine reals, next • By letting φ(a) := agr D0 (a), for all convex subset a of R, with eventual lower and upper bounds in F, ϕ(∅) ϕ([fi, fj ]) ϕ([fi, fj )) ϕ((fi, fj ]) ϕ((fi, fj )) ϕ([fi, +∞)) ϕ((−∞, fj ]) ϕ((fi, +∞)) ϕ((−∞, fj )) ϕ((−∞, +∞))

• For the relations times ndivision zdivision pdivision

:= := := :=

= = = = = = = = = =

∅, [h2ii, h2ji], [h2ii, h2j −1i], [h2i+1i, h2ji], [h2i+1i, h2j −1i], [h2ii, h2n+1i], [h−2n−1i, h2ji], [h2i+1i, h2n+1i], [h−2n−1i, h2j −1i], [h−2n−1i, h2n+1i].

{(x, y, z) ∈ R3 | z {(x, y, z) ∈ R3 | y {(x, y, z) ∈ R3 | y {(x, y, z) ∈ R3 | y 43

= xy}, = xz and y < 0}, = xz and y = 0}, = xz and y > 0}

we have agr R0(3) (times )

:= {(x, y, z) ∈ (R0)3 | z ∈ [xb×cy, xd×ey]},

agr R0(3) (pdivision ) := {(x, y, z) ∈ (R0)3 | z ∈ [xb/cy, xd/ey] and y ≺ h0i}, agr R0(3) (zdivision ) := ({h0i}×{h0i}×R0) ∪ (R0 ×{h0i}×{h0i}), agr R0(3) (ndivision ) := {(x, y, z) ∈ (R0)3 | z ∈ [xb/cy, xd/ey] and y  h0i}

44

32. Discrete multiplication • Values of hiib×chji                                  

first value whose condition part is satisfied: h0i, i = 0 or j = 0, h−iib×ch−ji, i < 0 and j < 0, −(h−iid×ehji), i < 0 and j > 0, hiib×chji :=   −(hiid×eh−ji), i > 0 and j < 0,        h1i, i = 1 or j = 1,         h2n+1i, i = 2n+1 ou j = 2n+1,        h2α(f i f j )i, i even, j even and f i f j ∈ F,    2 2 2 2      h2α(f i f j )+1i, in the other cases. b c b c 2

2

• with −hki := h−ki, α(x) := max{k ∈ 0..n | fk ≤ x}, β(x) := max{k ∈ 0..n | fk < x}.

45

33. Discrete multiplication, next • Values of hiid×ehji                                  

first value whose condition part is satisfied: h0i, i = 0 or j = 0, h−iid×eh−ji, i < 0 and j < 0, −(h−iib×chji), i < 0 and j > 0, hiid×ehji :=   −(hiib×ch−ji), i > 0 and j < 0,        h2n+1i, i = 2n+1 ou j = 2n+1,         h1i, i = 1 or j = 1,        h2β(f i f j )+2i, i even, j even and f i f j ∈ F,    2 2 2 2      h2β(f i f j )+1i, in the other cases. d e d e 2

2

• with −hki := h−ki, α(x) := max{k ∈ 0..n | fk ≤ x}, β(x) := max{k ∈ 0..n | fk < x}.

46

34. Discrete division • Values of hiib/chji                                  

first value whose condition part is satisfied: h0i, i=0, h−iib/ch−ji, i < 0 and j < 0, −(h−iid/ehji), i < 0 and j > 0, hiib/chji :=   −(hiid/eh−ji), i > 0 and j < 0,        h1i, i = 1 or j = 2n+1,         h2n+1i, i = 2n+1 ou j = 2n+1,        h2α(f i /f j )i, i even, j even and f i /f j ∈ F,    2 2 2 2      h2α(f i /f j )+1i, in the other cases. b c d e 2

2

• with −hki := h−ki, α(x) := max{k ∈ 0..n | fk ≤ x}, β(x) := max{k ∈ 0..n | fk < x}.

47

35. Discrete division, next • Values of hiid/ehji                                  

first value whose condition part is satisfied: h0i, i=0, h−iid/eh−ji, i < 0 and j < 0, −(h−iib/chji), i < 0 and j > 0, hiid/ehji :=   −(hiib/ch−ji), i > 0 and j < 0,        h2n+1i, i = 2n+1 or j = 2n+1,         h1i, i = 1 or j = 2n+1,        h2β(f i /f j )+2i, i even, j even and f i /f j ∈ F,    2 2 2 2      h2β(f i /f j )+1i, in the other cases. d e b c 2

2

• with −hki := h−ki, α(x) := max{k ∈ 0..n | fk ≤ x}, β(x) := max{k ∈ 0..n | fk < x}.

48

36. Solving the multiplication in the machine convex subsets

49

apx R(3) (times ∩ a) = 

 



a1 ∩ divz (a3 , a2 ) ∪            −1 ϕ (apx R0 a1 ∩ divn (a3 , a2 ) ∪)           a ∩ divp (a , a )   1 3 2      ×          , a ∩ divz (a , a ) ∪ 3 1    2           −1  ϕ (apx R0  a2 ∩ divn (a3 , a1 ) ∪)         a 2 ∩ divp (a3 , a2 )        ×    −1  ϕ (a3 ∩ mult (a1, a2))

ai

:= ϕ(πi(a)),

divz (u, v) := if h0i ∈ u and h0i ∈ v then [h−ni, hni] else ∅, 

divn (u, v) :=



inf{xb/cy | (x, y) ∈ ends (u×(v ∩ [h−2n−1i, h−1i]))}, , sup{xd/ey | (x, y) ∈ ends (u×(v ∩ [h−2n−1i, h−1i]))}

  



divp (u, v) :=



inf{xb/cy | (x, y) ∈ ends (u×(v ∩ [h1i, h2n+1i]))}, , sup{xd/ey | (x, y) ∈ ends (u×(v ∩ [h1i, h2n+1i]))}

  



mult (u, v) :=



inf{xb×cy | (x, y) ∈ ends (u×v)}, . sup{xd×ey | (x, y) ∈ ends (u×v)}

  

50

37. Example of discrete multiplication •

                    







    (−∞, −1), h−3i,                     [−1, −1], h−2i,                        h−1i, (−1, 0),          0 := R :=  h0i, [0, 0],                        (0, 1), h1i,                                 [1, 1], h2i,                      (1, +∞)   h3i 

                    

                    

                 

                   

−1,

F :=  0,  1

• Table of hiib×chji h−3i h−2i h−1i h0i h1i h2i h3i

h−3i h3i h3i h1i h0i h−3i h−3i h−3i

h−2i h3i h2i h1i h0i h−1i h−2i h−3i

h−1i h1i h1i h1i h0i h−1i h−1i h−3i

• Table of hiid×ehji 51

h0i h0i h0i h0i h0i h0i h0i h0i

h1i h−3i h−1i h−1i h0i h1i h1i h1i

h2i h−3i h−2i h−1i h0i h1i h2i h3i

h3i h−3i h−3i h−3i h0i h1i h3i h3i

h−3i h−2i h−1i h0i h1i h2i h3i

h−3i h3i h3i h3i h0i h−1i h−3i h−3i

h−2i h3i h2i h1i h0i h−1i h−2i h−3i

h−1i h3i h1i h1i h0i h−1i h−1i h−1i

52

h0i h0i h0i h0i h0i h0i h0i h0i

h1i h−1i h−1i h−1i h0i h1i h1i h3i

h2i h−3i h−2i h−1i h0i h1i h2i h3i

h3i h−3i h−3i h−1i h0i h3i h3i h3i

38. Example of discrete division •

                    







    (−∞, −1), h−3i,                     [−1, −1], h−2i,                        (−1, 0), h−1i,          0 := R :=  [0, 0], h0i,                        h1i, (0, 1),                                 h2i, [1, 1],                     (1, +∞)   h3i  

                    

                    

                 

                   

−1,

F :=  0,  1

• Table of hiib/chji h−3i h−2i h−1i h0i h1i h2i h3i

h−3i h1i h1i h1i h0i h−1i h−1i h−3i

h−2i h3i h2i h1i h0i h−1i h−2i h−3i

h−1i h3i h3i h1i h0i h−3i h−3i h−3i 53

h1i h−3i h−3i h−3i h0i h1i h3i h3i

h2i h−3i h−2i h−1i h0i h1i h2i h3i

h3i h−3i h−1i h−1i h0i h1i h1i h1i

• Table of hiid/ehji h−3i h−2i h−1i h0i h1i h2i h3i

h−3i h3i h1i h1i h0i h−1i h−1i h−1i

h−2i h3i h2i h1i h0i h−1i h−2i h−3i

h−1i h3i h3i h3i h0i h−1i h−3i h−3i

54

h1i h−3i h−3i h−1i h0i h3i h3i h3i

h2i h−3i h−2i h−1i h0i h1i h2i h3i

h3i h−1i h−1i h−1i h0i h1i h1i h3i

.

Extension of an approximation space

55

39. Adherence • Definition. Let (D, D) be an approximation space and r a subset of D. The adherence of r is denoted and defined by adh D (r) := {x ∈ D | r ∩ a 6= ∅, for all a ∈ D with x ∈ a}

• Properties For all subsets r, s of D and all element a of D: (i) (ii) (iii) (iv)

r ∩ a = ∅ → adh (r) ∩ a = ∅, r ⊆ a = ∅ → adh (r) ⊆ a, if 2 holds, adh (r ∪ s) = adh (r) ∪ adh (s), if 1 holds, apx (r ∩ a) = apx (adh (r) ∩ a), if 1 and 2 hold.

where 1 and 2 are the conditions: 1. the set D is closed for finite intersection, 2. any subset of D0 of the form D0 − a0, with a0 ∈ D0, can be written as a union of elements of D0,

56

40. Translation into an extended space • Theorem Let (D, D), (D0, D0) be two approximation, spaces, the first one being total, such that 1. the set D0 is closed for finite intersection, 2. any subset of D0 of the form D0 − a0, with a0 ∈ D0, can be written as a union of elements of D0, 3. the restriction of adh D0 to D defines a bijection of type D → D0, 4. a = adh D0 (a) ∩ D, for all a ∈ D. The mapping r 7→ adh D0 (r), of type P(D) → P(D0), is then a translation of the first approximation space into the second.

• Recalled definition A translation of a total approximation space (D, D) into an approximation space (D0, D0) is a mapping ϕ, of type P(D) → P(D0), such that, 1. ϕ(apx D (r ∩ a)) = apx D0 (ϕ(r) ∩ ϕ(a)), for all r ⊆ D and a ∈ D, 2. the restriction of ϕ to D defines an injective mapping of type D → D0.

57

41. Extension of R • We extend the approximation space 



R, set of reals,    :=    R set of convex subsets of R





 

• into the approximation space 0





+



R ,  R ∪ R ∪ R ∪ {−∞, +∞},   :=    0 + − R {[x, y] | x ∈ {−∞} ∪ R ∪ R and y ∈ {+∞} ∪ R ∪ R }





 

• with

R− := {x− | x ∈ R}, R+ := {x+ | x ∈ R}

and such that, for all elements x, y of R, x < y ← −∞ < x− < x < x+ < y − < y < y + < +∞

58

42. Extension of R, next • For all convex subset a of R, the set ϕ(a) := adh D0 (a) is the following interval of R0: ϕ(∅) ϕ([e, d]) ϕ([e, d)) ϕ((e, d]) ϕ((e, d)) ϕ([e, +∞)) ϕ((−∞, d]) ϕ((e, +∞)) ϕ((−∞, d)) ϕ((−∞, +∞))

• For the relations times ndivision zdivision pdivision

:= := := :=

= = = = = = = = = =

∅, [e, d], [e, d−], [e+, d], [e+, d−], [e, +∞], [−∞, d], [e+, +∞], [−∞, d−], [−∞, +∞].

{(x, y, z) ∈ R3 | z {(x, y, z) ∈ R3 | y {(x, y, z) ∈ R3 | y {(x, y, z) ∈ R3 | y 59

= xy}, = xz and y < 0}, = xz and y = 0}, = xz and y > 0}.

• we have adh R0(3) (times )

:= {(x, y, z) ∈ (R0)3 | z ∈ [xb×cy, xd×ey]},

adh R0(3) (pdivision ) := {(x, y, z) ∈ (R0)3 | z ∈ [xb/cy, xd/ey] and y < 0}, adh R0(3) (zdivision ) := ({0}×{0}×R) ∪ ({R}×{0}×{0}), adh R0(3) (ndivision ) := {(x, y, z) ∈ (R0)3 | z ∈ [xb/cy, xd/ey] and y > 0}.

60

43. Extended multiplication and division • xb×cy                                    

first value whose condition part is satisfied: (−x)b×c(−y), x < 0 and y < 0, −((−x)d×ey), x < 0 and y > 0, −(xd×e(−y)), x > 0 and y < 0, xb×cy :=  0, x = 0 or y = 0,     + + +   0 , x = 0 or y = 0 ,        +∞, x = +∞ or y = +∞,        (rp (x)rp (y))−, x ∈ R− or y ∈ R−,      + +  +   (rp (x)rp (y)) , x ∈ R or y ∈ R ,      xy, x ∈ R and y ∈ R. • with              

+∞, (−rp (x))−, −x :=  −x,    +   (−rp (x)) ,       −∞, 61

if x = −∞, if x ∈ R+, if x ∈ R, if x ∈ R−, if x = +∞.

• and, for all x ∈ R, rp (x−) := x, rp (x) := x, rp (x+) := x.

62

44. Extended multiplication and division, next

• xd×ey                                    

first value whose condition part is satisfied: (−x)d×e(−y), x < 0 and y < 0, −((−x)b×cy), x < 0 and y > 0, −(xb×c(−y)), x > 0 and y < 0, xd×ey :=  0, x = 0 ou y = 0,       +∞, x = +∞ ou y = +∞,        0+, x = 0+ ou y = 0+,        (rp (x)rp (y))+, x ∈ R+ ou y ∈ R+,      − −  −   (rp (x)rp (y)) , x ∈ R ou y ∈ R ,      xy, x ∈ R and y ∈ R. 63

• xd/ey and xb/cy xb/cy := xb×c(1/y), xd/ey := xd×e(1/y),

1/x

        −             

−∞, 0 , (rp (1/x))−, :=  1/x,      (rp (1/x))+,       +   0 ,      +∞,

64

if x = 0−, if x = −∞, if x ∈ R+, if x ∈ R, if x ∈ R−, if x = +∞, if x = 0+.

45. Solving the multiplication in the convex subsets

We conclude that, in the approximation space (R, R) of the reals by convex subsets, if a is a 3-box, 65

apx R(3) (times ∩ a) = 

 



a1 ∩ divz (a3 , a2 ) ∪            −1 ϕ (apx R0 a1 ∩ divn (a3 , a2 ) ∪)           a ∩ divp (a , a )   1 3 2      ×          , a ∩ divz (a , a ) ∪ 3 1    2           −1  ϕ (apx R0  a2 ∩ divn (a3 , a1 ) ∪)         a 2 ∩ divp (a3 , a2 )        ×    −1  ϕ (a3 ∩ mult (a1, a2))

ai

:= ϕ(πi(a)),

divz (u, v) := if 0 ∈ u and 0 ∈ v then [−∞, +∞] else ∅, 

divn (u, v) :=



inf{xb/cy | (x, y) ∈ ends (u×(v ∩ [−∞, 0 ]))}, , sup{xd/ey | (x, y) ∈ ends (u×(v ∩ [−∞, 0−]))}

  



divp (u, v) :=

+



inf{xb/cy | (x, y) ∈ ends (u×(v ∩ [0 , +∞]))}, , sup{xd/ey | (x, y) ∈ ends (u×(v ∩ [0+, +∞]))}

  



mult (u, v) :=





inf{xb×cy | (x, y) ∈ ends (u×v)}, . sup{xd×ey | (x, y) ∈ ends (u×v)}

  

66

.

Complement

67

46. Related work • Aillaud Christophe, R´esolution de contraintes par analyse de parties convexes de R, PhD dissertation (Th`ese de doctorat), Universit´e de la M´editerran´ee, 1997. • Benhamou Fr´ed´eric and William Older, Applying interval arithmetic to real, integer, and Boolean constraints, Journal of Logic Programming, vol 32, pages 1–24, 1997. • Benhamou F., P. Bouvier, A. Colmerauer, H. Garreta, B. Gilleta, J. L. Massat, G. Narboni, S. N’Dong, R. Pasero, J.F. Pique, Toura¨ıvane, M. Van Caneghem and E. Vetillard, Le manuel de Prolog IV, PrologIA Marseille, 1996. • BNR, BNR-Prolog user guide and reference manual, 1988. • Clearly J. G., Logical arithmetic, Future Computing Systems, vol 2, pages 125–149, 1987. • Colmerauer Alain, R´esolution de contraintes, Notes de cours, Diplˆome d’Etudes Approfondies d’Informatique, Course for first year PhD students, Universit´e de la M´editerran´ee, website: alain.colmerauer.free.fr, updated every year. • Dincbas M., P. Van Henterick, H. Simonis, A. Aggoun, T. Graf and F. Berthier, The constraint programming language CHIP, in Proc. Int. Conf on Fifth Generation Computer Systems, 1988. • Hickey T. J., M. H. van Emden and H. Wu, A unified framework for interval constraints and interval arithmetic, in Proceedings of Principles and Pratice of Constraint Programming – CP98, edited by M. Maher and J.-F. Puget, Springer Verlag, 1998. • N’Dong St´ephane, Un syst`eme approch´e de r´esolution num´erique, d´efinitions et m´ethodes, PhD dissertation (Th`ese de doctorat), Universit´e de la M´editerran´ee, 1999. • Older W. and A. J. Velino, Constraint arithmetic on real intervals, dans Constraint Logic Programming, edited by F. Benhamou and A. Colmerauer, MIT Press, 1993. 68

47. About unions and intersections, eventually infinite • Let D be any set of sets. The union of the elements of D is denoted and defined by ∪D := {x | there exists a ∈ D, with x ∈ a}. • The intersection of the elements of D is denoted and defined by ∩D := {x ∈ ∪D | for all a ∈ D, we have x ∈ a}. • Definition The set D is closed by intersection if for any non empty subset D0 of D the set ∩ D0 belongs D. • Definition The set D is closed by finite intersection if for all finite non empty subset D0 of D the set ∩ D0 belongs to D. • Property A sufficient condition in order that D is closed by intersection is that 1. D is closed by finite intersection and 2. any sequence of elements of D, strictly decreasing for inclusion, is finite.

69