Title: The Meaning of a Specification
1 The Meaning of a Specifications Meaning Case
Example MSC Clive Jervis
2What is a Specification?
- We readily use terms such as
- specification,
- design,
- implementation.
- We invent formal languages to express these.
- We may even ascribe them formal semantics.
- We use sub-categories such as
- underspecification
- overspecification
- refined specification
- But what do they mean?
- What are their relationships?
3Specification
- A simple definition
- A specification represents a set of
implementations - A specification that represents more than one
implementation we call underspecification - an
implementer is free to choose which one to build. - A specification that represents just one
implementation is complete and the implementer
has no freedom of choice. - Notice, the type of specifications is different
to the type of implementations type Spec set
of(set of Imp) - Definition is independent of definition of
implementation.
4Correct Implementation
Definition of correctness An implementation
satisfies its specification if it is amongst its
representations. I satisfies S ? I ? S If a
specification is inconsistent, then it represents
the empty set, and so no implementation can
satisfy it.
5Is MSC a Specification Language?
According to the language, an MSC defines a set
of traces. But does each trace define an intended
implementation?
msc am_I_a_specification
lower
middle
upper
m
n
lt !m, ?m, !n, ?n gt lt !m, !n, ?m, ?n gt lt !m, !n,
?n, ?m gt
- MSC defines 3 traces.
- Each trace fixes the exact order of events ?m and
?n.
MSC semantics does not seem to fit our definition
of specification
6MSC is a Specification Language
It is possible to define functions that
transforms a set of traces into sets of traces.
- However, there are different functions.
- For example
- one permits only deterministic implementations
- one permits non-determinist implementations
MSC Semantics not very helpful but permits many
interpretations
7When is a Specification not a Specification?
When its a design. Specifications commonly tell
not just what we can build, but how to build
it. When is a design not a design? When its a
specification. Often designs are vehicles for
expressing specifications. That is, an
implementer does not have to follow the design,
just the functionality. Is MSC a design language?
8Design
- A simple definition
- A prescription for building an implementation
- from a set of given components
- By given we mean specified.
- By prescription we mean a function.
- Notice, the type of design is different to the
type of specification and type of
implementation. - Definition is independent of implementation, but
not of specification.
9Correct Design
- A design is correct with respect to a
specification if - whenever we take a set of components that meet
their specifications, - and construct an implementation following the
design prescription, - then it satisfies the specification.
- c1 sat S1 ? ? cn sat Sn ? D(c1, , cn) sat S
- Note, design correctness is measured against a
given specification.
10Is MSC a Design Language?
- If we partition instances into components, then
the partition forms a design. - In particular, if we take each instance as a
separate component, it represents a design. - How to consider an MSC as a design
- extract a trace specification for each component
- concurrent composition of the components
represents the design function
MSC is a design language if we define
components. MSC language is not very helpful in
defining designs.
11Overspecification
We can define overspecification of a component in
a design. If a component specification can be
relaxed without altering the set of possible
constructions, then it is overspecified. Overspec
ification represents functional redundancy.
12Overspecified Instance
msc overspecified
upper
lower
middle
Middle specifies that m is sent before n, but
upper and lower dont know or care.
m
n
msc just_right
lower
middle
upper
Implementer is free to choose order of sending m
and n.
m
n
13Refinement
A refinement is a design that satisfies a given
specification. Refinement can reduce the choices
open to an implementer. Can MSCs be used in
refinement? Thats another story
14What is the meaning of MSC?
Is it a specification language? Is it a design
language? Is it an implementation language? Its
whatever you want it to be, but the semantics fit
none of the above! No-one agrees on what an MSC
means, even though everyone can agree its
semantics. If we add a definition of
implementation, we find that there are MSCs with
well defined semantics, but which
are inconsistent (have no possible
implementation)!
15Call To Arms
- Let us agree on meaning of semantic terms
- Ensure that
- recommendations use the terms consistently
- the semantics reflect the terms
- We are worse off than UML, because we pretend to
have semantics, even formal semantics