43 research outputs found

    Strategic polymorphism requires just two combinators!

    Get PDF
    In previous work, we introduced the notion of functional strategies: first-class generic functions that can traverse terms of any type while mixing uniform and type-specific behaviour. Functional strategies transpose the notion of term rewriting strategies (with coverage of traversal) to the functional programming paradigm. Meanwhile, a number of Haskell-based models and combinator suites were proposed to support generic programming with functional strategies. In the present paper, we provide a compact and matured reconstruction of functional strategies. We capture strategic polymorphism by just two primitive combinators. This is done without commitment to a specific functional language. We analyse the design space for implementational models of functional strategies. For completeness, we also provide an operational reference model for implementing functional strategies (in Haskell). We demonstrate the generality of our approach by reconstructing representative fragments of the Strafunski library for functional strategies.Comment: A preliminary version of this paper was presented at IFL 2002, and included in the informal preproceedings of the worksho

    Models for the reverse engineering of Java/Swing applications

    Get PDF
    Interest in design and development of graphical user interface (GUIs) is growing in the last few years. However, correctness of GUI's code is essential to the correct execution of the overall software. Models can help in the evaluation of interactive applications by allowing designers to concentrate on its more important aspects. This paper describes our approach to reverse engineering abstract GUI models-based directly from the Java/Swing legacy code.Fundação para a Ciência e a Tecnologia(FCT) Fundo Europeu de Desenvolvimento Regional (FEDER

    Combining formal methods and functional strategies regarding the reverse engineering of interactive applications

    Get PDF
    Graphical user interfaces (GUIs) make software easy to use by providing the user with visual controls. Therefore, correctness of GUI’s code is essential to the correct execution of the overall software. Models can help in the evaluation of interactive applications by allowing designers to concentrate on its more important aspects. This paper describes our approach to reverse engineer an abstract model of a user interface directly from the GUI’s legacy code. We also present results from a case study. These results are encouraging and give evidence that the goal of reverse engineering user interfaces can be met with more work on this technique.Fundação para a Ciência e a Tecnologia (FCT) Fundo Europeu de Desenvolvimento Regional (FEDER

    Strategic polymorphism requires just two combinators!

    Get PDF
    In previous work, we introduced the notion of functional strategies: first-class generic functions that can traverse terms of any type while mixing uniform and type-specific behaviour. Functional strategies transpose the notion of term rewriting strategies (with coverage of traversal) to the functional programming paradigm. Meanwhile, a number of Haskell-based models and combinator suites were proposed to support generic programming with functional strategies. In the present paper, we provide a compact and matured reconstruction of functional strategies. We capture strategic polymorphism by just two primitive combinators. This is done without commitment to a specific functional language. We analyse the design space for implementational models of functional strategies. For completeness, we also provide an operational reference model for implementing functional strategies (in Haskell). We demonstrate the generality of our approach by reconstructing representative fragments of the Strafunski library for functional strategies

    Typed Multi-Language Strategy Combinators

    Get PDF

    Comparing Java Programs: Syntactic and Contextual Semantic Differences

    Get PDF
    This thesis describes the foundation for developing a tool that compares Java programs, or different versions of a program. The tool captures syntactic differences and contextual semantic differences as well. Syntactic differences are “ordinary” changes in the code. This tool works much in the same way as the Unix tool diff, but it is much smarter than diff. This is because it exploits the fact that programs are built differently than ordinary text. The tool diff’s purpose is to compare text, and it will therefore give imprecise or too verbose results. The tool described in this thesis can identify contextual semantic differences because it knows the contexts of methods, meaning that it knows whether methods are directly declared in the class, inherited from implemented interfaces or if methods override the class’ parent’s method. The approach in this thesis for comparing Java programs is to transform the programs into abstract syntax trees. The transformation from source code to abstract syntax trees are done with the help Strafunski. Strafunski is a software bundle that supports generic programming. The implementation of the tool is done in Haskell. Haskell is a functional programming language. The work of comparing abstract syntax trees can be broken down into the problem of finding the largest common subtree of two abstract syntax trees and further more, the problem of finding the longest common subsequence of two sequences. This thesis describes and presents new algorithms for doing this and it also describe working Haskell code of the implementation of the tool

    Strategic term rewriting and its application to a VDM-SL to SQL conversion

    Get PDF
    We constructed a tool, called VooDooM, which converts datatypes in Vdm-sl into Sql relational data models. The conversion involves transformation of algebraic types to maps and products, and pointer introduction. The conversion is specified as a theory of refinement by calculation. The implementation technology is strategic term rewriting in Haskell, as supported by the Strafunski bundle. Due to these choices of theory and technology, the road from theory to practise is straightforward.Fundação para a Ciência e a Tecnologia (FCT) - POSI/ICHS/44304/2002Agência de Inovação (ADI) - ∑!223

    Transformation of structure-shy programs : applied to XPath queries and strategic functions

    Get PDF
    Various programming languages allow the construction of structure-shy programs. Such programs are defined generically for many different datatypes and only specify specific behavior for a few relevant subtypes. Typical examples are XML query languages that allow selection of subdocuments without exhaustively specifying intermediate element tags. Other examples are languages and libraries for polytypic or strategic functional programming and for adaptive object-oriented programming. In this paper, we present an algebraic approach to transformation of declarative structure-shy programs, in particular for strategic functions and XML queries. We formulate a rich set of algebraic laws, not just for transformation of structure-shy programs, but also for their conversion into structure-sensitive programs and vice versa. We show how subsets of these laws can be used to construct effective rewrite systems for specialization, generalization, and optimization of structure-shy programs. We present a type-safe encoding of these rewrite systems in Haskell which itself uses strategic functional programming techniques.(undefined

    On the performance of strategic attribute grammars

    Get PDF
    Dissertação de mestrado integrado em Engenharia InformáticaStrategic programming is a powerful technique used in language processing to define functions that traverse abstract syntax trees. With strategies, the programmer only indicates the nodes of the tree where the work has to be done, and the strategy used to traverse the whole tree and apply the function that works only on the defined nodes. In Haskell, there are two libraries that implement strategies: Strafunski and an equivalent library developed by DI: Ztrategic. Beyond that, we also have the Kiama library which is implemented in the Scala programming language. The Ztrategic library uses memorization in order to save work. Using memorization, the elimination of all occurrences of "bad smells" in an abstract tree of a program is done only once! In this thesis, we present a detailed study of the performance of the Kiama, Ztrategic, and memoized Ztrategic libraries, using different strategic problems and input languages.Programação estratégica é uma técnica poderosa usada em processamento de linguagens para definir funções que atravessam árvores de sintaxe abstracta. Com estratégias o programador apenas indica os nodos da árvore onde o trabalho tem de ser feito, e depois que estratégia é utilizada para atravessar toda a árvore e aplicar a função que faz trabalho apenas nos nodos definidos. Em Haskell existem duas bibliotecas de combinadores que implementam estratégias: Strafunski e uma biblioteca equivalente desenvolvida no DI: Ztrategic. Existe também outra biblioteca desenvolvida em Scala, Kiama. A biblioteca Ztrategic usa memorização de modo a poupar trabalho. Usando memorização, a eliminação de todas a ocorrências do "mau cheiro" numa árvore abstracta de um programa é feita apenas uma vez! Nesta tese faz-se um estudo detalhado da performance das bibliotecas Kiama, Ztrategic, e memoized Ztrategic, utilizando diferentes problemas de programação estratégica e diferentes linguagens de input

    Refactoring = Substitution + Rewriting: Towards Generic, Language-Independent Refactorings

    Get PDF
    corecore