Hostname: page-component-8448b6f56d-mp689 Total loading time: 0 Render date: 2024-04-24T00:10:48.506Z Has data issue: false hasContentIssue false

Understanding functional dependencies via constraint handling rules

Published online by Cambridge University Press:  01 January 2007

MARTIN SULZMANN
Affiliation:
School of Computing, National University of Singapore, S16 Level 5, 3 Science Drive 2, Singapore 117543 (e-mail: sulzmann@comp.nus.edu.sg)
GREGORY J. DUCK
Affiliation:
NICTA Victoria Laboratory, Department of Computer Science and Software Engineering, University of Melbourne, 3010 Vic, Australia (e-mail: gjd@cs.mu.oz.au)
SIMON PEYTON-JONES
Affiliation:
Microsoft Research Ltd, 7 JJ Thomson Avenue, Cambridge CB3 0FB, UK (e-mail: simonpj@microsoft.com)
PETER J. STUCKEY
Affiliation:
NICTA Victoria Laboratory, Department of Computer Science and Software Engineering, University of Melbourne, Vic 3010, Australia (e-mail: pjs@cs.mu.oz.au)
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.

Functional dependencies are a popular and useful extension to Haskell style type classes. We give a reformulation of functional dependencies in terms of Constraint Handling Rules (CHRs). In previous work, CHRs have been employed for describing user-programmable type extensions in the context of Haskell style type classes. Here, we make use of CHRs to provide for the first time a concise result that under some sufficient conditions, functional dependencies allow for sound, complete and decidable type inference. The sufficient conditions imposed on functional dependencies can be very limiting. We show how to safely relax these conditions and suggest several sound extensions of functional dependencies. Our results allow for a better understanding of functional dependencies and open up the opportunity for new applications.

Type
Article
Copyright
Copyright © Cambridge University Press 2006

References

Abdennadher, S. (1997) Operational semantics and confluence of constraint propagation rules. Pages 252266 of: Proc. of CP'97. LNCS, vol. 1330. Springer-Verlag.Google Scholar
Armstrong, W. W. (1974) Dependency structures of data base relationships. Pages 580583 of: Proc. of IFIP'74. North-Holland.Google Scholar
Chakravarty, M., Keller, G. & Peyton Jones, S. (2005a) Associated types synonyms. Pages 241253 of: Proc. of ICFP'05. ACM Press.CrossRefGoogle Scholar
Chakravarty, M., Keller, G., Peyton Jones, S. & Marlow, S. (2005b) Associated types with class. Pages 113 of: Proc. of POPL'05. ACM Press.Google Scholar
Chen, K., Hudak, P. & Odersky, M. (1992) Parametric type classes. Pages 170191 of: Proc. of ACM Conference on Lisp and Functional Programming. ACM Press.CrossRefGoogle Scholar
Duck, G. J., Peyton Jones, S., Stuckey, P. J. & Sulzmann, M. (2004) Sound and decidable type inference for functional dependencies. Pages 4963 of: Proc. of ESOP'04. LNCS, vol. 2986. Springer-Verlag.Google Scholar
Duggan, D. & Ophel, J. (2002) Type-checking multi-parameter type classes. J. Funct. Program. 12 (2), 133158.CrossRefGoogle Scholar
Frühwirth, T. (1995) Constraint handling rules. Pages 9097 of: Constraint programming: Basics and trends. LNCS, vol. 910. Springer-Verlag.CrossRefGoogle Scholar
Frühwirth, T. (1998) Theory and practice of constraint handling rules. J. Logic Program. 37 (1–3), 95138.CrossRefGoogle Scholar
Frühwirth, T. (2000) Proving termination of constraint solver programs. Pages 298317 of: Proc. of new trends in constraints: Joint ERCIM/Compulog net workshop. LNAI, vol. 1865. Springer-Verlag.CrossRefGoogle Scholar
GHC (2005) Glasgow Haskell Compiler home page. http://www.haskell.org/ghc/.Google Scholar
HUGS (2005) Hugs home page. http://www.haskell.org/hugs/.Google Scholar
Jones, M. P. (1992) Qualified types: Theory and practice. PhD thesis, Oxford University.Google Scholar
Jones, M. P. (1993) Coherence for qualified types. Research Report YALEU/DCS/RR-989. Yale University, Department of Computer Science.Google Scholar
Jones, M. P. (1995) Simplifying and improving qualified types. Pages 160169 of: FPCA ‘95: Conference on functional programming languages and computer architecture. ACM Press.CrossRefGoogle Scholar
Jones, M. P. (2000) Type classes with functional dependencies. Pages 230244 of: Proc. ESOP'00. LNCS, vol. 1782. Springer-Verlag.Google Scholar
Kiselyov, O., Lämmel, R. & Schupke, K. (2004) Strongly typed heterogeneous collections. Pages 96107 of: Proc. of Haskell'04. ACM Press.CrossRefGoogle Scholar
Lassez, J., Maher, M. & Marriott, K. (1987) Unification revisited. Pages 587625 of: Foundations of Deductive Databases and Logic Programming. Morgan Kauffman.Google Scholar
Maier, D. (1983). The Theory of Relational Databases. Computer Science Press.Google Scholar
Odersky, M., Sulzmann, M. & Wehr, M. (1999) Type inference with constrained types. Theory & Practice of Object Syst. 5 (1), 3555.3.0.CO;2-4>CrossRefGoogle Scholar
Ohori, A. (1995) A polymorphic record calculus and its compilation. ACM Trans. Program. Lang. & Syst. 17, 844895.CrossRefGoogle Scholar
Shoenfield, J. R. (1967) Mathematical Logic. Addison-Wesley.Google Scholar
Stuckey, P. J. & Sulzmann, M. (2005) A theory of overloading. ACM Trans. Program. Lang. & Syst., 27 (6), 154.CrossRefGoogle Scholar
Sulzmann, M. (2000) A general framework for Hindley/Milner type systems with constraints. PhD thesis, Yale University, Department of Computer Science.CrossRefGoogle Scholar
Submit a response

Discussions

No Discussions have been published for this article.