 # Lambda Calculus with Explicit Read-back

This paper introduces a new term rewriting system that is similar to the embedded read-back mechanism for interaction nets presented in our previous work, but is easier to follow than in the original setting and thus to analyze its properties. Namely, we verify that it correctly represents the lambda calculus. Further, we show that there is exactly one reduction sequence that starts with any term in our term rewriting system. Finally, we represent the leftmost strategy which is known to be normalizing.

## Authors

##### This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

## 1 Introduction

Read-back is the process of decoding a -term from its another representation. Previously, [1, Section 7] has presented an embedded read-back mechanism for interaction nets. Here, we will define a novel term rewriting system which resembles that mechanism in order to check its correctness and to study its properties more easily than in the original setting.

###### Notation.

We will use notations similar to . is a context with one hole, which will be denoted with . is the result of placing in the hole of the context . is the set of all -terms. is the set of all -terms in -normal form. is the set of all free variables in a -term . is the result of substituting for all free occurrences of variable in . , where . If , then stands for -reduction, and we write when or .

###### Definition 1.

Let . is an atom. is the result of replacing each in with . Additionally, we define set , then extend the definitions of substitution and for according to for any variable .

Note that for any , we have and .

###### Definition 2.

is the minimal set that satisfies the following conditions:

 ∀M∈Λ : ‘‘M"∈ΛRB; ∀C[x], M∈Λ∙ : ⟨C[x], M⟩∈ΛRB; ∀C[x], M∈ΛRB, →N∈Λ∙ : ⟨C[x], M →N⟩∈ΛRB.
###### Definition 3.

Let us introduce a reduction relation on as follows:

 ∀C[x], M∈Λ : ⟨C[x], ‘‘M"⟩→‘‘C[M]"; ∀C[x], λx.M∈Λ∙ : ⟨C[x], λx.M⟩→⟨C[λx.[x]], M[x:=‘‘x"]⟩; ∀C[x], M∈Λ, N0,→N∈Λ∙ : ⟨C[x], ‘‘M" N0 →N⟩→⟨C[x], ⟨M [x], N0⟩ →N⟩; ∀C[x], λx.M,N0,→N∈Λ∙ : ⟨C[x], (λx.M) N0 →N⟩→⟨C[x], M[x:=N0] →N⟩; ∀M,M′∈ΛRB, C[x], →N∈Λ∙ : M→M′ ⇒ ⟨C[x], M →N⟩→⟨C[x], M′ →N⟩.

Thanks to , the introduced relation is not to be confused with -reduction.

## 2 Correctness

###### Definition 4.

Mapping is called read-back and defined as follows:

 ∀C[x], M∈Λ∙∪ΛRB, →N∈Λ∙ : RB(⟨C[x], M →N⟩)≡C[RB(M) RB(N1)⋯RB(Nn)]; ∀M,N∈Λ∙ : RB(M N)≡RB(M) RB(N); ∀λx.M∈Λ∙ : RB(λx.M)≡λx.RB(M[x:=‘‘x"]); ∀M∈Λ : RB(‘‘M")≡M.

For example, if is a -term, then .

.

###### Proof.

Let . Notice that . Then we have . ∎

.

###### Proof.

We will use induction on Definition 3. First, consider the four basic cases:

1. .
Notice .

2. .
Notice .

3. .
Notice .

4. .
Notice , and
Notice .
Then due to Proposition 1.

Now consider , where , then notice that and . Finally, assuming that , conclude with . ∎

## 3 Normalization

###### Definition 5.

A context is normal if and only if .

In particular, contexts and are both normal, however is not. Another example is context : if is a variable and , then is also normal.

###### Notation.

will denote the set of all normal contexts.

.

###### Proof.

Let . Then by Definition 5, , and . ∎

###### Proposition 4.

Let . Then is in normal form if and only if is an atom.

###### Proof.

Notice that in Definition 3 we have if and only if is not an atom. ∎

###### Proposition 5.

For any , at most one reduction sequence starts from .

###### Proof.

Notice that for any there is at most one such that . ∎

.

###### Proof.

Let . Consider the following four cases:

1. , where is a variable.
Then and .

2. , where .
Then .
Notice due to and Proposition 3.

3. , where .
Then .

4. , where is a variable and .
Then .
Notice that .
Since , we have for some .
Assume and use induction to conclude .

Due to Proposition 4 and Proposition 5, the above four cases are exhaustive. ∎

.

###### Proof.

Notice that any infinite reduction sequence on can only be due to -reduction. Further, the proof of Proposition 6 shows that the leftmost -redex is always contracted, thus we can use [2, Normalization theorem 13.2.2] to conclude ().

Conversely, () directly follows from Proposition 2 and Proposition 6. ∎

## 4 Conclusion

This paper introduced a new term rewriting system designed after the embedded read-back mechanism for interaction nets that was presented in our previous work [1, Section 7].

Then we have demonstrated the correctness of our term rewriting system and showed its normalization property in Proposition 7. As a simple corollary, the conjecture in  can thus be proven using Proposition 7 and the preceding work . Proposition 7 can also help investigate the similar conjectures in [1, Section 7] and [5, Section 2].

In the future, we intend to apply a similar technique to develop the ideas from  which we believe to be a very promising direction, especially taking into account the experimental results obtained from their software implementation.