29.04.2014 Views

Presburger Arithmetic and Its Use in Verification

Presburger Arithmetic and Its Use in Verification

Presburger Arithmetic and Its Use in Verification

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

CHAPTER 7.<br />

PARALLEL EXECUTION OF DECISION PROCEDURES<br />

Figure 7.4. Speedup factors <strong>in</strong> Cooper evaluation.<br />

7.2.1 F<strong>in</strong>d<strong>in</strong>g concurrency<br />

As mentioned <strong>in</strong> Section 4.2.2, convert<strong>in</strong>g <strong>Presburger</strong> formulas <strong>in</strong>to DNF is <strong>in</strong>evitable<br />

for the Omega Test. DNF is a significant bottleneck of the algorithm because<br />

formulas may grow exponentially. Take a formula ∧ m<br />

i=1 L i ∧ ∧ n<br />

j=1 (L1 j ∨ L2 j )<br />

as an example, its DNF version is a disjunction of 2 n conjunctions of m + n literals.<br />

DNF is a challenge for employ<strong>in</strong>g the Omega Test, but there is a chance of<br />

massive concurrency <strong>in</strong> this procedure. In the above example, 2 n conjunctions are<br />

totally <strong>in</strong>dependent <strong>and</strong> ready for be<strong>in</strong>g resolved <strong>in</strong> parallel. To do so we rely on<br />

the follow<strong>in</strong>g rule (which is similar to Equation 7.2):<br />

∃ x 1 ...x n . ∨ ∧<br />

L ij ≡ ∨ ∃ x 1 ...x n . ∧ L ij (7.3)<br />

i j i<br />

j<br />

Us<strong>in</strong>g DNF, we can easily divide a formula <strong>in</strong>to many smaller ones <strong>and</strong> apply the<br />

Omega Test <strong>in</strong>dependently. The parallel pattern used here is Data Parallelism,<br />

when we have the same operation work<strong>in</strong>g on a big collection of data. As discussed<br />

<strong>in</strong> Section 2.2, F# provide very good constructs for data parallelism such as<br />

Parallel.For(Each), Array.Parallel <strong>and</strong> PSeq module.<br />

Look<strong>in</strong>g <strong>in</strong>to details of the Omega Test procedure, it is easy to recognize that<br />

their three basic blocks could be executed <strong>in</strong> parallel because there is no requirement<br />

for order of executions among Real Shadow, Dark Shadow <strong>and</strong> Gray Shadow. We<br />

can easily spawn three <strong>in</strong>dependent Tasks, butthereisalittlecoord<strong>in</strong>ationwhich<br />

should be done between these tasks. First of all, if Real Shadow’s task completes<br />

first <strong>and</strong> returns false, the other tasks should be term<strong>in</strong>ated immediately. Similarly,<br />

if Dark Shadow’s task returns true, the other runn<strong>in</strong>g tasks should be stopped<br />

right away. In the worst-case scenario, the result is returned from Gray Shadow’s<br />

task. It is likely that this task is the longest runn<strong>in</strong>g one so total execution time is<br />

comparable to execution time of this task. This idea of three parallel coord<strong>in</strong>ated<br />

56

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!