Results 21  30
of
36
A TypeBased Approach to Parallelization
 National University of Singapore
, 2003
"... Parallel programs can be synthesized from sequential functional programs via a technique known as context preservation [6]. This technique has significantly broadened the set of sequential programs eligible for parallelization. However, the ability to automatically detect functions which admit conte ..."
Abstract

Cited by 1 (1 self)
 Add to MetaCart
Parallel programs can be synthesized from sequential functional programs via a technique known as context preservation [6]. This technique has significantly broadened the set of sequential programs eligible for parallelization. However, the ability to automatically detect functions which admit contextpreservation property has not been investigated. In this paper, we propose a typebased approach to automatically detect a class of functions with contextpreservation property. In essence, our type system aims to detect an extendedring property of the subject program, from which context preservation is guaranteed. Through this type system, a sequential program can be automatically transformed to fit into a skeletal form, which can then be parallelized.
The expression lemma ⋆
"... Abstract. Algebraic data types and catamorphisms (folds) play a central role in functional programming as they allow programmers to define recursive data structures and operations on them uniformly by structural recursion. Likewise, in objectoriented (OO) programming, recursive hierarchies of objec ..."
Abstract

Cited by 1 (1 self)
 Add to MetaCart
(Show Context)
Abstract. Algebraic data types and catamorphisms (folds) play a central role in functional programming as they allow programmers to define recursive data structures and operations on them uniformly by structural recursion. Likewise, in objectoriented (OO) programming, recursive hierarchies of object types with virtual methods play a central role for the same reason. There is a semantical correspondence between these two situations which we reveal and formalize categorically. To this end, we assume a coalgebraic model of OO programming with functional objects. The development may be helpful in deriving refactorings that turn sufficiently disciplined functional programs into OO programs of a designated shape and vice versa. Key words: expression lemma, expression problem, functional object, catamorphism, fold, the composite design pattern, program calculation, distributive law, free monad, cofree comonad. 1
Structural recursion for querying ordered graphs
 In ICFP 2013
, 2013
"... Structural recursion, in the form of, for example, folds on lists and catamorphisms on algebraic data structures including trees, plays an important role in functional programming, by providing a systematic way for constructing and manipulating functional programs. It is, however, a challenge to de ..."
Abstract

Cited by 1 (1 self)
 Add to MetaCart
(Show Context)
Structural recursion, in the form of, for example, folds on lists and catamorphisms on algebraic data structures including trees, plays an important role in functional programming, by providing a systematic way for constructing and manipulating functional programs. It is, however, a challenge to define structural recursions for graph data structures, the most ubiquitous sort of data in computing. This is because unlike lists and trees, graphs are essentially not inductive and cannot be formalized as an initial algebra in general. In this paper, we borrow from the database community the idea of structural recursion on how to restrict recursions on infinite unordered regular trees so that they preserve the finiteness property and become terminating, which are desirable properties for query languages. We propose a new graph transformation language called FG for transforming and querying ordered graphs, based on the welldefined bisimulation relation on ordered graphs with special "edges. The language FG is a higher order graph transformation language that extends the simply typed lambda calculus with graph constructors and more powerful structural recursions, which is extended for transformations on the sibling dimension. It not only gives a general framework for manipulating graphs and reasoning about them, but also provides a solution to the open problem of how to define a structural recursion on ordered graphs, with the help of the bisimilarity for ordered graphs with "edges.
B[count++] = A[i];
"... / * copy all bigger elements from A[1..n] into B[] */ count = 0; for (i=0; i<n; i++) { sumAfter = 0; for (j=i+1; j<n; j++) { sumAfter + = A[j]; if (A[i]> sumAfter) ..."
Abstract
 Add to MetaCart
