Главная » Все файлы » Просмотр файлов из архивов » PDF-файлы » 5. Principles of Model Checking. Baier_ Joost (2008)

5. Principles of Model Checking. Baier_ Joost (2008) (5. Principles of Model Checking. Baier_ Joost (2008).pdf), страница 13

PDF-файл 5. Principles of Model Checking. Baier_ Joost (2008) (5. Principles of Model Checking. Baier_ Joost (2008).pdf), страница 13 Математические методы верификации схем и программ (63287): Книга - 10 семестр (2 семестр магистратуры)5. Principles of Model Checking. Baier_ Joost (2008) (5. Principles of Model Checking. Baier_ Joost (2008).pdf) - PDF, страница 13 (63287) - СтудИзба2020-08-25СтудИзба

Описание файла

PDF-файл из архива "5. Principles of Model Checking. Baier_ Joost (2008).pdf", который расположен в категории "". Всё это находится в предмете "математические методы верификации схем и программ" из 10 семестр (2 семестр магистратуры), которые можно найти в файловом архиве МГУ им. Ломоносова. Не смотря на прямую связь этого архива с МГУ им. Ломоносова, его также можно найти и в других разделах. .

Просмотр PDF-файла онлайн

Текст 13 страницы из PDF

Alternatively,another (more concrete) mutual exclusion algorithm could be selected that resolves thisscheduling issue explicitly. A prominent example of such algorithm has been provided in1981 by Peterson [332].Example 2.25.Peterson’s Mutual Exclusion AlgorithmConsider the processes P1 and P2 with the shared variables b1 , b2 , and x. b1 and b2 areBoolean variables, while x can take either the value 1 or 2, i.e., dom(x) = { 1, 2 }. Thescheduling strategy is realized using x as follows.

If both processes want to enter thecritical section (i.e., they are in location waiti ), the value of variable x decides which ofthe two processes may enter its critical section: if x = i, then Pi may enter its criticalsection (for i = 1, 2). On entering location wait1 , process P1 performs x := 2, thus givingprivilege to process P2 to enter the critical section.

The value of x thus indicates whichprocess has its turn to enter the critical section. Symmetrically, P2 sets x to 1 whenstarting to wait. The variables bi provide information about the current location of Pi .More precisely,bi = waiti ∨ criti .bi is set when Pi starts to wait. In pseudocode, P1 performs as follows (the code for processP2 is similar):46Modelling Concurrent SystemsPG1 :PG2 :noncrit1noncrit1b1 := true; x := 2b1 := falsewait1b2 := falsex=1 ∨ ¬b2crit1b2 := true; x := 1wait1x=2 ∨ ¬b1crit1Figure 2.9: Program graphs for Peterson’s mutual exclusion algorithm.P1loop forever...b1 := true; x := 2;wait until (x = 1 ∨ ¬b2 )do critical section odb1 := false...(* noncritical actions *)(* request *)(* release *)(* noncritical actions *)end loopProcess Pi is represented by program graph PGi over Var = { x, b1 , b2 } with locationsnoncriti , waiti , and criti , see Figure 2.9 above.

The reachable part of the underlying transition system TSPet = TS(PG1 ||| PG2 ) has the form as indicated in Figure 2.10 (page 47),where for convenience ni , wi , ci are used for noncriti , waiti , and criti , respectively. Thelast digit of the depicted states indicates the evaluation of variable x. For convenience, thevalues for bi are not indicated. Its evaluation can directly be deduced from the locationof PGi . Further, b1 = b2 = false is assumed as the initial condition.Each state in TSPet has the form loc1 , loc2 , x, b1 , b2 . As PGi has three possible locationsand bi and x each can take two different values, the total number of states of TSPet is 72.Only ten of these states are reachable.

Since there is no reachable state with P1 and P2being in their critical section, it can be concluded that Peterson’s algorithm satisfies themutual exclusion property.In the above program, the multiple assignments b1 := true; x := 2 and b2 := true; x := 1are considered as indivisible (i.e., atomic) actions. This is indicated by the brackets Parallelism and Communicationn1 , n2 , x = 247n1 , n2 , x = 1n1 , c2 , x = 1c1 , n2 , x = 2w1 , n2 , x = 2n1 , w2 , x = 1w1 , w2 , x = 1w1 , w2 , x = 2c1 , w2 , x = 1w1 , c2 , x = 2Figure 2.10: Transition system of Peterson’s mutual exclusion algorithm.and in the program text, and is also indicated in the program graphs PG1 and PG2 .We like to emphasize that this is not essential, and has only been done to simplify thetransition system TSPet .

