Abstract
We present a graph-basedmodel 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, instantiation graphs and conjunction graphs that naturally illustrate 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 defines graph-based relations and operations on types including equivalence, subtyping, conjunction and instantiation. Algorithms based on the graph structures are designed for the implementation 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.
Similar content being viewed by others
References
Gosling J, Joy B, Steele G, Bracha G. Java Language Specification: The Java Series. Addison-Wesley Longman Publishing Co., Inc. Boston, MA, USA, 2000
OMG Unified Modeling Language (OMG UML), Superstructure, V2.1.2, 2007. Object Management Group
Hoare C A R, He J. A trace model for pointers and objects. In: Proceedings of the 13th European Conference on Object-Oriented Programming, LNCS 1628. 1999, 1–17
Jifeng H, Li X, Liu Z. rCOS: a refinement calculus of object systems. Theoretical Computer Science, 2006, 365(1): 109–142
Klein G, Nipkow T. A machine-checked model for a Java-like language, virtual machine, and compiler. ACM Transactions on Programming Languages and Systems, 2006, 28(4): 619–695
Ke W, Liu Z, Wang S, Zhao L. A graph-based operational semantics of OO programs. Formal Methods and Software Engineering, 2009, 347–366
Bracha G. Generics in the Java programming language. Sun Microsystemsm, 2004, 1–23
Pierce B. Types and Programming Languages. The MIT Press, 2002
Gauthier N, Pottier F. Numbering matters: first-order canonical forms for second-order recursive types. In: ACM SIGPLAN Notices, 2004, 39(9): 150–161
Ke W, Li X, Liu Z, Stolz V. rCOS: a formal model-driven engineering method for component-based software. Frontiers of Computer Science, 2012, 6(1): 17–39
Zhao L, Liu X, Liu Z, Qiu Z. Graph transformations for object-oriented refinement. Formal Aspects of Computing, 2009, 21(1): 103–131
Ke W, Liu Z, Wang S, Zhao L. Graph-based type system, operational semantics and implementation of an object-oriented programming language. Technical Report 410, UNU-IIST, Macau, China, 2009. www.iist.unu.edu/www/docs/techreports/reports/report410.pdf
Abadi M, Cardelli L. A theory of objects. Springer, 1996
Igarashi A, Pierce B, Wadler P. Featherweight Java: aminimal core calculus for Java and GJ. ACM Transactions on Programming Languages and Systems, 2001, 23(3): 396–450
Wang S, Long Q, Qiu Z. Type safety for FJ and FGJ. Theoretical Aspects of Computing-ICTAC 2006, 2006, 257–271
Rémy D. From classes to objects via subtyping. Programming Languages and Systems, 1998, 200–220
Igarashi A, Viroli M. On variance-based subtyping for parametric types. In: Proceedings of the 16th European Conference on Object-Oriented Programming. 2002, 441–469
Ferreira A, Foss L, Ribeiro L. Formal verification of object-oriented graph grammars specifications. Electronic Notes in Theoretical Computer Science, 2007, 175(4): 101–114
Corradini A, Dotti F, Foss L, Ribeiro L. Translating Java code to graph transformation systems. Graph Transformations, 2004, 171–174
Kastenberg H, Kleppe A, Rensink A. Defining object-oriented execution semantics using graph transformations. Formal Methods for Open Object-Based Distributed Systems, 2006, 186–201
Heckel R, Küster J, Taentzer G. Confluence of typed attributed graph transformation systems. Graph Transformation, 2002, 161–176
Wermelinger M, Fiadeiro J. A graph transformation approach to software architecture reconfiguration. Science of Computer Programming, 2002, 44(2): 133–155
Ehrig H, Ehrig K, Prange U, Taentzer G. Fundamental theory for typed attributed graphs and graph transformation based on adhesive HLR categories. Fundamenta Informaticae, 2006, 74(1): 31–61
Rémy D, Yakobowski B. A graphical presentation of ML F types with a linear-time unification algorithm. In: Proceedings of the 2007 ACM SIGPLAN International Workshop on Types in Languages Design and Implementation. 2007, 27–38
Wright A, Felleisen M. A syntactic approach to type soundness. Information and Computation, 1994, 115(1): 38–94
Flanagan C, Leino K, Lillibridge M, Nelson G, Saxe J, Stata R. Extended static checking for Java. ACM SIGPLAN Notices, 2002, 37(5): 234–245
Author information
Authors and Affiliations
Corresponding author
Additional information
Wei Ke is a researcher and lecturer of Macao Polytechnic Institute, China. He received his PhD from School of Computer Science and Engineering, Beihang University, China. His research interests include programming languages, functional programming, formal methods and tool, support for object-oriented and componentbased engineering and systems. His recent research focuses on programming tools, environments, and program analysis.
Zhiming Liu is a senior research fellow of UNU-IIST and the head of Information Engineering and Technology in Health Programme (IETH). He was formerly a university lecturer at the University of Leicester and a research Fellow at the University of Warwick. He holds a PhD from the University of Warwick. He is internationally known for his work on the transformational approach to fault-tolerance and real-time computing, and the rCOS Method of model-driven design of component software. The research of IETH extends and applies these methods to human and environmental health care. Among a number of international conferences he founded, Zhiming Liu is one of founders of the International Symposium on Foundations of Health Information Engineering and Systems (FHIES).
Shuling Wang is an assistant research professor at Institute of Software, Chinese Academy of Scieneces (ISCAS). She received her PhD in 2008 from School of Mathematical Sciences, Peking University, China. In the following years, she was a postdoctoral research fellow at UNU-IIST and ISCAS. Her current research interests are hybrid systems and object-oriented programs, both related to formal modeling, semantics, and verification.
Liang Zhao is currently a postdoctoral fellow of United Nations University-International Institute for Software Technology (UNU-IIST). His research interests include semantics and type systems of programming languages, graph transformations, and formal methods for object-oriented development.
Rights and permissions
About this article
Cite this article
Ke, W., Liu, Z., Wang, S. et al. A graph-based generic type system for object-oriented programs. Front. Comput. Sci. 7, 109–134 (2013). https://doi.org/10.1007/s11704-012-1307-8
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s11704-012-1307-8