Главная » Просмотр файлов » A.F. Donaldson - TopSPIN Version 2.2. Automatic symmetry reduction for the SPIN model checker. User Manual

A.F. Donaldson - TopSPIN Version 2.2. Automatic symmetry reduction for the SPIN model checker. User Manual (798531), страница 4

Файл №798531 A.F. Donaldson - TopSPIN Version 2.2. Automatic symmetry reduction for the SPIN model checker. User Manual (A.F. Donaldson - TopSPIN Version 2.2. Automatic symmetry reduction for the SPIN model checker. User Manual) 4 страницаA.F. Donaldson - TopSPIN Version 2.2. Automatic symmetry reduction for the SPIN model checker. User Manual (798531) страница 42019-09-19СтудИзба
Просмтор этого файла доступен только зарегистрированным пользователям. Но у нас супер быстрая регистрация: достаточно только электронной почты!

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

short) to a “smaller” integer type(e.g. bit). This is to prevent arithmetic overflow where possible.So, for example, the following code snippet will cause a type error:byte k;k = -1;due to the fact that -1 has type short, which is a larger type than byte.Because SPIN is not as strict as this, practical examples may rely on this kind of assignment. Forthis reason, specifying -relaxedassignment on the command line tells TopSPIN to allow a variableof any numeric type to be assigned the result of an expression of any numeric type.As in §3.2.3, note that where possible, smaller numeric types should be used for reasons ofefficiency.

If you find you need the -relaxedassignment option then consider whether you couldrefactor your specification to use smaller types, removing the need for this option and reducing the sizeof the state-vector.3.3Mandatory configuration file options3.3.1 saucyString option specifying path to the saucy program. This option must be set by the user.3.3.2 commonString option specifying path to the Common directory, which is part of the TopSPIN distribution. Thisoption must be set by the user.3.3.3 gapString option specifying path to the GAP program. This option must be set by the user.3.4Configuration file options for symmetry detection3.4.1 explainTopSPIN detects symmetry by finding the static channel diagram for the input specification, computingits symmetries, and checking these symmetries for validity against the Promela specification.

Somesymmetries may not be valid: TopSPIN will try to compute the largest valid set of static channel diagramsymmetries.If you have written a specification which you expect to be symmetric, but for which TopSPINreports invalid symmetries, it may be interesting to inspect the reason for this invalidity: it could indicatea typo in the specification, a misunderstanding on the part of the user, or a limitation of TopSPIN.Setting explain to a positive integer n tells TopSPIN to output explanations for the first ninvalid symmetries. An “explanation” for an invalid symmetry α consists of a pair of text files, onecalled m original.txt, the other m permuted.txt (where m < n). The original file showsthe input specification before α is applied, then shows the specification after normalization has takenplace. The permuted file shows the input specification after α has been applied, then shows the permutedspecification after normalization.

TopSPIN regards a symmetry as valid if these normalized specificationsare the same, so obviously they will not be identical for α.The two text files can be compared with a diff tool (e.g. the excellent WinMerge1 ). Looking atthe differences in the normalized parts should be instructive as to why the given symmetry is not valid.By way of example, here is a mutual exclusion specification with five processes:mtype = {N,T,C}mtype st[6]=Nproctype user() {do:: d_step { st[_pid]==N -> st[_pid]=T }:: d_step { st[_pid]==T &&(st[1]!=C && st[2]!=C && st[1]!=C && st[4]!=C && st[5]!=C)-> st[_pid]=C}:: d_step { st[_pid]==C -> st[_pid]=N }od}init {atomic {run user();run user();run user();run user();run user();}}Running TopSPIN on this example, in verbose mode and with explain=1, produces outputincluding the following:Saucy computed the following generators for Aut(SCD(P)):Aut(SCD(P)) = <(3 2),(2 1),(3 4),(5 4)>-------------------------------------Computing valid generators:(3 2) : not validgenerating explanation in files 0_original.txt and 0_permuted.txt(2 1) : not valid(3 4) : not valid(5 4) : valid--------------------------------------The tool has determined that the symmetry (3 2) which swaps user processes 3 and 2 is notvalid, and has written an explanation to the files 0_original.txt and 0_permuted.txt.Figure 3.1 shows the results of comparing these files with WinMerge.

