• Nie Znaleziono Wyników

Rachunek lambda, lato 2019-20

N/A
N/A
Protected

Academic year: 2021

Share "Rachunek lambda, lato 2019-20"

Copied!
113
0
0

Pełen tekst

(1)

Rachunek lambda, lato 2019-20

Wykład 12

22 maja 2020

(2)

Classical (unnatural) deduction

1

Γ, ¬σ ` ⊥

(Cheat) Γ ` σ

Example: Peirce’s Law

((p → q) → p) → p

is classically valid, but unprovable without rule (Cheat). Indeed, there is no normal M with

x : (p → q) → p ` M : p

(3)

Classical (unnatural) deduction

1

Γ, ¬σ ` ⊥

(Cheat) Γ ` σ

Example: Peirce’s Law

((p → q) → p) → p

is classically valid, but unprovable without rule (Cheat).

Indeed, there is no normal M with x : (p → q) → p ` M : p

(4)

Classical (unnatural) deduction

1

Γ, ¬σ ` ⊥

(Cheat) Γ ` σ

Example: Peirce’s Law

((p → q) → p) → p

is classically valid, but unprovable without rule (Cheat).

Indeed, there is no normal M with x : (p → q) → p ` M : p

(5)

Representing data types

I Natural numbers are generated by

I Constant0 : int;

I Successors : int → int.

They correspond to long normal forms of type ω = (0 → 0) → 0 → 0

I Words over {a, b} are generated by

I Constantε : word;

I Two successorsλλw (a · w ) andλλw (b · w ) of type word→ word.

They correspond to long normal forms of type word = (0 → 0) → (0 → 0) → 0 → 0

(6)

Representing data types

I Natural numbers are generated by

I Constant0 : int;

I Successors : int → int.

They correspond to long normal forms of type ω = (0 → 0) → 0 → 0

I Words over {a, b} are generated by

I Constantε : word;

I Two successorsλλw (a · w ) andλλw (b · w ) of type word→ word.

They correspond to long normal forms of type word = (0 → 0) → (0 → 0) → 0 → 0

(7)

Representing data types

I Natural numbers are generated by

I Constant0 : int;

I Successors : int → int.

They correspond to long normal forms of type ω = (0 → 0) → 0 → 0

I Words over {a, b} are generated by

I Constantε : word;

I Two successorsλλw (a · w ) andλλw (b · w ) of type word→ word.

They correspond to long normal forms of type word = (0 → 0) → (0 → 0) → 0 → 0

(8)

Representing data types

I Natural numbers are generated by

I Constant0 : int;

I Successors : int → int.

They correspond to long normal forms of type ω = (0 → 0) → 0 → 0

I Words over {a, b} are generated by

I Constantε : word;

I Two successorsλλw (a · w ) andλλw (b · w ) of type word→ word.

They correspond to long normal forms of type

(9)

Representing data types

I Binary trees are generated by

I Constantnil : tree;

I Constructorcons : tree → tree → tree.

They correspond to long normal forms of type tree = (0 → 0 → 0) → 0 → 0

Generalization:

Term algebras correspond to types of order two, i.e, of the form (0n1 → 0) → · · · → (0nk → 0) → 0

(10)

Representing data types

I Binary trees are generated by

I Constantnil : tree;

I Constructorcons : tree → tree → tree.

They correspond to long normal forms of type tree = (0 → 0 → 0) → 0 → 0

Generalization:

Term algebras correspond to types of order two, i.e, of the form (0n1 → 0) → · · · → (0nk → 0) → 0

(11)

Representing data types

I Binary trees are generated by

I Constantnil : tree;

I Constructorcons : tree → tree → tree.

They correspond to long normal forms of type tree = (0 → 0 → 0) → 0 → 0

Generalization:

Term algebras correspond to types of order two, i.e, of the form (0n1 → 0) → · · · → (0nk → 0) → 0

(12)

Representing data types

Types of order three and up define more complex structures.

For instance, long normal forms of type ((0 → 0) → 0) → 0 → 0 are as follows:

λF λx0. F (λx1. F (λx2. F (λx3F . . . λxk. x`) . . .)).

(13)

Type reducibility

Definition: Type τ is reducible to type σ iff there exists a closed term Φ : τ → σ such that the operator λλM:τ. ΦM is injective on closed terms, i.e.,

ΦM1 =βη ΦM2 implies M1 =βη M2 for closedM1, M2 : τ.

Examples:

I Typeω is reducible to type word usingΦ = λnfgx .nfx.

I Typesα → β → 0 and β → α → 0 are reducible to each other using Φ = λxyz. xzy.

I Typeword is reducible to type tree using Φ = λwcn.w (λx . cnx )(λx . cxn)(cnn).

(14)

Type reducibility

Definition: Type τ is reducible to type σ iff there exists a closed term Φ : τ → σ such that the operator λλM:τ. ΦM is injective on closed terms, i.e.,

ΦM1 =βη ΦM2 implies M1 =βη M2 for closedM1, M2 : τ.

Examples:

I Typeω is reducible to type word usingΦ = λnfgx .nfx.

I Typesα → β → 0 and β → α → 0 are reducible to each other using Φ = λxyz. xzy.

I Typeword is reducible to type tree using Φ = λwcn.w (λx . cnx )(λx . cxn)(cnn).

(15)

Type reducibility

Definition: Type τ is reducible to type σ iff there exists a closed term Φ : τ → σ such that the operator λλM:τ. ΦM is injective on closed terms, i.e.,

ΦM1 =βη ΦM2 implies M1 =βη M2 for closedM1, M2 : τ.

Examples:

I Typeω is reducible to type word usingΦ = λnfgx .nfx.

I Typesα → β → 0 and β → α → 0 are reducible to each other using Φ = λxyz. xzy.

I Typeword is reducible to type tree using Φ = λwcn.w (λx . cnx )(λx . cxn)(cnn).

(16)

Type reducibility

Definition: Type τ is reducible to type σ iff there exists a closed term Φ : τ → σ such that the operator λλM:τ. ΦM is injective on closed terms, i.e.,

ΦM1 =βη ΦM2 implies M1 =βη M2 for closedM1, M2 : τ.

Examples:

I Typeω is reducible to type word usingΦ = λnfgx .nfx.

I Typesα → β → 0 and β → α → 0 are reducible to each other using Φ = λxyz. xzy.

(17)

Example

Encoding wordw = aab = a · a · b · ε as a tree,

corresponding toΦw = λcn.w (λx . cnx )(λx . cxn)(cnn).

