13.07.2015 Views

Software Design 2e - DIM

Software Design 2e - DIM

Software Design 2e - DIM

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

436A formal approach to designFigure 18.6 A simple algebraic specification (3).nnConstructor operations are used to create and modify entities of the defined sort.These will typically have identifiers such as create, update, add.Inspection operations are used to evaluate the attributes of the entity’s sort.(In the case of our example, we now see why it was necessary to import the sortinteger, since this is needed to provide an upper bound to the size of the table.)While the constructor operations are fairly standard, regardless of the sort of theentity, the inspection operations are obviously very sort-specific. Figure 18.6 shows theexample extended to include the signature. The operations create, insert and removeare obviously constructor operations, while last and eval are inspection operations.The axiomsIt is here that we get into the use of mathematical notation. Basically, this sectionprovides the definition of the inspection operations in terms of the constructor operations.Indeed, the construction of these definitions can be regarded as the maintechnical problem of developing an algebraic specification, and is discussed further inthe next section. Essentially, though, a set of equations is developed that gives mathematicalexpressions defining these relationships. These are shown for our example inFigure 18.7, which now provides a fully expanded definition for the aircraft_table,using this simplified form of algebraic notation.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!