calculating projections via type checking

90
DTT DTS Previous work Type check./infer. Conclusion References Calculating Projections via Type Checking Daisuke Bekki 1,2,3,4 Miho Satoh 1 1 Ochanomizu University / 2 CREST, Japan Science and Technology Agency / 3 National Institute of Advanced Industrial Science and Technology / 4 National Institute of Informatics version: August 13, 2015 TYpe Theory and LExical Semantics (TYTLES) ESSLLI2015, Barcelona, August 5th (Wed), 2015. http://www.slideshare.net/kaleidotheater/bekki-satotytles2015 1 / 71

Upload: daisuke-bekki

Post on 17-Aug-2015

140 views

Category:

Science


2 download

TRANSCRIPT

DTT DTS Previous work Type check./infer. Conclusion References

Calculating Projections via Type Checking

Daisuke Bekki1,2,3,4 Miho Satoh1

1Ochanomizu University / 2CREST, Japan Science and Technology Agency /3National Institute of Advanced Industrial Science and Technology / 4National

Institute of Informatics

version: August 13, 2015TYpe Theory and LExical Semantics (TYTLES)

ESSLLI2015, Barcelona, August 5th (Wed), 2015.

http://www.slideshare.net/kaleidotheater/bekki-satotytles2015

1 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Natural language semantics with dependent typesI Donkey anaphora: Sundholm (1986)I Translation from DRS to dependent type representations: Ahn

and Kolb (1990)I Ranta’s TTG (Relative and Implicational Donkey Sentences,

Branching Quantifiers, Intensionality, Tense): Ranta (1994)I A reformulation of Montague Grammar Montague (1973) in

terms of dependent type theory: Davila-Perez (1995)I Summation: Fox (1994a,b)I Presupposition Binding and Accommodation, Bridging:

Krahmer and Piwek (1999), Piwek and Krahmer (2000)I Type Theory with Record (TTR): Cooper (2005)I Coercion: Luo (1997, 1999, 2010, 2012), Asher and Luo

(2012)I Adverbs: Chatzikyriakidis (2014)

2 / 71

DTT DTS Previous work Type check./infer. Conclusion References

What this talk is about

I Dependent Type Semantics (DTS; Bekki (2013a, 2014)):I DTS is a framework of natural language sematnics based on

dependent type theory (Martin-Lof, 1984)(Coquand and Huet,1988).

I DTS is a proof-theoretic semantics via Curry-Howardcorrespondence between types and propositions, following theline of Sundholm (1986), Ranta (1994), Cooper (2005) andLuo (2012).

I DTS is a compositional/lexicalized theory of meaning thatworks as a semantic component of any lexical grammar.

I In this work, we update (=formalize and implement) the corecomponent (=the type checking/inference system) of DTSthat enables us to calculate presupposition projection in adecidable manner.

3 / 71

DTT DTS Previous work Type check./infer. Conclusion References

What this talk is about

I Dependent Type Semantics (DTS; Bekki (2013a, 2014)):I DTS is a framework of natural language sematnics based on

dependent type theory (Martin-Lof, 1984)(Coquand and Huet,1988).

I DTS is a proof-theoretic semantics via Curry-Howardcorrespondence between types and propositions, following theline of Sundholm (1986), Ranta (1994), Cooper (2005) andLuo (2012).

I DTS is a compositional/lexicalized theory of meaning thatworks as a semantic component of any lexical grammar.

I In this work, we update (=formalize and implement) the corecomponent (=the type checking/inference system) of DTSthat enables us to calculate presupposition projection in adecidable manner.

3 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Dependent Type Theory

4 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Three key concepts in dependent type theory

1. Curry-Howard Correspondence (between logic and typetheory)

2. Dependent types (vs. Simple types)

3. Proof-theoretic semantics (vs. Model-theoretic semantics)

5 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Typing rules for simply-typed lambda calculus(STLC) with binary products

Type construction rules Type deconstruction rules

x : A....M : B

i

λx.M

function

: A→ B(LAM ),i

M : A→ B N : AMN : B

(APP)

M : A N : B(M,N)

pair

: A×B(PROD)

M : A×Bπ1(M) : A

(PROJ )M : A×Bπ2(M) : B

(PROJ )

6 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Typing rules for simply-typed lambda calculus(STLC) with binary products

f : A→ B, x : A ` f : A→ B(VAR)

f : A→ B, x : A ` x : A(VAR)

f : A→ B, x : A ` fx : B(APP)

f : A→ B ` λx.fx : A→ B(LAM )

` λf.λx.fx : (A→ B)→ (A→ B)(LAM )

I The type of a term is determined by types of its subterm(s).

7 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Typing rules for simply-typed lambda calculus(STLC) with binary products

f : A→ B, x : A ` f : A→ B(VAR)

f : A→ B, x : A ` x : A(VAR)

f : A→ B, x : A ` fx : B(APP)

f : A→ B ` λx.fx : A→ B(LAM )

` λf.λx.fx : (A→ B)→ (A→ B)(LAM )

I The typing tree of a term (in STLC) can be recovered fromthe (structure of) term. (cf. Milner (1978))

Fact 1

A term is an encoding of a typing tree.

8 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Typing rules for simply-typed lambda calculus(STLC) with binary products

f : A→ B, x : A ` f : A→ B(VAR)

f : A→ B, x : A ` x : A(VAR)

f : A→ B, x : A ` fx : B(APP)

f : A→ B ` λx.fx : A→ B(LAM )

