Results 1 - 10
of
11
The HERMIT in the Machine: A Plugin for the Interactive Transformation of GHC Core Language Programs
- In Haskell Symposium (Haskell ’12). ACM
, 2012
"... The importance of reasoning about and refactoring programs is a central tenet of functional programming. Yet our compilers and de-velopment toolchains only provide rudimentary support for these tasks. This paper introduces a programmatic and compiler-centric interface that facilitates refactoring an ..."
Abstract
-
Cited by 14 (9 self)
- Add to MetaCart
The importance of reasoning about and refactoring programs is a central tenet of functional programming. Yet our compilers and de-velopment toolchains only provide rudimentary support for these tasks. This paper introduces a programmatic and compiler-centric interface that facilitates refactoring and equational reasoning. To develop our ideas, we have implemented HERMIT, a toolkit en-abling informal but systematic transformation of Haskell programs from inside the Glasgow Haskell Compiler’s optimization pipeline. With HERMIT, users can experiment with optimizations and equa-tional reasoning, while the tedious heavy lifting of performing the actual transformations is done for them. HERMIT provides a transformation API that can be used to build higher-level rewrite tools. One use-case is prototyping new optimizations as clients of this API before being committed to the GHC toolchain. We describe a HERMIT application—a read-eval-print shell for performing transformations using HERMIT. We also demonstrate using this shell to prototype an optimization on a specific example, and report our initial experiences and remaining challenges. Categories and Subject Descriptors D.3.2 [Programming Lan-guages]: Language Classifications—Applicative (functional) lan-guages
General Bindings and Alpha-Equivalence in Nominal Isabelle
"... Abstract. Nominal Isabelle is a definitional extension of the Isabelle/HOL theorem prover. It provides a proving infrastructure for reasoning about programming language calculi involving named bound variables (as opposed to de-Bruijn indices). In this paper we present an extension of Nominal Isabell ..."
Abstract
-
Cited by 5 (1 self)
- Add to MetaCart
(Show Context)
Abstract. Nominal Isabelle is a definitional extension of the Isabelle/HOL theorem prover. It provides a proving infrastructure for reasoning about programming language calculi involving named bound variables (as opposed to de-Bruijn indices). In this paper we present an extension of Nominal Isabelle for dealing with general bindings, that means term-constructors where multiple variables are bound at once. Such general bindings are ubiquitous in programming language research and only very poorly supported with single binders, such as lambdaabstractions. Our extension includes new definitions of α-equivalence and establishes automatically the reasoning infrastructure for α-equated terms. We also prove strong induction principles that have the usual variable convention already built in. 1
Programs and Proofs Mechanizing Mathematics with Dependent Types Lecture Notes
, 2014
"... 1.1 Why yet another course on Coq?...................... 5 1.1.1 What this course is about...................... 7 ..."
Abstract
-
Cited by 3 (2 self)
- Add to MetaCart
1.1 Why yet another course on Coq?...................... 5 1.1.1 What this course is about...................... 7
A Theory of Name Resolution
"... Abstract. We describe a language-independent theory for name binding and resolution, suitable for programming languages with complex scop-ing rules including both lexical scoping and modules. We formulate name resolution as a two-stage problem. First a language-independent scope graph is constructed ..."
Abstract
-
Cited by 1 (0 self)
- Add to MetaCart
(Show Context)
Abstract. We describe a language-independent theory for name binding and resolution, suitable for programming languages with complex scop-ing rules including both lexical scoping and modules. We formulate name resolution as a two-stage problem. First a language-independent scope graph is constructed using language-specific rules from an abstract syn-tax tree. Then references in the scope graph are resolved to correspond-ing declarations using a language-independent resolution process. We introduce a resolution calculus as a concise, declarative, and language-independent specification of name resolution. We develop a resolution algorithm that is sound and complete with respect to the calculus. Based on the resolution calculus we develop language-independent definitions of α-equivalence and rename refactoring. We illustrate the approach us-ing a small example language with modules. In addition, we show how our approach provides a model for a range of name binding patterns in existing languages. 1
Reducing the Cost of Precise Types
, 2012
"... ii Programs involving precise types enforce more properties via type-checking, but precise types also prevent the reuse of functions throughout a program since no single precise type is used throughout a large program. My work is a step toward eliminating the underlying dilemma regarding type precis ..."
Abstract
- Add to MetaCart
(Show Context)
ii Programs involving precise types enforce more properties via type-checking, but precise types also prevent the reuse of functions throughout a program since no single precise type is used throughout a large program. My work is a step toward eliminating the underlying dilemma regarding type precision versus func-tion reuse. It culminates in a novel traversal operator that recovers the reuse by automating most of each conversion between “similar ” precise types, for a notion of similarity that I characterize in both the intuitive and technical senses. The benefits of my techniques are clear in side-by-side comparisons; in particular, I apply my techniques to two definitions of lambda-lifting. I present and imple-ment my techniques in the Haskell programming language, but the fundamental ideas are applicable to any statically- and strongly-typed programming functional language with algebraic data types. iii
about Programs
"... Direct reflection is a form of meta-programming in which program terms can intensionally analyze other program terms. Previous work defined a big-step semantics for a directly reflective language called Archon, with a conservative approach to variable scoping based on operations for opening a lambda ..."
Abstract
- Add to MetaCart
(Show Context)
Direct reflection is a form of meta-programming in which program terms can intensionally analyze other program terms. Previous work defined a big-step semantics for a directly reflective language called Archon, with a conservative approach to variable scoping based on operations for opening a lambda-abstraction and swapping the order of nested lambda-abstractions. In this short paper, we give a small-step semantics for a revised version of Archon, based on operations for opening and closing lambda abstractions. We then discuss challenges for designing a static type system for this language, which is our ultimate goal.
Modular Reifiable Matching A List-of-Functors Approach to Two-Level Types
"... This paper presents Modular Reifiable Matching (MRM): a new approach to two level types using a fixpoint of list-of-functors rep-resentation. MRM allows the modular definition of datatypes and functions by pattern matching, using a style similar to the widely popular Datatypes a ̀ la Carte (DTC) app ..."
Abstract
- Add to MetaCart
This paper presents Modular Reifiable Matching (MRM): a new approach to two level types using a fixpoint of list-of-functors rep-resentation. MRM allows the modular definition of datatypes and functions by pattern matching, using a style similar to the widely popular Datatypes a ̀ la Carte (DTC) approach. However, unlike DTC, MRM uses a fixpoint of list-of-functors approach to two-level types. This approach has advantages that help with various aspects of extensibility, modularity and reuse. Firstly, modular pat-tern matching definitions are collected using a list of matches that is fully reifiable. This allows for extensible pattern matching def-initions to be easily reused/inherited, and particular matches to be overridden. Such flexibility is used, among other things, to imple-ment extensible generic traversals. Secondly, the subtyping relation between lists of functors is quite simple, does not require back-tracking, and is easy to model in languages like Haskell. MRM is implemented as a Haskell library, and its use and applicability are illustrated through various examples in the paper.
Generic Datatypes a ̀ la Carte
"... Formal reasoning in proof assistants, also known as mechaniza-tion, has high development costs. Building modular reusable com-ponents is a key issue in reducing these costs. A stumbling block for reuse is that inductive definitions and proofs are closed to ex-tension. This is a manifestation of the ..."
Abstract
- Add to MetaCart
(Show Context)
Formal reasoning in proof assistants, also known as mechaniza-tion, has high development costs. Building modular reusable com-ponents is a key issue in reducing these costs. A stumbling block for reuse is that inductive definitions and proofs are closed to ex-tension. This is a manifestation of the expression problem that has been addressed by the Meta-Theory a ̀ la Carte (MTC) framework in the context of programming language meta-theory. However, MTC’s use of extensible Church-encodings is unsatisfactory. This paper takes a better approach to the problem with datatype-generic programming (DGP). It applies well-known DGP tech-niques to represent modular datatypes, to build functions from functor algebras with folds and to compose proofs from proof alge-bras by means of induction. Moreover, for certain functionality and proofs our approach can achieve more reuse than MTC: instead of composing modular components we provide a single generic defi-nition once and for all.