Presentation is loading. Please wait.

Presentation is loading. Please wait.

Tiling Transactions in Rewriting Logic Roberto Bruni (Pisa/Illinois) José Meseguer (Illinois) Ugo Montanari (Pisa) WRLA 2002 Pisa, Italia, 19-21 Sept.

Similar presentations


Presentation on theme: "Tiling Transactions in Rewriting Logic Roberto Bruni (Pisa/Illinois) José Meseguer (Illinois) Ugo Montanari (Pisa) WRLA 2002 Pisa, Italia, 19-21 Sept."— Presentation transcript:

1 Tiling Transactions in Rewriting Logic Roberto Bruni (Pisa/Illinois) José Meseguer (Illinois) Ugo Montanari (Pisa) WRLA 2002 Pisa, Italia, 19-21 Sept. 2002 Research supported by IST-2001-32747 Project AGILE Italian MIUR Project COMETA ONR Grant N00014-02-1-0715 CNR Fellowship on Information Sciences and Technologies

2 Outline Transactions Zero-Safe Nets (shortly) A Word on Adjunctions & Coreflections Zero-Safe Nets as Tiles Tiling Transactions Example: Minimal Communication Tree Conclusions & Future Work

3 “Mission” Fully General Notion of Concurrent Transaction –Graphical Representation –Formal Specification –Refined and Abstract view Refinement morphism –(Distributed Commit)

4 Transactions: one, no one, one hundred thousands In databases: –a transaction groups actions into a single logical unit which terminates either with a commit or with an abort the commit operation permanently applies all the changes to the database, making them visible the abort operation cancels all the changes, as they were never executed –ACID: Atomic, Consistent, Isolated, Durable Several variants: –transactions with checkpoints, hierarchical, timed, long-lived, nested, with compensation

5 Distributed Transactions In “global computing” applications: –data integration and process cooperation is required across sites and organizations –different platforms, policies, data formats Multi-way transactions: –distributed processes start local transactions, then –they interact by exchanging information and joining their transactions –they must agree on commit/abort

6 Theory, Pragmatics & Ethics What are the abstract models? –Mathematical description –How do they relate to concrete model? –How to define formal abstraction/refinement techniques? TM Servers can be overloaded –A dedicated machine is necessary (e.g..NET) –Distribution is important When two or more organizations participate in the same transaction, which TM should take control? –Mediator trusted sites –Inter-corporation agreement

7 Zero-Safe Nets stable places zero places transitions tokens

8 Zero-Safe Nets stable places zero places transitions tokens

9 copy Example: Multicasting I 2 Interacting Processes Administrator buffer newsend receive Disconnected Processes connect

10 Parallel composition  receive

11 Horizontal Composition * copy receive

12 Transaction copy receive send

13 Example: Multicasting II Interacting Processes Administrator new 1-to-1 Disconnected Processes connect 2 2 Abstract Net 1-to-2 3 3 1-to-n n+1 ……

14 Main Features of ZS Nets Graphical Presentation Formal Theory –Horizontal states in S  –Vertical states in Z  (observations) –Horizontal composition as coordination parallel composition on (horizontal) states sequential composition on observations Abstraction / Refinement –Refinement morphism –Abstraction via coreflection Concurrent Transactions & Distributed Interpreter “Portability” under “Orthogonal” Flavors of Nets: –coloured, reconfigurable, dynamic, probabilistic, timed, with read and inhibitor arcs, with priorities,…

15 Objects & Messages Object & Messages as Places in Coloured Nets Rewrites as Transitions Partitioning stable/zero used to model participation in transactions (for objects) and transactional messages Example: A Day at WRLA2002 –Objects: participants, overhead projector, beamer, microphone, … –Messages: words, gestures, … –Transitions: speaking, moving, changing slides, … –Transactions: presentations, intervals, … –(TM: chair-men, organizers, …)

16 A Constructive View of Adjunctions A B

17 A B F F (A)

18 A Constructive View of Adjunctions A B F F (A) b What is the best approximation of b?

19 A Constructive View of Adjunctions A B F F (A) b What is the best approximation of b?

20 A Constructive View of Adjunctions A B F F (A) b What is the best approximation of b?

21 Adjunctions: Formally b BA For any b  B

22 Adjunctions: Formally F (G b ) b B GbGb A We want to find a G b  A with approximation  b : F (G b )  b  B which is universal bb

23 Adjunctions: Formally F (G b ) b B GbGb A i.e., any other approximation (via a  A) g: F (a)  b  B factorizes uniquely through  b bb F (a) g a

24 Adjunctions: Formally F (G b ) b B GbGb A i.e.,  ! ĝ: a  G b  A such that g = F (ĝ) ; g b  = {  b } b  B is called the counit bb F (a) g a ĝ F (ĝ)