Mutual exclusion is also ensured when both processes performthe assignments bi := true and x := . . . in this order but in a nonatomic way. Note that, forinstance, the order “first x := . . ., then bi := true” does not guarantee mutual exclusion.This can be seen as follows. Assume that the location inbetween the assignments x := . . .and bi := true in program graph Pi is called reqi . The state sequencenoncrit1 , noncrit2 ,req2 ,noncrit1 ,req2 ,req1 ,req2 ,wait1 ,req2 ,crit1 ,wait2 ,crit1 ,crit2 ,crit1 ,x = 1,x = 1,x = 2,x = 2,x = 2,x = 2,x = 2,b1b1b1b1b1b1b1= false,= false,= false,= true,= true,= true,= true,b2b2b2b2b2b2b2= false= false= false= false= false= true= trueis an initial execution fragment where P1 enters its critical section first (as b2 = false)after which P2 enters its critical section (as x = 2).

As a result, both processes aresimultaneously in their critical section and mutual exclusion is violated.2.2.3HandshakingSo far, two mechanisms for parallel processes have been considered: interleaving andshared-variable programs. In interleaving, processes evolve completely autonomously48Modelling Concurrent Systems• interleaving for α ∈/ H:α→1 s1s1 −−αs1 , s2 −−→ s1 , s2 αs2 −−→2 s2αs1 , s2 −−→ s1 , s2 • handshaking for α ∈ H:αα→1 s1 ∧ s2 −−→2 s2s1 −−αs1 , s2 −−→ s1 , s2 Figure 2.11: Rules for handshaking.whereas according to the latter type processes “communicate” via shared variables.

Inthis subsection, we consider a mechanism by which concurrent processes interact via handshaking. The term “handshaking” means that concurrent processes that want to interacthave to do this in a synchronous fashion. That is to say, processes can interact only ifthey are both participating in this interaction at the same time—they “shake hands”.Information that is exchanged during handshaking can be of various nature, ranging fromthe value of a simple integer, to complex data structures such as arrays or records.

Inthe sequel, we do not dwell upon the content of the exchanged messages. Instead, anabstract view is adopted and only communication (also called synchronization) actionsare considered that represent the occurrence of a handshake and not the content.To do so, a set H of handshake actions is distinguished with τ ∈ H. Only if bothparticipating processes are ready to execute the same handshake action, can messagepassing take place.

All actions outside H (i.e., actions in Act \ H) are independent andtherefore can be executed autonomously in an interleaved fashion.Definition 2.26.Handshaking (Synchronous Message Passing)Let TSi = (Si , Acti , →i , Ii , APi , Li ), i=1, 2 be transition systems and H ⊆ Act1 ∩ Act2with τ ∈ H. The transition system TS1 H TS2 is defined as follows:TS1 H TS2 = (S1 × S2 , Act1 ∪ Act2 , →, I1 × I2 , AP1 ∪ AP2 , L)where L(s1 , s2 ) = L1 (s1 ) ∪ L2 (s2 ), and where the transition relation → is defined bythe rules shown in Figure 2.11.Notation: TS1 TS2 abbreviates TS1 H TS2 for H = Act1 ∩ Act2 .Parallelism and CommunicationRemark 2.27.49Empty Set of Handshake ActionsWhen the set H of handshake actions is empty, all actions of the participating processescan take place autonomously, i.e., in this special case, handshaking reduces to interleavingTS1 ∅ TS2 = TS1 ||| TS2 .The operator H defines the handshaking between two transition systems.

Handshakingis commutative, but not associative in general. That is, in general we haveTS1 H (TS2 H TS3 ) = (TS1 H TS2 ) H TS3for H = H .However, for a fixed set H of handshake actions over which all processes synchronize, theoperator H is associative. LetTS = TS1 H TS2 H . .

. H TSn ,denote the parallel composition of transition systems TS1 through TSn where H ⊆ Act1 ∩. . . ∩ Actn is a subset of the set of actions Acti of all transition systems. This form ofmultiway handshaking is appropriate to model broadcasting, a communication form inwhich a process can transmit a datum to several other processes simultaneously.In many cases, processes communicate in a pairwise fashion over their common actions.Let TS1 . . . TSn denote the parallel composition of TS1 through TSn (with n > 0) whereTSi and TSj (0 < i = j n) synchronize over the set of actions Hi,j = Acti ∩ Actj such/ { i, j }. It is assumed that τ ∈ Hi,j .

The formal definitionthat Hi,j ∩ Actk = ∅ for k ∈of TS1 . . . TSn is analogous to Definition 2.26. The state space of TS1 . . . TSn resultsfrom the Cartesian product of the state spaces of TSi . The transition relation → is definedby the following rules:• for α ∈ Acti \ (Hi,j ) and 0 < i n:0<jni=jα→ i sisi −−αs1 , . . . , si , . . . , sn −−→ s1 , . . . , si , .

