Journal ArticleDOI

A λ-calculus with explicit weakening and explicit substitution

01 Feb 2001-Mathematical Structures in Computer Science (Cambridge University Press)-Vol. 11, Iss: 1, pp 169-206
TL;DR: 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.

2. Preliminaries

• The authors give here some de nitions and useful lemmas about rewriting systems.
• The authors also recall the rules for the usual -reduction on -terms with de Bruijn indices and the explicit substitution calculus s e .

De nition 2.4 (Con uence).

• The second one is a particular case of the rst one.
• The original result is that a rewriting system which is locally con uent, weakly normalizing and increasing (there is a measure which is strictly increased by reduction) is also strongly normalizing.
• The -calculus with de Bruijn indices: the db -calculus.
• This will simplify notations in the next sections and, this is more natural with respect to the typed calculus.
• = ug (the substitution) and (the updating function) are meta functions, i.e. are not in the syntax of the calculus, also known as fi.

(ax)

• The rst three rules are the usual ones of the db -calculus.
• A label corresponds to a weakening in the proof tree associated with the term.
• This is the motivation of the subscript \w" in the name of the calculus.
• The proof of subject reduction is straightforward.
• Every typed w -terms is strongly normalizable.

7. Simulation of the -reduction

• This is a particular case of proposition 6.15 with terms without metavariables.
• Just remark that, on terms without metavariables, the reductions w and b 0 (cf. de nition 6.7) are the same.

8. Preservation of strong normalization

• In the subsection 8.1, the authors give the sketch of the proof.
• Sections 8.2 and 8.3 give the de nitions and the main tools used in the proof.

8.1. Sketch of the proof

• For the last step (propagation of the substitution), the authors use the projection lemma on an extended syntax of the ws -calculus.
• This syntax allows to keep track of the reducts of the substitution created by reduction of the head redex.

Did you find this useful? Give us your feedback

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
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
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 ChapterDOI
01 Jan 2002
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.
Abstract: In this chapter we will present the basic concepts of term rewriting that are needed in this book. More details on term rewriting, its applications, and related subjects can be found in the textbook of Baader and Nipkow [BN98]. Readers versed in German are also referred to the textbooks of Avenhaus [Ave95], Bundgen [Bun98], and Drosten [Dro89]. Moreover, there are several survey articles [HO80, DJ90, Klo92, Pla93] that can also be consulted.

501 citations

Journal ArticleDOI
TL;DR: It is shown how good properties of first-order rewriting survive the extension, by giving an efficient rewriting algorithm, a critical pair lemma, and a confluence theorem for orthogonal systems.
Abstract: Nominal rewriting is based on the observation that if we add support for @a-equivalence to first-order syntax using the nominal-set approach, then systems with binding, including higher-order reduction schemes such as @l-calculus beta-reduction, can be smoothly represented. Nominal rewriting maintains a strict distinction between variables of the object-language (atoms) and of the meta-language (variables or unknowns). Atoms may be bound by a special abstraction operation, but variables cannot be bound, giving the framework a pronounced first-order character, since substitution of terms for variables is not capture-avoiding. We show how good properties of first-order rewriting survive the extension, by giving an efficient rewriting algorithm, a critical pair lemma, and a confluence theorem for orthogonal systems.

126 citations

Proceedings ArticleDOI
24 Aug 2004
TL;DR: It is shown that standard (first-order) rewriting is a particular case of nominal rewriting, and that very expressive higher-order systems such as Klop's Combinatory Reduction Systems can be easily defined as nominal rewriting systems.
Abstract: We present a generalisation of first-order rewriting which allows us to deal with terms involving binding operations in an elegant and practical way. We use a nominal approach to binding, in which bound entities are explicitly named (rather than using a nameless syntax such as de Bruijn indices), yet we get a rewriting formalism which respects α-conversion and can be directly implemented. This is achieved by adapting to the rewriting framework the powerful techniques developed by Pitts et al. in the FreshML project.Nominal rewriting can be seen as higher-order rewriting with a first-order syntax and built-in α-conversion. We show that standard (first-order) rewriting is a particular case of nominal rewriting, and that very expressive higher-order systems such as Klop's Combinatory Reduction Systems can be easily defined as nominal rewriting systems. Finally we study confluence properties of nominal rewriting.

58 citations

Cites background from "A λ-calculus with explicit weakenin..."

