Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Algebraic Theories for Contextual Pre-Nets Roberto Bruni - Dipartimento di Informatica, Università di Pisa joint work with: José Meseguer (UIUC) Ugo.

Similar presentations


Presentation on theme: "1 Algebraic Theories for Contextual Pre-Nets Roberto Bruni - Dipartimento di Informatica, Università di Pisa joint work with: José Meseguer (UIUC) Ugo."— Presentation transcript:

1 1 Algebraic Theories for Contextual Pre-Nets Roberto Bruni - Dipartimento di Informatica, Università di Pisa joint work with: José Meseguer (UIUC) Ugo Montanari (UNIPI) Vladimiro Sassone (COGS) ICTCS 2003, Bertinoro (FC), 13-15 Ottobre 2003

2 Algebraic Theories for Contextual Pre-Nets2 Plan of the Talk Introduction P/T Petri nets and pre-nets Read arcs, molecules and match-share Partial membership equational logic Algebraic theories Final remarks and conclusions

3 Algebraic Theories for Contextual Pre-Nets3 Plan of the Talk Introduction P/T Petri nets and pre-nets Read arcs, molecules and match-share Partial membership equational logic Algebraic theories Final remarks and conclusions

4 Algebraic Theories for Contextual Pre-Nets4 Petri Nets and Read Arcs P/T Petri nets [Petri’62] basic model of concurrency supported by a large community and by industrial-quality tools a media for conveying ideas to non-expert thanks to a suggestive graphical presentation Nets with read arcs aka nets with test arcs, aka nets with activator arcs, aka contextual nets model a non-destructive read operation multiple concurrent readings of resources are possible naïve encoding in P/T nets would serialize these accesses, with a dramatic loss of concurrency and efficiency

5 Algebraic Theories for Contextual Pre-Nets5 Semantic Approaches Petri nets processes causality and concurrency within a single run unfolding causality, concurrency and conflict between all possible events algebraic algebra of computations logic deduction theories Contextual nets processes unfolding (asymmetric conflict) algebraic molecules tokens are not atomic entities match-share too many fictitious behaviours logic

6 Algebraic Theories for Contextual Pre-Nets6 Aim Neat algebraic / logic characterization of the (monoidal) category of concurrent computation of contextual nets 1. Functorial construction net morphisms are preserved 2. Universal construction compositionality 3. Exploit PMEqtl theories proofs simplified by PMEqtl techniques 4. Follow the individual token philosophy more informative semantics 5. 1 + 4 = Pre-nets must be used

7 Algebraic Theories for Contextual Pre-Nets7 Plan of the Talk Introduction P/T Petri nets and pre-nets Read arcs, molecules and match-share Partial membership equational logic Algebraic theories Final remarks and conclusions

8 Algebraic Theories for Contextual Pre-Nets8 Terminology and Notation Places a,b,c,… classes of resources Transitions t,t’,… basic activities Tokens  instances of a resource class Markings u,v,w,… multisets of resources Multiset union u  w Empty marking  Places are unary markings a Pre-sets  t resources necessary to execute t multiset fetched by the execution of t Post-sets t  resources produced by t We write t:u  v for  t=u and t  =v

9 Algebraic Theories for Contextual Pre-Nets9 Formal Definition A P/T Petri net is a graph N=(S ,T,pre,post,u 0 ) S  is the set of markings (is the free monoid over the set of places S) (Nodes of the graph) T is the set of transitions (Arcs of the graph) pre:T  S  assigns pre-sets to transitions pre(t) =  t   (Source map of the graph) post:T  S  assigns post-sets to transitions post(t) = t  (Target map of the graph) u 0 is the initial marking

10 Algebraic Theories for Contextual Pre-Nets10 Circles and Boxes 2 a1a1 t1t1 a2a2 t2t2 a3a3 t3t3 a4a4 2 Circles are places Boxes are transitions Weighted arcs model pre- and post-sets Bullets are tokens u o =a 1  a 2 t 1 :a 1  2a 3 t 2 :a 2  2a 3 t 3 :2a 3  a 4 2