` λf.λx.fx : (A→ B)→ (A→ B)(LAM )

I The typing tree of a term (in STLC) can be recovered fromthe (structure of) term. (cf. Milner (1978))

Fact 1

A term is an encoding of a typing tree.

8 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Typing rules for simply-typed lambda calculus(STLC) with binary products

f : A→ B, x : A ` f : A→ B(VAR)

f : A→ B, x : A ` x : A(VAR)

f : A→ B, x : A ` fx : B(APP)

f : A→ B ` λx.fx : A→ B(LAM )

` λf.λx.fx : (A→ B)→ (A→ B)(LAM )

I The typing tree of a term (in STLC) can be recovered fromthe (structure of) term. (cf. Milner (1978))

Fact 1

A term is an encoding of a typing tree.

8 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Typing rules for simply-typed lambda calculus(STLC) with binary products

f : A→ B, x : A ` f : A→ B(VAR)

f : A→ B, x : A ` x : A(VAR)

f : A→ B, x : A ` fx : B(APP)

f : A→ B ` λx.fx : A→ B(LAM )

` λf.λx.fx : (A→ B)→ (A→ B)(LAM )

I The typing tree of a term (in STLC) can be recovered fromthe (structure of) term. (cf. Milner (1978))

Fact 1

A term is an encoding of a typing tree.

8 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Curry-Howard Correspondence btw. function typeand implication

Introduction rules Elimination rules

Typing rules inSTLC

x : A....M : B

i

λx.M

function

: A→ B(LAM ),i

M : A→ B N : AMN : B

(APP)

Natural de-duction rulesin PL

A....B

i

A→ B(→I ),i

A→ B A

B(→E)

9 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Curry-Howard Correspondence btw. product typeand conjunction

Introduction rules Elimination rules

Typingrules inSTLC

M : A N : B(M,N)

pair

: A×B(PROD)

M : A×Bπ1(M) : A

(PROJ )M : A×Bπ2(M) : B

(PROJ )

Naturaldeduc-tion rulesin PL

A B

A ∧B(∧I )

A ∧BA

(∧E)A ∧BB

(∧E)

Fact 2

Typing rules of STLC (almost exactly) correspond to naturaldeduction rules in logic.

10 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Curry-Howard Correspondence btw. product typeand conjunction

Fact 1

A term is an encoding of a typing tree.

+

Fact 2

Typing rules of STLC (almost exactly) correspond to naturaldeduction rules in logic.

Fact 3

A term of type A is also an encoding of a proof diagram of aproposition A (under the view that proposition is type)

11 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Curry-Howard Correspondence btw. product typeand conjunction

Fact 3

A term of type A is also an encoding of a proof diagram of aproposition A (under the view that proposition is type)

Fact 3’I Functions encode proofs of→.

I Pairs encode proofs of ∧.

12 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Curry-Howard Correspondence btw. product typeand conjunction

The correspondence between the notions of logic and type theory :

Logic Type Theory

proposition typeproof term (or program)axiom constant symbolassumption variablelogical connective type constructor

implication functional typeconjunction product typedisjunction direct sum type

absurdity empty typeintroduction constructorelimination destructorprovability inhabitancecut substitutionnormalization reduction

13 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Dependent function typeIntroduction rules Elimination rules

function type→ in STLC

x : A....M : B

i

λx.M

function

: A→ B(LAM ),i

M : A→ B N : AMN : B

(APP)

Dependentfunction type(Π) in DTT

A : sort

x : A....M : B

i

λx.M

function

: (x:A)→ B(ΠI ),i

M : (x:A)→ B N : A

MN : B[N/x](ΠE)

Scope: (x:A)→ B

14 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Dependent sum type

Introduction rules Elimination rules

producttype ×in STLC

M : A N : B(M,N)

pair

: A×B(PROD)

M : A×Bπ1(M) : A

(PROJ )M : A×Bπ2(M) : B

(PROJ )

Dependentsum type(Σ) inDTT

M : A N : B[M/x]

(M,N)

pair

:[x:AB

] (ΣI )M :

[x:AB

]π1(M) : A

(ΣE)

M :[x:AB

]π2(M) : B[π1(M)/x]

(ΣE)

Scope:

[x:AB

]

15 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Dependent types

Dependent types Standard notation x 6∈ fv(B) x ∈ fv(B)(x:A)→ B (Πx : A)B A→ B (∀x : A)B[x:AB

](Σx : A)B A ∧B (∃x : A)B

16 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Dependent Type Semantics

17 / 71

DTT DTS Previous work Type check./infer. Conclusion References

E-type anaphora: Ranta (1994)

(1) A man entered. He whistled.u:

x:entity[man(x)enter(x)

] whistle( π1(u) )

Note:

[x:AB

]is a type for pairs of A and B[x].

18 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Donkey anaphora: Sundholm (1986)

(2) Every farmer who owns a donkey beats it .

(x:entity)→

u:

farmer(x)y:entitya[

donkey(y)own(x, y)

] → beat(x, π1π2(u) )

Note: (x:A)→ B is a type for functions from A to B[x].

19 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Accessibility: Ranta (1994)

(3) Every man entered. * He whistled.u: (x:entity)→ man(x)→ enter(x)

whistle( ? )

In this case, the pronoun CANNOT pick up the entity (=the manwho entered) from u, since u is a function. This explains thefollowing cases uniformly, since both implication and negation areinstances of dependent functional types:

(4) a. If John owns a car, it must be a Porsche. *It is red.

b. John did not buy a car. *It is a Porsche.

This accounts for accessibility, based on the structure of a proof.20 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Local context and context passing: Bekki (2014)

Definition (Dynamic conjunction and disjunction)

M ;Ndef≡ λc.

[u:McN(c, u)

]M |N

def≡ λc. (u:¬Mc)→ N(c, u)

(1) A man entered. He whistled.

λc.

x:entity[man(x)enter(x)

] ; λc.whistle( @1 c))

underspecified term

= λc.

u:

x:entity[man(x)enter(x)

]whistle( @1 (c, u))

21 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Presupposition projection as type checking/inference

Felicity condition

`

