Genericity and re-exportation in CML: complete security and code sharing

1990 
The Generic Abstract Data Types (GADT) is designed to be a way of combining different ADT instances in one generic module (genericity). Another mechanism of code sharing in object-oriented languages is through inheritance. There are two approaches to instantiating ADTs: compile time static instantiation and run time dynamic instantiation. Both approaches have drawbacks. Static instantiation has a problem with the code explosion. Dynamic instantiation has two problems: late run time type checking and the inability to fully utilize the full power of generics. Inheritance in modern programming languages violates GADT encapsulation. The inability to write a class interface which reveals only the required information to its clients is the main drawback in object-oriented languages. My research introduces solutions to the problems of both instantiation types through a new approach of a secure, efficient, and powerful dynamic instantiation. Also, a new approach to inheritance is introduced through a one-level import-reexport (incremental inheritance) as a solution to the inheritance problem for object-oriented languages. The host language of my solutions is the Contour Model Language (CML). First, the genericity feature which is present in many modern programming languages will be reviewed. Next, the inheritance and the class encapsulation mechanism will be discussed. Then a new approach to dynamic genericity implementation and an example of GADT, its usage, and the correctness of its operational semantics will be shown. All the implementation details of the new dynamic genericity will be listed and explained. A complete example of code refinement through import-reexport will be given. The proposed GADT is a completely typed generic function which encapsulates the data structure of a generic type, and a set of generic procedure operations that manipulate this data structure. This GADT mechanism instantiates homogeneous ADTs where all elements of the ADT data structure have the same type. The run time invocation (instantiation) of the generic function guarantees efficient sharing of its code among all its instances. On the other hand, the complete and consistent typing of the generic function with a generic type insures complete and secure compile time type checking. Finally, the instantiation syntax is simply a function call, without any verbose syntax. The new reexportation mechanism (incremental inheritance) is introduced as another dimension of code sharing whereby one GADT can be constructed as a refinement of another GADT and passed to the user through the import-reexport feature. The interfaces of the importer and the exporter are securely defined to prevent any violation of the GADT encapsulation.
    • Correction
    • Source
    • Cite
    • Save
    • Machine Reading By IdeaReader
    0
    References
    0
    Citations
    NaN
    KQI
    []