14.08.2013 Views

Reactive Systems: Modelling, Specification and Verification - Cs.ioc.ee

Reactive Systems: Modelling, Specification and Verification - Cs.ioc.ee

Reactive Systems: Modelling, Specification and Verification - Cs.ioc.ee

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 />

<strong>Modelling</strong> <strong>and</strong> analysis of mutual<br />

exclusion algorithms<br />

In the previous chapters of this book, we have illustrated the use of the ingredients<br />

in our methodology for the description <strong>and</strong> analysis of reactive systems by means<br />

of simple, but hopefully illustrative, examples. As we have mentioned repeatedly,<br />

the difficulty in underst<strong>and</strong>ing <strong>and</strong> reasoning reliably about even the simplest reactive<br />

systems has long b<strong>ee</strong>n recognized. Apart from the intrinsic scientific <strong>and</strong><br />

intellectual interest of a theory of reactive computation, this realization has served<br />

as a powerful motivation for the development of the theory we have presented so<br />

far, <strong>and</strong> of its associated verification techniques.<br />

In order to offer you further evidence for the usefulness of the theory you have<br />

learned so far in the modelling <strong>and</strong> analysis of reactive systems, we shall now use<br />

it to model <strong>and</strong> analyze some well known mutual exclusion algorithms. These algorithms<br />

are amongst the most classic ones in the theory of concurrent algorithms,<br />

<strong>and</strong> have b<strong>ee</strong>n investigated by many authors using a variety of techniques—s<strong>ee</strong>, for<br />

instance, the classic papers (Dijkstra, 1965; Knuth, 1966; Lamport, 1986). Here,<br />

they will give us the opportunity to introduce some modelling <strong>and</strong> verification techniques<br />

that have proven their worth in the analysis of many different kinds of reactive<br />

systems.<br />

In order to illustrate concretely the steps that have to be taken in modelling<br />

<strong>and</strong> verification problems, we shall consider a very elegant solution to the mutual<br />

exclusion problem proposed by Peterson <strong>and</strong> discussed in (Peterson <strong>and</strong> Silberschatz,<br />

1985).<br />

In Peterson’s algorithm for mutual exclusion, there are two processes P1 <strong>and</strong><br />

P2, two boolean variables b1 <strong>and</strong> b2 <strong>and</strong> an integer variable k that may take the<br />

values 1 <strong>and</strong> 2. The boolean variables b1 <strong>and</strong> b2 have initial value false, whereas the<br />

157

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

Saved successfully!

Ooh no, something went wrong!