Efficient subtyping tests with PQ-encoding

Subtyping test, i.e., determining whether one type is a subtype of another, are a frequent operation during the execution of object-oriented programs. The challenge is in encoding the hierarchy in a small space, while simulataneously making sure that subtyping tests have efficient implmentation. We present a new scheme for encoding multiple and single inheritance hierarchies, which, in the standardized hierarchies, reduces the footprint of all previsously published schemes. The scheme is called PQ-encoding after PQ-trees, a data structure previously used in graph theory for finding the orderings that satisfy a collection of constraints. In particular, we show that in the traditional object layout model, the extra memory requirement for single inheritance hierarchies is zero. In the PQ-encoding subtyping tests are constant time, and use only two comparisons. Other than PQ-trees, PQ-encoding uses several novel optimization techniques. These techniques are applicable also in improving the performance of otehr, previously published, encoding schemes.

[1]  Roberto Tamassia,et al.  On-Line Graph Algorithms with SPQR-Trees , 1990, ICALP.

[2]  Luca Cardelli,et al.  The Modula–3 type system , 1989, POPL '89.

[3]  Alexander Borgida,et al.  Efficient management of transitive relationships in large data and knowledge bases , 1989, SIGMOD '89.

[4]  Yoav Hollander,et al.  The e language: a fresh separation of concerns , 2001, Proceedings Technology of Object-Oriented Languages and Systems. TOOLS 38.

[5]  R. Nigel Horspool,et al.  Near Optimal Hierarchical Encoding of Types , 1997, ECOOP.

[6]  Niklaus Wirth Reply to “Type-extension tests can be performed in constant time” , 1991, TOPL.

[7]  Christian Capelle Representation of an Order as Union of Interval Orders , 1994, ORDAL.

[8]  E. Dijkstra,et al.  Recursive Programming , 1960 .

[9]  Michael Jünger,et al.  A note on computing a maximal planar subgraph using PQ-trees , 1998, IEEE Trans. Comput. Aided Des. Integr. Circuits Syst..

[10]  Andrew Fall Sparse Term Encoding for Dynamic Taxonomies , 1996, ICCS.

[11]  Craig Chambers,et al.  The cecil language: specification and rationale , 1993 .

[12]  Norman H. Cohen Type-extension type test can be performed in constant time , 1991, TOPL.

[13]  Patrick Lincoln,et al.  Efficient implementation of lattice operations , 1989, TOPL.

[14]  Eric Thierry,et al.  A Quasi Optimal Bit-Vector Encoding of Tree Hierarchies. Application to Efficient Type Inclusion Tests , 2001, ECOOP.

[15]  János Komlós,et al.  Storing a sparse table with O(1) worst case access time , 1982, 23rd Annual Symposium on Foundations of Computer Science (sfcs 1982).

[16]  Bjarne Stroustrup,et al.  C++ Programming Language , 1986, IEEE Softw..

[17]  Bowen Alpern,et al.  Dynamic Type Checking in Jalapeño , 2001, Java Virtual Machine Research and Technology Symposium.

[18]  Lhouari Nourine,et al.  Encoding of Multiple Inheritance Hierarchies and Partial Orders , 1999, Comput. Intell..

[19]  Adele Goldberg,et al.  Smalltalk-80 - the interactive programming environment , 1984 .

[20]  Yves Caseau Efficient handling of multiple inheritance hierarchies , 1993, OOPSLA '93.

[21]  Lhouari Nourine,et al.  Bit-Vector Encoding for Partially Ordered Sets , 1994, ORDAL.

[22]  Martin F. van Bommel,et al.  Incremental encoding of multiple inheritance hierarchies , 1999, CIKM '99.

[23]  Ken Arnold,et al.  The Java Programming Language , 1996 .

[24]  Roberto Tamassia,et al.  On-Line Planarity Testing , 1989, SIAM J. Comput..

[25]  Joseph Gil,et al.  Space and time-efficient memory layout for multiple inheritance , 1999, OOPSLA '99.

[26]  Andreas Krall,et al.  CACAO - A 64-bit JavaVM Just-in-Time Compiler , 1997, Concurr. Pract. Exp..

[27]  Joseph Gil,et al.  Empirical Study of Object-Layout Strategies and Optimization Techniques , 2000, ECOOP.

[28]  Simon Fraser UniversityBurnaby Heterogeneous Encoding , 1995 .

[29]  Kellogg S. Booth,et al.  Testing for the Consecutive Ones Property, Interval Graphs, and Graph Planarity Using PQ-Tree Algorithms , 1976, J. Comput. Syst. Sci..

[30]  Ken Arnold,et al.  The Java programming language (2nd ed.) , 1998 .

[31]  Robert E. Filman Polychotomic Encoding: A Better Quasi-Optimal Bit-Vector Encoding of Tree Hierarchies , 2002, ECOOP.

[32]  R. Nigel Horspool,et al.  Efficient type inclusion tests , 1997, OOPSLA '97.

[33]  Brad J. Cox,et al.  Object-oriented programming ; an evolutionary approach , 1986 .

[34]  Dan E. Willard New Trie Data Structures Which Support Very Fast Search Operations , 1984, J. Comput. Syst. Sci..

[35]  James Gosling,et al.  The Java Programming Language" The Java Series , 1996 .

[36]  Peter van Emde Boas,et al.  Preserving Order in a Forest in Less Than Logarithmic Time and Linear Space , 1977, Inf. Process. Lett..

[37]  Lenhart K. Schubert,et al.  Determining Type, Part, Color, and Time Relationships , 1983, Computer.

[38]  Bjarne Stroustrup,et al.  The C++ programming language (2nd ed.) , 1991 .