Explicit

Substitution

on

the

Edge

of

Strong

Normalisation

Roel

Bloo

bloo@win.tue.nl

Herman

Geuvers

herman@win.tue.nl

Abstract

We

use

the

Recursive

Path

Ordering

-LRB-

RPO

-RRB-

technique

of

semantic

labelling

to

show

the

Preservation

of

Strong

Normalisation

-LRB-

PSN

-RRB-

property

for

several

calculi

of

explicit

substitution

Preservation

of

Strong

Normalisation

states

that

if

a

term

M

is

strongly

normalizing

under

ordinary

reduction

-LRB-

using

global

substitutions

-RRB-

then

it

is

strongly

normalizing

if

the

substitution

is

made

explicit

-LRB-

local

-RRB-

There

are

different

ways

of

making

global

substitution

explicit

and

PSN

is

a

quite

natural

and

desirable

property

for

the

explicit

substitution

calculus

Our

method

for

proving

PSN

is

very

general

and

applies

to

several

known

systems

of

explicit

substitutions

AE

of

Lescanne

et

al.

s

of

Kamareddine

and

R

os

and

x

of

Rose

and

Bloo

Introduction

Explicit

Substitution

was

first

studied

by

Abadi

Cardelli

Curien

and

L?evy

in

-LSB-

Abadi

et

al.

-RSB-

They

proposed

a

calculus

oe

of

explicit

substitutions

which

can

compose

substitutions

Melli?es

has

shown

that

simply

typable

terms

can

have

infinite

reduction

paths

in

oe

-LRB-

-LSB-

Melli?es

-RSB-

-RRB-

Several

people

-LRB-

see

-LSB-

BBLR

-RSB-

-LSB-

Bloo

Rose

-RSB-

-LSB-

Bloo

-RSB-

-LSB-

Kamareddine

Rios

-RSB-

-RRB-

have

succeeded

in

giving

calculi

of

explicit

substitutions

which

have

the

nice

property

that

every

term

which

is

strongly

normalising

for

reduction

is

also

strongly

normalising

in

the

explicit

substitution

calculus

We

call

this

property

PSN

-LRB-

Preservation

of

Strong

Normalisation

-RRB-

In

this

paper

we

present

a

method

to

prove

PSN

for

explicit

substitution

calculi

based

on

the

recursive

path

order

Zantema

used

the

recursive

path

order

to

show

termination

of

the

substitution

part

of

oe

-LSB-

Zantema

-RSB-

but

the

technique

he

used

does

n't

apply

to

show

PSN

We

use

a

stronger

technique

called

semantic

labelling

-LSB-

Ferreira

Zantema

-RSB-

to

show

PSN

for

all

explicit

substitution

calculi

known

to

have

the

PSN

property

We

also

show

why

our

method

does

n't

work

for

oe

Our

technique

relies

on

introducing

a

first

order

term

rewrite

system

where

function

symbols

for

application

and

substitution

are

labeled

with

natural

numbers

and

where

variables

are

represented

by

just

one

constant

The

recursive

path

order

rpo

on

this

labelled

calculus

is

strongly

normalising

-LRB-

or

terminating

-RRB-

Then

we

take

a

look

at

the

explicit

substitution

calculus

x

The

reduction

is

here

split

up

into

a

reduction

step

Beta

-LRB-

contracting

the

redex

and

creating

an

explicit

substitution

-RRB-

and

reduction

steps

x

-LRB-

moving

the

explicit

substitutions

through

the

term

to

perform

the

substitution

-RRB-

It

is

relatively

easy

-LRB-

as

usual

in

these

calculi

-RRB-

to

observe

that

x

is

strongly

normalising

and

confluent

Now

and

this

is

a

crucial

point

in

the

proof

of

PSN

we

take

a

look

at

the

terms

in

x

of

which

the

substitution

normal

form

of

all

of

its

subterms

is

SN

we

call

this

set

x

-LRB-

The

substitution

normal

form

of

a

term

M

is

obtained

by

evaluating

all

the

explicit

substitutions

in

M

not

contracting

any

redexes

That

is

we

take

the

x-normal-form

of

M

-RRB-

We

then

define

a

translation

T

from

x

into

the

set

of

labelled

terms

This

translation

T

is

reduction

preserving

address

of

both

authors

Eindhoven

University

of

Technology

P.O.Box

NL

-LCB-

MB

Eindhoven

in

the

sense

that

if

M

x

N

then

T

-LRB-

M

-RRB-

rpo

T

-LRB-

N

-RRB-

or

T

-LRB-

M

-RRB-

T

-LRB-

N

-RRB-

and

if

M

Beta

N

then

T

-LRB-

M

-RRB-

rpo

T

-LRB-

N

-RRB-

Hence

using

the

fact

that

x

is

strongly

normalizing

we

conclude

that

every

M

x

is

strongly

normalizing

So

x

has

the

PSN

property

-LRB-

because

every

term

that

is

strongly-normalizing

is

an

element

of

x

-RRB-

For

those

more

familiar

with

the

RPO

technique

in

the

way

it

has

been

presented

in

-LSB-

Klop

-RSB-

we

also

present

in

the

final

section

a

translation

from

x

to

commutative

labelled

trees

This

translation

is

also

reduction

preserving

in

the

same

sense

as

just

discussed

This

gives

a

slightly

different

way

of

obtaining

the

PSN

property

for

x.

To

show

the

flexibility

of

our

proof

method

we

use

it

for

different

calculi

of

explicit

substitution

We

start

off

with

a

calculus

where

we

use

named

variables

-LRB-

different

from

e.g.

-LSB-

Abadi

et

al.

-RSB-

where

de

Bruijn-indices

are

used

-RRB-

We

have

chosen

to

use

named

variables

because

this

makes

the

presentation

slightly

more

perspicuous

Moreover

it

makes

it

easier

to

single

out

the

places

where

the

difficulties

arise

in

the

calculus

of

-LSB-

Abadi

et

al.

-RSB-

We

also

apply

our

proof

method

to

the

calculi

AE

of

Lescanne

et

al.

and

s

of

Kamareddine

and

R

os

A

calculus

for

explicit

substitutions

with

named

variables

In

the

standard

definition

of

the

untyped

lambda

calculus

substitution

is

a

meta-operation

usually

denoted

by

-LSB-

x

N

-RSB-

or

-LSB-

N

x

-RSB-

where

x

is

a

variable

and

N

a

term

In

the

following

we

use

the

notation

-LSB-

N

x

-RSB-

for

a

-LRB-

global

-RRB-

substitution

of

N

for

x.

For

M

and

N

terms

and

x

y

distinct

variables

the

term

M

-LSB-

N

x

-RSB-

is

then

defined

by

structural

induction

as

follows

x

-LSB-

N

x

-RSB-

N

y

-LSB-

N

x

-RSB-

y

if

y

x

-LRB-

PQ

-RRB-

-LSB-

N

x

-RSB-

P

-LSB-

N

x

-RSB-

Q

-LSB-

N

x

-RSB-

-LRB-

y

:P

-RRB-

-LSB-

N

x

-RSB-

:P

-LSB-

y

-RSB-

-LSB-

N

x

-RSB-

if

FV

-LRB-

N

