Advances in Type Systems for Functional Logic Programming

Type systems are widely used in programming languages as a powerful tool providing safety to programs, and forcing the programmers to write code in a clearer way. Functional-logic languages have inherited Damas & Milner type system from their functional part due to its simplicity and popularity. However, functional-logic languages have some problematic features not taken under consideration by standard systems. In particular, it is known that the use of opaque HO patterns in left-hand sides of program rules may produce undesirable eects from the point of view of types. We re-examine the problem, and propose a Damas & Milner-like type system where certain uses of HO patterns (even opaque) are permitted while preserving type safety, as proved by a subject reduction result that uses a HO-let-rewriting, a recently proposed operational semantics for HO functional logic programs.

[1]  Dr. Pierre Deransart,et al.  Prolog: The Standard , 1996, Springer Berlin Heidelberg.

[2]  Chang Liu,et al.  Term rewriting and all that , 2000, SOEN.

[3]  Ralf Hinze,et al.  A new approach to generic functional programming , 2000, POPL '00.

[4]  Tobias Nipkow,et al.  Type Reconstruction for Type Classes , 1993 .

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

[6]  Benjamin C. Pierce,et al.  Types and programming languages: the next generation , 2003, 18th Annual IEEE Symposium of Logic in Computer Science, 2003. Proceedings..

[7]  James Cheney,et al.  First-Class Phantom Types , 2003 .

[8]  Fritz Henglein,et al.  Type inference with polymorphic recursion , 1993, TOPL.

[9]  Peyton Jones,et al.  Haskell 98 language and libraries : the revised report , 2003 .

[10]  Alan Mycroft,et al.  Polymorphic Type Schemes and Recursive Definitions , 1984, Symposium on Programming.

[11]  John Peterson,et al.  Implementing type classes , 1993, PLDI '93.

[12]  Simon L. Peyton Jones,et al.  Practical type inference for arbitrary-rank types , 2007, Journal of Functional Programming.

[13]  Simon L. Peyton Jones,et al.  Simple unification-based type inference for GADTs , 2006, ICFP '06.

[14]  R. Hindley The Principal Type-Scheme of an Object in Combinatory Logic , 1969 .

[15]  H. Hussmann Nondeterminism in Algebraic Specifications and Algebraic Programs , 1993, Progress in Theoretical Computer Science.

[16]  Yann Régis-Gianas,et al.  Stratified type inference for generalized algebraic data types , 2006, POPL '06.

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

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

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

[20]  J. A. Robinson,et al.  A Machine-Oriented Logic Based on the Resolution Principle , 1965, JACM.

[21]  Sandra Alves,et al.  Type Inference using Constraint Handling Rules , 2002, Electron. Notes Theor. Comput. Sci..

[22]  John W. Lloyd,et al.  Programming in an Integrated Functional and Logic Language , 1999, J. Funct. Log. Program..

[23]  Paul J. Krause,et al.  The art of Prolog - second edition by Leon Sterling and Ehud Shapiro, MIT Press, Cambridge, MA 1994, pp 509, £19.95 (paperback), £44.94 (hardback), ISBN 0-262-19338-8 , 1995, The Knowledge Engineering Review.

[24]  J. B. Wells,et al.  Adding Polymorphic Abstraction to ML (Detailed Abstract) , 1994 .

[25]  Jerzy Tiuryn,et al.  Type reconstruction in the presence of polymorphic recursion , 1993, TOPL.

[26]  VytiniotisDimitrios,et al.  Simple unification-based type inference for GADTs , 2006 .

[27]  Robert Sedgewick,et al.  Algorithms in C : Part 5 : Graph Algo-rithms , 2002 .

[28]  Harold N. Gabow,et al.  Path-based depth-first search for strong and biconnected components , 2000, Inf. Process. Lett..

[29]  P. Hudak,et al.  A general framework for hindley/milner type systems with constraints , 2000 .

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

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

[32]  Dominique Clément,et al.  The Natural Dynamic Semantics of Mini-Standard ML , 1987, TAPSOFT, Vol.2.

[33]  Juan José Moreno-Navarro,et al.  Adding Type Classes to Functional-Logic Languages , 1996, APPIA-GULP-PRODE.

[34]  Alberto Martelli,et al.  An Efficient Unification Algorithm , 1982, TOPL.

[35]  Philip Wadler,et al.  How to make ad-hoc polymorphism less ad hoc , 1989, POPL '89.

[36]  M. Debbabi,et al.  The Journal of Functional and Logic Programming , 2007 .

[37]  Jerzy Tiuryn,et al.  The undecidability of the semi-unification problem , 1990, STOC '90.

[38]  Benjamin C. Pierce,et al.  Advanced Topics In Types And Programming Languages , 2004 .

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

[40]  Robin Milner,et al.  A Theory of Type Polymorphism in Programming , 1978, J. Comput. Syst. Sci..

[41]  Marko C. J. D. van Eekelen,et al.  CLEAN: A language for functional graph writing , 1987, FPCA.

[42]  Daan Leijen,et al.  Flexible types: robust type inference for first-class polymorphism , 2009, POPL '09.

[43]  James McKinna,et al.  Why dependent types matter , 2006, POPL '06.

[44]  Mads Tofte,et al.  Region-based Memory Management , 1997, Inf. Comput..

[45]  Chris Reade,et al.  Elements of functional programming , 1989, International computer science series.

[46]  Enrique Martín Martín Advances in type systems for functional logic programming , 2009 .

[47]  Trevor Jim What are principal typings and what are they good for? , 1996, POPL '96.

[48]  Robert E. Tarjan,et al.  Depth-First Search and Linear Graph Algorithms , 1972, SIAM J. Comput..

[49]  John C. Mitchell,et al.  Abstract types have existential type , 1988, TOPL.

[50]  Francesca Cesarini,et al.  Erlang Programming - A Concurrent Approach to Software Development , 2009 .

[51]  Michael Hanus,et al.  The Integration of Functions into Logic Programming: From Theory to Practice , 1994, J. Log. Program..

[52]  Ralf Hinze Generics for the masses , 2004, ICFP '04.

[53]  Luís Damas,et al.  Type assignment in programming languages , 1984 .

[54]  Assaf J. Kfoury,et al.  Programming Examples Needing Polymorphic Recursion , 2005, ITRS.

[55]  Jan Wielemaker,et al.  An Overview of the SWI-Prolog Programming Environment , 2003, WLPE.

[56]  Zoltan Somogyi,et al.  The Execution Algorithm of Mercury, an Efficient Purely Declarative Logic Programming Language , 1996, J. Log. Program..

[57]  Simon L. Peyton Jones,et al.  The Implementation of Functional Programming Languages , 1987 .

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

[59]  Daan Leijen HMF: simple type inference for first-class polymorphism , 2008, ICFP.

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

[61]  Luca Cardelli,et al.  On understanding types, data abstraction, and polymorphism , 1985, CSUR.