Exam: Question 2 Flashcards

PROMELA & SPIN

1
Q

How do you specify real-world systems in PROMELA?

A
  • define global variables with “#define”
  • make proctypes for all processes that do logic
  • add comms if needed
  • add init process to start proctypes without active keyword
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How do you specify real-world systems in PROMELA, using synchronous comms?

A
  • define global variables with “#define”
  • make proctypes for all processes that do logic
  • add init process to start proctypes without active keyword
  • set up (unidirectional) channels for each possible direction of data transfer
  • set up mtype of possible message types
  • set up a byte array to hold data
  • add getting logic with ? and sending logic with !
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How do you show whether a PROMELA system may livelock?

A

go through possible execution scenarios from initialisation and find if they may cause each other to infinitely compete for a resource but still perform some action or change state

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is livelock?

A

A livelock is similar to a deadlock, except that the states of the processes involved in the livelock constantly change with regard to one another, none progressing.

A real-world example of livelock occurs when two people meet in a narrow corridor, and each tries to be polite by moving aside to let the other pass, but they end up swaying from side to side without making any progress because they both repeatedly move the same way at the same time.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Which PROMELA construct can be used to show that between two send communication actions there is always another communication?

A

A trace. A trace or notrace declaration does not specify new behaviour but instead states a correctness requirement on existing behaviour in the remainder of the system.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How can you make a constraint in PROMELA to show that between two send communication actions there is always another communication?

A

An event trace declaration that specifies the correctness requirement that send operations on channel q1 alternate with receive operations on channel q2. It also checks that all send operations on q1 are (claimed to be) exclusively messages of type a and all receive operations on channel q2 are exclusively messages of type b. This is written as follows:

mtype = { a, b }; // message type
trace {
        do
        :: q1!a; q2?b
        od
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How can you show whether a PROMELA specification holds a constraint?

A

Consider different possible considerations to find whether or not any possible execution does not satisfy the constraint and use it as proof of counterexample; otherwise, it does holds.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is weak fairness?

A

“Every process that is continuously enabled from a certain time instant onwards gets its turn infinitely often.”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is strong fairness?

A

“Every process that is enabled infinitely often gets its turn infinitely often.”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is unconditional fairness?

A

“Every process gets its turn infinitely often.”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the difference between weak, strong, and unconditional fairness?

A

unconditional = processes always get turns infinitely often

strong = all processes enabled infinitely often get turns infinitely often

weak = all processes constantly enabled from a given time get turns infinitely often

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What does it mean to check a PROMELA property under strong/weak fairness?

A

!

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How do you write a PROMELA never claim to prove or disprove a LTL property?

A

!

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How do you specify real-world systems in PROMELA, using asynchronous comms?

A

!

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How can SPIN check for livelocks?

A

!

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What does it mean for a PROMELA specification to not terminate correctly?

A

!

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

How do you show whether it is possible for a PROMELA specification to not terminate correctly?

A

!

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

How can SPIN be used to check whether it is possible for a PROMELA specification to not terminate correctly?

A

!

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What is an alternating bit protocol?

A

!

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

How can you model the alternating bit protocol in PROMELA?

A

!

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

What is the PROMELA timeout statement?

A

!

22
Q

What is the PROMELA timeout statement useful for?

A

!

23
Q

How can you find a trace that matches a PROMELA spec?

A

!

24
Q

What is a trace in SPIN?

A

!

25
Q

What is a never claim in SPIN?

A

!

26
Q

What is the difference between a trace and never claim in SPIN?

A

!

27
Q

How do you express strong fairness in LTL?

A

!

28
Q

How do you express weak fairness in LTL?

A

!

29
Q

What can check an LTL property over a PROMELA specification under strong fairness?

A

!

30
Q

What can check an LTL property over a PROMELA specification under weak fairness?

A

!

31
Q

How do you define a second process for a given PROMELA spec with a given first process, which will always terminate with an atomic block around the actions of the first process, but may not without the atomic block?

A

!

32
Q

What is the Dining Philosophers problem?

A

!

33
Q

What is deadlock?

A

!

34
Q

How do you find whether a PROMELA specification could deadlock?

A

!

35
Q

How do you implement starvation freedom as a LTL property?

A

!

36
Q

How do you implement mutual exclusion as an LTL property?

A

!

37
Q

What does starvation freedom mean?

A

!

38
Q

What does mutual exclusion mean?

A

!

39
Q

How do you extend a PROMELA specification using synchronous comms to go to the next value after 3 failed sends?

A

!

40
Q

How can you show that a PROMELA specification satisfies a constraint to show that between two send communication actions there is always another communication?

A

!

41
Q

What does it mean for SPIN to support weak fairness?

A

!

42
Q

Is it possible to integrate strong fairness into SPIN in any way? Why?

A

!

43
Q

How can you prove a SPIN spec terminates?

A

!

44
Q

How can you prove the state of a SPIN spec (i.e. the values of its variables) on termination?

A

!

45
Q

How can you write an init process that initialises SPIN global arrays and starts processes? Atomic is allowed.

A

!

46
Q

How can you write an init process that initialises SPIN global arrays and starts processes? Atomic is not allowed.

A

!

47
Q

How do you illustrate an algorithm in a system description prior to writing a PROMELA specification to implement it?

A

!

48
Q

How can you write a never claim to implement an LTL formula?

A

!

49
Q

What is a trace in PROMELA?

A

!

50
Q

What do PROMELA traces do?

A

!

51
Q

What are four PROMELA constructs used for formalising correctness properties?

A
  • never claims
  • traces
  • assert statements
  • ltl variables
52
Q

Is it possible to replace the specification of a trace by an LTL formula? Why?

A

!