Database query languages and functional logic programming

2006 ◽  
Vol 24 (2) ◽  
pp. 129-184
Author(s):  
Jesús M. Almendros-Jiménez ◽  
Antonio Becerra-Terón
2007 ◽  
Vol 7 (5) ◽  
pp. 537-582 ◽  
Author(s):  
ANTONIO J. FERNÁNDEZ ◽  
TERESA HORTALÁ-GONZÁLEZ ◽  
FERNANDO SÁENZ-PÉREZ ◽  
RAFAEL DEL VADO-VÍRSEDA

AbstractIn this paper, we present our proposal to Constraint Functional Logic Programming over Finite Domains (CFLP($\fd$)) with a lazy functional logic programming language which seamlessly embodies finite domain ($\fd$) constraints. This proposal increases the expressiveness and power of constraint logic programming over finite domains (CLP($\fd$)) by combining functional and relational notation, curried expressions, higher-order functions, patterns, partial applications, non-determinism, lazy evaluation, logical variables, types, domain variables, constraint composition, and finite domain constraints. We describe the syntax of the language, its type discipline, and its declarative and operational semantics. We also describe\toy(fd)$, an implementation forCFLP($\fd$), and a comparison of our approach with respect toCLP($\fd$) from a programming point of view, showing the new features we introduce. And, finally, we show a performance analysis which demonstrates that our implementation is competitive with respect to existingCLP($\fd$) systems and that clearly outperforms the closer approach toCFLP($\fd$).


2012 ◽  
Vol 14 (1) ◽  
pp. 65-116 ◽  
Author(s):  
ADRIÁN RIESCO ◽  
JUAN RODRÍGUEZ-HORTALÁ

AbstractModern functional logic programming (FLP) languages use non-terminating and non-confluent constructor systems (CSs) as programs in order to define non-strict and non-deterministic functions. Two semantic alternatives have been usually considered for parameter passing with this kind of functions: call-time choice and run-time choice. While the former is the standard choice of modern FLP languages, the latter lacks some basic properties – mainly compositionality – that have prevented its use in practical FLP systems. Traditionally it has been considered that call-time choice induces a singular denotational semantics, while run-time choice induces a plural semantics. We have discovered that this latter identification is wrong when pattern matching is involved, and thus in this paper we propose two novel compositional plural semantics for CSs that are different from run-time choice.We investigate the basic properties of our plural semantics – compositionality, polarity, and monotonicity for substitutions, and a restricted form of the bubbling property for CSs – and the relation between them and to previous proposals, concluding that these semantics form a hierarchy in the sense of set inclusion of the set of values computed by them. Besides, we have identified a class of programs characterized by a simple syntactic criterion for which the proposed plural semantics behave the same, and a program transformation that can be used to simulate one of the proposed plural semantics by term rewriting. At the practical level, we study how to use the new expressive capabilities of these semantics for improving the declarative flavor of programs. As call-time choice is the standard semantics for FLP, it still remains the best option for many common programming patterns. Therefore, we propose a language that combines call-time choice and our plural semantics, which we have implemented in the Maude system. The resulting interpreter is then employed to develop and test several significant examples showing the capabilities of the combined semantics.


Sign in / Sign up

Export Citation Format

Share Document