scholarly journals A rewrite-based computational model for functional logic programming

10.29007/3ks9 ◽  
2018 ◽  
Author(s):  
Mircea Marin ◽  
Temur Kutsia ◽  
Besik Dundua

Functional logic programming extends the functional programming style with two important features: the possibility to define nondeterministic operations with overlapping rules, and the usage of logic variables in both defining rules and expressions to evaluate. Conditional constructor-based term rewrite systems (CB-CTRSs) emerged as a suitable model for functional logic programs, because they can be easily transformed into an equivalent program in a core language where computations can be performed more efficiently.We consider a recent proposal by Antoy and Hanus, of translating CB-CTRSs into an equivalent class of programs where computation can be performed by mere rewriting. His computational model has the limitation of computing only ground answer substitutions for equations with strict semantics interpreted as joinability to a value.We propose two adjustments of their computational models, which are capable to compute non-ground answers.

2016 ◽  
Vol 17 (2) ◽  
pp. 121-147 ◽  
Author(s):  
SERGIO ANTOY ◽  
MICHAEL HANUS

AbstractIn functional logic programs, rules are applicable independently of textual order, i.e., any rule can potentially be used to evaluate an expression. This is similar to logic languages and contrary to functional languages, e.g., Haskell enforces a strict sequential interpretation of rules. However, in some situations it is convenient to express alternatives by means of compact default rules. Although default rules are often used in functional programs, the non-deterministic nature of functional logic programs does not allow to directly transfer this concept from functional to functional logic languages in a meaningful way. In this paper, we propose a new concept of default rules for Curry that supports a programming style similar to functional programming while preserving the core properties of functional logic programming, i.e., completeness, non-determinism, and logic-oriented use of functions. We discuss the basic concept and propose an implementation which exploits advanced features of functional logic languages.


2014 ◽  
Vol 25 (4) ◽  
pp. 942-977
Author(s):  
FRANCISCO JAVIER LÓPEZ-FRAGUAS ◽  
ENRIQUE MARTIN-MARTIN ◽  
JUAN RODRÍGUEZ-HORTALÁ

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.


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$).


Sign in / Sign up

Export Citation Format

Share Document