11 Algebraic Theories for Contextual Pre-Nets11 CTPh vs. ITPh Collective Token Philosophy (CTPh) Any two tokens in the same place are indistinguishable one from the other computationally equivalent Individual Token Philosophy (ITPh) Any token carries its own history tokens have unique origins fetching one token makes an activity causally dependent from the activities that produced it such analysis can be important for recovery purposes, detecting intrusions, increase parallelism, …

12 Algebraic Theories for Contextual Pre-Nets12 CTPh vs. ITPh: Graphically 2 a1a1 t1t1 a2a2 t2t2 a3a3 t3t3 a4a4 2 2 2 a1a1 t1t1 a2a2 t2t2 a3a3 t3t3 a4a4 2 2

13 Algebraic Theories for Contextual Pre-Nets13 CTPh vs. ITPh: Graphically 2 a1a1 t1t1 a2a2 t2t2 a3a3 t3t3 a4a4 2 2 2 a1a1 t1t1 a2a2 t2t2 a3a3 t3t3 a4a4 2 2 e1e1 e2e2

14 Algebraic Theories for Contextual Pre-Nets14 CTPh vs. ITPh: Graphically 2 a1a1 t1t1 a2a2 t2t2 a3a3 t3t3 a4a4 2 2 2 a1a1 t1t1 a2a2 t2t2 a3a3 t3t3 a4a4 2 2 e1e1 e2e2 e’ 3 e’’ 3

15 Algebraic Theories for Contextual Pre-Nets15 CTPh vs. ITPh: Graphically 2 a1a1 t1t1 a2a2 t2t2 a3a3 t3t3 a4a4 2 2 2 a1a1 t1t1 a2a2 t2t2 a3a3 t3t3 a4a4 2 2 e1e1 e2e2 e’ 3 e’’ 3

16 Algebraic Theories for Contextual Pre-Nets16 Petri Nets are Monoids Proof terms denote CTPh computations: commutative processes uSuS u:u  N u [idle]  :u  N v  :u’  N v’  :u  u’  N v  v’ [parallel composition] commutative associative unit  :  N   :u  N v  :v  N w ;:uNw;:uNw [sequential composition] monoid homomorphism identities u:u  N u t:u  v  T t:u  N v [firing]

17 Algebraic Theories for Contextual Pre-Nets17 ITPh and Pre-Nets T(.) : Petri  CMonCat CTPh, functorial, universal, expressed in PMEqtl P(.), DP(.), Q(.) : Petri  SMonCat ITPh, non functorial Pre-Net R N as implementation of N [BMMS99] pre- and post-sets are strings, not multisets for each t:u  v, one implementation t p,q :p  q, with p,q  S   (p)=u and  (q)=v Z(.) : PreNets  SMonCat ITPh, functorial, universal, expressed in PMEqtl all pre-nets implementations of N have the same semantics

18 Algebraic Theories for Contextual Pre-Nets18 Pre-Nets are Monoids Proof terms denote ITPh computations: concatenable processes pSpS p:p  R p [idle] t:p  q  T t:p  R q [firing]  :p  R q  :p’  R q’  :p  p’  R q  q’ [parallel composition]  :p  R q  :q  R r ;:pRr;:pRr [sequential composition] commutative associative unit  :  R  monoid homomorphism identities p:p  R p p,q  S   p,q :p  q  R q  p [symmetry]

19 Algebraic Theories for Contextual Pre-Nets19 Example a1a1 a2a2 t1t1 t2t2 a3a3 a3a3 a3a3 a3a3 t3t3 t3t3 p 0 =a 1  a 2 (t 1  t 2 ) ; (t 3  t 3 ) = (t 1 ;t 3 )  (t 2 ;t 3 )

20 Algebraic Theories for Contextual Pre-Nets20 Example a1a1 a2a2 t1t1 t2t2 a3a3 a3a3 a3a3 a3a3 t3t3 t3t3 p 0 =a 1  a 2 (t 1  t 2 ) ; (a 3  a3,a3  a3) ; (t 3  t 3 )

