Главная » Просмотр файлов » 3. Verification of sequential and concurrent programs. Apt_ Olderog (3rd edition) (2010)

3. Verification of sequential and concurrent programs. Apt_ Olderog (3rd edition) (2010) (811405), страница 56

Файл №811405 3. Verification of sequential and concurrent programs. Apt_ Olderog (3rd edition) (2010) (3. Verification of sequential and concurrent programs. Apt_ Olderog (3rd edition) (2010).pdf) 56 страница3. Verification of sequential and concurrent programs. Apt_ Olderog (3rd edition) (2010) (811405) страница 562020-08-25СтудИзба
Просмтор этого файла доступен только зарегистрированным пользователям. Но у нас супер быстрая регистрация: достаточно только электронной почты!

Текст из файла (страница 56)

, n}, Ri is an await statement in Si .(ii) Given interference free standard proof outlines {pi } Si∗ {qi } for weaktotal correctness, i ∈ {1, . . . , n}, we associate with every potential deadlock of S a corresponding tuple (r1 , . . ., rn ) of assertions by put-ting fori ∈ {1, . . . , n}:• ri ≡ pre(Ri ) ∧ ¬B if Ri ≡ await B then S end,• ri ≡ qi if Ri ≡ E.⊓⊔VnIf we can show ¬ i=1 ri for every such tuple (r1 , .

. ., rn ) of assertions,none of the potential deadlocks can actually arise. This is how deadlock freedom is established in the second premise of the following proof rule for totalcorrectness of parallel programs.RULE 29: PARALLELISM WITH DEADLOCK FREEDOM(1) The standard proof outlines {pi } Si∗ {qi }, i ∈ {1, . . . , n}for weak total correctness are interference free,(2) For every potential deadlock (R1 , . . ., Rn ) of[S1 k. . .kSn ] the corresponding tupleVn ofassertions (r1 , . .

., rn ) satisfies ¬ i=1 ri .VnVn{ i=1 pi } [S1 k. . .kSn ] { i=1 qi }To prove total correctness of parallel programs with synchronization, we usethe following proof system TSY :PROOF SYSTEM TSY :This system consists of the group of axiomsand rules 1–5, 7, 25, 28, 29 and A2–A6.Proof outlines for parallel programs with synchronization are defined in astraightforward manner (cf. Chapter 7).The following example illustrates the use of rule 29 and demonstrates thatfor the components of parallel programs we cannot prove in isolation morethan weak total correctness.Example 9.2.

We now wish to prove the correctness formula{x = 0} [await x = 1 then skip endkx := 1] {x = 1}(9.1)of Example 9.1 in the proof system TSY. For the component programs weuse the following interference free standard proof outlines for weak total cor-3169 Parallel Programs with Synchronizationrectness:{x = 0 ∨ x = 1} await x = 1 then skip end {x = 1}(9.2)and{x = 0} x := 1 {x = 1}.Formula (9.2) is proved using the synchronization rule 28; it is true only in thesense of weak total correctness because the execution of the await statementgets blocked when started in a state satisfying x = 0.Deadlock freedom is proved as follows. The only potential deadlock is(await x = 1 then skip end, E).(9.3)The corresponding pair of assertions is((x = 0 ∨ x = 1) ∧ x 6= 1, x = 1),the conjunction of which is clearly false.

This shows that deadlock cannotarise. Rule 29 is now applicable and yields (9.1) as desired.⊓⊔SoundnessWe now prove the soundness of PSY. Since we noted already the soundnessof the synchronization rule 28, we concentrate here on the soundness proofsof the auxiliary variables rule 25 and the parallelism with shared variablesrule 27.Lemma 9.2. (Auxiliary Variables) The auxiliary variables rule 25 issound for partial (and total) correctness of parallel programs with synchronization.Proof.

See Exercise 9.6.⊓⊔To prove the soundness of the parallelism with shared variables rule 27 forpartial correctness of parallel programs with synchronization, we proceed asin the case of parallel programs with shared variables in Chapter 8. Namely,we first prove the following lemma analogous to the Strong Soundness forParallel Programs Lemma 8.8.Lemma 9.3. (Strong Soundness for Parallel Programs with Synchronization) Let {pi } Si∗ {qi }, i ∈ {1, . .

. , n}, be interference free standardproof outlines for partial correctness for component programs Si . Suppose that< [S1 k. . .kSn ], σ > →∗ < [R1 k. . .kRn ], τ >9.3 Verification317Vnfor some state σ satisfying i=1 pi , some component programs Ri with i ∈{1, . . . , n} and some state τ . Then for j ∈ {1, .

. . , n}• if Rj ≡ at(T, Sj ) for a normal subprogram T of Sj , then τ |= pre(T ),• if Rj ≡ E, then τ |= qj .Proof. Fix j ∈ {1, . . . , n}. It is easy to show that either Rj ≡ at(T, Sj ) fora normal subprogram T of Sj or Rj ≡ E (see Exercise 9.4). In the first caselet r stand for pre(T ) and in the second case let r stand for qj . We need toshow τ |= r.The proof is by induction on the length of the transition sequence considered in the formulation of the lemma, and proceeds analogously to theproof of the Strong Soundness for Parallel Programs Lemma 8.8. We needonly to consider one more case in the induction step: the last transition ofthe considered transition sequence is due to a step< Rk′ , τ ′ > → < Rk , τ >(9.4)of the kth component executing an await statement, say await B then Send.