-RRB-

-LSB-

fxg

-LSB-

-LRB-

FV

-LRB-

P

-RRB-

n

fyg

-RRB-

-LRB-

x

:P

-RRB-

-LSB-

N

x

-RSB-

x

:P

We

assume

the

notions

of

free

variable

-LRB-

FV

-RRB-

and

bound

variable

-LRB-

BV

-RRB-

to

be

known

Furthermore

denotes

syntactical

equality

modulo

conversion

which

is

defined

as

the

smallest

equivalence

relation

such

that

x

x

P

N

and

Q

M

-RRB-

PQ

NM

P

Q

y

FV

-LRB-

Q

-RRB-

n

fxg

-RRB-

x

:P

y

Q

-LSB-

y

x

-RSB-

In

the

definition

of

substitution

there

is

a

choice

for

the

variable

For

this

definition

to

make

sense

it

has

to

be

shown

that

the

specific

choice

for

the

variable

is

irrelevant

But

this

is

a

consequence

of

the

definition

of

and

the

following

Lemma

Lemma

If

P

Q

and

M

N

then

P

-LSB-

M

x

-RSB-

Q

-LSB-

N

x

-RSB-

In

order

to

get

a

calculus

x

of

explicit

substitutions

two

extensions

have

to

be

made

The

first

is

extending

the

terms

with

substitutions

Definition

The

set

of

terms

x

is

defined

by

the

following

abstract

syntax

A

x

j

AA

j

x

A

j

Ahx

Ai

Where

x

denotes

an

arbitrary

variable

Substitution

is

defined

on

x-terms

as

for

terms

but

with

the

extra

clauses

that

M

hy

=P

i

-LSB-

N

x

-RSB-

M

-LSB-

y

-RSB-

-LSB-

N

x

-RSB-

=P

-LSB-

N

x

-RSB-

i

if

FV

-LRB-

N

-RRB-

-LSB-

fxg

-LSB-

-LRB-

FV

-LRB-

M

-RRB-

n

fyg

-RRB-

M

hx

=P

i

-LSB-

N

x

-RSB-

M

hx

=P

-LSB-

N

x

-RSB-

i

equivalence

is

defined

on

x-terms

as

for

terms

but

with

the

extra

clause

that

M

N

P

Q

y

FV

-LRB-

Q

-RRB-

n

fxg

-RRB-

P

hx

M

i

Q

-LSB-

y

x

-RSB-

hy

N

i

A

x

is

called

pure

if

A

i.e.

A

does

not

contain

any

substitution

hx

Bi

The

second

is

refining

the

notion

of

reduction

Remember

that

the

reduction

relation

on

pure

terms

is

defined

as

the

contextual

closure

of

-LRB-

x

A

-RRB-

B

A

-LSB-

B

x

-RSB-

We

make

the

global

substitution

in

explicit

by

splitting

into

two

parts

Beta

is

for

the

creation

of

a

substitution

out

of

a

redex

x

is

for

the

proliferation

of

substitutions

through

a

term

to

variables

and

for

performing

the

actual

substitution

or

throwing

away

the

substitute

if

the

substitution

turns

out

to

be

void

Definition

The

reduction

relations

Beta

and

x

are

defined

to

be

the

contextual

closures

modulo

conversion

of

respectively

-LRB-

x

A

-RRB-

B

Beta

Ahx

Bi

and

-LRB-

AB

-RRB-

hx

Ci

x

-LRB-

Ahx

Ci

-RRB-

-LRB-

Bhx

Ci

-RRB-

-LRB-

y

A

-RRB-

hx

Ci

x

y

Ahx

Ci

if

x

y

and

y

FV

-LRB-

C

-RRB-

xhx

Ci

x

C

Ahx

Ci

x

A

if

x

FV

-LRB-

C

-RRB-

The

explicit

substitution

reduction

relation

x

is

the

union

of

Beta

and

x

The

reduction

Ahx

Ci

x

A

if

x

FV

-LRB-

A

-RRB-

is

also

called

garbage

collection

Since

we

consider

terms

modulo

equality

substitutions

can

always

be

distributed

to

variables

hence

the

rule

yhx

Ci

x

y

if

x

y

would

already

be

sufficient

The

more

efficient

garbage

collection

will

do

no

harm

however

The

reduction

relation

x

is

called

the

substitution

calculus

It

has

nice

properties

Lemma

x

is

strongly

normalising

confluent

and

has

unique

normalforms

Proof

Strong

normalisation

is

shown

by

defining

a

map

h

x

IN

which

decreases

on

xreduction

define

h

-LRB-

x

-RRB-

h

-LRB-

AB

-RRB-

h

-LRB-

A

-RRB-

h

-LRB-

B

-RRB-

h

-LRB-

x

A

-RRB-

h

-LRB-

A

-RRB-

h

-LRB-

Ahx

Bi

-RRB-

h

-LRB-

A

-RRB-

-LRB-

h

-LRB-

B

-RRB-

-RRB-

then

by

induction

on

the

structure

of

A

if

A

x

B

then

h

-LRB-

A

-RRB-

h

-LRB-

B

-RRB-

To

prove

confluence

it

is

now

sufficient

to

show

weak

confluence

which

is

easy

Definition

We

write

A

SNR

if

A

is

strongly

normalizing

with

respect

to

the

reduction

relation

R

We

write

x

-LRB-

A

-RRB-

to

denote

the

x-normalform

of

A.

For

pure

terms

A

we

write

-LRB-

A

-RRB-

to

denote

the

normalform

of

A

if

it

exists

We

define

-LRB-

A

-RRB-

to

be

the

maximal

length

of

a

reduction

path

starting

with

x

-LRB-

A

-RRB-

if

x

-LRB-

A

-RRB-

SN

Note

that

for

A

x

x

-LRB-

A

-RRB-

is

pure

We

now

give

some

elementary

but

important

properties

of

x

and

Lemma

-LRB-

substitution

-RRB-

For

all

terms

A

B

x

-LRB-

Ahx

Bi

-RRB-

x

-LRB-

A

-RRB-

-LSB-

x

-LRB-

B

-RRB-

x

-RSB-

Proof

We

prove

by

induction

on

the

number

of

symbols

in

the

sequence

A

Bm

that

x

-LRB-

hxm

Bmi

-RRB-

x

-LRB-

A

-RRB-

-LSB-

x

-LRB-

-RRB-

-RSB-

-LSB-

x

-LRB-

Bm

-RRB-

xm

-RSB-

We

distinguish

cases

according

to

the

structure

of

A

we

only

treat

some

of

them

ffl

A

xi

Then

x

-LRB-

hxm

Bmi

-RRB-

x

-LRB-

Bihxi

Bi

i

hxm

Bmi

-RRB-

IH

x

-LRB-

Bi

-RRB-

-LSB-

x

-LRB-

Bi

-RRB-

xi

-RSB-

-LSB-

x

-LRB-

Bm

-RRB-

xm

-RSB-

x

-LRB-

A

-RRB-

-LSB-

x

-LRB-

-RRB-

-RSB-

-LSB-

x

-LRB-

Bm

-RRB-

xm

-RSB-

ffl

A

Then

the

number

of

symbols

in

the

sequence

A

Bm

