The example is taken from Sect. 1.2 of Vol. 1 of the CPN book.



Similar documents
QUANTITATIVE METHODS CLASSES WEEK SEVEN

5 2 index. e e. Prime numbers. Prime factors and factor trees. Powers. worked example 10. base. power

Lecture 3: Diffusion: Fick s first law

by John Donald, Lecturer, School of Accounting, Economics and Finance, Deakin University, Australia

Econ 371: Answer Key for Problem Set 1 (Chapter 12-13)

Architecture of the proposed standard

Mathematics. Mathematics 3. hsn.uk.net. Higher HSN23000

Entity-Relationship Model

Adverse Selection and Moral Hazard in a Model With 2 States of the World

Traffic Flow Analysis (2)

CPS 220 Theory of Computation REGULAR LANGUAGES. Regular expressions

SPECIAL VOWEL SOUNDS

Question 3: How do you find the relative extrema of a function?

AP Calculus AB 2008 Scoring Guidelines

Use a high-level conceptual data model (ER Model). Identify objects of interest (entities) and relationships between these objects

New Basis Functions. Section 8. Complex Fourier Series

Lecture notes: 160B revised 9/28/06 Lecture 1: Exchange Rates and the Foreign Exchange Market FT chapter 13

C H A P T E R 1 Writing Reports with SAS

Remember you can apply online. It s quick and easy. Go to Title. Forename(s) Surname. Sex. Male Date of birth D

(Analytic Formula for the European Normal Black Scholes Formula)

Combinatorial Analysis of Network Security

A Note on Approximating. the Normal Distribution Function

Factorials! Stirling s formula

June Enprise Rent. Enprise Author: Document Version: Product: Product Version: SAP Version:

Parallel and Distributed Programming. Performance Metrics

Electronic Commerce. and. Competitive First-Degree Price Discrimination

Free ACA SOLUTION (IRS 1094&1095 Reporting)

Continuity Cloud Virtual Firewall Guide

Lecture 20: Emitter Follower and Differential Amplifiers

ME 612 Metal Forming and Theory of Plasticity. 6. Strain

Sci.Int.(Lahore),26(1), ,2014 ISSN ; CODEN: SINTE 8 131

Development of Financial Management Reporting in MPLS

Constraint-Based Analysis of Gene Deletion in a Metabolic Network

Production Costing (Chapter 8 of W&W)

HOMEWORK FOR UNIT 5-1: FORCE AND MOTION

Business Systems Analysis with Ontologies

Expert-Mediated Search

STATEMENT OF INSOLVENCY PRACTICE 3.2

5.4 Exponential Functions: Differentiation and Integration TOOTLIFTST:

Section 7.4: Exponential Growth and Decay

In the previous two chapters, we clarified what it means for a problem to be decidable or undecidable.

Policies for Simultaneous Estimation and Optimization

A Theoretical Model of Public Response to the Homeland Security Advisory System

Long run: Law of one price Purchasing Power Parity. Short run: Market for foreign exchange Factors affecting the market for foreign exchange

Business rules FATCA V. 02/11/2015

Foreign Exchange Markets and Exchange Rates

Incomplete 2-Port Vector Network Analyzer Calibration Methods

Upper Bounding the Price of Anarchy in Atomic Splittable Selfish Routing

Abstract. Introduction. Statistical Approach for Analyzing Cell Phone Handoff Behavior. Volume 3, Issue 1, 2009

TIME MANAGEMENT. 1 The Process for Effective Time Management 2 Barriers to Time Management 3 SMART Goals 4 The POWER Model e. Section 1.

Intermediate Macroeconomic Theory / Macroeconomic Analysis (ECON 3560/5040) Final Exam (Answers)

SOFTWARE ENGINEERING AND APPLIED CRYPTOGRAPHY IN CLOUD COMPUTING AND BIG DATA

Category 7: Employee Commuting

SPREAD OPTION VALUATION AND THE FAST FOURIER TRANSFORM

Important Information Call Through... 8 Internet Telephony... 6 two PBX systems Internet Calls... 3 Internet Telephony... 2