u:

x:entity[man(x)enter(x)

]whistle(@1((), u))

: type

⇓ Type checking/inference

` @1 :

>x:entity[

man(x)enter(x)

]→ entity

22 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Presupposition resolution as proof search

` @1 :

>x:entity[

man(x)enter(x)

]→ entity

I If the hearer chooses to bind the presupposition, he/she hasto find a term to replace @1 (for example, λx.π1π2(x) issuch a term). In other words, anaphora/presuppositionresolution reduces to proof search.

I Or the hearer may choose to accommodate the presupposition:in that case, he/she abandons tng proof search and add a newvariable of the above type to the global context.

23 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Recent works on DTS

I Generalized Quantifiers: Tanaka et al. (2013), Tanaka (2014)

I Double-Negated Antecedents: Bekki (2013b)

I Modal Subordination: Tanaka et al. (2014)

I Conventional Implicature: Bekki and McCready (2014)

I Honorification in Japanese: Watanabe et al. (2014)

I Type checking/inference in DTS and its implementation:Bekki and Sato (2015)

I Factive Presupposition: Tanaka et al. (2015)

24 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Interim summary

I DTS is a framework of natural language semantics based ondependent type theory, following the line of Sundholm (1986),Ranta (1994).

I Dependent types work well for representing discourseanaphora (or presupposition in general) in a parallel mannerto syntactic structures.

I DTS is a compositionalized (or lexicalized) version ofdependent-type-oriented semantics, which adopts amechanism such as local contexts, context passing, andunderspecified terms.

I In DTS, the calculation of presupposition projection reducesto type checking/inference. This algorithm has not beenformulated nor implemented until this work is done!

25 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Interim summary

I DTS is a framework of natural language semantics based ondependent type theory, following the line of Sundholm (1986),Ranta (1994).

I Dependent types work well for representing discourseanaphora (or presupposition in general) in a parallel mannerto syntactic structures.

I DTS is a compositionalized (or lexicalized) version ofdependent-type-oriented semantics, which adopts amechanism such as local contexts, context passing, andunderspecified terms.

I In DTS, the calculation of presupposition projection reducesto type checking/inference. This algorithm has not beenformulated nor implemented until this work is done!

25 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Interim summary

I DTS is a framework of natural language semantics based ondependent type theory, following the line of Sundholm (1986),Ranta (1994).

I Dependent types work well for representing discourseanaphora (or presupposition in general) in a parallel mannerto syntactic structures.

I DTS is a compositionalized (or lexicalized) version ofdependent-type-oriented semantics, which adopts amechanism such as local contexts, context passing, andunderspecified terms.

I In DTS, the calculation of presupposition projection reducesto type checking/inference. This algorithm has not beenformulated nor implemented until this work is done!

25 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Interim summary

I DTS is a framework of natural language semantics based ondependent type theory, following the line of Sundholm (1986),Ranta (1994).

I Dependent types work well for representing discourseanaphora (or presupposition in general) in a parallel mannerto syntactic structures.

I DTS is a compositionalized (or lexicalized) version ofdependent-type-oriented semantics, which adopts amechanism such as local contexts, context passing, andunderspecified terms.

I In DTS, the calculation of presupposition projection reducesto type checking/inference. This algorithm has not beenformulated nor implemented until this work is done!

25 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Previous work on typechecking/inference algorithm in

dependent type theory

26 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Type Inference in Dependent Types

I DTS is based on Dependent Type Theory.

I Type inference in dependent type theory is known to beundecidable.

27 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Type Inference in Dependent Types

I DTS is based on Dependent Type Theory.

I Type inference in dependent type theory is known to beundecidable.

27 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Type Inference in Dependent Types

I DTS is based on Dependent Type Theory.

I Type inference in dependent type theory is known to beundecidable.

27 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Type Inference in Dependent Types

I Previous work on type inference in dependent type theory→ Loh’s system for Agda (Loh et al., 2010).

I In Loh’s system, we can do type inference in dependent typetheory with the help of a construction called annotation.

28 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Loh et al. (2010)’s system

e↓ ::= e↑| λx.e↓

e↑ ::= e↓ : e↓| ∗| ∀x : e↓.e′↓| x| e↑ e

′↓

v ::= n| ∗| ∀x : v.v′

n ::= x| nv

Γ ` e′ :↓ ∗ e′ ⇓ v′ Γ ` e :↓ v′

Γ ` (e : e′) :↑ v′(ANN )

Γ ` ∗ :↑ ∗(STAR)

Γ(x) = v

Γ ` x :↑ v(VAR)

Γ ` e :↓ ∗ e ⇓ v Γ, x : v ` e′ :↓ ∗Γ ` ∀x : e.e′ :↑ ∗