• ...[1, 24, 12]) and more generally for higher-order rewrite systems (e....

[...]

Book ChapterDOI
11 Sep 2007
TL;DR: Very simple technology is used to establish a general theory of explicit substitutions for the lambda-calculus which enjoys fundamental properties such as simulation of one-step beta-reduction, confluence on metaterms, preservation of beta-strong normalisation, strong normalisation of typed terms and full composition.
Abstract: Calculi with explicit substitutions (ES) are widely used in different areas of computer science. Complex systems with ES were developed these last 15 years to capture the good computational behaviour of the original systems (with meta-level substitutions) they were implementing. In this paper we first survey previous work in the domain by pointing out the motivations and challenges that guided the development of such calculi. Then we use very simple technology to establish a general theory of explicit substitutions for the lambda-calculus which enjoys fundamental properties such as simulation of one-step beta-reduction, confluence on metaterms, preservation of beta-strong normalisation, strong normalisation of typed terms and full composition. The calculus also admits a natural translation into Linear Logic's proof-nets.

53 citations

Cites background from "A λ-calculus with explicit weakenin..."

• ...Since then, different notions of safe composition where introduced, even if PSN becomes more difficult to prove ([8, 14, 1, 29, 31])....

[...]

• ...λx [44] Yes No Yes Yes Yes No λσ [2] Yes No No No Yes Yes λσ⇑ [23] Yes Yes No No Yes Yes λζ [41] Yes Yes Yes Yes No No λws [14] Yes Yes Yes Yes Yes No λlxr [29] Yes ? Yes Yes Yes Yes...

[...]

• ...In order to cope with this problem David and Guillaume [14] defined a calculus with labels called λws, which allows controlled composition of ES without losing PSN and SN....

[...]

Journal ArticleDOI
TL;DR: The operational behaviour of the calculus and some of its fundamental properties such as confluence, preservation of strongnormalisation, strong normalisation of simply typed terms, step by step simulation of @b-reduction and full composition are shown.
Abstract: We present a simple term calculus with an explicit control of erasure and duplication of substitutions, enjoying a sound and complete correspondence with the intuitionistic fragment of Linear Logic's proof-nets. We show the operational behaviour of the calculus and some of its fundamental properties such as confluence, preservation of strong normalisation, strong normalisation of simply typed terms, step by step simulation of @b-reduction and full composition.

51 citations

Cites background from "A λ-calculus with explicit weakenin..."

• ...Besides the ‚ws-calculus [ DG01 ] and its encoding in linear logic [DCKP00] already mentioned, other computational meanings of logic via the use of operators have already been proposed....

[...]

• ...In order to cope with this problem David and Guillaume [ DG01 ] deflned a calculus with labels, called ‚ws, which allows controlled composition of explicit substitutions without losing PSN....

[...]

• ...In calculi like ‚ws [ DG01 ] only cases (1) and (3) are considered by the reduction rules, thus only yielding partial composition....

[...]

References
More filters
Proceedings Article
18 Mar 1993
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.
Abstract: From the Publisher: This book, the first on the subject in English, gives a readable but rigorous introduction to the theory of term rewriting systems. These are a technique used in computer science, especially functional programming, for abstract data type specification and automatic theorem-proving. The book is self-contained, and begins with a discussion of elementary systems and progresses to the most general cases that involve concepts such as second-order lambda calculus. Exercises are included throughout, and solutions to a selection of them are provided. Complete proofs of results that are often buried in the literature are also given, so researchers in functional programming, theoretical computer science, and logic will find this book useful.

821 citations

Proceedings ArticleDOI
01 Dec 1989
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.
Abstract: The ls-calculus is a refinement of the l-calculus where substitutions are manipulated explicitly. The ls-calculus provides a setting for studying the theory of substitutions, with pleasant mathematical properties. It is also a useful bridge between the classical l-calculus and concrete implementations.

577 citations

Book ChapterDOI
01 Jan 2002
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.
Abstract: In this chapter we will present the basic concepts of term rewriting that are needed in this book. More details on term rewriting, its applications, and related subjects can be found in the textbook of Baader and Nipkow [BN98]. Readers versed in German are also referred to the textbooks of Avenhaus [Ave95], Bundgen [Bun98], and Drosten [Dro89]. Moreover, there are several survey articles [HO80, DJ90, Klo92, Pla93] that can also be consulted.

501 citations

"A λ-calculus with explicit weakenin..." refers background in this paper

• ...The lemma 2.10 is an adaptation of a result given in (Klop, 1992)....

[...]

• ...10 is an adaptation of a result given in (Klop, 1992)....

[...]

Book ChapterDOI
10 Apr 1995
TL;DR: A simply typed λ-term whose computation in the λσ-calculus does not always terminate is presented.
Abstract: We present a simply typed λ-term whose computation in the λσ-calculus does not always terminate.

142 citations

Journal ArticleDOI
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. Abstract: Explicit substitutions were proposed by Abadi, Cardelli, Curien, Hardin and Levy to internalise substitutions into$\lambda$-calculus and to propose a mechanism for computing on substitutions.$\lambda\upsilon$is another view of the same concept which aims to explain the process of substitution and to decompose it in small steps.$\lambda\upsilon$is simple and preserves strong normalisation. Apparently that important property cannot stay with another important one, namely confluence on open terms. The spirit of$\lambda\upsilon$is closely related to another calculus of explicit substitutions proposed by de Bruijn and called$C\lambda\xi\phi$. In this paper, we introduce$\lambda\upsilon$, we present$C\lambda\xi\phi$in the same framework as$\lambda\upsilon$and we compare both calculi. Moreover, we prove properties of$\lambda\upsilon$; namely$\lambda\upsilon$correctly implements$\beta$reduction,$\lambda\upsilon$is confluent on closed terms, i.e., on terms of classical$\lambda$-calculus and on all terms that are derived from those terms, and finally$\lambda\upsilon$preserves strong normalization of$\beta\$-reduction.

116 citations