ThenRk′ ≡ at(await B then S end, Sk ).By the induction hypothesis τ ′ |= pre(await B then S end). Also by thesemantics of await statements τ ′ |= B. Two cases now arise.Case 1 j = k.By the definition of a proof outline, in particular formation rule (xii) forthe await statements, there exist assertions p and q and an annotated versionS ∗ of S such that the following three properties hold:pre(await B then S end) → p,(9.5){p ∧ B} S ∗ {q} is a proof outline for partial correctness,(9.6)q → r.(9.7)Here r is the assertion associated with Rj and defined in the proof of theStrong Soundness for Parallel Programs Lemma 8.8, so r ≡ pre(T ) if Rj ≡at(T, Sj ) for a normal subprogram T of Sj and r ≡ qj if Rj ≡ E.Since τ ′ |= pre(await B then S end) ∧ B, by (9.5)τ ′ |= p ∧ B.(9.8)By (9.4)< await B then S end, τ ′ > → < E, τ >,so by the definition of semantics< S ′ , τ ′ > →∗ < E, τ > .(9.9)3189 Parallel Programs with SynchronizationNow by (9.6), (9.8) and (9.9), and by virtue of the Strong Soundness Theorem 3.3 we get τ |= q.

By (9.7) we conclude τ |= r.Case 2 j 6= k.The argument is the same as in the proof of the Strong Soundness forParallel Programs Lemma 8.8.⊓⊔Corollary 9.1. (Parallelism) The parallelism with shared variables rule 27is sound for partial correctness of parallel programs with synchronization.Corollary 9.2. (Soundness of PSY) The proof system PSY is sound forpartial correctness of parallel programs with synchronization.Proof.

We use the same argument as in the proof of the Soundness Corollary 7.1.⊓⊔Next, we prove soundness of the proof system TSY for total correctness ofparallel programs with synchronization. We concentrate here on the soundness proof of the new parallelism rule 29. To this end we establish the following two lemmata. The first one is an analogue of Termination Lemma 8.9.Lemma 9.4.

(Divergence Freedom) Let {pi } Si∗ {qi }, i ∈ {1, . . . , n}, beinterference free standard proof outlines for weak total correctness for component programs Si . ThenVn⊥ 6∈ Mtot [[[S1 k. . .kSn ]]]([[ i=1 pi ]]).Proof. The proof is analogous to the proof of the Termination Lemma 8.9.It relies now on the definition of proof outlines for weak total correctnessand the Strong Soundness for Component Programs Lemma 9.1 instead ofDefinition 8.3 and the Strong Soundness for Parallel Programs Lemma 8.8.Lemma 9.5.

(Deadlock Freedom) Let {pi } Si∗ {qi }, i ∈ {1, . . . , n}, beinterference free standard proof outlines for partial correctness for component programs Si . Suppose that for every potential deadlock (R1 , . . ., Rn )ofV[S1 k. . .kSn ] the corresponding tuple of assertions (r1 , . . ., rn ) satisfiesn¬ i=1 ri . ThenVn∆ 6∈ Mtot [[[S1 k. . .kSn ]]]([[ i=1 pi ]]).Proof. Suppose that the converse holds. Then for some states σ and τ andcomponent programs T1 , . . ., Tn< [S1 k.

. .kSn ], σ > →∗ < [T1 k. . .kTn ], τ >,where < [T1 k. . .kTn ], τ > is a deadlock.By the definition of deadlock,(9.10)9.4 Case Study: Producer/Consumer Problem319(i) for every i ∈ {1, . . . , n} eitherTi ≡ at(Ri , Si )(9.11)for some await statement Ri in the component program Si , orTi ≡ E,(9.12)(ii) for some i ∈ {1, . . . , n} case (9.11) holds.By collecting the await statements Ri satisfying (9.11) and by definingRi ≡ E in case of (9.12), we obtain a potential deadlock (R1 , .

. ., Rn ) of[S1 k. . .kSn ]. Consider now the corresponding tuple of assertions (r1 , . . ., rn )and fix some i ∈ {1, . . . , n}.If Ri ≡ await B then S end for some B and S, then ri ≡ pre(Ri ) ∧ ¬B.By the Strong Soundness for Component Programs Lemma 9.1, (9.10) and(9.11) we have τ |= pre(Ri ). Moreover, since < [T1 k. . .kTn ], τ > is a deadlock,τ |= ¬B also. Thus τ |= ri .If Ri ≡ E, then ri ≡ qi . By the Strong Soundness for Component ProgramsLemma 9.1, (9.10)Vnwe have τ |= ri , as well.Vn and (9.11)⊔Thus τ |= i=1 ri ; so ¬ i=1 ri is not true. This is a contradiction.

Характеристики

Список файлов книги

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