Skip to main content

Proof-relevant Horn Clauses for Dependent Type Inference and Term Synthesis


First-order resolution has been used for type inference for many years, including in Hindley-Milner type inference, type-classes, and constrained data types. Dependent types are a new trend in functional languages. In this paper, we show that proof-relevant first-order resolution can play an important role in automating type inference and term synthesis for dependently typed languages. We propose a calculus that translates type inference and term synthesis problems in a dependently typed language to a logic program and a goal in the proof-relevant first-order Horn clause logic. The computed answer substitution and proof term then provide a solution to the given type inference and term synthesis problem. We prove the decidability and soundness of our method.

Hide All
Ahn, K. Y. and Vezzosi, A. 2016. Executable relational specifications of polymorphic type systems using prolog. See Kiselyov and King (2016), 109125.
Bottu, G., Karachalias, G., Schrijvers, T., d. S. Oliveira, B. C., and Wadler, P. 2017. Quantified class constraints. See Diatchki (2017), 148–161.
Brady, E. 2013. Idris, a general-purpose dependently typed programming language: Design and implementation. J. Funct. Program. 23, 5, 552593.
Diatchki, I. S., Ed. 2017. Proceedings of the 10th ACM SIGPLAN International Symposium on Haskell, Oxford, United Kingdom, September 7-8, 2017. ACM.
Farka, F., Komendantskaya, E., and Hammond, K. 2016. Coinductive soundness of corecursive type class resolution. In Logic-Based Program Synthesis and Transformation - 26th International Symposium, LOPSTR 2016, Edinburgh, UK, September 6-8, 2016, Revised Selected Papers, Hermenegildo, M. V. and López-García, P., Eds. Lecture Notes in Computer Science, vol. 10184. Springer, 311327.
Fu, P. and Komendantskaya, E. 2017. Operational semantics of resolution and productivity in horn clause logic. Formal Asp. Comput. 29, 3, 453474.
Fu, P., Komendantskaya, E., Schrijvers, T., and Pond, A. 2016. Proof relevant corecursive resolution. See Kiselyov and King (2016), 126–143.
Gonthier, G. and Mahboubi, A. 2010. An introduction to small scale reflection in Coq. J. Formalized Reasoning 3, 2, 95152.
Harper, R. and Pfenning, F. 2005. On equivalence and canonical forms in the LF type theory. ACM Trans. Comput. Log. 6, 1, 61101.
Hemann, J., Friedman, D. P., Byrd, W. E., and Might, M. 2016. A small embedding of logic programming with a simple complete search. In Proceedings of the 12th Symposium on Dynamic Languages, DLS 2016, Amsterdam, The Netherlands, November 1, 2016, Ierusalimschy, R., Ed. ACM, 96107.
Karachalias, G. and Schrijvers, T. 2017. Elaboration on functional dependencies: functional dependencies are dead, long live functional dependencies! See Diatchki (2017), 133–147.
Kiselyov, O. and King, A., Eds. 2016. Functional and Logic Programming - 13th International Symposium, FLOPS 2016, Kochi, Japan, March 4-6, 2016, Proceedings. Lecture Notes in Computer Science, vol. 9613. Springer.
Miller, D. and Nadathur, G. 2012. Programming with Higher-Order Logic. Cambridge University Press.
Milner, R. 1978. A theory of type polymorphism in programming. Journal of Computer and System Sciences 17, 348375.
Odersky, M., Sulzmann, M., and Wehr, M. 1999. Type inference with constrained types. TAPOS 5, 1, 3555.
Peyton Jones, S., Jones, M., and Meijer, E. 1997. Type classes: an exploration of the design space. In Haskell workshop.
Pientka, B. 2013. An insider's look at LF type reconstruction: everything you (n)ever wanted to know. J. Funct. Program. 23, 1, 137.
Pientka, B. and Dunfield, J. 2010. Beluga: A framework for programming and reasoning with deductive systems (system description). In Automated Reasoning, 5th International Joint Conference, IJCAR 2010, Edinburgh, UK, July 16-19, 2010. Proceedings, Giesl, J. and Hähnle, R., Eds. Lecture Notes in Computer Science, vol. 6173. Springer, 1521.
Slama, F. and Brady, E. 2017. Automatically proving equivalence by type-safe reflection. In Intelligent Computer Mathematics - 10th International Conference, CICM 2017, Edinburgh, UK, July 17-21, 2017, Proceedings, Geuvers, H., England, M., Hasan, O., Rabe, F., and Teschke, O., Eds. Lecture Notes in Computer Science, vol. 10383. Springer, 4055.
Stuckey, P. J. and Sulzmann, M. 2002. A theory of overloading. In Proceedings of the Seventh ACM SIGPLAN International Conference on Functional Programming (ICFP '02), Pittsburgh, Pennsylvania, USA, October 4-6, 2002., Wand, M. and Jones, S. L. P., Eds. ACM, 167178.
Sulzmann, M. and Stuckey, P. J. 2008. HM(X) type inference is CLP(X) solving. J. Funct. Program. 18, 2, 251283.
Vazou, N., Tondwalkar, A., Choudhury, V., Scott, R. G., Newton, R. R., Wadler, P., and Jhala, R. 2018. Refinement reflection: complete verification with SMT. PACMPL 2, POPL, 53:1–53:31.
Weirich, S., Voizard, A., de Amorim, P. H. A., and Eisenberg, R. A. 2017. A specification for dependent types in haskell. PACMPL 1, ICFP, 31:1–31:29.
Recommend this journal

Email your librarian or administrator to recommend adding this journal to your organisation's collection.

Theory and Practice of Logic Programming
  • ISSN: 1471-0684
  • EISSN: 1475-3081
  • URL: /core/journals/theory-and-practice-of-logic-programming
Please enter your name
Please enter a valid email address
Who would you like to send this to? *



Full text views

Total number of HTML views: 0
Total number of PDF views: 0 *
Loading metrics...

Abstract views

Total abstract views: 0 *
Loading metrics...

* Views captured on Cambridge Core between <date>. This data will be updated every 24 hours.

Usage data cannot currently be displayed