25.12.2014 Views

On improving efficiency of model checking through systematically ...

On improving efficiency of model checking through systematically ...

On improving efficiency of model checking through systematically ...

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.

start<br />

L2==0<br />

start<br />

L1:=0<br />

l2<br />

l3<br />

L2:=1<br />

w1:=Latest<br />

l2<br />

L2:=0<br />

L2==1<br />

l4<br />

Prefer1:=w1<br />

l3<br />

l4<br />

l5<br />

L1==0<br />

L1:=1<br />

l6<br />

ridx:=Prefer2<br />

r1:=Latest<br />

Prefer2:=r1<br />

L1==1<br />

l7<br />

ridx:=Prefer1<br />

reading<br />

l9<br />

l5<br />

L1==0<br />

L1:=1<br />

l6<br />

L1==1<br />

l7<br />

w2:=Prefer1 w2:=Prefer2<br />

l8<br />

l11<br />

Precon:=w2<br />

l10<br />

j:=Latest<br />

w2:=Precon<br />

(w2==3 and j==2) or<br />

(w2==3 and j==3) or<br />

(w2==2 and j==3)<br />

widx:=1<br />

widx:=3<br />

writing<br />

(w2==1 and j==2) or<br />

(w2==2 and j==1) or<br />

(w2==2 and j==2)<br />

widx:=2<br />

(w2==1 and j==1) or<br />

(w2==1 and j==3) or<br />

(w2==3 and j==1)<br />

Figure 4.2: Reader and Writer graph for the algorithm<br />

bounded. Moreover, there is no real-time in this <strong>model</strong>. Since this <strong>model</strong><br />

contains many locations and transitions, the Nbac <strong>model</strong> is large in terms<br />

<strong>of</strong> physical size.<br />

We choose it as a case study because PMC proves that the algorithm does<br />

not satisfy the safety property. We are interested in <strong>checking</strong> whether we<br />

get the same result using our approach. However, Nbac and Uppaal can<br />

prove the safety property separately. Despite <strong>of</strong> that fact, this system still<br />

remains a good case study for its characteristic which is a finite system and<br />

large in physical size.<br />

4.3 Fischer’s protocol<br />

Fischer’s protocol is a mutual exclusion algorithm in which n processes uses<br />

timing constraints and a shared variable to ensure mutual exclusion. Figure<br />

4.3 shows two processes from Fischer’s protocol. Each process has a unique<br />

identifier, a clock x and 4 locations A, B, C and CS. They share a common<br />

variable namely lock. From location A each process can make a transition<br />

to location B if lock has value 0. It stays in B for k seconds before assigning<br />

its id to lock. After setting value for lock, it goes to location C. Then<br />

the process may enter the critical section (location CS) after it spends at<br />

40

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

Saved successfully!

Ooh no, something went wrong!