# ΔΛ (Delta-Lambda)

## Introduction :

This language is a test language for an implementation of the type system ΔΛ (Delta-Lambda) described by de Bruijn for simplifying the semantics of his Automath project.
Eventually I will post the Coq/Idris/Agda/etc... proofs for the compliance of the code to the inferential rules specified by [De Groote].

## Syntax :

The syntax is expressed in [EBNF].

### expression syntax

```
Expression = 'type'
| Identifier
| '(' , Expression , { ',' , Expression } , ')' , Expression
| '[' , Declaration , { ',' , Declaration } , ']' , Expression
;
Declaration = [ Identifier , { ',' , Identifier } ] ':' Expression
;
```

## Semantics :

the semantics of delta-lambda are fairly simple, and involve inductive definitions on the structure of expressions. We will step through the inductive relations on terms and describe them in detail. We assume that beta equivalence is known to be the reflexive transitive symmetric closure of beta reduction, which is defined as normal. the notation `[x := A]B`

is used to represent substitution, which also takes on the typical meaning (pedants may examine de Bruijn's paper)

here are the relations (the names of which are the same in the code):
1. typeOf
* the typeOf function produces the type of a term, by replacing the tail variable with it's type

typeOf[context, x] = A if [x : A] in context

typeOf[context, (A) B] = (A) typeOf[context, B]

typeOf[context, [x : A] B] = [x: A] typeOf[[x : A] context, B])

ftype

ftype[context, A] = A if tail[A] is type

ftype[context, A] = typef[context, typeOf[context, A]] if tail[A] is not type

tail

tail[type] = type

tail[x] = x

tail[(A) B] = tail[B]

tail[[x : A] B] = tail[B]

correct

correct[context, type] = true

correct[context, x] = true iff (x A) in context, else false

correct[context, [x : A] B] = correct[context, A] and correct[[x : A] context, B]

correct[context, (A) B] = correct[B] and typing[context, A] is beta equivalent to some [x : C] D and typeOf[context, B] is beta equivalent to C and correct[context, [x := B]D]

It must be reiterated that proofs of the conformance of these structural relations on Expressions have not been written yet, as the relations are not simply recursive, so a proof in Coq/Agda/Idris/etc... will be very difficult
Also note that the code does not exactly follow this formalism.

## References :

Generalising Automath by Means of a Lambda-Typed Lambda Calculus Keuker, D.W., Lopez-Escobar, E.G.K. and Smith, C.H., eds., *Mathematal Logic and Theoretical Computer Science*, pp. 71-92, by courtesy of Marcel Dekker Inc., New York.

Reveiwing the Classical and the de Bruijn Notation for lambda-calculus and Pure Type Systems *J. Logic Computat*., Vol 11 No. 3, pp. 363-394, Oxford University Press.

Defining λ-Typed λ-Calculi by Axiomatizing the Typing Relation P. Enjalbert, A. Finkel, and K.W. Wagner eds., *Lecture Notes in Computer Science, Vol. 665*, Springer-Verlag (1993), pp. 712-723., 10th Annual Symposium on Theoretical Aspects of Computer Science, STACS’93.

EBNF