Hostname: page-component-8448b6f56d-xtgtn Total loading time: 0 Render date: 2024-04-23T13:40:49.342Z Has data issue: false hasContentIssue false

Constraint handling rules with binders, patterns and generic quantification*

Published online by Cambridge University Press:  22 August 2017

ALEJANDRO SERRANO
Affiliation:
Department of Information and Computing Sciences, Utrecht University, Utrecht, The Netherlands (e-mails: A.SerranoMena@uu.nl, J.Hage@uu.nl)
JURRIAAN HAGE
Affiliation:
Department of Information and Computing Sciences, Utrecht University, Utrecht, The Netherlands (e-mails: A.SerranoMena@uu.nl, J.Hage@uu.nl)

Abstract

Constraint handling rules provide descriptions for constraint solvers. However, they fall short when those constraints specify some binding structure, like higher-rank types in a constraint-based type inference algorithm. In this paper, the term syntax of constraints is replaced by λ-tree syntax, in which binding is explicit, and a new ∇ generic quantifier is introduced, which is used to create new fresh constants.

Type
Regular Papers
Copyright
Copyright © Cambridge University Press 2017 

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

Footnotes

*

This work was supported by the Netherlands Organisation for Scientific Research (NWO) project on “DOMain Specific Type Error Diagnosis (DOMSTED)” (612.001.213).

References

