Hostname: page-component-848d4c4894-r5zm4 Total loading time: 0 Render date: 2024-06-26T00:00:46.075Z Has data issue: false hasContentIssue false

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

Published online by Cambridge University Press:  10 August 2018

FRANTIŠEK FARKA
Affiliation:
University of St Andrews, and Heriot-Watt University (e-mail: ff12@st-andrews.ac.uk)
EKATERINA KOMENDANTSKYA
Affiliation:
Heriot-Watt University (e-mail: ek19@hw.ac.uk)
KEVIN HAMMOND
Affiliation:
University of St Andrews (e-mail: kevin@kevinhammond.net)
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the ‘Save PDF’ action button.

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.

Type
Original Article
Copyright
Copyright © Cambridge University Press 2018 

References

Ahn, K. Y. and Vezzosi, A. 2016. Executable relational specifications of polymorphic type systems using prolog. See Kiselyov and King (2016), 109125.Google Scholar
Bottu, G., Karachalias, G., Schrijvers, T., d. S. Oliveira, B. C., and Wadler, P. 2017. Quantified class constraints. See Diatchki (2017), 148–161.Google Scholar
Brady, E. 2013. Idris, a general-purpose dependently typed programming language: Design and implementation. J. Funct. Program. 23, 5, 552593.Google Scholar
Diatchki, I. S., Ed. 2017. Proceedings of the 10th ACM SIGPLAN International Symposium on Haskell, Oxford, United Kingdom, September 7-8, 2017. ACM.Google Scholar
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.Google Scholar
Fu, P. and Komendantskaya, E. 2017. Operational semantics of resolution and productivity in horn clause logic. Formal Asp. Comput. 29, 3, 453474.Google Scholar
Fu, P., Komendantskaya, E., Schrijvers, T., and Pond, A. 2016. Proof relevant corecursive resolution. See Kiselyov and King (2016), 126–143.Google Scholar
Gonthier, G. and Mahboubi, A. 2010. An introduction to small scale reflection in Coq. J. Formalized Reasoning 3, 2, 95152.Google Scholar
Harper, R. and Pfenning, F. 2005. On equivalence and canonical forms in the LF type theory. ACM Trans. Comput. Log. 6, 1, 61101.Google Scholar
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.Google Scholar
Karachalias, G. and Schrijvers, T. 2017. Elaboration on functional dependencies: functional dependencies are dead, long live functional dependencies! See Diatchki (2017), 133–147.Google Scholar
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.Google Scholar
Miller, D. and Nadathur, G. 2012. Programming with Higher-Order Logic. Cambridge University Press.Google Scholar
Milner, R. 1978. A theory of type polymorphism in programming. Journal of Computer and System Sciences 17, 348375.Google Scholar
Odersky, M., Sulzmann, M., and Wehr, M. 1999. Type inference with constrained types. TAPOS 5, 1, 3555.Google Scholar
Peyton Jones, S., Jones, M., and Meijer, E. 1997. Type classes: an exploration of the design space. In Haskell workshop.Google Scholar
Pientka, B. 2013. An insider's look at LF type reconstruction: everything you (n)ever wanted to know. J. Funct. Program. 23, 1, 137.Google Scholar
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.Google Scholar
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.Google Scholar
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.Google Scholar
Sulzmann, M. and Stuckey, P. J. 2008. HM(X) type inference is CLP(X) solving. J. Funct. Program. 18, 2, 251283.Google Scholar
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.Google Scholar
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.Google Scholar