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.
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
References
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)
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)
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)
Dwork, C., Kanellakis, P., Mitchell, J.: On the sequential nature of unification. J. Logic Programming 1, 35–50 (1984)
Frey, A.: Satisfying subtype inequalities in polynomial space. In: Van Hentenryck, P. (ed.) SAS 1997. LNCS, vol. 1302, pp. 265–277. Springer, Heidelberg (1997)
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)
Kozen, D., Palsberg, J., Schwartzbach, M.I.: Efficient inference of partial types. J. Comput. Syst. Sci. 49, 306–324 (1994)
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)
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)
Palsberg, J.: Efficient inference of object types. Information and Computation 123, 198–209 (1995). Preliminary version in LICS 1994
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 1995
Palsberg, J., Smith, J.: Constrained types and their expressiveness. ACM Trans. Progr. Lang. Sys. 18(5), 519–527 (1996)
Pratt, V., Tiuryn, J.: Satisfiability of inequalities in a poset. Fundamenta Informaticæ 28, 165–182 (1996)
Thatte, S.: Type inference with partial types. In: Lepistö, T., Salomaa, A. (eds.) ICALP 1988. LNCS, vol. 317, pp. 615–629. Springer, Heidelberg (1988)
Tiuryn, J.: Subtype inequalities. In: 7th Annual IEEE Symp. on Logic in Computer Science (LICS 1992), pp. 308–315 (1992)
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)
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)
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)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 1999 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Vorobyov, S. (1999). Subtyping Functional+Nonempty Record Types. In: Gottlob, G., Grandjean, E., Seyr, K. (eds) Computer Science Logic. CSL 1998. Lecture Notes in Computer Science, vol 1584. Springer, Berlin, Heidelberg. https://doi.org/10.1007/10703163_19
Download citation
DOI: https://doi.org/10.1007/10703163_19
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-65922-8
Online ISBN: 978-3-540-48855-2
eBook Packages: Springer Book Archive