819,100 research outputs found

    Point-free program transformation

    Get PDF
    Functional programs are particularly well suited to formal manipulation by equational reasoning. In particular, it is straightforward to use calculational methods for program transformation. Well-known transformation techniques, like tupling or the introduction of accumulating parameters, can be implemented using calculation through the use of the fusion (or promotion) strategy. In this paper we revisit this transformation method, but, unlike most of the previous work on this subject, we adhere to a pure point-free calculus that emphasizes the advantages of equational reasoning. We focus on the accumulation strategy initially proposed by Bird, where the transformed programs are seen as higher-order folds calculated systematically from a specification. The machinery of the calculus is expanded with higher-order point-free operators that simplify the calculations. A substantial number of examples (both classic and new) are fully developed, and we introduce several shortcut optimization rules that capture typical transformation patterns.PresidĂȘncia do Conselho de Ministros - POSI/ICHS/44304/2002

    A framework for point-free program transformation

    Get PDF
    The subject of this paper is functional program transformation in the so-called point-free style. By this we mean first translating programs to a form consisting only of categorically-inspired combinators, algebraic data types defined as fixed points of functors, and implicit recursion through the use of type-parameterized recursion patterns. This form is appropriate for reasoning about programs equationally, but difficult to actually use in practice for programming. In this paper we present a collection of libraries and tools developed at Minho with the aim of supporting the automatic conversion of programs to point-free (embedded in Haskell), their manipulation and rule-driven simplification, and the (limited) automatic application of fusion for program transformation.Fundação para a CiĂȘncia e a Tecnologia (FCT

    Denotation by Transformation: Towards Obtaining a Denotational Semantics by Transformation to Point-free Style

    Get PDF
    It has often been observed that a point-free style of programming provides a more abstract view on programs. We aim to use the gain in abstraction to obtain a denotational semantics for functional logic languages in a straightforward way. Here we propose a set of basic operations based on which arbitrary functional logic programs can be transformed to point-free programs. The resulting programs are strict but, nevertheless, the semantics of the original program is preserved. There is a one-to-one mapping from the primitives introduced by the transformation to operations in relation algebra. This mapping can be extended to obtain a relation algebraic model for the whole program. This yields a denotational semantics which is on one hand closely related to point-free functional logic programs and on the other hand connects to the well developed field of algebraic logic including automatic proving

    Constraint-aware schema transformation

    Get PDF
    Ninth International Workshop on Rule-Based Programming (Rule 2008)Data schema transformations occur in the context of software evolution, refactoring, and cross-paradigm data mappings. When constraints exist on the initial schema, these need to be transformed into constraints on the target schema. Moreover, when high-level data types are refined to lower level structures, additional target schema constraints must be introduced to balance the loss of structure and preserve semantics. We introduce an algebraic approach to schema transformation that is constraint-aware in the sense that constraints are preserved from source to target schemas and that new constraints are introduced where needed. Our approach is based on refinement theory and point-free program transformation. Data refinements are modeled as rewrite rules on types that carry point-free predicates as constraints. At each rewrite step, the predicate on the reduct is computed from the predicate on the redex. An additional rewrite system on point-free functions is used to normalize the predicates that are built up along rewrite chains. We implemented our rewrite systems in a type-safe way in the functional programming language Haskell. We demonstrate their application to constraint-aware hierarchical-relational mappings.FCT -Fundação para a CiĂȘncia e a Tecnologia(SFRH/BD/30215/2006

    Automatic modular abstractions for template numerical constraints

    Full text link
    We propose a method for automatically generating abstract transformers for static analysis by abstract interpretation. The method focuses on linear constraints on programs operating on rational, real or floating-point variables and containing linear assignments and tests. In addition to loop-free code, the same method also applies for obtaining least fixed points as functions of the precondition, which permits the analysis of loops and recursive functions. Our algorithms are based on new quantifier elimination and symbolic manipulation techniques. Given the specification of an abstract domain, and a program block, our method automatically outputs an implementation of the corresponding abstract transformer. It is thus a form of program transformation. The motivation of our work is data-flow synchronous programming languages, used for building control-command embedded systems, but it also applies to imperative and functional programming

    A Generalization of Short-Cut Fusion and Its Correctness Proof

    Get PDF
    Short-cut fusion is a program transformation technique that uses a single local transformation - called the foldr build rule - to remove certain intermediate lists from modularly constructed functional programs. Arguments that short-cut fusion is correct typical appeal either to intuition or to "free theorems" - even though the latter have not been known to hold for the languages supporting higher-order polymorphic functions and fixed point recursion in which short-cut fusion is usually applied. In this paper we use Pitts' recent demonstration that contextual equivalence in such languages is relationally parametric to prove that programs in them which have undergone short-cut fusion are contextually equivalent to their unfused counterparts. For each algebraic data type we then define a generalization of build which constructs substitution instances of its associated data structures, and use Pitts' techniques to prove the correctness of a contextual equivalence-preserving fusion rule which generalizes short-cut fusion. These rules optimize compositions of functions that uniformly consume algebraic data structures with functions that uniformly produces substitution instances of those data structures

    THE GOVERNMENT COMMITMENT TO QUALITY EDUCATION - AN OVERVIEW OF FREE QUALITY SCHOOL EDUCATION IN SIERRA LEONE

    Get PDF
    The Free Quality School Education (FQSE) is a critical priority policy of the Government of Sierra Leone for national transformation through education. The Government of Sierra Leone is aware of the influence and power of education in national development and, therefore, has prioritized education as its flagship program. This paper is to establish a positive effort made by the Government of Sierra Leone in its commitment to implement and bring to reality the Free Quality School Education countrywide. The paper introduced in brief the historical flashback of education in Sierra Leone, followed by the changes in the education system. The researcher viewed some problems of education in Sierra Leone over the years. In an overview, the paper went on to demonstrate the Government's effort in promoting education since independence in 1961. As a point of clarification, the paper reviewed the knowledge of Quality Education. In a clearer picture, the paper views the result and analysis of Government commitment in the Free Quality School Education. The methods used for the research were interviews, observation, discussion, and information from the internet and books (secondary data). The paper highlighted the conclusion with recommendations.  Article visualizations

    Short Cut Fusion: Proved and Improved

    Get PDF
    Short cut fusion is a particular program transformation technique which uses a single, local transformation — called the foldrbuild rule — to remove certain intermediate lists from modularly constructed functional programs. Arguments that short cut fusion is correct typically appeal either to intuition or to “free theorems” — even though the latter have not been known to hold for the languages supporting higher-order polymorphic functions and fixed point recursion in which short cut fusion is usually applied. In this paper we use Pitts’ recent demonstration that contextual equivalence in such languages is relationally parametric to prove that programs in them which have undergone short cut fusion are contextually equivalent to their unfused counterparts. The same techniques in fact yield a much more general result. For each algebraic data type we define a generalization augment of build which constructs substitution instances of its associated data structures. Together with the well-known generalization cata of folder to arbitrary algebraic data types, this allows us to formulate and prove correct for each a contextual equivalence-preserving cata-augment fusion rule. These rules optimize compositions of functions that uniformly consume algebraic data structures with functions that uniformly produce substitution instances of them

    Strongly typed rewriting for coupled software transformation

    Get PDF
    Coupled transformations occur in software evolution when multiple artifacts must be modified in such a way that they remain consistent with each other. An important example involves the coupled transformation of a data type, its instances, and the programs that consume or produce it. Previously, we have provided a formal treatment of transformation of the first two: data types and instances. The treatment involved the construction of type-safe, type-changing strategic rewrite systems. In this paper, we extend our treatment to the transformation of corresponding data processing programs. The key insight underlying the extension is that both data migration functions and data processors can be represented type-safely by a generalized abstract data type (GADT). These representations are then subjected to program calculation rules, harnessed in type-safe, type-preserving strategic rewrite systems. For ease of calculation, we use point-free representations and corresponding calculation rules. Thus, coupled transformations are carried out in two steps. First, a type-changing rewrite system is applied to a source type to obtain a target type together with (representations of) migration functions between source and target. Then, a type-preserving rewrite system is applied to the composition of a migration function and a data processor on the source (or target) type to obtain a data processor on the target (or source) type. All rewrites are type-safe.Fundação para a CiĂȘncia e a Tecnologia (FCT) - POSI/ICHS/44304/2002
    • 

    corecore