A Project Management framework for Software Implementation Planning and Management

Online Price Competition within and between Heterogeneous Retailer Groups

Logo Design/Development 1-on-1

the so-called KOBOS system. 1 with the exception of a very small group of the most active stocks which also trade continuously through

IHE IT Infrastructure (ITI) Technical Framework Supplement. Cross-Enterprise Document Workflow (XDW) Trial Implementation

CPU. Rasterization. Per Vertex Operations & Primitive Assembly. Polynomial Evaluator. Frame Buffer. Per Fragment. Display List.

Enforcing Fine-grained Authorization Policies for Java Mobile Agents

Compositional Specification of Commercial Contracts

Hardware Modules of the RSA Algorithm

TELL YOUR STORY WITH MYNEWSDESK The world's leading all-in-one brand newsroom and multimedia PR platform

CHAPTER 4c. ROOTS OF EQUATIONS

EFFECT OF GEOMETRICAL PARAMETERS ON HEAT TRANSFER PERFORMACE OF RECTANGULAR CIRCUMFERENTIAL FINS

The price of liquidity in constant leverage strategies. Marcos Escobar, Andreas Kiechle, Luis Seco and Rudi Zagst

Analyzing Failures of a Semi-Structured Supercomputer Log File Efficiently by Using PIG on Hadoop

union scholars program APPLICATION DEADLINE: FEBRUARY 28 YOU CAN CHANGE THE WORLD... AND EARN MONEY FOR COLLEGE AT THE SAME TIME!

MAXIMAL CHAINS IN THE TURING DEGREES

Repulsive Force

Keywords Cloud Computing, Service level agreement, cloud provider, business level policies, performance objectives.

Basis risk. When speaking about forward or futures contracts, basis risk is the market

GOAL SETTING AND PERSONAL MISSION STATEMENT

Planning and Managing Copper Cable Maintenance through Cost- Benefit Modeling

Cookie Policy- May 5, 2014

Cloud and Big Data Summer School, Stockholm, Aug., 2015 Jeffrey D. Ullman

The international Internet site of the geoviticulture MCC system Le site Internet international du système CCM géoviticole

FACULTY SALARIES FALL NKU CUPA Data Compared To Published National Data

OPTIONS AND FUTURES: A TECHNICAL APPRAISAL

Performance Evaluation

METHODS FOR HANDLING TIED EVENTS IN THE COX PROPORTIONAL HAZARD MODEL

Rural and Remote Broadband Access: Issues and Solutions in Australia

User-Perceived Quality of Service in Hybrid Broadcast and Telecommunication Networks

Theoretical aspects of investment demand for gold

An Broad outline of Redundant Array of Inexpensive Disks Shaifali Shrivastava 1 Department of Computer Science and Engineering AITR, Indore

Switches and Indicators 01

In the first years of the millennium, Americans flocked to Paris to enjoy French

Who uses our services? We have a growing customer base. with institutions all around the globe.

Version 1.0. General Certificate of Education (A-level) January Mathematics MPC3. (Specification 6360) Pure Core 3. Final.

Rent, Lease or Buy: Randomized Algorithms for Multislope Ski Rental

CUTTING METHODS AND CARTESIAN ROBOTS KESME YÖNTEMLERİ VE KARTEZYEN ROBOTLAR

An Adaptive Clustering MAP Algorithm to Filter Speckle in Multilook SAR Images

Dr David Dexter The Parkinson s UK Brain Bank

Projections - 3D Viewing. Overview Lecture 4. Projection - 3D viewing. Projections. Projections Parallel Perspective

Current and Resistance

Category 1: Purchased Goods and Services

Meerkats: A Power-Aware, Self-Managing Wireless Camera Network for Wide Area Monitoring

Theoretical approach to algorithm for metrological comparison of two photothermal methods for measuring of the properties of materials

Transcription:

