Главная » Просмотр файлов » 5. Principles of Model Checking. Baier_ Joost (2008)

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

Файл №811406 5. Principles of Model Checking. Baier_ Joost (2008) (5. Principles of Model Checking. Baier_ Joost (2008).pdf) 18 страница5. Principles of Model Checking. Baier_ Joost (2008) (811406) страница 182020-08-25СтудИзба
Просмтор этого файла доступен только зарегистрированным пользователям. Но у нас супер быстрая регистрация: достаточно только электронной почты!

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

Forstatements stmt ∈ {skip, x := expr, c?x, c!expr} the set of substatements is sub(stmt) ={stmt, exit}. For sequential composition letsub(stmt1 ; stmt2 ) ={ stmt ; stmt2 | stmt ∈ sub(stmt1 ) \ {exit} } ∪ sub(stmt2 ).For conditional commands, the set of substatements is defined as the set consisting of theif–fi-statement itself and substatements of its guarded commands.

That is, for cond cmd70Modelling Concurrent Systemsbeing if :: g1 ⇒ stmt1 . . . :: gn ⇒ stmtn fi we havesub(cond cmd) = { cond cmd } ∪1insub(stmti ).The substatements of a loop loop given by do :: g1 ⇒ stmt1 . . . :: gn ⇒ stmtn od aredefined similarly, but taking into account that control moves back to loop when guardedcommands terminate. That is:sub(loop) ={ loop, exit } ∪1in{ stmt ; loop | stmt ∈ sub(stmti ) \ {exit} }.For atomic regions let sub(atomic{stmt}) = { atomic{stmt}, exit }.The definition of sub(loop) relies on the observation that the effect of a loop with a singleguarded command, say “do :: g ⇒ stmt od”, corresponds to the effect ofif g then stmt ; do :: g ⇒ stmt od else skip fiAn analogous characterization applies to loops with two or more guarded commands.Thus, the definition of the substatements of loop relies on combining the definitions of thesets of substatements for sequential composition and conditional commands.The formal semantics of nanoPromela program P = [P1 | .

. . |Pn ] where the behavior of theprocess Pi is specified by a nanoPromela statement is a channel system [PG1 | . . . |PGn ]over (Var, Chan) where Var is the set of variables and Chan the set of channels thatare declared in P. As mentioned before, a formal syntax for the variable and channeldeclarations will not be provided, and global and local variables will not be distinguished.We assume that the set Var of typed variables and the set Chan of channels (togetherwith a classification of the channels into synchronous and FIFO-channels of some capacitycap(·)) are given.

Hence, local variable and channel declarations for the processes Pi arenot considered. It is assumed that they are given by a nanoPromela-statement over somefixed tuple (Var, Chan).We now provide inference rules for the nanoPromela constructs. The inference rules for theatomic commands (skip, assignment, communication actions) and sequential composition,conditional and repetitive commands give rise to the edges of a “large” program graphwhere the set of locations agrees with the set of nanoPromela-statements. Thus, the edgeshave the formg:commg:α→ stmtstmt → stmt or stmt where stmt is a nanoPromela statement, stmt a substatement of stmt, and g a guard, αan action, and comm a communication action c?x or c!expr.

The subgraph consisting ofParallelism and Communication71the substatements of Pi then yields the program graph PGi of process Pi as a componentof the program P.The semantics of the atomic statement skip is given by a single axiom formalizing thatthe execution of skip terminates in one step without affecting the variablestrue: idskip → exitwhere id denotes an action that does not change the values of the variables, i.e., Effect(id, η)= η for all variable evaluations η.

Similarly, the execution of a statement consisting of anassignment x := expr has the trivial guard and terminates in one step:true : assign(x, expr)x := expr → exitwhere assign(x, expr) denotes the action that changes the value of x according to theassignment x := expr and does not affect the other variables, i.e., if η ∈ Eval(Var) andy ∈ Var then Effect(assign(x, expr), η)(y) = η(y) if y = x and Effect(assign(x, expr), η)(x)is the value of expr when evaluated over η. For the communication actions c!expr and c?xthe following axioms apply:c!exprc?xc!expr → exitc?x → exitThe effect of an atomic region atomic{x1 := expr1 ; . .

. ; xm := exprm } is the cumulativeeffect of the assignments xi := expri . It can be defined by the rule:true : αmatomic{x1 := expr1 ; . . . ; xm := exprm } → exitwhere α0 = id, αi = Effect(assign(xi , expri ), Effect(αi−1 , η)) for 1 i m.Sequential composition stmt1 ; stmt2 is defined by two rules that distinguish whether ornot stmt1 terminates in one step. If the first step of stmt1 leads to a location (statement)different from exit, then the following rule applies:g:αstmt1 → stmt1 = exitg:αstmt1 ; stmt2 → stmt1 ; stmt2If the computation of stmt1 terminates in one step by executing action α, then control ofstmt1 ; stmt2 moves to stmt2 after executing α:g:αstmt1 → exitg:αstmt1 ; stmt2 → stmt272Modelling Concurrent SystemsThe effect of a conditional command cond cmd = if :: g1 ⇒ stmt1 .

