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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Variable declaration. All variables, global and local variables, <strong>of</strong> an<br />

XTG <strong>model</strong> are declared in Nbac as global state variables. Since Nbac has a<br />

single namespace, it is possible that there are coincidences on local variable<br />

names in an XTG <strong>model</strong>. In these cases, names <strong>of</strong> variables must be changed.<br />

Integer and Boolean variables in an XTG <strong>model</strong> can be declared the same<br />

way in Nbac <strong>model</strong>. Clock variables, however, are not supported in Nbac.<br />

We declare them as Integers. Our method to <strong>model</strong> their real-time notion<br />

is described hereafter.<br />

In Figure 2.2, lock is a shared integer variable between two processes; x<br />

is a local clock variable to represent the clock in each process. In the Nbac<br />

<strong>model</strong>, lock is <strong>model</strong>ed by two Boolean variables lock1 and lock2. The<br />

reason for such adaption is that Boolean variables is handled exactly while<br />

Interger variables are approximate in Nbac. Integer variables are approximate<br />

in Nbac because they are abstracted by convex polyhedra. Moreover,<br />

in Fischer’s protocol, lock is used to control the status <strong>of</strong> the critical section<br />

(lock ∈{0, 1}). Thus, it is natural to <strong>model</strong> lock like that. Two integer<br />

variables c1,c2 are introduced to <strong>model</strong> the local clock variable x.<br />

Figure 2.3 shows an updated version <strong>of</strong> the Fischer’s protocol when it is<br />

specified in Nbac.<br />

lock1 != true<br />

l10<br />

lock1 == false,<br />

lock2 ==false<br />

c1 := 0<br />

l11<br />

c1 < 2<br />

c1 2,<br />

lock1 == true<br />

l13<br />

lock1 := false<br />

lock2 != true<br />

l20<br />

lock2 == 0,<br />

lock1 == 0<br />

c2:=0<br />

l21<br />

c2 < 2<br />

c2 2,<br />

lock2 == true<br />

l23<br />

lock2 := false<br />

Figure 2.3: Two parallel processes in the Nbac updated Fischer’s protocol<br />

Parallel processes. In XTG, we can specify several processes in a system<br />

independently and then simply declare them as parallel processes. In<br />

15

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

Saved successfully!

Ooh no, something went wrong!