(Last modified Thu Jun 05 23:20 2008)
What is a specification?
A program meets its specification (or fails to).
So that for any possible program behavior or characteristic, the specification can be used to classify it as acceptable or not acceptable (or required, forbidden, or neither).
A program can be tested to see whether it (fails to) meet its specification; or the program's design can be verified as supporting the specification (or not).
What can we do with specifications?
Writing the specification forces us to think about the issues involved. Once the specification is produced, we can ask questions about it and think about the answers.
Different kinds of specification are good for making different kinds of statement.
A quick trot through some kinds of specifications:
Goal graph
Much more useful. Variables stand for entities in the domain (there are still variable-like sentence letters standing for sentences that can be true or false). ∀x ∃y TallerThan(x,y).
,
always
,
...).
Much more difficult to use.
∀x ∃y TallerThan(x,y).
a[b-f]*g+
| A | ::= | Ba |
| B | ::= | Bb |
| | | b |
| Automata | Grammars | Languages | ||
|---|---|---|---|---|
| Finite-state machines | ≡ | Regular grammars | ~ | Regular languages |
| Pushdown automata | ≡ | Context-free grammars | ~ | Context-free languages |
| Linear bounded automata | ≡ | Context-sensitive grammars | ~ | Context-sensitive languages |
| Turing machines | ≡ | Unrestricted grammars | ~ | Recursive languages |
The regular languages ⊂ the context-free languages ⊂ the context-sensitive languages ⊂ the recursive languages ⊂ all possible languages.
Statechart
| Specification type | Invariant/temporal | Integral/disjoint |
|---|---|---|
| Assertions | May be either | Disjoint |
| Propositional logic | Invariant | Disjoint |
| First-order logic | Invariant | Disjoint |
| Temporal logic | Temporal | Disjoint |
| Goal graphs | Invariant | Integral |
| Enumerations | Invariant | Integral |
| State models | Temporal | Integral |
| Interaction models | Temporal | Disjoint |
Things a kind of formal specification has (or should have) (or could have):