is

larger

than

in

the

sequence

Bm

and

the

number

of

symbols

in

A

is

bigger

than

in

so

by

the

induction

hypothesis

x

-LRB-

hxm

Bmi

-RRB-

x

-LRB-

-RRB-

-LSB-

x

-LRB-

-RRB-

y

-RSB-

-LSB-

x

-LRB-

-RRB-

-RSB-

-LSB-

x

-LRB-

Bm

-RRB-

xm

-RSB-

x

-LRB-

-RRB-

-LSB-

x

-LRB-

-RRB-

-RSB-

-LSB-

x

-LRB-

Bm

-RRB-

xm

-RSB-

Lemma

-LRB-

projection

-RRB-

For

all

terms

A

B

if

A

x

B

then

x

-LRB-

A

-RRB-

x

-LRB-

B

-RRB-

if

A

Beta

B

then

x

-LRB-

A

-RRB-

x

-LRB-

B

-RRB-

Proof

is

immediate

and

is

by

induction

on

the

structure

of

A.

Note

that

if

N

N

then

M

-LSB-

N

x

-RSB-

M

-LSB-

N

x

-RSB-

We

treat

some

cases

ffl

A

-LRB-

x

-RRB-

B

Then

x

-LRB-

A

-RRB-

-LRB-

x

x

-LRB-

-RRB-

-RRB-

x

-LRB-

-RRB-

x

-LRB-

-RRB-

-LSB-

x

-LRB-

-RRB-

x

-RSB-

x

-LRB-

-RRB-

x

-LRB-

B

-RRB-

ffl

A

B

Then

x

-LRB-

A

-RRB-

x

-LRB-

-RRB-

-LSB-

x

-LRB-

-RRB-

x

-RSB-

IH

x

-LRB-

-RRB-

-LSB-

x

-LRB-

-RRB-

x

-RSB-

x

-LRB-

B

-RRB-

The

projection

lemma

is

not

strong

enough

to

give

us

PSN

The

problem

is

that

if

A

Beta

B

then

sometimes

x

-LRB-

A

-RRB-

x

-LRB-

B

-RRB-

as

in

xhy

=-LRB-

z

C

-RRB-

Di

Beta

xhy

Chz

Dii

A

proof

of

PSN

by

analyzing

what

can

happen

inside

void

substitutions

such

as

in

this

example

is

given

in

-LSB-

Bloo

-RSB-

and

in

-LSB-

Bloo

Rose

-RSB-

Lemma

-LRB-

soundness

-RRB-

For

all

pure

terms

A

B

if

A

B

then

A

xB

Proof

Induction

on

the

structure

of

A

We

treat

the

case

A

-LRB-

x

-RRB-

B

-LSB-

x

-RSB-

Then

A

Beta

xx

-LRB-

-RRB-

Lemma

x

-LRB-

-RRB-

-LSB-

x

-LRB-

-RRB-

x

-RSB-

A

pure

-LSB-

x

-RSB-

A

final

property

of

x

that

can

be

shown

easily

is

the

confluence

of

x.

Theorem

x

is

confluent

Proof

If

A

and

A

then

by

projection

x

-LRB-

A

-RRB-

x

-LRB-

Bi

-RRB-

so

by

confluence

of

there

is

a

pure

term

C

such

that

Bi

C

now

by

soundness

x

-LRB-

Bi

-RRB-

xC

Then

also

xC

The

recursive

path

order

In

this

section

we

briefly

introduce

the

recursive

path

order

For

a

more

detailed

description

and

proofs

the

reader

is

referred

to

-LSB-

Dershowitz

-RSB-

-LSB-

Zantema

-RSB-

and

-LSB-

Ferreira

Zantema

-RSB-

Definition

Let

F

be

a

set

of

function

symbols

X

a

set

of

variables

such

that

F

X

let

T

-LRB-

F

X

-RRB-

be

the

set

of

-LRB-

open

-RRB-

terms

over

F

and

X

Let

be

a

partial

order

on

F

Let

o

be

a

map

assigning

to

every

function

symbol

f

F

one

of

the

words

mult

or

lex

The

recursive

path

order

rpo

on

T

-LRB-

F

X

-RRB-

induced

by

and

o

is

defined

by

f

-LRB-

sm

-RRB-

rpo

g

-LRB-

tn

-RRB-

iff

-LSB-

si

g

-LRB-

tn

-RRB-

si

rpo

g

-LRB-

tn

-RRB-

-RSB-

-LRB-

f

g

-LSB-

f

-LRB-

sm

-RRB-

rpo

tj

-RSB-

-RRB-

-LRB-

f

g

-LSB-

f

-LRB-

sm

-RRB-

rpo

tj

-RSB-

smi

o

-LRB-

f

-RRB-

rpo

tni

-RRB-

Here

lex

rpo

and

mult

rpo

are

respectively

the

lexicographic

and

the

multiset

extensions

of

rpo

i.e.

ffl

smi

lex

rpo

tni

iff

for

some

i

m

n

si

ti

si

rpo

ti

or

sm

tm

m

n.

ffl

smi

mult

rpo

tni

iff

the

multiset

smgg

can

be

transformed

into

the

multiset

tngg

by

performing

the

operation

replace

a

member

s

of

the

multiset

by

finitely

many

terms

t

such

that

s

rpo

t

one

or

more

times

In

-LSB-

Ferreira

Zantema

-RSB-

o

is

called

status

function

More

complex

extensions

of

rpo

than

multiset

or

lexicographic

are

even

possible

Theorem

-LRB-

Dershowitz

-RRB-

Let

be

a

partial

order

and

o

a

status

function

on

a

set

of

function

symbols

F

let

rpo

be

the

induced

recursive

path

order

Then

rpo

is

well-founded

-LRB-

-RRB-

is

well-founded

Proof

see

-LSB-

Dershowitz

-RSB-

or

-LSB-

Ferreira

Zantema

-RSB-

PSN

for

x

In

this

section

we

use

the

recursive

path

order

to

show

that

x

has

PSN

Since

the

recursive

path

order

is

about

first

order

term

rewrite

systems

we

need

to

translate

terms

of

x

into

a

first

order

term

rewrite

system

to

be

able

to

prove

PSN

this

translation

must

in

some

sense

preserve

reductions

We

do

this

by

labelling

-LRB-

some

-RRB-

function

symbols

with

maximal

lengths

of

reduction

sequences

therefore

we

restrict

to

terms

where

these

lengths

are

finite

for

all

subterms

It

will

turn

out

that

these

are

exactly

all

the

strongly

normalizing

x-terms

Definition

We

define

the

set

x

ae

x

by

x

fA

x

j

for

all

subterms

B

of

A

x

-LRB-

B

-RRB-

SN

g

Remark

A

x

if

and

only

if

for

all

subterms

B

of

A

-LRB-

B

-RRB-

Lemma

-LRB-

-LRB-

x

A

-RRB-

B

-RRB-

-LRB-

Ahx

Bi

-RRB-

Proof

Every

reduction

path

of

length

n

of

x

-LRB-

Ahx

Bi

-RRB-

can

be

extended

to

a

reduction

path

of

length

n

of

x

-LRB-

-LRB-

x

A

-RRB-

B

