Advertisement

Intersection Type Matching with Subtyping

  • Boris Düdder
  • Moritz Martens
  • Jakob Rehof
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 7941)

Abstract

Type matching problems occur in a number of contexts, including library search, component composition, and inhabitation. We consider the intersection type matching problem under the standard notion of subtyping for intersection types: Given intersection types τ and σ, where σ is a constant type, does there exist a type substitution S such that S(τ) is a subtype of σ? We show that the matching problem is NP-complete. NP-hardness holds already for the restriction to atomic substitutions. The main contribution is an NP-algorithm which is engineered for efficiency by minimizing nondeterminism and running in Ptime on deterministic input problems. Our algorithm is based on a nondeterministic polynomial time normalization procedure for subtype constraint systems with intersection types. We have applied intersection type matching in optimizations of an inhabitation algorithm.

Keywords

Type Variable Intersection Type Match Problem Organize Type Combinatory Logic 
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. 1.
    Barendregt, H., Coppo, M., Dezani-Ciancaglini, M.: A Filter Lambda Model and the Completeness of Type Assignment. Journal of Symbolic Logic 48(4), 931–940 (1983)MathSciNetMATHCrossRefGoogle Scholar
  2. 2.
    Jha, S., Palsberg, J., Zhao, T.: Efficient Type Matching. In: Nielsen, M., Engberg, U. (eds.) FOSSACS 2002. LNCS, vol. 2303, pp. 187–204. Springer, Heidelberg (2002)CrossRefGoogle Scholar
  3. 3.
    Zaremski, A., Wing, J.: Signature Matching: A Tool for Using Software Libraries. ACM Trans. Softw. Eng. Methodol. 4(2), 146–170 (1995)CrossRefGoogle Scholar
  4. 4.
    Baader, F., Snyder, W.: Unification Theory. In: Handbook of Automated Reasoning, ch. 8, pp. 439–526. Elsevier (2001)Google Scholar
  5. 5.
    Rehof, J., Urzyczyn, P.: Finite Combinatory Logic with Intersection Types. In: Ong, L. (ed.) TLCA 2011. LNCS, vol. 6690, pp. 169–183. Springer, Heidelberg (2011)CrossRefGoogle Scholar
  6. 6.
    Düdder, B., Martens, M., Rehof, J., Urzyczyn, P.: Bounded Combinatory Logic. In: Proceedings of CSL 2012. LIPIcs, vol. 16, pp. 243–258. Schloss Dagstuhl (2012)Google Scholar
  7. 7.
    Rehof, J.: Towards Combinatory Logic Synthesis. In: 1st International Workshop on Behavioural Types, BEAT 2013, January 22 (2013), http://beat13.cs.aau.dk/pdf/BEAT13-proceedings.pdf
  8. 8.
    Düdder, B., Martens, M., Rehof, J.: Intersection Type Matching and Bounded Combinatory Logic (Extended Version). Technical Report 841, Faculty of Computer Science, TU Dortmund (2012), http://ls14-www.cs.tu-dortmund.de/index.php/Jakob_Rehof_Publications#Technical_Reports
  9. 9.
    Hindley, J.R.: The Simple Semantics for Coppo-Dezani-Sallé Types. In: Dezani-Ciancaglini, M., Montanari, U. (eds.) Programming 1982. LNCS, vol. 137, pp. 212–226. Springer, Heidelberg (1982)CrossRefGoogle Scholar
  10. 10.
    Rehof, J.: The Complexity of Simple Subtyping Systems. PhD thesis, DIKU, Department of Computer Science (1998)Google Scholar
  11. 11.
    Tiuryn, J.: Subtype Inequalities. In: Proceedings of LICS 1992, pp. 308–315. IEEE Computer Society (1992)Google Scholar
  12. 12.
    Frey, A.: Satisfying Subtype Inequalities in Polynomial Space. Theor. Comput. Sci. 277(1-2), 105–117 (2002)MathSciNetMATHCrossRefGoogle Scholar
  13. 13.
    Benanav, D., Kapur, D., Narendran, P.: Complexity of Matching Problems. J. Symb. Comput. 3(1/2), 203–216 (1987)MathSciNetMATHCrossRefGoogle Scholar
  14. 14.
    Kapur, D., Narendran, P.: NP-Completeness of the Set Unification and Matching Problems. In: Siekmann, J.H. (ed.) CADE 1986. LNCS, vol. 230, pp. 489–495. Springer, Heidelberg (1986)CrossRefGoogle Scholar
  15. 15.
    Kapur, D., Narendran, P.: Complexity of Unification Problems with Associative-Commutative Operators. J. Autom. Reasoning 9(2), 261–288 (1992)MathSciNetMATHCrossRefGoogle Scholar
  16. 16.
    Ronchi Della Rocca, S.: Principal Type Scheme and Unification for Intersection Type Discipline. Theor. Comput. Sci. 59, 181–209 (1988)MathSciNetMATHCrossRefGoogle Scholar
  17. 17.
    Kfoury, A.J., Wells, J.B.: Principality and Type Inference for Intersection Types Using Expansion Variables. Theor. Comput. Sci. 311(1-3), 1–70 (2004)MathSciNetMATHCrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2013

Authors and Affiliations

  • Boris Düdder
    • 1
  • Moritz Martens
    • 1
  • Jakob Rehof
    • 1
  1. 1.Faculty of Computer ScienceTechnical University of DortmundGermany

Personalised recommendations