Abdennadher, S. 1997. Operational semantics and confluence of constraint propagation rules. In Proc. of CP97, Linz, Austria, October 29–November 1, Smolka, G., Ed.CrossRefGoogle Scholar
Abdennadher, S. and Schütz, H. 1998. CHR∨: A flexible query language. In Proc. of International Conference on Flexible Query Answering Systems, FQAS '98, 1–14.Google Scholar
Baelde, D., Chaudhuri, K., Gacek, A., Miller, D., Nadathur, G., Tiu, A. and Wang, Y. 2014. Abella: A system for reasoning about relational specifications. Journal of Formalized Reasoning 7 (2), 189.Google Scholar
Charguéraud, A. 2012. The locally nameless representation. Journal of Automated Reasoning 49, 3, 363408.CrossRefGoogle Scholar
Cheney, J. and Urban, C. 2008. Nominal logic programming. ACM Transactions on Programming Languages and Systems 30 (5), 26:126:47.CrossRefGoogle Scholar
Csorba, J., Zombori, Z. and Szeredi, P. 2012. Pros and Cons of Using CHR for Type Inference. Unpublished, available in the first author's web page.Google Scholar
de~Bruijn, N. 1972. Lambda calculus notation with nameless dummies, a tool for automatic formula manipulation, with application to the Church-Rosser theorem. Indagationes Mathematicae (Proceedings) 75, 5, 381392.CrossRefGoogle Scholar
Dijkstra, A., van~den~Geest, G., Heeren, B. and Swierstra, S. D. 2007. Modelling Scoped Instances with Constraint Handling Rules. Technical Report, Department of Information and Computing Sciences, Utrecht University.Google Scholar
Duck, G. J., Stuckey, P. J., de~la~Banda, M. G. and Holzbaur, C. 2004. The refined operational semantics of constraint handling rules. In Proc. of ICLP 2004, Saint-Malo, France, September 6–10, 90–104.Google Scholar
Duck, G. J., Stuckey, P. J. and Sulzmann, M. 2007. Observable confluence for constraint handling rules. In Proc. of ICLP 2007, Porto, Portugal, September 8–13, 2007, Dahl, V. and Niemelä, I., Eds., 224–239.Google Scholar
Dunfield, J. and Krishnaswami, N. R. 2013. Complete and easy bidirectional typechecking for higher-rank polymorphism. In Proc. of International Conference on Functional Programming, ICFP'13, Morrisett, G. and Uustalu, T., Eds. ACM, 429–442.Google Scholar
Eisenberg, R. A., Weirich, S. and Ahmed, H. G. 2016. Visible type application. In Programming Languages and Systems 25th European Symposiun on Programming – ESOP 2016, Lecture Notes in Computer Science 9632. Springer, 229–254.Google Scholar
Frühwirth, T. 1998. Theory and practice of constraint handling rules. Journal of Logic Programming 37, 13, 95138.CrossRefGoogle Scholar
Frühwirth, T. 2000. Proving Termination of Constraint Solver Programs. Springer, Berlin, Heidelberg, 298317.Google Scholar
Frühwirth, T. 2009. Constraint Handling Rules, 1st ed. Cambridge University Press.CrossRefGoogle Scholar
Hage, J. and Heeren, B. 2009. Strategies for solving constraints in type and effect systems. Electronic Notes in Theoretical Computer Science 236, 163183.CrossRefGoogle Scholar
Huet, G. 1975. A unification algorithm for typed λ-calculus. Theoretical Computer Science 1, 1, 2757.CrossRefGoogle Scholar
Koninck, L., Schrijvers, T. and Demoen, B. 2007. User-definable rule priorities for CHR. In Proc. of International ACM SIGPLAN Conference on Principles and Practice of Declarative Programming, PPDP '07. ACM, 25–36.Google Scholar
Miller, D. 1990. An Extension to ML to Handle Bound Variables in Data Structures. Technical Report, Department of Computer and Information Science, University of Pennsylvania.Google Scholar
Miller, D. 1991. A logic programming language with lambda-abstraction, function variables, and simple unification. Journal of Logic and Computation 1, 253281.CrossRefGoogle Scholar
Miller, D. 2000. In Abstract Syntax for Variable Binders: An Overview , Proceeding of Computational Logic 2000, Lecture Notes in Computer Science 1861. Springer, 239253.CrossRefGoogle Scholar
Miller, D. and Nadathur, G. 2012. Programming with Higher-Order Logic, 1st ed. Cambridge University Press, New York.CrossRefGoogle Scholar
Miller, D. and Tiu, A. 2005. A proof theory for generic judgments. ACM Transactions on Computational Logic 6 (4), 749783.CrossRefGoogle Scholar
Peyton~Jones, S., Vytiniotis, D., Weirich, S. and Shields, M. 2007. Practical type inference for arbitrary-rank types. Journal of Functional Programming 17, 1, 182.Google Scholar
Pfenning, F. and Elliott, C. 1988. Higher-order abstract syntax. In Proc. of the ACM SIGPLAN'88 Conference on Programming Language Design and Implementation, PLDI '88. ACM, New York, 199–208.Google Scholar
Pilozzi, P. and De~Schreye, D. 2008. Termination analysis of CHR revisited. In Proc. of ICLP 2008, Udine, Italy, December 9–13, Garcia~de~la~Banda, M. and Pontelli, E., Eds. 501–515.Google Scholar
Pottier, F. and Rémy, D. 2005. The essence of ML type inference. In Advanced Topics in Types and Programming Languages, Pierce, B. C., Ed. MIT, Chapter 10, 389489.Google Scholar
Qian, Z. 1993. Linear Unification of Higher-Order Patterns, 391–405.CrossRefGoogle Scholar
Serrano, A. and Hage, J. 2016. Type error diagnosis for embedded DSLs by two-stage specialized type rules. In Programming Languages and Systems 25th European Symposium on Programming – ESOP 2016, Lecture Notes in Computer Science 9632. Springer, 672–698.Google Scholar
Shinwell, M. R., Pitts, A. M. and Gabbay, M. J. 2003. FreshML: Programming with binders made simple. In Proc. of ACM SIGPLAN International Conference on Functional Programming, ICFP '03. ACM, 263–274.Google Scholar
Sneyers, J., Schrijvers, T. and Demoen, B. 2009. The computational power and complexity of constraint handling rules. ACM Transactions on Programming Languages and Systems 31 (2), 8:18:42.CrossRefGoogle Scholar
Sneyers, J., Weert, P. V., Schrijvers, T. and Koninck, L. 2010. As time goes by: Constraint Handling Rules. Theory and Practice of Logic Programming 10, 1, 147.CrossRefGoogle Scholar
Stuckey, P. J., Sulzmann, M. and Wazny, J. 2006. Type processing by constraint reasoning. In Programming Languages and Systems, Kobayashi, N., Ed. Lecture Notes in Computer Science, Vol. 4279. Springer, 125.Google Scholar
Sulzmann, M., Duck, G. J., Peyton~Jones, S. and Stuckey, P. J. 2007. Understanding functional dependencies via constraint handling rules. Journal of Functional Programming 17, 1, 83129.CrossRefGoogle Scholar
Sulzmann, M., Wazny, J. and Stuckey, P. J. 2006. A framework for extended algebraic data types. In Proc. of International Symposium on Functional and Logic Programming, FLOPS '06, 47–64.Google Scholar
Swift Team. 2016. Type checker design and implementation. Available at https://github.com/apple/swift/blob/master/docs/TypeChecker.rst Google Scholar
Tiu, A. 2006. A logic for reasoning about generic judgments. In Proc. of 1st International Workshop on Logical Frameworks and Meta-Languages, LFMTP '06. Electronic Notes in Theoretical Computer Science 174 (5), 318.CrossRefGoogle Scholar
Voets, D., Pilozzi, P. and De~Schreye, D. 2008. A new approach to termination analysis of constraint handling rules. In Pre-proceedings of LOPSTR 2008, pp. 28–42.Google Scholar
Vytiniotis, D., Peyton~Jones, S., Schrijvers, T. and Sulzmann, M. 2011. OutsideIn(X): Modular type inference with local assumptions. Journal of Functional Programming 21 (4–5), 333412.CrossRefGoogle Scholar
Wazny, J. 2006. Type Inference and Type Error Diagnosis for Hindley/Milner with Extensions. PhD Thesis, University of Melbourne, Australia.Google Scholar