SHARED OBJECTS 1.1 incr_count 1.1.1 set_count_1 AND 1.1.2 - - PowerPoint PPT Presentation

shared objects
SMART_READER_LITE
LIVE PREVIEW

SHARED OBJECTS 1.1 incr_count 1.1.1 set_count_1 AND 1.1.2 - - PowerPoint PPT Presentation

dependability engineering & Petri nets October 2018 dependability engineering & Petri nets October 2018 G ARDENS , HIERARCHY TREE Top 1 turnstile1 SHARED OBJECTS 1.1 incr_count 1.1.1 set_count_1 AND 1.1.2 set_count_2 MUTEX


slide-1
SLIDE 1

dependability engineering & Petri nets October 2018 Y:\Documents\teaching\course-concurrency\skript-sources\nl_skript_fm\nl05_mutex_garden.sld.fm 5 - 1 / 20

SHARED OBJECTS

AND

MUTEX

  • BOTANICAL GARDEN

dependability engineering & Petri nets October 2018 monika.heiner@b-tu.de 5 - 2 / 20

GARDENS, HIERARCHY TREE

Top turnstile1 1 set_count_to_0 2 turnstile2 3 next_run 4 incr_count 1.1 set_count_1 1.1.1 set_count_2 1.1.2 set_count_3 1.1.3 set_count_4 1.1.4 incr_count 3.1 set_count_1 3.1.1 set_count_2 3.1.2 set_count_3 3.1.3 set_count_4 3.1.4

slide-2
SLIDE 2

dependability engineering & Petri nets October 2018 monika.heiner@b-tu.de 5 - 3 / 20

GARDENS, TOP LEVEL

write coend cobegin process_begin2 process_end2 end write process_end1 process_begin1 cobegin begin

  • 4. next_run
  • 3. turnstile2
  • 2. set_count_to_0
  • 1. turnstile1

pnt: ORD HOM NBM PUR CSV SCF CON SC Ft0 tF0 Fp0 pF0 MG SM FC EFC ES N Y N N N N Y Y N N N N N N N N N DTP CPI CTI B SB REV DSt BSt DTr DCF L LV L&S ? Y Y Y Y N N ? Y N N N N cnt: ORD HOM NBM PUR CSV SCF CON SC Ft0 tF0 Fp0 pF0 MG SM FC EFC ES N Y N N N N Y Y N N N N N N N N N DTP CPI CTI B SB REV DSt BSt DTr DCF L LV L&S WL CL ? Y Y Y Y N N ? Y N N N N N Y

dependability engineering & Petri nets October 2018 monika.heiner@b-tu.de 5 - 4 / 20

GARDENS

  • 1. turnstile1

(2) begin_for end_for turnstile1 co_loop1 loop1 T1_in_loop T1_loop 1.1. incr_count process_end1 process_begin1

slide-3
SLIDE 3

dependability engineering & Petri nets October 2018 monika.heiner@b-tu.de 5 - 5 / 20

GARDENS

1.1. incr_count

fact T1_read_0 T1_read_1 T1_read_2 T1_read_3 T1_read_4F T1_fact T1_set_4 T1_set_3 T1_set_2 T1_set_1 count_0 count_1 count_2 count_3 count_4 1.1.4. set_count_4 1.1.3. set_count_3 1.1.2. set_count_2 1.1.1. set_count_1 T1_in_loop T1_loop

dependability engineering & Petri nets October 2018 monika.heiner@b-tu.de 5 - 6 / 20

GARDENS

1.1.1. set_count_1

count_1 count_0 count_1 count_2 count_3 count_4 count_1 count_1 count_1 count_1 T1_set_1 T1_loop

slide-4
SLIDE 4

dependability engineering & Petri nets October 2018 monika.heiner@b-tu.de 5 - 7 / 20

GARDENS1

  • 4. next_run

(2) (2) next_run loop2 loop1 loop2_set loop1_set reset_loop2 reset_loop1 end begin

dependability engineering & Petri nets October 2018 monika.heiner@b-tu.de 5 - 8 / 20

AND THEN THERE WAS COLOUR

slide-5
SLIDE 5

dependability engineering & Petri nets October 2018 monika.heiner@b-tu.de 5 - 9 / 20

COLOUR, BOOLEAN OPERATIONS

p3 Dot p4 Dot A 1`T Boolean A 1`T Boolean B 1`F Boolean B 1`F Boolean C 1`F Boolean C 1`F Boolean assign A := B or C notA notB notC in

  • ut

dot dot a

  • r_fun(b,c)

a not_fun(a) a not_fun(a) a not_fun(a) dot dot b c

dependability engineering & Petri nets October 2018 monika.heiner@b-tu.de 5 - 10 / 20

COLOUR,

CONTROL FLOW

Dot Dot A 1`false Boolean A 1`false Boolean A 1`false Boolean A 1`false Boolean A 1`false Boolean A 1`false Boolean A 1`false Boolean B 1`false Boolean B 1`false Boolean B 1`false Boolean B 1`false Boolean B 1`false Boolean if_A Dot endif Dot C 1`false Boolean C 1`false Boolean Dot Dot endif Dot if_AandB Dot A := B swap swap then else swap A := B and C else [!(x&y)] then [x&y] x x +x x +x y +x x y&z x y T F y z x x y y