(Show Context)
/ * copy all bigger elements from A[1..n] into B[] */ count = 0; for (i=0; i<n; i++) { sumAfter = 0; for (j=i+1; j<n; j++) { sumAfter + = A[j]; if (A[i]> sumAfter)
unknown title
"... sumCP x = sum ’ x id ���� � sum ’ [] r = r 0 sum ’ (a:x) r = sum ’ x (\h−>a+(r h)) In short, if we define one program transformation, we might have to prepare two versions, one for arguments and the other for results. Such kinds of asymmetry disturb construction and manipulation programs. We have ..."
Abstract
 Add to MetaCart
(Show Context)
sumCP x = sum ’ x id ���� � sum ’ [] r = r 0 sum ’ (a:x) r = sum ’ x (\h−>a+(r h)) In short, if we define one program transformation, we might have to prepare two versions, one for arguments and the other for results. Such kinds of asymmetry disturb construction and manipulation programs. We have been suffering from them. What we need is a criterion that will be a guidepost so that we would not lose our way by these kinds of asymmetry. 3. IO SWAPPING Here we introduce a novel program transformation called IO swapping. IO swapping makes a new recursive function whose calltime computations (computations managed in arguments) and returntime computations (computations
Deterministic Higherorder Patterns for Program Transformation
, 2003
"... Higherorder patterns, together with higherorder matching, enable concise speci cation of program transformation, and have been implemented in several program transformation systems. However, higherorder matching generally generates nondeterministic matches, and the matching algorithm is so ex ..."
Abstract
 Add to MetaCart
(Show Context)
Higherorder patterns, together with higherorder matching, enable concise speci cation of program transformation, and have been implemented in several program transformation systems. However, higherorder matching generally generates nondeterministic matches, and the matching algorithm is so expensive that even secondorder matching is NPcomplete. It is orthodox to impose constraint on the form of patterns so as to obtain the desirable matches satisfying certain properties such as decidability and niteness. In the context of uni cation, Miller's higherorder patterns have a single most general uni er. We relax the restriction of his patterns without changing determinism in the context of matching instead of uni cation. As a consequence, our deterministic higherorder pattern (DHP) covers a wide class of useful patterns for program transformation. Our deterministic matching algorithm is ecient which is linear in the size of the term for a xed pattern.
Jorge Sousa Pinto
"... Abstract. Functional programs are particularly well suited to formal manipulation by equational reasoning. In particular, it is straightforward to use calculational methods for program transformation. Wellknown transformation techniques, like tupling or the introduction of accumulating parameters, ..."
Abstract
 Add to MetaCart
Abstract. Functional programs are particularly well suited to formal manipulation by equational reasoning. In particular, it is straightforward to use calculational methods for program transformation. Wellknown 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 pointfree 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 higherorder folds calculated systematically from a specification. The machinery of the calculus is expanded with higherorder pointfree 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. 1.
Catamorphic Approach to Program Analysis
, 2003
"... This paper proposes a new framework for program analysis that regards them as maximum marking problems: mark the codes of a program under a certain condition such that the number of marked nodes is maximum. We show that if one can develop an e#cient checking program (in terms of a finite catamorphi ..."
Abstract
 Add to MetaCart
(Show Context)
This paper proposes a new framework for program analysis that regards them as maximum marking problems: mark the codes of a program under a certain condition such that the number of marked nodes is maximum. We show that if one can develop an e#cient checking program (in terms of a finite catamorphism) whether marked programs are correctly marked, then an e#cient and incremental marking algorithm to analyze control flow of structured programs (say in C or Java with limited numbers of gotos) is obtained for free. To describe catamorphisms on control flow graphs, we present an algebraic construction, called SP Term, for graphs with bounded tree width. The transformation to SP Terms is done e#ciently in linear time. We demonstrate that our framework is powerful to describe various kinds of control flow analyses. Especially, for analyses in which some optimality is required (or expected), our approach has a big advantage.
A Case Study on a Modular Transformation Strategy
, 1999
"... this paper, we show that it is possible to minimize these deep insights. Our thesis is that the highlevel transformation techniques such as fusion, tupling, and generalization/accumulation can be well integrated to help provide a systematic and modular approach to calculate efficient programs, ..."
Abstract
 Add to MetaCart
this paper, we show that it is possible to minimize these deep insights. Our thesis is that the highlevel transformation techniques such as fusion, tupling, and generalization/accumulation can be well integrated to help provide a systematic and modular approach to calculate efficient programs, and thus the mild insights in our transformation are mainly confined to meet the conditions to facilitate transformation techniques
The Categorical Imperative  Or: How to Hide Your State Monads
"... . We demonstrate a systematic way of introducing state monads to improve the efficiency of data structures. When programs are expressed as transformations of abstract data types  which becomes possible by suitable definitions of ADTs and ADT fold operations, we can observe restricted usage pattern ..."
Abstract
 Add to MetaCart
(Show Context)
. We demonstrate a systematic way of introducing state monads to improve the efficiency of data structures. When programs are expressed as transformations of abstract data types  which becomes possible by suitable definitions of ADTs and ADT fold operations, we can observe restricted usage patterns for ADTs, and this can be exploited to derive (i) partial data structures correctly implementing the ADTs and (ii) imperative realizations of these partial data structures. With a library of ADTs together with (some of) their imperative implementations, efficient versions of functional programs can be obtained without being concerned or even knowing about state monads. As one example we demonstrate the optimization of a graph ADT resulting in an optimal imperative implementation of depthfirst search. 1 Introduction State monads are essentially used to (i) to make the passing of state through successive function calls more explicit and (ii) to enable the imperative implementation of updat...