The purpose of this talk is to propose an iterator and container specification mechanism which makes the specification independent of a particular Programming Language and makes the specification formal. The following options have been considered:
Advantages: sound mathematical foundation, languages and tools exist.
Disadvantages: state must be modeled, very complex specifications as a result, differences between containers disappear.
Advantages: imperative style of specification, built-in notion of state.
Disadvantages: too low level of specification, container operations cannot be formally specified.
An iterator is represented as an object of the corresponding iterator type with an address as the object's identifier. Iterator types are combined in iterator categories each having a definite set of iterator operation. A container is represented as an object of the corresponding container type possessing a number of attributes, observers, and mutators. Observers are specified in terms of attribute values. Mutators are specified in terms of transition rules updating attribute values.