Abstract
We dissent from the view that all of the behavior of abstract data types, including errors, should be specified. Since most errors are based upon implementation considerations, the specifier of a data type must either anticipate all future errors which may arise in some implementation — which is impossible — or must respecify the data type each time a new implementation is written with new errors — which somewhat defeats the purpose of specification. Our solution is to do as much as possible with the idealized version of the data type, in which errors are eschewed.We propose a new definition of “implementation” allowing an abstract data type to be implemented by a partial algebra which has the correct behavior as long as its operators are defined. To deal more readily with partial algebras, we introduce the notion of a partial algebra with pre-conditions (pap), and define the semantics of a pap to be another partial algebra. We then give various results which offer ways of proving properties of the algebra denoted by a pap from the pap. Several examples of partial implementations are given.Data type parameterization is then considered in this context. We extend our new definition of implementation to parameterized types implementing other parameterized types, and then explore parameterized types with pre-conditions.
Talk to us
Join us for a 30 min session where you can share your feedback and ask us any queries you have
Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.