(PI )Γ ` e :↑ ∀x : v.v′ Γ ` e′ :↓ v v′[e′/x] ⇓ v′′

Γ ` ee′ :↑ v′′(APP)

Γ ` e :↑ v

Γ ` e :↓ v(CHK)

Γ, x : v ` e :↓ v′

Γ ` λx.e :↓ ∀x : v.v′(LAM )

29 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Explanation of Loh’s system

e↓ ::= e↑| λx.e↓

e↑ ::= e↓ : e↓| ∗| ∀x : e↓.e′↓| x| e↑ e

′↓

v ::= n| ∗| ∀x : v.v′

n ::= x| nv

I e↓ : checkable terms

I e↑ : inferable terms

I v : values

I n : neutral terms

30 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Explanation about Loh’s system

I Typing rules are also classified into two categories:type inference rules and type checking rules.

Γ ` e′ :↓ ∗ e′ ⇓ v′ Γ ` e :↓ v′

Γ ` (e : e′) :↑ v′(ANN )

Γ ` ∗ :↑ ∗(STAR)

Γ(x) = v

Γ ` x :↑ v(VAR)

Γ ` e :↓ ∗ e ⇓ v Γ, x : v ` e′ :↓ ∗Γ ` ∀x : e.e′ :↑ ∗

(PI )

Γ ` e :↑ ∀x : v.v′ Γ ` e′ :↓ v v′[e′/x] ⇓ v′′

Γ ` ee′ :↑ v′′(APP)

The conclusion of type inference rules contains :↑

31 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Explanation of Loh’s system

I Typeing rules are also classified into two categories: typeinference rules and type checking rules.

Γ ` e :↑ v

Γ ` e :↓ v(CHK)

Γ, x : v ` e :↓ v′

Γ ` λx.e :↓ ∀x : v.v′(LAM )

The conclusion of type checking rules contains :↓

1. Type inference rules and type checking rules are defined in amutually recursive manner.

2. In DTS, these notations are used similarly.

32 / 71

DTT DTS Previous work Type check./infer. Conclusion References

How to read typing rules

Example[L] Γ `σ M :↑ (x:v)→ v′ [L′] [L′] Γ `σ N :↓ v [L′′] v′[N/x] �β v

′′

[L] Γ `σ MN :↑ v′′ [L′′](ΠE)

In logic:

I We read rules from premise to conclusion.

I If the premises are satisfied, then the conclusion is satisfied.

33 / 71

DTT DTS Previous work Type check./infer. Conclusion References

How to read typing rules

Example[L] Γ `σ M :↑ (x:v)→ v′ [L′] [L′] Γ `σ N :↓ v [L′′] v′[N/x] �β v

′′

[L] Γ `σ MN :↑ v′′ [L′′](ΠE)

In type inference:

I We read rules from conclusion to premise.

I A term to the left of the colon has a type to the right of thecolon only when all the premise are satisfied.

34 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Type checking/inference algorithm inDTS

35 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Type inference system for DTSI In DTS, there are terms that are not included in Loh’s system.

Loh’s system DTSλx.e↓ λx.M↑e↓ : e↓ M↓ : M↓∗ type

∀x : e↓.e′↓ (x:M↓)→M↓x x

e↑ e′↓ M↑ M↓

c[x:M↓M↓

]...

@i

36 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Inferable terms and Checkable terms

I M↑ : inferable term

I M↓ : checkable term

M↑ ::= x| c| type| (x:M↓)→M↓| M↑ M↓

|[x:M↓M↓

]| (M↑ ,M↑ )| πiM↑| M↓ : M↓| ()| >| ⊥

M↓ ::= M↑| λx.M↓| M↓M↑| (M↓,M↓)| @i

37 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Inferable terms and Checkable terms

I M↑ : inferable term

I M↓ : checkable term

M↑ ::= x| c| type| (x:M↓)→M↓| M↑ M↓

|[x:M↓M↓

]| (M↑ ,M↑ )| πiM↑| M↓ : M↓| ()| >| ⊥

M↓ ::= M↑| λx.M↓| M↓M↑| (M↓,M↓)| @i

37 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Typing rules

Constant symbols

(c, v) ∈ σ[L] Γ `σ c :↑ v [L]

(CON )

@-operators

[L] Γ `σ @i :↓ v [L, (i : v)](ASP)

I σ : signature

I [L] : type assignments for @-operators

38 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Typing rules

Dependent sum types

[L] Γ `σ A :↓ s1 [L′] A �β v [L′] Γ, x : v `σ B :↓ s2 [L′′]

[L] Γ `σ[x:AB

]:↑ s2 [L′′]

(ΣF)

(s1, s2 ∈ {type, kind})

[L] Γ `σ M :↓ v [L′] v′[M/x] �β v′′ [L′] Γ `σ N :↓ v′′ [L′′]

[L] Γ `σ (M,N) :↓

[x:vv′

][L′′]

(ΣI )

[L] Γ `σ M :↑

[x:vv′

][L′]

[L] Γ `σ π1M :↑ v [L′](ΣE)

[L] Γ `σ M :↑

[x:vv′

][L′] v′[π1M/x] �β v

′′

[L] Γ `σ π2M :↑ v′′ [L′](ΣE)

39 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Difference from Loh’s system

I There is an important difference between our system andLoh’s system: rules for function application.

I In Loh’s system, there is only one rule for function application:the (ΠE) rule.

I In DTS, there are two rules for function application:the (ΠE) rule and the (→ E) rule.

40 / 71

