Hostname: page-component-8678677fb7-bbpp6 Total loading time: 0 Render date: 2026-10-16T17:54:46.495Z Has data issue: false hasContentIssue false

A liberal type system for functional logic programs†

Published online by Cambridge University Press:  10 November 2014

FRANCISCO JAVIER LÓPEZ-FRAGUAS
Affiliation:
Dpto. de Sistemas Informáticos y Computación, Facultad de Informática, Universidad Complutense de Madrid, Madrid, Spain Email: fraguas@sip.ucm.es
ENRIQUE MARTIN-MARTIN
Affiliation:
Dpto. de Sistemas Informáticos y Computación, Facultad de Informática, Universidad Complutense de Madrid, Madrid, Spain Email: fraguas@sip.ucm.es
JUAN RODRÍGUEZ-HORTALÁ
Affiliation:
Dpto. de Sistemas Informáticos y Computación, Facultad de Informática, Universidad Complutense de Madrid, Madrid, Spain Email: fraguas@sip.ucm.es

Abstract

We propose a new type system for functional logic programming which is more liberal than the classical Damas–Milner usually adopted, but it is also restrictive enough to ensure type soundness. Starting from Damas–Milner typing of expressions, we propose a new notion of well-typed program that adds support for type-indexed functions, a particular form of existential types, opaque higher-order patterns and generic functions – as shown by an extensive collection of examples that illustrate the possibilities of our proposal. In the negative side, the types of functions must be declared, and therefore types are checked but not inferred. Another consequence is that parametricity is lost, although the impact of this flaw is limited as ‘free theorems’ were already compromised in functional logic programming because of non-determinism.

Information

Type
Paper
Copyright
Copyright © Cambridge University Press 2014 

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

Article purchase

Temporarily unavailable