Transparent function types: clearing up opacity

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.

[1]  Enrique Martin-Martin Type classes in functional logic programming , 2011, PEPM '11.

[2]  Daniel Seidel,et al.  An Adequate, Denotational, Functional-Style Semantics for Typed FlatCurry , 2010, WFLP.

[3]  Simon L. Peyton Jones,et al.  A history of Haskell: being lazy with class , 2007, HOPL.

[4]  Marilyn Bohl,et al.  Information processing , 1971 .

[5]  Enrique Martin-Martin,et al.  Liberal Typing for Functional Logic Programs , 2010, APLAS.

[6]  Rafael Caballero,et al.  A Functional-Logic Perspective on Parsing , 1999, Fuji International Symposium on Functional and Logic Programming.

[7]  Enrique Martin-Martin,et al.  Well-typed narrowing with extra variables in functional-logic programming , 2012, PEPM '12.

[8]  Mario Rodríguez-Artalejo,et al.  Polymorphic Types in Functional Logic Programming , 2001, J. Funct. Log. Program..

[9]  Mario Rodríguez-Artalejo,et al.  Functional and Constraint Logic Programming , 2001, CCL.

[10]  John C. Reynolds,et al.  Types, Abstraction and Parametric Polymorphism , 1983, IFIP Congress.

[11]  J. C. Gonz Alez-Moreno,et al.  An Approach to Declarative Programming Based on a Rewriting Logic , 2022 .

[12]  Martin Odersky,et al.  Polymorphic type inference and abstract data types , 1994, TOPL.

[13]  Enrique Martin-Martin,et al.  New Results on Type Systems for Functional Logic Programming , 2009, WFLP.

[14]  Michael Hanus,et al.  Functional logic programming , 2010, CACM.

[15]  F. J. L opez-Fraguas,et al.  Declarative Programming with Real Constraints , 1997 .

[16]  Michael Hanus,et al.  Multi-paradigm Declarative Languages , 2007, ICLP.

[17]  Michael Hanus,et al.  Curry: an integrated functional logic language (version 0 , 2003 .

[18]  Francisco Javier López-Fraguas,et al.  An Approach to Declarative Programming Based on a Rewriting Logic , 1999, J. Log. Program..

[19]  Juan Rodríguez-Hortalá,et al.  Rewriting and Call-Time Choice: The HO Case , 2008, FLOPS.

[20]  Philip Wadler,et al.  Theorems for free! , 1989, FPCA.

[21]  Sergio Antoy,et al.  Typed Higher-Order Narrowing without Higher-Order Strategies , 1999, Fuji International Symposium on Functional and Logic Programming.

[22]  Mario Rodríguez-Artalejo,et al.  A Higher Order Rewriting Logic for Functional Logic Programming , 1997, ICLP.

[23]  Rafael Caballero,et al.  Integrating XPath with the Functional-Logic Language Toy , 2011, PADL.

[24]  Jesús Manuel Almendros-Jiménez,et al.  XQuery in the Functional-Logic Language Toy , 2011, WFLP.

[25]  Matthias Felleisen,et al.  A call-by-need lambda calculus , 1995, POPL '95.

[26]  Robin Milner,et al.  Principal type-schemes for functional programs , 1982, POPL '82.

[27]  John C. Mitchell,et al.  Abstract types have existential types , 1985, POPL.

[28]  Francisco Javier López-Fraguas,et al.  TOY: A Multiparadigm Declarative System , 1999, RTA.

[29]  Lee Naish A Higher Order Rewriting Logic for Functional Logic Programming , 1997 .