-RRB-

by

prefixing

it

by

x

-LRB-

-LRB-

x

A

-RRB-

B

-RRB-

-LRB-

x

x

-LRB-

A

-RRB-

-RRB-

x

-LRB-

B

-RRB-

x

-LRB-

A

-RRB-

-LSB-

x

-LRB-

B

-RRB-

x

-RSB-

x

-LRB-

Ahx

Bi

-RRB-

Lemma

If

A

x

and

A

x

then

x

Proof

Induction

on

the

structure

of

A.

Definition

We

define

the

set

of

labelled

terms

l

by

the

following

abstract

syntax

A

j

A

n

A

j

A

j

AhAin

where

n

ranges

over

the

natural

numbers

We

define

by

induction

on

the

structure

of

terms

a

translation

T

x

l

T

-LRB-

x

-RRB-

T

-LRB-

AB

-RRB-

T

-LRB-

A

-RRB-

n

T

-LRB-

B

-RRB-

where

n

-LRB-

AB

-RRB-

T

-LRB-

x

A

-RRB-

T

-LRB-

A

-RRB-

T

-LRB-

Ahx

Bi

-RRB-

T

-LRB-

A

-RRB-

hT

-LRB-

B

-RRB-

in

where

n

-LRB-

Ahx

Bi

-RRB-

Note

that

for

all

A

x

T

-LRB-

A

-RRB-

is

well-defined

Definition

We

define

a

TRS

l

using

as

terms

the

set

l

and

having

the

reduction

relation

l

defined

by

-LRB-

A

-RRB-

m

B

l

AhBin

if

m

n

-LRB-

A

m

B

-RRB-

hCin

l

-LRB-

AhCip

-RRB-

q

-LRB-

BhCir

-RRB-

if

n

p

q

r

-LRB-

A

-RRB-

hCin

l

-LRB-

AhCin

-RRB-

AhCi

l

C

AhCi

l

A

A

m

B

l

A

n

B

if

m

n

AhBim

l

AhBin

if

m

n

Note

that

l

is

not

confluent

for

our

purposes

this

is

no

problem

since

l

is

only

designed

to

be

useful

for

proving

strong

normalisation

The

last

two

rules

are

called

Decr

in

-LSB-

Zantema

-RSB-

and

are

necessary

to

decrease

the

labels

of

applications

and

substitutions

if

inside

of

them

a

Beta-reduction

is

performed

Note

that

in

the

presence

of

the

Decr

rules

we

could

also

have

-LRB-

A

-RRB-

n

B

l

AhBin

for

all

n

instead

of

-LRB-

A

-RRB-

m

B

l

AhBin

for

all

m

n.

Lemma

The

relation

l

is

a

subrelation

of

some

recursive

path

order

-LRB-

That

is

there

is

a

precedence

relation

such

that

for

all

A

B

l

if

A

l

B

then

A

rpo

B

where

rpo

is

the

rpo

ordering

induced

by

-RRB-

Proof

Define

the

precedence

by

n

h

in

n

and

the

status

function

o

by

o

-LRB-

n

-RRB-

o

-LRB->=-RRB-

o

-LRB-

hin

-RRB-

lex

Then

l

is

a

subrelation

of

the

induced

recursive

path

order

rpo

Corrollary

l

is

SN

Proof

By

Theorem

rpo

of

Lemma

is

strongly

normalising

hence

by

Lemma

l

is

strongly

normalising

Lemma

If

A

x

and

A

x

then

T

-LRB-

A

-RRB-

l

T

-LRB-

-RRB-

Proof

Induction

on

the

structure

of

A

we

treat

some

of

the

more

interesting

cases

ffl

A

-LRB-

x

-RRB-

Beta

Then

T

-LRB-

A

-RRB-

-LRB-

T

-LRB-

-RRB-

-RRB-

m

T

-LRB-

-RRB-

l

T

-LRB-

-RRB-

hx

T

-LRB-

-RRB-

in

T

-LRB-

-RRB-

where

m

-LRB-

A

-RRB-

n

-LRB-

-RRB-

note

that

m

n

by

Lemma

ffl

A

-LRB-

-RRB-

hx

x

-LRB-

-RRB-

-LRB-

-RRB-

Then

T

-LRB-

A

-RRB-

-LRB-

T

-LRB-

-RRB-

m

T

-LRB-

-RRB-

-RRB-

hT

-LRB-

-RRB-

in

l

-LRB-

T

-LRB-

-RRB-

hT

-LRB-

-RRB-

ip

n

-LRB-

T

-LRB-

-RRB-

hT

-LRB-

-RRB-

iq

T

-LRB-

-RRB-

where

m

-LRB-

-RRB-

n

-LRB-

A

-RRB-

p

-LRB-

-RRB-

q

-LRB-

-RRB-

note

that

n

p

and

n

q.

ffl

A

xhx

x

Then

T

-LRB-

A

-RRB-

hT

-LRB-

-RRB-

im

l

T

-LRB-

-RRB-

T

-LRB-

-RRB-

where

m

-LRB-

A

-RRB-

ffl

A

gc

Then

T

-LRB-

A

-RRB-

T

-LRB-

-RRB-

hT

-LRB-

-RRB-

im

l

T

-LRB-

-RRB-

T

-LRB-

-RRB-

where

m

-LRB-

A

-RRB-

ffl

A

-LRB-

y

-RRB-

hx

x

y

-LRB-

-RRB-

Then

T

-LRB-

A

-RRB-

-LRB-

T

-LRB-

-RRB-

-RRB-

hT

-LRB-

-RRB-

im

l

-LRB-

T

-LRB-

-RRB-

hT

-LRB-

-RRB-

im

-RRB-

T

-LRB-

-RRB-

where

m

-LRB-

A

-RRB-

-LRB-

-RRB-

ffl

A

x

Then

T

-LRB-

A

-RRB-

T

-LRB-

-RRB-

m

T

-LRB-

-RRB-

IH

l

T

-LRB-

-RRB-

m

T

-LRB-

-RRB-

l

T

-LRB-

-RRB-

n

T

-LRB-

-RRB-

where

m

-LRB-

A

-RRB-

n

-LRB-

-RRB-

Corrollary

-LRB-

PSN

-RRB-

A

SN

x

-LRB-

-RRB-

A

x

x

preserves

strong

normalisation

AE

s

and

extensions

In

this

section

we

show

that

our

method

is

general

enough

to

show

PSN

for

other

calculi

of

explicit

substitutions

such

as

AE

of

-LSB-

BBLR

-RSB-

and

s

of

-LSB-

Kamareddine

Rios

-RSB-

and

also

some

extensions

of

x.

Furthermore

we

discuss

some

extensions

of

x

giving

a

counterexample

to

PSN

similar

to

the

one

of

-LSB-

Melli?es

-RSB-

but

less

involved

The

calculi

AE

and

s

Definition

Terms

and

substitutions

of

AE

are

defined

by

the

following

abstract

syntaxes

a

n

-LRB-

aa

-RRB-

-LRB-

a

-RRB-

-LRB-

a

-LSB-

s

-RSB-

-RRB-

s

a

-LRB-

s

-RRB-

where

n

ranges

over

the

set

g

The

reduction

relation

AE

