Results 11  20
of
108
Elimination with a Motive
 Types for Proofs and Programs (Proceedings of the International Workshop, TYPES’00), volume 2277 of LNCS
, 2002
"... I present a tactic, BasicElim, for Type Theory based proof systems to apply elimination rules in a refinement setting. Applicable rules are parametric in their conclusion, expressing the leverage hypotheses ~x yield on any \Phi ~x we choose. \Phi represents the motive for an elimination: BasicElim' ..."
Abstract

Cited by 37 (12 self)
 Add to MetaCart
I present a tactic, BasicElim, for Type Theory based proof systems to apply elimination rules in a refinement setting. Applicable rules are parametric in their conclusion, expressing the leverage hypotheses ~x yield on any \Phi ~x we choose. \Phi represents the motive for an elimination: BasicElim's job is to construct a \Phi suited to the goal at hand. If these ~x inhabit an instance of \Phi's domain, I adopt a technique standard in `folklore', generalizing the ~x and expressing the restriction by equation. A novel notion of = readily permits dependent equations, and a second tactic, Unify, simpifies the equational hypotheses thus appearing in subgoals. Given such technology, it becomes effective to express properties of datatypes, relations and functions in this style. A small extension couples BasicElim with rewriting, allowing complex techniques to be packaged in a single rule. 1
On embedding a microarchitectural design language within Haskell
 In Proceedings of the ACM SIGPLAN International Conference on Functional Programming (ICFP ’99
, 1999
"... Based on our experience with modelling and verifying microarchitectural designs within Haskell, this paper examines our use of Haskell as host for an embedded language. In particular, we highlight our use of Haskell's lazy lists, type classes, lazy state monad, and unsafePerformIO, and point to seve ..."
Abstract

Cited by 34 (4 self)
 Add to MetaCart
Based on our experience with modelling and verifying microarchitectural designs within Haskell, this paper examines our use of Haskell as host for an embedded language. In particular, we highlight our use of Haskell's lazy lists, type classes, lazy state monad, and unsafePerformIO, and point to several areas where Haskell could be improved in the future. We end with an example of a benefit gained by bringing the functional perspective to microarchitectural modelling.
Strategic Pattern Matching
 Rewriting Techniques and Applications (RTA'99
, 1999
"... Stratego is a language for the specification of transformation rules and strategies for applying them. The basic actions of transformations are matching and building instantiations of firstorder term patterns. The language supports concise formulation of generic and data typespecific term traversa ..."
Abstract

Cited by 34 (7 self)
 Add to MetaCart
Stratego is a language for the specification of transformation rules and strategies for applying them. The basic actions of transformations are matching and building instantiations of firstorder term patterns. The language supports concise formulation of generic and data typespecific term traversals. One of the unusual features of Stratego is the separation of scope from matching, allowing sharing of variables through traversals. The combination of firstorder patterns with strategies forms an expressive formalism for pattern matching. In this paper we discuss three examples of strategic pattern matching: (1) Contextual rules allow matching and replacement of a pattern at an arbitrary depth of a subterm of the root pattern. (2) Recursive patterns can be used to characterize concisely the structure of languages that form a restriction of a larger language. (3) Overlays serve to hide the representation of a language in another (more generic) language. These techniques are illustrated by...
Practical predicate dispatch
, 2004
"... Predicate dispatch is an objectoriented (OO) language mechanism for determining the method implementation to be invoked upon a message send. With predicate dispatch, each method implementation includes a predicate guard specifying the conditions under which the method should be invoked, and logical ..."
Abstract

Cited by 34 (2 self)
 Add to MetaCart
Predicate dispatch is an objectoriented (OO) language mechanism for determining the method implementation to be invoked upon a message send. With predicate dispatch, each method implementation includes a predicate guard specifying the conditions under which the method should be invoked, and logical implication of predicates determines the method overriding relation. Predicate dispatch naturally unifies and generalizes several common forms of dynamic dispatch, including traditional OO dispatch, multimethod dispatch, and functionalstyle pattern matching. Unfortunately, prior languages supporting predicate dispatch have had several deficiencies that limit its utility in practice. We introduce JPred, a backwardcompatible extension to Java supporting predicate dispatch. While prior languages with predicate dispatch have been extensions to toy or nonmainstream languages, we show how predicate dispatch can be naturally added to a traditional OO language. While prior languages with predicate dispatch have required the whole program to be available for typechecking and compilation, JPred retains Java’s modular typechecking and compilation strategies. While prior languages with predicate dispatch have included specialpurpose algorithms for reasoning about predicates, JPred employs generalpurpose, offtheshelf decision procedures. As a result, JPred’s type system is more flexible, allowing several useful programming idioms that are spuriously rejected by those other languages. After describing the JPred language and type system, we present a case study illustrating the utility of JPred in a realworld application, including its use in the detection of several errors.
Promoting Rewriting to a Programming Language: A Compiler for NonDeterministic Rewrite Programs in AssociativeCommutative Theories
, 2001
"... Firstorder languages based on rewrite rules share many features with functional languages. But one difference is that matching and rewriting can be made much more expressive and powerful by incorporating some builtin equational theories. To provide reasonable programming environments, compilation ..."
Abstract

Cited by 30 (6 self)
 Add to MetaCart
Firstorder languages based on rewrite rules share many features with functional languages. But one difference is that matching and rewriting can be made much more expressive and powerful by incorporating some builtin equational theories. To provide reasonable programming environments, compilation techniques for such languages based on rewriting have to be designed. This is the topic addressed in this paper. The proposed techniques are independent from the rewriting language and may be useful to build a compiler for any system using rewriting modulo associative and commutative (AC) theories. An algorithm for manytoone AC matching is presented, that works efficiently for a restricted class of patterns. Other patterns are transformed to fit into this class. A refined data structure, namely compact bipartite graph, allows encoding all matching problems relative to a set of rewrite rules. A few optimisations concerning the construction of the substitution and of the reduced term are described. We also address the problem of nondeterminism related to AC rewriting and show how to handle it through the concept of strategies. We explain how an analysis of the determinism can be performed at compile time and we illustrate the benefits of this analysis for the performance of the compiled evaluation process. Then we briefly introduce the ELAN system and its compiler, in order to give some experimental results and comparisons with other languages or rewrite engines.
Functional Programming with Graphs
 2ND ACM SIGPLAN INT. CONF. ON FUNCTIONAL PROGRAMMING
, 1997
"... Graph algorithms expressed in functional languages often suffer from their inherited imperative, statebased style. In particular, this impedes formal program manipulation. We show how to model persistent graphs in functional languages by graph constructors. This provides a decompositional view of g ..."
Abstract

Cited by 29 (10 self)
 Add to MetaCart
Graph algorithms expressed in functional languages often suffer from their inherited imperative, statebased style. In particular, this impedes formal program manipulation. We show how to model persistent graphs in functional languages by graph constructors. This provides a decompositional view of graphs which is very close to that of data types and leads to a "more functional" formulation of graph algorithms. Graph constructors enable the definition of general fold operations for graphs. We present a promotion theorem for one of these folds that allows program fusion and the elimination of intermediate results. Fusion is not restricted to the elimination of treelike structures, and we prove another theorem that facilitates the elimination of intermediate graphs. We describe an MLimplementation of persistent graphs which efficiently supports the presented fold operators. For example, depthfirstsearch expressed by a fold over a functional graph has the same complexity as the corresp...
Unrolling lists
 In ACA4 Conference on Lisp and Functional Programming
, 1994
"... Lists are ubiquitous in functional programs, thus supporting lists efficiently is a major concern to compiler writers for functional languages. Lists are normally represented as linked cons cells, with each cons cell containing a car (the data) and a cdr (the link); this is inefficient in the use of ..."
Abstract

Cited by 27 (1 self)
 Add to MetaCart
Lists are ubiquitous in functional programs, thus supporting lists efficiently is a major concern to compiler writers for functional languages. Lists are normally represented as linked cons cells, with each cons cell containing a car (the data) and a cdr (the link); this is inefficient in the use of space, because 5070 of the storage is used for links. Loops and recursions on lists are slow on modern machines because of the long chains of control dependence (in checking for d) and data dependence (in fetching cdr fields). We present a data structure for “unrolled lists, ” where each cell has several data items (car fields) and one link (cdr). This reduces the memory used for links, and it significantly shortens the length of controldependence and datadependence chains in operations on lists. We further present an efficient compiletime analysis that transforms programs written for “ordinary ” lists into programs on unrolled lists. The use of our new representation requires no change to existing programs. We sketch the proof of soundness of our analysiswhich is based on refinement types—and present some preliminary measurements of our technique. 1
Generic views on data types
 In Tarmo Uustalu, editor, Proceedings 8th International Conference on Mathematics of Program Construction, MPC’06, volume 4014 of LNCS
, 2006
"... Abstract. A generic function is defined by induction on the structure of types. The structure of a data type can be defined in several ways. For example, in PolyP a pattern functor gives the structure of a data type viewed as a fixed point, and in Generic Haskell a structural representation type giv ..."
Abstract

Cited by 25 (9 self)
 Add to MetaCart
Abstract. A generic function is defined by induction on the structure of types. The structure of a data type can be defined in several ways. For example, in PolyP a pattern functor gives the structure of a data type viewed as a fixed point, and in Generic Haskell a structural representation type gives an isomorphic type view of a data type in terms of sums of products. Depending on this generic view on the structure of data types, some generic functions are easier, more difficult, or even impossible to define. Furthermore, the efficiency of some generic functions can be improved by choosing a different view. This paper introduces generic views on data types and shows why they are useful. Furthermore, it shows how generic views have been added to Generic Haskell, an extension of the functional programming language Haskell that supports the construction of generic functions. The separation between inductive definitions on type structure and generic views allows us to combine many approaches to generic programming in a single framework. 1