21 Algebraic Theories for Contextual Pre-Nets21 Plan of the Talk Introduction P/T Petri nets and pre-nets Read arcs, molecules and match-share Partial membership equational logic Algebraic theories Final remarks and conclusions

22 Algebraic Theories for Contextual Pre-Nets22 Nets with Read Arcs Graphically rendered as undirected arcs Equivalent to self-loops from the point of view of reachability Allow more parallelism Ex. read L and read R can fire concurrently! read L read R aLaL aRaR b cLcL cRcR u 0 =a L  b  a R (a L  read R ) ; (read L  c R )  (read L  a R ) ; (c L  read R ) we need syntax to write read L (?)read R

23 Algebraic Theories for Contextual Pre-Nets23 Molecules, Atoms, Electrons Non free monoid of places [Mes96] a = {a|0} and {a|n} = {a|n+1}  [a] Molecules for CTPh and ITPh [BM01] Two monoid homomorphisms: (.) + and (.) - (u  v) + = (u) +  (v) + and (  ) + =  (u  v) - = (u) -  (v) - and (  ) - =  Suitable laws u = (u) +  (u) - ((u) + ) - = ((u) - ) + = (u) - ((u) - ) - =  (u) k = ((u) + … ) + (u) 0 = u and (u) 1 = (u) + and (u) k+1 = ((u) k ) +  atom a  nucleus (a) k  electron (a) -  token a  context [a]

24 Algebraic Theories for Contextual Pre-Nets24 Example read L read R aLaL aRaR b-b- cLcL cRcR u 0 =a L  b  a R read L  b 2  read R = (read L  b +  a R ) ; (c L  b +  read R ) = (a L  b +  read R ) ; (read L  b +  c R ) b+b+ Drawback: Tokens are not atomic entities