c

n c

n c

c n

(18)

A nice theorem

Theorem (R. Statman):

Every type over a single type constant0 is reducible to tree.

Idea dowodu

wg Thierry’ego Joly w kilku krokach.

(19)

Krok pierwszy

Lemat: Każdy typ nad 0 można zredukować do typu J = (0 → 0 → 0) → ((0 → 0) → 0) → 0.

Pomysł na dowód:

Kombinatory typu J są postaci λ@ λ∆. W, gdzie:

@ : 0 → 0 → 0, ∆ : (0 → 0) → 0 ` W : 0. Operatory @i ∆ mogą naśladować aplikację i abstrakcję.

(20)

Krok pierwszy

Lemat: Każdy typ nad 0 można zredukować do typu J = (0 → 0 → 0) → ((0 → 0) → 0) → 0.

Pomysł na dowód:

Kombinatory typu J są postaci λ@ λ∆. W, gdzie:

@ : 0 → 0 → 0, ∆ : (0 → 0) → 0 ` W : 0.

Operatory @i ∆ mogą naśladować aplikację i abstrakcję.

(21)

Krok pierwszy

Lemat: Każdy typ nad 0 można zredukować do typu J = (0 → 0 → 0) → ((0 → 0) → 0) → 0.

Pomysł na dowód:

Kombinatory typu J są postaci λ@ λ∆. W, gdzie:

@ : 0 → 0 → 0, ∆ : (0 → 0) → 0 ` W : 0.

Operatory @i ∆ mogą naśladować aplikację i abstrakcję.

(22)

Redukcja do typu J

Mając „stałe” @ : 0 → 0 → 0 i ∆ : (0 → 0) → 0, możemy zakodować dowolny term jako term typu0.

Na przykład term2 = λfx. f (fx) zakodujemy jako Dwa = ∆(λf0. ∆(λx0. @f (@fx )))

Bardziej sugestywna notacja:

— piszmyΛx zamiast ∆(λx oraz M · N zamiast @MN. Wtedy term Dwa napiszemy tak: Λf0Λx0. f · (f · x ) Opuszczamy szczegóły.

(23)

Redukcja do typu J

Mając „stałe” @ : 0 → 0 → 0 i ∆ : (0 → 0) → 0, możemy zakodować dowolny term jako term typu0.

Na przykład term2 = λfx. f (fx) zakodujemy jako Dwa = ∆(λf0. ∆(λx0. @f (@fx )))

Bardziej sugestywna notacja:

— piszmyΛx zamiast ∆(λx oraz M · N zamiast @MN. Wtedy term Dwa napiszemy tak: Λf0Λx0. f · (f · x ) Opuszczamy szczegóły.

(24)

Redukcja do typu J

Mając „stałe” @ : 0 → 0 → 0 i ∆ : (0 → 0) → 0, możemy zakodować dowolny term jako term typu0.

Na przykład term2 = λfx. f (fx) zakodujemy jako Dwa = ∆(λf0. ∆(λx0. @f (@fx )))

Bardziej sugestywna notacja:

— piszmyΛx zamiast ∆(λx oraz M · N zamiast @MN. Wtedy term Dwa napiszemy tak: Λf0Λx0. f · (f · x )

(25)

Redukcja do typu J

J = (0 → 0 → 0) → ((0 → 0) → 0) → 0.

Γ = {@ : 0 → 0 → 0, ∆ : (0 → 0) → 0}.

Dla dowolnegoτ, definiujemy termy Uτ i Vτ, takie że:

Γ ` Uτ : τ → 0 Γ ` Vτ : 0 → τ Indukcja: U0= V0= I,

Uρ→σ = λfρ→σ. ∆(λx0Uσ(f (Vρ(x )))) Vρ→σ = λy0λzρ. Vσ(@y (Uρz))

Redukcja typuτ doJ jest dana przez term λfτλ@λ∆. Uτf. opuszczone

(26)

Γ = {@ : 0 → 0 → 0, ∆ : (0 → 0) → 0}.

Definiujemy termy Uτ : τ → 0, Vτ : 0 → τ Uρ→σ = λfρ→σ. ∆(λx0Uσ(f (Vρ(x )))) Vρ→σ = λy0λzρ. Vσ(@y (Uρz))

Sens tej definicji:

Uρ→σ(f ): x : 0−→ ρVρ −→ σf −→ 0Uσ

Vρ→σ(y ): z : ρ −→ 0Uρ −→ 0@y −→ σVσ

(27)

Krok drugi

Zredukowaliśmy dowolny typ do typu:

J = (0 → 0 → 0) → ((0 → 0) → 0) → 0 czyli do J = bool → ((0 → 0) → 0) → 0.

Teraz zredukujemy końcówkę((0 → 0) → 0) → 0 do typu word = (0 → 0) → (0 → 0) → 0 → 0. (Potem zredukujemy J do typu bool → word.)

(28)

Krok drugi

Zredukowaliśmy dowolny typ do typu:

J = (0 → 0 → 0) → ((0 → 0) → 0) → 0 czyli do J = bool → ((0 → 0) → 0) → 0.

Teraz zredukujemy końcówkę((0 → 0) → 0) → 0 do typu word = (0 → 0) → (0 → 0) → 0 → 0.

(Potem zredukujemy J do typubool → word.)

(29)

Krok drugi

Zredukowaliśmy dowolny typ do typu:

J = (0 → 0 → 0) → ((0 → 0) → 0) → 0 czyli do J = bool → ((0 → 0) → 0) → 0.

Teraz zredukujemy końcówkę((0 → 0) → 0) → 0 do typu word = (0 → 0) → (0 → 0) → 0 → 0.

(Potem zredukujemy J do typubool → word.)

(30)

Φ : [((0 → 0) → 0) → 0] → [(0 → 0) → (0 → 0) → 0 → 0]

Φ = λZ λf0→0g0→0x0. Z (λh0→0. f (h(g (hx ))))

Kombinatory typu [(0 → 0) → 0] → 0 są takie: M = λϕ(0→0)→0. ϕ(λy1. ϕ(λy2. . . . ϕ(λyk. yj))). Term M jest zdeterminowany przez liczby k i j.

Przykład: M = λϕ(0→0)→0. ϕ(λy1. ϕ(λy2. ϕ(λy3. ϕ(λy4. y2)))). WtedyΦ(M) = λfgx . f4(g (f2(x ))).

Opuszczamy szczegóły.

(31)

Φ : [((0 → 0) → 0) → 0] → [(0 → 0) → (0 → 0) → 0 → 0]

Φ = λZ λf0→0g0→0x0. Z (λh0→0. f (h(g (hx ))))

Kombinatory typu [(0 → 0) → 0] → 0 są takie:

M = λϕ(0→0)→0. ϕ(λy1. ϕ(λy2. . . . ϕ(λyk. yj))).

Term M jest zdeterminowany przez liczbyk i j.

Przykład: M = λϕ(0→0)→0. ϕ(λy1. ϕ(λy2. ϕ(λy3. ϕ(λy4. y2)))). WtedyΦ(M) = λfgx . f4(g (f2(x ))).

Opuszczamy szczegóły.

(32)

Φ : [((0 → 0) → 0) → 0] → [(0 → 0) → (0 → 0) → 0 → 0]

Φ = λZ λf0→0g0→0x0. Z (λh0→0. f (h(g (hx ))))

Kombinatory typu [(0 → 0) → 0] → 0 są takie:

M = λϕ(0→0)→0. ϕ(λy1. ϕ(λy2. . . . ϕ(λyk. yj))).

Term M jest zdeterminowany przez liczbyk i j.

Przykład: M = λϕ(0→0)→0. ϕ(λy1. ϕ(λy2. ϕ(λy3. ϕ(λy4. y2)))).

WtedyΦ(M) = λfgx . f4(g (f2(x ))). Opuszczamy szczegóły.

(33)

Φ : [((0 → 0) → 0) → 0] → [(0 → 0) → (0 → 0) → 0 → 0]

Φ = λZ λf0→0g0→0x0. Z (λh0→0. f (h(g (hx ))))

Kombinatory typu [(0 → 0) → 0] → 0 są takie:

M = λϕ(0→0)→0. ϕ(λy1. ϕ(λy2. . . . ϕ(λyk. yj))).

Term M jest zdeterminowany przez liczbyk i j.

Przykład: M = λϕ(0→0)→0. ϕ(λy1. ϕ(λy2. ϕ(λy3. ϕ(λy4. y2)))).

WtedyΦ(M) = λfgx . f4(g (f2(x ))).

Opuszczamy szczegóły.

(34)

Krok drugi

Φ = λZ λf0→0g0→0x0. Z (λh0→0. f (h(g (hx )))) M = λϕ(0→0)→0. ϕ(λy1. ϕ(λy2. ϕ(λy3. ϕ(λy4. y2)))).

WtedyΦ(M) = λfgx . ϕ(λy1. ϕ(λy2. ϕ(λy3. ϕ(λy4. y2)))), gdzie ϕ = λh0→0. f (h(g (hx ))).

ϕ(λy4. y2)  f ((λy4. y2)(. . . )) → f (y2); ϕ(λy3. fy2)  f ((λy3. fy2)(. . . )) → f2(y2);

ϕ(λy2. f2(y2))  f ((λy2. f2(y2))(g ((λy2. f2(y2))(x ))))

 f3(g (f2(x )); ϕ(λy1. f3(g (f2(x )))  f ((λy1. f3(g (f2(x )))(. . . )))

 f4(g (f2(x ))). opuszczone

(35)

Krok drugi

Φ = λZ λf0→0g0→0x0. Z (λh0→0. f (h(g (hx )))) M = λϕ(0→0)→0. ϕ(λy1. ϕ(λy2. ϕ(λy3. ϕ(λy4. y2)))).

WtedyΦ(M) = λfgx . ϕ(λy1. ϕ(λy2. ϕ(λy3. ϕ(λy4. y2)))), gdzie ϕ = λh0→0. f (h(g (hx ))).

ϕ(λy4. y2)  f ((λy4. y2)(. . . )) → f (y2);

ϕ(λy3. fy2)  f ((λy3. fy2)(. . . )) → f2(y2);

ϕ(λy2. f2(y2))  f ((λy2. f2(y2))(g ((λy2. f2(y2))(x ))))

 f3(g (f2(x )); ϕ(λy1. f3(g (f2(x )))  f ((λy1. f3(g (f2(x )))(. . . )))

 f4(g (f2(x ))). opuszczone

(36)

Krok drugi

Φ = λZ λf0→0g0→0x0. Z (λh0→0. f (h(g (hx )))) M = λϕ(0→0)→0. ϕ(λy1. ϕ(λy2. ϕ(λy3. ϕ(λy4. y2)))).

WtedyΦ(M) = λfgx . ϕ(λy1. ϕ(λy2. ϕ(λy3. ϕ(λy4. y2)))), gdzie ϕ = λh0→0. f (h(g (hx ))).

ϕ(λy4. y2)  f ((λy4. y2)(. . . )) → f (y2);

ϕ(λy3. fy2)  f ((λy3. fy2)(. . . )) → f2(y2);

ϕ(λy2. f2(y2))  f ((λy2. f2(y2))(g ((λy2. f2(y2))(x ))))

 f3(g (f2(x )); ϕ(λy1. f3(g (f2(x )))  f ((λy1. f3(g (f2(x )))(. . . )))

 f4(g (f2(x ))). opuszczone

(37)

Krok drugi

Φ = λZ λf0→0g0→0x0. Z (λh0→0. f (h(g (hx )))) M = λϕ(0→0)→0. ϕ(λy1. ϕ(λy2. ϕ(λy3. ϕ(λy4. y2)))).

WtedyΦ(M) = λfgx . ϕ(λy1. ϕ(λy2. ϕ(λy3. ϕ(λy4. y2)))), gdzie ϕ = λh0→0. f (h(g (hx ))).

ϕ(λy4. y2)  f ((λy4. y2)(. . . )) → f (y2);

ϕ(λy3. fy2)  f ((λy3. fy2)(. . . )) → f2(y2);

ϕ(λy2. f2(y2))  f ((λy2. f2(y2))(g ((λy2. f2(y2))(x ))))

 f3(g (f2(x ));

ϕ(λy1. f3(g (f2(x )))  f ((λy1. f3(g (f2(x )))(. . . )))

 f4(g (f2(x ))). opuszczone

(38)

Krok drugi

Φ = λZ λf0→0g0→0x0. Z (λh0→0. f (h(g (hx )))) M = λϕ(0→0)→0. ϕ(λy1. ϕ(λy2. ϕ(λy3. ϕ(λy4. y2)))).

WtedyΦ(M) = λfgx . ϕ(λy1. ϕ(λy2. ϕ(λy3. ϕ(λy4. y2)))), gdzie ϕ = λh0→0. f (h(g (hx ))).

ϕ(λy4. y2)  f ((λy4. y2)(. . . )) → f (y2);

ϕ(λy3. fy2)  f ((λy3. fy2)(. . . )) → f2(y2);

ϕ(λy2. f2(y2))  f ((λy2. f2(y2))(g ((λy2. f2(y2))(x ))))

 f3(g (f2(x ));

ϕ(λy1. f3(g (f2(x )))  f ((λy1. f3(g (f2(x )))(. . . )))

(39)

Krok trzeci

MamyJ = bool → J2 → 0, gdzie:

bool = 0 → 0 → 0 J2 = (0 → 0) → 0.

W kroku drugim zredukowaliśmy typJ2 → 0 do typu word = (0 → 0) → (0 → 0) → 0 → 0

używając Φ = λZJ2→0λf0→0g0→0x0. Z (λh0→0f (h(g (hx )))) Teraz redukujemybool → J2 → 0dobool → wordużywając Ψ = λZbool→J2→0λtboolλf0→0g0→0x0. Zt(λh0→0f (h(g (hx )))) czyliΨ = λZbool→J2→0λtbool. Φ(Zt).

(40)

Krok czwarty: redukcja bool → word do tree.

Typbool → word, czyli:

(0 → 0 → 0) → (0 → 0) → (0 → 0) → 0 → 0 odpowiada algebrze termów nad sygnaturą

t : 0 → 0 → 0, f , g : 0 → 0, c : 0.

Trzeba je zakodować jako zwykłe drzewa nad sygnaturą t : 0 → 0 → 0, c : 0.

Można to zrobić używając np.Θ : (bool → word) → tree:

Θ = λZ λt0→0→0c0. Zt(λx tcx )(λx txc)(tcc)

(41)

Typy proste: semantyka

(42)

Semantics for finite types

Assumptions:

I Orthodox Church style;

I Only one atomic type0;

I Extensional equality =βη.

(43)

Standard model M(A)

I Basic domainD0 = A;

I Function domains: Dσ→τ = Dσ → Dτ;

I Obvious semantics:

I [[x ]]v = v (x );

I [[MN]]v = [[M]]v([[N]]v);

I [[λxτ. M]]v = λλd ∈Dτ. [[M]]v [x 7→d ].

(44)

Completeness

Theorem (Harvey Friedman):

Terms are βη-equal iff they are equal in M(N).

Proof:

Define partial surjections ϕσ : Dσ −◦ Tσ/=βη by induction: Forσ = 0 take ϕ0 : N → T0/=βη to be any (total) surjection. (Terms of base type are represented by their numbers.) For function types, we represent (the behaviour of) lambda-terms using integer functions, so that:

ϕσ(ab) =βη ϕτ →σ(a)ϕτ(b).

(45)

Completeness

Theorem (Harvey Friedman):

Terms are βη-equal iff they are equal in M(N).

Proof:

Define partial surjectionsϕσ : Dσ −◦ Tσ/=βη by induction:

Forσ = 0 take ϕ0 : N → T0/=βη to be any (total) surjection. (Terms of base type are represented by their numbers.) For function types, we represent (the behaviour of) lambda-terms using integer functions, so that:

ϕσ(ab) =βη ϕτ →σ(a)ϕτ(b).

(46)

Completeness

Theorem (Harvey Friedman):

Terms are βη-equal iff they are equal in M(N).

Proof:

Define partial surjectionsϕσ : Dσ −◦ Tσ/=βη by induction:

Forσ = 0 take ϕ0 : N → T0/=βη to be any (total) surjection.

(Terms of base type are represented by their numbers.)

For function types, we represent (the behaviour of) lambda-terms using integer functions, so that:

ϕσ(ab) =βη ϕτ →σ(a)ϕτ(b).

(47)

Completeness

Theorem (Harvey Friedman):

Terms are βη-equal iff they are equal in M(N).

Proof:

Define partial surjectionsϕσ : Dσ −◦ Tσ/=βη by induction:

Forσ = 0 take ϕ0 : N → T0/=βη to be any (total) surjection.

(Terms of base type are represented by their numbers.) For function types, we represent (the behaviour of) lambda-terms using integer functions, so that:

ϕσ(ab) =βη ϕτ →σ(a)ϕτ(b).

(48)

Completeness proof

Givenϕσ : Dσ −◦ Tσ/=βη and ϕτ : Dτ −◦ Tτ/=βη,

we say that a function f : Dτ → Dσ represents a term Mτ →σ when (informally) the following diagram commutes:

Dτ f //

ϕτ



Dσ ϕσ



Tτ/=βη

λλt. Mt

//Tσ/=βη

(49)

Completeness proof

Define partial surjectionsϕσ : Dσ −◦ Tσ/=βη by induction:

I ϕ0 : N → T0/=βη is any (total) surjection.

I ϕτ →σ(f ) = [M]=βη when f represents M. Abbreviation: Ifd ∈ Dσ, writed forϕσ(d ).

Main property:

If f and e are defined thenf (e) is defined and f e =βη f (e)

(50)

Completeness proof

Lemma:

Takev so that v (x ) = x, for all x. Then M =βη [[M]]v, all M.

Main Proof:

LetM(N) |= M = N. Then [[M]]v = [[N]]v, for all v, in particular for v as above. Therefore

M =βη [[M]]v =βη [[N]]v =βη N.

(51)

Completeness proof

Lemma:

Takev so that v (x ) = x, for all x. Then M =βη [[M]]v, all M.

Main Proof:

LetM(N) |= M = N. Then [[M]]v = [[N]]v, for all v, in particular for v as above. Therefore

M =βη [[M]]v =βη [[N]]v =βη N.

(52)

Finite completeness

Łatwa obserwacja:

For every M and N there is k such that:

M =βη N iff M(k) |= M = N.

Corollary:

Terms are βη-equal iff they are equal in all finite models.

(Konwencja: k = {0, 1, . . . , k − 1})

(53)

Finite completeness

Łatwa obserwacja:

For every M and N there is k such that:

M =βη N iff M(k) |= M = N.

Corollary:

Terms are βη-equal iff they are equal in all finite models.

(Konwencja: k = {0, 1, . . . , k − 1})

(54)

Finite completeness

Theorem (R. Statman):

For every M there is k such that, for all N: M =βη N iff M(k) |= M = N.

Corollary:

Terms are βη-equal iff they are equal in all finite models.

(Konwencja: k = {0, 1, . . . , k − 1})

(55)

Finite completeness

Theorem (R. Statman):

For every M there is k such that, for all N: M =βη N iff M(k) |= M = N.

Corollary:

Terms are βη-equal iff they are equal in all finite models.

(Konwencja: k = {0, 1, . . . , k − 1})

(56)

Finite completeness proof

It suffices to prove that

for every closed M : treethere is k such that, for all N : tree:

M =βη N iff M(k) |= M = N.

Indeed, for closedM : τ, consider Φ(M),

where Φis a reduction of τ to tree.

For non-closed terms, consider appropriate lambda-closures.

(57)

Finite completeness for tree

Letp(m)(n) = 2m(2n + 1). Then p ∈ D0→0→0 in M(N). Observe that p(m)(n) > m, n, for all m, n.

Term zamknięty typutree, to w istocie drzewo.

Wartość[[M]](p)(0) można uważać za numer tego drzewa. Ćwiczenie: Jaka liczba jest numerem drzewa

λpx . px (p(pxx )x )?

(58)

Finite completeness for tree

Letp(m)(n) = 2m(2n + 1). Then p ∈ D0→0→0 in M(N). Observe that p(m)(n) > m, n, for all m, n.

Term zamknięty typutree, to w istocie drzewo.

Wartość[[M]](p)(0) można uważać za numer tego drzewa. Ćwiczenie: Jaka liczba jest numerem drzewa

λpx . px (p(pxx )x )?

(59)

Finite completeness for tree

Letp(m)(n) = 2m(2n + 1). Then p ∈ D0→0→0 in M(N). Observe that p(m)(n) > m, n, for all m, n.

Term zamknięty typutree, to w istocie drzewo.

Wartość[[M]](p)(0) można uważać za numer tego drzewa.

Ćwiczenie: Jaka liczba jest numerem drzewa λpx . px (p(pxx )x )?

(60)

ForM : tree, define k = 2 + [[M]](p)(0), i.e. 2 + numer (M).

Letp0 : k → k → k be p „truncated” to values less than k. Thenp0 ∈ D0→0→0 in M(k).

SupposeM(k) |= M = N. Then in the model M(k):

k − 2 = [[M]](p0)(0) = [[N]](p0)(0) (*) But all numbers needed to verify (*) are at mostk − 2. (Otherwise the rhs equalsk − 1.)

Therefore[[M]](p)(0) = [[N]](p)(0) holds also inM(N). It follows that M =βη N.

(61)

ForM : tree, define k = 2 + [[M]](p)(0), i.e. 2 + numer (M).

Letp0 : k → k → k be p „truncated” to values less than k.

Thenp0 ∈ D0→0→0 in M(k).

SupposeM(k) |= M = N. Then in the model M(k):

k − 2 = [[M]](p0)(0) = [[N]](p0)(0) (*) But all numbers needed to verify (*) are at mostk − 2. (Otherwise the rhs equalsk − 1.)

Therefore[[M]](p)(0) = [[N]](p)(0) holds also inM(N). It follows that M =βη N.

(62)

ForM : tree, define k = 2 + [[M]](p)(0), i.e. 2 + numer (M).

Letp0 : k → k → k be p „truncated” to values less than k.

Thenp0 ∈ D0→0→0 in M(k).

SupposeM(k) |= M = N. Then in the model M(k):

k − 2 = [[M]](p0)(0) = [[N]](p0)(0) (*)

But all numbers needed to verify (*) are at mostk − 2. (Otherwise the rhs equalsk − 1.)

Therefore[[M]](p)(0) = [[N]](p)(0) holds also inM(N). It follows that M =βη N.

(63)

ForM : tree, define k = 2 + [[M]](p)(0), i.e. 2 + numer (M).

Letp0 : k → k → k be p „truncated” to values less than k.

Thenp0 ∈ D0→0→0 in M(k).

SupposeM(k) |= M = N. Then in the model M(k):

k − 2 = [[M]](p0)(0) = [[N]](p0)(0) (*) But all numbers needed to verify (*) are at mostk − 2.

(Otherwise the rhs equalsk − 1.)

Therefore[[M]](p)(0) = [[N]](p)(0) holds also inM(N). It follows that M =βη N.

(64)

ForM : tree, define k = 2 + [[M]](p)(0), i.e. 2 + numer (M).

Letp0 : k → k → k be p „truncated” to values less than k.

Thenp0 ∈ D0→0→0 in M(k).

SupposeM(k) |= M = N. Then in the model M(k):

k − 2 = [[M]](p0)(0) = [[N]](p0)(0) (*) But all numbers needed to verify (*) are at mostk − 2.

(Otherwise the rhs equalsk − 1.)

Therefore[[M]](p)(0) = [[N]](p)(0) holds also inM(N). It follows that M = N.

(65)

Equality is not definable in simple types

There is noE : ωτ → ωσ → ωρ, such that for all p, q ∈ N: E pωτqωσ =βη 0ωρ iff p = q.

Proof:

By Statman’s thm., take k such that for all N : ωρ: M(k) |= 0ωρ = N iff 0ωρ =βη N.

There arep 6= q with [[pωτ]] = [[qωτ]] in M(k). So in M(k): [[E pωτqωσ]] = [[E ]][[pωτ]][[qωσ]] = [[E ]][[qωτ]][[qωσ]] =

[[E qωτqωσ]] = [[0ωρ]] ThusM(k) |= E pωτqωσ = 0ωρ, whence p = q.

(66)

Equality is not definable in simple types

There is noE : ωτ → ωσ → ωρ, such that for all p, q ∈ N: E pωτqωσ =βη 0ωρ iff p = q.

Proof:

By Statman’s thm., take k such that for all N : ωρ: M(k) |= 0ωρ = N iff 0ωρ =βη N.

There arep 6= q with [[pωτ]] = [[qωτ]] in M(k). So in M(k): [[E pωτqωσ]] = [[E ]][[pωτ]][[qωσ]] = [[E ]][[qωτ]][[qωσ]] =

[[E qωτqωσ]] = [[0ωρ]] ThusM(k) |= E pωτqωσ = 0ωρ, whence p = q.

(67)

Equality is not definable in simple types

There is noE : ωτ → ωσ → ωρ, such that for all p, q ∈ N: E pωτqωσ =βη 0ωρ iff p = q.

Proof:

By Statman’s thm., take k such that for all N : ωρ: M(k) |= 0ωρ = N iff 0ωρ =βη N.

There arep 6= q with [[pωτ]] = [[qωτ]] in M(k).

So inM(k): [[E pωτqωσ]] = [[E ]][[pωτ]][[qωσ]] = [[E ]][[qωτ]][[qωσ]] =

[[E qωτqωσ]] = [[0ωρ]] ThusM(k) |= E pωτqωσ = 0ωρ, whence p = q.

(68)

Equality is not definable in simple types

There is noE : ωτ → ωσ → ωρ, such that for all p, q ∈ N: E pωτqωσ =βη 0ωρ iff p = q.

Proof:

By Statman’s thm., take k such that for all N : ωρ: M(k) |= 0ωρ = N iff 0ωρ =βη N.

There arep 6= q with [[pωτ]] = [[qωτ]] in M(k). So in M(k):

[[E pωτqωσ]] = [[E ]][[pωτ]][[qωσ]] = [[E ]][[qωτ]][[qωσ]] =

[[E qωτqωσ]] = [[0ωρ]]

(69)

Plotkin’s problem

Givend ∈ Dτ in a finite model M(X ).

Is there a closed term M : τ with [[M]] = d?

More generally:

Let v (x1) = e1 ∈ Dσ1, . . . , v (xn) = en ∈ Dσn. Is there M such that [[M]]v = d? (Is d definable from e1, . . . , en?)

Fact: These decision problems are reducible to each other.

(70)

Plotkin’s problem

Givend ∈ Dτ in a finite model M(X ).

Is there a closed term M : τ with [[M]] = d?

More generally:

Let v (x1) = e1 ∈ Dσ1, . . . , v (xn) = en ∈ Dσn. Is there M such that [[M]]v = d?

(Is d definable from e1, . . . , en?)

(71)

Undecidablility of lambda-definability

Theorem (Ralph Loader, 1993):

Plotkin’s problem is undecidable.

Proof:

Reduction from the undecidable word problem for Semi-Thue systems.

Semi-Thue system: a finite set of rules C ⇒ D, where C , D ⊆ {a, b}. Induces rewritingxCy → xDy, for any x, y. Word problem: Can a word w be rewritten to v in a finite number of steps?

(72)

Undecidablility of lambda-definability

Theorem (Ralph Loader, 1993):

Plotkin’s problem is undecidable.

Proof:

Reduction from the undecidable word problem for Semi-Thue systems.

Semi-Thue system: a finite set of rules C ⇒ D, where C , D ⊆ {a, b}. Induces rewritingxCy → xDy, for any x, y. Word problem: Can a word w be rewritten to v in a finite number of steps?

(73)

Undecidablility of lambda-definability

Theorem (Ralph Loader, 1993):

Plotkin’s problem is undecidable.

Proof:

Reduction from the undecidable word problem for Semi-Thue systems.

Semi-Thue system: a finite set of rules C ⇒ D, where C , D ⊆ {a, b}. Induces rewritingxCy → xDy, for any x, y. Word problem: Can a word w be rewritten to v in a finite number of steps?

(74)

Undecidablility of lambda-definability

Theorem (Ralph Loader, 1993):

Plotkin’s problem is undecidable.

Proof:

Reduction from the undecidable word problem for Semi-Thue systems.

Kodujemy słowaw i v i reguły systemu jako elementy modelu.

Pytamy, czyv jest definiowalne z w i reguł.

(75)

Proof

TakeX = {a, b, L, R, ∗, 1, 0}. Encode any word w = o1. . . on as a functionw : D0n→ D0, such that

I w (∗ · · · ∗ oi ∗ · · · ∗) = 1, if the i-th symbol in w is oi;

I w (∗ · · · ∗ LR ∗ · · · ∗) = 1;

I w (. . .) = 0, otherwise.

(76)

How does it work?

Forw = w1Cw2 we have w = λλ~x λλ~y λλ~z. w (~x )(~y )(~z).

Fix~x , ~z and consider the function g = λλ~y . w (~x )(~y )(~z). It “accepts” the following strings (depending on~x , ~z):

~x ~y ~z

∗ · · · ∗ oi ∗ · · · ∗ ∗ · · · ∗ ∗ · · · ∗

∗ · · · ∗ same as C ∗ · · · ∗

∗ · · · ∗ ∗ · · · ∗ ∗ · · · ∗ oi∗ · · · ∗

∗ · · · ∗ LR ∗ · · · ∗ ∗ · · · ∗ ∗ · · · ∗

∗ · · · ∗ L R ∗ · · · ∗ ∗ · · · ∗

∗ · · · ∗ ∗ · · · ∗ L R ∗ · · · ∗

∗ · · · ∗ ∗ · · · ∗ ∗ · · · ∗ LR ∗ · · · ∗

(77)

How does it work?

Forw = w1Cw2 we have w = λλ~x λλ~y λλ~z. w (~x )(~y )(~z).

Fix~x , ~z and consider the function g = λλ~y . w (~x )(~y )(~z).

It “accepts” the following strings (depending on~x , ~z):

~x ~y ~z

∗ · · · ∗ oi ∗ · · · ∗ ∗ · · · ∗ ∗ · · · ∗

∗ · · · ∗ same as C ∗ · · · ∗

∗ · · · ∗ ∗ · · · ∗ ∗ · · · ∗ oi∗ · · · ∗

∗ · · · ∗ LR ∗ · · · ∗ ∗ · · · ∗ ∗ · · · ∗

∗ · · · ∗ L R ∗ · · · ∗ ∗ · · · ∗

∗ · · · ∗ ∗ · · · ∗ L R ∗ · · · ∗

∗ · · · ∗ ∗ · · · ∗ ∗ · · · ∗ LR ∗ · · · ∗

(78)

How does it work?

Forw = w1Cw2 we have w = λλ~x λλ~y λλ~z. w (~x )(~y )(~z).

Fix~x , ~z and consider the function g = λλ~y . w (~x )(~y )(~z).

It “accepts” the following strings (depending on~x , ~z):

~x ~y ~z

∗ · · · ∗ oi ∗ · · · ∗ ∗ · · · ∗ ∗ · · · ∗

∗ · · · ∗ same as C ∗ · · · ∗

∗ · · · ∗ ∗ · · · ∗ ∗ · · · ∗ oi∗ · · · ∗

∗ · · · ∗ LR ∗ · · · ∗ ∗ · · · ∗ ∗ · · · ∗

∗ · · · ∗ L R ∗ · · · ∗ ∗ · · · ∗

(79)

How does it work?

Fix~x , ~z and consider the function g = λλ~y . w (~x )(~y )(~z).

Depending on~x , ~z, the function g is as follows:

~x g ~z

∗ · · · ∗ oi ∗ · · · ∗ χ{∗···∗} ∗ · · · ∗

∗ · · · ∗ C ∗ · · · ∗

∗ · · · ∗ χ{∗···∗} ∗ · · · ∗ oi ∗ · · · ∗

∗ · · · ∗ LR ∗ · · · ∗ χ{∗···∗} ∗ · · · ∗

∗ · · · ∗ L χ{R∗···∗} ∗ · · · ∗

∗ · · · ∗ χ{∗···∗L} R ∗ · · · ∗

∗ · · · ∗ χ{∗···∗} ∗ · · · ∗ LR ∗ · · · ∗

(80)

How to encode a rule F = (C ⇒ D)?

Fix~x , ~z and consider the function g = λλ~y . w (~x )(~y )(~z).

What will change in this table if we replacew1Cw2 by w1Dw2?

~

x g ~z

∗ · · · ∗ oi ∗ · · · ∗ χ{∗···∗} ∗ · · · ∗

∗ · · · ∗ C ∗ · · · ∗

∗ · · · ∗ χ{∗···∗} ∗ · · · ∗ oi ∗ · · · ∗

∗ · · · ∗ LR ∗ · · · ∗ χ{∗···∗} ∗ · · · ∗

∗ · · · ∗ L χ{R∗···∗} ∗ · · · ∗

∗ · · · ∗ χ{∗···∗L} R ∗ · · · ∗

∗ · · · ∗ χ{∗···∗} ∗ · · · ∗ LR ∗ · · · ∗

other χ other

(81)

How to encode a rule F = (C ⇒ D)?

Fix~x , ~z and consider the function g = λλ~y . w (~x )(~y )(~z).

What will change in this table if we replacew1Cw2 by w1Dw2?

~

x g ~z

∗ · · · ∗ oi ∗ · · · ∗ χ{∗···∗} ∗ · · · ∗

∗ · · · ∗ C ∗ · · · ∗

∗ · · · ∗ χ{∗···∗} ∗ · · · ∗ oi ∗ · · · ∗

∗ · · · ∗ LR ∗ · · · ∗ χ{∗···∗} ∗ · · · ∗

∗ · · · ∗ L χ{R∗···∗} ∗ · · · ∗

∗ · · · ∗ χ{∗···∗L} R ∗ · · · ∗

∗ · · · ∗ χ{∗···∗} ∗ · · · ∗ LR ∗ · · · ∗

(82)

How to encode a rule F = (C ⇒ D)

Every ruleF = (C ⇒ D) is encoded as a function F : (D0m → D0) → (D0n → D0),

wherem = |C | and n = |D|. We take:

I F (χ{∗···∗}) = χ{∗···∗};

I F (χ{R∗···∗}) = χ{R∗···∗};

I F (χ{∗···∗L}) = χ{∗···∗L};

I F (C ) = D;

(83)

Claim

A word w can be rewritten to v iff the element v of M(X ) is definable fromw and the functions F encoding the rules.

The easy part: Letw = w1Cw2 rewrite to v = w1Dw2

usingF = (C ⇒ D). Assume that term W defines w. Thenv is definable by

V = λ~x ~u~z. F (λ~y . W ~x~y ~z)~u, (*) It follows that codes of reachable words are definable.

The hard part: And conversely.

(84)

Claim

A word w can be rewritten to v iff the element v of M(X ) is definable fromw and the functions F encoding the rules.

The easy part: Letw = w1Cw2 rewrite to v = w1Dw2

usingF = (C ⇒ D). Assume that term W defines w. Thenv is definable by

V = λ~x ~u~z. F (λ~y . W ~x~y ~z)~u, (*) It follows that codes of reachable words are definable.

The hard part: And conversely.

(85)

Claim

A word w can be rewritten to v iff the element v of M(X ) is definable fromw and the functions F encoding the rules.

The easy part: Letw = w1Cw2 rewrite to v = w1Dw2

usingF = (C ⇒ D). Assume that term W defines w. Thenv is definable by

V = λ~x ~u~z. F (λ~y . W ~x~y ~z)~u, (*) It follows that codes of reachable words are definable.

The hard part: And conversely.

(86)

Inhabitation for intersection types

Theorem

The inhabitation problem for intersection types is undecidable.

Proof: Reduction from definability.

Encode elementsd of M(X )as intersection typesτd:

I If d ∈ D0 then τd = d.

I If d ∈ Dα→β then τd =T

e∈Dαe → τde). For a valuationv in M(X ), take Γv(x ) = τv (x ). Main Lemma: [[M]]v = d iff Γv ` M : τd.