Rsourc Allocation Abstract This is a small toy xampl which is wll-suitd as a first introduction to Cnts. Th CN modl is dscribd in grat dtail, xplaining th basic concpts of C-nts. Hnc, it can b rad by popl with no/littl tri nt background. Th CN modl dscribs how two diffrnt kinds of procsss ar sharing thr diffrnt kinds of rsourcs. It is simpl to undrstand and asy to simulat/modify. Th xampl is takn from Sct. 1.2 of Vol. 1 of th CN book. Dvlopd and Maintaind by: Kurt Jnsn, Aarhus Univrsity, Dnmark (kjnsn@daimi.au.dk).

2 CN Modl Assum that w hav a st of procsss, which shar a common pool of rsourcs. Thr ar two diffrnt kinds of procsss (calld p-procsss and q-procsss) and thr diffrnt kinds of rsourcs (calld r-rsourcs, s-rsourcs, and t-rsourcs). Th procsss could b diffrnt computr programs (.g., txt ditors and drawing programs) whil th rsourcs could b diffrnt facilitis shard by th programs (.g., tap drivs, lasr printrs and plottrs). ach procss is cyclic and during th individual parts of its cycl, th procss nds to hav xclusiv accss to a varying amount of th rsourcs. Th rsourc allocation systm is modlld by th C-nt shown blow. Initial Marking M 0 color U = with p q; color I = int; color = product U*I; color = with ; var x: U; var i: I; 1 R 1 1 3 (q,0) A 3 3 (q,0) T1 if x =q thn 1 (q,i+1) ls mpty 2 (p,0) 2 2 (p,0) B cas x of if x=p p => 2 thn 1 (p,i+1) q => 1 ls mpty T2 [x=q] 3 S 3 3 if x=p thn 1 ls mpty if x=q thn 1 ls mpty C T3 D 2 T 2 2 T4 2 cas x of p => 2 q => 1 T5

Th procsss can b in fiv diffrnt stats, rprsntd by th placs A. ach plac may contain on or mor markrs, calld tokns. ach tokn carris a data valu calld th tokn colour. Th data valu may b of arbitrarily complx typ (.g., a rcord whr th first fild is a ral, th scond a txt string, whil th third is a list of intgr pairs). For a givn plac all tokns must hav tokn colours that blong to a spcifid typ. This typ is calld th colour st of th plac. Th us of colour sts in C-nts is totally analogous to th us of typs in programming languags. Colour sts dtrmin th possibl valus of tokns (analogously to th way in which typs dtrmin th possibl valus of variabls and xprssions). For historical rasons w talk about colourd tokns which can b distinguishd from ach othr in contrast to th plain tokns of an ordinary tri nt. By convntion w writ colour sts in italics. From th abov figur, it can b sn that th placs A hav th typ as colour st, whil th placs R T hav th typ as colour st. Th dclarations of th colour sts (in th uppr lft cornr of th figur) tll us that ach tokn on A has a tokn colour which is a pair (bcaus th colour st is dclard to b th Cartsian product of two othr colour sts U and I). Th first lmnt of th pair is an lmnt of U and thus it is ithr p or q (bcaus th colour st U is dclard to b an numration typ with ths two lmnts). Th scond lmnt is an intgr (bcaus th colour st I is dclard by mans of th CN ML standard typ int, which contains all intgrs in an implmntation-dpndnt intrval). Intuitivly, th first lmnt of a tokn tlls whthr th tokn rprsnts a p-procss or a q-procss, whil th scond lmnt tlls how many full cycls th procss has compltd. It can also b sn that all th tokns on R T hav th sam tokn colour ( is th only lmnt of ). Intuitivly, this mans that ths tokns carry no information apart from thir prsnc/absnc at a plac. Th initial marking is dtrmind by valuating th initialization xprssions, i.., th undrlind xprssions nxt to th placs. In th initial marking thr ar thr (q,0)-tokns on A and two (p,0)-tokns on B, whil C, D and hav no tokns (by convntion w omit initialization xprssions which valuat to th mpty multi-st). Morovr, R has on -tokn, S has thr -tokns and T has two -tokns. Th marking of ach plac is a multi-st ovr th colour st attachd to th plac. W nd multi-sts to allow two or mor tokns to hav idntical tokn colours. If w only workd with sts it would b impossibl, for xampl, to hav thr (q,0)-tokns in th initial marking of A. Th currnt marking of a givn plac is rprsntd by mans of a small circl (with an intgr saying how many tokns thr ar) and a txt string nxt to th circl (with a multi-st saying what th individual tokn colours ar, and which cofficints thy hav). By convntion w omit th circl and th txt string for placs which hav no tokns. In th figur abov, th currnt marking 3

