15 research outputs found

    Structure and Properties of Traces for Functional Programs

    Get PDF
    The tracer Hat records in a detailed trace the computation of a program written in the lazy functional language Haskell. The trace can then be viewed in various ways to support program comprehension and debugging. The trace was named the augmented redex trail. Its structure was inspired by standard graph rewriting implementations of functional languages. Here we describe a model of the trace that captures its essential properties and allows formal reasoning. The trace is a graph constructed by graph rewriting but goes beyond simple term graphs. Although the trace is a graph whose structure is independent of any rewriting strategy, we define the trace inductively, thus giving us a powerful method for proving its properties

    Higher-order lazy functional slicing

    Get PDF
    Program slicing is a well known family of techniques intended to identify and isolate code fragments which depend on, or are depended upon, specific program entities. This is particularly useful in the areas of reverse engineering, program understanding, testing and software maintenance. Most slicing methods, and corresponding tools, target either the imperative or the object oriented paradigms, where program slices are computed with respect to a variable or a program statement. Taking a complementary point of view, this paper focuses on the slicing of higher-order functional programs under a lazy evaluation strategy. A prototype of a Haskell slicer, built as proof-of-concept for these ideas, is also introduced

    Slicing Condicional de Programas Funcionales

    Full text link
    La fragmentación o slicing de programas es un método para aislar partes de un programa que potencialmente afectan al valor computado en un punto de interés, conocido como criterio de slicing. Esta técnica fue ampliamente utilizada e investigada en el paradigma imperativo, pero no ha recibido la misma atención en el contexto declarativo. La técnica denominada slicing condicional brinda un marco común para la realización de slicing y es relevante debido a que subsume al slicing estático y dinámico. Este tipo de descomposición no ha sido definida en el paradigma declarativo. En este trabajo definimos y proponemos un algoritmo para calcular slices condicionales en lenguajes funcionales de primer orden.Cheda, D. (2008). Slicing Condicional de Programas Funcionales. http://hdl.handle.net/10251/12304Archivo delegad

    A Lightweight Hat: Simple Type-Preserving Instrumentation for Self-Tracing Lazy Functional Programs

    Get PDF
    Existing methods for generating a detailed trace of a computation of a lazy functional program are complex. These complications limit the use of tracing in practice. However, such a detailed trace is desirable for understanding and debugging a lazy functional program. Here we present a lightweight method that instruments a program to generate such a trace, namely the augmented redex trail introduced by the Haskell tracer Hat. The new method is a major step towards an omniscient debugger for real-world Haskell programs

    Imperative functional programs that explain their work

    Get PDF
    Program slicing provides explanations that illustrate how program outputs were produced from inputs. We build on an approach introduced in prior work by Perera et al., where dynamic slicing was defined for pure higher-order functional programs as a Galois connection between lattices of partial inputs and partial outputs. We extend this approach to imperative functional programs that combine higher-order programming with references and exceptions. We present proofs of correctness and optimality of our approach and a proof-of-concept implementation and experimental evaluation.Comment: Full version of ICFP 2017 paper, with appendice

    Run-time debugging for functional logic languages

    Get PDF
    This thesis describes the design, implementation and use of a run-time debugging tool for understanding the lazy semantics and locating failures in the functional logic language Curry. We provide a means for programmers to step in the evaluation order of program expressions at a source code level. Every expression evaluated is detected by a program coverage in a layout of the source code. Its run-time value can be represented to the user. The user can stop the execution of a program whenever he or she chooses to do so. A means to backward stepping is also provided. For large programs, we record only partial computations that are generated by evaluating selected expressions from the user. To achieve these means, we suggest and use some annotations in programs. Repre- sentation of intermediate steps of evaluations in a single-step mode is also provided by a distributed programming technique. Stepping in the real order of lazy evaluations could be helpful in searching for failures in simple programs and to beginners in understanding the behavior of functions in functional logic languages

    An Analysis of the Current Program Slicing and Algorithmic Debugging Based Techniques

    Full text link
    This thesis presents a classification of program slicing based techniques. The classification allows us to identify the differences between existing techniques, but it also allows us to predict new slicing techniques. The study identifies and compares the dimensions that influence current techniques.Silva Galiana, JF. (2008). An Analysis of the Current Program Slicing and Algorithmic Debugging Based Techniques. http://hdl.handle.net/10251/14300Archivo delegad

    Una aproximación offline a la evaluación parcial dirigida por narrowing

    Full text link
    La evaluación parcial dirigida por narrowing (NPE: Narrowing-driven Partial Evaluation) es una técnica potente para la especialización de sistemas de reescritura, i.e., para el componente de primer orden de muchos lenguajes declarativos (lógico) funcionales como Haskell, Curry o Toy. Los evaluadores parciales se clasifican en dos grandes categorías: online y offline, de acuerdo al momento temporal en que se consideran los aspectos de terminación del proceso de especialización. Los evaluadores parciales online son usualmente más precisos ya que tienen más información disponible. Los evaluadores parciales offline proceden comúnmente en dos etapas; la primera etapa procesa un programa (e.g., para identificar aquellas llamadas a función que se pueden desplegar sin riesgo de no terminación) e incluye anotaciones para guiar las computaciones parciales; entonces, una segunda etapa, la de evaluación parcial propiamente dicha, sólo tiene que obedecer las anotaciones y por tanto el especializador es mucho más rápido que en la aproximación online. En esta tesis se presenta un nuevo esquema de evaluación parcial dirigido por narrowing, más eficiente y que asegura la terminación siguiendo el estilo offline. Para ello, identificamos una caracterización de programas cuasi-terminantes a los que llamamos "no crecientes". En tales programas, las computaciones por narrowing necesario presentan sólo un conjunto finito de términos diferentes (módulo renombramiento de variables). La propiedad de la cuasi-terminación es importante toda vez que su presencia es regularmente una condición suficiente para la terminación del proceso de especialización. Sin embargo, la clase de programas cuasi-terminantes es muy restrictiva, por lo que introducimos un algoritmo que acepta programas inductivamente secuenciales---una clase mucho más amplia sobre la que está definido el narrowing necesario---y anota aquellas partes que violan la caracterización de programas no crecientes. Para procesar de maneRamos Díaz, JG. (2007). Una aproximación offline a la evaluación parcial dirigida por narrowing [Tesis doctoral no publicada]. Universitat Politècnica de València. https://doi.org/10.4995/Thesis/10251/1888Palanci
    corecore