• No se han encontrado resultados

Capítulo II. Marco Teórico

2.3. Teorías con otros enfoques

2.3.3. Teoría de Erick Heinz Lennenberg

In Chapter 8, we proved that every semi-algebraic set can be represented as the union of zero sets of finitely many regular semi-algebraic systems. It is natural to ask how to perform set theoretic operations, such as union, intersection, complement and difference of semi-algebraic sets, based on such a representation.

Note that each (regular) semi-algebraic system can also be seen as a quantifier free formula. So one can implement the set operations naively based on the algorithm RealTriangularize and logic operations. However, an obvious drawback of such an implementation is that it totally neglects the structure of a regular semi-algebraic system.

Indeed, if the structure of the computed object can be exploited, it is possible to obtain more efficient algorithms. One good example of this is theDifferencealgorithm, which computes the difference of the zero sets of two regular systems, presented in Chapter 5. This algorithm exploits the structure of a regular chain and outperforms the naive implementation by several orders of magnitude.

Apart from the algebraic computations, the idea behind the Difference algorithm in Chapter 5 is to compute the difference (A1∩A2)\(B1∩B2) in the following way:

(A1∩B1)∩(A2\B2) [

(A1\B1)∩A2. (9.1) Observe that if A1∩B1 =∅, then the difference is (A1 ∩A2). Moreover, computing ∩s

In this section, we present algorithms (Algorithm 33 and 34) which take advantage of the algorithm Difference (also an algorithm Intersection derived from it) and the idea presented above for computing the intersection and difference of semi-algebraic sets represented by regular semi-algebraic systems.

We provide proofs of the termination and correctness of Algorithm 36 and 37. The termination and correctness of the other algorithms can be easily derived from them by relation 9.1 and other logic arguments.

Algorithm 33: DifferenceRsas(R, R′)

Input: two regular semi-algebraic systems R= [Q, T, P>] and

R′ = [Q, T, P

>]

Output: a set of regular semi-algebraic systemsRi,

i= 1, . . . , e, such that ZR(R)\ZR(R′) =∪ei=1ZR(Ri). begin 1 Q:=Q ∧P>; 2 Q′ :=QP′ >; 3 T:=Difference(T, T′); 4 T′ :=Intersection(T, T′); 5 if T′ = then returnR; 6 for [T∗, H]Tdo 7 Q∗ =Q \ QH∗ 6 =; 8 output RealTriangularize(T∗,Q) 9 for [T∗, H]T do 10 Q∗ =Q ∧H∗ 6 =; 11 output RealTriangularize(T∗,Q) 12 end 13 Algorithm 34: IntersectionRsas(R, R′)

Input: two regular semi-algebraic systems R= [Q, T, P>] and

R′ = [Q, T, P

>]

Output: a set of regular semi-algebraic systemsRi,

i= 1, . . . , e, such that ZR(R)∩ZR(R′) =∪ei=1ZR(Ri). Q∗ :=Q ∧P >∧ Q′∧P>′; 1 for [T∗, H]Intersection(T, T) do 2 output RealTriangularize(T∗,QH∗ 6 =) 3

Algorithm 35: RealTriangularize(T,Q)

Input: T, a regular chain; Q, a quantifier free formula Output: a set of regular semi-algebraic systemsRi,

i= 1, . . . , e, such that WR(T)∩ZR(Q) =∪ei=1ZR(Ri).

for each conjunctive formula F N≥∧P>∧H6= do

1

output RealTriangularize(T, F, N≥, P>, H6=);

2

Algorithm 36: RealTriangularize(T, F, N≥, P>, H6=)

Input: a regular chain T and a semi-algebraic system S= [F, N≥, P>, H6=] Output: a set of regular semi-algebraic systemsRi,

i= 1· · ·e, such thatWR(T)∩ZR(S) =∪ei=1ZR(Ri).

T:=Triangularize(F, T);

1

for C ∈T do

2

output RealTriangularize(C, N≥, P>, H6=∪init(T)6=);

3

Algorithm 37: RealTriangularize(T, N≥, P>, H6=)

Input: a regular chain T and a semi-algebraic system S= [∅, N≥, P>, H6=] Output: a set of regular semi-algebraic systemsRi,

i= 1, . . . , e, such that WR(T)∩ZR(S) =∪ei=1ZR(Ri). H′ := init(T)H; 1 T:={[T,]}; T′ :=; 2 for pN do 3 for [T′, N]T do 4 T′ :=T′∪ {[C, N′]|CIntersect(p, T)}; 5 T′ :=T′∪ {[T′, N∪ {p}]} 6 T:=T′; T′ :=; 7 T:={[T′, NP, H]|[T, N]T}; 8 while T6=∅ do 9 let [T′, P, H]T; T:=T\ {[T, P, H]}; 10 for CRegularOnly(T′, PH) do 11 BP :=BorderPolynomialSet(C, P′H); 12 (DP,R) =GenerateRegularSas(BP, C, P′); 13 if R 6= then output R; 14 for f ∈DP \(P′ H)do 15 T:=T∪ {[D, P′, H]|DIntersect(f, C)}; 16

Proof. By the specification of Triangularize, we have V(F)∩W(T) ⊆ ∪C∈TW(C) ⊆

V(F)∩W(T). Therefore V(F)∩W(T) = ∪C∈TW(C)\V(init(T)). Thus its termi-

nation and correctness follows directly from that of Algorithm 37.

Proposition 9.2. Algorithm 37 terminates and satisfies its specification.

Proof. The terminations follows from the fact that at line 16 of this algorithm, the polynomial f is regular modulo sat(C), which guarantees that each new generated regular chain has smaller dimension than C. Next we prove the correctness.

Firstly, after line 8, we claim that the following three relations hold. (i) For any [T′, P, H]T, we have W(T)W(T).

(ii) We have Z(T, P ∪H) =∪[T′,P,H]TZ(T′, P′∪H′).

(iii) We have WR(T)∩ZR(N, P>, H6=) =∪[T,P,H]TWR(T′)∩ZR(P>′, H6=′ ).

Now we prove the claims by induction on the number of polynomials in N. If N =, thenT =T′,P =Pand H= init(T)H. So the claims clearly hold.

Let N = N′ ∪ {p} and we assume that the claims hold for N. Let Tbe all

the set of triples [T′, P, H] such that Z(T, P H) = ∪[

T′,P,H]T′Z(T′, P′ ∪H′), WR(T)∩ZR(N′ , P>, H6=) = ∪[T,P,H]T′WR(T′)∩ZR(P>′, H6=′ ) and W(T′) ⊆ W(T)

for any [T′, P, H]Thold.

Consider the loop from line 3 to 7. LetTbe the set of all [T′, P, H] after executing

the final iteration of this loop and line 8. For each triple [T′, P, H]T, the following

relation hold:

Z(T′, P′H′) =Z(T′, P′H′)V(p)Z(T′, P′ H′)\V(p). (9.2) By line 6, the triple [T′, P∪ {p}, H] belongs to T. Let T

1, . . . , Ts be the output

of Intersect. We have

V(p)W(T′)⊆ ∪s

i=1W(Ti)⊆V(p)∩W(T′). (9.3)

By line 5, [Ti, P′, H′] belongs toT. By induction hypothesis, we haveW(T′)⊆W(T),

together with relation 9.3, we deduce that W(Ti)⊆W(T) and

V(p)∩Z(T′, H′)⊆ ∪s

i=1Z(Ti, H′)⊆V(p)∩Z(T, H′). (9.4)

Combining relations 9.2, 9.4 and induction hypothesis, we deduce that claims (i), (ii) and (iii) hold forT and thus for N.

Secondly, we prove that the while loop from line 9 to 16 generates regular semi- algebraic systems Ri, i = 1, . . . , e, such that WR(T)∩ZR(S) =∪ei=1ZR(Ri). To this

end, it is enough to prove the following loop invariants. For a given iteration, let R be the set of regular semi-algebraic systems in the current output and let T be the set of unprocessed tasks [T′, P, H]. The invariant we shall prove is

WR(T)∩ZR(N, P>, H6=) = ∪R∈RZR(R)∪[T,P,H]TWR(T′)∩ZR(P>′, H6=′ ). (9.5)

The invariant clearly hold at the beginning by claim (iii). For a given iteration, we assume that the invariant holds at the beginning of it and we would like to prove that the invariant stills holds at the end of it.

For a given iteration, let [T′, P, H] be the task picked fromT. Let C

1, . . . , Cs be

output of RegularOnly, we have Z(T′, PH)⊆ ∪s

i=1Z(Ci, P′∪H′)⊆W(T), which

implies that WR(Ci)∩ZR(P>′, H6=′ )⊆WR(T)∩ZR(N≥, P>, H6=). RenameTas the set of all [Ci, P′, H′]. We thus deduce that relation 9.5 holds for the newT.

Moreover, each [Ci, P′∪H′] is a regular system. By the specifications of Border-

PolynomialSet and GenerateRegularRsas, for each [C, P′, H] T, there exists finitely

many regular semi-algebraic systems R1, . . . , Rs and a set Dsuch that

WR(C)∩ZR(P>′, H=6′ ) =∪si=1ZR(Ri)∪fD VR(f)∩WR(C)∩ZR(P>′, H6=′ ).

For a given f and C, Intersect computes regular chains T1, . . . , Tt such that V(f)∩

W(C)⊆ ∪t

i=1W(Ti)⊆ V(f)∩W(C). Note that W(C)⊆ W(T), which implies that

Z(Ti, H′) ⊆ W(T) and therefore WR(Ti)∩ZR(P>′, H6=′ ) ⊆ WR(T)∩ZR(N, P>, H6=).

Hence, we deduce that the invariant 9.5 stills holds at end of the iteration.