4 is idntical to th initial marking, and this mans that th small circls and thir txt strings contain th sam information as th initialization xprssions. ach of th fiv transitions T1 T5 rprsnts a shift from on stat to th nxt. Th surrounding arc inscriptions tll us how rsourcs ar rsrvd and rlasd. To s how this works, lt us considr transition T2 which has thr surrounding arcs. Th arc xprssion appars twic (on th input arc from B and on th output arc to C) whil cas x of p=>2` q=>1` appars onc (on th input arc from S). Togthr ths thr arc xprssions hav two variabls, x and i, and from th dclarations it can b sn that x has typ U whil i has typ I. At a first glanc on might also think that, p and q ar variabls, but from th dclarations it can b sn that this is not th cas: is an lmnt of th colour st, whil p and q ar lmnts of U. This mans that thy ar constants. Intuitivly, th thr arc xprssions tll us that an occurrnc of T2 movs a tokn from B to C without changing th colour (bcaus th two arc xprssions ar idntical). Morovr, th occurrnc Marking M 1 color U = with p q; color I = int; color = product U*I; color = with ; var x: U; var i: I; 1 R 1 1 3 (q,0) A 3 3 (q,0) T1 if x =q thn 1 (q,i+1) ls mpty 2 (p,0) 1 1 (p,0) B cas x of if x=p p => 2 thn 1 (p,i+1) q => 1 ls mpty T2 [x=q] 3 if x=q thn 1 ls mpty C 1 1 (p,0) S 1 1 T3 if x=p thn 1 ls mpty D 2 T 2 2 T4 2 cas x of p => 2 q => 1 T5

rmovs a multi-st of tokns from S. This multi-st is dtrmind by valuating th corrsponding arc xprssion. As it can b sn, th multi-st dpnds upon th kind of procss involvd. A p-procss nds two s-rsourcs to go from B to C (and thus it rmovs two -tokns from S), whil a q-procss only nds on s-rsourc to go from B to C (and thus it rmovs only on -tokn from S). Now lt us b a littl mor prcis, and xplain in dtail how th nabling and occurrnc of C-nt transitions ar dtrmind. Th transition T2 has two variabls (x and i), and bfor w can considr an occurrnc of th transition ths variabls hav to b bound to colours of th corrsponding typs (i.., lmnts of th colour sts U and I). This can b don in many diffrnt ways. On possibility is to bind x to p and i to zro: thn w gt th binding b 1 = <x=p,i=0>. Anothr possibility is to bind x to q and i to 37: thn w gt th binding b 2 = <x=q,i=37>. For ach binding w can chck whthr th transition, with that binding, is nabld (in th currnt marking). For th binding b 1 th two input arc xprssions valuat to (p,0) and 2, rspctivly. Thus w conclud that b 1 is nabld in th initial marking bcaus ach of th input placs contains at last th tokns to which th corrsponding arc xprssion valuats (on (p,0)-tokn on B and two -tokns on S). For th binding b 2 th two arc xprssions valuat to (q,37) and. Thus w conclud that b 2 is not nabld (thr is no (q,37)-tokn on B). A transition can occur in as many ways as w can bind th variabls that appar in th surrounding arc xprssions (and in th guard introducd blow). Howvr, for a givn marking, it is usually only a fw of ths bindings that ar nabld. Whn a transition is nabld (for a crtain binding) it may occur, and it thn rmovs tokns from its input placs and adds tokns to its output placs. Th numbr of rmovd/addd tokns and th colours of ths tokns ar dtrmind by th valu of th corrsponding arc xprssions (valuatd with rspct to th binding in qustion). A pair (t,b) whr t is a transition and b a binding for t is calld a binding lmnt. Th binding lmnt (T2,b 1 ) is nabld in th initial marking M 0 and it transforms M 0 into th marking M 1 (shown blow). Analogously, w conclud that th binding lmnt (T1,<x=q,i=0>) is nabld in M 0 and that it transforms M 0 into th marking M 2 (shown blow). W say that ach of th markings M 1 and M 2 is dirctly rachabl from M 0. Th binding lmnt (T2,b 2 ) is not nabld in M 0 and thus it cannot occur. Nxt, lt us tak a closr look at transition T5. This transition movs a tokn from plac to ithr A or B (p-procsss go to B, whil q-procsss go to A). Simultanously th transition updats th cycl countr i. Notic that diffrnt bindings for a transition may not only rsult in diffrnt tokn colours but also in diffrnt numbrs of tokns. In particular this may man that th multi-st of tokns which ar addd/rmovd, for a givn binding, may b mpty, as 5