is

the

union

of

AEBeta

and

AE

which

are

defined

by

-LRB-

a

-RRB-

b

AEBeta

a

-LSB-

b

-LRB-

ab

-RRB-

-LSB-

s

-RSB-

AE

a

-LSB-

s

-RSB-

b

-LSB-

s

-RSB-

-LRB-

a

-RRB-

-LSB-

s

-RSB-

AE

-LRB-

a

-LSB-

-LRB-

s

-RRB-

-RSB-

-RRB-

-LSB-

a

AE

a

n

-LSB-

a

AE

n

-LSB-

-LRB-

s

-RRB-

-RSB-

AE

n

-LSB-

-LRB-

s

-RRB-

-RSB-

AE

n

-LSB-

s

-RSB-

-LSB-

-RSB-

n

-LSB-

-RSB-

AE

n

Some

initial

intuition

to

motivate

the

reduction

rules

of

AE

a

-LSB-

b

stands

for

substitute

b

for

in

a

-LSB-

-LRB-

s

-RRB-

-RSB-

stands

for

the

substitution

obtained

by

first

raising

all

the

indices

in

s

by

and

substituting

not

the

index

but

the

index

and

-LSB-

-RSB-

stands

for

the

substitution

that

raises

all

numbers

-LRB-

in

the

term

in

front

of

it

-RRB-

by

An

example

to

explain

these

intuitive

motivations

is

the

following

-LRB-

For

reasons

of

legibility

we

have

removed

some

brackets

-RRB-

-LRB-

>=-LRB-

-LRB-

-RRB-

-RRB-

-RRB-

-LRB-

-RRB-

AEBeta

-LRB-

-LRB-

-RRB-

-RRB-

-LSB-

AE

>=-LRB-

-LRB-

-RRB-

-LSB-

-LRB-

=-RRB-

-RSB-

-RRB-

AE

-LRB-

-LSB-

-LRB-

=-RRB-

-RSB-

-LSB-

-LRB-

=-RRB-

-RSB-

-RRB-

AE

-LRB-

-LSB-

-LRB-

=-RRB-

-RSB-

-RRB-

AE

-LRB-

-LRB-

-LSB-

-LSB-

-RSB-

-RRB-

-RRB-

AE

-LRB-

-LRB-

-RRB-

-LSB-

-RSB-

-RRB-

AE

-LRB-

-LRB-

-LSB-

-RSB-

-LSB-

-RSB-

-RRB-

-RRB-

AE

-LRB-

-LRB-

-RRB-

-RRB-

For

a

detailed

explanation

and

motivation

of

the

system

AE

we

refer

to

-LSB-

BBLR

-RSB-

Definition

Terms

and

substitutions

of

s

are

defined

by

the

following

abstract

syntaxes

a

n

-LRB-

aa

-RRB-

-LRB-

a

-RRB-

-LRB-

OEija

-RRB-

-LRB-

aoeia

-RRB-

where

n

i

range

over

the

set

g

and

j

ranges

over

g

The

reduction

relation

s

is

the

union

of

sBeta

and

s

which

are

defined

by

-LRB-

a

-RRB-

b

sBeta

-LRB-

a

-RRB-

oeib

s

-LRB-

aoei

b

-RRB-

-LRB-

-RRB-

oeib

s

-LRB-

-RRB-

-LRB-

-RRB-

noeib

s

n

if

n

i

-LRB-

b

-RRB-

if

n

i

n

if

n

i

OEik

-LRB-

a

-RRB-

s

-LRB-

OEik

a

-RRB-

OEik

-LRB-

-RRB-

s

-LRB-

-RRB-

-LRB-

-RRB-

OEikn

s

ae

n

i

if

n

k

n

if

n

k

Again

we

do

n't

give

a

detailed

explanation

and

motivation

for

the

rules

of

this

calculus

but

refer

to

-LSB-

Kamareddine

Rios

-RSB-

Some

initial

intuition

oei

-LRB-

b

-RRB-

stands

for

the

substitution

of

b

for

i

OEik

-LRB-

a

-RRB-

stands

for

raise

all

the

numbers

n

k

in

the

term

a

with

i

To

explain

the

rules

we

treat

the

same

example

as

for

AE

-LRB-

>=-LRB-

-LRB-

-RRB-

-RRB-

-RRB-

-LRB-

-RRB-

sBeta

-LRB-

-LRB-

-RRB-

-RRB-

-LRB-

-RRB-

s

>=-LRB-

-LRB-

-RRB-

-LRB-

-RRB-

-RRB-

s

-LRB-

-LRB-

-RRB-

-RRB-

-LRB-

-LRB-

-RRB-

-RRB-

-RRB-

s

-LRB-

-LRB-

-LRB-

-RRB-

-RRB-

-RRB-

s

-LRB-

-LRB-

-RRB-

-RRB-

s

-LRB-

-LRB-

-LRB-

-RRB-

-LRB-

-RRB-

-RRB-

-RRB-

s

-LRB-

-LRB-

-RRB-

-RRB-

The

calculus

s

is

very

similar

to

AE

The

difference

is

mainly

in

the

moment

of

updating

in

AE

every

step

n

-LSB-

-LRB-

s

-RRB-

-RSB-

AE

n

-LSB-

s

-RSB-

-LSB-

-RSB-

creates

an

update

substitution

-LSB-

-RSB-

whereas

in

s

the

update

functionsymbol

OEik

is

only

created

at

the

actual

moment

of

substitution

in

noena

s

a.

Also

in

the

reductions

noeib

s

n

-LRB-

n

i

-RRB-

and

noeib

s

n

-LRB-

n

i

-RRB-

there

is

no

updatefunction

generated

whereas

in

n

-LSB-

-LRB-

s

-RRB-

-RSB-

AE

n

-LSB-

s

-RSB-

-LSB-

-RSB-

an

update

substitution

is

created

regardless

of

whether

the

substitution

-LSB-

-LRB-

s

-RRB-

-RSB-

is

binding

n

or

is

void

In

-LSB-

BBLR

-RSB-

it

is

shown

that

AE

has

PSN

by

contradicting

the

existence

of

a

minimal

infinite

AE-reduction

of

a

term

which

is

SN

for

in

-LSB-

Kamareddine

Rios

-RSB-

PSN

is

shown

to

hold

for

s

in

a

similar

way

We

show

that

AE

and

s

are

PSN

by

using

the

labelled

calculus

l

The

proof

is

very

similar

to

the

proof

of

PSN

for

x

that

we

gave

in

the

previous

section

For

AE

and

s

we

have

the

usual

properties

such

as

SN

CR

UN

for

AE

respectively

s

substitution

lemma

projection

lemma

soundness

lemma

and

confluence

for

AE

respectively

s

We

denote

the

AE-normal

form

respectively

s-normal

form

of

a

term

b

by

AE

-LRB-

b

-RRB-

respectively

s

-LRB-

b

-RRB-

Note

that

a

substitution

of

AE

is

of

the

form

n

-LRB-

b

=-RRB-

or

n

-LRB-

-RRB-

for

some

n

We

denote

reduction

on

AE-terms

as

well

as

on

s-terms

by

for

a

AE

respectively

s-term

a

we

write

-LRB-

a