This should alert the userto the fact that the operand st[1] != C appears twice in the highlighted boolean expression: this isclearly a mistake – one of these operands should be changed to st[2] != C to restore full symmetryand presumably correct the model.This illustrates the idea that presence of symmetry can actually be a correctness requirement inits own right.Default value: 0, i.e. no explanations will be given.3.4.2 timeboundWhen detecting symmetry, TopSPIN may use a coset search to try to improve upon the initially computedgroup of symmetries. This search can be time-consuming on particular examples.

The timeboundinteger option limits the length of time dedicated to this search to a maximum number of seconds.Default value: 0, which is used to specify that the coset search should be unbounded.3.4.3 conjugatesIf the coset search is taking a long time, it is sometimes possible to speed things up by picking a number of candidate symmetries at random, finding the conjugate of each known valid generator by these1.http://www.winmerge.org/Figure 3.1: Comparing text files output by the explain option to see why symmetry (3 2) is not valid.random elements, and then testing the conjugates for validity.

This is based on the practical observationthat valid symmetries are often conjugate to other valid symmetries. The conjugates integer optionis used to specify how many conjugates to use.Default value: 0. If symmetry detection is slow, try 5 conjugates.3.4.4 symmetryfileSometimes TopSPIN is unable to automatically detect symmetry from an input specification even thoughthe user knows that symmetry exists.

In this case, it is possible to specify a file containing generators for asymmetry group. The name of this file is specified via the symmetryfile option. If symmetryfileis set, TopSPIN will not attempt automatic symmetry detection, and will use the given group of symmetries for symmetry reduction.Default value: no file specified, automatic symmetry detection will be attempted..3.5Configuration file options for symmetry reduction3.5.1 strategyString option specifying the strategy to use for symmetry reduction. Options are: fast, enumerate, hillclimbing, segment, flatten, exactmarkers, approxmarkers.Default value: fast.3.5.2 transpositionsBoolean option stating whether to apply group elements as transpositions.Default value: true.3.5.3 stabiliserchainBoolean option stating whether to use a stabiliser chain for enumeration.Default value: true.3.5.4 vectoriseBoolean option stating whether to use vector SIMD instructions for symmetry reduction.

The nature ofthe resulting vector code depends on the target configuration file option (see §3.5.7).Default value: false.3.5.5 paralleliseBoolean option stating whether to parallelise symmetry reduction using pthreads.Default value: false.3.5.6 coresInteger option stating the number of cores available for parallel symmetry reduction.Default value: 1.3.5.7 targetString option specifying the target to use for vector and parallel symmetry reduction.

Options are: PC,CELL, POWERPC.Default value: not set by default.3.6Configuration file options for usability3.6.1 profileProfile the performance of TopSPIN?Default value: false.3.6.2 verboseDisplay progress of TopSPIN in detail?Default value: false.3.6.3 quietSuppress non-vital output?Default value: false.4LimitationsBefore using TopSPIN for advanced verification it is important to understand what can and cannot bedone with the tool.

TopSPIN places various restrictions on the form a Promela specification may have.Also, certain SPIN options are not (yet) compatible with symmetry reduction.This section briefly described the limitations of TopSPIN. Limitations marked with an asteriskcould be removed with relative ease: they just haven’t been dealt with yet.

