摘要
We present a graph-based model of a generic type system for an OO language. The type system supports the features of recursive types, generics and interfaces, which are commonly found in modern OO languages such as Java. In the classical graph theory, we define type graphs, instantia- tion graphs and conjunction graphs that naturally iIlustrate the relations among types, generics and interfaces within complex OO programs. The model employs a combination of nominal and anonymous nodes to represent respectively types that are identified by names and structures, and de- fines graph-based relations and operations on types including equivalence, subtyping, conjunction and instantiation. Algo- rithms based on the graph structures are designed for the im- plementation of the type system. We believe that this type system is important for the development of a graph-based logical foundation of a formal method for verification of and reasoning about OO programs.
We present a graph-based model of a generic type system for an OO language. The type system supports the features of recursive types, generics and interfaces, which are commonly found in modern OO languages such as Java. In the classical graph theory, we define type graphs, instantia- tion graphs and conjunction graphs that naturally iIlustrate the relations among types, generics and interfaces within complex OO programs. The model employs a combination of nominal and anonymous nodes to represent respectively types that are identified by names and structures, and de- fines graph-based relations and operations on types including equivalence, subtyping, conjunction and instantiation. Algo- rithms based on the graph structures are designed for the im- plementation of the type system. We believe that this type system is important for the development of a graph-based logical foundation of a formal method for verification of and reasoning about OO programs.