DTT DTS Previous work Type check./infer. Conclusion References

The difference from Loh’s system

I Why are there two rules for function application in DTS?→ The (ΠE) rule is insufficient to decide the type of @i.

I How the type of @i is decided?

(1) A man entered. He whistled.u:

x:entity[man(x)enter(x)

]whistle(@1((), u))

41 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Type checking for @i

(1) A man entered. He whistled.u:

x:entity[man(x)enter(x)

]whistle(@1((), u))

I In this example, the part whistle(@1((), u)) has @1.

I Let’s go over a type checking process of whistle(@1((), u))without using (→ E) rule.

42 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Type checking for @i

(whistle, entity→ type) ∈ σΓ ` whistle :↑ entity→ type

(CON )

Γ ` @1 :↑ ?2

Γ ` @1((), u) :↑ ?1(ΠE)

Γ ` @1((), u) :↓ entity(CHK)

Γ ` whistle(@1((), u)) :↑ type(ΠE)

I @i is not a inferable term, so this inference fails.→ The type of @1 cannot be decided.

43 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Type checking for @i

(whistle, entity→ type) ∈ σΓ ` whistle :↑ entity→ type

(CON )

Γ ` @1 :↑ ?2

Γ ` @1((), u) :↑ ?1(ΠE)

Γ ` @1((), u) :↓ entity(CHK)

Γ ` whistle(@1((), u)) :↑ type(ΠE)

I @i is not a inferable term, so this inference fails.→ The type of @1 cannot be decided.

43 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Type checking for @i

(whistle, entity→ type) ∈ σΓ ` whistle :↑ entity→ type

(CON )

Γ ` @1 :↑ ?2 · · ·

Γ ` @1((), u) :↑ ?1(ΠE)

Γ ` @1((), u) :↓ entity(CHK)

Γ ` whistle(@1((), u)) :↑ type(ΠE)

I @i is not a inferable term, so this inference fails.→ The type of @1 cannot be decided.

43 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Type checking for @i

(whistle, entity→ type) ∈ σΓ ` whistle :↑ entity→ type

(CON )

Γ ` @1 :↑ ?2 · · ·

Γ ` @1((), u) :↑ ?1(ΠE)

Γ ` @1((), u) :↓ entity(CHK)

Γ ` whistle(@1((), u)) :↑ type(ΠE)

I @i is not a inferable term, so this inference fails.→ The type of @1 cannot be decided.

43 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Type checking for @i

I Why this fails?

(ΠE) rule

Γ `σ M :↑ (x:v)→ v′ Γ `σ N :↓ v v′[N/x] �β v′′

Γ `σ MN :↑ v′′(ΠE)

I Because (ΠE) rule first tries to infer the type of the functionpart of a function application term.

I This conflicts with the fact that @i is not an inferable term.

44 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Type checking for @i

I We can think of another way to decide the type of @1.

I In the last type checking process, we checked whether@1((), u) has the type entity.

(whistle, entity→ type) ∈ σΓ ` whistle :↑ entity→ type

(CON )Γ ` @1((), u) :↓ entity

Γ ` whistle(@1((), u)) :↑ type(ΠE)

45 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Type checking for @i

Γ ` @1((), u) :↓ entity

I In the expression above, @1 should have the function type.

I The @1 receives an argument ((),u) and returns a term oftype entity.

I That is, if the type of argument part ((), u) can be decided,we can also decide the type of function part @1.

It is the (→ E) rule that enables type inference in this way.

46 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Type checking for @i

(→E) rule

[L] Γ `σ N :↑ v [L′] [L′] Γ `σ M :↓ v → v′ [L′′][L] Γ `σ MN :↓ v′ [L′′]

(→E)

I In this rule, the argument part of function application isevaluated first.

I We can do type inference of the sentence (1) by using thisrule.

47 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Type checking for @i

I Type checking process of @1((), u) by using (→ E) rule.

Γ ` () :↑ >(>I )

(u,

x:entity[man(x)enter(x)

]) ∈ Γ

Γ ` u :↑

x:entity[man(x)enter(x)

](VAR)

Γ ` ((), u) :↑

>x:entity[

man(x)enter(x)

]

(∧I )

Γ ` @1 :↓

>x:entity[

man(x)enter(x)

]→ entity

(ASP)

Γ ` @1((), u) :↓ entity(→E)

I The @1 is assigned an appropriate type that represents theprojective content of the sentence (1)

48 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Type checking for @i

I Type checking process of @1((), u) by using (→ E) rule.

Γ ` () :↑ >(>I )

(u,

x:entity[man(x)enter(x)

]) ∈ Γ

Γ ` u :↑

x:entity[man(x)enter(x)

](VAR)

Γ ` ((), u) :↑

>x:entity[

man(x)enter(x)

]

(∧I )

Γ ` @1 :↓

>x:entity[

man(x)enter(x)

]→ entity

(ASP)

Γ ` @1((), u) :↓ entity(→E)

I The @1 is assigned an appropriate type that represents theprojective content of the sentence (1)

48 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Conclusion

49 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Summary

I In DTS, presupposition projections are calculated as typecheck/inference in dependent type theory (and presuppositionbindings/accommodations are proof-search), however, typechecking/inference in (full) dependent type theory isundecidable.

I We formulated and implemented a (decidable) typechecking/inference system for a fragment of dependent typetheory, which is still enough to describe semanticrepresentations of natural language.I AnnotationsI β-reduction during type checkingI Type inference rules for simple function/product typesI Underspecified terms