(87)

Inhabitation for intersection types

Theorem

The inhabitation problem for intersection types is undecidable.

Proof: Reduction from definability.

Encode elementsd of M(X )as intersection typesτd:

I If d ∈ D0 then τd = d.

I If d ∈ Dα→β then τd =T

e∈Dαe → τde). For a valuationv in M(X ), take Γv(x ) = τv (x ). Main Lemma: [[M]]v = d iff Γv ` M : τd.

(88)

Inhabitation for intersection types

Theorem

The inhabitation problem for intersection types is undecidable.

Proof: Reduction from definability.

Encode elementsd of M(X ) as intersection typesτd:

I If d ∈ D0 then τd = d.

I If d ∈ Dα→β then τd =T

e∈Dαe → τde).

For a valuationv in M(X ), take Γv(x ) = τv (x ). Main Lemma: [[M]]v = d iff Γv ` M : τd.

(89)

Inhabitation for intersection types

Theorem

The inhabitation problem for intersection types is undecidable.

Proof: Reduction from definability.

Encode elementsd of M(X ) as intersection typesτd:

I If d ∈ D0 then τd = d.

I If d ∈ Dα→β then τd =T

e∈Dαe → τde).

For a valuationv in M(X ), take Γv(x ) = τv (x ). Main Lemma: [[M]]v = d iff Γv ` M : τd.

(90)

Higher-order unification

Problem:

Given Church-style (normal) terms M,N of the same type with some variables x1σ1, . . . , xnσn called unknowns. (There may be other variables called constants or parameters.) Are there termsP1σ1, . . . , Pnσn such that

M[x1 := P1, . . . xn:= Pn] =βη N[x1 := P1, . . . xn := Pn]? Non-essential generalization to finite systems of equations.

Examples

(constantsa, b : p, f : p → p → p,

unknowns F : p → p,G : p → p → p)

I fa(Fa) = F (faa)has solutions λx .fa(fa(fa(· · · (fax ) · · · ))).

I Gab = fa(Gab)has no solution.

(91)

Higher-order unification

Problem:

Given Church-style (normal) terms M,N of the same type with some variablesx1σ1, . . . , xnσn called unknowns.

(There may be other variables called constants or parameters.) Are there termsP1σ1, . . . , Pnσn such that

M[x1 := P1, . . . xn := Pn] =βη N[x1 := P1, . . . xn := Pn]?

Non-essential generalization to finite systems of equations.

Examples

(constantsa, b : p, f : p → p → p,

unknowns F : p → p,G : p → p → p)

I fa(Fa) = F (faa)has solutions λx .fa(fa(fa(· · · (fax ) · · · ))).

I Gab = fa(Gab)has no solution.

(92)

Higher-order unification

Problem:

Given Church-style (normal) terms M,N of the same type with some variablesx1σ1, . . . , xnσn called unknowns.

(There may be other variables called constants or parameters.) Are there termsP1σ1, . . . , Pnσn such that

M[x1 := P1, . . . xn := Pn] =βη N[x1 := P1, . . . xn := Pn]?

Non-essential generalization to finite systems of equations.

Examples

(constantsa, b : p, f : p → p → p,

unknowns F : p → p,G : p → p → p)

I fa(Fa) = F (faa)has solutions λx .fa(fa(fa(· · · (fax ) · · · ))).

I Gab = fa(Gab)has no solution.

(93)

Higher-order unification

Problem:

Given Church-style (normal) terms M,N of the same type with some variablesx1σ1, . . . , xnσn called unknowns.

(There may be other variables called constants or parameters.) Are there termsP1σ1, . . . , Pnσn such that

M[x1 := P1, . . . xn := Pn] =βη N[x1 := P1, . . . xn := Pn]?

Non-essential generalization to finite systems of equations.

Examples

(constantsa, b : p, f : p → p → p,

unknowns F : p → p,G : p → p → p)

I fa(Fa) = F (faa)has solutions λx .fa(fa(fa(· · · (fax ) · · · ))).

I Gab = fa(Gab)has no solution.

(94)

Higher-order unification

Problem:

Given Church-style (normal) terms M,N of the same type with some variablesx1σ1, . . . , xnσn called unknowns.

(There may be other variables called constants or parameters.) Are there termsP1σ1, . . . , Pnσn such that

M[x1 := P1, . . . xn := Pn] =βη N[x1 := P1, . . . xn := Pn]?

Non-essential generalization to finite systems of equations.

Examples

(constantsa, b : p, f : p → p → p,

unknowns F : p → p,G : p → p → p)

I fa(Fa) = F (faa)has solutions λx .fa(fa(fa(· · · (fax ) · · · ))).

(95)

Example 1

The equationfa(Fa) = F (faa) has solutions λx .fa(fa(fa(· · · (fax ) · · · ))).

f = F F (x ) := f

a F f a f

a a a a x

(96)

Example 2

The equationGab = fa(Gab) has no solution.

G = f

a b a G

a b

(97)

Rząd (order)

Rząd typu:

I order (p) = 0;

I order (σ → τ ) = max{order (σ) + 1, order (τ )}.

Uwaga:

order (σ1→ · · · →σn→p) = 1 + max{order (σn) | n = 1, . . . , n}

Unificationof order n has unknowns of order n − 1.

(98)

Rząd (order)

Rząd typu:

I order (p) = 0;

I order (σ → τ ) = max{order (σ) + 1, order (τ )}.

Uwaga:

order (σ1→ · · · →σn→p) = 1 + max{order (σn) | n = 1, . . . , n}

Unificationof order n has unknowns of order n − 1.

(99)

Rząd (order)

Rząd typu:

I order (p) = 0;

I order (σ → τ ) = max{order (σ) + 1, order (τ )}.

Uwaga:

order (σ1→ · · · →σn→p) = 1 + max{order (σn) | n = 1, . . . , n}

Unificationof order n has unknowns of order n − 1.

(100)

Undecidability

Theorem 1 (C.L. Lucchesi’72, G. Huet’73):

The third-order unification is undecidable.

Theorem 2 (W. Goldfarb’81):

The second-order unification is undecidable.

Theorem 3 (A. Schubert’97):

Nierozstrzygalność drugiego rzędu nawet wtedy, gdy niewiadome nie są zagnieżdżone.

(101)

Undecidability

Theorem 1 (C.L. Lucchesi’72, G. Huet’73):

The third-order unification is undecidable.

Theorem 2 (W. Goldfarb’81):

The second-order unification is undecidable.

Theorem 3 (A. Schubert’97):

Nierozstrzygalność drugiego rzędu nawet wtedy, gdy niewiadome nie są zagnieżdżone.

(102)

Undecidability

Theorem 1 (C.L. Lucchesi’72, G. Huet’73):

The third-order unification is undecidable.

Theorem 2 (W. Goldfarb’81):

The second-order unification is undecidable.

Theorem 3 (A. Schubert’97):

Nierozstrzygalność drugiego rzędu nawet wtedy, gdy niewiadome nie są zagnieżdżone.

(103)

X problem Hilberta

Twierdzenie (Matjasiewicz)

Następujący problem jest nierozstrzygalny:

Dany wielomianw (~x ) o współczynnikach całkowitych. Czy równaniew (~x ) = 0ma rozwiązanie w liczbach całkowitych?

Cytaty

Powiązane dokumenty

Takie typy czasem się

For every number n of a type derivation for a lambda-term M there exists m such that every number of a finite reduction sequence of M is less

For every number n of a type derivation for a lambda-term M there exists m such that every number of a finite reduction sequence of M is less than m... Strong Normalization.. For

Uwaga: Klasyczny rachunek zdań jest.. Statman): Inhabitation in simple types is decidable and P SPACE -complete.?. Wniosek: To samo dotyczy minimalnego

I Validity/provability in second-order classical propositional logic (known as the QBF problem) is P SPACE -complete.. I Provability in second-order intuitionistic propositional

Twierdzenie ( Löb, 1976, Gabbay, 1974, Sobolew, 1977) Problem inhabitacji:.. Dany typ τ , czy istnieje term zamknięty M

I Przedmiotem dziaªania mo»e by¢ cokolwiek, zatem.. funkcja nie ma a priori

M = λ~x.(λy.P)Q~R → β λ~ x.P[y := Q]~R = N is called