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 6.<br />

EXPERIMENTS ON PRESBURGER ARITHMETIC<br />

No. of quantifiers Deepest nest<strong>in</strong>g of quantifiers Solv<strong>in</strong>g time<br />

(Orig<strong>in</strong>al/HB’s/Ours) (Orig<strong>in</strong>al/HB’s/Ours) (HB’s/Ours)<br />

2-seq 3190/729/583 54/25/19 0.31/0.28 s<br />

3-seq 10955/2823/2352 83/39/30 0.9/0.78 s<br />

4-seq 26705/7638/5165 113/54/42 2.27/1.47 s<br />

5-seq 53284/16830/14501 144/70/55 56.47/6.32 s<br />

Table 6.1. Experimental results of two simplification algorithms.<br />

6.3 Optimization of Cooper’s algorithm<br />

Before go<strong>in</strong>g to implement a parallel variant of Cooper’s algorithm, we consider<br />

some design choices for the algorithm itself. These design choices affect both sequential<br />

<strong>and</strong> parallel versions, but to keep th<strong>in</strong>gs simple we justify the selection by<br />

abenchmarkofthesequentialalgorithmonly. Therearesomeimprovementswhich<br />

have been done to contribute to a better implementation of Cooper’s procedure:<br />

• Reduce all literals as much as possible. By reduc<strong>in</strong>g, we mean all constra<strong>in</strong>ts<br />

are evaluated to truth values whenever possible, <strong>and</strong> their coefficients<br />

are reduced to the smaller values. This process will lead to early evaluation of<br />

some parts of a formula, <strong>and</strong> huge coefficients are avoided as much as possible.<br />

• Keep a formula <strong>in</strong> a uniform way. Thisimprovementreliesonourexperience<br />

of GNF, <strong>and</strong> uniform formulas not only have small depths of recursion<br />

but also collect many formulas <strong>in</strong> their collection <strong>and</strong> <strong>in</strong>troduce more chances<br />

of concurrency, which is important for the purpose of parallel execution later<br />

on.<br />

The test set consists of ten h<strong>and</strong>-annotated <strong>Presburger</strong> formulas, each one has<br />

3-4 nested universal quantifiers <strong>and</strong> a disjunction of 3-4 equalities. The benchmark<br />

is performed <strong>in</strong> the follow<strong>in</strong>g manner: each test is run 100 times <strong>and</strong> execution time<br />

is calculated by average execution time of 100 sessions. Moreover, some sessions<br />

were executed before the benchmark, so every function is ensured <strong>in</strong> the warm state<br />

<strong>in</strong> the time of benchmark<strong>in</strong>g.<br />

Here we consider two important optimizations which have been mentioned <strong>in</strong><br />

Section 4.2: elim<strong>in</strong>at<strong>in</strong>g blocks of quantifiers <strong>and</strong> us<strong>in</strong>g heterogeneous coefficients of<br />

literals. Theideaofelim<strong>in</strong>at<strong>in</strong>gblocksofquantifiersisclear,<strong>in</strong>steadofmanipulat<strong>in</strong>g<br />

ahugeformula,wesplitthework<strong>in</strong>tomanysmallpieces<strong>and</strong>manipulatemany<br />

small formulas. As illustrated <strong>in</strong> Figure 6.2, push<strong>in</strong>g blocks of quantifiers <strong>in</strong>to small<br />

formulas results <strong>in</strong> 10−20× performance ga<strong>in</strong> compared to the basel<strong>in</strong>e version. The<br />

result is significant because smaller formulas easily fit <strong>in</strong>to caches, so manipulat<strong>in</strong>g<br />

them is much faster <strong>in</strong> practice. Us<strong>in</strong>g heterogeneous coefficients adds up a slight<br />

performance ga<strong>in</strong> as demonstrated <strong>in</strong> the figure. Their advantage is two-fold; we save<br />

one traversal through the formula to collect all coefficients so result<strong>in</strong>g coefficients<br />

are smaller <strong>and</strong> result<strong>in</strong>g quantifier-free formulas are easier to evaluate <strong>in</strong> the later<br />

46

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

Saved successfully!

Ooh no, something went wrong!