50 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Summary

I In DTS, presupposition projections are calculated as typecheck/inference in dependent type theory (and presuppositionbindings/accommodations are proof-search), however, typechecking/inference in (full) dependent type theory isundecidable.

I We formulated and implemented a (decidable) typechecking/inference system for a fragment of dependent typetheory, which is still enough to describe semanticrepresentations of natural language.I AnnotationsI β-reduction during type checkingI Type inference rules for simple function/product typesI Underspecified terms

50 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Summary

I In DTS, presupposition projections are calculated as typecheck/inference in dependent type theory (and presuppositionbindings/accommodations are proof-search), however, typechecking/inference in (full) dependent type theory isundecidable.

I We formulated and implemented a (decidable) typechecking/inference system for a fragment of dependent typetheory, which is still enough to describe semanticrepresentations of natural language.I AnnotationsI β-reduction during type checkingI Type inference rules for simple function/product typesI Underspecified terms

50 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Summary

I In DTS, presupposition projections are calculated as typecheck/inference in dependent type theory (and presuppositionbindings/accommodations are proof-search), however, typechecking/inference in (full) dependent type theory isundecidable.

I We formulated and implemented a (decidable) typechecking/inference system for a fragment of dependent typetheory, which is still enough to describe semanticrepresentations of natural language.I AnnotationsI β-reduction during type checkingI Type inference rules for simple function/product typesI Underspecified terms

50 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Future work

I Connection with syntactic parsers

I Efficient proof-search algorithm for this fragment ofdependent type theory

I Formal properties of the system

51 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Future work

I Connection with syntactic parsers

I Efficient proof-search algorithm for this fragment ofdependent type theory

I Formal properties of the system

51 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Future work

I Connection with syntactic parsers

I Efficient proof-search algorithm for this fragment ofdependent type theory

I Formal properties of the system

51 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Reference I

Ahn, R. and H.-P. Kolb. (1990) “Discourse Representation meetsConstructive Mathematics”, In: L. Kalman and L. Polos (eds.):Papers from the Second Symposium on Logic and Language.Akademiai Kiado.

Asher, N. and Z. Luo. (2012) “Formalisation of coercions in lexicalsemantics”, In the Proceedings of Sinn und Bedeutung 17. Paris,pp.63–80.

Barendregt, H. P. (1991) “Introduction to generalized typesystems”, Journal of Functional Programming 1(2), pp.125–154.

Barendregt, H. P. (1992) “Lambda Calculi with Types”, In: S.Abramsky, D. M. Gabbay, and T. Maibaum (eds.): Handbook ofLogic in Computer Science, Vol. 2. Oxford Science Publications,pp.117–309.

52 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Reference II

Bekki, D. (2013a) “Dependent Type Semantics: An Introduction”,In: the 2012 edition of the LIRa yearbook: a selection of papers.University of Amsterdam.

Bekki, D. (2013b) “A Type-theoretic Approach to DoubleNegation Elimination in Anaphora”, In the Proceedings of Logicand Engineering of Natural Language Semantics 10 (LENLS 10).Tokyo.

Bekki, D. (2014) “Representing Anaphora with Dependent Types”,In the Proceedings of N. Asher and S. V. Soloviev (eds.):Logical Aspects of Computational Linguistics (8th internationalconference, LACL2014, Toulouse, France, June 2014Proceedings), LNCS 8535. Toulouse, pp.14–29, Springer,Heiderburg.

53 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Reference III

Bekki, D. and E. McCready. (2014) “CI via DTS”, In theProceedings of LENLS11. Tokyo, pp.110–123.

Bekki, D. and M. Sato. (2015) “Calculating Projections via TypeChecking”, In the Proceedings of TYpe Theory and LExicalSemantics (TYTLES), ESSLLI2015 workshop. Barcelona, Spain.

Berardi, S. (1990) “Type Dependence and ConstructiveMathematics”, Ph.d thesis, Mathematical Institute.

Bertot, Y. and P. Casteran. (2004) Interactive Theorem Provingand Program Development. Springer.

Bove, A. and P. Dybjer. (2008) “Dependent Types at Work”.

54 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Reference IV

Chatzikyriakidis, S. (2014) “Adverbs in a Modern Type Theory”,In: N. Asher and S. V. Soloviev (eds.): Logical Aspect ofComputational Linguistics, 8th International Conference,LACL2014, Toulouse, France, June 18-20, 2014 Proceedings.Springer.

Cooper, R. (2005) “Austinian truth, attitudes and type theory”,Research on Language and Computation 3, pp.333–362.

Coquand, T. and G. Huet. (1988) “The Calculus of Constructions”,Information and Computation 76(2-3), pp.95–120.

Davila-Perez, R. (1995) “Semantics and Parsing in IntuitionisticCategorial Grammar”, Ph.d. thesis, University of Essex.

55 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Reference V

Fox, C. (1994a) “Discourse Representation, Type Theory andProperty Theory”, In the Proceedings of H. Bunt, R. Muskens,and G. Rentier (eds.): the International Workshop onComputational Semantics. Institute for Language Technologyand Artificial Intelligence (ITK), Tilburg, pp.71–80.

Fox, C. (1994b) “Existence Presuppositions and CategoryMistakes”, Acta Linguistica Hungarica 42(3/4), pp.325–339.Published 1996.

Gallin, D. (1975) Intensional and Higher-Order Modal Logic. WithApplication to Montague Semantics. Amsterdam, New York,North-Holland Publisher/Elsevier Publisher.

