T2.0 Background and Motivation
The LSD notation was first developed by Beynon in collaboration with Mark Norris of British Telecom in 1986. The original influence over the design of the LSD notation was SDL [BN87]. (The terminology of LSD first had "process" rather than "agent" for this reason.) The elaboration of the design and identification of the agent-oriented non-operational nature of the specification was carried out by Mike Slade, as described in his MSc thesis (1989). One of the main objectives of Slade's work, sponsored by British Telecom, was the development of software for animating from LSD specifications; this led to the design and implementation of the ADM. The challenges of graphical animation from the ADM have been met subsequently through the work of Simon Yung in linking the ADM and EDEN. (Though something is lost in the translation process.)
LSD specification and ADM simulation arguably address issues rather different from SDL. Some points of particular relevance are:
Most methods of computer modelling put the emphasis on trying to
specify / mimic the global behaviour of a system without explicitly modelling
the relationship between its component parts. In formal specification,
independence of the physical model is regarded as desirable, on the assumption
that understanding the behaviour of a system should precede the construction
of its components. Most simulation tools are based on random generation
of inputs etc that can give a useful view of the overall behaviour of a
discrete-event system, but will generally fail to account for the essential
mechanisms that cause particular sequences of events, and be of little
help in matters of detail. The trend towards using qualitative models (as
in naive physics) also tends to divorce computer-based modelling from physical
principles.
Our approach reflects a different outlook: we consider that complex
specifications for systems cannot be constructed without building and experimenting
on components, that simulation that is based on a statistical approach
is too coarse a tool for many applications, and that a computer model in
physics and engineering must be based on a strong relationship to the physical
entity it represents. Until these concerns are addressed, the scientific
integrity of computer use in many applications is in question.
The LSD specification of an agent comprises 4 kinds of variable:
state - a variable that it ownsIt also includes a protocol that specifies the possible actions that the agent can perform to change the system state, subject to certain enabling conditions being met. In setting up a simulation from a specification, instances of specified agents are introduced. The effect of agent action may be to invoke or delete other agents. The special variable LIVE can be used to specify when an agent instance is deleted.oracle - a variable to which it responds
handle - a variable conditionally under its control
derivate - an indivisibly coupled stimulus-response relation
As an illustrative example, consider the following specification of the station_master agent, taken from the railway station animation:
agent sm() { // The station master:
state (time) tarrive = |Time|, // registers time of arrival
(bool) can_move = false, // determines whether driver can start engineoracle (time) Limit, Time, // knows the time to elapse before departure due(bool) whistle = false, // controls the whistle
(bool) whistled = false; // remembers whether he has blown the whistle
(bool) sm_flag = false, // controls the flag
(bool) sm_raised_flag = false // remembers whether he has raised the flag
(bool) guard_raised_flag, // knows whether the guard has raised his flaghandle (bool) can_move, whistle, whistled, sm_flag, sm_raised_flag,(bool) driver_ready, // knows the driver is ready
(bool) around[d] (d = 1 .. number_of_doors), // knows whether there's anybody around doorway
(bool) door_open[d] (d = 1 .. number_of_doors) // the doors status
(bool) door_open[d] (d = 1 .. number_of_doors) // partially controls the doorsderivate (bool) ready = ^ (! door_open[d]) | d = 1 .. number_of_doors), // monitors whether all doors are shut
(bool) timeout = (Time - tarrive) > Limit; // monitors whether departure dueprotocol
door_open[d] ^ around[d] -> door_open[d] = false, (d = 1 .. number_of_doors)}ready ^ timeout ^ ! whistled -> whistle = true; whistled = true; guard(); whistle = false,
ready ^ whistled ^ ! sm_raised_flag -> sm_flag = true; sm_raised_flag = true,
sm_flag ^ guard_raised_flag -> sm_flag = false,
ready ^ guard_raised_flag ^ driver_ready ^ engaged ^ ! can_move -> can_move = true
The term "variable" is not necessarily a good name for the oracles, states, handles and derivates of the LSD specification. In a sense, they are all observables, but in some instances they are observables associated with different agents of what is conceptually the same thing. This is why the same identifier occurs many times in an LSD specification:
e.g. measSpeed state for speed_transducer
oracle for throttle_manageroracle for the driver
cruiseStts state for cruise_cutout
oracle for the driver
oracle for the throttle_manager.
The oracle, state, handle, derivate
characterisation reflects the status of the observable with respect to
the agent. For instance, a handle resembles what we have previously termed
an experimental parameter. We shall adopt v-observable to mean observable
designated by identifier v. Note that in simulation derived from an
LSD specification, identifier instances will in general be represented
by different variables.
The system designer determines the observables recorded in the LSD specification. These observables are what the designer would record and subject to experiment in relating the (pre-act-of-faith) behaviour of the system to the (post-act-of-faith) reliable activity of the components.
More about the classification of variables associated with an agent
states
A state variable v is the primary source of all v-observables: at any time, all v-observables are associated with at most one state variable.
A state variable v is a record of the "authentic value" of v-observables. It's value is not necessarily the value perceived by the agent to which it is bound. That is to say, a variable may be both an oracle and a state to the same agent, as in "The time as recorded by my watch", or "my bank balance".
Note that those agents which serve primarily as observers and actors
in a system tend to have few state variables. E.g. there are no state variables
associated with the driver agent.
In the VCCS as implemented, it would be possible to treat the parameters
of the vehicle as subject to change. E.g. a simulation might take account
of loading the vehicle, or express the relationship between the wind resistance
and the vehicle profile.
This admits the possibility that its value is inaccurate.
actSpeed is state in vehicle, ...
Note that actSpeed is not deemed to be an oracle to the speed_transducer, though it is referred to by a derivate. We might ask in a similar spirit whether, in the privilege
!door_locked ^ !door_open -> door_open = true
the fact that a door is locked is an oracle to the door user. Whether the door can be opened or not in no way depends on the user's perception of whether it is or isn't locked, nor is the effect of locking the door subject to delay.
Handles allow direct action of one agent upon another that is outside the scope of an object-oriented paradigm (cf an object invokes a method to change its state).
When a v-handle and v-oracle co-exist, they together indicate communication
between agents. When animating from a specification, appropriate assumptions
about communication have to be made. For instance, the VCCS specification
does not specify how the speed of the vehicle, as measured by the speed_transducer,
is communicated to the throttle_manager. In animation, we might assume
idealised communication, or refine the specification to include further
details of the communication channel.
Each privilege represents a possible action, or sequence of actions, that an agent can perform in appropriate circumstances. For example, if the engine is switched off, the driver can switch it on, and vice versa.
There is no fixed set of rules for interpreting agent protocols in operational
terms. Relevant considerations include:
Issues for the designer (to be addressed by an LSD specification):
Simplest case, as illustrated by Hooke's Law: "change o1 and observe o2".
Can still recognise a functional dependency where another agent is responsible for changing o1. There is a semantic distinction between o1 and o2:
in changing o1, refer to o1 not as an observable but as state variable
in observing o2, regard o2 as an oracle.
[A spreadsheet user may continue to update though the spreadsheet has yet to be made consistent. In effect, if o1 is displayed value of cell1 and o2 is displayed value of cell2, then the relation o2 = f(o1) is guaranteed to hold only when the spreadsheet is completely up-to-date. This can be understood in terms of the above model as: o2 is an oracle to the spreadsheet agent. In observing o2, the spreadsheet agent does not simply consult the display, but (as when following a protocol for an experimental observation) waits until the spreadsheet is up-to-date.]
The use of derivates in animation from an LSD specification reflects presumed functional dependencies and synchronisations in the view of the system designer. This interpretation may conflict with the concept of a derivate as an indivisible relationship as perceived by an agent.
[In a model of spreadsheet and spreadsheet user system, have to appeal to the protocol for observation used to determine the value of a cell described above to account for the fact that the spreadsheet user perceives definitive relationships that in the view of the system designer are not universally valid. This is good illustration of how a v-oracle is to be interpreted with reference to subtle conventions of communication and observation. Notice also that the indivisibility of relationships between spreadsheet cells defined by formulae in the view of the spreadsheet user is here guaranteed because no other agent can interrupt the updating process - if this were not the case, the premise on which the user continues to enter data whilst the spreadsheet is still updating would be invalid.]
The usefulness of the concept of a derivate as an indivisible relationship as perceived by an agent is illustrated by the derivates used in the station_master agent in the train specification.
Important distinction between timeless experiments (cf Hookes' Law) and those in which analogue behaviour plays a role. In the latter, events and analogue variables are used, as in the VCCS (cf Th2).
LSD isn't intended to define an unambiguous behaviour for a concurrent system in itself. The interpretation of oracles, the ways in which privileges to act are exercised by agents, the nature of the relationship between observed stimulus and response, and the speed with which sequential steps in the protocol are executed are all subject to further examination before an animation can be constructed.
T2.3. Illustrative Examples
For illustrative examples, refer to the LSD specifications given in the Appendix: the VCCS, the RSA, the Digital Watch, the Electronic Catflap (in versions by Simon Yung and Ian Bridge) and the Telephone.
References
[BN87] WMB + MTN: Comparison of SDL and LSD
[BNOS90] WMB et al: Definitive Specification of Concurrent Systems
[BNS88] WMB et al: Definitions for modelling and simulating concurrent systems