Index
L
A
T EX & P4
Pure Patterns Type Systems P2T S
Luigi Liquori
joint work with
The Rho-Team INRIA & LORIA
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 1
Pure Patterns Type Systems P 2 T S Luigi Liquori joint work with - - PowerPoint PPT Presentation
EX & P 4 L T A Index Pure Patterns Type Systems P 2 T S Luigi Liquori joint work with The Rho-Team INRIA & LORIA Luigi Liquori c Rhappy-Days, Nancy, March 22, 2004 1 Index P 2 T S Motivations and Contributions Luigi
Index
L
A
T EX & P4
Luigi Liquori
joint work with
The Rho-Team INRIA & LORIA
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 1
Index
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 2
Index
From Lambda-calculus to Rewriting-calculus
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 3
Index
From Lambda-calculus to Rewriting-calculus
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 3
Index
From Lambda-calculus to Rewriting-calculus
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 3
Index
From Lambda-calculus to Rewriting-calculus
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 3
Index
From Lambda-calculus to Rewriting-calculus
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 3
Index
From Lambda-calculus to Rewriting-calculus
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 3
Index
From Lambda-calculus to Rewriting-calculus
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 3
Index
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 4
Index
The Uncle Pat
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 5
Index
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 6
Index
The Lady Match
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 7
Index
P
2T S: Tricky !
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 8
Index
P
2T S: Tricky !
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 8
Index
P
2T S: Tricky !
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 8
Index
P
2T S: Tricky !
to cons(int 3 nil(int))
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 9
Index
P
2T S: Tricky !
to cons(int 3 nil(int))
to int and cons(int 3 nil(int))
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 9
Index
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 10
Index
Thanks to TAL’s Group (Cornell)
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 11
Index
Typed Rho
based on Curry-Howard isomorphism ` a la Coq, Twelf, Lego, . . .
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 12
Index
Typed Rho
based on Curry-Howard isomorphism ` a la Coq, Twelf, Lego, . . .
Rewriting-calculus
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 12
Index
Typed Rho
based on Curry-Howard isomorphism ` a la Coq, Twelf, Lego, . . .
Rewriting-calculus
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 12
Index
Typed Rho
based on Curry-Howard isomorphism ` a la Coq, Twelf, Lego, . . .
Rewriting-calculus
Pure Pattern Type Systems (P
2T S) c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 12
Index
Typed Rho
based on Curry-Howard isomorphism ` a la Coq, Twelf, Lego, . . .
Rewriting-calculus
Pure Pattern Type Systems (P
2T S)
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 12
Index
Typed Rho
based on Curry-Howard isomorphism ` a la Coq, Twelf, Lego, . . .
Rewriting-calculus
Pure Pattern Type Systems (P
2T S)
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 12
Index
P
2T S: Some problems
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 13
Index
P
2T S: Some problems
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 13
Index
P
2T S: Some problems
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 13
Index
P
2T S: Some problems
1
1 ). Zσ1τ Yσ1 1 ) (Xσ2τ 2
2 ) : τ
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 13
Index
P
2T S: Some problems
2 : τ
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 13
Index
P
2T S: Some problems
2 : τ
system!
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 13
Index
The main contribution of this (ongoing) work are ...
in a typed setting. We introduce delayed matching constraint, and the possibility for patterns in abstractions to evolve (by reduction or substitution) during execution
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 14
Index
The main contribution of this (ongoing) work are ...
in a typed setting. We introduce delayed matching constraint, and the possibility for patterns in abstractions to evolve (by reduction or substitution) during execution
enjoying ⋆ confluence ⋆ subject reduction ⋆ conservativity over PTSs ⋆ consistency for normalizing P
2T Ss c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 14
Index
The main contribution of this (ongoing) work are ...
in a typed setting. We introduce delayed matching constraint, and the possibility for patterns in abstractions to evolve (by reduction or substitution) during execution
enjoying ⋆ confluence ⋆ subject reduction ⋆ conservativity over PTSs ⋆ consistency for normalizing P
2T Ss
2T S is an open problem . . . but it is ok for simple
P
2T S-types (see Benjamin Wack SN-paper) and it “seems” ok for
simple+dependent P
2T S-types (❀ Rho gical Framework) c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 14
Index
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 15
Index
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 16
Index
The Typed Syntax
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 17
Index
The Typed Syntax
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 17
Index
The Typed Syntax
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 17
Index
The Typed Syntax
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 17
Index
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 18
Index
Galleria I: The Pattern Abstraction A →∆ B
∆
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 19
Index
Galleria I: The Pattern Abstraction A →∆ B
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 19
Index
Galleria I: The Pattern Abstraction A →∆ B
Fv(A →∆ B)
△
= (Fv(A) ∪ Fv(B) ∪ Fv(∆)) \ Dom(∆)
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 19
Index
Galleria I: The Pattern Abstraction A →∆ B
Fv(A →∆ B)
△
= (Fv(A) ∪ Fv(B) ∪ Fv(∆)) \ Dom(∆)
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 19
Index
Galleria I: The Pattern Abstraction A →∆ B
Fv(A →∆ B)
△
= (Fv(A) ∪ Fv(B) ∪ Fv(∆)) \ Dom(∆)
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 19
Index
Galleria II: The Matching Constraint [A ≪∆ B]C
the matching equation [A ≪∆ B] is put on the stack, hence constraints and “de facto” blocks the evaluation of C
(in case no solution exists at this stage of the evaluation)
△
= Fv((A →∆ C) B)
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 20
Index
HARD RUN EASY RUN SKIP
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 21
Index
Less Easy Running
∅X →(X:i) X
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 22
Index
Less Easy Running
∅X →(X:i) X X≺
XX OK!!
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 22
Index
Less Easy Running
∅X →(X:i) X X≺
XX OK!!
∅X →(X:i) Y
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 22
Index
Less Easy Running
∅X →(X:i) X X≺
XX OK!!
∅X →(X:i) Y X≺
XX ∧ X≺
XY KO!!
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 22
Index
Less Easy Running
∅X →(X:i) X X≺
XX OK!!
∅X →(X:i) Y X≺
XX ∧ X≺
XY KO!!
∅ X →(X:i) f(X 3)
Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 22
Index
Less Easy Running
∅X →(X:i) X X≺
XX OK!!
∅X →(X:i) Y X≺
XX ∧ X≺
XY KO!!
∅ X →(X:i) f(X 3)
XX ∧ f≺
Xf ∧ X≺
XX ∧ Y ≺
X3 OK!!
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 22
Index
Less Easy Running
∅X →(X:i) X X≺
XX OK!!
∅X →(X:i) Y X≺
XX ∧ X≺
XY KO!!
∅ X →(X:i) f(X 3)
XX ∧ f≺
Xf ∧ X≺
XX ∧ Y ≺
X3 OK!!
∅ [f(X) ≪(X:i) f(3)].X
Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 22
Index
Less Easy Running
∅X →(X:i) X X≺
XX OK!!
∅X →(X:i) Y X≺
XX ∧ X≺
XY KO!!
∅ X →(X:i) f(X 3)
XX ∧ f≺
Xf ∧ X≺
XX ∧ Y ≺
X3 OK!!
∅ [f(X) ≪(X:i) f(3)].X
Xf ∧ X≺
XX ∧ X≺
XX ∧ f≺
∅ f ∧ Y ≺
∅ 3 OK!!
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 22
Index
Two Easy Running
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 23
Index
Two Easy Running
∅ cons(T 3 nil(T))
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 23
Index
Two Easy Running
∅ cons(T 3 nil(T))
∅ 3 ∧ T≺
∅ T
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 23
Index
Two Easy Running
∅ cons(T 3 nil(T))
∅ 3 ∧ T≺
∅ T
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 23
Index
Two Easy Running
∅ cons(T 3 nil(T))
∅ 3 ∧ T≺
∅ T
∅ cons(i 3 nil(i))
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 23
Index
Two Easy Running
∅ cons(T 3 nil(T))
∅ 3 ∧ T≺
∅ T
∅ cons(i 3 nil(i))
∅ 3 ∧ T≺
∅ i
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 23
Index
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 24
Index
The Type System I
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 25
Index
The Type System I
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 25
Index
The Type System I
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 25
Index
The Type System I
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 25
Index
The Type System I
ρ σ δC
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 25
Index
The Type System II
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 26
Index
The Type System II
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 26
Index
The Type System II
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 26
Index
The Type System II
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 26
Index
The Type System II
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 26
Index
The Type System II
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 26
Index
The Type System II
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 26
Index
The Type System II
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 26
Index
The Type System II
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 26
Index
The Type System II
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 26
Index
The Type System II
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 26
Index
The Type System II
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 26
Index
Fetch Your System
System Rules ρ → (∗, ∗, ∗) ρ2 (∗, ∗, ∗) (✷, ∗, ∗) ρω (∗, ∗, ∗) (✷, ✷, ✷) ρω (∗, ∗, ∗) (∗, ✷, ✷) (✷, ✷, ✷) ρLF (∗, ∗, ∗) (∗, ✷, ✷) ρP2 (∗, ∗, ∗) (✷, ∗, ∗) (∗, ✷, ✷) ρPω (∗, ∗, ∗) (∗, ✷, ✷) (✷, ✷, ✷) ρPω (∗, ∗, ∗) (✷, ∗, ∗) (∗, ✷, ✷) (✷, ✷, ✷)
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 27
Index
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 28
Index
Example: Simple Type Derivation
Let Γ
△
= i:∗, f:ΠZ:Σ.i, 3:i, 4:i, and ∆
△
= X:i, and Σ
△
= Z:i,
. . . Γ, ∆ ⊢ (λ3:∅.3) : Π3:∅.i 5 6 Γ, ∆ ⊢ (λ3:∅.3) X : [3 ≪∅ X].i 3 (∗, ∗, ∗) ∈ R Γ ⊢ [Z ≪Σ X].i : ∗ Γ, ∆ ⊢ [3 ≪∅ X].i : ∗ Γ ⊢ Πf(X):∆.[3 ≪∅ X].i : ∗ Γ ⊢ λf(X):∆.(λ3:∅.3)X : Πf(X):∆.[3 ≪∅ X].i 3 4 Γ ⊢ (λf(X):∆.(λ3:∅.3)X) f(3) : [f(X) ≪∆ f(3)].[3 ≪∅ X].i 1 2 Γ ⊢ (λf(X):∆.(λ3:∅.3)X) f(3) : i where 1
△
= [f(X) ≪∆ f(3)].[3 ≪∅ X].i=
ρ σ δi, and
2
△
= Γ ⊢ i : ∗, and
3
△
= Γ, ∆ ⊢ f(X) : [Z ≪Σ X].i, and
4
△
= Γ ⊢ f(3) : [Z ≪Σ 3].i, and
5
△
= Γ, ∆ ⊢ X : i, and
6
△
= Γ, ∆ ⊢ 3 : i.
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 29
Index
Example: Simple Type Derivation
Let Γ
△
= i:∗, f:ΠZ:Σ.i, 3:i, 4:i, and ∆
△
= X:i, and Σ
△
= Z:i,
. . . Γ, ∆ ⊢ (λ3:∅.3) : Π3:∅.i 5 6 Γ, ∆ ⊢ (λ3:∅.3) X : [3 ≪∅ X].i 3 (∗, ∗, ∗) ∈ R Γ ⊢ [Z ≪Σ X].i : ∗ Γ, ∆ ⊢ [3 ≪∅ X].i : ∗ Γ ⊢ Πf(X):∆.[3 ≪∅ X].i : ∗ Γ ⊢ λf(X):∆.(λ3:∅.3)X : Πf(X):∆.[3 ≪∅ X].i 3 4 Γ ⊢ (λf(X):∆.(λ3:∅.3)X) f(3) : [f(X) ≪∆ f(3)].[3 ≪∅ X].i 1 2 Γ ⊢ (λf(X):∆.(λ3:∅.3)X) f(3) : i where 1
△
= [f(X) ≪∆ f(3)].[3 ≪∅ X].i=
ρ σ δi, and
2
△
= Γ ⊢ i : ∗, and
3
△
= Γ, ∆ ⊢ f(X) : [Z ≪Σ X].i, and
4
△
= Γ ⊢ f(3) : [Z ≪Σ 3].i, and
5
△
= Γ, ∆ ⊢ X : i, and
6
△
= Γ, ∆ ⊢ 3 : i.
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 29
Index
Playing with the Rho-cube: ρLF
△
= i:∗, f:ΠX:(X:i).∗, 3:i
Γ, X:i ⊢ X : i Γ ⊢ i : ∗ Γ, X:i ⊢ ∗ : ✷ Γ ⊢ ΠX:(X:i).∗ : ✷ Γ ⊢ f : ΠX:(X:i).∗ Γ, X:i ⊢ X : i Γ ⊢ 3 : i Γ ⊢ f(3) : [X ≪(X:i) 3]⊤∗ ≡ ∗
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 30
Index
Playing with the Rho-cube: ρ2
derived (where f denotes f X∗→X∗):
⊢ ∗ : ✷ ⊢ X∗ : ∗ ⊢ Y X∗ : X∗ (Conv+Appl) . . . ⊢ f(Y X∗) : X∗ ⊢ ∗ : ✷ ⊢ X∗ : ∗ ⊢ ∗ : ✷ ⊢ X∗ : ∗ X:∗, Y :X ⊢ f(Y X∗) → X : ∗ ⊢ f(Y X∗) → Y X∗ : f(Y X∗) → X∗ ⊢ ∗ : ✷ ⊢ X∗ : ∗ ⊢ ∗ : ✷
. . . ⊢ f(Y X∗) → X∗ : ∗ X:∗, Y :X ⊢ X∗ → f(Y X∗) → X : ∗ X:∗, Y :X ⊢ X∗ → f(Y X∗) → Y X∗ : X:∗, Y :X ⊢ X∗ → f(Y X∗) → X : ∗
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 31
Index
Playing with the Rho-cube: ρ2
derived (where f denotes f X∗→X∗):
⊢ ∗ : ✷ ⊢ X∗ : ∗ ⊢ Y X∗ : X∗ (Conv+Appl) . . . ⊢ f(Y X∗) : X∗ ⊢ ∗ : ✷ ⊢ X∗ : ∗ ⊢ ∗ : ✷ ⊢ X∗ : ∗ X:∗, Y :X ⊢ f(Y X∗) → X : ∗ ⊢ f(Y X∗) → Y X∗ : f(Y X∗) → X∗ ⊢ ∗ : ✷ ⊢ X∗ : ∗ ⊢ ∗ : ✷
. . . ⊢ f(Y X∗) → X∗ : ∗ X:∗, Y :X ⊢ X∗ → f(Y X∗) → X : ∗ X:∗, Y :X ⊢ X∗ → f(Y X∗) → Y X∗ : X:∗, Y :X ⊢ X∗ → f(Y X∗) → X : ∗
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 31
Index
Playing with the Rho-cube: ρ2
derived (where f denotes f X∗→X∗):
⊢ ∗ : ✷ ⊢ X∗ : ∗ ⊢ Y X∗ : X∗ (Conv+Appl) . . . ⊢ f(Y X∗) : X∗ ⊢ ∗ : ✷ ⊢ X∗ : ∗ ⊢ ∗ : ✷ ⊢ X∗ : ∗ X:∗, Y :X ⊢ f(Y X∗) → X : ∗ ⊢ f(Y X∗) → Y X∗ : f(Y X∗) → X∗ ⊢ ∗ : ✷ ⊢ X∗ : ∗ ⊢ ∗ : ✷
. . . ⊢ f(Y X∗) → X∗ : ∗ X:∗, Y :X ⊢ X∗ → f(Y X∗) → X : ∗ X:∗, Y :X ⊢ X∗ → f(Y X∗) → Y X∗ : X:∗, Y :X ⊢ X∗ → f(Y X∗) → X : ∗
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 31
Index
CONCLUSIONS
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 32
Index
P
2T S: Some Results
ρ σ δ is confluent
ρ σ δ C, then Γ ⊢ C : B
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 33
Index
P
2T S: Some Results
ρ σ δ is confluent
ρ σ δ C, then Γ ⊢ C : B
2T S is logically consistent, i.e.
for every sort s ∈ S, X:s ⊢ A : X
2T Ss are a conservative extension of PTSs:
Γ ⊢PTS A : B ⇐ ⇒ Γ† ⊢P2
T S A† : B†
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 33
Index
Open Tracks
techniques can be used to prove strong normalization of the λ
≪
readily to P
2T Ss; Luigi
2T Ss with a limited form of decidable
higher-order unification, in the style of λ-Prolog; Claude/Gop?
a laCoquand-Pollack-Luo; ?
constraints, but the resulting formalism could serve as the core engine of a little type-checker underneath of a powerful proof assistant; u:Claude-Germain,t:?
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 34
Index
Challenge ... Extending the Curry-Howard Isomorphism
deduction modulo, and natural deduction respectively;
2T Ss
can be used to extend previous results on term calculi for sequent calculi, and how their extension with matching theories can be used to provide suitable term calculi for deduction modulo;
2T Ss correspond to an extension
assumptions;
been considered previously, but it seems interesting to investigate whether such an extended natural deduction could find some applications in proof assistants, e.g. for transforming and optimizing proofs. END
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 35
Index
Logics and Rho ` a la Church
The relation with (intuitionistic) logic through the so-called Curry-Howard isomorphism, or ‘formulae-as-types’ principle, has been profoundly studied for
a laChurch, this relation is less clear, as demonstrated by the authors. The principle could be adapted as follows: Given a typed term A, if we can derive for A a type τ in the typed system Rho, with a derivation DerT, then the term A can be seen as the coding
type τ assigned to A.
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 36
Index
Curry from Church
For those systems, if DerT is a typed derivation, and − is the above meant erasing function, then by applying − to the “subject” of every judgment in DerT, we obtain a valid type assignment derivation DerU with the same structure
the result of an application of − to a typed one. In particular, the erasing function − induces an isomorphism between every typed system and the corresponding type assignment system.
f
△
=
f X
△
=
X A τ
△
=
A [P ≪∆ A].B
△
=
[P ≪ A ]. B P →∆ A
△
=
P → A A B
△
=
A B A; B
△
=
A ; B
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 37
Index
Logics and Rho ` a la Curry
For the type assignment system Rho the relation with logic is less clear even for the corresponding type assignments for the Lambda. The ‘formulae-as-types’ principle of Curry and Howard could be extended to the above type assignment systems as follows: Given an untyped term U, if we can assign a type τ in the type assignment system Rho, with a derivation DerU, then:
ϕ which corresponds to the interpretation of the type τ assigned to U;
instances (of the schema) prove, respectively, all the logic formulas ϕi’s that can be interpreted as the types τi’s that can be assigned to U.
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 38
Index
Typed and Untyped Judgments and Derivations
DerT DerU DerU −1 Γ ⊢U A : τ Γ ⊢T A : τ
✲
·
✛
· −1 Der
✛ ✲ ☞ ☞ ☞ ☞ ☞ ☞ ☞ ☞ ☞ ☞ ☞ ☞ ☞ ☞ ☞ ☞ ☞ ☞ ☞ ☞ ☞ ☞ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ☞ ☞ ☞ ☞ ☞ ☞ ☞ ☞ ☞ ☞ ☞ ☞ ☞ ☞ ☞ ☞ ☞ ☞ ☞ ☞ ☞ ☞
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 39
Index
Thanks for youρ attention ...
λ
≪
→
✻ ✲ ✚✚✚✚ ✚ ❃λ
≪
ω
✻ ✲
λ
≪2
✲ ✚✚✚✚ ✚ ❃λ
≪
ω
✲
λ
≪
P
✚✚✚✚ ✚ ❃ ✻
λ
≪
Pω
✻
λ
≪
P2
✚✚✚✚ ✚ ❃
λ
≪
Pω
PROP
✻ ✲ ✚✚✚✚ ✚ ❃
PROPω
✻ ✲
PROP2
✲ ✚✚✚✚ ✚ ❃
PROPω
✲
PRED
✚✚✚✚ ✚ ❃ ✻
PREDω
✻
PRED2
✚✚✚✚ ✚ ❃
PREDω
PROP proposition logic PRED predicate logic PROP2 second-order PROP PRED2 second-order PRED PROPω weakly higher-order PROP PREDω weakly higher-order PRED PROPω higher-order PROP PREDω higher-order PRED
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 40
Index
Thanks for youρ attention ...
λ
≪
→
✻ ✲ ✚✚✚✚ ✚ ❃λ
≪
ω
✻ ✲
λ
≪2
✲ ✚✚✚✚ ✚ ❃λ
≪
ω
✲
λ
≪
P
✚✚✚✚ ✚ ❃ ✻
λ
≪
Pω
✻
λ
≪
P2
✚✚✚✚ ✚ ❃
λ
≪
Pω
PROP
✻ ✲ ✚✚✚✚ ✚ ❃
PROPω
✻ ✲
PROP2
✲ ✚✚✚✚ ✚ ❃
PROPω
✲
PRED
✚✚✚✚ ✚ ❃ ✻
PREDω
✻
PRED2
✚✚✚✚ ✚ ❃
PREDω
PROP proposition logic PRED predicate logic PROP2 second-order PROP PRED2 second-order PRED PROPω weakly higher-order PROP PREDω weakly higher-order PRED PROPω higher-order PROP PREDω higher-order PRED
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 40
Index
Thanks for youρ attention ...
λ
≪
→
✻ ✲ ✚✚✚✚ ✚ ❃λ
≪
ω
✻ ✲
λ
≪2
✲ ✚✚✚✚ ✚ ❃λ
≪
ω
✲
λ
≪
P
✚✚✚✚ ✚ ❃ ✻
λ
≪
Pω
✻
λ
≪
P2
✚✚✚✚ ✚ ❃
λ
≪
Pω
PROP
✻ ✲ ✚✚✚✚ ✚ ❃
PROPω
✻ ✲
PROP2
✲ ✚✚✚✚ ✚ ❃
PROPω
✲
PRED
✚✚✚✚ ✚ ❃ ✻
PREDω
✻
PRED2
✚✚✚✚ ✚ ❃
PREDω
PROP proposition logic PRED predicate logic PROP2 second-order PROP PRED2 second-order PRED PROPω weakly higher-order PROP PREDω weakly higher-order PRED PROPω higher-order PROP PREDω higher-order PRED
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 40
Index
The Uncle Pat and the Lady Match
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 41
Index
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 42
Index
Lambda Calculi ` a la Church and Logics
Isomorphism ”proofs-as-(λ)-terms & propositions-as-types”
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 43
Index
Lambda Calculi ` a la Church and Logics
Isomorphism ”proofs-as-(λ)-terms & propositions-as-types”
[φ] ] is a canonical interpretation of φ in λi
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 43
Index
Lambda Calculi ` a la Church and Logics
Isomorphism ”proofs-as-(λ)-terms & propositions-as-types”
[φ] ] is a canonical interpretation of φ in λi
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 43
Index
Lambda Calculi ` a la Church and Logics
Isomorphism ”proofs-as-(λ)-terms & propositions-as-types”
[φ] ] is a canonical interpretation of φ in λi
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 43
Index
The Famous Barendregt’s λ-cube and its 8 logic systems
λ→
✻ ✲ ✚✚✚✚ ✚ ❃λω ✻ ✲
λ2
✲ ✚✚✚✚ ✚ ❃λω ✲
λP
✚✚✚✚ ✚ ❃ ✻
λPω
✻
λP2
✚✚✚✚ ✚ ❃
λPω
PROP
✻ ✲ ✚✚✚✚ ✚ ❃
PROPω
✻ ✲
PROP2
✲ ✚✚✚✚ ✚ ❃
PROPω
✲
PRED
✚✚✚✚ ✚ ❃ ✻
PREDω
✻
PRED2
✚✚✚✚ ✚ ❃
PREDω
PROP proposition logic PRED predicate logic PROP2 second-order PROP PRED2 second-order PRED PROPω weakly higher-order PROP PREDω weakly higher-order PRED PROPω higher-order PROP PREDω higher-order PRED
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 44
Index
The Famous Barendregt’s λ-cube and its 8 logic systems
λ→
✻ ✲ ✚✚✚✚ ✚ ❃λω ✻ ✲
λ2
✲ ✚✚✚✚ ✚ ❃λω ✲
λP
✚✚✚✚ ✚ ❃ ✻
λPω
✻
λP2
✚✚✚✚ ✚ ❃
λPω
PROP
✻ ✲ ✚✚✚✚ ✚ ❃
PROPω
✻ ✲
PROP2
✲ ✚✚✚✚ ✚ ❃
PROPω
✲
PRED
✚✚✚✚ ✚ ❃ ✻
PREDω
✻
PRED2
✚✚✚✚ ✚ ❃
PREDω
PROP proposition logic PRED predicate logic PROP2 second-order PROP PRED2 second-order PRED PROPω weakly higher-order PROP PREDω weakly higher-order PRED PROPω higher-order PROP PREDω higher-order PRED
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 44
Index
The Famous Barendregt’s λ-cube and its 8 logic systems
λ→
✻ ✲ ✚✚✚✚ ✚ ❃λω ✻ ✲
λ2
✲ ✚✚✚✚ ✚ ❃λω ✲
λP
✚✚✚✚ ✚ ❃ ✻
λPω
✻
λP2
✚✚✚✚ ✚ ❃
λPω
PROP
✻ ✲ ✚✚✚✚ ✚ ❃
PROPω
✻ ✲
PROP2
✲ ✚✚✚✚ ✚ ❃
PROPω
✲
PRED
✚✚✚✚ ✚ ❃ ✻
PREDω
✻
PRED2
✚✚✚✚ ✚ ❃
PREDω
PROP proposition logic PRED predicate logic PROP2 second-order PROP PRED2 second-order PRED PROPω weakly higher-order PROP PREDω weakly higher-order PRED PROPω higher-order PROP PREDω higher-order PRED
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 44
Index
From Barendregt’s λ-cube to Pure Type Systems (PTSs)
Berardi and Terlouw in ’89 BACK
a la Church can be seen as PTSs
be described/generalised as a simple unique PTS
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 45
Index
From Barendregt’s λ-cube to Pure Type Systems (PTSs)
Berardi and Terlouw in ’89 BACK
a la Church can be seen as PTSs
be described/generalised as a simple unique PTS
factorise and simplify proofs in metatheory, in the style “one theorem fits all!”
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 45
Index
From Barendregt’s λ-cube to Pure Type Systems (PTSs)
Berardi and Terlouw in ’89 BACK
a la Church can be seen as PTSs
be described/generalised as a simple unique PTS
factorise and simplify proofs in metatheory, in the style “one theorem fits all!”
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 45
Index
More Pragmatically ...
proposition-as-type principle, have a firm theoretical basis in logics represented via PTSs
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 46
Index
More Pragmatically ...
proposition-as-type principle, have a firm theoretical basis in logics represented via PTSs
MIZAR, ACL2, PVS ...
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 46
Index
More Pragmatically ...
proposition-as-type principle, have a firm theoretical basis in logics represented via PTSs
MIZAR, ACL2, PVS ...
capability of simplifying terms
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 46
Index
More Pragmatically ...
proposition-as-type principle, have a firm theoretical basis in logics represented via PTSs
MIZAR, ACL2, PVS ...
capability of simplifying terms
e principle can be (βιδ)-reductions, structural well-founded recursion, provable equality, or some arbitrary notion of reduction
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 46
Index
More Pragmatically ...
proposition-as-type principle, have a firm theoretical basis in logics represented via PTSs
MIZAR, ACL2, PVS ...
capability of simplifying terms
e principle can be (βιδ)-reductions, structural well-founded recursion, provable equality, or some arbitrary notion of reduction
“powerful” the proof assistant is ... BACK
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 46
Index
P
2T S: One-step, Many-steps, Congruence
Let Ctx[−] be any term T with a “single hole” inside, and let Ctx[A] be the result
→
ρ σ δ≡→ρ ∪ →σ ∪ →δ:
ρ σ δ B
ρ σ δ Ctx[B] (Ctx[−])
→
ρ σ δ and congruence relation = ρ σ δ are respectively
defined as the reflexive-transitive and reflexive-symmetric-transitive closure of →
ρ σ δ
BACK
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 47
Index
Abbreviations and Priorities
△
= A • B1 • · · · •Bn function-application
△
= A1; · · · ; An
△
= A • B • A
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 48
Index
Abbreviations and Priorities
△
= A • B1 • · · · •Bn function-application
△
= A1; · · · ; An
△
= A • B • A
: .
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 48
Index
... still substitutions
and
i=1...mFv(Ai)
and
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 49
Index
The Algorithm Alg
Γ(
A1≺
Γ,∆A2 ∧ B1≺
Γ,∆B2
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 50
Index
The Algorithm Alg
Γ(
A1≺
Γ,∆A2 ∧ B1≺
Γ,∆B2
Γ[A2 ≪∆ C2].B2
A1≺
Γ,∆A2 ∧ B1≺
Γ,∆B2 ∧ C1≺
ΓC2
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 50
Index
The Algorithm Alg
Γ(
A1≺
Γ,∆A2 ∧ B1≺
Γ,∆B2
Γ[A2 ≪∆ C2].B2
A1≺
Γ,∆A2 ∧ B1≺
Γ,∆B2 ∧ C1≺
ΓC2
Γ(A2; B2)
A1≺
ΓA2 ∧ B1≺
ΓB2
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 50
Index
The Algorithm Alg
Γ(
A1≺
Γ,∆A2 ∧ B1≺
Γ,∆B2
Γ[A2 ≪∆ C2].B2
A1≺
Γ,∆A2 ∧ B1≺
Γ,∆B2 ∧ C1≺
ΓC2
Γ(A2; B2)
A1≺
ΓA2 ∧ B1≺
ΓB2
∅ C)
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 50
Index
Termination of Alg
is defined as the reflexive, transitive and compatible closure of
T′, with T′ a matching system in solved form then, we say that the matching algorithm Alg (taking as input the system T) succeeds
α-conversion and Barendregt’s hygiene-convention
T
△
=
∧
i=0...n Xi≺
≺Σ
∆iAi
∧
j=0...m aj≺
≺Σ
∆jaj
the corresponding substitution {A1/X1 · · · An/Xn} is exhibited.
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 51
Index
Functional P
2T S
We require all specifications to be functional, i.e. for every s1, s2, s′
2, s3, s′ 3 ∈ S,
the following holds: (s1, s2) ∈ A and (s1, s′
2) ∈ A
implies s2 ≡ s′
2
(s1, s2, s3) ∈ R and (s1, s2, s′
3) ∈ R
implies s3 ≡ s′
3.
Furthermore, we let S⊤ denote the set of topsorts, i.e. S⊤ = {s ∈ S | ∀s′ ∈ S. (s, s′) ∈ A} and define a variant of delayed matching constraint as follows: [A ≪∆ C]⊤.B =
if B ∈ S⊤ [A ≪∆ C].B
BACK
c Luigi Liquori Rhappy-Days, Nancy, March 22, 2004 52