Efficient subtyping tests with PQ-encoding

  • Authors:
  • Yoav Zibin;Joseph Yossi Gil

  • Affiliations:
  • Department of Computer Science, Technion-Israel Institute of Technology, Technion City, Haifa 32000, Israel;Department of Computer Science, Technion-Israel Institute of Technology, Technion City, Haifa 32000, Israel

  • Venue:
  • OOPSLA '01 Proceedings of the 16th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications
  • Year:
  • 2001

Quantified Score

Hi-index 0.00

Visualization

Abstract

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.