• Keine Ergebnisse gefunden

Consider the following procedure CAS (”Compare-And-Swap”), where r = CAS(x, e, n) means that the procedure returns the final value of r.

N/A
N/A
Protected

Academic year: 2021

Aktie "Consider the following procedure CAS (”Compare-And-Swap”), where r = CAS(x, e, n) means that the procedure returns the final value of r."

Copied!
1
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

SS 2014 14.05.2014 Exercises to the lecture

Concurrency Theory Sheet 4

Roland Meyer, Viktor Vafeiadis Delivery until 20.05.2014 at 12h Exercise 4.1

Consider the following procedure CAS (”Compare-And-Swap”), where r = CAS(x, e, n) means that the procedure returns the final value of r.

r = CAS(x, e, n):

atomic ( r = [x]

if r = e then ([x] = n; r = 1) else(r = 0)

)

a) Complete the following rule so that it specifies the behaviour of CAS:

· · ·

r = CAS(x, e, n) sat ( P , R, G, Q ) b) Implement a lock using the procedure CAS.

Do not use ”assume”, but you can use ”if” and ”while”.

c) Prove that your lock implementation satisfies

sem stable(P, R) sem stable(Q, R) P ⇒ p 7→ − ∗ F p 7→ TID ∗ F ⇒ Q

{p 7→ 0 p 7→ TID} ⊆ G lock(p, TID) sat ( P , R, G, Q ) Exercise 4.2

Let ls(x, z) be defined as x = z ∧ emp ∨ ∃y. x 7→ y ∗ ls(y, z).

a) Prove (x 7→ y (P ∗ Q)) ⇒ ((x 7→ y P) ∗ Q) ∨ (P ∗ (x 7→ y Q)).

b) Prove ((x 7→ y) ∗ ls(k, m)) ⇒ (ls(k, x) ∗ ls(y, m)).

c) Conclude sem stable(ls(k, m), R) with

R := {x 7→ y (x 7→ z ∗ z 7→ y), (x 7→ z ∗ z 7→ y) x 7→ y}.

Exercise 4.3

Prove the soundness of the Prim rule:

`

SL

{P } c {Q} writes(c) ∩ fv(R, G) = ∅ c sat (P, R, G, Q)

Delivery until 20.05.2014 at 12h into the box next to 34-401.4

Referenzen

ÄHNLICHE DOKUMENTE

The Poisson distribution expresses the probability of a given number of events occurring in a fixed in- terval of time or space if these events occur with a known constant mean rate

Charakteristische Merkmale des ML-Effekts – Lichtkurve I. Applications on

The Federal Office examines each asylum application on the basis of the German Asylum Act (Asylgesetz) as to whether one of the four forms of protection – entitlement to

Under the conditions used for the searches, penalties of —1, 2 , 3 for matches, replacements, deletions/insertions, re- spectively, the expected numbers as calculated are a

60 participants have been selected for the experiment, and each participant is supposed to test and rate every packaging of exactly one toothpaste type on a 1-5 scale. Which type

Hybridiza- tion resulted in three molecules that were resis- tant to subsequent digestion with S l nuclease (Fig. The shortest, 79 nt in length, was expected as a fragment of

11 The name for the ordeal was written (d) íd “(divine) river” in the older (Sargonic to Middle Assyrian) texts (the pronunciation was id or nāru depending on the period or

Hence, to reconstruct past changes in oceanic productivity we have to look for tracers (proxies) in oceanic sediments which have preserved their bioproductivity