Asynchronous Multi-Agent ASMs An Introduction Egon Börger Dipartimento di Informatica, Universita di Pisa

Slides:



Advertisements
Similar presentations
© Egon Börger: Linked List 1 Double Linked Lists : Desired Operations Define an ASM which offers the following operations, predicates and functions on.
Advertisements

Real-Time Process Control Systems (Real-Time Controller ASM for the Railroad Crossing Case Study) Egon Börger Dipartimento di Informatica, Universita di.
FIPA Interaction Protocol. Request Interaction Protocol Summary –Request Interaction Protocol allows one agent to request another to perform some action.
Global States.
Impossibility of Distributed Consensus with One Faulty Process
More on Processes Chapter 3. Process image _the physical representation of a process in the OS _an address space consisting of code, data and stack segments.
1 Distributed Deadlock Fall DS Deadlock Topics Prevention –Too expensive in time and network traffic in a distributed system Avoidance.
Chapter 6 - Convergence in the Presence of Faults1-1 Chapter 6 Self-Stabilization Self-Stabilization Shlomi Dolev MIT Press, 2000 Shlomi Dolev, All Rights.
Vered Gafni – Formal Development of Real Time Systems 1 Statecharts Semantics.
Justification-based TMSs (JTMS) JTMS utilizes 3 types of nodes, where each node is associated with an assertion: 1.Premises. Their justifications (provided.
Hoare’s Correctness Triplets Dijkstra’s Predicate Transformers
D u k e S y s t e m s Time, clocks, and consistency and the JMM Jeff Chase Duke University.
Garbage Collecting the World Bernard Lang Christian Queinnec Jose Piquer Presented by Yu-Jin Chia See also: pp text.
1 Maximal Independent Set. 2 Independent Set (IS): In a graph G=(V,E), |V|=n, |E|=m, any set of nodes that are not adjacent.
Self Stabilizing Algorithms for Topology Management Presentation: Deniz Çokuslu.
Announcements. Midterm Open book, open note, closed neighbor No other external sources No portable electronic devices other than medically necessary medical.
CS542 Topics in Distributed Systems Diganta Goswami.
Distributed Computing 8. Impossibility of consensus Shmuel Zaks ©
1 Maximal Independent Set. 2 Independent Set (IS): In a graph, any set of nodes that are not adjacent.
Asynchronous ASMs Network Leader Election Egon Börger Dipartimento di Informatica, Universita di Pisa
A Semantic Characterization of Unbounded-Nondeterministic Abstract State Machines Andreas Glausch and Wolfgang Reisig 1.
S NAPSHOT A LGORITHM. W HAT IS A S NAPSHOT - INTUITION Given a system of processors and communication channels between them, we want each processor to.
CS514: Intermediate Course in Operating Systems Professor Ken Birman Vivek Vishnumurthy: TA.
CS 582 / CMPE 481 Distributed Systems
Ordering and Consistent Cuts Presented By Biswanath Panda.
61 Nondeterminism and Nodeterministic Automata. 62 The computational machine models that we learned in the class are deterministic in the sense that the.
Asynchronous ASMs Ring Load Balance Egon Börger Dipartimento di Informatica, Universita di Pisa
 Idit Keidar, Principles of Reliable Distributed Systems, Technion EE, Spring Principles of Reliable Distributed Systems Lecture 7: Failure Detectors.
Asynchronous ASMs Master/Slave Agreement Egon Börger Dipartimento di Informatica, Universita di Pisa
© nCode 2000 Title of Presentation goes here - go to Master Slide to edit - Slide 1 Reliable Communication for Highly Mobile Agents ECE 7995: Term Paper.
Computer Science Lecture 11, page 1 CS677: Distributed OS Last Class: Clock Synchronization Logical clocks Vector clocks Global state.
© Egon Börger: Daemon Game 1 Daemon Game (Turner 1993) Problem Description Design a system for the following multi-player game: –A Daemon generates Bump.
Asynchronous Multi-Agent ASMs An Introduction Egon Börger Dipartimento di Informatica, Universita di Pisa
Distributed systems Module 2 -Distributed algorithms Teaching unit 1 – Basic techniques Ernesto Damiani University of Bozen Lesson 4 – Consensus and reliable.
Asynchronous ASMs Phase Synchronization on Undirected Trees Egon Börger Dipartimento di Informatica, Universita di Pisa
1 Formal Models for Transactions: Zero Safe Nets Roberto Bruni Dipartimento di Informatica Università di Pisa Models and Languages for Coordination and.
Illustrating Stepwise Refinement Shortest Path ASMs Egon Börger Dipartimento di Informatica, Universita di Pisa
On the Cost of Fault-Tolerant Consensus When There are no Faults Idit Keidar & Sergio Rajsbaum Appears in SIGACT News; MIT Tech. Report.
Paxos Made Simple Jinghe Zhang. Introduction Lock is the easiest way to manage concurrency Mutex and semaphore. Read and write locks. In distributed system:
Selected topics in distributed computing Shmuel Zaks
Introduction to ASMs Dumitru Roman Digital Enterprise Research Institute
Representing distributed algorithms Why do we need these? Don’t we already know a lot about programming? Well, you need to capture the notions of atomicity,
CS6133 Software Specification and Verification
Consensus and Its Impossibility in Asynchronous Systems.
Relativity and Abstract State Machines Edel Sherratt Aberystwyth University Aberystwyth, Wales, UK.
The Complexity of Distributed Algorithms. Common measures Space complexity How much space is needed per process to run an algorithm? (measured in terms.
“Virtual Time and Global States of Distributed Systems”
Distributed Systems Fall 2010 Logical time, global states, and debugging.
CSE 486/586, Spring 2013 CSE 486/586 Distributed Systems Global States Steve Ko Computer Sciences and Engineering University at Buffalo.
Distributed systems Consensus Prof R. Guerraoui Distributed Programming Laboratory.
D u k e S y s t e m s Asynchronous Replicated State Machines (Causal Multicast and All That) Jeff Chase Duke University.
Hwajung Lee. Well, you need to capture the notions of atomicity, non-determinism, fairness etc. These concepts are not built into languages like JAVA,
Hwajung Lee. Why do we need these? Don’t we already know a lot about programming? Well, you need to capture the notions of atomicity, non-determinism,
Chapter 11 Resource Allocation by Mikhail Nesterenko “Distributed Algorithms” by Nancy A. Lynch.
SysRép / 2.5A. SchiperEté The consensus problem.
Chapter 7: Consistency & Replication IV - REPLICATION MANAGEMENT By Jyothsna Natarajan Instructor: Prof. Yanqing Zhang Course: Advanced Operating Systems.
Fault tolerance and related issues in distributed computing Shmuel Zaks GSSI - Feb
Ordering of Events in Distributed Systems UNIVERSITY of WISCONSIN-MADISON Computer Sciences Department CS 739 Distributed Systems Andrea C. Arpaci-Dusseau.
Presented by: Belgi Amir Seminar in Distributed Algorithms Designing correct concurrent algorithms Spring 2013.
Asynchronous Multi-Agent ASMs with atomic or durative real-time actions (Real-Time Bakery Algorithm for Mutual Exlusion ) Egon Börger Dipartimento di Informatica,
CSE 486/586 CSE 486/586 Distributed Systems Global States Steve Ko Computer Sciences and Engineering University at Buffalo.
Distributed, Self-stabilizing Placement of Replicated Resources in Emerging Networks Bong-Jun Ko, Dan Rubenstein Presented by Jason Waddle.
1 Chapter 11 Global Properties (Distributed Termination)
1 Distributed Vertex Coloring. 2 Vertex Coloring: each vertex is assigned a color.
Introduction to distributed systems description relation to practice variables and communication primitives instructions states, actions and programs synchrony.
Asynchronous ASMs Echo Algorithm Egon Börger Dipartimento di Informatica, Universita di Pisa
Distributed Systems Lecture 6 Global states and snapshots 1.
Ordering of Events in Distributed Systems UNIVERSITY of WISCONSIN-MADISON Computer Sciences Department CS 739 Distributed Systems Andrea C. Arpaci-Dusseau.
Theory of Computational Complexity Probability and Computing Chapter Hikaru Inada Iwama and Ito lab M1.
Maximal Independent Set
Presentation transcript:

Asynchronous Multi-Agent ASMs An Introduction Egon Börger Dipartimento di Informatica, Universita di Pisa

© Egon Börger: Introduction to Async ASMs 2 E. Börger, R. Stärk Abstract State Machines A Method for High-Level System Design and Analysis Springer-Verlag 2003 For update info see AsmBook web page: For details see Chapter 6 (Asynchronous Multi-Agent ASMs) of:

© Egon Börger: Introduction to Async ASMs 3 Definition of Async ASMs Small Examples –Mutual Exclusion Dining Philosophers –Network Algorithms Master Slave Consensus References

© Egon Börger: Introduction to Async ASMs 4 Recalling Basic ASMs : computation step Basic ASM: a finite set of rules, executed by a single agent self, of form –If Condition Then Updates A computation step of a basic ASM: In the current state (well-defined global structure) S: –determine all the fireable rules in S (s.t. Cond is true in S) –compute all expressions t i,t occurring in updates f(t 1,…,t n ):=t this includes reading of the monitored functions, supposed to have well-defined stable values for each execution step execute simultaneously all these function updates

© Egon Börger: Introduction to Async ASMs 5 Recalling Basic ASMs: next state The updating yields a next state S’, which is well-defined by the updates - and by possible changes of the monitored function values, thought of as resulting from implicit actions of the environment –environment actions are assumed to be “located” with respect to a machine step in such a way that their result is ready when the machine is going to perform its next step (implicit environment-controller separation principle)

© Egon Börger: Introduction to Async ASMs 6 Distributed Runs: State Stability Problem In runs of asynchronously cooperating independent agents, the possible incomparability of moves - coming with different data, clocks, moments and duration of execution - makes it difficult –to uniquely define a global state where moves are executed –to locate changes of monitored fcts in the ordering of moves The coherence condition in the definition of asynchronous multi-agent ASM runs below postulates well-definedness for a relevant portion of state in which an agent is supposed to perform a step, thus providing a notion of “local” stable view of “the” idealized state in which an agent makes a move.

© Egon Börger: Introduction to Async ASMs 7 Async ASM Runs: Environmental Changes Changes of monitored functions can be made explicit as resulting from moves of one or more environment agents. –Such monitored moves - moves of “unkown” agents, as opposed to the controlled moves of the explicitly given agents - are often thought of as implicitly given, e.g. by speaking of “time moments” in which changes of monitored functions take place.

© Egon Börger: Introduction to Async ASMs 8 Defining Asynchronous Multi-Agent ASMs An Async ASM is a family of pairs (a, ASM(a)) of –agents a  Agent (a possibly dynamic set) –basic ASMs ASM (a) A Run of an async ASM is a partially ordered set (M, < ) of “moves” m of its agents s.t.: –finite history: each move has only finitely many predecessors, i.e. {m’ | m’ < m } is finite for each m  M –sequentiality of agents: for each agent a  Agent, his moves {m | m  M, a performs m} are linearly ordered by < –coherence: each (finite) initial segment X of (M, < ) has an associated state  (X) – think of it as the result of all moves in X with m executed before m’ if m<m’– which for every maximal element m  X is the result of applying move m in state  (X-{m})

© Egon Börger: Introduction to Async ASMs 9 Linearizing Initial segments of runs of an async ASM Linearization Lemma. Let X be a finite initial segment (downward closed subset) of a run of an async ASM. Each linearization of X yields a run with the same final state. Proof: follows from the coherence condition

© Egon Börger: Introduction to Async ASMs 10 Definition & Simple Properties of Async ASMs Small Examples –Mutual Exclusion Dining Philosophers See Reisig 1998, Sect. 10 Multiple Read One Write –Network Algorithms Master Slave Consensus Exercises and References

© Egon Börger: Introduction to Async ASMs 11 Exclusive use of shared resources: problem statement Goal: Design a distributed algorithm that –allows every interested agent to eventually use some shared resource in exclusive use –prevents two users to use the shared resource simultaneously Agent: set of agents each equipped with –resource: Resource (different agents may have the same resource) owner: Resource  Agent recording the current user of a given resource

© Egon Börger: Introduction to Async ASMs 12 Exclusive use of shared resources: single agent view The algorithm has to manipulate updates of owner in such a way that every attempt by an agent to become owner of his resource will eventually succeed Every single agent would like to execute alternately the following two rules: if owner(resource) = none then owner(resource):= self if owner(resource) = self then owner(resource):= none Conflicts in using resource shared among different agents are risolved by defining a partial order among possibly conflicting moves in an (appropriately initialized) run of an async ASM. Realizing such an order reflects appropriate scheduling and priority policies.

© Egon Börger: Introduction to Async ASMs 13 Dining Philosophers illustrating exclusive use of shared resources Shared resources represented as “forks” used by “philosophers” Resource assigning function F: depends on the neighbourhood in the underlying graph e.g. each agent may have one left and one right neighbour sharing the resource: Fork = (leftF,rightF) with elementwise defined owner leftF rightF phil if owner(leftF) = owner(rightF) = none then owner(leftF):= self owner(rightF):= self if owner(leftF) = owner(rightF) = self then owner(leftF):= none owner(rightF):= none

© Egon Börger: Introduction to Async ASMs 14 Definition of Async ASMs Small Examples –Mutual Exclusion Dining Philosophers –Network Algorithms Master Slave Consensus Simple Properties of Async ASMs References

© Egon Börger: Introduction to Async ASMs 15 Definition of Async ASMs Small Examples –Mutual Exclusion Dining Philosophers –Network Algorithms Master Slave Agreement See Reisig 1998, Sect. 30 (Fig.30.1), 75 Consensus Load Balance References

© Egon Börger: Introduction to Async ASMs 16 Master/Slave Agreement : problem statement Goal: Design a distributed algorithm for a master launching orders to slave agents, to be confirmed by them and to be executed iff all of them confirm to the master the acceptance of the order. Algorithmic Idea: –the master enquires about a job to be launched and then waits for answers from the slaves –the slaves answer the enquiry and then wait for the order or the cancellation of the launched job from the master –the master orders or cancels the job depending on whether all slaves answered to accept it or not Eventually the master becomes idle, with all slaves either idle too or executing the accepted job.

© Egon Börger: Introduction to Async ASMs 17 Master/Slave Agreement : Agent Signature master: a distinguished agent –order: Order external function yielding jobs to be sent to the slaves –ctl_state: {idle, waitingForAnswer} Slaves: a set of agents equipped with –asked: {true,false} recording whether a job request has been launched by the master to the slave –answer : {accept,refuse,undef} recording whether a job request has been acceped by the slave –ctl_state:{idle, waitingForOrder, busy} Initially ctl_state = idle, order = answer =undef, asked = false NB. Abstraction from message passing: functions asked, answer, order shared in writing resp.reading among slaves and master

© Egon Börger: Introduction to Async ASMs 18 Enquire  forall s  Slave s.asked := true Master/Slave Agreement ASMs OrderOrCancel  clear answer if for some s  Slave s.answer = refuse then order:=cancel else order:=job Answers Arrived  forall s  Slave s.answer  {accept, refuse} idle waiting For Answer Answers Arrived OrderOr Cancel Enquire Answer  if asked then choose r  {accept, refuse} answer:=r asked:=false OrderArrived  order  { job, cancel } idle waiting For Order Answer order = job Order Arrived busy no yes done

© Egon Börger: Introduction to Async ASMs 19 Master/Slave Agreement Correctness Proposition: In every run of a set of master and slaves, all equipped with the corresponding master/slave ASM, after the master has started an Enquiry, eventually the master becomes idle and –either all slaves become done or –all slaves become busy executing the job ordered by the master Proof. Follows by run induction.

© Egon Börger: Introduction to Async ASMs 20 Definition of Async ASMs Small Examples –Mutual Exclusion Dining Philosophers –Network Algorithms Master Slave Consensus See Reisig 1998, Sect. 35 (Fig. 35.1), 80 References

© Egon Börger: Introduction to Async ASMs 21 Consensus in Networks: problem statement Goal: Design a distributed algorithm for reaching consensus among homogeneous agents of finite connected networks (using only communication between neighbors, without broker or mediator, with abstract requests and answers). Algorithmic Idea: every agent (node) may –launch a request to his neighbors and wait for the replies –agree with the replies received from his neighbors –reply to requests received from his neighbors until all agents agree (maybe never)

© Egon Börger: Introduction to Async ASMs 22 Consensus ASM: Agent Signature Agent : finite connected set (of nodes) Each agent equipped with: –neighb  Agent (external function) –Request  {RequestFrom(n)|n  neighb } (controlled function) –Reply  {ReplyFrom(n)|n  neighb } (controlled function) –ctl_state : {pending, agreed} Initially ctl_state=pending, Request = empty, Reply = full chosenRule to control non-deterministic choice between LaunchNewRequest and Answer

© Egon Börger: Introduction to Async ASMs 23 Consensus Control State ASM ExpectedRepliesComplete  Reply = full pending agreed no LaunchNewRequest  Reply := empty BroadcastRequest BroadcastRequest  forall n  neighb insert RequestFrom(self) into Request(n) send answer for RequestFrom(n)  insert ReplyFrom(self) into Reply(n) Answer  forall r  Request do delete r from Request send answer for r Variation: choose r  Request... there are requests Answer yes chosenRule = Answer Expected Replies Complete LaunchNew Request yes chosenRule = LaunchNew Request no

© Egon Börger: Introduction to Async ASMs 24 Async Consensus ASM : Stability property Proposition: In every distributed run of agents equipped with the consensus ASM, if the run terminates, then for every agent holds: –ctl_state = agreed –Reply = full –Request = empty Proof (assuming that every enabled agent will eventually make a move): follows from the definition of LaunchNewRequest, Answer. –When Reply=full at agent, then there is no RequestFrom(agent) in Request(n) for any n  neighb(agent)

© Egon Börger: Introduction to Async ASMs 25 References W.Reisig: Elements of Distributed Algorithms Springer-Verlag 1998 Y. Gurevich and D. Rosenzweig: Partially Ordered Runs: A Case Study. In: Abstract State Machines. Theory and Applications. (Ed. Y.Gurevich et al). Springer LNCS 1912, 2000, E. Börger, R. Stärk: Abstract State Machines. A Method for High-Level System Design and Analysis Springer-Verlag 2003, see