CONTENTS

INTRODUCTION

1. BASIC REFAL

1.1 A simple function definition

1.2 Symbols and expressions

1.3 Pattern matching

1.4 Sentences and programs

1.5 The abstract Refal machine

1.6 More examples of functions

2. REFAL IN COMPUTERS

2.1 How to run it

2.2 Program modules

2.3 Input-Output

2.4 Representation of Refal expressions

2.5 The algorithm of pattern matching

3. BASIC PROGRAMMING TECHNIQUES

3.1 Brackets as pointers

3.2 Function formats

3.3 Implicit and explicit recursion

3.4 Duplication of variables

3.5 Breaking algorythms into functions

3.6 Recurtion and iteration

3.7 Dealing with nested parentheses

4. EXTENDED REFAL

4.1 Conditions

4.2 Blocks

4.3 The Bury-Dig functions

5. PROGRAM DEVELOPMENT

5.1 Missioners and cannibales

5.2 Sorting algorythms

5.3 Paths in graph

5.4 Translation of arithmetic expressions

6. METASYSTEM TRANSITION

6.1 Metafunction Mu

6.2 Metacode

6.3 Evaluator

6.4 Freezer

ANSWERS TO EXERCISES

REFERENCE MANUAL

A. Instalation and use for IBM XT/AT

B. Syntax summary

C. Built-in functions

D. Refal tracer

INDEX