. . :: gn ⇒ stmtn fi isformalized by means of the following rule:h:αstmti → stmtigi ∧h:αcond cmd → stmtiThis rule relies on the test-and-set semantics where choosing one of the enabled guardedcommands and performing its first action are treated as an atomic step. The blocking ofcond cmd when none of its guards is enabled needs no special treatment.

The reason isthat cond cmd has no other edges than the ones specified by the rule above. Thus, in aglobal state s = 1 , . . . , n , η, ξ where the location i of the ith process is i = cond cmdand all guards g1 , . . . , gn evaluate to false, then there is no action of the ith process that isenabled in s. However, actions of other processes might be enabled. Thus, the ith processhas to wait until the other processes modify the variables appearing in g1 , . . . , gn such thatone or more of the guarded commands gi ⇒ stmti become enabled.For loops, say loop = do :: g1 ⇒ stmt1 . .

. :: gn ⇒ stmtn od, we deal with three rules. Thefirst two rules are similar to the rule for conditional commands, but taking into accountthat control moves back to loop after the execution of the selected guarded command hasbeen completed. This corresponds to the following rules:h:αh:αstmti → stmti = exitstmti → exitgi ∧h:αloop → stmti ; loopgi ∧h:αloop → loopIf none of the guards g1 , . . . , gn holds in the current state then the do–od-loop will beaborted. This is formalized by the following axiom:¬g1 ∧...∧¬gnloop → exitRemark 2.39.Test-and-Set Semantics vs. Two-Step SemanticsThe rules for if–fi- and do–od-statements formalize the so-called test-and-set semantics ofguarded commands. This means that evaluating guard gi and performing the first step ofthe selected enabled guarded command gi ⇒ stmti are performed atomically.

In contrast,SPIN’s interpretation of Promela relies on a two-step-semantics where the selection of anenabled guarded command and the execution of its first action are split into two steps.The rule for a conditional command is formalized by the axiomgi : idif :: g1 ⇒ stmt1 . . . :: gn ⇒ stmtn fi → stmtiParallelism and Communication73where id is an action symbol for an action that does not affect the variables. Similarly,the first two rules for loops have to be replaced for the two-step semantics by the followingrule:gi : idloop → stmti ; loopThe rule for terminating the loop remains unchanged.As long as we consider the statements in isolation, the test-and-set semantics and thetwo-step semantics are equal.

However, when running several processes in parallel, theinterleaving might cause undesired side effects. For example, consider the semaphore-basedsolution of the mutual exclusion problem, modeled by a nanoPromela program where thebehavior of Pi is given by the following nanoPromela-statement:do :: true ⇒ skip;if :: y > 0 ⇒ y := y − 1;criti := truefi;y := y + 1odThe initial value of the semaphore y is zero. Under the two-step semantics the mutualexclusion property is not guaranteed as it allows the processes to verify that the guardy > 0 of the if–fi-statement holds, without decreasing the value of y, and moving controlto the assignment y := y − 1.

But from there the processes can enter their critical sections.However, the protocol works correctly for the test-and-set semantics since then checkingy > 0 and decreasing y is an atomic step that cannot be interleaved by the actions of theother process.Remark 2.40.Generalized GuardsSo far we required that the guards in conditional or repetitive commands consist of Booleanconditions on the program variables. However, it is also often useful to ask for interactionfacilities in the guards, e.g., to specify that a process has to wait for a certain input alonga FIFO-channel by means of a conditional command if :: c?x ⇒ stmt fi.

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

Тип файла
PDF-файл
Размер
5,5 Mb
Тип материала
Высшее учебное заведение

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

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