Advertisement

Subtyping Functional+Nonempty Record Types

  • Sergei Vorobyov
Part of the Lecture Notes in Computer Science book series (LNCS, volume 1584)

Abstract

Solving systems of subtype constraints (or subtype inequalities) is in the core of efficient type reconstruction in modern object-oriented languages with subtyping and inheritance, two problems known polynomial time equivalent. It is important to know how different combinations of type constructors influence the complexity of the problem. We show the NP-hardness of the satisfiability problem for subtype inequalities between object types built by using simultaneously both the functional and the nonempty record type constructors, but without any atomic types and atomic subtyping.

The class of constraints we address is intermediate with respect to known classes. For pure functional types with atomic subtyping of a special non-lattice (crown) form solving subtype constraints is PSPACE-complete [Tiuryn 92, Frey97]. On the other hand, if there are no atomic types and subtyping on them, but the largest T type is included, then both pure functional and pure record (separately) subtype constraints are polynomial time solvable, which is mainly due to the lattice type structure. We show that combining the functional and nonempty record constructors yields NP-hardness without any atomic subtyping, and the same is true for just a single type constant with a nonempty record constructor.

Keywords

Functional Type Atomic Type Object Type Partial Type Conjunctive Normal Form 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Aiken, A., Wimmers, E., Lakshman, T.: Soft typing with conditional types. In: 21st ACM Symp. on Principles of Programming Languages (POPL 1994), pp. 163–173 (1994)Google Scholar
  2. Benke, M.: Efficient type reconstruction in presence of inheritance. In: Borzyszkowski, A.M., Sokolowski, S. (eds.) MFCS 1993. LNCS, vol. 711, pp. 272–280. Springer, Heidelberg (1993)Google Scholar
  3. Brandt, M., Henglein, F.: Coinductive axiomatization of recursive type equality and subtyping. In: de Groote, P., Hindley, J.R. (eds.) TLCA 1997. LNCS, vol. 1210, pp. 63–81. Springer, Heidelberg (1997)Google Scholar
  4. Dwork, C., Kanellakis, P., Mitchell, J.: On the sequential nature of unification. J. Logic Programming 1, 35–50 (1984)zbMATHCrossRefMathSciNetGoogle Scholar
  5. Frey, A.: Satisfying subtype inequalities in polynomial space. In: Van Hentenryck, P. (ed.) SAS 1997. LNCS, vol. 1302, pp. 265–277. Springer, Heidelberg (1997)CrossRefGoogle Scholar
  6. Hoang, M., Mitchell, J.C.: Lower bounds on type inference with subtypes. In: 22nd ACM Symp. on Principles of Programming Languages (POPL 1995), pp. 176–185 (1995)Google Scholar
  7. Kozen, D., Palsberg, J., Schwartzbach, M.I.: Efficient inference of partial types. J. Comput. Syst. Sci. 49, 306–324 (1994)zbMATHCrossRefMathSciNetGoogle Scholar
  8. Lincoln, P., Mitchell, J.C.: Algorithmic aspects of type inference with subtypes. In: 19th ACM Symp. on Principles of Programming Languages (POPL 1992), pp. 293–304 (1992)Google Scholar
  9. O’Keefe, P.M., Wand, M.: Type inference for partial types is decidable. In: Krieg-Brückner, B. (ed.) ESOP 1992. LNCS, vol. 582, pp. 408–417. Springer, Heidelberg (1992)Google Scholar
  10. Palsberg, J.: Efficient inference of object types. Information and Computation 123, 198–209 (1995). Preliminary version in LICS 1994zbMATHCrossRefMathSciNetGoogle Scholar
  11. Palsberg, J., O’Keefe, P.: A type system equivalent to flow analysis. ACM Trans. Progr. Lang. Sys. 17, 576–599 (1995). Preliminary version in POPL 1995CrossRefGoogle Scholar
  12. Palsberg, J., Smith, J.: Constrained types and their expressiveness. ACM Trans. Progr. Lang. Sys. 18(5), 519–527 (1996)CrossRefGoogle Scholar
  13. Pratt, V., Tiuryn, J.: Satisfiability of inequalities in a poset. Fundamenta Informaticæ 28, 165–182 (1996)zbMATHMathSciNetGoogle Scholar
  14. Thatte, S.: Type inference with partial types. In: Lepistö, T., Salomaa, A. (eds.) ICALP 1988. LNCS, vol. 317, pp. 615–629. Springer, Heidelberg (1988)Google Scholar
  15. Tiuryn, J.: Subtype inequalities. In: 7th Annual IEEE Symp. on Logic in Computer Science (LICS 1992), pp. 308–315 (1992)Google Scholar
  16. Tiuryn, J.: Subtyping over a lattice (abstract). In: Gottlob, G., Leitsch, A., Mundici, D. (eds.) KGC 1997. LNCS, vol. 1289, pp. 84–88. Springer, Heidelberg (1997)Google Scholar
  17. Trifonov, V., Smith, S.: Subtyping constrained types. In: Cousot, R., Schmidt, D.A. (eds.) SAS 1996. LNCS, vol. 1145, pp. 349–365. Springer, Heidelberg (1996)Google Scholar
  18. Wand, M., O’Keefe, P.: On the complexity of type inference with coercion. In: Functional Programming Languages and Computer Architecture 1989, pp. 293–298 (1989)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1999

Authors and Affiliations

  • Sergei Vorobyov
    • 1
  1. 1.Max-Planck Institut für InformatikSaarbrückenGermany

Personalised recommendations