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

Slides:



Advertisements
Similar presentations
CommUnity, Tiles and Connectors joint work with Roberto Bruni José Luiz Fiadeiro Antónia Lopes Ugo Montanari Ivan Lanese Dipartimento di Informatica Università.
Advertisements

Connectors and Concurrency joint work with Ugo Montanari Roberto Bruni Dipartimento di Informatica Università di Pisa Dagstuhl Seminar #04241, September.
Modular Processings based on Unfoldings Eric Fabre & Agnes Madalinski DistribCom Team Irisa/Inria UFO workshop - June 26, 2007.
Specification, Partitioning, and Composition Techniques for Web Applications in the Context of Event-B Abdolbaghi Rezazadeh Michael Butler University of.
1 Transactions and Web Services. 2 Web Environment Web Service activities form a unit of work, but ACID properties are not always appropriate since Web.
CS 603 Handling Failure in Commit February 20, 2002.
Roberto Pisa, Italy 13 June 2008 WADT Tiles for Reo Roberto Bruni Dipartimento di Informatica Università di Pisa WADT th International.
A Semantic Characterization of Unbounded-Nondeterministic Abstract State Machines Andreas Glausch and Wolfgang Reisig 1.
Transaction Processing Lecture ACID 2 phase commit.
1 The SOCK SAGA Ivan Lanese Computer Science Department University of Bologna Italy Joint work with Gianluigi Zavattaro.
1 Review Topics 1.Basic understanding of a business process 2.The relationship of a business process with a work flow 3.The different types aspects and.
1 Formal Models for Transactions: Petri Nets Roberto Bruni Dipartimento di Informatica Università di Pisa Models and Languages for Coordination and Orchestration.
1 Ivan Lanese Computer Science Department University of Bologna Roberto Bruni Computer Science Department University of Pisa A mobile calculus with parametric.
1 Formal Models for Distributed Negotiations Description Roberto Bruni Dipartimento di Informatica Università di Pisa XVII Escuela de Ciencias Informaticas.
1 Formal Models for Distributed Negotiations Zero-Safe Nets Roberto Bruni Dipartimento di Informatica Università di Pisa XVII Escuela de Ciencias Informaticas.
Synchronization Algebras with Mobility for Graph Transformations joint work with Ugo Montanari Dipartimento di Informatica Università di Pisa Ivan Lanese.
1 Formal Models for Distributed Negotiations Workflows, BizTalk and ZSN Roberto Bruni Dipartimento di Informatica Università di Pisa XVII Escuela de Ciencias.
1 Ugo Montanari Dipartimento di Informatica Università di Pisa Roberto Bruni, GianLuigi Ferrari, Hernan Melgratti, Emilio Tuosto (Pisa) Cosimo Laneve (Bologna)
1 Formal Models for Distributed Negotiations Transactions in Linda Roberto Bruni Dipartimento di Informatica Università di Pisa XVII Escuela de Ciencias.
1 Formal Models for Distributed Negotiations Concurrent Languages Translation Roberto Bruni Dipartimento di Informatica Università di Pisa XVII Escuela.
Hernán Melgratti joint work with Roberto Bruni and Ugo Montanari Dipartimento di Informatica - Università di Pisa Flat Committed Join in Join.
New insights on architectural connectors joint work with Roberto Bruni University of Pisa, Italy Ugo Montanari University of Pisa, Italy José Luiz Fiadeiro.
1 Static vs dynamic SAGAs Ivan Lanese Computer Science Department University of Bologna/INRIA Italy.
1 Formal Models for Transactions: Zero Safe Nets Roberto Bruni Dipartimento di Informatica Università di Pisa Models and Languages for Coordination and.
1 Ivan Lanese Computer Science Department University of Pisa Prof. Ugo Montanari Synchronization strategies for global computing Relator: Thesis Progress.
Pre-nets, (read arcs) and unfolding: A functorial presentation Paolo Baldan (Venezia) Roberto Bruni (Pisa/Illinois) Ugo Montanari (Pisa) WADT Frauenchiemsee,
1 Ivan Lanese Computer Science Department University of Bologna Italy Concurrent and located synchronizations in π-calculus.
1 Formal Models for Distributed Negotiations From Petri Nets to Join Calculus Roberto Bruni Dipartimento di Informatica Università di Pisa XVII Escuela.
Modeling a Service and Session Calculus with Hierarchical Graph Transformation Roberto Bruni, Andrea Corradini, Ugo Montanari (based on joint work with.
Modeling Community with Tiles joint work with Ivan Lanese Ugo Montanari Dipartimento di Informatica Università di Pisa Roberto Bruni Dipartimento di Informatica.
An algebra of Connectors for modeling CommUnity with Tiles joint work with Roberto Bruni Ugo Montanari Dipartimento di Informatica Università di Pisa Ivan.
1 Formal Models for Transactions: BizTalk as ZSN Roberto Bruni Dipartimento di Informatica Università di Pisa Models and Languages for Coordination and.
Dipartimento di Informatica Università di Pisa Nested Commits for Mobile Calculi: Extending Join Roberto Bruni, Hernán Melgratti and Ugo Montanari.
1 Algebraic Theories for Contextual Pre-Nets Roberto Bruni - Dipartimento di Informatica, Università di Pisa joint work with: José Meseguer (UIUC) Ugo.
1 Formal Models for Distributed Negotiations Introduction Roberto Bruni Dipartimento di Informatica Università di Pisa XVII Escuela de Ciencias Informaticas.
Complete Axioms for Stateless Connectors joint work with Roberto Bruni and Ugo Montanari Dipartimento di Informatica Università di Pisa Ivan Lanese Dipartimento.
1 Category Theory in a ( E,M ) -category Some aspects of category theory, in particular related to universality, can be developed in any finitely complete.
Computer Science Lecture 12, page 1 CS677: Distributed OS Last Class Vector timestamps Global state –Distributed Snapshot Election algorithms.
Distributed Databases
The Relationship between Topology and Logic Dr Christopher Townsend (Open University)
Commit Protocols. CS5204 – Operating Systems2 Fault Tolerance Causes of failure: process failure machine failure network failure Goals : transparent:
An Information Theory based Modeling of DSMLs Zekai Demirezen 1, Barrett Bryant 1, Murat M. Tanik 2 1 Department of Computer and Information Sciences,
Category Theory By: Ashley Reynolds. HISTORY OF CATEGORY THEORY  In 1942–45, Samuel Eilenberg and Saunders Mac Lane introduced categories, functors,
USING METADATA TO FACILITATE UNDERSTANDING AND CERTIFICATION ABOUT THE PRESERVATION PROPERTIES OF A PRESERVATION SYSTEM Jewel H. Ward, Hao Xu, Mike C.
Introduction to Formal Methods Based on Jeannette M. Wing. A Specifier's Introduction to Formal Methods. IEEE Computer, 23(9):8-24, September,
 FOAL 2010 Modeling Aspects by Category Theory Serge P. Kovalyov Novosibirsk, Russia.
Week 5 Lecture Distributed Database Management Systems Samuel ConnSamuel Conn, Asst Professor Suggestions for using the Lecture Slides.
A Holistic Security Architecture for Distributed Information Systems – A Categorical Approach.
PAVANI REDDY KATHURI TRANSACTION COMMUNICATION. OUTLINE 0 P ART I : I NTRODUCTION 0 P ART II : C URRENT R ESEARCH 0 P ART III : F UTURE P OTENTIAL 0 R.
Process Coordination in BPEL CounterProposal Bob Haugen.
Dipartimento di Informatica Università di Pisa Alberto Baragatti, Roberto Bruni, Hernán Melgratti, Ugo Montanari and Giorgio Spagnolo Prototype Platforms.
Lecture 2: Introduction to Category Theory Nick Rossiter, Computing Science, Newcastle University, England
Commit Algorithms Hamid Al-Hamadi CS 5204 November 17, 2009.
Balanced Category Theory Claudio Pisani Calais, June 2008.
Modeling a Service and Session Calculus with Hierarchical Graph Transformation Joint work with Roberto Bruni and Andrea Corradini, second part Ugo Montanari.
DISCRETE COMPUTATIONAL STRUCTURES CSE 2353 Fall 2010 Most slides modified from Discrete Mathematical Structures: Theory and Applications by D.S. Malik.
1 Typing in Information Systems Nick Rossiter, Michael Heather Computer Science and Digital Technologies Northumbria University, Newcastle NE1 8ST, UK.
The theory behind Functional Programming Functional: based on lambda calculus / combinators, recursion theory, category theory. By contrast with other.
Revisiting failure detectors Some of you asked questions about implementing consensus using S - how does it differ from reaching consensus using P. Here.
Ordering of Events in Distributed Systems UNIVERSITY of WISCONSIN-MADISON Computer Sciences Department CS 739 Distributed Systems Andrea C. Arpaci-Dusseau.
Operational Semantics Mooly Sagiv Tel Aviv University Sunday Scrieber 8 Monday Schrieber.
Ordering of Events in Distributed Systems UNIVERSITY of WISCONSIN-MADISON Computer Sciences Department CS 739 Distributed Systems Andrea C. Arpaci-Dusseau.
Coordination and conversation protocols in open multi-agent systems
Axioms for a category of spaces
Graph-Based Operational Semantics
State Machine Diagrams
Denotational Semantics (Denotational Semantics)
Distributed Transactions
Process in the World as a Transaction
Transaction Communication
Presentation transcript:

Tiling Transactions in Rewriting Logic Roberto Bruni (Pisa/Illinois) José Meseguer (Illinois) Ugo Montanari (Pisa) WRLA 2002 Pisa, Italia, Sept Research supported by IST Project AGILE Italian MIUR Project COMETA ONR Grant N CNR Fellowship on Information Sciences and Technologies

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

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

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

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

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

Zero-Safe Nets stable places zero places transitions tokens

Zero-Safe Nets stable places zero places transitions tokens

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

Parallel composition  receive

Horizontal Composition * copy receive

Transaction copy receive send

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

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,…

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, …)

A Constructive View of Adjunctions A B

A B F F (A)

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

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

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

Adjunctions: Formally b BA For any b  B

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

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

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 (ĝ)

Duality A B F F (A)

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

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

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

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

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

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

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

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”

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

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

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

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

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

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

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

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 

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

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)

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

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

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

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

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

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

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

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

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

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

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

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

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 )) 

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

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

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

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

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

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