25 Duality A B F F (A)

26 Duality A B F F (A) G G (B)

27 Duality A B F F (A) G G (B) F (G b’ ) b’ F (G b ) b G b’ GbGb  b’ bb

28 Duality A B F F (A) G G (B) F (G b’ ) b’ F (G b ) b G b’ GbGb h  b’ bb

29 Duality A B F F (A) G G (B) F (G b’ ) b’ F (G b ) G b’ GbGb  b ; h  b’  b ; h

30 Duality A B F F (A) G G (B) F (G F (a) ) F (a) a id F (a)  F (a) F (a) id F (a) G F (a)  a = id F (a) is called the unit

31 Adjunctions: Properties Left Adjoints (e.g. F ) preserve Colimits Right Adjoints (e.g. G ) preserve Limits (Co)Limits are the categorical way of expressing operations  Adjunctions are Compositional Interpretations Typical Scenario: –B has more structure than A –G is the obvious forgetful functor –F is the best way of adding the extra structure to A

32 Building Transactions I ZPetri HCatZPetri objects: ZS nets arrows: graph homomorphisms, preserving place partitioning & disjoint image property for zero places objects: ZS nets whose transitions possess ,*, id arrows: “disjoint” graph homomorphisms, preserving place partitioning and all operations on transitions forgets ,*, id Z

33 Building Transactions II Given N  ZPetri, take Z (N): –arrows from u  S  to v  S  are the concurrent transactions of N –Prime arrows are the basic transactions of N from u  S  to v  S  non decomposable in parallel –e.g., in the multicast example, each basic transaction contains at most one “sender”

34 Coreflection A B F F (A) G G (B) when  a : a  G ( F (a)) is a natural iso

35 Coreflection B A when  a : a  G ( F (a)) is a natural iso, then A can be seen as a subcategory of B, with F the inclusion

36 Coreflection B A when  a : a  G ( F (a)) is a natural iso, then A can be seen as a subcategory of B, with F the inclusion Typical Scenario: –B category of operational models –A category of abstract models –G (b) is the same as b when observed from A

37 Abstract Net via Coreflection ZSN Petri objects: ZS nets arrows: refinement morphisms A refinement morphism R : N 1  N 2 –is a zero-safe net morphism R’ : N 1  Z (N 2 ) –that maps transitions of N 1 either to prime arrows of Z (N 2 ) or to transitions of N 2 AZAZ A Z maps ZS nets to their abstract counterparts the counit maps transitions to the transactions they represent N A Z (N) NN

38 From Nets to Computads Can we generalize the ZS approach? –Meta-theory for transactions formal models fully general notion refinement / abstraction –Extension of the distributed commit algorithm Petri Nets: based on multiset rewriting Zero-Safe Nets: bidimensional multiset rewriting –horizontal composition computes transactions –vertical composition builds computations on the abstract net RL & TL seem to be the natural candidates

39 RL & 2-Computads Main Ingredients of Rewriting Logic: –Signature  of system configurations –Structural axioms E –Rewrite rules over [t] E Categorically (in the initial model): –States form a cartesian category L ,E –the Lawvere Theory associated with ( ,E) underlined natural number as objects substitutions as arrows composition = substitution application –Proof terms form a cartesian 2-category 2-Computad –Monoidal category of configurations C –Rewrite rules over the arrows of C

40 Nets as 2-Computads S  seen as monoidal category –unique object 0 –u  S  seen as an arrow u:0  0 –sequential composition = tensor product u;v = u  v Transitions as rewrites –pre-set = source –post-set = target

41 RL & TL In (Unconditional) RL: –Rewrites  : f(x)  g(x) can be applied in any context C[.]: C[  (x)]: C[f(x)]  C[g(x)] with any argument p(y):  (p(y)): f(p(y))  g(p(y)) –Horizontal composition is total In TL: –Rewrites are coordinated via observations –applicable in context if C accept the effect of  –applicable with argument p if it provides the trigger –Horizontal composition is partial p f g C  p f g C 

42 TL & D-Computads Main Ingredients of Tile Logic: –(  H,E H ): system configurations –(  V,E V ): Observations –Tiles:  : [p] E H    [q] E H D-Computad –Monoidal category of configurations H –Monoidal category of observations V –Tiles over the arrows of H and C [u] E V [v] E V

43 ZS Nets as D-Computads S , Z  seen as monoidal categories –unique object 0 –u  S  seen as a configuration u:0  0 –a  Z  seen as an observation a:0  0 –(S  Z)  = S   Z  –sequential composition = tensor product u;v = u  v a;b = a  b Transitions as tiles –stable pre-set = initial configuration (north) –stable post-set = final configuration (south) –zero pre-set = trigger (west) –zero post-set = effect (east)

