scispace - formally typeset
Open AccessJournal ArticleDOI

A λ-calculus with explicit weakening and explicit substitution

Reads0
Chats0
TLDR
The main novelty of this calculus (given with de Bruijn indices) is the use of labels that represent updating functions and correspond to explicit weakening.
Abstract
Since Mellies showed that λσ (a calculus of explicit substitutions) does not preserve the strong normalization of the β-reduction, it has become a challenge to find a calculus satisfying the following properties: step-by-step simulation of the β-reduction, confluence on terms with metavariables, strong normalization of the calculus of substitutions and preservation of the strong normalization of the λ-calculus. We present here such a calculus. The main novelty of this calculus (given with de Bruijn indices) is the use of labels that represent updating functions and correspond to explicit weakening. A typed version is also presented.

read more

Content maybe subject to copyright    Report

HAL Id: hal-00384683
https://hal.archives-ouvertes.fr/hal-00384683
Submitted on 15 May 2009
HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entic research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.
L’archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diusion de documents
scientiques de niveau recherche, publiés ou non,
émanant des établissements d’enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.
A lambda-calculus with explicit weakening and explicit
substitution
René David, Bruno Guillaume
To cite this version:
René David, Bruno Guillaume. A lambda-calculus with explicit weakening and explicit substitution.
Mathematical Structures in Computer Science, Cambridge University Press (CUP), 2001, 11 (1),
pp.169-206. �10.1017/S0960129500003224�. �hal-00384683�

Under consideration for publication in Math. Struct. in Comp. Science
A
-calculus with explicit weakening and
explicit substitution
R E N
E D A V I D
1
and B R U N O G U I L L A U M E
1
;
2
y
1
Laboratoire de Mathematiques
Universite de Savoie
F-73376 Le Bourget du Lac Cedex
2
Laboratoire de Recherche en Informatique
B^at. 490 - Universite Paris SUD
F-91405 Orsay Cedex
Received 3 April 2000
Since Mellies has shown that

(a calculus of explicit substitutions) does not preserve
the strong normalization of the
-reduction, it b ecame a challenge to nd a calculus
satisfying the following prop erties: step by step simulation of the
-reduction, conuence
on terms with metavariables, strong normalization of the calculus of substitutions and
preservation of the strong normalization of the
-calculus. We present here such a
calculus. The main novelty of the calculus (given with de Bruijn indices) is the use of
labels
that represent updating functions and corresp ond to explicit weakening. A typed
version is also presented.
Contents
1 Introduction 2
2 Preliminaries 4
2.1 Rewriting 4
2.2 The
-calculus with de Bruijn indices: the
db
-calculus 6
2.3 The
s
-calculus and the
s
e
-calculus 7
3 The calculus with explicit weakening:
w
9
3.1 Terms with lab els 9
3.2 The
w
-calculus 10
3.3 Simply typed
w
-calculus 10
3.4
w
versus
db
11
3.5 Conclusion:
w
versus
db
13
4 The
ws
-calculus 14
4.1 Syntax and reduction rules for the
ws
-calculus 14
4.2 Typing rules for the
ws
-calculus 16
4.3 Link with the
s
e
-calculus 17
y
This work was done at Universite de Savoie and was nished in Universite Paris SUD.

Rene
David
, Bruno
Guillaume
2
5 Strong normalization of the calculus of substitutions 17
5.1 The substitutive contexts 17
5.2 Simulation of the
ws
-calculus in the
p
2
-calculus 19
5.3 Strong normalization of the
p
2
-calculus 20
6 Conuence on open terms 22
6.1 The calculus with metavariables 22
6.2 Conuence of the
ws
o
-calculus 22
6.3 Conuence of the
ws
o
-calculus 22
7 Simulation of the
-reduction 28
8 Preservation of strong normalization 29
8.1 Sketch of the pro of 30
8.2 Denitions 30
8.3 Preservation of innite reductions by propagation 32
8.4 Proof of the key lemma 37
9 Conclusion 38
References 39
1. Introduction
Calculi of explicit substitutions are useful tools that ll the gap b etween the meta op-
eration of substitution app earing in the
-reduction of the
-calculus and its concrete
implementation.
The most natural property such calculi have to satisfy is the simulation of the
-
reduction (SIM): every
-reduction can be done in the new calculus and conversely this
calculus do es not introduce other reductions.
To have a go od implementation of the
-calculus, it is also natural to ask that no innite
reductions are created by the use of explicit substitutions. This is called the preservation
of strong normalization (PSN). Mellies gave in (Mellies, 1995) a simply typed term with
an innite reduction in

. This counter-example shows that