56 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Reference VI

Girard, J.-Y., Y. Lafont, and P. Taylor. (1989) Proofs and Types,Cambridge Tracts in Theoretical Computer Science 7.Cambridge University Press.

Jacobs, B. (1999) Categorical Logic and Type Theory, Vol. 141 ofStudies in Logic and the Foundations of Mathematics. NorthHolland, Elsevier.

Krahmer, E. and P. Piwek. (1999) “Presupposition Projection asProof Construction”, In: H. Bunt and R. Muskens (eds.):Computing Meanings: Current Issues in ComputationalSemantics, Studies in Linguistics Philosophy Series. Dordrecht,Kluwer Academic Publishers.

57 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Reference VII

Loh, A., C. McBride, and W. Swierstra. (2010) “A TutorialImplementation of a Dependently Typed Lambda Calculus”,Fundamenta Informaticae - Dependently Typed Programming102(2), pp.177–207.

Luo, Z. (1997) “Coercive subtyping in type theory”, In: D. vanDalen and M. Bezem (eds.): CSL 1996. LNCS, vol. 1258.Heidelberg, Springer.

Luo, Z. (1999) “Coercive subtyping”, Journal of Logic andComputation 9(1), pp.105–130.

Luo, Z. (2010) “Type-theoretical semantics with coercivesubtyping”, In the Proceedings of Semantics and LinguisticTheory 20 (SALT 20). Vancouver.

58 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Reference VIII

Luo, Z. (2012) “Formal Semantics in Modern Type Theories withCoercive Subtyping”, Linguistics and Philosophy 35(6).

Martin-Lof, P. (1975) “An intuitionistic theory of types”, In: H. E.Rose and J. Shepherdson (eds.): Logic Colloquium ’73.Amsterdam, North-Holland, pp.73–118.

Martin-Lof, P. (1984) Intuitionistic Type Theory, Vol. 17. Naples,Italy: Bibliopolis. Sambin, Giovanni (ed.).

Milner, R. (1978) “A Theory of Type Polymorphism inProgramming” Journal of Computer and System Science(JCSS)(17), pp.348–374.

59 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Reference IX

Montague, R. (1973) “The proper treatment of quantification inordinary English”, In: J. Hintikka, J. Moravcsic, and P. Suppes(eds.): Approaches to Natural Language. Dordrecht, Reidel,pp.221–242.

Nordstrom, B., K. Petersson, and J. Smith. (1990) Programmingin Martin-Lof’s Type Theory. Oxford University Press.

Piwek, P. and E. Krahmer. (2000) “Presuppositions in Context:Constructing Bridges”, In: P. Bonzon, M. Cavalcanti, and R.Nossum (eds.): Formal Aspects of Context, Applied LogicSeries. Dordrecht, Kluwer Academic Publishers.

Ranta, A. (1994) Type-Theoretical Grammar. Oxford UniversityPress.

60 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Reference X

Sundholm, G. (1986) “Proof theory and meaning”, In: D. Gabbayand F. Guenthner (eds.): Handbook of Philosophical Logic, Vol.III. Reidel, Kluwer, pp.471–506.

Tanaka, R. (2014) “A Proof-Theoretic Approach to GeneralizedQuantifiers in Dependent Type Semantics”, In the Proceedingsof R. de Haan (ed.): the ESSLLI 2014 Student Session, 26thEuropean Summer School in Logic, Language and Information.Tubingen, Germany, pp.140–151.

Tanaka, R., K. Mineshima, and D. Bekki. (2014) “Resolving ModalAnaphora in Dependent Type Semantics”, In the Proceedings ofthe Eleventh International Workshop on Logic and Engineeringof Natural Language Semantics (LENLS11), JSAI InternationalSymposia on AI 2014. Tokyo, pp.43–56.

61 / 71

DTT DTS Previous work Type check./infer. Conclusion References

Reference XITanaka, R., K. Mineshima, and D. Bekki. (2015) “Factivity and

Presupposition in Dependent Type Semantics”, In theProceedings of TYpe Theory and LExical Semantics (TYTLES),ESSLLI2015 workshop.

Tanaka, R., Y. Nakano, and D. Bekki. (2013) “ConstructiveGeneralized Quantifiers Revisited”, In the Proceedings of Logicand Engineering of Natural Language Semantics 10 (LENLS 10).Tokyo, pp.69–78.

Watanabe, N., E. McCready, and D. Bekki. (2014) “JapaneseHonorification: Compositionality and Expressivity”, In theProceedings of S. Kawahara and M. Igarashi (eds.): FAJL 7:Formal Approaches to Japanese Linguistics, the MIT WorkingPapers in Linguistics 73. International Christian University,Japan, pp.265–276.

62 / 71

Appendix

Appendix

63 / 71

Appendix

Presuppositions

(5) a. Sweden does not cherish its king.

: Sweden has a king.

b. If Sweden is a monarchy, Sweden cherishes its king.

: If Sweden is a monarchy, Sweden has a king.

c. Every monarchy cherishes its king.

: Every monarchy has a king.

d. Sweden, a monarchy, cherishes its king.

: Sweden is a monarchy/has a king.

64 / 71

Appendix

Lexical items in DTS

PF Syntactic categories Semantic representations

if S/S/S λp.λq.λc. (u:pc)→ (q(c, u))everynom T/(T\NP)/N λn.λp.λc. (x:entity)→ (u:nx(c, x))→ (px(c, (x, u)))

