{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

[by ? above = ΞΌx β€’ a β†’ b β†’ c β†’ x | b β†’ a

Info iconThis preview shows pages 14–21. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ))) [by ‑ above] = ΞΌX β€’ ( a β†’ b β†’ c β†’ X | b β†’ a β†’ c β†’ X ) [since this is guarded] Therefore ( P || Q ) = ( a β†’ c β†’ X ( a β†’ b β†’ c β†’ X | b β†’ a β†’ c β†’ X )) by ‑ above 14 ’ & $ % Example: The Dining Philosophers (1) Describing the example: In ancient times, a wealthy philanthropist endowed a College to accommodate five eminent philosophers. Each philosopher had a room in which he could engage in his professional activity of thinking; there was also a common dining room, furnished with a circular table, surrounded by five chairs, each labelled by the name of the philosopher who was to sit in it. The names of the philosophers were PHIL0, PHIL1, PHIL2, PHIL3, PHIL4, and they were disposed in this order anticlockwise around the table. To the left of each philosopher there was laid a golden fork, and in the centre stood a large bowl of spaghetti, which was constantly replenished. A philosopher was expected to spend most of his time thinking; but when he felt hungry, he went to the dining room, sat down in his own chair, picked up his own fork on his left, and plunged it into the spaghetti. But such is the tangled nature of spaghetti that a second fork is required to carry it to the mouth. The philosopher therefore had also to pick up the fork on his right. When he was finished he would put down both his forks, get up from his chair, and continue thinking. Of course, a fork can be used by only one philosopher at a time. If the other philosopher wants it, he just has to wait until the fork is available again. 15 ’ & $ % Diagram for Illustrating the Example Please see page 57 (i.e., 79) of the book. 16 ’ & $ % Alphabets of the Example (1) For PHIL i , its alphabet is defined: Ξ±PHIL i = { i.sits down,i.gets up, i.picks up fork.i,i.picks up fork. ( i βŠ• 1) , i.puts down fork.i,i.puts down fork. ( i βŠ• 1) } (2) For the i-th fork, its alphabet is defined as: Ξ±FORK i = { i.picks up fork.i, ( i β€œ 1) .picks up fork.i, i.puts down fork.i, ( i β€œ 1) .puts down fork.i } 17 ’ & $ % Behavior of the Example (1) Apart from thinking and eating which we have chosen to ignore, the life of each philosopher is described as the repetition of a cycle of six events PHIL i = ( i.sits down β†’ i.picks up fork.i β†’ i.picksupfork. ( i βŠ• 1) β†’ i.puts down fork.i β†’ i.puts down fork. ( i βŠ• 1) β†’ i.gets up β†’ PHIL i ) (2) The role of a fork is a simple one; it is repeatedly picked up and put down by one of its adjacent philosophers (the same one on both occasions) 18 ’ & $ % FORK i = ( i.picks up fork.i β†’ i.puts down fork.i β†’ FORK i | ( i β€œ 1) .picks up fork.i β†’ ( i β€œ 1) .puts down fork.i β†’ FORK i ) (3) The behaviour of the whole College is the concurrent combination of the behaviour of each of these components PHILOS = ( PHIL || PHIL 1 || PHIL 2 || PHIL 3 || PHIL 4 ) FORKS = ( FORK || FORK 1 || FORK 2 || FORK 3 || FORK 4 ) COLLEGE = PHILOS || FORKS 19 ’ & $ % Variation of the Example (1) Variation 1 An interesting variation of this story allows the philosophers to pick...
View Full Document

{[ snackBarMessage ]}

Page14 / 55

[by β€ above = ΞΌX β€’ a β†’ b β†’ c β†’ X | b β†’ a β†’ c...

This preview shows document pages 14 - 21. Sign up to view the full document.

View Full Document Right Arrow Icon bookmark
Ask a homework question - tutors are online