Users Guide: a Resource Analysis for Hume

Revision History
Revision $Revision: 1.3 $28 Aug 2009Revised by: hwl
Version for Summer School on Advances in Programming Languages

Table of Contents
1. Introduction
2. A Quick Introduction to Using the Resource Analysis for Hume
2.1. Basic Usage
3. Worked Examples of Hume Resource Analysis
3.1. Integer Examples
3.2. List Examples
3.3. Operations on Trees
3.3.1. Insertion into a Red-Black Tree
3.4. Box-level examples
3.4.1. Multiplication by recursion
3.4.2. Multiplication by iteration
3.4.3. Vending machine
4. Advanced Features of the Resource Analysis
4.1. Elaboration Module
4.1.1. Optimizing the bound for red-black tree insertion
5. Options to the Resource Analysis for Hume
5.1. List of Options
5.2. Notes on Numeric Potential
5.3. Signals
6. Internal aspects of the Resource Analysis
6.1. Translation from Hume to Schopenhauer
6.1.1. Input language restrictions
6.1.2. Limitations of the translation
6.2. Cost tables
6.3. Hume Abstract Machine
7. System
8. Getting the Resource Analysis
8.1. On-line resource analysis
8.2. Installing
8.3. Emacs Hume Mode
8.4. Hume example programs
9. Compiling Hume Programs

This document gives guidance on how to use the amortised-cost based resource analysis for Hume. This is a very early draft.

1. Introduction

A central design goal for Hume is the predictability of resources. The main tool that is provided to the developer of Hume programs is a static analysis, inferring bounds on resource consumption. Resources that can be handled are heap, stack, execution-time and function calls.

This document aims to give guidance on how to use the resource analysis for Hume. It is not an introduction to Hume programming, nor does it discuss the techniques used in the analysis to deliever these bounds.

Other useful resources on Hume are:

In this document we first give a quick introduction how to analyse Hume programs (Section 2). More detailed worked examples explain how to interpret the results of the analysis and how to use them in developing the Hume code (Section 3). Advanced features of the resource analysis, in particular helping to explain the result of the analysis, are discussed in Section 4. The options available to the analysis are discussed in Section 5. Internal aspects of the analysis that might be of relevance to the user are discussed in Section 6. Finally, we give information on the system including profiling, tools etc (Section 7). Information on how to install the analysis is available in Section 8. Information on how to compile and run Hume programs is available in Section 9.