Safe typing of functional logic programs with opaque patterns and local bindings

Type systems are widely used in programming languages as a powerful tool providing safety to programs. Functional logic languages have inherited Damas-Milner type system from their functional part due to its simplicity and popularity. In this paper we address a couple of aspects that can be subject...

Descripción completa

Detalles Bibliográficos
Autores: López Fraguas, Francisco Javier, Martín Martín, Enrique, Rodríguez Hortalá, Juan
Tipo de recurso: artículo
Fecha de publicación:2014
País:España
Institución:Universidad Complutense de Madrid (UCM)
Repositorio:Docta Complutense
Idioma:inglés
OAI Identifier:oai:docta.ucm.es:20.500.14352/35091
Acceso en línea:https://hdl.handle.net/20.500.14352/35091
Access Level:acceso abierto
Palabra clave:004.42.047
004.432.4
Functional-logic programming
Type systems
Opaque patterns
Let bindings
Informática (Informática)
Programación de ordenadores (Informática)
Software
1203.17 Informática
1203.23 Lenguajes de Programación
3304.16 Diseño Lógico
Descripción
Sumario:Type systems are widely used in programming languages as a powerful tool providing safety to programs. Functional logic languages have inherited Damas-Milner type system from their functional part due to its simplicity and popularity. In this paper we address a couple of aspects that can be subject of improvement. One is related to a problematic feature of functional logic languages not taken under consideration by standard systems: it is known that the use of opaque HO patterns in left-hand sides of program rules may produce undesirable effects from the point of view of types. We re-examine the problem, and propose two variants of a Damas-Milner-like type system where certain uses of HO patterns (even opaque) are permitted while preserving type safety. The considered formal framework is that of programs without extra variables and using let-rewriting as reduction mechanism. The other aspect addressed is the different ways in which polymorphism of local definitions can be handled. At the same time that we formalize the type system, we have made the effort of technically clarifying the overall process of type inference in a whole program.