slide-6
SLIDE 6

dependability engineering & Petri nets October 2018 monika.heiner@b-tu.de 5 - 11 / 20

COLOUR

papaya bananas 4 mango p_salat fruit_salat mango_salat salat Salats fruits 8 4`b++ 2`m++ 2`p Fruits edibles 8 4`b++ 2`m++ 2`p Edibles pre_p_salat prep_fruit_salat prep_mango_salat prep_mango_salat prep_fruit_salat pre_p_salat pre_p_salat prep_fruit_salat prep_mango_salat 2`dot dot dot dot dot 2`dot 3`dot dot 1`ms 1`fs 1`ps 2`p p++ 3`b++ 2`m m m p++ 3`b++ 2`m 2`p 1`ps 1`fs 1`ms

dependability engineering & Petri nets October 2018 monika.heiner@b-tu.de 5 - 12 / 20

COLOUR

edibles 8 4`b++ 2`m++ 2`p Edibles edibles 8 4`b++ 2`m++ 2`p Edibles preps preps [y=t1]2`p++ [y=t2]1`p++ [y=t2]3`b++ [y=t2]2`m++ [y=t3]1`m [y=t1]1`ps++ [y=t2]1`fs++ [y=t3]1`ms [y=t1]1`ps++ [y=t2]1`fs++ [y=t3]1`ms [y=t1]2`p++ [y=t2](1`p++ 3`b++ 2`m)++ [y=t3]1`m it should be possible to combine equal guards.

slide-7
SLIDE 7

dependability engineering & Petri nets October 2018 monika.heiner@b-tu.de 5 - 13 / 20

COLOURED GARDEN

begin 1`dot Dot cobegin Dot process_begin1 Dot process_end1 Dot write Dot end Dot process_end2 Dot process_begin2 Dot cobegin coend write turnstile1 set_count_to_0 turnstile2 next_run

dependability engineering & Petri nets October 2018 monika.heiner@b-tu.de 5 - 14 / 20

COLOURED GARDEN

process_begin1 Dot process_end1 Dot T1_loop Dot T1_in_loop Dot loop1 1`2 Loop turnstile1 T1_end_for T1_begin_for [x<>0] incr_count x x-1

slide-8
SLIDE 8

dependability engineering & Petri nets October 2018 monika.heiner@b-tu.de 5 - 15 / 20

COLOURED GARDEN

T1_loop Dot T1_in_loop Dot count 1`0 Count count 1`0 Count T1_set Count T1_read T1_incr y x+1 x x x x

dependability engineering & Petri nets October 2018 monika.heiner@b-tu.de 5 - 16 / 20

COLOURED GARDEN

begin 1`dot Dot cobegin Dot count 1`0 Count set_0 x

slide-9
SLIDE 9

dependability engineering & Petri nets October 2018 monika.heiner@b-tu.de 5 - 17 / 20

COLOURED GARDEN

begin 1`dot Dot end Dot loop1 1`2 Loop reset_loop1 Dot reset_loop2 Dot loop1_set Dot loop2_set Dot loop2 1`2 Loop next_run1 next_run2 reset_loop1 reset_loop2 2 2 i i

dependability engineering & Petri nets October 2018 monika.heiner@b-tu.de 5 - 18 / 20

COLOURED NETS, OBSERVATIONS

❑ coloured Petri nets may serve as a short-hand notation for place/transition Petri nets ❑ a coloured place has (like a program variable)

  • >

a name

  • >

a colour set = data type = set of values (colours) ❑ any token on a given place has a specific colour of the place‘s colour set ❑ a coloured place contains generally a multiset (bug) of coloured tokens ❑ the arc inscriptions consist of

  • >

constants

  • >

“formal sums” of coloured tokens

  • >

variables

  • >

functions . . . or a combination of all those ❑ arc inscriptions’s readability = net readability !

slide-10
SLIDE 10

dependability engineering & Petri nets October 2018 monika.heiner@b-tu.de 5 - 19 / 20

COLOURED PETRI NETS, SUMMARY

❑ information-preserving transformation ❑ folding needs user interaction

  • >

partitions of transition set and place set ❑ trivial transformation:

  • nly one colour (black colour)
  • >

no structure compression ❑ any Petri net may be transformed into

  • >

all structure information in arc inscriptions

folding

Petrinetz

Petri net

unfolding

Petrinetz

coloured Petri net

dependability engineering & Petri nets October 2018 monika.heiner@b-tu.de 5 - 20 / 20

COLOURED PETRI NETS, ANALYSIS

❑ by unfolding

  • >

reuse of all P/T net analysis techniques

  • >

symmetrically reduced rg ❑ without unfolding

  • >

reachability graph (CPN - occurrence graph)

  • >

invariants (tools ?)

  • >

CTL model checking (tools ?) ❑ dedicated notion of liveness: collectively live transitions

  • >

all transition colours of a given coloured transition guarantee together the liveness

  • >

very useful for control flow models

  • ->> garden example
  • ->> mutex examples