1,148 research outputs found

    How functional programming mattered

    Get PDF
    In 1989 when functional programming was still considered a niche topic, Hughes wrote a visionary paper arguing convincingly ‘why functional programming matters’. More than two decades have passed. Has functional programming really mattered? Our answer is a resounding ‘Yes!’. Functional programming is now at the forefront of a new generation of programming technologies, and enjoying increasing popularity and influence. In this paper, we review the impact of functional programming, focusing on how it has changed the way we may construct programs, the way we may verify programs, and fundamentally the way we may think about programs

    Narrowing-based Optimization of Rewrite Theories

    Full text link
    Partial evaluation has been never investigated in the context of rewrite theories that allow concurrent systems to be specified by means of rules, with an underlying equational theory being used to model system states as terms of an algebraic data type. In this paper, we develop a symbolic, narrowing-driven partial evaluation framework for rewrite theories that supports sorts, subsort overloading, rules, equations, and algebraic axioms. Our partial evaluation scheme allows a rewrite theory to be optimized by specializing the plugged equational theory with respect to the rewrite rules that define the system dynamics. This can be particularly useful for automatically optimizing rewrite theories that contain overly general equational theories which perform unnecessary computations involving matching modulo axioms, because some of the axioms may be blown away after the transformation. The specialization is done by using appropriate unfolding and abstraction algorithms that achieve significant specialization while ensuring the correctness and termination of the specialization. Our preliminary results demonstrate that our transformation can speed up a number of benchmarks that are difficult to optimize otherwise.This work has been partially supported by the EU (FEDER) and the Spanish MCIU under grant RTI2018094403-B-C32,andbyGeneralitatValencianaundergrantPROMETEO/2019/098. JuliaSapiñahasbeensupported by the Generalitat Valenciana APOSTD/2019/127 grantAlpuente Frasnedo, M.; Ballis, D.; Escobar Román, S.; Sapiña Sanchis, J. (2020). Narrowing-based Optimization of Rewrite Theories. Universitat Politècnica de València. http://hdl.handle.net/10251/14557

    A partial evaluation methodology for optimizing rewrite theories incrementally

    Get PDF
    Partial evaluation (PE) is a branch of computer science that achieves code optimization via specialization. This article describes a PE methodology for optimizing rewrite theories that encode concurrent as well as nondeterministic systems by means of the Maude language. The main advantages of the proposed methodology can be summarized as follows: • An automatic program optimization technique for rewrite theories featuring several PE criteria that support the specialization of a broad class of rewrite theories. • An incremental partial evaluation modality that allows the key specialization components to be encapsulated at the desired granularity level to facilitate progressive refinements of the specialization. • All executability theory requirements are preserved by the PE transformation. Also the transformation ensures the semantic equivalence between the original rewrite theory and the specialized theory under rather mild conditions

    A Partial Evaluation Framework for Order-sorted Equational Programs modulo Axioms

    Full text link
    [EN] Partial evaluation is a powerful and general program optimization technique with many successful applications. Existing PE schemes do not apply to expressive rule-based languages like Maude, CafeOBJ, OBJ, ASF+SDF, and ELAN, which support: 1) rich type structures with sorts, subsorts, and overloading; and 2) equational rewriting modulo various combinations of axioms such as associativity, commutativity, and identity. In this paper, we develop the new foundations needed and illustrate the key concepts by showing how they apply to partial evaluation of expressive programs written in Maude. Our partial evaluation scheme is based on an automatic unfolding algorithm that computes term variants and relies on high-performance order-sorted equational least general generalization and order-sorted equational homeomorphic embedding algorithms for ensuring termination. We show that our partial evaluation technique is sound and complete for convergent rewrite theories that may contain various combinations of associativity, commutativity, and/or identity axioms for different binary operators. We demonstrate the effectiveness of Maude's automatic partial evaluator, Victoria, on several examples where it shows significant speed-ups. (C) 2019 Elsevier Inc. All rights reserved.This work has been partially supported by the EU (FEDER) and the Spanish MCIU under grant RTI2018-094403-B-C32, by Generalitat Valenciana under grant PROMETEO/2019/098, and by NRL under contract number N00173-17-1-G002. Angel Cuenca-Ortega has been supported by the SENESCYT, Ecuador (scholarship program 2013).Alpuente Frasnedo, M.; Cuenca-Ortega, AE.; Escobar Román, S.; Meseguer, J. (2020). A Partial Evaluation Framework for Order-sorted Equational Programs modulo Axioms. Journal of Logical and Algebraic Methods in Programming. 110:1-36. https://doi.org/10.1016/j.jlamp.2019.100501S13611

    A complete transformational toolkit for compilers

    Get PDF
    In an earlier paper, one of the present authors presented a preliminary account of an equational logic called PIM. PIM is intended to function as a 'transformational toolkit' to be used by compilers and analysis tools for imperative languages, and has been applied to such problems as program slicing, symbolic evaluation, conditional constant propagation, and dependence analysis. PIM consists of the untyped lambda calculus extended with an algebraic rewriting system that characterizes the behavior of lazy stores and generalized conditionals. A major question left open in the earlier paper was whether there existed a complete equational axiomatization of PIM's semantics. In this paper, we answer this question in the affirmative for PIM's core algebraic component, PIMt, under the assumption of certain reasonable restrictions on term formation. We systematically derive the complete PIM logic as the culmination of a sequence of increasingly powerful equational systems starting from a straightforward 'interpreter' for closed PIM terms

    Towards a complete transformational toolkit for compilers

    Get PDF
    PIM is an equational logic designed to function as a ``transformational toolkit'' for compilers and other programming tools that analyze and manipulate imperative languages.It has been applied to such problems as program slicing, symbolic evaluation, conditional constant propagation, and dependence analysis.PIM consists of the untyped lambda calculus extended with an algebraic data type that characterizes the behavior of lazy stores and generalized conditionals.A graph form of PIM terms is by design closely related to several intermediate representations commonly used in optimizing compilers. In this paper, we show that PIM's core algebraic component, PIMt_t, possesses a complete equational axiomatization (under the assumption of certain reasonable restrictions on term formation). This has the practical consequence of guaranteeing that every semantics-preserving transformation on a program representable in PIMt_t can be derived by application of PIMt_t rules. We systematically derive the complete PIMt_t logic as the culmination of a sequence of increasingly powerful equational systems starting from a straightforward ``interpreter'' for closed PIMt_t terms. This work is an intermediate step in a larger program to develop a set of well-founded tools for manipulation of imperative programs by compilers and other systems that perform program analysis

    Order-sorted Homeomorphic Embedding modulo Combinations of Associativity and/or Commutativity Axioms

    Full text link
    [EN] The Homeomorphic Embedding relation has been amply used for defining termination criteria of symbolic methods for program analysis, transformation, and verification. However, homeomorphic embedding has never been investigated in the context of order-sorted rewrite theories that support symbolic execution methods modulo equational axioms. This paper generalizes the symbolic homeomorphic embedding relation to order-sorted rewrite theories that may contain various combinations of associativity and/or commutativity axioms for different binary operators. We systematically measure the performance of different, increasingly efficient formulations of the homeomorphic embedding relation modulo axioms that we implement in Maude. Our experimental results show that the most efficient version indeed pays off in practice.M. Alpuente and S. Escobar have been partially supported by the EU (FEDER) and the Spanish MCIU under grant RTI2018-094403-B-C32, by the Spanish Generalitat Valenciana under grant PROMETEO/2019/098, and by the European Union's Horizon 2020 research and innovation programme under grant agreement No. 952215 (TAILOR). J. Meseguer has been supported by NRL under contract number N00173-17-1-G002. A. Cuenca-Ortega has been supported by the SENESCYT, Ecuador (scholarship program 2013).Alpuente Frasnedo, M.; Cuenca-Ortega, A.; Escobar Román, S.; Meseguer, J. (2020). Order-sorted Homeomorphic Embedding modulo Combinations of Associativity and/or Commutativity Axioms. Fundamenta Informaticae. 177(3-4):297-329. https://doi.org/10.3233/FI-2020-1991S2973291773-
    • …
    corecore