skip to main content
10.1145/2370776.2370793acmotherconferencesArticle/Chapter ViewAbstractPublication PagesppdpConference Proceedingsconference-collections
research-article

Transparent function types: clearing up opacity

Published: 19 September 2012 Publication History

Abstract

Functional logic programming (FLP) is a paradigm that comes from the integration of lazy functional programming and logic programming. Although most FLP systems use static typing by means of a direct adaptation of Damas-Milner type system, it is well-known that some FLP features like higher-order patterns or the equality operator lead to so-called opacity situations that are not properly handled by Damas-Milner type system, thus leading to the loss of type preservation. Previous works have addressed this problem either directly forbidding those HO patterns that are opaque or restricting its use. In this paper we propose a new approach that is based on eliminating the unintended opacity created by HO patterns and the equality operator by extending the expressiveness of the type language with decorations in the arrows of the functional types. We study diverse possibilities, which differ in the amount of information included in the decorations. The obtained type systems have different properties and expressiveness, but each of them recovers type preservation from simple extensions of Damas-Milner.

References

[1]
J. M. Almendros-Jiménez, R. Caballero, Y. García-Ruiz, and F. Sáenz-Pérez. XQuery in the functional-logic language Toy. In Proceedings of the 20th International Workshop on Functional and Constraint Logic Programming (WFLP '11), volume 6816 of Lecture Notes in Computer Science, pages 35--51. Springer, 2011.
[2]
S. Antoy and M. Hanus. Functional logic programming. Communications of the ACM, 53(4):74--85, 2010.
[3]
S. Antoy and A. Tolmach. Typed higher-order narrowing without higher-order strategies. In Proceedings of the 4th International Symposium on Functional and Logic Programming (FLOPS '99), volume 1722 of Lecture Notes in Computer Science, pages 335--352. Springer, 1999.
[4]
Z. Ariola, M. Felleisen, J. Maraist, M. Odersky, and P. Wadler. A call-by-need lambda calculus. In Proceedings of the 22nd Annual ACM SIGACT-SIGPLAN Symposium on Principles of Programming Languages (POPL '95), pages 233--246. ACM, 1995.
[5]
R. Caballero, Y. García-Ruiz, and F. Sáenz-Pérez. Integrating XPath with the functional-logic language toy. In Proceedings of the 13th International Symposium on Practical Aspects of Declarative Languages (PADL '11), volume 6539 of Lecture Notes in Computer Science, pages 145--159. Springer, 2011.
[6]
R. Caballero and F. López-Fraguas. A functional-logic perspective on parsing. In Proceedings of the 4th International Symposium on Functional and Logic Programming (FLOPS '99), pages 85--99. Springer, 1999.
[7]
R. Caballero and F. J. López-Fraguas. Functional logic parsers in Toy. Technical Report SIP-7498, Universidad Complutense de Madrid, April 1998. Available at http://gpd.sip.ucm.es/fraguas/papers/TR-SIP-74--98-Toy-parsers.pdf.
[8]
R. Caballero, J. Sanchez, P. A. Sanchez, A. J. F. Leiva, A. G. Luezas, F. L. Fraguas, M. R. Artalejo, and F. S. Pérez. Toy, a multiparadigm declarative language. version 2.3.2, October 2011. Available at http://toy.sourceforge.net.
[9]
J. Christiansen, D. Seidel, and J. Voigtlönder. An adequate, denotational, functional-style semantics for typed FlatCurry. In Proceedings of the 19th International Workshop on Functional and (Constraint) Logic Programming (WFLP '10), Revised Selected Papers, volume 6559 of Lecture Notes in Computer Science, pages 119--136. Springer, 2011.
[10]
L. Damas and R. Milner. Principal type-schemes for functional programs. In Proceedings of the 9th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL '82), pages 207--212. ACM, 1982.
[11]
J. González-Moreno, T. Hortalá-González, F. López-Fraguas, and M. Rodríguez-Artalejo. An approach to declarative programming based on a rewriting logic. Journal of Logic Programming, 40(1):47--87, 1999.
[12]
J. González-Moreno, T. Hortalá-González, and M. Rodríguez-Artalejo. A higher order rewriting logic for functional logic programming In Proceedings of the 14th International Conference on Logic Programming (ICLP '97), pages 153--167. MIT Press, 1997.
[13]
J. González-Moreno, T. Hortalá-González, and M. Rodríguez-Artalejo. Polymorphic types in functional logic programming. Journal of Functional and Logic Programming, 2001(1), July 2001.
[14]
M. Hanus. Curry: An integrated functional logic language (version 0.8.2). Available at http://www.informatik.uni-kiel.de/curry/report.html, March 2006.
[15]
M. Hanus. Multi-paradigm declarative languages. In Proceedings of the 23rd International Conference on Logic Programming (ICLP '07), volume 4670 of Lecture Notes in Computer Science, pages 45--75. Springer, 2007.
[16]
T. Hortalá-González, F. J. López-Fraguas, J. Sánchez-Hernández, and E. Ullán-Hernández. Declarative programming with real constraints. Technical Report SIP-5997, Universidad Complutense de Madrid, April 1997. Available at http://gpd.sip.ucm.es/fraguas/papers/TR-DIA-5997-CFLPR.pdf.
[17]
P. Hudak, J. Hughes, S. Peyton Jones, and P. Wadler. A history of Haskell: Being lazy with class. In Proceedings of the 3rd ACM SIGPLAN Conference on History of Programming Languages (HOPL III), pages 12--1--12--55. ACM, 2007.
[18]
K. Läufer and M. Odersky. Polymorphic type inference and abstract data types. ACM Transactions on Programming Languages and Systems, 16:1411--1430, 1994.
[19]
F. López-Fraguas, E. Martin-Martin, and J. Rodríguez-Hortalá. Liberal typing for functional logic programs. In Proceedings of the 8th Asian Symposium on Programming Languages and Systems (APLAS '10), volume 6461 of Lecture Notes in Computer Science, pages 80--96. Springer, 2010.
[20]
F. López-Fraguas, E. Martin-Martin, and J. Rodríguez-Hortalá. New results on type systems for functional logic programming. In Proceedings of the 18th International Workshop on Functional and (Constraint) Logic Programming (WFLP '09), Revised Selected Papers, volume 5979 of Lecture Notes in Computer Science, pages 128--144. Springer, 2010.
[21]
F. López-Fraguas, E. Martin-Martin, and J. Rodríguez-Hortalá. Welltyped narrowing with extra variables in functional-logic programming. In Proceedings of the 2012 ACM SIGPLAN Workshop on Partial Evaluation and Program Manipulation (PEPM '12), pages 83--92. ACM, 2012.
[22]
F. López-Fraguas, J. Rodríguez-Hortalá, and J. Sánchez-Hernández. Rewriting and call-time choice: the HO case. In Proceedings of the 9th International Symposium on Functional and Logic Programming (FLOPS '08), volume 4989 of Lecture Notes in Computer Science, pages 147--162. Springer, 2008.
[23]
F. López-Fraguas and J. Sánchez-Hernández. Toy: A multiparadigm declarative system. In Proceedings of the 10th International Conference on Rewriting Techniques and Applications (RTA '99), volume 1631 of Lecture Notes in Computer Science, pages 244--247. Springer, 1999.
[24]
W. Lux. Adding Haskell-style overloading to Curry. In Workshop of Working Group 2.1.4 of the German Computing Science Association GI, pages 67--76, 2008.
[25]
E. Martin-Martin. Type classes in functional logic programming. In Proceedings of the 2011 ACM SIGPLAN Workshop on Partial Evaluation and Program Manipulation (PEPM '11), pages 121--130. ACM, 2011.
[26]
E. Martin-Martin and J. Rodríguez-Hortalá. Transparent function types: Clearing up opacity (extended version). Technical Report SIC-11-12, Universidad Complutense de Madrid, July 2012. Available athttp://gpd.sip.ucm.es/enrique/publications/ppdp12/SIC-11-12.pdf.
[27]
J. C. Mitchell and G. D. Plotkin. Abstract types have existential type. ACM Transactions on Programming Languages and Systems, 10(3):470--502, 1988.
[28]
J. C. Reynolds. Types, abstraction and parametric polymorphism. Information Processing, (83):513--523, 1983.
[29]
M. Rodríguez-Artalejo. Functional and constraint logic programming. In Constraints in Computational Logics: Theory and Applications. International Summer School (CCL99), volume 2002 of Lecture Notes in Computer Science, pages 202--270. Springer, 2001.
[30]
P. Wadler. Theorems for free! In Proceedings of the 4th International Conference on Functional Programming Languages and Computer Architecture (FPCA '89), pages 347--359. ACM, 1989.

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Other conferences
PPDP '12: Proceedings of the 14th symposium on Principles and practice of declarative programming
September 2012
226 pages
ISBN:9781450315227
DOI:10.1145/2370776
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Sponsors

  • Kuleuven Belgium: Kuleuven Belgium

In-Cooperation

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 19 September 2012

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. functional-logic programming
  2. higher-order patterns
  3. opacity
  4. type systems

Qualifiers

  • Research-article

Conference

PPDP'12
Sponsor:
  • Kuleuven Belgium

Acceptance Rates

Overall Acceptance Rate 230 of 486 submissions, 47%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • 0
    Total Citations
  • 73
    Total Downloads
  • Downloads (Last 12 months)1
  • Downloads (Last 6 weeks)0
Reflects downloads up to 13 Feb 2025

Other Metrics

Citations

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media