Constructive failure has been proposed recently as a programming construct useful for functional logic programming, playing a role similar to that of constructive negation in logicprogramming. On the other hand, almo...
详细信息
Constructive failure has been proposed recently as a programming construct useful for functional logic programming, playing a role similar to that of constructive negation in logicprogramming. On the other hand, almost any functionallogic program requires the use of some kind of equality test between expressions. We face in this work in a rigorous way the interaction of failure and equality (even for non-ground expressions), which is a non trivial issue, requiring in particular the use of disequality conditions at the level of the operational mechanism of constructive failure. As an interesting side product, we develop a novel treatment of equality and disequality in functional logic programming, by giving them a functional status, which is better suited for practice than previous proposals.
This paper focuses on the integration of the (also integrated) declarative paradigms of functionallogic and fuzzy logicprogramming, in order to obtain a richer and much more expressive framework where mathematical f...
详细信息
ISBN:
(纸本)3540325298
This paper focuses on the integration of the (also integrated) declarative paradigms of functionallogic and fuzzy logicprogramming, in order to obtain a richer and much more expressive framework where mathematical functions cohabit with fuzzy logic features. In this sense, this paper must be seen as a first stage in the development of this new research line. Starting with two representative languages from both settings, namely Curry and Likelog, we propose an hybrid dialect where a set of rewriting rules associated to the functionallogic dimension of the language, are accompanied with a set of similarity equations between symbols of the same nature and arity, which represents the fuzzy counterpart of the new environment. We directly act inside the kernel of the operational mechanism of the language, thus obtaining a fuzzy variant of needed narrowing which fully exploits the similarities collected in a given program. A key point in the design of this last operational method is that, apart from computing at least the same elements of the crisp case, all similar terms of a given goal are granted to be completely treated too while avoiding the risk of infinite loops associated to the intrinsic (reflexive, symmetric and transitive) properties of similarity relations.
Although functional as well as logic languages use equality to discriminate between logically different cases, the operational meaning of equality is different in such languages. functional languages reduce equational...
详细信息
Although functional as well as logic languages use equality to discriminate between logically different cases, the operational meaning of equality is different in such languages. functional languages reduce equational expressions to their Boolean values, True or False, logic languages use unification to check the validity only and fail otherwise. Consequently, the language Curry, which amalgamates functional and logicprogramming features, offers two kinds of equational expressions so that the programmer has to distinguish between these uses. We show that this distinction can be avoided by providing an analysis and transformation method that automatically selects the appropriate operation. Without this distinction in source programs, the language design can be simplified and the execution of programs can be optimized. As a consequence, we show that one kind of equational expressions is sufficient and unification is nothing else than an optimization of Boolean equality.
We describe a framework to support the implementation of web-based systems intended to manipulate data stored in relational databases. Since the conceptual model of a relational database is often specified as an entit...
详细信息
We describe a framework to support the implementation of web-based systems intended to manipulate data stored in relational databases. Since the conceptual model of a relational database is often specified as an entity-relationship (ER) model, we propose to use the ER model to generate a complete implementation in the declarative programming language Curry. This implementation contains operations to create and manipulate entities of the data model, supports authentication, authorization, session handling, and the composition of individual operations to user processes. Furthermore, the implementation ensures the consistency of the database w.r.t. the data dependencies specified in the ER model, i.e., updates initiated by the user cannot lead to an inconsistent state of the database. In order to generate a high-level declarative implementation that can be easily adapted to individual customer requirements, the framework exploits previous works on declarative database programming and web user interface construction in Curry.
We present a generic scheme for the declarative debugging of programs that are written in rewriting-based languages that are equipped with narrowing. Our aim is to provide an integrated development environment in whic...
详细信息
We present a generic scheme for the declarative debugging of programs that are written in rewriting-based languages that are equipped with narrowing. Our aim is to provide an integrated development environment in which it is possible to debug a program and then correct it automatically. Our methodology is based on the combination (in a single framework) of a semantics-based diagnoser that identifies those parts of the code that contain errors and an inductive learner that tries to repair them, once the bugs have been located in the program. We develop our methodology in several steps. First, we associate with our programs a semantics that is based on a (continuous) immediate consequence operator, T-R, which models the answers computed by narrowing and is parametric w.r.t. the evaluation strategy, which can be eager or lazy. Then, we show that, given the intended specification of a program R, it is possible to check the correctness of R by a single step of T-R. In order to develop an effective debugging method, we approximate the computed answers semantics of R and derive a finitely terminating bottom-up abstract diagnosis method, which can be used statically. Finally, a bug-correction program synthesis methodology attempts to correct the erroneous components of the wrong code. We propose a hybrid, top-down (unfolding-based) as well as bottom-up (induction-based), correction approach that is driven by a set of evidence examples which are automatically produced as an outcome by the diagnoser. The resulting program is proven to be correct and complete w.r.t. the considered example sets. Our debugging framework does not require the user to provide error symptoms in advance or to answer difficult questions concerning program correctness. An implementation of our debugging system has been undertaken which demonstrates the workability of our approach. (C) 2010 Elsevier B.V. All rights reserved.
Needed narrowing is a complete and optimal operational principle for modern declarative languages which integrate the best features of lazy functional and logicprogramming. We investigate the formal relation between ...
详细信息
Needed narrowing is a complete and optimal operational principle for modern declarative languages which integrate the best features of lazy functional and logicprogramming. We investigate the formal relation between needed narrowing and another (not so lazy) narrowing strategy which is the basis for popular implementations of lazy function at logic languages. We demonstrate that needed narrowing and lazy narrowing are computationally equivalent over the class of uniform programs. We also introduce a complete refinement of lazy narrowing, called uniform lazy narrowing, which is still equivalent to needed narrowing over the aforementioned class. Since actual implementations of functionallogic languages are based on the transformation of the original program into a uniform one-which is then executed using a lazy narrowing strategy-our results can be thought of as a formal basis for the correctness of these implementations.
This work introduces a transformation methodology for functionallogic programs based on needed narrowing, the optimal and complete operational principle for modem declarative languages which integrate the best featur...
详细信息
This work introduces a transformation methodology for functionallogic programs based on needed narrowing, the optimal and complete operational principle for modem declarative languages which integrate the best features of functional and logicprogramming. We provide correctness results for the transformation system w.r.t. the set of computed values and answer substitutions and show that the prominent properties of needed narrowing-namely, the optimality w.r.t. the length of derivations and the number of computed solutions-carry over to the transformation process and the transformed programs. We illustrate the power of the system by taking on in our setting two well-known transformation strategies (composition and tapling). We also provide an implementation of the transformation system which, by means of some experimental results, highlights the potentiality of our approach. (C) 2003 Elsevier B.V. All rights reserved.
logicprogramming is a flexible programming paradigm due to the use of predicates without a fixed data flow. To extend logic languages with the compact notation of functionalprogramming, there are various proposals t...
详细信息
logicprogramming is a flexible programming paradigm due to the use of predicates without a fixed data flow. To extend logic languages with the compact notation of functionalprogramming, there are various proposals to map evaluable functions into predicates in order to stay in the logicprogramming framework. Since amalgamated functionallogic languages offer flexible as well as efficient evaluation strategies, we propose an opposite approach in this paper. By mapping logic programs into functionallogic programs with a transformation based on inferring functional dependencies, we develop a fully automatic transformation which keeps the flexibility of logicprogramming but can improve computations by reducing infinite search spaces to finite ones.
Many functionallogic 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...
详细信息
Many functionallogic 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 functionallogic 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 functionallogic 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.
Pull-tabbing is an evaluation approach for functionallogic computations, based on a graph transformation recently proposed, which avoids making irrevocable nondeterministic choices that would jeopardize the completen...
详细信息
Pull-tabbing is an evaluation approach for functionallogic computations, based on a graph transformation recently proposed, which avoids making irrevocable nondeterministic choices that would jeopardize the completeness of computations. In contrast to other approaches with this property, it does not require an upfront cloning of a possibly large portion of the choice's context. We formally define the pull-tab transformation, characterize the class of programs for which the transformation is intended, extend the computations in these programs to include the transformation, and prove the correctness of the extended computations.
暂无评论