-RRB-

to

denote

the

maximal

number

of

reduction

steps

starting

from

AE

-LRB-

a

-RRB-

respectively

s

-LRB-

a

-RRB-

if

this

number

exists

Definition

AE

fa

AE

a

-LSB-

AE

-LRB-

b

-RRB-

SN

-RSB-

g

s

fa

s

a

-LSB-

s

-LRB-

b

-RRB-

SN

-RSB-

g

Lemma

AE

is

closed

under

AE-reduction

s

is

closed

under

s-reduction

Definition

TAE

AE

l

is

defined

by

TAE

-LRB-

n

-RRB-

TAE

-LRB-

ab

-RRB-

TAE

-LRB-

a

-RRB-

p

TAE

-LRB-

b

-RRB-

where

p

-LRB-

ab

-RRB-

TAE

-LRB-

a

-RRB-

TAE

-LRB-

a

-RRB-

TAE

-LRB-

a

-LSB-

n

-LRB-

b

=-RRB-

-RSB-

-RRB-

TAE

-LRB-

a

-RRB-

hTAE

-LRB-

b

-RRB-

ip

where

p

-LRB-

a

-LSB-

n

-LRB-

b

=-RRB-

-RSB-

-RRB-

TAE

-LRB-

a

-LSB-

n

-LRB-

-RRB-

-RSB-

-RRB-

TAE

-LRB-

a

-RRB-

Ts

s

l

is

defined

by

Ts

-LRB-

n

-RRB-

Ts

-LRB-

ab

-RRB-

Ts

-LRB-

a

-RRB-

p

Ts

-LRB-

b

-RRB-

where

p

-LRB-

ab

-RRB-

Ts

-LRB-

a

-RRB-

Ts

-LRB-

a

-RRB-

Ts

-LRB-

aoeib

-RRB-

Ts

-LRB-

a

-RRB-

hTs

-LRB-

b

-RRB-

ip

where

p

-LRB-

aoeib

-RRB-

Ts

-LRB-

OEij

a

-RRB-

Ts

-LRB-

a

-RRB-

Lemma

If

a

AE

and

a

AE

b

then

TAE

-LRB-

a

-RRB-

lTAE

-LRB-

b

-RRB-

If

a

AE

and

a

AEBeta

b

then

TAE

-LRB-

a

-RRB-

l

TAE

-LRB-

b

-RRB-

If

a

s

and

a

s

b

then

Ts

-LRB-

a

-RRB-

lTs

-LRB-

b

-RRB-

If

a

s

and

a

sBeta

b

then

Ts

-LRB-

a

-RRB-

l

Ts

-LRB-

b

-RRB-

Proof

Induction

on

the

structure

of

a.

Theorem

a

SN

AE

-LRB-

-RRB-

a

AE

AE

has

PSN

a

SN

s

-LRB-

-RRB-

a

s

s

has

PSN

Proof

-RRB-

by

projection

-LRB-

since

AE

is

SN

any

infinite

AE-reduction

must

contain

infinitely

many

AEBeta-steps

Therefore

an

infinite

reduction

of

a

pure

term

which

is

SN

for

translates

by

TAE

into

an

infinite

l-reduction

which

is

impossible

by

follows

from

similar

to

Extensions

of

x

In

this

section

we

consider

several

extensions

of

x

with

some

kind

of

composition

The

calculus

oe

of

-LSB-

Abadi

et

al.

-RSB-

was

designed

to

be

able

to

compose

substitutions

The

price

however

is

not

having

PSN

-LRB-

cf.

-LSB-

Melli?es

-RSB-

-RRB-

Since

x

has

no

composition

but

does

have

PSN

it

is

an

interesting

question

where

the

borderline

is

between

PSN

and

composition

of

substitutions

We

start

with

a

short

discussion

of

oe

For

the

precise

definition

of

oe

the

reader

is

referred

to

-LSB-

Abadi

et

al.

-RSB-

The

composition

of

substitutions

in

oe

is

mainly

performed

by

two

rules

Comp

and

Map

The

first

glues

two

substitutions

together

a

-LSB-

s

-RSB-

-LSB-

t

-RSB-

Comp

a

-LSB-

sffit

-RSB-

while

Map

allows

the

distribution

of

the

second

substitution

over

the

first

-LRB-

-RRB-

ffit

Map

b

-LSB-

t

-RSB-

-LRB-

-LRB-

-RRB-

ffit

-RRB-

Map

b

-LSB-

t

-RSB-

c

-LSB-

t

-RSB-

-LRB-

-RRB-

As

was

pointed

out

in

-LSB-

Kamareddine

Nederpelt

-RSB-

the

substitutions

of

oe

are

roughly

the

same

as

simultaneous

parallel

substitutions

in

the

following

extension

of

x

terms

t

x

tt

x

t

th

x

ti

where

h

x

ti

is

shorthand

for

xm

tmi

reductions

are

similar

as

for

x

plus

the

composition

rule

ah

x

bih

y

ci

ah

x

y

y

ci

bmh

y

ci

ci

In

this

calculus

one

can

imitate

the

counterexample

to

PSN

of

oe

-LRB-

cf

-LSB-

Melli?es

-RSB-

-RRB-

In

fact

even

the

calculus

x

extended

with

the

rule

ahx

bihy

ci

ahx

bhy

cii

if

y

FV

-LRB-

a

-RRB-

-LRB-

no

simultaneous

substitutions

needed

-RRB-

does

n't

have

PSN

We

give

an

infinite

derivation

starting

from

the

term

y

:-LRB-

x

-RRB-

-LRB-

-LRB-

y

a

-RRB-

b

-RRB-

-LRB-

-LRB-

y

a

-RRB-

b

-RRB-

Note

that

this

term

is

even

simpler

than

the

term

used

in

-LSB-

Melli?es

-RSB-

First

we

define

substitutions

i

for

m

IN

by

hy

=-LRB-

y

a

-RRB-

bi

m

hy

bffmi

Now

consider

the

following

three

reductions

-LRB-

For

simplicity

we

forget

about

the

variable

convention

during

this

counterexample

furthermore

we

freely

change

bound

variables

if

convenient

-RRB-

-LRB-

y

:-LRB-

x

-RRB-

-LRB-

-LRB-

y

a

-RRB-

b

-RRB-

-RRB-

-LRB-

-LRB-

y

a

-RRB-

b

-RRB-

=-LRB-

y

a

-RRB-

bihy

=-LRB-

y

a

-RRB-

bi

=-LRB-

-LRB-

y

a

-RRB-

b

-RRB-

hy

=-LRB-

y

a

-RRB-

bii

=-LRB-

y

ahy

=-LRB-

y

a

-RRB-

bi

-RRB-

-LRB-

bhy

=-LRB-

y

a

-RRB-

bi

-RRB-

i

=-LRB-

y

-RRB-

-LRB-

-RRB-

i

m

=-LRB-

y

a

-RRB-

bihy

bffmi

=-LRB-

-LRB-

y

a

-RRB-

b

-RRB-

hy

bffmii

=-LRB-

y

ahy

bffmi

-RRB-

-LRB-

bhy

bffmi

-RRB-

i

=-LRB-

y

affm

-RRB-

-LRB-

