Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

How can I fix this error? spin: model.pml: 1 4 , Error: syntax error saw 'data typename' near 'int' spin: model.pml: 2 5 , Error:

How can I fix this error?
spin: model.pml:14, Error: syntax error saw 'data typename' near 'int'
spin: model.pml:25, Error: syntax error saw 'data typename' near 'int'
spin: model.pml:9, Error: proctype thread not found
Problem
Two global int variables, x and y, are initialized to 10 and 0.
Two threads execute the following statements (in mixed syntax):
Thread 1: while (x != y){ x = x -1; y = y +1; }
Thread 2: await (x == y); atomic { x =8; y =2; }
Like in Promela, each assignment is an atomic action. Write a Promela model that captures the behavior of this system and
1. Use Spin to check if both threads always terminate, and to show what the final values of x and y can be.
2. Explain what happens if the two assignments in Thread 2 are not done atomically, and confirm your explanation using Spin.
Note: There may (or may not) be two or more final values.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Programming The Perl DBI Database Programming With Perl

Authors: Tim Bunce, Alligator Descartes

1st Edition

1565926994, 978-1565926998

More Books

Students also viewed these Databases questions

Question

How is a city like a natural ecosystem? How is it different?

Answered: 1 week ago

Question

Write formal and informal proposals.

Answered: 1 week ago

Question

Describe the components of a formal report.

Answered: 1 week ago

Question

Write formal and informal reports.

Answered: 1 week ago