Advertisement

Type inference for partial types is decidable

  • Patrick M. O'Keefe
  • Mitchell Wand
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 582)

Abstract

The type inference problem for partial types, introduced by Thatte [15], is the problem of deducing types under a subtype relation with a largest element Ω and closed under the usual antimonotonic rule for function types. We show that this problem is decidable by reducing it to a satisfiability problem for type expressions over this partial order and giving an algorithm for the satisfiability problem. The satisfiability problem is harder than the one conventionally given because comparable types may have radically different shapes.

References

  1. [1]
    Amadio, R.M., and Cardelli, L. “Subtyping Recursive Types,” Conf. Rec. 1991 ACM Symp. on Principles of Programming Languages, 104–118.Google Scholar
  2. [2]
    Clément, D., Despeyroux, J., Despeyroux, T., and Kahn, G. “A Simple Applicative Language: Mini-ML” Proc. 1986 ACM Symp. on Lisp and Functional Programming, 13–27.Google Scholar
  3. [3]
    Cardelli, L. “Basic Polymorphic Typechecking,” Polymorphism Newsletter 2, 1 (Jan, 1985). Also appeared as Computing Science Tech. Rep. 119, AT&T Bell Laboratories, Murray Hill, NJ.Google Scholar
  4. [4]
    Fuh, Y.-C., and Mishra, P. “Type Inference with Subtypes,” Proc. European Symposium on Programming (1988), 94–114.Google Scholar
  5. [5]
    Gomard, C.K. “Partial Type Inference for Untyped Functional Programs,” Proc. 1990 ACM Conf. on Lisp and Functional Programming, 282–287.Google Scholar
  6. [6]
    Henglein, F. “Efficient Type Inference for Higher-Order Binding-Time Analysis,” Functional Programming Languages and Computer Architecture, 5th ACM Conference (J. Hughes, ed.), Springer Lecture Notes in Computer Science, Vol. 523, 1991, pp. 448–472.Google Scholar
  7. [7]
    Henglein, F. personal communication, 1991.Google Scholar
  8. [8]
    Hindley, R. “The Principal Type-Scheme of an Object in Combinatory Logic,” Trans. Am. Math. Soc. 146 (1969) 29–60.Google Scholar
  9. [9]
    Hindley, R. “The Completeness Theorem for Typing λ-Terms” Theoret. Comp. Sci. 22 (1983) 1–17. See also Hindley, R. “Curry's Type-rules are Complete with Respect to the F-Semantics Too” Theoret. Comp. Sci. 22 (1983) 127–133.Google Scholar
  10. [10]
    LeRoy X., and Mauny, M. “Dynamics in ML,” Functional Programming Languages and Computer Architecture, 5th ACM Conference (J. Hughes, ed.), Springer Lecture Notes in Computer Science, Vol. 523, 1991, pp. 406–426.Google Scholar
  11. [11]
    Milner, R. “A Theory of Type Polymorphism in Programming,” J. Comp. & Sys. Sci. 17 (1978), 348–375.Google Scholar
  12. [12]
    Mitchell, J.C. “Coercion and Type Inference (summary),” Conf. Rec. 11th Ann. ACM Symp. on Principles of Programming Languages (1984), 175–185.Google Scholar
  13. [13]
    Mitchell, J.C. “Type Inference with Simple Subtypes,” J. of Functional Programming 1 (1991), 245–285.Google Scholar
  14. [14]
    Rémy, D. “Typechecking records and variants in a natural extension of ML,” Conf. Rec. 16th Ann. ACM Symp. on Principles of Programming Languages (1989), 77–88.Google Scholar
  15. [15]
    Thatte, S. “Type Inference with Partial Types,” Proc. ICALP '88 (1988), 615–629.Google Scholar
  16. [16]
    Wand, M., and O'Keefe, P. “On the Complexity of Type Inference with Coercion,” Conf. on Functional Programming Languages and Computer Architecture (London, September, 1989).Google Scholar
  17. [17]
    Wand, M. “A Semantic Prototyping System,” Proc. ACM SIGPLAN '84 Compiler Construction Conference (1984) 213–221.Google Scholar
  18. [18]
    Wand, M. “A Simple Algorithm and Proof for Type Inference” Fundamenta Informaticae 10 (1987), 115–122.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1992

Authors and Affiliations

  • Patrick M. O'Keefe
    • 1
  • Mitchell Wand
    • 2
  1. 1.ICAD, Inc.Cambridge
  2. 2.College of Computer ScienceNortheastern UniversityBostonUSA

Personalised recommendations