aacc T\(T/NP)/N λn.λp.λx.λc.

y:entity[v:ny(c, y)pyx(c, (y, v))

]king N λx.λc.king(x)cherish S\NP/NP λy.λx.λc.cherish(x, y)

itsacc T\(T/NP)/N λn.λp.λx.λc.p

π1

@jc ::

y:entitynyc

have

(π1

(@ic ::

[z:entity¬human(z)

]), y

)xc

65 / 71

Appendix

Semantic representations for (5)

(5a) : λc.cherish

sweden, π1

@1(c) ::

y:entityking(y)

of

(y, π1

(@2(c) ::

[z:entity¬human(z)

]))

(5b) : λc.¬cherish

sweden, π1

@1(c) ::

y:entityking(y)

have

(π1

(@2(c) ::

[z:entity¬human(z)

]), y

)

(5c) : λc.(u : monarchy(sweden))→ cherish

sweden, π1

@1(c, u) ::

y:entityking(y)

have

(π1

(@2(c, u) ::

[z:entity¬human(z)

]), y

)

(5d) : λc.(x : entity)→ (u : monarchy(x))→ cherish

x, π1

@1(c, (x, u)) ::

y:entityking(y)

have

(π1

(@2(c, (x, u)) ::

[z:entity¬human(z)

]), y

)

(5e) : λc.

cherish

sweden, π1

@1(c) ::

y:entityking(y)

have

(π1

(@2(c) ::

[z:entity¬human(z)

]), y

)

@3 =monarchy(sweden) @3

66 / 71

Appendix

Projective contents of (5)

(5a)(5d) : δ : type, c : δ ` @2 : δ →[z:entity¬human(z)

](5b) : δ : type, c : δ, u : monarchy(sweden) ` @2 :

[δmonarchy(sweden)

]→[z:entity¬human(z)

](5c) : δ : type, c : δ, x : entity, u : monarchy(x) ` @2 :

δ[ entitymonarchy(x)

]→ [z:entity¬human(z)

]

(5a)(5d) : δ : type, c : δ ` @1 : δ →

y:entity[king(y)have(sweden, y)

](5b) : δ : type, c : δ ` @1 :

[δmonarchy(sweden)

]→

y:entity[king(y)have(sweden, y)

](5c) : δ : type, c : δ, x : entity, u : monarchy(x) ` @1 :

δ[ entitymonarchy(x)

]→y:entity[

king(y)have(x, y)

](5d) : δ : type, c : δ ` @3 : monarchy(sweden)

67 / 71

Appendix

Presupposition Projection CalculatedThe judgments in (??) are the ones obtained after anaphoraresolution for @2 has been executed: the output of the programcontains the occurrence of @2 within the types for @1 (this meansthat the possessive presuppositions in (5) contain the anaphoraantecedents). The proof terms corresponding to the intendedreading in (5) (i.e. it refers to Sweden in (5a)(5b)(5d), and everymonarchy in (5c)) are as follows:

@2 = λc.(sweden, n(sweden)m)

@2 = λc.(π1π2(c), n(π1π2(c))(π2π2(c))),

where m is a proof term for monarchy(sweden) (Sweden is amonarchy), and n is a proof term for(x : entity)→ monarchy(x)→ ¬human(x) (Monarchy is nota human). Then, (??) is obtained by substituting @2 with theseproof terms.

68 / 71

Appendix

Dependent Types in Mathematics and LogicI The notion of dependent types originates from:

I Martin-Lof Type Theory (MLTT) (Martin-Lof (1975, 1984)),which was proposed as a foundation of constructivemathematics.

I Calculus of Constructions (CoC) (Coquand and Huet (1988)),which was proposed as a foundation of functionalprogramming and mathematical proofs.

I Lately, fragments of MLTT and CoC have been integratedinto a general theory of the λ-cube (Barendregt (1992)) andPure Type Systems (PTS) (Berardi (1990); Barendregt(1991)) with other important type theories, such as Girard’sF (Girard et al. (1989)).

I Calculus of Inductive Constructions (CoIC) (=CoC withinductive types) is known as an underlying language of proofassistants Coq (Bertot and Casteran (2004)) and Agda(Nordstrom et al. (1990), Bove and Dybjer (2008)). 69 / 71

Appendix

What is NOT Dependent Type Theory

I Type-Theoretic Semantics (ex. Montague (1973), Gallin(1975)), where a proposition is a term of type t, while inDependent Type Theory, a proposition is a type (=a collectionof proofs).

I Dependent Type Theory is proof-theoretic, but it has adenotational semantics (cf. fibred category theory: Jacobs(1999)) and other types of semantics (cf. game-theoreticsemantics) as well.

70 / 71

Appendix

Proof-theoretic vs. model-theoretic semanticsThe ‘meaning’ of a given proposition φ:

The Proof-theoretic Semantics Model-theoretic Semantics

Provability, or {Γ | Γ ` φ} Truth-condition, or {(M, g) | JφKM,g = 1}

Inference rules Semantic Values(natural deduction): (classical logic):

A....B

i

A→ B(→I ),i

A A→ BB

(→E)

A BA ∧B

(∧I )A1 ∧A2

Ai(∧E),i=1,2

JA→ BKM,g = 1⇐ : JAKM,g = 0 or JBKM,g = 1

JA ∧BKM,g = 1⇐ : JAKM,g = 1 and JBKM,g = 1

71 / 71