• Keine Ergebnisse gefunden

Problem 2: A Petri Net Language

N/A
N/A
Protected

Academic year: 2021

Aktie "Problem 2: A Petri Net Language"

Copied!
2
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

Concurrency Theory(WS 2011/12) Out: Wed, Oct 19 Due: Wed, Oct 26

Exercise Sheet 1

Jun.-Prof. Roland Meyer, Georgel C˘alin Technische Universit¨at Kaiserslautern

Problem 1: Shared Memory Concurrency

(a) Letload,storeandincbe atomic operations for loading a variable’s value into cache, storing a variable’s cache value into memory and incrementing a variable’s cache value.

Ifxis initially0, argument why there are executions ending withx= 2011of the program

fori= 1. . . 2011do loadx

incx storex end for

fori= 1. . .2011do loadx

incx storex end for

Misleading Hint: Each of the two above programs is basically incrementingx2011times.

(b) Letnegbe another atomic operation for negating aBooleanvariable’s cache value.

Ifxis initially0, give a Petri net representation of the following program and specify transition sequences which describe why the program may terminate withx= 0orx= 1in memory.

loadx negx storex

loadx negx storex

Hint: Without concurrency, the net for one half of the above program could be represented by

mx=0 load cx=0 neg cx=1 store mx=1

Problem 2: A Petri Net Language

For the Petri net below, give the set of all transition sequences that end in deadlock.

p1 x

p2

c a

b

p3 p4

Which are the deadlock markings for each of the sequences you found?

(2)

Problem 3: Invariants for Mutual Exclusion

Recall the mutual exclusion protocol given in class:

pw1

t1

pcs1

t2

sem=1

sem=0

t01 pw2

pcs2

t02

As seen in class(0 1 0 1 2 1)T is an invariant used to prove no markingM with M(pcs1) = M(pcs2) = M(sem=0) = 1

is reachable.

Which invariants can be used to prove no markingM with justM(pcs1) = M(pcs2) = 1is reachable? Give a general description and prove mutual exclusion for such a concrete invariant.

Problem 4: “Multiplication” as a Petri Net

Consider the Petri net which contains placesx,yandoutas in the picture below.

x m

y n

additional places, transitions and arcs

out

Add places (and corresponding tokens), transitions and arcs to the net such that for arbitrary m, n∈N, ifM0(x) = m,M0(y) =nandM0(out) = 0the net always reaches a deadlock and, ifMter is the deadlock marking,Mter(out)isanyof{0, . . . , m·n}.

Argument the corectness of your construction.

Referenzen

ÄHNLICHE DOKUMENTE

As a key-bounding-box-value store (KBVS), BBoxDB stores each value together with an n-dimensional axis parallel bounding box. The bounding box describes the location of the value in

Cintra, G., Miyazawa, F., Wakabayashi, Y., Xavier, E.: Algorithms for two- dimensional cutting stock and strip packing problems using dynamic programming and column

While the standard residual income is formally computed as profit minus cost of capital times actual capital invested, the new paradigm introduces a fourth element: the

While the standard residual income is formally computed as profit minus cost of capital times actual capital invested, the new paradigm introduces a fourth element: the

In par- ticular, we examine the decision problem faced by an agent with bounded memory who receives a sequence of noisy signals from a partially observable Markov decision

Die Schließungseigenschaft ergibt sich daraus, dass die sukzessive Spiegelung an einer ungeraden Anzahl kopunktaler Geraden auf eine einzige Geradenspiegelung reduziert

Once these are allowed to have independent effects (as in column 4 of Table 2), the speci fi cation test is happy to accept that the remaining assets could proxy for a common

The present paper solves the above problem for system (1.1) by defining the notion of weak parameter-ellipticity and by proving an a priori estimate for the corresponding