bffm

-RRB-

i

affm

hy

bffm

ii

affm

m

i

affm

n

bffmihy

bffni

bffmhy

bffnii

bffm

n

i

These

combine

into

an

infinite

derivation

in

the

following

way

-LRB-

y

:-LRB-

x

-RRB-

-LRB-

-LRB-

y

a

-RRB-

b

-RRB-

-RRB-

-LRB-

-LRB-

y

a

-RRB-

b

-RRB-

m

affm

m

m

Recall

that

we

proved

PSN

by

showing

that

every

term

of

which

the

x-normal

form

of

any

of

its

subterms

is

in

SN

is

also

SN

for

Beta

-LSB-

x.

With

the

extra

composition

reduction

defined

above

there

is

an

easy

counterexample

to

that

the

term

xhy

zzihz

w

wwi

has

x-normalform

x

-LRB-

and

is

also

SN

for

x-reduction

-RRB-

but

it

has

as

a

subterm

of

a

reduct

if

composition

is

allowed

This

example

also

shows

why

our

method

fails

for

the

system

extended

with

the

extra

composition

rule

and

hence

also

for

oe

T

-LRB-

xhy

zzihz

w

wwi

-RRB-

h

>=-LRB-

-RRB-

whereas

after

composition

of

the

two

substitutions

the

label

of

the

innermost

substitution

does

not

exist

T

-LRB-

xhy

-LRB-

zz

-RRB-

hz

w

wwii

-RRB-

h

-LRB-

-RRB-

h

>=-LRB-

-RRB-

So

reduction

in

oe

does

not

always

decrease

T

images

One

can

try

to

give

a

rule

for

composition

of

substitutions

such

that

reduction

still

decreases

T

images

the

following

rule

seems

best

fit

for

this

purpose

ahx

bihy

ci

ahx

bhy

cii

if

y

FV

-LRB-

a

-RRB-

x

FV

-LRB-

x

-LRB-

a

-RRB-

-RRB-

The

idea

behind

this

rule

is

that

if

x

FV

-LRB-

x

-LRB-

a

-RRB-

-RRB-

then

bhy

ci

will

occur

as

a

subterm

of

some

x-reduct

Hence

allowing

to

create

bhy

ci

at

this

point

will

not

spoil

PSN

We

strongly

believe

that

adding

this

reduction

rule

does

not

spoil

SN

-LRB-

i.e.

x

extended

with

the

rule

has

PSN

-RRB-

but

we

have

not

been

able

to

prove

it

Proof

of

PSN

using

labelled

trees

In

this

section

we

outline

a

proof

of

the

Preservation

of

Strong

Normalization

property

again

using

the

RPO

technique

but

now

in

the

way

it

has

been

presented

in

-LSB-

Klop

-RSB-

One

then

looks

at

the

collection

of

commutative

finite

labelled

trees

Tree

-LRB-

i.e.

trees

are

identified

upto

permutation

of

branches

there

is

no

order

from

left

to

right

in

the

subtrees

-RRB-

The

labels

are

taken

from

IN

Furthermore

one

looks

at

the

set

Tree

where

some

nodes

in

a

tree

may

have

a

marker

It

is

convenient

to

denote

the

tree

with

root

node

n

and

subtrees

tp

by

n

-LRB-

tp

-RRB-

and

similarly

if

the

root

node

has

a

marker

by

n

-LRB-

tp

-RRB-

In

the

following

we

abbreviate

tp

to

t.

On

these

commutative

labelled

trees

with

markers

-LRB-

the

set

Tree

-RRB-

a

reduction

relation

is

defined

Definition

The

relation

on

Tree

is

defined

as

follows

n

-LRB-

t

-RRB-

n

-LRB-

t

-RRB-

n

-LRB-

t

-RRB-

m

-LRB-

n

-LRB-

t

-RRB-

n

-LRB-

t

-RRB-

-RRB-

if

m

n

zero

or

more

copies

of

n

-LRB-

t

-RRB-

n

-LRB-

s

t

-RRB-

n

-LRB-

s

s

t

-RRB-

zero

or

more

copies

of

s

n

-LRB-

t

-RRB-

ti

i

p

Furthermore

the

relation

is

compatible

with

the

tree-forming

operations

that

is

if

ti

then

n

-LRB-

ti

tp

-RRB-

n

-LRB-

tp

-RRB-

As

usual

the

relation

denotes

the

transitive

closure

of

and

denotes

the

transitive

reflexive

closure

of

For

examples

on

the

use

of

these

rules

we

refer

to

-LSB-

Klop

-RSB-

we

just

mention

the

main

result

which

will

be

applied

here

to

the

issue

of

PSN

for

explicit

substituion

Theorem

-LRB-

-LSB-

Klop

-RSB-

-LSB-

Dershowitz

-RSB-

-RRB-

The

relation

is

well-founded

on

Tree

-LRB-

the

set

of

trees

without

markers

-RRB-

To

prove

PSN

for

the

calculus

x

we

now

proceed

by

defining

a

reduction

preserving

mapping

T

from

x

to

Tree

if

M

x

N

then

M

N

and

if

M

Beta

N

then

M

N

Hence

using

the

fact

that

x

is

strongly

normalizing

we

can

again

conclude

that

every

M

x

is

strongly

normalizing

and

so

that

x

has

the

PSN

property

For

notational

convenience

we

abbreviate

the

sequence

of

definitions

hxn

Pni

to

hx

=P

i.

Definition

For

M

x

we

define

the

tree

T

-LRB-

M

-RRB-

by

induction

on

the

length

of

M

as

follows

T

-LRB-

x

-RRB-

T

-LRB-

QN

-RRB-

-LRB-

QN

-RRB-

R

T

-LRB-

Q

-RRB-

T

-LRB-

N

-RRB-

T

-LRB-

y

N

-RRB-

T

-LRB-

N

-RRB-

T

-LRB-

yhx

=P

i

-RRB-

R

T

-LRB-

-RRB-

T

-LRB-

Pn

-RRB-

if

y

xng

T

-LRB-

xihx

=P

i

-RRB-

ss

R

T

-LRB-

-RRB-

T

-LRB-

Pi

-RRB-

T

-LRB-

Pihxi

Pi

i

hxn

Pni

-RRB-

T

-LRB-

-LRB-

QN

-RRB-

hx

=P

i

-RRB-

-LRB-

-LRB-

QN

-RRB-

hx

=P

i

-RRB-

R

T

-LRB-

Qhx

=P

i

-RRB-

T

-LRB-

N

hx

=P

i

-RRB-

T

-LRB-

-LRB-

y

N

-RRB-

hx

=P

i

-RRB-

T

-LRB-

N

hx

=P

i

-RRB-

The

following

Lemmas

show

that

T

preserves

reductions

-LRB-

in

the

right

sense

as

announced

above

-RRB-

The

proofs

of

these

Lemmas

are

not

difficult

the

main

complication

being

to

find

out

the

right

induction

loadings

-LRB-

and

the

right

order

on

which

the

induction

should

be

done

-RRB-

We

just

outline

the

proofs

Lemma

For

M

x

if

M

x

N

then

T

-LRB-

M

-RRB-

T

-LRB-

N

-RRB-

Proof

By

