image

A++ and the Lambda Calculus

Georg P. Loczewski

image

A++ and the Lambda Calculus

Principles of Functional Programming

image

IMPRESSUM

Copyright ©2018 Georg P. Loczewski

A++ and the Lambda Calculus

The book was set by the author using the LATEX typesetting system and was printed and bound in the Federal Republic of Germany.

1st. Edition 2018

tredition GmbH, Hamburg

ISBN

978-3-7469-3811-0 (Paperback)

978-3-7469-3809-7 (Hardcover)

978-3-7469-3810-3 (e-Book)

See also A++ The Smallest Programming Language in the World[29]

The author and publisher make no warranty of any kind, expressed or implied, with regard to these programs or the documentation contained in this book. The author and publisher shall not be liable in any event for incidental or consequential damages in connection with the use of these programs.

All rights reserved. No part of this book may be reproduced in any form by any electronic or mechanical means (including photocopying, recording, or information storage and retrieval) without permission in writing from the publisher and the author.

The book was set by the author using the LATEX typesetting system and was printed and bound in the Federal Republic of Germany.

To my wife Ursula and my sons Thomas and Johannes dedicated in love.

image

Contents

I The Lambda Calculus

1 Introduction

1.1 Origin

1.2 Definition

1.3 Literature

1.4 Syntax of Lambda Expressions

2 Basic Rules for Lambda Conversions

2.1 Notation used in Conversion Rules

2.1.1 Notation used to specify conversion of lambda expressions

2.1.2 Notation used to specify substitution

2.2 Alpha Conversion

2.2.1 Rules of Alpha Conversion

2.2.2 Beta Conversion

2.2.3 Rule of β-Conversion

2.2.4 β-Reduction

2.2.5 β-Abstraction

2.3 Eta Conversion

2.3.1 η-Reduction

2.3.2 η-Abstraction

2.4 Rules of Associativity

2.4.1 Rule of Associativity for Abstraction

2.4.2 Rule of Associativity for Application

2.4.3 Example for both rules:

2.5 Y-Combinator

2.5.1 Using the Y-Combinator to implement recursion

II A++

1 Introduction to A++

1.1 Purpose of A++ and Origin

1.1.1 Purpose

1.1.2 Origin

1.1.3 ARS — Generalization of the Lambda-Calculus

1.1.4 Name of the language

1.2 Motivations for the development of A++

1.2.1 To support an alternate method of teaching the principles of programming

1.2.2 To provide a learning tool for exploring the fundamentals of programming

1.2.3 To support a method teaching powerful programming patterns applicable to most languages

1.2.4 To open a new view of programming for many programmers:

1.3 Features of A++

1.3.1 Programming paradigms supported:

1.3.2 Constitutive Principles of A++

1.3.3 Closure

1.3.4 Basic abstractions derived from ARS

1.3.5 Development of Applications with A++

1.4 Internal Architecture of A++

1.4.1 Overview

1.4.2 Internal Structure Overview (commented version)

1.4.3 Syntax of ARS (A++)

1.4.4 Definition of A++ in the form of a Tree Diagram

1.4.5 Commenting the definition:

1.4.6 Examples of A++ - Syntax

2