has not PSN.
Another important property is to have the conuence on terms with metavariables
(MC): in proof assistants or theorem provers one has to consider pro of trees with some
unknown subtrees. To represent these pro of trees,
-terms with metavariables (corre-
sponding to unknown parts of the tree) are necessary. The conuence on usual (closed)
terms is easy to obtain but MC is much more dicult.
Since Mellies gave his counter-example, many calculi have b een prop osed but none of
them satises simultaneously SIM, PSN and MC. Figure 1 gives some of them and their
properties.
In order to satisfy b oth SIM and MC, rules for the interaction b etween substitutions
are necessary. These rules are resp onsible for the lack of PSN in

and
s
e
. In
d
and

n
, a weaker notion of composition is used and thus PSN is satised, but these rules
are not strong enough to get MC.
The
s
-calculus is the most natural calculus of explicit substitutions: it is the
-calculus
(with de Bruijn indices) where the substitution (
i
) and the updating (
k
j
) have b een

A
-calculus with explicit weakening and explicit substitution
3
SIM PSN MC
without

(Benaissa et al., 1996) Yes Yes No
interaction
s
(Kamareddine and Ros, 1995b) Yes Yes No

(Mu~noz, 1996; Mu~noz, 1997) Big step Yes Yes

(Abadi et al., 1991) Yes No Yes
with
s
e
(Kamareddine and Ros, 1997) Yes No Yes
interaction
d
(Ferreira et al., 1996) Yes Yes No
S K I nT
(Goguen and Goubault-Larrecq, 1999) Yes Yes Yes
Fig. 1. Calculi of explicit substitutions and their prop erties
internalized. The
s
e
-calculus is obtained by adding new rules for the interaction of
substitutions. This set of rules is the minimal one to get MC but unfortunately,
s
e
does
not satisfy PSN (Guillaume, 1999a).
In the following example, the
-reduction is done in two steps: rst, the reduction of
the
-redex and the propagation of the substitution and then, the propagation of the
updating function. The
h
1
i
in the middle term means that the free indices in the term
below must b e increased by 1. This corresponds to the function
1
0
in
s
e
.
Example 1.1.
@
@
@
@
@
0
1
@
@
2
@
@
1
0
-
@
@
1
@
@
h
1
i
@
@
0
1
0
-
@
@
1
@
@
@
@
0
2
0
The rules for the propagation of the updating functions are resp onsible for the lack of
PSN in
s
e
(Guillaume, 1999a). The key idea of our calculus is to keep the information
about up dating in terms rather than to move it down. In others words, we decide that
(in the example ab ove) the \right" reduct of the term is the second rather than the third
one.
Recently, another solution which relies on a translation of
-terms into sequent combi-
nators has been proposed (Goguen and Goubault-Larrecq, 1999). Goguen and Goubault
introduce a rst order calculus (named
S K I n
) on the set of terms dened by:
t
::=
x
j
I
m
j
K
m
(
t
)
j
S
m
(
t; t
)
where
I
m
,
k
m
and
S
m
are generalizations of the usual combinators
I
,
K
and
S
. The
translation of the
-term
t
in
S K I n
is written
t
and the reverse one [[
u
]] for any
S K I n
-
term u. They show that
t
!
u
implies
t
!
+
S K I n
u
but conversely, they only have
that
t
!
S K I n
u
implies [[
t
]]
!
[[
u
]]. Unfortunately, with an example a la Mellies,

