240 likes | 366 Views
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.
E N D
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
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)
Basic ASM • States are first order structures (base set with functions) • Vocabulary, terms, locations • Moves update the values of locations
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
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 mX, there is a unique state s(X) that results from performing m in the state s(X\{m})
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
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
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
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
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
What’s wrong with global time? • Suppose client uses multiple services • Global time is determined by more than one communicator • Which takes precedence?
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
Fitzgerald, Lorentz, Einstein • Inertial frames do not accelerate wrt each other • Lorentz transformation preserves laws of electrodynamics • So no preference for any frame
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
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
Aim • Identify transformations analogous to the Galilean and Lorentz transformations that preserve required properties of abstract state machines
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
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
Private state • Updates are applied instantaneously • But computing the update set is not necessarily instantaneous • Shareable locations should not be used for scratch work
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
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