6 illustratd by th two thick output arcs of T5. W hav positiond th first sgmnts of th two arcs on top of ach othr to illustrat th clos rlationship btwn thm. Howvr, it should b strssd that this has no formal maning. Th only purpos is to mak th drawing mor radabl for human bings. Nxt lt us look at transition T1, which in addition to th arc xprssions has a guard: [x=q]. A guard is a boolan xprssion (i.., an xprssion that valuats to ithr tru or fals). It may hav variabls in xactly th sam way that th arc xprssions hav. Th purpos of a guard is to dfin an additional constraint which must b fulfilld for a transition to b nabld. In this cas th guard tlls us that it is only tokns rprsnting q-procsss which can mov from A to B (bcaus th guard for all bindings <x=p, > valuats to fals and thus prvnts nabling). It is asy to s that w in this cas could hav omittd th guard, bcaus w nvr will hav p-tokns on plac A. Howvr, Marking M 2 color U = with p q; color I = int; color = product U*I; color = with ; var x: U; var i: I; 1 R 3 (q,0) A 2 2 (q,0) T1 if x =q thn 1 (q,i+1) ls mpty 2 (p,0) 3 2 (p,0)++1 (q,0) B cas x of if x=p p => 2 thn 1 (p,i+1) q => 1 ls mpty T2 [x=q] 3 if x=q thn 1 ls mpty C S 2 2 T3 if x=p thn 1 ls mpty D 2 T 2 2 T4 2 cas x of p => 2 q => 1 T5

adding th guard maks our dscription mor robust towards rrors. Whn th sam variabl nam appars mor than onc, in th guard/arc xprssions of a singl transition, w only hav on variabl (with multipl apparancs). ach binding of th transition spcifis a colour for th variabl and this colour is usd for all th apparancs. Howvr, it should b notd that th apparancs of x around T1 ar totally indpndnt of th apparancs of x around T2 in th sns that th two sts of apparancs in th sam stp can b bound to diffrnt colour valus. It can b shown that th rsourc allocation systm prsntd abov has no dadlock (i.., no rachabl marking in which no binding lmnt is nabld). Howvr what happns if w chang th numbr of procsss or th numbr of rsourcs? As an xampl, lt us assum that th initial marking has an xtra s-rsourc (i.., an xtra -tokn on S). On should xpct that this small modification cannot lad to a dadlock bcaus dadlocks appar whn w hav too fw rsourc tokns, and thus an xtra rsourc tokn cannot caus a dadlock. Is th argumnt abov convincing? At a first glanc: ys! Howvr, this argumnt is wrong. Adding th xtra s-rsourc actually mans that w can rach a dadlock. This can b sn by ltting th two p-procsss advanc from stat B to stat D, whil th q-procsss rmain in stat A. Hopfully, this small xampl dmonstrats that informal argumnts about bhavioural proprtis ar dangrous and this is on of our motivations for th dvlopmnt of th mor formal analysis mthods, such as occurrnc graphs and plac invariants. 7