Rafael Caballero
Complutense University of Madrid
Network
Latest external collaboration on country level. Dive into details by clicking on the dots.
Publication
Featured researches published by Rafael Caballero.
Proceedings of the 2005 ACM SIGPLAN workshop on Curry and functional logic programming | 2005
Rafael Caballero
Debugging is one of the essential parts of the software development cycle. However, the usual debugging techniques used in imperative languages such as the step by step execution often are not suitable for debugging declarative programming languages. We present here a graphical debugging environment for constraint lazy functional-logic programs based on declarative debugging. The debugger displays the computation tree associated with a computation which has produced an incorrect answer, and navigates it with the assistance of the user until the error, an incorrect program rule, is found out. The debugger supports programs including equality and disequality constraints.
international symposium on functional and logic programming | 2001
Rafael Caballero; Francisco Javier López-Fraguas; Mario Rodríguez-Artalejo
The aim of this paper is to provide theoretical foundations for the declarative debugging of wrong answers in lazy functional logic programming. We rely on a logical framework which formalizes both the intended meaning and the execution model of programs in a simple language which combines the expressivity of pure Prolog and a significant subset of Haskell. As novelties w.r.t. to previous related approaches, we deal with functional values both as arguments and as results of higher order functions, we obtain a completely formal specification of the debugging method, and we extend known soundness and completeness results for the debugging of wrong answers in logic programming to a substantially more difficult context. A prototype implementation of a working debugger is planned as future work.
Electronic Notes in Theoretical Computer Science | 2002
Rafael Caballero; Mario Rodríguez-Artalejo
We present a declarative debugger for lazy functional logic programs with polymorphic type discipline. Whenever a computed answer is considered wrong by the user (error symptom), the debugger locates a program fragment (function dening rule) responsible for the error. The notions of symptom and error have a declarative meaning w.r.t. to an intended program semantics. Debugging is performed by searching in a computation tree which is a logical representation of the computation. Following a known technique, our tool is based on a program transformation: transformed programs return computation trees along with the results expected by source programs. Our transformation is provably correct w.r.t. well-typing and program semantics. As additional improvements w.r.t. related approaches, we solve a previously open problem concerning the use of curried functions, and we provide a correct method for avoiding redundant questions to the user during debugging. A prototype implementation of the debugger is available. Case studies and extensions are planned as future work.
Electronic Notes in Theoretical Computer Science | 2007
Rafael Caballero; Christian Hermanns; Herbert Kuchen
In this paper we propose applying the ideas of declarative debugging to the object-oriented language Java as an alternative to traditional trace debuggers used in imperative languages. The declarative debugger builds a suitable computation tree containing information about method invocations occurred during a wrong computation. The tree is then navigated, asking the user questions in order to compare the intended semantics of each method with its actual behavior until a wrong method is found out. The technique has been implemented in an available prototype. We comment the several new issues that arise when using this debugging technique, traditionally applied to declarative languages, to a completely different paradigm and propose several possible improvements and lines of future work.
workshop on recent trends in algebraic development techniques | 2009
Adrián Riesco; Alberto Verdejo; Rafael Caballero; Narciso Martí-Oliet
Declarative debugging is a semi-automatic technique that starts from an incorrect computation and locates a program fragment responsible for the error by building a tree representing this computation and guiding the user through it to find the wrong statement. This paper presents the fundamentals for the declarative debugging of rewriting logic specifications, realized in the Maude language, where a wrong computation can be a reduction, a type inference, or a rewrite. We define appropriate debugging trees obtained as the result of collapsing in proof trees all those nodes whose correctness does not need any justification. Since these trees are obtained from a suitable semantic calculus, the correctness and completeness of the debugging technique can be formally proved. We illustrate how to use the debugger by means of an example and succinctly describe its implementation in Maude itself thanks to its reflective and metalanguage features.
The Journal of Logic and Algebraic Programming | 2012
Adrián Riesco; Alberto Verdejo; Narciso Martí-Oliet; Rafael Caballero
Abstract Declarative debugging is a semi-automatic technique that starts from an incorrect computation and locates a program fragment responsible for the error by building a tree representing this computation and guiding the user through it to find the error. Membership equational logic ( MEL ) is an equational logic that in addition to equations allows one to state membership axioms characterizing the elements of a sort. Rewriting logic is a logic of change that extends MEL by adding rewrite rules, which correspond to transitions between states and can be nondeterministic. We propose here a calculus to infer reductions, sort inferences, normal forms, and least sorts with the equational subset of rewriting logic, and rewrites and sets of reachable terms through rules. We use an abbreviation of the proof trees computed with this calculus to build appropriate debugging trees for both wrong (an incorrect result obtained from an initial result) and missing answers (results that are erroneous because they are incomplete), whose adequacy for debugging is proved. Using these trees we have implemented Maude DDebugger, a declarative debugger for Maude, a high-performance system based on rewriting logic. We illustrate its use with an example.
international symposium on functional and logic programming | 1999
Rafael Caballero; Francisco Javier López-Fraguas
Parsing has been a traditional workbench for showing the virtues of declarative programming. Both logic and functional programming claim the ability of writing parsers in a natural and concise way. We address here the task from a functional-logic perspective. By modelling parsers as non-deterministic functions we achieve a very natural manner of building parsers, which combines the nicest properties of the functional and logic approaches. In particular, we are able to define parsers within our framework in a style very close to that of functional programming parsers, but using simpler concepts. Moreover, we have moved beyond usual declarative approaches to parsers, since the functional-logic parsers presented here can be considered as truly data values. As an example of this feature we define a function that detects ambiguous grammars.
semantics in data and knowledge bases | 2008
Rafael Caballero; Yolanda García-Ruiz; Fernando Sáenz-Pérez
The logic programming language Datalog has been extensively researched as a query language for deductive databases. Although similar to Prolog, the Datalog operational mechanisms are more intricate, leading to computations quite hard to debug by traditional approaches. In this paper, we present a theoretical framework for debugging Datalog programs based on the ideas of declarative debugging. In our setting, a debugging session starts when the user detects an unexpected answer for some query, and ends with the debugger pointing to either an erroneous predicate or to a set of mutually recursive predicates as the cause of the unexpected answer. Instead of representing the computations by means of trees, as usual in declarative debugging, we propose graphs as a more convenient structure in the case of Datalog, proving formally the soundness and completeness of the debugging technique. We also present a debugging tool implemented in the publicly available deductive database system DES following this theoretical framework.
international symposium on functional and logic programming | 2008
Rafael Caballero; Mario Rodríguez Artalejo; Rafael del Vado Vírseda
We present a declarative method for diagnosing missing computed answers in CFLP(D), a generic scheme for lazy Constraint Functional-Logic Programming which can be instantiated by any constraint domain D given as parameter. As far as we know, declarative diagnosis of missing answers in such an expressive framework has not been tackled before. Our approach combines and extends previous work done separately for constraint logic programming and lazy functional programming languages. Diagnosis can be started whenever a user finds that the set of computed answers for a given goal with finite search space misses some expected solution w.r.t. an intended interpretation of the program, that provides a declarative description of its expected behavior. Diagnosis proceeds by exploring a proof tree, that provides a declarative view of the answer-collection process performed by the computation, and it ends up with the detection of some function definition in the program that is incomplete w.r.t. the intended interpretation. We can prove the logical correctness of the diagnosis method under the assumption that the recollection of computed answers performed by the goal solving system can be represented as a proof tree. We argue the plausibility of this assumption, and we describe the prototype of a tool which implements the diagnosis method.
tests and proofs | 2013
Rafael Caballero; Enrique Martin-Martin; Adrián Riesco; Salvador Tamarit
Declarative debuggers are semi-automatic debugging tools that abstract the execution details to focus on the program semantics. Erroneous computations are represented by suitable trees, which are traversed by asking questions to the user until a bug is found. This paper applies declarative debugging to the sequential subset of the language Erlang. The debugger takes the intermediate representation generated by Erlang systems, known as Core Erlang, and an initial error detected by the user, and locates an erroneous program function responsible for the error. In order to represent the erroneous computation, a semantic calculus for sequential Core Erlang programs is proposed. The debugger uses an abbreviation of the proof trees of this calculus as debugging trees, which allows us to prove the soundness of the approach. The technique has been implemented in a debugger tool publicly available.