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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
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)
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)
Zaremski, A., Wing, J.: Signature Matching: A Tool for Using Software Libraries. ACM Trans. Softw. Eng. Methodol. 4(2), 146–170 (1995)
Baader, F., Snyder, W.: Unification Theory. In: Handbook of Automated Reasoning, ch. 8, pp. 439–526. Elsevier (2001)
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)
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)
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
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
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)
Rehof, J.: The Complexity of Simple Subtyping Systems. PhD thesis, DIKU, Department of Computer Science (1998)
Tiuryn, J.: Subtype Inequalities. In: Proceedings of LICS 1992, pp. 308–315. IEEE Computer Society (1992)
Frey, A.: Satisfying Subtype Inequalities in Polynomial Space. Theor. Comput. Sci. 277(1-2), 105–117 (2002)
Benanav, D., Kapur, D., Narendran, P.: Complexity of Matching Problems. J. Symb. Comput. 3(1/2), 203–216 (1987)
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)
Kapur, D., Narendran, P.: Complexity of Unification Problems with Associative-Commutative Operators. J. Autom. Reasoning 9(2), 261–288 (1992)
Ronchi Della Rocca, S.: Principal Type Scheme and Unification for Intersection Type Discipline. Theor. Comput. Sci. 59, 181–209 (1988)
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)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2013 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Düdder, B., Martens, M., Rehof, J. (2013). Intersection Type Matching with Subtyping. In: Hasegawa, M. (eds) Typed Lambda Calculi and Applications. TLCA 2013. Lecture Notes in Computer Science, vol 7941. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-38946-7_11
Download citation
DOI: https://doi.org/10.1007/978-3-642-38946-7_11
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-38945-0
Online ISBN: 978-3-642-38946-7
eBook Packages: Computer ScienceComputer Science (R0)