If you’re working with SPINand TopSPIN and are being hindered by these restrictions then please get in tough (see §6.4) and effortswill be made to add appropriate features to TopSPIN.4.1Process instantiation and dynamic process creationTopSPIN requires all processes to be instantiated using run statements within an init process. The formof the init process must be:init {atomic {run ...;run ...;...run ...;<other statements>}}i.e. all process must be started atomically, and must come before any other statements in the init process(e.g.

initialisation code), which must also appear within the atomic block.In particular, TopSPIN does not support process instantiation using the active keyword, or viarun statements outside the init process.If a specification relies on dynamic process creation then it may be possible to re-model theprocesses as shown in Figures 4.1 and 4.2. Figure 4.1 shows a specification which instantiates copiesof proctype P dynamically. Assuming that 3 is an upper bound for the number of instances of P whichshould be running at any time, Figure 4.2 shows an alternative way of expressing the specification.

Theproctype P now includes a channel parameter, and an instance of P waits until it can receive on thischannel before executing its body. Its body is identical to the original, except that it includes a final gotoproctype P() {/* body */}proctype Q() {...run P();...}Figure 4.1: Skeleton Promela specification with dynamic process creation.chan wakeup_P_1 = [0] of {bit};chan wakeup_P_2 = [0] of {bit};chan wakeup_P_3 = [0] of {bit}proctype P(chan start) {sleep:start?1;/* body */goto sleep}proctype Q() {...if :: wakeup_P_1!1:: wakeup_P_2!1:: wakeup_P_3!1fi;...}init {atomic {/* original ‘run’ statements */run P(wakeup_P_1);run P(wakeup_P_2);run P(wakeup_P_3)}}Figure 4.2: Re-modelled Promela specification without dynamic process creation.statement after which it returns to its initial configuration.1 The init process instantiates three copiesof P , each with a distinct synchronous channel.

Instead of instantiating a copy of P , the proctype Qnow offers the literal value 1 to all channels on which instances of P may be listening. The exampleof Figures 4.1 and 4.2 can be adapted to handle multiple process types, with any fixed upper bound foreach process type.4.2Process terminationTechnically, process termination destroys symmetry in a Promela specification. SPIN only allows processes to terminate in reverse order. So, if five identical, terminating client proctypes are launchedsimultaneously with process identifiers in the range {1, 2, 3, 4, 5}, the processes will terminate one-byone in a fixed order: 5, 4, 3, 2, 1. This ordering on process identifiers breaks symmetry between theprocesses.Furthermore, the way symmetry reduction is implemented in TopSPIN is not strictly compatiblewith process termination.

After the initial state, TopSPIN assumes a fixed set of running processes. Ifa process dies, TopSPIN may try to exchange this processes’s state with that of another process whencomputing symmetry representatives, and this can (very occasionally) lead to verification-time errors(see §6.1.15).If you want to work with terminating processes, you can insert a dummy termination state at theend of each proctype using a line like the following:end_ok: false1. This goto statement should really be part of an atomic block which also resets any local variables of the proctype to theirinitial values.mtype = {N,T,C}mtype st[2]=Nproctype user(byte id) {do:: d_step { st[id]==N -> st[id]=T }:: d_step { st[id]==T && st[0]!=C && st[1]!=C -> st[id]=C }:: d_step { st[id]==C -> st[id]=N }od}init {atomic {run user(0);run user(1);}}Figure 4.3: Promela specification which uses user-defined process identifiers.mtype = {N,T,C} mtype st[3]=N;proctype user()do:: d_step {:: d_step {:: d_step {od}{st[_pid]==N -> st[_pid]=T }st[_pid]==T && st[1]!=C && st[2]!=C -> st[_pid]=C }st[_pid]==C -> st[_pid]=N }init {atomic {run user();run user();}}Figure 4.4: Re-modelled specification which uses the _pid variable.The end label ensures that SPIN will not complain about instances of the proctype blocking atthis label, and the false statement ensures that proctype instances will never truly terminate.4.3The_pidvariable should be usedFor symmetry to be detected, it is important for proctypes to use their built-in _pid variable rather thana user-defined process identifier.

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

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

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

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