24
Relativity and Abstract State Machines Edel Sherratt Aberystwyth University Aberystwyth, Wales, UK

Relativity and Abstract State Machines Edel Sherratt Aberystwyth University Aberystwyth, Wales, UK

Embed Size (px)

Citation preview

Page 1: Relativity and Abstract State Machines Edel Sherratt Aberystwyth University Aberystwyth, Wales, UK

Relativity and Abstract State Machines

Edel SherrattAberystwyth UniversityAberystwyth, Wales, UK

Page 2: Relativity and Abstract State Machines Edel Sherratt Aberystwyth University Aberystwyth, Wales, UK

Content

• Abstract State Machines rock• Global Time doesn’t• We’ve been here before• Some analogies• A small step towards admissible

transformations between ASMs’ frames of reference

Page 3: Relativity and Abstract State Machines Edel Sherratt Aberystwyth University Aberystwyth, Wales, UK

ASMs are Powerful and Versatile

• Every kind of algorithm (Blass, Gurevich)• Conway's game of life, ambiguous grammars,

lift control, Internet telephony, database recovery … (Börger, Stärk)

• Asynchronous communication (Glässer, Gurevich, Veanes)

• SDL semantics (Glässer, Gotzhein, Prinz)

Page 4: Relativity and Abstract State Machines Edel Sherratt Aberystwyth University Aberystwyth, Wales, UK

Basic ASM

• States are first order structures (base set with functions)

• Vocabulary, terms, locations• Moves update the values of locations

Page 5: Relativity and Abstract State Machines Edel Sherratt Aberystwyth University Aberystwyth, Wales, UK

Distributed ASM

• ASM with multiple threads of control• Each associated with an agent• Each agent interprets its ASM program

according to its partial view of the state• This gives an update set

Page 6: Relativity and Abstract State Machines Edel Sherratt Aberystwyth University Aberystwyth, Wales, UK

Distributed ASM

Page 7: Relativity and Abstract State Machines Edel Sherratt Aberystwyth University Aberystwyth, Wales, UK

Distributed ASM

• A run is a partially ordered set of moves (M,<) such that– each move has finitely many predecessors– the moves performed by a given agent are linearly

ordered by <– for every finite initial segment X of (M, <), and

every maximal move m X, there is a unique state (s X) that results from performing m in the state (s X\{m})

Page 8: Relativity and Abstract State Machines Edel Sherratt Aberystwyth University Aberystwyth, Wales, UK

Distributed ASM

• Freedom to schedule a run• Moves can be carried out– In parallel, unless they conflict– Interleaved– According to an explicit schedule

• Coherence condition; more restrictive than serializability in e.g. database scheduling

Page 9: Relativity and Abstract State Machines Edel Sherratt Aberystwyth University Aberystwyth, Wales, UK

ASMs with Time (Graf, Prinz)

• Focus on moves rather than states• Moves are events (contrast with spacetime

events)• Moves are timed so that the partial ordering

on moves is reflected in a compatible order on time

• Time allows measurement of distance between (some) events

Page 10: Relativity and Abstract State Machines Edel Sherratt Aberystwyth University Aberystwyth, Wales, UK

Global Time

• Implicit in the basic ASM• Is it present in the case of a distributed ASM?– Confluence of rule applications suggests that it is– In any run, moves are ordered in global time,

though some occur at the same global time– Local timestamps set by reading the monitored

function ‘now’, which gives a global time

Page 11: Relativity and Abstract State Machines Edel Sherratt Aberystwyth University Aberystwyth, Wales, UK

What’s wrong with global time?

• Server with clients; online ticketing system• A distributed ASM, but clients have distinct,

usually conflicting , goals• Server determines which requests succeed

and which fail• Global time is determined by the server

Page 12: Relativity and Abstract State Machines Edel Sherratt Aberystwyth University Aberystwyth, Wales, UK

What’s wrong with global time?

• A new client for a running service• Abstract Communicator (Glässer et al.) acts as

intermediary• Communicator is part of client’s environment• Global time is determined by communicator• Communicator determines global time for all

clients• And resolves clients’ times with server’s time

Page 13: Relativity and Abstract State Machines Edel Sherratt Aberystwyth University Aberystwyth, Wales, UK

What’s wrong with global time?

• Suppose client uses multiple services• Global time is determined by more than one

communicator• Which takes precedence?

Page 14: Relativity and Abstract State Machines Edel Sherratt Aberystwyth University Aberystwyth, Wales, UK

We’ve been here before

Page 15: Relativity and Abstract State Machines Edel Sherratt Aberystwyth University Aberystwyth, Wales, UK

Galileo (and Newton)

• Absolute space• Inertial frame is in uniform motion relative to

absolute space• Universal absolute time shared by all inertial

frames• Galilean transformation: x’=x-vt, t’=t, y’=y, z’=z

Page 16: Relativity and Abstract State Machines Edel Sherratt Aberystwyth University Aberystwyth, Wales, UK

Fitzgerald, Lorentz, Einstein

• Inertial frames do not accelerate wrt each other

• Lorentz transformation preserves laws of electrodynamics

• So no preference for any frame

Page 17: Relativity and Abstract State Machines Edel Sherratt Aberystwyth University Aberystwyth, Wales, UK

Relevance to ASMs?

• Analogy• Space is defined by the vocabulary of an ASM• Time progresses through a run• Event is a combination of state (values at

locations) and time (contrast with event as move)

• ASMs communicate only through mutually accessible locations

Page 18: Relativity and Abstract State Machines Edel Sherratt Aberystwyth University Aberystwyth, Wales, UK

Where the analogy breaks down

• ASMs need not operate in the same space• In general, shared locations represent minor

points of overlap• ASM spacetime is not continuous• Nonetheless, differences between states can

be computed as can distances in time

Page 19: Relativity and Abstract State Machines Edel Sherratt Aberystwyth University Aberystwyth, Wales, UK

Aim

• Identify transformations analogous to the Galilean and Lorentz transformations that preserve required properties of abstract state machines

Page 20: Relativity and Abstract State Machines Edel Sherratt Aberystwyth University Aberystwyth, Wales, UK

Observing an event

• Two ASMs, A and B• Can B observe a location as A sees it?• Only mutually accessible location(s) can be

observed• Terms of A map to terms of B iff the terms

refer to the same location

Page 21: Relativity and Abstract State Machines Edel Sherratt Aberystwyth University Aberystwyth, Wales, UK

Time of an event (state)

• Local clocks can only be synchronized if mutually accessible locations have the same values

• Otherwise each ASM sees the state of the other as being in its own past or future

Page 22: Relativity and Abstract State Machines Edel Sherratt Aberystwyth University Aberystwyth, Wales, UK

Private state

• Updates are applied instantaneously• But computing the update set is not

necessarily instantaneous• Shareable locations should not be used for

scratch work

Page 23: Relativity and Abstract State Machines Edel Sherratt Aberystwyth University Aberystwyth, Wales, UK

Conserving History

• Suppose SA precedes SA’ in the history of A, and suppose B observes those states as SB and SB’

• That is, mutually accessible locations are mapped from A’s terms and A’s time to B’s terms and B’s time

• Then SB must also precede SB’ in B’s frame of reference

Page 24: Relativity and Abstract State Machines Edel Sherratt Aberystwyth University Aberystwyth, Wales, UK

Summary

• Some initial requirements that must be fulfilled by any transformation of observations from the state and time of one ASM to those of another have been identified

• Much remains to be done to achieve the aim of identifying useful transformations