Software Specification: Algebraic Specification
Algebraic Specification
Algebraic specification [Guttag 1977] is a technique whereby an object is specified in terms of the relationships between the operations that act on that object.
A specification is presented in four parts
Introduction part where the sort of the entity being specified is introduced and the name of any other specifications which are required are set out
1. Informal description of the sort and its operations
2. Signature where the names of the operations on that object and the sorts of their parameters are defined
3. Axioms where the relationships between the sort operations are defined.
Note:
> The introduction part of a specification also includes an imports part which names the other specifications which are required in a specification.
Description part:
> Formal text with an informal description
Signature part:
> Names of the operations which are defined over the sort,
> Number and sort of their parameters, and
> Sort of the result of evaluating of the operation.
Axioms part:
> Operations in terms of their relationships with each other.
Two classes of operations:
• Constructor operations: Operation that create or modify entities of the sort which is defined in the specification.
• Inspection operations: Operations that evaluate attributes of the sort which defined in the specification.
Example (Figure)
Sort: Coord.
Operations:
- Creating a coordinate,
- Testing coordinates for equality, and
- Accessing the X and Y components.
Imports:
Two specifications:
- BOOLEAN
- INTEGER.
Note:
> In the specification of the Eq operation the operator ‘=’ is overloaded.
Posted in Computer Science, Information Technology, Software Engineering, Software Engineering |