25 Algebraic Theories for Contextual Pre-Nets25 Match-Share Categories Match-Share categories [GM98] symmetric monoidal categories, plus with suitable axioms  p,p ;  p =  p and  p ;  p,p =  p (  p  p);  p = (p  p );  p and  p ;(  p  p) =  p ;(p  p )   =  and   =   p  q = (p  q,p  q);(  p  q ) and  p  q = (  p  q );(p  p,q  q)  p ;  p = (p  p );(  p  p)  p ;  p = p pSpS p:pp Rpp:pp Rp [match] pSpS p:pRppp:pRpp [share] commutativity associativity monoidality { MAIN AXIOMS {

26 Algebraic Theories for Contextual Pre-Nets26 Match-Share Graphically a aaa aa aa aa ab  a,b ba aa  a,a aa a aa = aa a aa

27 Algebraic Theories for Contextual Pre-Nets27 Match-Share Graphically a aaa aa aa aa ab  a,b ba aa a aa = aa aa a aa a aa aa aa a

28 Algebraic Theories for Contextual Pre-Nets28 Match-Share Graphically a aaa aa aa aa ab  a,b ba aa a aa = aa a a a

29 Algebraic Theories for Contextual Pre-Nets29 Match-Share Graphically a aaa aa aa aa ab  a,b ba a aa = aa aa a a a aa aa aa a aa a =a a aa aa aa a aa

30 Algebraic Theories for Contextual Pre-Nets30 Transitions as Arrows aLaL read L b cLcL b bb bb aRaR read R b cRcR b bb bb

31 Algebraic Theories for Contextual Pre-Nets31 Example aLaL read L b cLcL baRaR read R cRcR b aRaR cLcL

32 Algebraic Theories for Contextual Pre-Nets32 Example aLaL read L b cLcL baRaR read R cRcR b aRaR cLcL

33 Algebraic Theories for Contextual Pre-Nets33 Example aLaL read L b cLcL aRaR read R cRcR b aRaR cLcL

34 Algebraic Theories for Contextual Pre-Nets34 Example aLaL read L b cLcL aRaR read R cRcR b aRaR cLcL

35 Algebraic Theories for Contextual Pre-Nets35 Example aLaL read L b cLcL aRaR read R cRcR b aRaR cLcL

36 Algebraic Theories for Contextual Pre-Nets36 Example aLaL read L b read R cRcR b aRaR cLcL

37 Algebraic Theories for Contextual Pre-Nets37 Example aLaL read L b read R cRcR b aRaR cLcL

38 Algebraic Theories for Contextual Pre-Nets38 Example aLaL read L b read R cRcR b aRaR cLcL  S(R) free SMonCat  distinguishes too much  MS(R) free MSCat  too many arrows  E (R) : S(R)  MS(R)  E (a) = a  E (t:u  w  v) = (u  w ) ; (t  w) ; (v  w )  Drawback:  is  MS(R) meaningful?

39 Algebraic Theories for Contextual Pre-Nets39 Plan of the Talk Introduction P/T Petri nets and pre-nets Read arcs, molecules and match-share Partial membership equational logic Algebraic theories Final remarks and conclusions

40 Algebraic Theories for Contextual Pre-Nets40 PMEqtl Partial Membership Equational Logic convenient definition of theories for nets and their computations subsort for regarding objects as idle steps partiality of sequential composition membership predicates for selecting admissible behaviours tensor product of theories for MonCat efficiently supported by Maude 2.0 proof of freeness follows by PMEqtl results adjunctions proved by existence of theory morphisms

41 Algebraic Theories for Contextual Pre-Nets41 MON fth MON is sort Monoid. op e : Monoid. op _  _ : Monoid Monoid -> Monoid [assoc id:e]. endfth

42 Algebraic Theories for Contextual Pre-Nets42 CAT fth CAT is sorts Object Arrow. subsort Object < Arrow. ops d(_) c(_) : Arrow -> Object. op _;_. var a : Object. vars f g h : Arrow. eq d(a) = a. eq c(a) = a. ceq a;f = f if d(f)=a. ceq f;a = f if c(f)=a. cmb f;g : Arrow if c(f)=d(g). ceq d(f;g) = d(f) if c(f)=d(g). ceq c(f;g) = c(g) if c(f)=d(g). ceq f;(g;h) = (f;g);h if c(f)=d(g) and c(g)=d(h). endfth

43 Algebraic Theories for Contextual Pre-Nets43 SMONCAT fth SMONCAT is including MONCAT. op  (_,_) : Object Object -> Arrow. vars a a’ b b’ c : Object. vars f f’ : Arrow. eq d(  (a,b)) = a  b. eq c(  (a,b)) = b  a. eq  (a,e) = a. eq  (e,a) = a. eq  (a  b,c) = (a  (b,c)) ; (  (a,c)  b). eq  (a,b);  (b,a) = a  b. ceq (f  f’);  (b,b’) =  (a,a’);(f’  f) if d(f)=a and d(f’)=a’ and c(f)=b and c(f’)=b’. endfth

44 Algebraic Theories for Contextual Pre-Nets44 MSCAT fth MSCAT is including SMONCAT. ops  (_)  (_) : Object -> Arrow. vars a b : Object. eq d(  (a)) = a  a. eq d(  (a)) = a. eq c(  (a)) = a. eq c(  (a)) = a  a. eq  (e) = e. eq  (e) = e. eq  (a,a);  (a) =  (a). eq  (a);  (a,a) =  (a). eq  (a  b) = (a  (b,a)  b);(  (a)  (b)). eq  (a  b) = (  (a)  (b));(a  (a,b)  b). eq (  (a)  a);  (a) = (a  (a));  (a). eq  (a);(  (a)  a) =  (a);(a  (a)). eq  (a);  (a) = a. eq  (a);  (a) = (a  (a));(  (a)  a). endfth

45 Algebraic Theories for Contextual Pre-Nets45 Plan of the Talk Introduction P/T Petri nets and pre-nets Read arcs, molecules and match-share Partial membership equational logic Algebraic theories Final remarks and conclusions

46 Algebraic Theories for Contextual Pre-Nets46 RAUT (Read-Automata) fth RAUT is including MON. sort Rtrans. subsort Monoid < Rtrans. ops pre(_) post(_) ctx(_) : Rtrans -> Monoid. var u : Monoid. eq pre(u) = e. eq post(u) = e. eq ctx(u) = u. endfth

47 Algebraic Theories for Contextual Pre-Nets47 RCOMP (Read-Computation) fth RCOMP is including MSCAT. sort Rtrans Rarrow. subsort Object < Rtrans < Rarrow < Arrow. ops pre(_) post(_) ctx(_) : Rtrans -> Object. op mk(_) : Rtrans -> Arrow vars h k : Rarrow. var t : Rtrans. vars u v : Object. mb h  k : Rarrow. mb  (u,v) : Rarrow. cmb h;k : Rarrow if c(h)=d(k). eq d(t) = pre(t)  ctx(t). eq c(t) = post(t)  ctx(t). eq pre(u) = e. eq post(u) = e. eq ctx(u) = u. eq d(mk(t)) = d(t). eq c(mk(t)) = c(t). eq mk(u) = u. eq t = (pre(t)  (ctx(t)));(mk(t)  ctx(t));(post(t)  (ctx(t))). endfth self-loop version relation between t and its self-loop version markings idle+transitions E (MS(R)) MS(R) Rarrow is symmetric monoidal

48 Algebraic Theories for Contextual Pre-Nets48 t and mk(t) a t b cb b b bb bb b b

49 Algebraic Theories for Contextual Pre-Nets49 t and mk(t) a mk(t) b cb bb bb b b bb bb b b

50 Algebraic Theories for Contextual Pre-Nets50 t and mk(t) a mk(t) b cb bb bb b b bb bb b b

51 Algebraic Theories for Contextual Pre-Nets51 t and mk(t) a mk(t) b cb b b bb bb b b

52 Algebraic Theories for Contextual Pre-Nets52 t and mk(t) a t c b b

53 Algebraic Theories for Contextual Pre-Nets53 RV (Theory Morphism) view RV from RAUT to RCOMP is sort Monoid to Object. endview The view RV induces a forgetful functor U RV from the category of RCOMP-algebras (computational models) to the category of RAUT-algebras (contextual pre-nets) with a left-adjoint F RV

54 Algebraic Theories for Contextual Pre-Nets54 Results F RV (R) is a match-share category isomorphic to MS(R) via a match-share functor F RV (R) |Rarrow is a symmetric monoidal category isomorphic to E (S(R)) via a symmetric monoidal functor A computation  is meaningful iff RCOMP |-  : Rarrow

55 Algebraic Theories for Contextual Pre-Nets55 Plan of the Talk Introduction P/T Petri nets and pre-nets Read arcs, molecules and match-share Partial membership equational logic Algebraic theories Final remarks and conclusions

56 Algebraic Theories for Contextual Pre-Nets56 Conclusions Typing discipline via membership predicates Functorial and universal construction contextual pre-nets seen as implementations of contextual nets proof via PMEqtl techniques Results exploited in WADT 2002 [BBM02] to functorially reconcile all net semantics Maude can be used as proof engine

57 Algebraic Theories for Contextual Pre-Nets57 The End Algebraic Theories for Contextual Pre-Nets a paper byRoberto Bruni José Meseguer Ugo Montanari Vladimiro Sassone ICTCS 2003 presentation by Roberto Bruni Research supported by FET-GC Project IST-2001-32747 AGILE MIUR Project COFIN 2001013518 COMETA Italia CNR Fellowship and CS Department at UIUC (first author) Front cover: electronic watercolor by Roberto Bruni


Download ppt "1 Algebraic Theories for Contextual Pre-Nets Roberto Bruni - Dipartimento di Informatica, Università di Pisa joint work with: José Meseguer (UIUC) Ugo."

Similar presentations


Ads by Google