44 Tiling Transactions I ZComp HCatZComp objects: D-Computads arrows: disjoint D-Computads morphisms (on observations: injective on objects, faithful on arrows) objects: D-Computads whose tiles possess ,*, id arrows: disjoint D-Computad morphisms, preserving all operations on tiles forgets ,*, id D

45 Tiling Transactions II Given D  ZComp, take D (D): –cells with indentities as trigger and effect are the concurrent transactions of D –Elementary cells are the basic transactions of D trigger is an identity effect is an identity minimal –non decomposable in parallel –non decomposable sequentially –without unnecessary idle configurations

46 Tiling Transactions III ZComp HCatZComp forgets ,*, id D ZPetri HCatZPetri D recovers Z

47 Abstraction via Coreflection I Rcomp 2Comp objects: D-Computads arrows: refinement morphisms A refinement morphism M : D 1  D 2 –is a disjoint D-Computad morphism M’ : D 1  D (D 2 ) –that maps tiles of D 1 either to elementary elements of D (D 2 ) or to tiles of D 2 AdAd A d maps D-Computads to their abstract 2-Computads the counit maps rewrite rules to the transactions they represent D A d (D) DD

48 Abstraction via Coreflection II Rcomp 2Comp AdAd Petri ZSN A d recovers A Z

49 Example: CCS-like PC P ::= 0 | .P | P|P P act .P  id lpar P|Q  id P’|Q rpar P|Q  id  P|Q’ com P|Q id  P’|Q’ action prefix is frozen

50 Example: a Tile Transaction 0 act a.0 a id a.0 rpar _|_ a id  a _|_ P1P1 lpar _|_ a a  id _|_ P2P2 com _|_ id aaaa _|_ 0 act a.0 a id a.0 (X 1 |a.0)|(a.0|X 2 ) (X 1 |0)|(0|X 2 )  id

51 Abstract Communications _|_ P3P3 P2P2 P4P4 P5P5 P6P6 P7P7 P8P8 P1P1

52 Abstract Communications _|_ P3P3 P2P2 P4P4 P5P5 P6P6 P7P7 P8P8 P1P1

53 Abstract Communications _|_ P3P3 P2P2 P4P4 P5P5 P6P6 P7P7 P8P8 P1P1

54 Abstract Communications _|_ P3P3 P2P2 P4P4 P5P5 P6P6 P7P7 P8P8 P1P1

55 Abstract Communications _|_ P3P3 P2P2 P4P4 P5P5 P6P6 P7P7 P8P8 P1P1

56 Abstract Communications _|_ X1X1 a.X 2 X4X4 _|_ X3X3 a.X 5 X6X6 Each time, we want to consider just the most general “context”, which is essential to the interaction (X 1 |(a.X 2 |X 3 ))|(X 4 |(a.X 5 |X 6 )) (X 1 |(X 2 |X 3 ))|(X 4 |(X 5 |X 6 )) 

57 Abstract Communications _|_ X1X1 a.X 2 X4X4 X3X3 a.X 5 (X 1 |(a.X 2 |X 3 ))|(X 4 |a.X 5 ) (X 1 |(X 2 |X 3 ))|(X 4 |X 5 )  OK

58 Abstract Communications _|_ a.X 2 X1X1 _|_ (X 1 |a.X 2 )|(X 3 |(X 4 |a.X 5 )) (X 1 |X 2 )|(X 3 |(X 4 |X 5 ))  OK X4X4 a.X 5 X3X3

59 Abstract Communications _|_ a.X 2 X1X1 _|_a.X 5 (X 1 |a.X 2 )|((X 3 |X 4 )|a.X 5 ) (X 1 |X 2 )|((X 3 |X 4 )|X 5 )  NO! X3X3 X4X4

60 Abstract Communications _|_ a.X 2 X1X1 _|_a.X 4 Concurrent rewrites b.Y 1 b.Y 2

61 Conclusions & Future Work We have fully generalized the ZS approach –Refinement morphisms between Tiles –Abstract Rewrite Theory (aka 2-computad) –“Compositional” specification of transactions To investigate: –Connection with conditional RL

62 Tiling Transactions in RL a paper byRoberto Bruni José Meseguer Ugo Montanari a WRLA presentation byRoberto Bruni Research supported by IST-2001-32747 Project AGILE Italian MIUR Project COMETA ONR Grant N00014-02-1-0715 CNR Fellowship on Inf. Sci. and Techn. Electronic watercolor by Roberto Bruni


Download ppt "Tiling Transactions in Rewriting Logic Roberto Bruni (Pisa/Illinois) José Meseguer (Illinois) Ugo Montanari (Pisa) WRLA 2002 Pisa, Italia, 19-21 Sept."

Similar presentations


Ads by Google