FinalExam2(2)

FinalExam2(2) - Question-3 For the sub question 3a to 3e-...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Question -1 For non deterministic program S and post condition R there are two main concerns: Does S TERMINATE? (Possible cases: always, sometimes, never) Des it terminate 1n R? (Possible cases: always, sometimes, never) 1a. List the seven different characterizations of a non deterministic program S with respect to these two concerns. 1b. Represent each of the above graphically (Hint – start with WP(S, TRUE), WLP(S, R) and WLP(S, ┐R) ) 1c. Represent each of the above as a predicate over WP(S, TRUE), WLP(S, R) and WLP(S, ┐R) Question-2 2a. Write a UNITY program for sorting an array A[0. .n]. Your program MUST express potential concurrencies. 2b . Prove that your program has a fixed point and that when the program reaches its fixed point the array A [1,,n] is sorted. What is your invariant? What is your well founded set?
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Question-3 For the sub question 3a to 3e- do following (a) Formally define the properties of a program S with respect to predicates P and Q (b) Express the property in terms of the program execution model. 3a . P unless Q 3b . P is stable 3c. P is invariant 3 d. P ensures Q 3e . P leads to Q ( notation - P ->Q ) 3f . what are safety properties? What are progress properties? For each of following properties indicate whether it is a safety property or a progress property. Property Safety Progress P unless Q P is stable P is invariant P ensures Q P leads to Q Question 4 4a. is the following program guaranty termination under fairness? JUSTIFY your answer. {n > 0} Loopselect n>o => n:= n-2 or n>0 => n:= n+1 end loopselect ________________ 4b Write a UNITY program for a semaphore S....
View Full Document

Page1 / 2

FinalExam2(2) - Question-3 For the sub question 3a to 3e-...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online