Petri Net-Flavored Places An Advanced Transition System for - - PowerPoint PPT Presentation

petri net flavored places
SMART_READER_LITE
LIVE PREVIEW

Petri Net-Flavored Places An Advanced Transition System for - - PowerPoint PPT Presentation

Petri Net-Flavored Places An Advanced Transition System for Distributed Computing in Racket J orgen Brandt 2018-09-29 Software Engineering Petri Nets Visually understandable Defined semantics (properties, invariants, correctness)


slide-1
SLIDE 1

Petri Net-Flavored Places

An Advanced Transition System for Distributed Computing in Racket J¨

  • rgen Brandt

2018-09-29

slide-2
SLIDE 2

Software Engineering

slide-3
SLIDE 3

Petri Nets

◮ Visually understandable ◮ Defined semantics (properties, invariants, correctness) ◮ Complete (can be executed, tested)

CashBox Compartment Signal CoinSlot a Storage b

coin coin sig sig cookie_box cookie_box cookie_box cookie_box cookie_box

slide-4
SLIDE 4

Petri Net Syntax

Down

#Ref<0.4.2.1>

◮ Passive component: Place

slide-5
SLIDE 5

Petri Net Syntax

Down Busy down_busy

(r,m,p) m p

Idle

◮ Passive component: Place ◮ Active component: Transition

slide-6
SLIDE 6

Petri Net Syntax

Request Reply

  • p

x f(x)

◮ Passive component: Place ◮ Active component: Transition ◮ Environment “High-level interface nets”

slide-7
SLIDE 7

Example

slide-8
SLIDE 8

Implementation: Cookie Vending Machine

CashBox Compartment Signal CoinSlot a Storage b

coin coin sig sig cookie_box cookie_box cookie_box cookie_box cookie_box

https://github.com/joergen7/pnet

slide-9
SLIDE 9

Implementation: Cookie Vending Machine

slide-10
SLIDE 10

Implementation: Cookie Vending Machine

slide-11
SLIDE 11

Implementation: Cookie Vending Machine

slide-12
SLIDE 12

Implementation: Cookie Vending Machine

slide-13
SLIDE 13

Implementation: Cookie Vending Machine

slide-14
SLIDE 14

Possible Application: Cuneiform

slide-15
SLIDE 15

Cuneiform: Motivation

◮ Cuneiform is . . .

◮ Functional programming language ◮ Distributed language ◮ Integration of other languages

◮ Open:

◮ command line tools ◮ R scripts ◮ Python libraries ◮ . . .

◮ General:

◮ Universal model of computation

https://cuneiform-lang.org

slide-16
SLIDE 16

Cuneiform Code Example: Iteration

def f( txt : File ) -> <y : File> in Perl *{ ... }* let xs : [File] = ['a.txt', 'b.txt' : File]; for x <- xs do f( txt = x )|y end;

slide-17
SLIDE 17

Distrubuted Execution Environment: Sequence Diagram

c m w1 w2

  • e
slide-18
SLIDE 18

Distributed Execution Environment: Sequence Diagram

c m w1 w2

  • e

a1,...,a4

slide-19
SLIDE 19

Distributed Execution Environment: Sequence Diagram

c m w1 w2

  • e

a1,...,a4 a2 a1

slide-20
SLIDE 20

Distributed Execution Environment: Sequence Diagram

c m w1 w2

  • e

a1,...,a4 a2 a1 (a1,r1)

slide-21
SLIDE 21

Distributed Execution Environment: Sequence Diagram

c m w1 w2

  • e

a1,...,a4 a2 a1 (a1,r1) (a1,r1)

slide-22
SLIDE 22

Distributed Execution Environment: Sequence Diagram

c m w1 w2

  • e

a1,...,a4 a2 (a2,r2) (a4,r4) a1 (a1,r1) a3 (a3,r3) (a1,r1)

  • (a3,r3)

(a4,r4) (a2,r2)

slide-23
SLIDE 23

Distributed Execution Environment: Sequence Diagram

c m w1 w2

  • e

a1,...,a4 v a2 (a2,r2) (a4,r4) a1 (a1,r1) a3 (a3,r3) (a1,r1)

  • (a3,r3)

(a4,r4) (a2,r2)

slide-24
SLIDE 24

Distributed Execution Environment: Sequence Diagram

c m w1 w2

  • e

a1,...,a4 v a2 (a2,r2) (a4,r4) a1 (a1,r1) a3 (a3,r3) (a1,r1)

  • (a3,r3)

(a4,r4) (a2,r2)

  • Three interfaces

Between . . . ◮ User and client

expressions, values

slide-25
SLIDE 25

Distributed Execution Environment: Sequence Diagram

c m w1 w2

  • e

a1,...,a4 v a2 (a2,r2) (a4,r4) a1 (a1,r1) a3 (a3,r3) (a1,r1)

  • (a3,r3)

(a4,r4) (a2,r2)

  • Three interfaces

Between . . . ◮ User and client

expressions, values

◮ Client and master

demand, applications, results

slide-26
SLIDE 26

Distributed Execution Environment: Sequence Diagram

c m w1 w2

  • e

a1,...,a4 v a2 (a2,r2) (a4,r4) a1 (a1,r1) a3 (a3,r3) (a1,r1)

  • (a3,r3)

(a4,r4) (a2,r2)

  • Three interfaces

Between . . . ◮ User and client

expressions, values

◮ Client and master

demand, applications, results

◮ Master and worker

applications, results

slide-27
SLIDE 27

Distributed Execution Environment: Petri Net Model

ci m wj

◮ The sequence diagram suggests a coarse structure ◮ Composing nets in a distributed system ◮ m independent clients and n independent workers

slide-28
SLIDE 28

Distributed Execution Environment: Master (i)

m

CRE master features

◮ Cache ◮ Scheduler ◮ Fault tolerance ◮ Language-independence

slide-29
SLIDE 29

Distributed Execution Environment: Master (ii)

(p,a) p p n•

  • a

p (p,a) (p,a) a (p,a) a p ((p,a),δ) [] A A+[a] a∉A a a (a,δ) (a,δ) (a,δ) p p q q q q q q q q q

  • q

q q

  • ((q,i),a)

(a,δ) ((q,i),a,δ) ((q,i),a) a

cre_master

n∈ℕ,n>0 i∈ℕ p,q∈Pid a,δ∈Expr r∈Result e∈Error q

WorkerRequest WorkerResult ExitWorker AddWorker AddClient ExitClient Demand CreRequest CreReply

(a,δ) (a,δ) n• n•

  • p

Guard allow lookup Cache schedule link_worker link_client ClientPool BadClient WorkerPool Surplus BusyWorker Allowed remove_demand Introduced release reallow remove_worker Released address recover_demand remove_client DemandPool BusyDemand SentDemand send_demand introduce

((q,i),a)

slide-30
SLIDE 30

Cuneiform Application: Variant Calling with GATK

https://cuneiform-lang.org

slide-31
SLIDE 31

Wrap up

slide-32
SLIDE 32

Related Work

◮ CPNTools: Graphical editor with code generation to Erlang ◮ Haskell-colored Petri nets: Functional embeddings

slide-33
SLIDE 33

Conclusion

◮ Petri nets as a programming model ◮ Visual interpretation of code ◮ Composition to form distributed systems

◮ Petri net on the inside ◮ Racket place on the outside

https://github.com/joergen7/pnet