HERMIT: An Equational Reasoning Model to Implementation Rewrite System for Haskell (Invited Talk)

نویسنده

  • Andrew Gill
چکیده

HERMIT is a rewrite system for Haskell. Haskell, a pure functional programming language, is an ideal candidate for performing equational reasoning. Equational reasoning, replacing equals with equals, is a tunneling mechanism between different, but equivalent, programs. The ability to be agile in representation and implementation, but retain equivalence, brings many benefits. Post-hoc optimization is one obvious application of representation agility. What we want to explore is the mechanization of rewriting, inside real Haskell programs, enabling the prototyping of new optimizations, the explicit use of types to direct transformations, and perform larger data refinement tasks than are currently undertaken. Paper and pencil program transformations have been published that improve performance in a principled way; indeed some have turned the act of program transformation into an art form. But there is only so far a sheet of paper and a pencil can take you. There are also source code development environments that provide support for refactoring, such as HaRe. These work at the syntactical level, and Haskell is a large and complex language. What we want is mechanization, for examples that are currently undertaken by hand, and for examples that are challenging to perform using current development environments. In this talk, we overview HERMIT, the Haskell equational reasoning model to implementation tunnel. HERMIT operates at the Glasgow Haskell compiler’s Core level, deep inside GHC, where type information is easy to obtain, and the language being rewritten is smaller. HERMIT provides three levels of support for transformation and prototyping: a strategic programming base with many typed rewrite primitives, a simple shell that can used to interactively request rewrites and explore transformation possibilities, and a batch language that can mechanize focused, and optionally program specific, optimizations. We will demonstrate all three of these levels, and show how they cooperate. The explicit aim of the HERMIT project is to explore the worker/wrapper transformation as a specific way of mechanizing data refinement. HERMIT has been successfully used on small examples, efficient reverse, tupling-fib, and many other examples from the literature. We will show two larger and more interesting examples of program transformation using HERMIT. Specifically, we will show the mechanization of the making a century program refinement pearl, originally by Richard Bird, and the exploration of datatype alternatives in Graham Hutton’s implementation of John Conway’s Game of Life. 1998 ACM Subject Classification D.3.4 Translator writing systems and compiler generators

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

HERMIT: Mechanized Reasoning during Compilation in the Glasgow Haskell Compiler

It is difficult to write programs which are both correct and fast. A promising approach, functional programming, is based on the idea of using pure, mathematical functions to construct programs. With effort, it is possible to establish a connection between a specification written in a functional language, which has been proven correct, and a fast implementation, via program transformation. When...

متن کامل

Proving Safety Properties of Rewrite Theories

Rewriting logic theories are a general and expressive way of specifying concurrent systems, where states are axiomatized by equations and transitions among states are axiomatized by rewrite rules. In this paper, we present a transfor-mational and reductionistic deductive approach for verifying safety properties of rewrite theories. In our approach all formal temporal reasoning about concurrent ...

متن کامل

The Technology Behind a Graphical User Interface for an Equational Reasoning Assistant

The Haskell Equational Reasoning Assistant (HERA) is an application written in Haskell that helps users construct and present equational reasoning style proofs[1]. In this paper we discuss the technology behind the user interface.

متن کامل

Termination of Context-Sensitive Rewriting with Built-In Numbers and Collection Data Structures

Context-sensitive rewriting is a restriction of rewriting that can be used to elegantly model declarative specification and programming languages such as Maude. Furthermore, it can be used to model lazy evaluation in functional languages such as Haskell. Building upon previous work on constrained equational rewrite systems (CERSs), an expressive and elegant class of rewrite systems that contain...

متن کامل

Mixin Modules and Computational Effects

We define a calculus for investigating the interactions between mixin modules and computational effects, by combining the purely functional mixin calculus CMS with a monadic metalanguage supporting the two separate notions of simplification (local rewrite rules) and computation (global evaluation able to modify the store). This distinction is important for smoothly integrating the CMS rules (wh...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2014