. . sn • for α ∈ Hi,j and 0 < i < j n:αα→ i si ∧ sj −−→ j sjsi −−αs1 , . . . , si , . . . , sj , . . . , sn −−→ s1 , . . . , si , . . . , sj , . . . , sn 50Modelling Concurrent SystemsAccording to the first rule, components can execute actions that are not subject to handshaking in a completely autonomous manner as in interleaving. The second rule states thatprocesses TSi and TSj (i = j) have to perform every handshaking action in Acti ∩ Actjtogether. These rules are in fact just generalizations of those given in Figure 2.11.Example 2.28.Mutual Exclusion by Means of an ArbiterAn alternative solution to the mutual exclusion problem between processes P1 and P2(as before) is to model the binary semaphore that regulates access to the critical sectionby a separate parallel process that interacts with P1 and P2 by means of handshaking.For simplicity, we ignore the waiting phase and assume that Pi simply alternates infinitelyoften between noncritical and critical sections.

Assume (much simplified) transition systemrepresentations TS1 and TS2 with just two states: criti and noncriti . The new process,named Arbiter, mimics a binary semaphore (see Figure 2.12). P1 and P2 communicatewith the Arbiter via handshaking over the set H = { request, rel }. Accordingly, the actionsrequest (requesting to access the critical section) and rel (to leave the critical section) haveto be executed synchronously with the Arbiter.

Свежие статьи
Популярно сейчас
А знаете ли Вы, что из года в год задания практически не меняются? Математика, преподаваемая в учебных заведениях, никак не менялась минимум 30 лет. Найдите нужный учебный материал на СтудИзбе!
Ответы на популярные вопросы
Да! Наши авторы собирают и выкладывают те работы, которые сдаются в Вашем учебном заведении ежегодно и уже проверены преподавателями.
Да! У нас любой человек может выложить любую учебную работу и зарабатывать на её продажах! Но каждый учебный материал публикуется только после тщательной проверки администрацией.
Вернём деньги! А если быть более точными, то автору даётся немного времени на исправление, а если не исправит или выйдет время, то вернём деньги в полном объёме!
Да! На равне с готовыми студенческими работами у нас продаются услуги. Цены на услуги видны сразу, то есть Вам нужно только указать параметры и сразу можно оплачивать.
Отзывы студентов
Ставлю 10/10
Все нравится, очень удобный сайт, помогает в учебе. Кроме этого, можно заработать самому, выставляя готовые учебные материалы на продажу здесь. Рейтинги и отзывы на преподавателей очень помогают сориентироваться в начале нового семестра. Спасибо за такую функцию. Ставлю максимальную оценку.
Лучшая платформа для успешной сдачи сессии
Познакомился со СтудИзбой благодаря своему другу, очень нравится интерфейс, количество доступных файлов, цена, в общем, все прекрасно. Даже сам продаю какие-то свои работы.
Студизба ван лав ❤
Очень офигенный сайт для студентов. Много полезных учебных материалов. Пользуюсь студизбой с октября 2021 года. Серьёзных нареканий нет. Хотелось бы, что бы ввели подписочную модель и сделали материалы дешевле 300 рублей в рамках подписки бесплатными.
Отличный сайт
Лично меня всё устраивает - и покупка, и продажа; и цены, и возможность предпросмотра куска файла, и обилие бесплатных файлов (в подборках по авторам, читай, ВУЗам и факультетам). Есть определённые баги, но всё решаемо, да и администраторы реагируют в течение суток.
Маленький отзыв о большом помощнике!
Студизба спасает в те моменты, когда сроки горят, а работ накопилось достаточно. Довольно удобный сайт с простой навигацией и огромным количеством материалов.
Студ. Изба как крупнейший сборник работ для студентов
Тут дофига бывает всего полезного. Печально, что бывают предметы по которым даже одного бесплатного решения нет, но это скорее вопрос к студентам. В остальном всё здорово.
Спасательный островок
Если уже не успеваешь разобраться или застрял на каком-то задание поможет тебе быстро и недорого решить твою проблему.
Всё и так отлично
Всё очень удобно. Особенно круто, что есть система бонусов и можно выводить остатки денег. Очень много качественных бесплатных файлов.
Отзыв о системе "Студизба"
Отличная платформа для распространения работ, востребованных студентами. Хорошо налаженная и качественная работа сайта, огромная база заданий и аудитория.
Отличный помощник
Отличный сайт с кучей полезных файлов, позволяющий найти много методичек / учебников / отзывов о вузах и преподователях.
Отлично помогает студентам в любой момент для решения трудных и незамедлительных задач
Хотелось бы больше конкретной информации о преподавателях. А так в принципе хороший сайт, всегда им пользуюсь и ни разу не было желания прекратить. Хороший сайт для помощи студентам, удобный и приятный интерфейс. Из недостатков можно выделить только отсутствия небольшого количества файлов.
Спасибо за шикарный сайт
Великолепный сайт на котором студент за не большие деньги может найти помощь с дз, проектами курсовыми, лабораторными, а также узнать отзывы на преподавателей и бесплатно скачать пособия.
Популярные преподаватели
Добавляйте материалы
и зарабатывайте!
Продажи идут автоматически
5167
Авторов
на СтудИзбе
437
Средний доход
с одного платного файла
Обучение Подробнее