Cost-Augmented Partial Evaluation of Functional Logic Programs

2004 ◽  
Vol 17 (1/2) ◽  
pp. 7-46 ◽  
Author(s):  
Germán Vidal
2005 ◽  
Vol 5 (3) ◽  
pp. 273-303 ◽  
Author(s):  
MARÍA ALPUENTE ◽  
SALVADOR LUCAS ◽  
GERMÁN VIDAL ◽  
MICHAEL HANUS

Many functional logic languages are based on narrowing, a unification-based goal-solving mechanism which subsumes the reduction mechanism of functional languages and the resolution principle of logic languages. Needed narrowing is an optimal evaluation strategy which constitutes the basis of modern (narrowing-based) lazy functional logic languages. In this work, we present the fundamentals of partial evaluation in such languages. We provide correctness results for partial evaluation based on needed narrowing and show that the nice properties of this strategy are essential for the specialization process. In particular, the structure of the original program is preserved by partial evaluation and, thus, the same evaluation strategy can be applied for the execution of specialized programs. This is in contrast to other partial evaluation schemes for lazy functional logic programs which may change the program structure in a negative way. Recent proposals for the partial evaluation of declarative multi-paradigm programs use (some form of) needed narrowing to perform computations at partial evaluation time. Therefore, our results constitute the basis for the correctness of such partial evaluators.


2007 ◽  
Vol 7 (1-2) ◽  
pp. 215-247 ◽  
Author(s):  
JOSEP SILVA ◽  
GERMÁN VIDAL

AbstractProgram slicing has been mainly studied in the context of imperative languages, where it has been applied to a wide variety of software engineering tasks, like program understanding, maintenance, debugging, testing, code reuse, etc. This work introduces the first forward slicing technique for declarative multi-paradigm programs which integrate features from functional and logic programming. Basically, given a program and aslicing criterion(a function call in our setting), the computed forward slice contains those parts of the original program which arereachablefrom the slicing criterion. Our approach to program slicing is based on an extension of (online) partial evaluation. Therefore, it provides a simple way to develop program slicing tools from existing partial evaluators and helps to clarify the relation between both methodologies. A slicing tool for the multi-paradigm language Curry, which demonstrates the usefulness of our approach, has been implemented in Curry itself.


1998 ◽  
Vol 20 (4) ◽  
pp. 768-844 ◽  
Author(s):  
María Alpuente ◽  
Moreno Falaschi ◽  
Germán Vidal

2003 ◽  
Vol 85 (1) ◽  
pp. 19-25 ◽  
Author(s):  
Elvira Albert ◽  
Michael Hanus ◽  
Germán Vidal

Sign in / Sign up

Export Citation Format

Share Document