12.07.2015 Views

Formal Verification of Workflow Patterns with SPIN

Formal Verification of Workflow Patterns with SPIN

Formal Verification of Workflow Patterns with SPIN

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

3 WORKFLOW PATTERNS TRANSLATION 5is denoted by aux an auxiliary array <strong>of</strong> size sizeq to distinguish between theactivities already completed from the others. After nishing, each activity sendsa message through a channel in the array qs to report it (e.g. if the activity thatcomunicates through channel qs[n] is nished, it will send a message throughthis channel reporting that). In this pattern translation, all the channels inthe array qs are transverse to see if there is something to receive from eachone <strong>of</strong> them. If there is, it will be received and marked it in the array aux(e.g aux[n]=1). Thus, the process in Promela which use the syncronizationdenition will only continue if it has received a message from each channel. Theuse <strong>of</strong> the keyword timeout is to avoid process starvation, giving the opportunityto other processes to execute.ExclusiveChoice - This pattern is dened as being a split <strong>of</strong> the control owinto two or more exclusive alternative paths. The pattern is exclusive in thesense that only one <strong>of</strong> the alternative paths may be chosen for the process tocontinue. This pattern is translated by the following inline denition.inline exclusiveChoice(qs,sizeq,choice,msg){if :: (choice>=0 && choice qs[choice]!msg;:: else -> skip;fi;}The process representing the activity which makes the choice must use thisdenition, and the alternative processes must use the recv denition.Simple Merge - The Simple Merge pattern provides a means <strong>of</strong> merging twoor more control ows <strong>of</strong> distinct activities <strong>with</strong>out synchronizing them. Thispattern corresponds to an exclusive OR-join and is translated as follows.inline simpleMerge(qs,sizeq,msg){int n;n=0;skip;S: if :: len(qs[n])>0 -> qs[n]?msg; goto E:: len(qs[n])==0 -> n++; goto Lfi;L: if :: n==sizeq -> n=0; timeout; goto S/* timeout: to give chance to another process to execute. */:: n goto Sfi;E: skip;}In this translation, each channel in the array qs will represent the communicationchannel between a specic Promela process and the process which mergesall the control ow paths. The process in Promela which merges the controlows <strong>of</strong> distinct processes must use the above denition. The processes thatrepresent the activities whose control ow will be joined must use the senddenition.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!