induction

on

the

length

of

M

distinguishing

subcases

according

to

the

structure

of

M

Note

that

we

need

Lemma

to

make

sure

that

N

x

and

hence

that

T

-LRB-

N

-RRB-

is

well-defined

The

following

two

Lemmas

are

sublemmas

necessary

for

the

proof

of

preservation

of

Betareduction

by

T

Lemma

For

N

hx

=P

i

x

T

-LRB-

N

hx

=P

i

-RRB-

T

-LRB-

N

-RRB-

Proof

By

induction

on

the

length

of

N

Lemma

For

-LRB-

-LRB-

y

N

-RRB-

Q

-RRB-

hx

=P

i

x

T

-LRB-

-LRB-

-LRB-

y

N

-RRB-

Q

-RRB-

hx

=P

i

-RRB-

T

-LRB-

N

hy

Qihx

=P

i

-RRB-

Proof

By

induction

on

the

length

of

N

using

Lemma

First

write

N

as

Rhy

Qi

with

R

not

a

term

that

ends

with

a

substitution

item

-LRB-

So

the

sequence

hy

Qi

should

be

taken

as

long

as

possible

-RRB-

Then

distinguish

cases

according

to

the

structure

of

R.

Corrollary

The

calculus

x

has

the

PSN

property

Conclusions

We

have

introduced

a

new

method

for

proving

PSN

of

lambda

calculi

with

explicit

substitution

The

method

involves

four

steps

ffl

determine

a

suitable

set

contained

in

the

set

of

strongly

normalising

terms

in

the

explicit

substitution

calculus

containing

the

pure

SN

terms

and

closed

under

explicit

substitution

reduction

ffl

give

a

translation

from

this

set

into

a

first

order

term

rewrite

system

ffl

define

a

strongly

normalising

reduction

relation

on

this

TRS

by

giving

a

well-founded

precedence

ffl

show

that

the

translation

preserves

infinite

reduction

paths

For

named

calculi

the

translation

identifies

all

variables

for

calculi

using

de

Bruijn

indices

the

translation

identifies

all

indices

and

erases

update

functions

giving

evidence

for

the

statement

update

functions

do

not

matter

for

termination

issues

Kruskal

's

theorem

ensures

that

a

wellfounded

precedence

yields

a

strongly

normalizing

term

rewrite

system

Further

applications

of

this

method

that

are

under

investigation

ffl

give

a

maximal

strategy

for

x-reduction

and

an

inductive

characterization

of

the

set

x

ffl

give

a

general

PSN

proof

for

combinator

reduction

systems

with

explicit

substitution

-LRB-

cf.

-LSB-

Rose

-RSB-

-LSB-

Bloo

Rose

-RSB-

-RRB-

ffl

give

a

-LRB-

first

order

-RRB-

calculus

with

explicit

substitution

which

has

PSN

as

well

as

confluence

on

open

terms

Acknowledgements

Thanks

to

Thomas

Arts

for

making

us

aware

of

current

notations

for

the

recursive

path

orders

using

semantic

labelling

We

have

also

benefitted

from

discussions

with

the

following

people

Hans

Zantema

Gilles

Barthe

Daniel

Briaud

Twan

Laan

Pierre

Lescanne

Rob

Nederpelt

and

Kristoffer

Rose

References

-LSB-

Abadi

et

al.

-RSB-

Abadi

M.

Cardelli

L.

Curien

P.-L.

and

L?evy

J.-J.

Explicit

substitutions

in

POPL

Seventeenth

Annual

ACM

Symposium

on

Principles

of

Programming

Languages

-LRB-

San

Francisco

California

jan.

-RRB-

-LSB-

Abramsky

et

al.

-RSB-

Abramsky

S.

Gabbay

Dov

M.

and

Maibaum

T.

S.

E.

-LRB-

eds

-RRB-

Handbook

of

Logic

in

Computer

Science

Vol

II

Oxford

University

Press

-LSB-

Bloo

-RSB-

Bloo

R.

Preservation

of

Strong

Normalisation

for

Explicit

Substitution

Computing

Science

Report

Eindhoven

University

of

Technology

-LSB-

Bloo

Rose

-RSB-

Bloo

R.

and

Rose

K.

H.

Preservation

of

Strong

Normalisation

in

Named

Lambda

Calculi

with

Explicit

Substitution

and

Garbage

Collection

in

J.C.

van

Vliet

ed.

Proceedings

of

CSN

-LRB-

Computing

Science

in

the

Netherlands

-RRB-

ISBN

90 6196 460

also

available

as

technical

report

via

WWW

URL

ftp

-LSB-

Bloo

Rose

-RSB-

Bloo

R.

and

Rose

K.

H.

Combinatory

Reduction

Systems

with

Explicit

Substitution

that

Preserve

Strong

Normalisation

to

appear

in

Proceedings

of

RTA

-LSB-

Dershowitz

-RSB-

Dershowitz

N.

A

note

on

simplification

orderings

Inf

Proc

Letters

-LRB-

-RRB-

-LCB-

-LSB-

Ferreira

Zantema

-RSB-

Ferreira

M.C.F.

and

Zantema

H.

Well-foundedness

of

Term

Orderings

Technical

Report

Utrecht

University

-LSB-

BBLR

-RSB-

Benaissa

Z.E.A.

Briaud

D.

Lescanne

P.

and

Rouyer-Degli

J.

AE

a

calculus

of

explicit

substitutions

which

preserves

strong

normalisation

accepted

for

publication

in

Journal

of

Functional

Programming

-LSB-

Kamareddine

Nederpelt

-RSB-

Kamareddine

F.

and

Nederpelt

R.P.

On

stepwise

explicit

substitution

International

Journal

of

Foundations

of

Computer

Science

-LRB-

-RRB-

-LCB-

-LSB-

Kamareddine

Rios

-RSB-

Kamareddine

F.

and

Rios

A.

calculus

a

la

de

Bruijn

explicit

substitution

Lecture

Notes

in

Computer

Science

Vol

international

symposium

on

Programming

Languages

Implementations

Logics

and

Programs

PLILP

pages

-LCB-

Springer-Verlag

-LSB-

Klop

-RSB-

Klop

J.

W.

Term

rewrite

systems

in

-LSB-

Abramsky

et

al.

-RSB-

-LSB-

Melli?es

-RSB-

Melli?es

P.-A.

Typed

calculi

with

explicit

substitutions

may

not

terminate

in

Proceedings

of

TLCA

Lecture

Notes

in

Computer

Science

Vol

eds

M.

Dezani-Ciancaglini

and

G.

Plotkin

-LSB-

Rose

-RSB-

Rose

K.

H.

Combinator

Reduction

Systems

with

Explicit

Substitution

in

Proceedings

of

HOA

-LRB-

Second

International

Workshop

on

Higher-Order

Algebra

Logic

and

Term

Rewriting

-RRB-

Paderborn

Germany

also

available

as

technical

report

via

WWW

URL

ftp

-LSB-

Zantema

-RSB-

Zantema

H.

Termination

of

Term

Rewriting

by

Semantic

Labelling

Fundamenta

Informaticae

Vol

-LRB-

-RRB-

pp.

-LCB-

explicit substitution
recursive path order