“Parametric Lambda Calculus”

Transcript

“Parametric Lambda Calculus”
“Parametric Lambda Calculus”
Simona Ronchi Della Rocca
Luca Paolini
[email protected]
Università di Torino
Dipartimento di Informatica
FOLLIA - Torino, 2006 – p. 1/56
Outline
Historical Introduction
FOLLIA - Torino, 2006 – p. 2/56
Outline
Historical Introduction
The syntax of the parametric λ calculus
FOLLIA - Torino, 2006 – p. 2/56
Outline
Historical Introduction
The syntax of the parametric λ calculus
The fundamental properties: Confluence and
Standardization
FOLLIA - Torino, 2006 – p. 2/56
Outline
Historical Introduction
The syntax of the parametric λ calculus
The fundamental properties: Confluence and
Standardization
The Universal Reduction Machine
FOLLIA - Torino, 2006 – p. 2/56
Outline
Historical Introduction
The syntax of the parametric λ calculus
The fundamental properties: Confluence and
Standardization
The Universal Reduction Machine
The Operational Semantics
FOLLIA - Torino, 2006 – p. 2/56
Outline
Historical Introduction
The syntax of the parametric λ calculus
The fundamental properties: Confluence and
Standardization
The Universal Reduction Machine
The Operational Semantics
Crossing Call-by-name and Call-by-value
FOLLIA - Torino, 2006 – p. 2/56
A bit of history
∼ 1930 The λ-calculus as logical foundation of mathematics
(Curry)
The λ-calculus as intensional language for the
computable functions (Curry, Kleene, Turing)
FOLLIA - Torino, 2006 – p. 3/56
A bit of history
∼ 1930 The λ-calculus as logical foundation of mathematics
(Curry)
The λ-calculus as intensional language for the
computable functions (Curry, Kleene, Turing)
∼ 1960 LISP: the first programming language inspired by
λ-calculus (MC Carthy)
The translation of Algol 60 into λ-calculus (Landin)
The language CUCH (Böhm and Gross)
The Separability Theorem (Böhm)
FOLLIA - Torino, 2006 – p. 3/56
A bit of history
∼ 1930 The λ-calculus as logical foundation of mathematics
(Curry)
The λ-calculus as intensional language for the
computable functions (Curry, Kleene, Turing)
∼ 1960 LISP: the first programming language inspired by
λ-calculus (MC Carthy)
The translation of Algol 60 into λ-calculus (Landin)
The language CUCH (Böhm and Gross)
The Separability Theorem (Böhm)
∼ 1970 The denotational semantics of λ-calculus (Scott)
The λ-βv -calculus (Plotkin)
FOLLIA - Torino, 2006 – p. 3/56
A bit of history
1980 − 90 The incompleteness of λ-calculus
(Ronchi, Honsell)
The full-abstraction problem (Plotkin, Berry)
The lazy λ-calculus (Abramsky)
Other λ-calculi....
FOLLIA - Torino, 2006 – p. 4/56
Some λ-calculi
The classical λ-calculus:
a paradigmatic language for the call-by-name
computations.
FOLLIA - Torino, 2006 – p. 5/56
Some λ-calculi
The classical λ-calculus:
a paradigmatic language for the call-by-name
computations.
The λ-βv -calculus:
a paradigmatic language for the lazy-call-by-value
computations.
FOLLIA - Torino, 2006 – p. 5/56
“Historia magistra vitae”
question:
Is there a unique paradigmatic language, that can
model all the computations listed before (and may be
that can suggest new computations)?
FOLLIA - Torino, 2006 – p. 6/56
“Historia magistra vitae”
question:
Is there a unique paradigmatic language, that can
model all the computations listed before (and may be
that can suggest new computations)?
answer:
The parametric λ-calculus.
FOLLIA - Torino, 2006 – p. 6/56
The parametric λ-calculus
The parametric λ-calculus is an abstract calculus with some
basic requirements, parametric with respect to a set of
terms. Different instantiations of the parameter produce a
different λ-calculus.
FOLLIA - Torino, 2006 – p. 7/56
The parametric λ-calculus
The parametric λ-calculus is an abstract calculus with some
basic requirements, parametric with respect to a set of
terms. Different instantiations of the parameter produce a
different λ-calculus.
It allows to generalize definitions, properties and proofs
FOLLIA - Torino, 2006 – p. 7/56
The parametric λ-calculus
The parametric λ-calculus is an abstract calculus with some
basic requirements, parametric with respect to a set of
terms. Different instantiations of the parameter produce a
different λ-calculus.
It allows to generalize definitions, properties and proofs
It is a natural starting point for the study of new calculi
FOLLIA - Torino, 2006 – p. 7/56
The parametric λ-calculus
The parametric λ-calculus is an abstract calculus with some
basic requirements, parametric with respect to a set of
terms. Different instantiations of the parameter produce a
different λ-calculus.
It allows to generalize definitions, properties and proofs
It is a natural starting point for the study of new calculi
It helps the investigations of the relations between
different calculi
FOLLIA - Torino, 2006 – p. 7/56
The Syntax
The set Λ is produced by
M ::= x | M M | λx.M
FOLLIA - Torino, 2006 – p. 8/56
The Syntax
The set Λ is produced by
M ::= x | M M | λx.M
Let ∆ ⊆ Λ. The ∆-reduction (→∆ ) is
the contextual closure of the following rule:
(λx.M )N →∆ M [N/x] if and only if N ∈ ∆
FOLLIA - Torino, 2006 – p. 8/56
Set of Input Values
Let ∆ ⊆ Λ.
∆ is a set of input values, when:
FOLLIA - Torino, 2006 – p. 9/56
Set of Input Values
Let ∆ ⊆ Λ.
∆ is a set of input values, when:
Var ⊆ ∆
(variable closure)
FOLLIA - Torino, 2006 – p. 9/56
Set of Input Values
Let ∆ ⊆ Λ.
∆ is a set of input values, when:
Var ⊆ ∆
P, Q ∈ ∆ implies P [Q/x] ∈ ∆,
(variable closure)
(substitution closure)
FOLLIA - Torino, 2006 – p. 9/56
Set of Input Values
Let ∆ ⊆ Λ.
∆ is a set of input values, when:
Var ⊆ ∆
P, Q ∈ ∆ implies P [Q/x] ∈ ∆,
(variable closure)
(substitution closure)
M ∈ ∆ and M →∆ N imply N ∈ ∆
(reduction closure)
FOLLIA - Torino, 2006 – p. 9/56
Set of Input Values
Let ∆ ⊆ Λ.
∆ is a set of input values, when:
Var ⊆ ∆
P, Q ∈ ∆ implies P [Q/x] ∈ ∆,
(variable closure)
(substitution closure)
M ∈ ∆ and M →∆ N imply N ∈ ∆
(reduction closure)
The above requirements assure that the status of being
an input value is preserved during the evalution
process.
FOLLIA - Torino, 2006 – p. 9/56
Some λ∆-calculi
Λ is a set of input values
(the λΛ-calculus is the classical λ-calculus)
FOLLIA - Torino, 2006 – p. 10/56
Some λ∆-calculi
Λ is a set of input values
(the λΛ-calculus is the classical λ-calculus)
Γ = V ar ∪ {λx.M | M ∈ Λ} is a set of input values
(the λΓ-calculus is the Plotkin’s λβv -calculus)
FOLLIA - Torino, 2006 – p. 10/56
Some λ∆-calculi
Λ is a set of input values
(the λΛ-calculus is the classical λ-calculus)
Γ = V ar ∪ {λx.M | M ∈ Λ} is a set of input values
(the λΓ-calculus is the Plotkin’s λβv -calculus)
Ξ = V ar ∪ {M | M is a closed β normal form } is a set
of input value
FOLLIA - Torino, 2006 – p. 10/56
Some λ∆-calculi
Λ is a set of input values
(the λΛ-calculus is the classical λ-calculus)
Γ = V ar ∪ {λx.M | M ∈ Λ} is a set of input values
(the λΓ-calculus is the Plotkin’s λβv -calculus)
Ξ = V ar ∪ {M | M is a closed β normal form } is a set
of input value
ΛI , defined by the following grammar:
M ::= x | M M | λx.M (x ∈ F V (M ))
is a set of input values
FOLLIA - Torino, 2006 – p. 10/56
Non Input Values
Λ-normal forms are not input values
FOLLIA - Torino, 2006 – p. 11/56
Non Input Values
Λ-normal forms are not input values
Λ-head normal forms are not input values
FOLLIA - Torino, 2006 – p. 11/56
Non Input Values
Λ-normal forms are not input values
Λ-head normal forms are not input values
Γ-normal forms are not input values
FOLLIA - Torino, 2006 – p. 11/56
Confluence
M →∗∆ N1 and M →∗∆ N2 imply there is N3 such that both
N1 →∗∆ N3 and N2 →∗∆ N3 .
FOLLIA - Torino, 2006 – p. 12/56
Confluence
M →∗∆ N1 and M →∗∆ N2 imply there is N3 such that both
N1 →∗∆ N3 and N2 →∗∆ N3 .
The closure conditions on the set ∆ of input values
assure that the corresponding λ-∆-calculus enjoys the
confluence property.
The closure conditions are sufficient but not necessary
for garantee the confluence property (instead of the
reduction closure it would be sufficent to have:
M ∈ ∆ and M →∗∆ N imply there is P ∈ ∆ such that
N →∗∆ P . )
FOLLIA - Torino, 2006 – p. 12/56
Confluence
M →∗∆ N1 and M →∗∆ N2 imply there is N3 such that both
N1 →∗∆ N3 and N2 →∗∆ N3 .
The closure conditions on the set ∆ of input values
assure that the corresponding λ-∆-calculus enjoys the
confluence property.
The closure conditions are sufficient but not necessary
for garantee the confluence property (instead of the
reduction closure it would be sufficent to have:
M ∈ ∆ and M →∗∆ N imply there is P ∈ ∆ such that
N →∗∆ P . )
FOLLIA - Torino, 2006 – p. 12/56
A counterexample
Let us take Λ-normal forms as input values.
Then the confluence fails, in fact:
(λx.(λy.z)(x(λx.xx)))(λx.xx) reduces to both z and
(λy.z)((λx.xx)(λx.xx)), which do not have a common reduct.
FOLLIA - Torino, 2006 – p. 13/56
Standardization
M →∗∆ N implies there is a standard reduction sequence
such that M →∗∆ N (M →s∆ N ) .
FOLLIA - Torino, 2006 – p. 14/56
Standardization
M →∗∆ N implies there is a standard reduction sequence
such that M →∗∆ N (M →s∆ N ) .
In case of λΛ-calculus a standard reduction sequence is a
strategy choosing redexes from left to right. It is not easy to
formalize such a strategy for other sets of input values.
FOLLIA - Torino, 2006 – p. 14/56
Standardization
M →∗∆ N implies there is a standard reduction sequence
such that M →∗∆ N (M →s∆ N ) .
In case of λΛ-calculus a standard reduction sequence is a
strategy choosing redexes from left to right. It is not easy to
formalize such a strategy for other sets of input values.
(λx.x(KI))(II) →Λ II(KI) →Λ I(KI) →Λ I(λy.I)
is a standard reduction sequence in the λΛ-calculus.
FOLLIA - Torino, 2006 – p. 14/56
Standardization
M →∗∆ N implies there is a standard reduction sequence
such that M →∗∆ N (M →s∆ N ) .
In case of λΛ-calculus a standard reduction sequence is a
strategy choosing redexes from left to right. It is not easy to
formalize such a strategy for other sets of input values.
(λx.x(KI))(II) →Λ II(KI) →Λ I(KI) →Λ I(λy.I)
is a standard reduction sequence in the λΛ-calculus.
The reduction sequence reducing the same term from left
to right in the λΓ-calculus:
(λx.x(KI))(II) →Γ (λx.x(λy.I))(II) →Γ (λx.x(λy.I))I →Γ I(λy.I)
is not a standard reduction sequence!
FOLLIA - Torino, 2006 – p. 14/56
Sequentialization
The ∆-sequentialization (M )◦ of a term M is a function
from Λ to Λ defined as follows:
(xM1 ...Mm )◦ = x(M1 )◦ ...(Mm )◦ ;
((λx.P )QM1 ...Mm )◦ = (λx.P )◦ (Q)◦ (M1 )◦ ...(Mm )◦
if Q ∈ ∆;
((λx.P )QM1 ...Mm )◦ = (Q)◦ (λx.P )◦ (M1 )◦ ...(Mm )◦
if Q 6∈ ∆;
(λx.P )◦ = λx.(P )◦ .
FOLLIA - Torino, 2006 – p. 15/56
Sequentialization
The ∆-sequentialization (M )◦ of a term M is a function
from Λ to Λ defined as follows:
(xM1 ...Mm )◦ = x(M1 )◦ ...(Mm )◦ ;
((λx.P )QM1 ...Mm )◦ = (λx.P )◦ (Q)◦ (M1 )◦ ...(Mm )◦
if Q ∈ ∆;
((λx.P )QM1 ...Mm )◦ = (Q)◦ (λx.P )◦ (M1 )◦ ...(Mm )◦
if Q 6∈ ∆;
(λx.P )◦ = λx.(P )◦ .
The degree of a redex R in M is the numbers of λ’s
which both are active in M and occur on the left of (R)◦
in (M )◦ .
(A symbol λ in a term M is active if and only if it is the first symbol of a ∆-redex of M ).
FOLLIA - Torino, 2006 – p. 15/56
Sequentialization
A sequence M ≡ P0 →∆ P1 →∆ ... →∆ Pn →∆ N is
standard if and only if the degree of the redex
contracted in Pi is less than or equal to the degree of
the redex contracted in Pi+1 , for every i < n.
FOLLIA - Torino, 2006 – p. 16/56
Sequentialization
A sequence M ≡ P0 →∆ P1 →∆ ... →∆ Pn →∆ N is
standard if and only if the degree of the redex
contracted in Pi is less than or equal to the degree of
the redex contracted in Pi+1 , for every i < n.
A set ∆ of input values is standard if and only if M 6∈ ∆
and M →∗∆ N by reducing at every step a not principal
redex imply N 6∈ ∆.
(The principal redex is the redex of degree 0
corresponding to the head redex in the λΛ-calculus )
FOLLIA - Torino, 2006 – p. 16/56
Sequentialization
A sequence M ≡ P0 →∆ P1 →∆ ... →∆ Pn →∆ N is
standard if and only if the degree of the redex
contracted in Pi is less than or equal to the degree of
the redex contracted in Pi+1 , for every i < n.
A set ∆ of input values is standard if and only if M 6∈ ∆
and M →∗∆ N by reducing at every step a not principal
redex imply N 6∈ ∆.
(The principal redex is the redex of degree 0
corresponding to the head redex in the λΛ-calculus )
A λ∆-calculus is standard if and only if the set ∆ is
standard
FOLLIA - Torino, 2006 – p. 16/56
Sequentialization
A sequence M ≡ P0 →∆ P1 →∆ ... →∆ Pn →∆ N is
standard if and only if the degree of the redex
contracted in Pi is less than or equal to the degree of
the redex contracted in Pi+1 , for every i < n.
A set ∆ of input values is standard if and only if M 6∈ ∆
and M →∗∆ N by reducing at every step a not principal
redex imply N 6∈ ∆.
(The principal redex is the redex of degree 0
corresponding to the head redex in the λΛ-calculus )
A λ∆-calculus is standard if and only if the set ∆ is
standard
To be standard is a necessary and sufficent condition
for enjoying the standardization property.
FOLLIA - Torino, 2006 – p. 16/56
Standardization (examples)
(λx.x(KI))(II) →Γ (λx.x(KI))I →Γ I(KI) →Γ I(λy.I)
is a standard reduction sequence in the λΓ-calculus.
FOLLIA - Torino, 2006 – p. 17/56
Standardization (examples)
(λx.x(KI))(II) →Γ (λx.x(KI))I →Γ I(KI) →Γ I(λy.I)
is a standard reduction sequence in the λΓ-calculus.
The set of input values Λ, Γ, Ξ are standard.
FOLLIA - Torino, 2006 – p. 17/56
Standardization (examples)
(λx.x(KI))(II) →Γ (λx.x(KI))I →Γ I(KI) →Γ I(λy.I)
is a standard reduction sequence in the λΓ-calculus.
The set of input values Λ, Γ, Ξ are standard.
The set of input values ΛI is not standard.
FOLLIA - Torino, 2006 – p. 17/56
Evaluation
The principal evaluation is a sequence of reduction
performing at every step the principal redex.
FOLLIA - Torino, 2006 – p. 18/56
Evaluation
The principal evaluation is a sequence of reduction
performing at every step the principal redex.
The principal evaluation is normalizing.
FOLLIA - Torino, 2006 – p. 18/56
Evaluation
The principal evaluation is a sequence of reduction
performing at every step the principal redex.
The principal evaluation is normalizing.
There is a Parametric Principal Reduction Machine,
parametric with respect to the set of input values ∆,
reducing a term according to the principal evaluation.
FOLLIA - Torino, 2006 – p. 18/56
The PPR machine
M →p∆ N
λx.M →p∆ λx.N
p1
i = min{j ≤ m|Mi 6∈ ∆-nf} Mi →p∆ Ni
xM1 ...Mm →p∆ xM1 ...Ni ...Mm
Q∈∆
(λx.P )QM1 ...Mm →p∆ P [Q/x]M1 ...Mm
p3
Q 6∈ ∆ Q 6∈ ∆-nf Q →p∆ Q′
(λx.P )QM1 ...Mm →p∆ (λx.P )Q′ M1 ...Mm
p4
Q 6∈ ∆ Q ∈ ∆-nf P ∈
6 ∆-nf P →p∆ P ′
(λx.P )QM1 ...Mm →p∆ (λx.P ′ )QM1 ...Mm
Q 6∈ ∆
p2
p5
P, Q ∈ ∆-nf i = min{j ≤ m|Mi 6∈ ∆-nf} Mi →p∆ Ni
(λx.P )QM1 ...Mm →p∆ (λx.P )QM1 ...Ni ...Mm
p6
FOLLIA - Torino, 2006 – p. 19/56
Output values
Let ∆ be a set of input values.
A set of output values with respect to ∆ is any set
Θ ⊆ Λ such that:
Θ contains all the ∆-normal forms;
If M =∆ N and N ∈ Θ then there is P ∈ Θ such that
M →∗p
∆ P
(→∗p denotes the reduction sequence choosing at every step the principal redex )
FOLLIA - Torino, 2006 – p. 20/56
Examples of Output Values
∆-normal forms is a set of output values w.r.t ∆, for all
∆.
FOLLIA - Torino, 2006 – p. 21/56
Examples of Output Values
∆-normal forms is a set of output values w.r.t ∆, for all
∆.
Λ-head normal forms is a set of output values w.r.t Λ.
FOLLIA - Torino, 2006 – p. 21/56
Examples of Output Values
∆-normal forms is a set of output values w.r.t ∆, for all
∆.
Λ-head normal forms is a set of output values w.r.t Λ.
Λ-weak head normal forms is a set of output values w.r.t
Λ.
FOLLIA - Torino, 2006 – p. 21/56
Examples of Output Values
∆-normal forms is a set of output values w.r.t ∆, for all
∆.
Λ-head normal forms is a set of output values w.r.t Λ.
Λ-weak head normal forms is a set of output values w.r.t
Λ.
Γ together with Γ-normal forms are a set of output
values w.r.t Γ.
FOLLIA - Torino, 2006 – p. 21/56
The Operational Semantics
Let Θ be a set of output values with respect to the set of
input value ∆. ⇓∆,Θ is the evaluation relation defined
through the following rules:
M ∈Θ
M ⇓∆,Θ M
(axiom)
M →p∆ P
P ⇓∆,Θ N
M ⇓∆,Θ N
(eval)
FOLLIA - Torino, 2006 – p. 22/56
The Operational Semantics
Let Θ be a set of output values with respect to the set of
input value ∆. ⇓∆,Θ is the evaluation relation defined
through the following rules:
M ∈Θ
M ⇓∆,Θ M
(axiom)
M →p∆ P
P ⇓∆,Θ N
M ⇓∆,Θ N
(eval)
Operational pre-order:
M ∆,Θ N if and only if, for all contexts C[.] such that
0
C[M ], C[N ] ∈ Λ , C[M ] ⇓∆,Θ implies C[N ] ⇓∆,Θ .
FOLLIA - Torino, 2006 – p. 22/56
The Operational Semantics
Let Θ be a set of output values with respect to the set of
input value ∆. ⇓∆,Θ is the evaluation relation defined
through the following rules:
M ∈Θ
M ⇓∆,Θ M
(axiom)
M →p∆ P
P ⇓∆,Θ N
M ⇓∆,Θ N
(eval)
Operational pre-order:
M ∆,Θ N if and only if, for all contexts C[.] such that
0
C[M ], C[N ] ∈ Λ , C[M ] ⇓∆,Θ implies C[N ] ⇓∆,Θ .
Operational Equivalence:
M ≈∆,Θ N if and only if M ∆,Θ N and N ∆,Θ M .
FOLLIA - Torino, 2006 – p. 22/56
Normal forms: an apparent paradox
In the λΛ-calculus, the set of normal forms:
M ::= x | λ~x.xM...M
is semantically meaningful. The Böhm separability
property holds, so two βη -different normal forms cannot
be equated.
FOLLIA - Torino, 2006 – p. 23/56
Normal forms: an apparent paradox
In the λΛ-calculus, the set of normal forms:
M ::= x | λ~x.xM...M
is semantically meaningful. The Böhm separability
property holds, so two βη -different normal forms cannot
be equated.
In a generic λ∆-calculus, the set of normal forms:
M ::= x | λ~x.xM...M | λ~x.(λx.P )QM..M
has not good semantical properties.
(Q 6∈ ∆)
FOLLIA - Torino, 2006 – p. 23/56
Normal forms in λΓ
In the λΓ-calculus, two Γ-normal forms can be
consistently equated, for example it is consistent to put:
λx.I(xx) = λx.xx.
FOLLIA - Torino, 2006 – p. 24/56
Normal forms in λΓ
In the λΓ-calculus, two Γ-normal forms can be
consistently equated, for example it is consistent to put:
λx.I(xx) = λx.xx.
Let D ≡ λx.xx. (λy.D)(xI)D is a Γ-nf.
It is consistent to put:
(λy.D)(xI)D = DD
(DD is not a value!)
FOLLIA - Torino, 2006 – p. 24/56
Normal forms in λΓ
In the λΓ-calculus, two Γ-normal forms can be
consistently equated, for example it is consistent to put:
λx.I(xx) = λx.xx.
Let D ≡ λx.xx. (λy.D)(xI)D is a Γ-nf.
It is consistent to put:
(λy.D)(xI)D = DD
(DD is not a value!)
A Separability Theorem holds, saying that two different
Λ-normal forms can be Γ-separated, so they are
different in every Γ model.
FOLLIA - Torino, 2006 – p. 24/56
Normal forms in λΓ
In the λΓ-calculus, two Γ-normal forms can be
consistently equated, for example it is consistent to put:
λx.I(xx) = λx.xx.
Let D ≡ λx.xx. (λy.D)(xI)D is a Γ-nf.
It is consistent to put:
(λy.D)(xI)D = DD
(DD is not a value!)
A Separability Theorem holds, saying that two different
Λ-normal forms can be Γ-separated, so they are
different in every Γ model.
We conjecture that the same holds for all meaningful ∆.
FOLLIA - Torino, 2006 – p. 24/56
Solvability & Valuability
A term M is valuable iff M →∗∆ N ∈ ∆.
FOLLIA - Torino, 2006 – p. 25/56
Solvability & Valuability
A term M is valuable iff M →∗∆ N ∈ ∆.
A term M is potentially ∆-valuable iff
there is a substitution s replacing variables by closed
values, s.t. s(M ) is ∆-valuable.
FOLLIA - Torino, 2006 – p. 25/56
Solvability & Valuability
A term M is valuable iff M →∗∆ N ∈ ∆.
A term M is potentially ∆-valuable iff
there is a substitution s replacing variables by closed
values, s.t. s(M ) is ∆-valuable.
A term M is ∆-solvable if and only if there is a head
~ such that:
∆-context C[.] ≡ (λ~x.[.])N
~x sequentialize variables in FV(M )
~ ⊆∆
N
and
C[M ] =∆ I
FOLLIA - Torino, 2006 – p. 25/56
Γ-Solvability, Γ and Γ-normal forms
We already showed that the term:
(λy.D)(xI)D
where D ≡ λx.xx
is a Γ-normal form, which is not a Γ-input value, and
which is operationally equivalent to DD
FOLLIA - Torino, 2006 – p. 26/56
Γ-Solvability, Γ and Γ-normal forms
We already showed that the term:
(λy.D)(xI)D
where D ≡ λx.xx
is a Γ-normal form, which is not a Γ-input value, and
which is operationally equivalent to DD
DD is Γ-unsolvable
FOLLIA - Torino, 2006 – p. 26/56
Γ-Solvability, Γ and Γ-normal forms
We already showed that the term:
(λy.D)(xI)D
where D ≡ λx.xx
is a Γ-normal form, which is not a Γ-input value, and
which is operationally equivalent to DD
DD is Γ-unsolvable
(λy.D)(xI)D is Γ-unsolvable!
FOLLIA - Torino, 2006 – p. 26/56
Γ-Solvability, Γ and Γ-normal forms
We already showed that the term:
(λy.D)(xI)D
where D ≡ λx.xx
is a Γ-normal form, which is not a Γ-input value, and
which is operationally equivalent to DD
DD is Γ-unsolvable
(λy.D)(xI)D is Γ-unsolvable!
λx.(λy.D)(xI)D ∈ Γ!
FOLLIA - Torino, 2006 – p. 26/56
Γ-Solvability, Γ and Γ-normal forms
We already showed that the term:
(λy.D)(xI)D
where D ≡ λx.xx
is a Γ-normal form, which is not a Γ-input value, and
which is operationally equivalent to DD
DD is Γ-unsolvable
(λy.D)(xI)D is Γ-unsolvable!
λx.(λy.D)(xI)D ∈ Γ!
So neither the set of Γ-normal forms nor the set Γ is not
a proper subset of the set of Γ-solvable terms!
FOLLIA - Torino, 2006 – p. 26/56
Call-by-name, call-by-value relations
Some interesting sets of terms in call-by-value calculi
correspond to semantically relevant set of the classical
(call-by-name) calculus.
The set of potentially Γ-valuable terms coincides with
the set of lazy Λ-strongly normalizing terms.
FOLLIA - Torino, 2006 – p. 27/56
Call-by-name, call-by-value relations
Some interesting sets of terms in call-by-value calculi
correspond to semantically relevant set of the classical
(call-by-name) calculus.
The set of potentially Γ-valuable terms coincides with
the set of lazy Λ-strongly normalizing terms.
The set of Φ-solvable terms coincides with the set of
Λ-strongly normalizing
(The λΦ-calculus is a not lazy call-by-value calculus.)
FOLLIA - Torino, 2006 – p. 27/56
Lazy Reductions
Let ∆ ⊆ Λ be a set of terms.
The lazy ∆-reduction (→∆ℓ ) is the applicative closure of
the following rule:
(λx.M )N → M [N/x] if and only if N ∈ ∆
FOLLIA - Torino, 2006 – p. 28/56
Lazy Reductions
Let ∆ ⊆ Λ be a set of terms.
The lazy ∆-reduction (→∆ℓ ) is the applicative closure of
the following rule:
(λx.M )N → M [N/x] if and only if N ∈ ∆
→ Λ λx.I
Let I ≡ λx.x; then λx.II→
6 Λℓ λx.I
while λx.II6→
FOLLIA - Torino, 2006 – p. 28/56
Γ-pot. valuability and Λℓ-strongly norm.
M is Λℓ-strongly norm.
B ⊢ν M : σ
M is pot. Γ-valuable
FOLLIA - Torino, 2006 – p. 29/56
Γ-pot. valuability and Λℓ-strongly norm.
M is Λℓ-strongly norm.
B ⊢ν M : σ
M is pot. Γ-valuable
FOLLIA - Torino, 2006 – p. 29/56
Γ-pot. valuability and Λℓ-strongly norm.
M is Λℓ-strongly norm.
B ⊢ν M : σ
M is pot. Γ-valuable
FOLLIA - Torino, 2006 – p. 29/56
Γ-solvability and Λℓ-strong norm.
The set of Γ-solvable terms is a proper subset of the set
of Γ-potentially valuable terms, so it is a proper subset
of the set of Λℓ-strongly normalizing terms.
FOLLIA - Torino, 2006 – p. 30/56
Γ-solvability and Λℓ-strong norm.
The set of Γ-solvable terms is a proper subset of the set
of Γ-potentially valuable terms, so it is a proper subset
of the set of Λℓ-strongly normalizing terms.
The Γ-normal form (λy.D)(xI)D is Γ-unsolvable!
FOLLIA - Torino, 2006 – p. 30/56
Γ-solvability and Λℓ-strong norm.
The set of Γ-solvable terms is a proper subset of the set
of Γ-potentially valuable terms, so it is a proper subset
of the set of Λℓ-strongly normalizing terms.
The Γ-normal form (λy.D)(xI)D is Γ-unsolvable!
FOLLIA - Torino, 2006 – p. 30/56
A non lazy Call-By-Value
The set SNΛ of Λℓ-strongly normalizing terms is a set of
input values.
FOLLIA - Torino, 2006 – p. 31/56
A non lazy Call-By-Value
The set SNΛ of Λℓ-strongly normalizing terms is a set of
input values.
The set of SNΛ -solvable terms coincides with the set of
SNΛ -potentially valuable terms.
FOLLIA - Torino, 2006 – p. 31/56
A non lazy Call-By-Value
The set SNΛ of Λℓ-strongly normalizing terms is a set of
input values.
The set of SNΛ -solvable terms coincides with the set of
SNΛ -potentially valuable terms.
The set of SNΛ -solvable terms coincides with SNΛ .
FOLLIA - Torino, 2006 – p. 31/56
A non lazy Call-By-Value
The set SNΛ of Λℓ-strongly normalizing terms is a set of
input values.
The set of SNΛ -solvable terms coincides with the set of
SNΛ -potentially valuable terms.
The set of SNΛ -solvable terms coincides with SNΛ .
SNΛ is not the minimal set of input values satisfying
these properties.
FOLLIA - Torino, 2006 – p. 31/56
A non lazy Call-By-Value
Υi , Φi are defined as follows:
Υ0 = Var
Φi = Var ∪ (Υi )0
Υi+1 =Var ∪{xM1 ...Mn | Mk ∈ Υi (1 ≤ k ≤ n)}
∪{λ~x.M | M ∈ Υi }
∪{(λx.P )QM1 ...Mn | Q ∈ Υi − (Λ0 ∪ Var),
P [Q/x]M1 . . . Mn →∗Φi R ∈ Υi }
FOLLIA - Torino, 2006 – p. 32/56
A non lazy Call-By-Value
Υi , Φi are defined as follows:
Υ0 = Var
Φi = Var ∪ (Υi )0
Υi+1 =Var ∪{xM1 ...Mn | Mk ∈ Υi (1 ≤ k ≤ n)}
∪{λ~x.M | M ∈ Υi }
∪{(λx.P )QM1 ...Mn | Q ∈ Υi − (Λ0 ∪ Var),
P [Q/x]M1 . . . Mn →∗Φi R ∈ Υi }
Let Υ = ∪i Υi and Φ = Var ∪ (Υ)0
FOLLIA - Torino, 2006 – p. 32/56
Some Properties of λΦ-calculus
M is Λ-strongly norm.
B⊢M :σ
M is Φ-solvable
M is pot. Φ-valuable
M →∗Φ N ∈ Υ
FOLLIA - Torino, 2006 – p. 33/56
Some Properties of λΦ-calculus
M is Λ-strongly norm.
B⊢M :σ
M is Φ-solvable
M is pot. Φ-valuable
M →∗Φ N ∈ Υ
FOLLIA - Torino, 2006 – p. 33/56
Some Properties of λΦ-calculus
M is Λ-strongly norm.
B⊢M :σ
M is Φ-solvable
M is pot. Φ-valuable
M →∗Φ N ∈ Υ
FOLLIA - Torino, 2006 – p. 33/56
Some Properties of λΦ-calculus
M is Λ-strongly norm.
B⊢M :σ
M is Φ-solvable
M is pot. Φ-valuable
M →∗Φ N ∈ Υ
FOLLIA - Torino, 2006 – p. 33/56
Some Properties of λΦ-calculus
M is Λ-strongly norm.
B⊢M :σ
M is Φ-solvable
M is pot. Φ-valuable
M →∗Φ N ∈ Υ
FOLLIA - Torino, 2006 – p. 33/56
λ∆-model
λ∆-model is a quadruple < D, I, ◦, [[.]] > where
D is a set
◦ is an operation on D
I is a subset of D
if ρ : Var → I then [[.]]ρ maps terms in D
FOLLIA - Torino, 2006 – p. 34/56
λ∆-model
λ∆-model is a quadruple < D, I, ◦, [[.]] > s.t.:
[[x]]ρ = ρ(x)
FOLLIA - Torino, 2006 – p. 35/56
λ∆-model
λ∆-model is a quadruple < D, I, ◦, [[.]] > s.t.:
[[x]]ρ = ρ(x)
[[M N ]]ρ = [[M ]]ρ ◦ [[N ]]ρ
FOLLIA - Torino, 2006 – p. 35/56
λ∆-model
λ∆-model is a quadruple < D, I, ◦, [[.]] > s.t.:
[[x]]ρ = ρ(x)
[[M N ]]ρ = [[M ]]ρ ◦ [[N ]]ρ
[[λx.M ]]ρ ◦ d = [[M ]]ρ[d/x]
if d ∈ I
FOLLIA - Torino, 2006 – p. 35/56
λ∆-model
λ∆-model is a quadruple < D, I, ◦, [[.]] > s.t.:
[[x]]ρ = ρ(x)
[[M N ]]ρ = [[M ]]ρ ◦ [[N ]]ρ
[[λx.M ]]ρ ◦ d = [[M ]]ρ[d/x]
if d ∈ I
if [[M ]]ρ[d/x] = [[M ′ ]]ρ′ [d/y] for each d ∈ I,
then [[λx.M ]]ρ = [[λy.M ′ ]]ρ′
FOLLIA - Torino, 2006 – p. 35/56
λ∆-model
λ∆-model is a quadruple < D, I, ◦, [[.]] > s.t.:
[[x]]ρ = ρ(x)
[[M N ]]ρ = [[M ]]ρ ◦ [[N ]]ρ
[[λx.M ]]ρ ◦ d = [[M ]]ρ[d/x]
if d ∈ I
if [[M ]]ρ[d/x] = [[M ′ ]]ρ′ [d/y] for each d ∈ I,
then [[λx.M ]]ρ = [[λy.M ′ ]]ρ′
M ∈ ∆ implies ∀ρ.[[M ]]ρ ∈ I
FOLLIA - Torino, 2006 – p. 35/56
Intersection Types
Let C be a countable set of type-constants, containing at
least the constant ω .
FOLLIA - Torino, 2006 – p. 36/56
Intersection Types
Let C be a countable set of type-constants, containing at
least the constant ω .
The set T (C) of types is inductively defined as follows:
σ ::= α | (σ→τ ) | (σ∧τ )
where α ∈ C .
FOLLIA - Torino, 2006 – p. 36/56
Intersection Type Theory
A intersection relation ≤ is a preorder relation on T (C),
closed under the following rules:
σ≤ω
(a)
σ≤σ ∧ σ
σ≤σ
(b)
σ ∧ τ ≤σ
σ≤ρ, ρ≤τ
σ≤ρ
(r)
(c)
σ ∧ τ ≤τ
(σ → τ ) ∧ (σ → π)≤σ → (τ ∧ π)
σ ′ ≤σ, τ ≤τ ′
σ → τ ≤σ ′ → τ ′
(f )
(d)
(t)
(c′ )
σ≤σ ′ , τ ≤τ ′
σ ∧ τ ≤σ ′ ∧ τ ′
σ → ω≤ω → ω
(e)
(g)
≤ induce a type theory ≃ .
FOLLIA - Torino, 2006 – p. 37/56
Intersection Type System
A type system ∇ is a triple < C, ≤∇ , I(C) >:
C is a set of type constants
FOLLIA - Torino, 2006 – p. 38/56
Intersection Type System
A type system ∇ is a triple < C, ≤∇ , I(C) >:
C is a set of type constants
≤∇ is an intersection relation on T (C)
FOLLIA - Torino, 2006 – p. 38/56
Intersection Type System
A type system ∇ is a triple < C, ≤∇ , I(C) >:
C is a set of type constants
≤∇ is an intersection relation on T (C)
I(C) ⊆ T (C) is a set of input types s.t.
I(C) is not empty
FOLLIA - Torino, 2006 – p. 38/56
Intersection Type System
A type system ∇ is a triple < C, ≤∇ , I(C) >:
C is a set of type constants
≤∇ is an intersection relation on T (C)
I(C) ⊆ T (C) is a set of input types s.t.
I(C) is not empty
σ ∈ I(C) and σ ≃∇ τ imply τ ∈ I(C);
FOLLIA - Torino, 2006 – p. 38/56
Intersection Type System
A type system ∇ is a triple < C, ≤∇ , I(C) >:
C is a set of type constants
≤∇ is an intersection relation on T (C)
I(C) ⊆ T (C) is a set of input types s.t.
I(C) is not empty
σ ∈ I(C) and σ ≃∇ τ imply τ ∈ I(C);
σ ∈ I(C) and τ 6∈ I(C) imply σ ≤∇ τ .
FOLLIA - Torino, 2006 – p. 38/56
Intersection Type Assignment System
Let ∇ be a type system
B[σ/x] ⊢∇ x : σ
B[σ/x] ⊢∇ M : τ
B ⊢∇ λx.M : σ → τ
B ⊢∇ M : σ B ⊢∇ M : τ
B ⊢∇ M : σ ∧ τ
B ⊢∇ M : σ ∧ τ
B ⊢∇ M : σ
(var)
(→I)
(∧I)
(∧El )
B ⊢∇ M : ω
σ ∈ I(C)
(ω)
B ⊢∇ M : σ → τ
B ⊢∇ N : σ
B ⊢∇ M N : τ
(→E)
B ⊢∇ M : σ σ ≤∇ τ
B ⊢∇ M : τ
(≤∇ )
B ⊢∇ M : σ ∧ τ
B ⊢∇ M : τ
(∧Er )
FOLLIA - Torino, 2006 – p. 39/56
Intersection Type Assignment System
Let ∇ be a type system
B[σ/x] ⊢∇ x : σ
B[σ/x] ⊢∇ M : τ
B ⊢∇ λx.M : σ → τ
B ⊢∇ M : σ B ⊢∇ M : τ
B ⊢∇ M : σ ∧ τ
B ⊢∇ M : σ ∧ τ
B ⊢∇ M : σ
(var)
(→I)
(∧I)
(∧El )
B ⊢∇ M : ω
σ ∈ I(C)
B ⊢∇ M : σ → τ
B ⊢∇ N : σ
B ⊢∇ M N : τ
B ⊢∇ M : σ σ ≤∇ τ
B ⊢∇ M : τ
B ⊢∇ M : σ ∧ τ
B ⊢∇ M : τ
(ω)
(→E)
(≤∇ )
(∧Er )
FOLLIA - Torino, 2006 – p. 39/56
Filters
Let ∇ be the type system < C, ≤∇ , I(C) >.
Let F (∇) be the set of all filters.
FOLLIA - Torino, 2006 – p. 40/56
Filters
Let ∇ be the type system < C, ≤∇ , I(C) >.
Let F (∇) be the set of all filters.
Let I(∇) be the set of input filters containing at least one
type belonging to I(C).
FOLLIA - Torino, 2006 – p. 40/56
Filters
Let ∇ be the type system < C, ≤∇ , I(C) >.
Let F (∇) be the set of all filters.
Let I(∇) be the set of input filters containing at least one
type belonging to I(C).
f1 ◦∇ f2 =↑ {ω}∪
{τ | σ → τ ∈ f1 and σ ∈ f2 and σ ∈ I(C) }.
FOLLIA - Torino, 2006 – p. 40/56
Filters
Let ∇ be the type system < C, ≤∇ , I(C) >.
Let F (∇) be the set of all filters.
Let I(∇) be the set of input filters containing at least one
type belonging to I(C).
f1 ◦∇ f2 =↑ {ω}∪
F(∇)
[[M ]]ρ
{τ | σ → τ ∈ f1 and σ ∈ f2 and σ ∈ I(C) }.
= {σ ∈ T (C) | ∃B ∝ ρ such that B ⊢∇ M : σ}
where B ∝ ρ when B(z) ∈ ρ(z), for all z.
FOLLIA - Torino, 2006 – p. 40/56
Legal Type Theory
Let ∇ be the type system < C, ≤∇ , I(C) >.
∇ is legal whenever, for all σ ∈ I(C) and τ 6≃∇ ω :
(σ1 → τ1 ) ∧ ... ∧ (σn → τn )≤∇ σ → τ
FOLLIA - Torino, 2006 – p. 41/56
Legal Type Theory
Let ∇ be the type system < C, ≤∇ , I(C) >.
∇ is legal whenever, for all σ ∈ I(C) and τ 6≃∇ ω :
(σ1 → τ1 ) ∧ ... ∧ (σn → τn )≤∇ σ → τ
implies ∃{i1 , ..., ik } ⊆ {1, ..., n} s.t.
(σi1 ∧ ... ∧ σik )≥∇ σ and (τi1 ∧ ... ∧ τik )≤∇ τ .
FOLLIA - Torino, 2006 – p. 41/56
Filters models(Coppo-Dezani)
Let ∇ =< C, ≤∇ , I(C) > be legal and
such that M ∈ ∆ imply ∀ρ [[M ]]ρ ∈ I(∇).
Then < F(∇), I(∇), ◦∇ , [[.]]F (∇) > is a λ∆-model.
FOLLIA - Torino, 2006 – p. 42/56
Filters models(Coppo-Dezani)
Let ∇ =< C, ≤∇ , I(C) > be legal and
such that M ∈ ∆ imply ∀ρ [[M ]]ρ ∈ I(∇).
Then < F(∇), I(∇), ◦∇ , [[.]]F (∇) > is a λ∆-model.
M ⊑F N
means that
F
∀ρ, [[M ]]F
⊆
[[N
]]
ρ
ρ
FOLLIA - Torino, 2006 – p. 42/56
Filters models(Coppo-Dezani)
Let ∇ =< C, ≤∇ , I(C) > be legal and
such that M ∈ ∆ imply ∀ρ [[M ]]ρ ∈ I(∇).
Then < F(∇), I(∇), ◦∇ , [[.]]F (∇) > is a λ∆-model.
M ⊑F N
means that
Correctness:
F
∀ρ, [[M ]]F
⊆
[[N
]]
ρ
ρ
⊑F ⊆ O
FOLLIA - Torino, 2006 – p. 42/56
Filters models(Coppo-Dezani)
Let ∇ =< C, ≤∇ , I(C) > be legal and
such that M ∈ ∆ imply ∀ρ [[M ]]ρ ∈ I(∇).
Then < F(∇), I(∇), ◦∇ , [[.]]F (∇) > is a λ∆-model.
M ⊑F N
means that
Correctness:
Completeness:
F
∀ρ, [[M ]]F
⊆
[[N
]]
ρ
ρ
⊑F ⊆ O
O ⊆ ⊑F
FOLLIA - Torino, 2006 – p. 42/56
Filters models(Coppo-Dezani)
Let ∇ =< C, ≤∇ , I(C) > be legal and
such that M ∈ ∆ imply ∀ρ [[M ]]ρ ∈ I(∇).
Then < F(∇), I(∇), ◦∇ , [[.]]F (∇) > is a λ∆-model.
M ⊑F N
means that
Correctness:
Completeness:
F
∀ρ, [[M ]]F
⊆
[[N
]]
ρ
ρ
⊑F ⊆ O
Full abstraction:
O ⊆ ⊑F
⊑F = O
FOLLIA - Torino, 2006 – p. 42/56
Using Parametric Models
In literature standard topological models for lazy
evaluations of λ-calculus have been considered.
FOLLIA - Torino, 2006 – p. 43/56
Using Parametric Models
In literature standard topological models for lazy
evaluations of λ-calculus have been considered.
Abramsky and Ong (1993)
have studied the call by name parameter passing
FOLLIA - Torino, 2006 – p. 43/56
Using Parametric Models
In literature standard topological models for lazy
evaluations of λ-calculus have been considered.
Abramsky and Ong (1993)
have studied the call by name parameter passing
Egidi, Honsell and Ronchi Della Rocca (1992)
have studied the call by value parameter passing
FOLLIA - Torino, 2006 – p. 43/56
Using Parametric Models
In literature standard topological models for lazy
evaluations of λ-calculus have been considered.
Both models are correct, but not complete!
FOLLIA - Torino, 2006 – p. 43/56
Using Parametric Models
In literature standard topological models for lazy
evaluations of λ-calculus have been considered.
Both models are correct, but not complete!
A pre-order relation on terms, stratified on intersection
types which grasps exactly the two operational semantics
we want to model.
Such a relation can be used for building
two fully abstract models starting from a logical descriptions
of the two previous models.
FOLLIA - Torino, 2006 – p. 43/56
Using Parametric Models
In literature standard topological models for lazy
evaluations of λ-calculus have been considered.
Both models are correct, but not complete!
A pre-order relation on terms, stratified on intersection
types which grasps exactly the two operational semantics
we want to model.
Such a relation can be used for building
two fully abstract models starting from a logical descriptions
of the two previous models.
FOLLIA - Torino, 2006 – p. 43/56
Lazy Evaluations (Plotkin 1975)
Call by name (said simply lazy)
λx.M ⇓L λx.M
(lazy)
P [Q/x]M1 . . .Mm ⇓L N
(λx.P )QM1 . . .Mm ⇓L N
(head)
Call by value
λx.M ⇓V λx.M
(lazy)
Q ⇓V Q′ P [Q′ /x]M1 . . .Mm ⇓V N
(λx.P )QM1 . . .Mm ⇓V N
(head)
FOLLIA - Torino, 2006 – p. 44/56
Operational Semantics
Let M, N ∈ Λ0
M ⇓L if and only if M Λ-reduces to an abstr.
FOLLIA - Torino, 2006 – p. 45/56
Operational Semantics
Let M, N ∈ Λ0
M ⇓V if and only if M Γ-reduces to an abstr.
FOLLIA - Torino, 2006 – p. 45/56
Operational Semantics
Let M, N ∈ Λ0
M ⇓V if and only if M Γ-reduces to an abstr.
Let O ∈ {L, V}.
FOLLIA - Torino, 2006 – p. 45/56
Operational Semantics
Let M, N ∈ Λ0
M ⇓V if and only if M Γ-reduces to an abstr.
Let O ∈ {L, V}.
M O N if and only if,
for all context C[.] such that C[M ], C[N ] ∈ Λ0 ,
C[M ] ⇓O implies C[N ] ⇓O .
FOLLIA - Torino, 2006 – p. 45/56
Operational Semantics
Let M, N ∈ Λ0
M ⇓V if and only if M Γ-reduces to an abstr.
Let O ∈ {L, V}.
M O N if and only if,
for all context C[.] such that C[M ], C[N ] ∈ Λ0 ,
C[M ] ⇓O implies C[N ] ⇓O .
M ≈O N if and only if M O N and N O M .
FOLLIA - Torino, 2006 – p. 45/56
L-model (Abramsky-Ong)
∠ is the type system < C∠ , ≤∠ , I(C∠ ) >
where ≤∠ is the least intersection relation,
C∠ = {ω} and I(C∠ ) = T (C∠ ).
FOLLIA - Torino, 2006 – p. 46/56
L-model (Abramsky-Ong)
∠ is the type system < C∠ , ≤∠ , I(C∠ ) >
where ≤∠ is the least intersection relation,
C∠ = {ω} and I(C∠ ) = T (C∠ ).
L is the model < F(∠), F (∠), ◦∠ , [[.]]F (∠) >.
L is isomorphic to the topological λ-model, initial
solution of: X = [X → X]⊥
FOLLIA - Torino, 2006 – p. 46/56
L-model (Abramsky-Ong)
∠ is the type system < C∠ , ≤∠ , I(C∠ ) >
where ≤∠ is the least intersection relation,
C∠ = {ω} and I(C∠ ) = T (C∠ ).
L is the model < F(∠), F (∠), ◦∠ , [[.]]F (∠) >.
L is isomorphic to the topological λ-model, initial
solution of: X = [X → X]⊥
L is correct but not complete with respect to L .
FOLLIA - Torino, 2006 – p. 46/56
V-model (Egidi et al.)
√
is the type system < C√ , ≤√ , I(C√ ) >
where C√ = {ω}, I(C√ ) = {σ | σ 6≃V ω} and ≤√ is the
least intersection relation satisfying:
(ω → ω) →
τ ≤√ ω
→τ
(v)
FOLLIA - Torino, 2006 – p. 47/56
V-model (Egidi et al.)
√
is the type system < C√ , ≤√ , I(C√ ) >
where C√ = {ω}, I(C√ ) = {σ | σ 6≃V ω} and ≤√ is the
least intersection relation satisfying:
(ω → ω) →
τ ≤√ ω
→τ
(v)
√
√
√ √
F
(
) >.
V is the model < F( ), I( ), ◦ , [[.]]
V is isomorphic to the topological λ-model, initial
solution of: X = [X →⊥ X]⊥ .
FOLLIA - Torino, 2006 – p. 47/56
V-model (Egidi et al.)
√
is the type system < C√ , ≤√ , I(C√ ) >
where C√ = {ω}, I(C√ ) = {σ | σ 6≃V ω} and ≤√ is the
least intersection relation satisfying:
(ω → ω) →
τ ≤√ ω
→τ
(v)
√
√
√ √
F
(
) >.
V is the model < F( ), I( ), ◦ , [[.]]
V is isomorphic to the topological λ-model, initial
solution of: X = [X →⊥ X]⊥ .
V is correct but not complete with respect to V .
FOLLIA - Torino, 2006 – p. 47/56
L-Characterizations
B ⊢∠ M : ω → ω if and only if M ⇓L .
FOLLIA - Torino, 2006 – p. 48/56
L-Characterizations
B ⊢∠ M : ω → ω if and only if M ⇓L .
If σ6≃∠ ω then σ≃∠ σ0 ∧ ... ∧ σn such that
i → ω → ω.
∀i ≤ n, σi ≃∠ τ1i → ... → τm
i
FOLLIA - Torino, 2006 – p. 48/56
L-Characterizations
B ⊢∠ M : ω → ω if and only if M ⇓L .
If σ6≃∠ ω then σ≃∠ σ0 ∧ ... ∧ σn such that
i → ω → ω.
∀i ≤ n, σi ≃∠ τ1i → ... → τm
i
σ≃∠ ω if and only if σ ≡ ω
| ∧ .....
{z ∧ ω}.
n
FOLLIA - Torino, 2006 – p. 48/56
V-Characterizations
B ⊢√ M : ω → ω if and only if M ⇓V .
If σ6≃√ ω then σ≃√ σ0 ∧ ... ∧ σn such that
i → ω → ω.
∀i ≤ n, σi ≃√ τ1i → ... → τm
i
σ≃√ ω if and only if σ ≡ ω
| ∧ .....
{z ∧ ω}.
n
FOLLIA - Torino, 2006 – p. 49/56
L-Typed Relation
0 defined as follows:
EL
is
a
relation
on
Λ
σ
M EL
ω N is true;
FOLLIA - Torino, 2006 – p. 50/56
L-Typed Relation
0 defined as follows:
EL
is
a
relation
on
Λ
σ
M EL
ω N is true;
M EL
σ→τ N where τ ≃∠ ω , if and only if
B ⊢∠ M : ω → ω implies B ⊢∠ N : ω → ω ;
FOLLIA - Torino, 2006 – p. 50/56
L-Typed Relation
0 defined as follows:
EL
is
a
relation
on
Λ
σ
M EL
ω N is true;
M EL
σ→τ N where τ ≃∠ ω , if and only if
B ⊢∠ M : ω → ω implies B ⊢∠ N : ω → ω ;
M EL
σ→τ N where τ 6≃∠ ω , if and only if
P ∈ Λ0 and B ⊢∠ P : σ imply M P EL
τ NP;
FOLLIA - Torino, 2006 – p. 50/56
L-Typed Relation
0 defined as follows:
EL
is
a
relation
on
Λ
σ
M EL
ω N is true;
M EL
σ→τ N where τ ≃∠ ω , if and only if
B ⊢∠ M : ω → ω implies B ⊢∠ N : ω → ω ;
M EL
σ→τ N where τ 6≃∠ ω , if and only if
P ∈ Λ0 and B ⊢∠ P : σ imply M P EL
τ NP;
L N and M EL N .
M EL
N
if
and
only
if
M
E
σ∧τ
σ
τ
FOLLIA - Torino, 2006 – p. 50/56
L-Typed Relation
0 defined as follows:
EL
is
a
relation
on
Λ
σ
M EL
ω N is true;
M EL
σ→τ N where τ ≃∠ ω , if and only if
B ⊢∠ M : ω → ω implies B ⊢∠ N : ω → ω ;
M EL
σ→τ N where τ 6≃∠ ω , if and only if
P ∈ Λ0 and B ⊢∠ P : σ imply M P EL
τ NP;
L N and M EL N .
M EL
N
if
and
only
if
M
E
σ∧τ
σ
τ
M EL N if and only if M EL
σ N , for all σ .
FOLLIA - Torino, 2006 – p. 50/56
L-Typed Relation
0 defined as follows:
EL
is
a
relation
on
Λ
σ
M EL
ω N is true;
M EL
σ→τ N where τ ≃∠ ω , if and only if
B ⊢∠ M : ω → ω implies B ⊢∠ N : ω → ω ;
M EL
σ→τ N where τ 6≃∠ ω , if and only if
P ∈ Λ0 and B ⊢∠ P : σ imply M P EL
τ NP;
L N and M EL N .
M EL
N
if
and
only
if
M
E
σ∧τ
σ
τ
M EL N if and only if M EL
σ N , for all σ .
FOLLIA - Torino, 2006 – p. 50/56
V-Typed Relation
EVσ is a relation on Λ0 defined as follows:
M EVω N is true;
M EVσ→τ N where τ ≃√ ω , if and only if
B ⊢√ M : ω → ω implies B ⊢√ N : ω → ω ;
M EVσ→τ N where τ 6≃√ ω , if and only if
P ∈ Γ0 -val. and B ⊢√ P : σ imply M P EVτ N P ;
M EVσ∧τ N if and only if M EVσ N and M EVτ N .
M EV N if and only if M EVσ N , for all σ .
FOLLIA - Torino, 2006 – p. 51/56
L
E -Properties
Let M, N ∈ Λ0 .
EL is a preorder relation
FOLLIA - Torino, 2006 – p. 52/56
L
E -Properties
Let M, N ∈ Λ0 .
EL is a preorder relation
M ⊑L N implies M EL N
FOLLIA - Torino, 2006 – p. 52/56
L
E -Properties
Let M, N ∈ Λ0 .
EL is a preorder relation
M ⊑L N implies M EL N
M EL N if and only if M L N
FOLLIA - Torino, 2006 – p. 52/56
L
E -Properties
Let M, N ∈ Λ0 .
EL is a preorder relation
M ⊑L N implies M EL N
M EL N if and only if M L N
M ,N if and only if M EL N and N EL M .
FOLLIA - Torino, 2006 – p. 52/56
V
E -Properties
Let M, N ∈ Λ0 .
EV is a preorder relation
M ⊑V N implies M EV N
M EV N if and only if M V N
M ,N if and only if M EV N and N EV M .
FOLLIA - Torino, 2006 – p. 53/56
LL-model
, induces a equiv. relation on F 0 (∠), the set of filters being
interpretations of closed terms.
[f ] will be the equivalence class of f w.r.t. ,, while F,0
will be the set of all such classes.
FOLLIA - Torino, 2006 – p. 54/56
LL-model
, induces a equiv. relation on F 0 (∠), the set of filters being
interpretations of closed terms.
[f ] will be the equivalence class of f w.r.t. ,, while F,0
will be the set of all such classes.
0
I,
= {[f ] ∈
F,0
| ∃M ∈
Λ0
s.t.
F(∠)
[[M ]]ρ
= f }.
FOLLIA - Torino, 2006 – p. 54/56
LL-model
, induces a equiv. relation on F 0 (∠), the set of filters being
interpretations of closed terms.
[f ] will be the equivalence class of f w.r.t. ,, while F,0
will be the set of all such classes.
0
I,
= {[f ] ∈
F,0
| ∃M ∈
Λ0
s.t.
F(∠)
[[M ]]ρ
= f }.
[f ]◦, [g] = [f ◦∠ g], for all [f ], [g] ∈ F,0 .
FOLLIA - Torino, 2006 – p. 54/56
LL-model
, induces a equiv. relation on F 0 (∠), the set of filters being
interpretations of closed terms.
[f ] will be the equivalence class of f w.r.t. ,, while F,0
will be the set of all such classes.
0
I,
= {[f ] ∈
F,0
| ∃M ∈
Λ0
s.t.
F(∠)
[[M ]]ρ
= f }.
[f ]◦, [g] = [f ◦∠ g], for all [f ], [g] ∈ F,0 .
[[M ]]LL
ζ
=
F(∠)
[[[M ]]ρ ],
where ρ(x) ∈ ζ(x).
FOLLIA - Torino, 2006 – p. 54/56
LL-model
, induces a equiv. relation on F 0 (∠), the set of filters being
interpretations of closed terms.
[f ] will be the equivalence class of f w.r.t. ,, while F,0
will be the set of all such classes.
0
I,
= {[f ] ∈
F,0
| ∃M ∈
Λ0
s.t.
F(∠)
[[M ]]ρ
= f }.
[f ]◦, [g] = [f ◦∠ g], for all [f ], [g] ∈ F,0 .
[[M ]]LL
ζ
=
F(∠)
[[[M ]]ρ ],
where ρ(x) ∈ ζ(x).
Let LL be the quadruple: < F,0 , I,0 , ◦, [[.]]LL >.
FOLLIA - Torino, 2006 – p. 54/56
VV-model
√
0
F ( ),
, induces a equiv. relation on
interpretations of closed terms.
the set of filters being
[f ] will be the equivalence class of f w.r.t. ,, while F,0
will be the set of all such classes.
0 = {[f ] ∈ F 0 | ∃M ∈ Γ0 s.t.
I,
,
√
F( )
[[M ]]ρ
= f }.
[f ]◦, [g] = [f ◦√ g], for all [f ], [g] ∈ F,0 .
[[M ]]VV
ζ =
√
F( )
[[[M ]]ρ
],
where ρ(x) ∈ ζ(x).
Let VV be the quadruple: < F,0 , I,0 , ◦, [[.]]VV >.
FOLLIA - Torino, 2006 – p. 55/56
Full Abstraction
LL is a λΛ-model.
VV is a λΓ-model.
FOLLIA - Torino, 2006 – p. 56/56
Full Abstraction
LL is a λΛ-model.
VV is a λΓ-model.
The model LL is fully abstract with respect to the
L-operational semantics.
The model VV is fully abstract with respect to the
V-operational semantics.
FOLLIA - Torino, 2006 – p. 56/56