FMSE Lecture 09
FMSE Lecture 09
Abstract Machines
outline
Operations/Functions
Take inputs from the user
Supply outputs to the user.
Affect any change within the
component.
Interface
Collection of operations by which
machine interacts with
environment.
Components of AMN
It is required by the machine to maintain or
process information.
For this a local state is required.
State is mentioned by the local variables.
State variables are listed under VARIABLES
heading.
INVARIANT
Their types and any other information are listed.
The information which must be true of the state.
For example type of variable must not be
changed during the execution.
Components of AMN contd..
INITIALISATION
Represents initial state
Machine Name
Machine must have a name ,so that other
machines can refer to it.
The name is given under the heading MACHINE.
Machine
It has a name, internal state, and set of operations as
do objects.
It may be considered as a black box with buttons on the
side corresponding to the operations, and a set of state
variables inside.
Components of AMN contd..
MACHINE Ticket
Ticket AMN
VARIABLES
To maintain the state of a system we define
variables, a variable should be of the type which is
suitable to express kind of value it can store.
How the systems are understood rather than
implemented.
In terms of values, sets, relations, sequences .
A variable can be of the type N, natural numbers
set(0,1,2,…..).
In the example we have two kind of tickets
Ticket number being served
Number of Next ticket to be dispensed.
We can model with variables:
next
serve
Ticket AMN contd..
VARIABLES serve, next
INVARIANT
Provides information about the variables of the
machine
It gives type of values of variable
Restrictions on their possible values
Relationships to each other
Values of variables may change but it describes the
properties of the variables which must be true during
execution process.
Type of variable is expressed as:
Either an element of a set var TYPE
Subset of a set var⊑ TYPE.
Var=expression
Ticket AMN contd..
At least one invariant clause should be defined
for each variable. Listed
Next N
Sreve N
Further restrictions imposed by the operation
can also be added
In Ticket machine number being served must be
less than the number of the ticket to be given
out.
serve≤next
Next<serv+20
INVARIANT serve N ⋀ next N ⋀ serve ≤ next
Serve<=next
26<=26
26+1=27
Exercise
Summary