Rene
David
, Bruno
Guillaume
4
they show that
S K I n
is not strongly normalizing in the typed case and thus that it do es
not have PSN.
To recover the PSN, they dene the
S K I nT
-calculus on the same syntax but with
less permissive rules. This second calculus has the exp ected properties (including PSN)
but the relation with the
-calculus is more complicated than for
S K I n
. The logic
behind
S K I nT
is a fragment of the mo dal logic S4 called
near-intuitionistic logic
. The
corresponding notion of \
-calculus" is a closure calculus (named
clos
) which is an
extension of call-by-value (CBV)
-calculus. The
-calculus is translated in
S K I nT
in
the following way: rst, encode the
-calculus in the CBV
-calculus (using for example
a continuation passing style (CPS) transformation), then use a translation from
clos
to
S K I nT
. Denoting by
L
(
t
) the translation of the
-term
t
in
S K I nT
, they prove:
|
if
t
!
u
then
L
(
t
)
!
S K I nT
L
(
u
);
|
t
and
u
are convertible if and only if
L
(
t
) and
L
(
u
) are convertible in
S K I nT
.
The pap er is organized as follow: we rst introduce the
w
-calculus (section 3)which
is the usual
-calculus (with de Bruijn indices) where terms may contain lab els
h
k
i
, then
we give the
ws
-calculus (section 4) which is obtained from the
w
-calculus by making
the substitutions explicit and by adding rules for interaction b etween substitutions.
The sections from 5 to 8 are devoted to the pro ofs of the main prop erties of the
ws
-calculus. The most innovative section is the last one where the PSN is proved.
Warning:
This pap er is the complete version of the extended abstract presented in
WESTAPP'99 (David and Guillaume, 1999). There, the
ws
-calculus was called
l
(
l
for
label).
2. Preliminaries
We give here some denitions and useful lemmas ab out rewriting systems. We also recall
the rules for the usual
-reduction on
-terms with de Bruijn indices and the explicit
substitution calculus
s
e
.
2.1.
Rewriting
Denition 2.1 (Abstract rewriting systems).
Let
E
be a set of terms and
R
be
a set of rewriting rules. We denote by
!
R
the binary relation on
E
dened by the
contextual closure of the set of rules.
We also write
!
R
(resp.
!
+
R
) for the transitive and reexive closure, (resp. transitive
closure) of
!
R
.
Denition 2.2 (Normal form).
We say that
t
2
E
is an
R
-normal form if there are
no terms
u
such that
t
!
R
u
. The set of
R
-normal forms is denoted by
NF
(
R
).
Denition 2.3 (Normalization).
|
A term
t
2
E
is strongly normalizable if there is no innite
R
-reduction of
t
, i.e.
if every sequence
t
!
R
t
1
!
R
t
2
: : :
is nite. The set of
R
-strongly normalizable
terms is denoted by
SN
(
R
). If
SN
(
R
) =
E
, we say that the reduction
R
is strongly
normalizing.

Citations
More filters
Book

Rewriting Techniques and Applications

Sophie Tison
TL;DR: It is shown how the earlier procedure can be extended to combine multiple disjoint canonizable, solvable theories within the Shostak framework.
Book ChapterDOI

A normalisation result for higher-order calculi with explicit substitutions

TL;DR: It is shown that needed strategies normalise in the ES-based implementation of any orthogonal pattern higher-order rewrite system, including the λ-calculus.
Journal ArticleDOI

A Theory of Explicit Substitutions with Safe and Full Composition

TL;DR: Very simple technology in named variable-style notation is used to establish a theory of explicit substitutions for the lambda-calculus which enjoys a whole set of useful properties such as full composition, simulation of one-step beta-reduction, preservation of beta-strong normalisation, strong normalisation of typed terms and confluence on metaterms.
Book ChapterDOI

Strong Normalization of the Typed λws-Calculus

TL;DR: The λ ws -calculus is a λ-calculus with explicit substitutions with desired properties: step by step simulation of β, confluence on terms with meta-variables and preservation of the strong normalization.
Proceedings ArticleDOI

Metaconfluence of Calculi with Explicit Substitutions at a Distance

TL;DR: This work establishes metaconfluence for a family of calculi with explicit substitutions (ES) that enjoy preservation of strong-normalization (PSN) and that act at a distance on metaterms, providing for the first time an interesting family of lambda-calculi with implicit substitutions that enjoy both PSN and metacon fluence without requiring sophisticated notions of reduction modulo a set of equations.
References
More filters
Proceedings Article

Term rewriting systems

TL;DR: This book gives a readable but rigorous introduction to the theory of term rewriting systems, a technique used in computer science, especially functional programming, for abstract data type specification and automatic theorem-proving.
Proceedings ArticleDOI

Explicit substitutions

TL;DR: The λ&sgr;-calculus is a refinement of the λ-Calculus where substitutions are manipulated explicitly, and provides a setting for studying the theory of substitutions, with pleasant mathematical properties.
Book ChapterDOI

Term Rewriting Systems

TL;DR: This chapter presents the basic concepts of term rewriting that are needed in this book and suggests several survey articles that can be consulted.
Book ChapterDOI

Typed lambda-calculi with explicit substitutions may not terminate

TL;DR: A simply typed λ-term whose computation in the λσ-calculus does not always terminate is presented.
Journal ArticleDOI

λν, a calculus of explicit substitutions which preserves strong normalisation

TL;DR: In this paper, a calculus of explicit substitutions, called $C\lambda\xi\phi, was proposed and compared to the one proposed by de Bruijn and is shown to preserve strong normalization.
Frequently Asked Questions (1)
Q1. What contributions have the authors mentioned in the paper "A lambda-calculus with explicit weakening and explicit substitution" ?

HAL this paper is a multi-disciplinary open access archive for the deposit and dissemination of scientific research documents, whether they are published or not.