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, 2015
TYpe 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 types
Donkey anaphora: Sundholm (1986)
Translation from DRS to dependent type representations: Ahn
and Kolb (1990)
Ranta’s TTG (Relative and Implicational Donkey Sentences,
Branching Quantifiers, Intensionality, Tense): Ranta (1994)
A reformulation of Montague Grammar Montague (1973) in
terms of dependent type theory: D´avila-P´erez (1995)
Summation: Fox (1994a,b)
Presupposition Binding and Accommodation, Bridging:
Krahmer and Piwek (1999), Piwek and Krahmer (2000)
Type Theory with Record (TTR): Cooper (2005)
Coercion: Luo (1997, 1999, 2010, 2012), Asher and Luo
(2012)
Adverbs: Chatzikyriakidis (2014)
2 / 71
DTT DTS Previous work Type check./infer. Conclusion References
What this talk is about
Dependent Type Semantics (DTS; Bekki (2013a, 2014)):
DTS is a framework of natural language sematnics based on
dependent type theory (Martin-L¨of, 1984)(Coquand and Huet,
1988).
DTS is a proof-theoretic semantics via Curry-Howard
correspondence between types and propositions, following the
line of Sundholm (1986), Ranta (1994), Cooper (2005) and
Luo (2012).
DTS is a compositional/lexicalized theory of meaning that
works as a semantic component of any lexical grammar.
In this work, we update (=formalize and implement) the core
component (=the type checking/inference system) of DTS
that enables us to calculate presupposition projection in a
decidable manner.
3 / 71
DTT DTS Previous work Type check./infer. Conclusion References
What this talk is about
Dependent Type Semantics (DTS; Bekki (2013a, 2014)):
DTS is a framework of natural language sematnics based on
dependent type theory (Martin-L¨of, 1984)(Coquand and Huet,
1988).
DTS is a proof-theoretic semantics via Curry-Howard
correspondence between types and propositions, following the
line of Sundholm (1986), Ranta (1994), Cooper (2005) and
Luo (2012).
DTS is a compositional/lexicalized theory of meaning that
works as a semantic component of any lexical grammar.
In this work, we update (=formalize and implement) the core
component (=the type checking/inference system) of DTS
that enables us to calculate presupposition projection in a
decidable 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 type
theory)
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 : A
MN : 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 )
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 )
The typing tree of a term (in STLC) can be recovered from
the (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 )
The typing tree of a term (in STLC) can be recovered from
the (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 )
The typing tree of a term (in STLC) can be recovered from
the (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 )
The typing tree of a term (in STLC) can be recovered from
the (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 type
and implication
Introduction rules Elimination rules
Typing rules in
STLC
x : A....
M : B
i
λx.M
function
: A → B
(LAM ),i
M : A → B N : A
MN : B
(APP)
Natural de-
duction rules
in 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 type
and conjunction
Introduction rules Elimination rules
Typing
rules 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)
Natural
deduc-
tion rules
in PL
A B
A ∧ B
(∧I )
A ∧ B
A
(∧E)
A ∧ B
B
(∧E)
Fact 2
Typing rules of STLC (almost exactly) correspond to natural
deduction rules in logic.
10 / 71
DTT DTS Previous work Type check./infer. Conclusion References
Curry-Howard Correspondence btw. product type
and conjunction
Fact 1
A term is an encoding of a typing tree.
+
Fact 2
Typing rules of STLC (almost exactly) correspond to natural
deduction rules in logic.
⇓
Fact 3
A term of type A is also an encoding of a proof diagram of a
proposition A (under the view that proposition is type)
11 / 71
DTT DTS Previous work Type check./infer. Conclusion References
Curry-Howard Correspondence btw. product type
and conjunction
Fact 3
A term of type A is also an encoding of a proof diagram of a
proposition A (under the view that proposition is type)
Fact 3’
Functions encode proofs of →.
Pairs encode proofs of ∧.
12 / 71
DTT DTS Previous work Type check./infer. Conclusion References
Curry-Howard Correspondence btw. product type
and conjunction
The correspondence between the notions of logic and type theory :
Logic Type Theory
proposition type
proof term (or program)
axiom constant symbol
assumption variable
logical connective type constructor
implication functional type
conjunction product type
disjunction direct sum type
absurdity empty type
introduction constructor
elimination destructor
provability inhabitance
cut substitution
normalization reduction
13 / 71
DTT DTS Previous work Type check./infer. Conclusion References
Dependent function type
Introduction rules Elimination rules
function type
→ in STLC
x : A....
M : B
i
λx.M
function
: A → B
(LAM ),i
M : A → B N : A
MN : B
(APP)
Dependent
function 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
product
type ×
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)
Dependent
sum type
(Σ) in
DTT
M : A N : B[M/x]
(M, N)
pair
:
x:A
B
(ΣI )
M :
x:A
B
π1(M) : A
(ΣE)
M :
x:A
B
π2(M) : B[π1(M)/x]
(ΣE)
Scope:
x:A
B
15 / 71
DTT DTS Previous work Type check./infer. Conclusion References
Dependent types
Dependent types Standard notation x ∈ fv(B) x ∈ fv(B)
(x:A) → B (Πx : A)B A → B (∀x : A)B
x:A
B
(Σ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:A
B
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 man
who entered) from u, since u is a function. This explains the
following cases uniformly, since both implication and negation are
instances 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; N
def
≡ λc.
u:Mc
N(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
If the hearer chooses to bind the presupposition, he/she has
to find a term to replace @1 (for example, λx.π1π2(x) is
such a term). In other words, anaphora/presupposition
resolution reduces to proof search.
Or the hearer may choose to accommodate the presupposition:
in that case, he/she abandons tng proof search and add a new
variable of the above type to the global context.
23 / 71
DTT DTS Previous work Type check./infer. Conclusion References
Recent works on DTS
Generalized Quantifiers: Tanaka et al. (2013), Tanaka (2014)
Double-Negated Antecedents: Bekki (2013b)
Modal Subordination: Tanaka et al. (2014)
Conventional Implicature: Bekki and McCready (2014)
Honorification in Japanese: Watanabe et al. (2014)
Type checking/inference in DTS and its implementation:
Bekki and Sato (2015)
Factive Presupposition: Tanaka et al. (2015)
24 / 71
DTT DTS Previous work Type check./infer. Conclusion References
Interim summary
DTS is a framework of natural language semantics based on
dependent type theory, following the line of Sundholm (1986),
Ranta (1994).
Dependent types work well for representing discourse
anaphora (or presupposition in general) in a parallel manner
to syntactic structures.
DTS is a compositionalized (or lexicalized) version of
dependent-type-oriented semantics, which adopts a
mechanism such as local contexts, context passing, and
underspecified terms.
In DTS, the calculation of presupposition projection reduces
to type checking/inference. This algorithm has not been
formulated nor implemented until this work is done!
25 / 71
DTT DTS Previous work Type check./infer. Conclusion References
Interim summary
DTS is a framework of natural language semantics based on
dependent type theory, following the line of Sundholm (1986),
Ranta (1994).
Dependent types work well for representing discourse
anaphora (or presupposition in general) in a parallel manner
to syntactic structures.
DTS is a compositionalized (or lexicalized) version of
dependent-type-oriented semantics, which adopts a
mechanism such as local contexts, context passing, and
underspecified terms.
In DTS, the calculation of presupposition projection reduces
to type checking/inference. This algorithm has not been
formulated nor implemented until this work is done!
25 / 71
DTT DTS Previous work Type check./infer. Conclusion References
Interim summary
DTS is a framework of natural language semantics based on
dependent type theory, following the line of Sundholm (1986),
Ranta (1994).
Dependent types work well for representing discourse
anaphora (or presupposition in general) in a parallel manner
to syntactic structures.
DTS is a compositionalized (or lexicalized) version of
dependent-type-oriented semantics, which adopts a
mechanism such as local contexts, context passing, and
underspecified terms.
In DTS, the calculation of presupposition projection reduces
to type checking/inference. This algorithm has not been
formulated nor implemented until this work is done!
25 / 71
DTT DTS Previous work Type check./infer. Conclusion References
Interim summary
DTS is a framework of natural language semantics based on
dependent type theory, following the line of Sundholm (1986),
Ranta (1994).
Dependent types work well for representing discourse
anaphora (or presupposition in general) in a parallel manner
to syntactic structures.
DTS is a compositionalized (or lexicalized) version of
dependent-type-oriented semantics, which adopts a
mechanism such as local contexts, context passing, and
underspecified terms.
In DTS, the calculation of presupposition projection reduces
to type checking/inference. This algorithm has not been
formulated nor implemented until this work is done!
25 / 71
DTT DTS Previous work Type check./infer. Conclusion References
Previous work on type
checking/inference algorithm in
dependent type theory
26 / 71
DTT DTS Previous work Type check./infer. Conclusion References
Type Inference in Dependent Types
DTS is based on Dependent Type Theory.
27 / 71
DTT DTS Previous work Type check./infer. Conclusion References
Type Inference in Dependent Types
DTS is based on Dependent Type Theory.
Type inference in dependent type theory is known to be
undecidable.
27 / 71
DTT DTS Previous work Type check./infer. Conclusion References
Type Inference in Dependent Types
DTS is based on Dependent Type Theory.
Type inference in dependent type theory is known to be
undecidable.
27 / 71
DTT DTS Previous work Type check./infer. Conclusion References
Type Inference in Dependent Types
Previous work on type inference in dependent type theory
→ L¨oh’s system for Agda (L¨oh et al., 2010).
In L¨oh’s system, we can do type inference in dependent type
theory with the help of a construction called annotation.
28 / 71
DTT DTS Previous work Type check./infer. Conclusion References
L¨oh 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 L¨oh’s system
e↓ ::= e↑
| λx.e↓
e↑ ::= e↓ : e↓
| ∗
| ∀x : e↓.e↓
| x
| e↑ e↓
v ::= n
| ∗
| ∀x : v.v
n ::= x
| nv
e↓ : checkable terms
e↑ : inferable terms
v : values
n : neutral terms
30 / 71
DTT DTS Previous work Type check./infer. Conclusion References
Explanation about L¨oh’s system
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 L¨oh’s system
Typeing rules are also classified into two categories: type
inference 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 a
mutually 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:
We read rules from premise to conclusion.
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:
We read rules from conclusion to premise.
A term to the left of the colon has a type to the right of the
colon only when all the premise are satisfied.
34 / 71
DTT DTS Previous work Type check./infer. Conclusion References
Type checking/inference algorithm in
DTS
35 / 71
DTT DTS Previous work Type check./infer. Conclusion References
Type inference system for DTS
In DTS, there are terms that are not included in L¨oh’s system.
L¨oh’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
M↑ : inferable term
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
M↑ : inferable term
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)
σ : signature
[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:A
B
:↑ s2 [L ]
(ΣF)
(s1, s2 ∈ {type, kind})
[L] Γ σ M :↓ v [L ] v [M/x] β v [L ] Γ σ N :↓ v [L ]
[L] Γ σ (M, N) :↓
x:v
v
[L ]
(ΣI )
[L] Γ σ M :↑
x:v
v
[L ]
[L] Γ σ π1M :↑ v [L ]
(ΣE)
[L] Γ σ M :↑
x:v
v
[L ] v [π1M/x] β v
[L] Γ σ π2M :↑ v [L ]
(ΣE)
39 / 71
DTT DTS Previous work Type check./infer. Conclusion References
Difference from L¨oh’s system
There is an important difference between our system and
L¨oh’s system: rules for function application.
In L¨oh’s system, there is only one rule for function application:
the (ΠE) rule.
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 L¨oh’s system
Why are there two rules for function application in DTS?
→ The (ΠE) rule is insufficient to decide the type of @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))




In this example, the part whistle(@1((), u)) has @1.
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)
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)
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)
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 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
Why this fails?
(ΠE) rule
Γ σ M :↑ (x:v) → v Γ σ N :↓ v v [N/x] β v
Γ σ MN :↑ v
(ΠE)
Because (ΠE) rule first tries to infer the type of the function
part of a function application term.
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
We can think of another way to decide the type of @1.
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
In the expression above, @1 should have the function type.
The @1 receives an argument ((),u) and returns a term of
type entity.
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)
In this rule, the argument part of function application is
evaluated first.
We can do type inference of the sentence (1) by using this
rule.
47 / 71
DTT DTS Previous work Type check./infer. Conclusion References
Type checking for @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)
The @1 is assigned an appropriate type that represents the
projective content of the sentence (1)
48 / 71
DTT DTS Previous work Type check./infer. Conclusion References
Type checking for @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)
The @1 is assigned an appropriate type that represents the
projective 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
In DTS, presupposition projections are calculated as type
check/inference in dependent type theory (and presupposition
bindings/accommodations are proof-search), however, type
checking/inference in (full) dependent type theory is
undecidable.
We formulated and implemented a (decidable) type
checking/inference system for a fragment of dependent type
theory, which is still enough to describe semantic
representations of natural language.
Annotations
β-reduction during type checking
Type inference rules for simple function/product types
Underspecified terms
50 / 71
DTT DTS Previous work Type check./infer. Conclusion References
Summary
In DTS, presupposition projections are calculated as type
check/inference in dependent type theory (and presupposition
bindings/accommodations are proof-search), however, type
checking/inference in (full) dependent type theory is
undecidable.
We formulated and implemented a (decidable) type
checking/inference system for a fragment of dependent type
theory, which is still enough to describe semantic
representations of natural language.
Annotations
β-reduction during type checking
Type inference rules for simple function/product types
Underspecified terms
50 / 71
DTT DTS Previous work Type check./infer. Conclusion References
Summary
In DTS, presupposition projections are calculated as type
check/inference in dependent type theory (and presupposition
bindings/accommodations are proof-search), however, type
checking/inference in (full) dependent type theory is
undecidable.
We formulated and implemented a (decidable) type
checking/inference system for a fragment of dependent type
theory, which is still enough to describe semantic
representations of natural language.
Annotations
β-reduction during type checking
Type inference rules for simple function/product types
Underspecified terms
50 / 71
DTT DTS Previous work Type check./infer. Conclusion References
Summary
In DTS, presupposition projections are calculated as type
check/inference in dependent type theory (and presupposition
bindings/accommodations are proof-search), however, type
checking/inference in (full) dependent type theory is
undecidable.
We formulated and implemented a (decidable) type
checking/inference system for a fragment of dependent type
theory, which is still enough to describe semantic
representations of natural language.
Annotations
β-reduction during type checking
Type inference rules for simple function/product types
Underspecified terms
50 / 71
DTT DTS Previous work Type check./infer. Conclusion References
Future work
Connection with syntactic parsers
Efficient proof-search algorithm for this fragment of
dependent type theory
Formal properties of the system
51 / 71
DTT DTS Previous work Type check./infer. Conclusion References
Future work
Connection with syntactic parsers
Efficient proof-search algorithm for this fragment of
dependent type theory
Formal properties of the system
51 / 71
DTT DTS Previous work Type check./infer. Conclusion References
Future work
Connection with syntactic parsers
Efficient proof-search algorithm for this fragment of
dependent type theory
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 meets
Constructive 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 lexical
semantics”, In the Proceedings of Sinn und Bedeutung 17. Paris,
pp.63–80.
Barendregt, H. P. (1991) “Introduction to generalized type
systems”, 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 of
Logic 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 Double
Negation Elimination in Anaphora”, In the Proceedings of Logic
and 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 international
conference, LACL2014, Toulouse, France, June 2014
Proceedings), 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 the
Proceedings of LENLS11. Tokyo, pp.110–123.
Bekki, D. and M. Sato. (2015) “Calculating Projections via Type
Checking”, In the Proceedings of TYpe Theory and LExical
Semantics (TYTLES), ESSLLI2015 workshop. Barcelona, Spain.
Berardi, S. (1990) “Type Dependence and Constructive
Mathematics”, Ph.d thesis, Mathematical Institute.
Bertot, Y. and P. Cast´eran. (2004) Interactive Theorem Proving
and 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 of
Computational 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.
D´avila-P´erez, R. (1995) “Semantics and Parsing in Intuitionistic
Categorial 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 and
Property Theory”, In the Proceedings of H. Bunt, R. Muskens,
and G. Rentier (eds.): the International Workshop on
Computational Semantics. Institute for Language Technology
and Artificial Intelligence (ITK), Tilburg, pp.71–80.
Fox, C. (1994b) “Existence Presuppositions and Category
Mistakes”, Acta Linguistica Hungarica 42(3/4), pp.325–339.
Published 1996.
Gallin, D. (1975) Intensional and Higher-Order Modal Logic. With
Application 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 of
Studies in Logic and the Foundations of Mathematics. North
Holland, Elsevier.
Krahmer, E. and P. Piwek. (1999) “Presupposition Projection as
Proof Construction”, In: H. Bunt and R. Muskens (eds.):
Computing Meanings: Current Issues in Computational
Semantics, Studies in Linguistics Philosophy Series. Dordrecht,
Kluwer Academic Publishers.
57 / 71
DTT DTS Previous work Type check./infer. Conclusion References
Reference VII
L¨oh, A., C. McBride, and W. Swierstra. (2010) “A Tutorial
Implementation of a Dependently Typed Lambda Calculus”,
Fundamenta Informaticae - Dependently Typed Programming
102(2), pp.177–207.
Luo, Z. (1997) “Coercive subtyping in type theory”, In: D. van
Dalen and M. Bezem (eds.): CSL 1996. LNCS, vol. 1258.
Heidelberg, Springer.
Luo, Z. (1999) “Coercive subtyping”, Journal of Logic and
Computation 9(1), pp.105–130.
Luo, Z. (2010) “Type-theoretical semantics with coercive
subtyping”, In the Proceedings of Semantics and Linguistic
Theory 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 with
Coercive Subtyping”, Linguistics and Philosophy 35(6).
Martin-L¨of, 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-L¨of, P. (1984) Intuitionistic Type Theory, Vol. 17. Naples,
Italy: Bibliopolis. Sambin, Giovanni (ed.).
Milner, R. (1978) “A Theory of Type Polymorphism in
Programming” 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 in
ordinary English”, In: J. Hintikka, J. Moravcsic, and P. Suppes
(eds.): Approaches to Natural Language. Dordrecht, Reidel,
pp.221–242.
Nordstr¨om, B., K. Petersson, and J. Smith. (1990) Programming
in Martin-L¨of’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 Logic
Series. Dordrecht, Kluwer Academic Publishers.
Ranta, A. (1994) Type-Theoretical Grammar. Oxford University
Press.
60 / 71
DTT DTS Previous work Type check./infer. Conclusion References
Reference X
Sundholm, G. (1986) “Proof theory and meaning”, In: D. Gabbay
and F. Guenthner (eds.): Handbook of Philosophical Logic, Vol.
III. Reidel, Kluwer, pp.471–506.
Tanaka, R. (2014) “A Proof-Theoretic Approach to Generalized
Quantifiers in Dependent Type Semantics”, In the Proceedings
of R. de Haan (ed.): the ESSLLI 2014 Student Session, 26th
European Summer School in Logic, Language and Information.
T¨ubingen, Germany, pp.140–151.
Tanaka, R., K. Mineshima, and D. Bekki. (2014) “Resolving Modal
Anaphora in Dependent Type Semantics”, In the Proceedings of
the Eleventh International Workshop on Logic and Engineering
of Natural Language Semantics (LENLS11), JSAI International
Symposia on AI 2014. Tokyo, pp.43–56.
61 / 71
DTT DTS Previous work Type check./infer. Conclusion References
Reference XI
Tanaka, R., K. Mineshima, and D. Bekki. (2015) “Factivity and
Presupposition in Dependent Type Semantics”, In the
Proceedings of TYpe Theory and LExical Semantics (TYTLES),
ESSLLI2015 workshop.
Tanaka, R., Y. Nakano, and D. Bekki. (2013) “Constructive
Generalized Quantifiers Revisited”, In the Proceedings of Logic
and Engineering of Natural Language Semantics 10 (LENLS 10).
Tokyo, pp.69–78.
Watanabe, N., E. McCready, and D. Bekki. (2014) “Japanese
Honorification: Compositionality and Expressivity”, In the
Proceedings of S. Kawahara and M. Igarashi (eds.): FAJL 7:
Formal Approaches to Japanese Linguistics, the MIT Working
Papers 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 SNP/NP λy.λx.λc.cherish(x, y)
itsacc T (T /NP)/N λn.λp.λx.λc.p



π1



@jc ::




y:entity

nyc
have π1 @ic ::
z:entity
¬human(z)
, y










65 / 71
Appendix
Semantic representations for (5)
(5a) : λc.cherish



sweden, π1



@1(c) ::




y:entity

king(y)
of y, π1 @2(c) ::
z:entity
¬human(z)














(5b) : λc.¬cherish



sweden, π1



@1(c) ::




y:entity

king(y)
have π1 @2(c) ::
z:entity
¬human(z)
, y














(5c) : λc.(u : monarchy(sweden)) → cherish



sweden, π1



@1(c, u) ::




y:entity

king(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:entity

king(y)
have π1 @2(c, (x, u)) ::
z:entity
¬human(z)
, y














(5e) : λc.






cherish



sweden, π1



@1(c) ::




y:entity

king(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 :


δ
entity
monarchy(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 :


δ
entity
monarchy(x)

 →


y:entity
king(y)
have(x, y)


(5d) : δ : type, c : δ @3 : monarchy(sweden)
67 / 71
Appendix
Presupposition Projection Calculated
The judgments in (??) are the ones obtained after anaphora
resolution for @2 has been executed: the output of the program
contains the occurrence of @2 within the types for @1 (this means
that the possessive presuppositions in (5) contain the anaphora
antecedents). The proof terms corresponding to the intended
reading in (5) (i.e. it refers to Sweden in (5a)(5b)(5d), and every
monarchy 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 a
monarchy), and n is a proof term for
(x : entity) → monarchy(x) → ¬human(x) (Monarchy is not
a human). Then, (??) is obtained by substituting @2 with these
proof terms.
68 / 71
Appendix
Dependent Types in Mathematics and Logic
The notion of dependent types originates from:
Martin-L¨of Type Theory (MLTT) (Martin-L¨of (1975, 1984)),
which was proposed as a foundation of constructive
mathematics.
Calculus of Constructions (CoC) (Coquand and Huet (1988)),
which was proposed as a foundation of functional
programming and mathematical proofs.
Lately, fragments of MLTT and CoC have been integrated
into a general theory of the λ-cube (Barendregt (1992)) and
Pure Type Systems (PTS) (Berardi (1990); Barendregt
(1991)) with other important type theories, such as Girard’s
F (Girard et al. (1989)).
Calculus of Inductive Constructions (CoIC) (=CoC with
inductive types) is known as an underlying language of proof
assistants Coq (Bertot and Cast´eran (2004)) and Agda
(Nordstr¨om et al. (1990), Bove and Dybjer (2008)). 69 / 71
Appendix
What is NOT Dependent Type Theory
Type-Theoretic Semantics (ex. Montague (1973), Gallin
(1975)), where a proposition is a term of type t, while in
Dependent Type Theory, a proposition is a type (=a collection
of proofs).
Dependent Type Theory is proof-theoretic, but it has a
denotational semantics (cf. fibred category theory: Jacobs
(1999)) and other types of semantics (cf. game-theoretic
semantics) as well.
70 / 71
Appendix
Proof-theoretic vs. model-theoretic semantics
The ‘meaning’ of a given proposition φ:
The Proof-theoretic Semantics Model-theoretic Semantics
Provability, or {Γ | Γ φ} Truth-condition, or {(M, g) | φ M,g = 1}
Inference rules Semantic Values
(natural deduction): (classical logic):
A....
B
i
A → B
(→I ),i
A A → B
B
(→E)
A B
A ∧ B
(∧I )
A1 ∧ A2
Ai
(∧E),i=1,2
A → B M,g = 1
⇐: A M,g = 0 or B M,g = 1
A ∧ B M,g = 1
⇐: A M,g = 1 and B M,g = 1
71 / 71

Calculating Projections via Type Checking

  • 1.
    DTT DTS Previouswork 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, 2015 TYpe Theory and LExical Semantics (TYTLES) ESSLLI2015, Barcelona, August 5th (Wed), 2015. http://www.slideshare.net/kaleidotheater/bekki-satotytles2015 1 / 71
  • 2.
    DTT DTS Previouswork Type check./infer. Conclusion References Natural language semantics with dependent types Donkey anaphora: Sundholm (1986) Translation from DRS to dependent type representations: Ahn and Kolb (1990) Ranta’s TTG (Relative and Implicational Donkey Sentences, Branching Quantifiers, Intensionality, Tense): Ranta (1994) A reformulation of Montague Grammar Montague (1973) in terms of dependent type theory: D´avila-P´erez (1995) Summation: Fox (1994a,b) Presupposition Binding and Accommodation, Bridging: Krahmer and Piwek (1999), Piwek and Krahmer (2000) Type Theory with Record (TTR): Cooper (2005) Coercion: Luo (1997, 1999, 2010, 2012), Asher and Luo (2012) Adverbs: Chatzikyriakidis (2014) 2 / 71
  • 3.
    DTT DTS Previouswork Type check./infer. Conclusion References What this talk is about Dependent Type Semantics (DTS; Bekki (2013a, 2014)): DTS is a framework of natural language sematnics based on dependent type theory (Martin-L¨of, 1984)(Coquand and Huet, 1988). DTS is a proof-theoretic semantics via Curry-Howard correspondence between types and propositions, following the line of Sundholm (1986), Ranta (1994), Cooper (2005) and Luo (2012). DTS is a compositional/lexicalized theory of meaning that works as a semantic component of any lexical grammar. In this work, we update (=formalize and implement) the core component (=the type checking/inference system) of DTS that enables us to calculate presupposition projection in a decidable manner. 3 / 71
  • 4.
    DTT DTS Previouswork Type check./infer. Conclusion References What this talk is about Dependent Type Semantics (DTS; Bekki (2013a, 2014)): DTS is a framework of natural language sematnics based on dependent type theory (Martin-L¨of, 1984)(Coquand and Huet, 1988). DTS is a proof-theoretic semantics via Curry-Howard correspondence between types and propositions, following the line of Sundholm (1986), Ranta (1994), Cooper (2005) and Luo (2012). DTS is a compositional/lexicalized theory of meaning that works as a semantic component of any lexical grammar. In this work, we update (=formalize and implement) the core component (=the type checking/inference system) of DTS that enables us to calculate presupposition projection in a decidable manner. 3 / 71
  • 5.
    DTT DTS Previouswork Type check./infer. Conclusion References Dependent Type Theory 4 / 71
  • 6.
    DTT DTS Previouswork Type check./infer. Conclusion References Three key concepts in dependent type theory 1. Curry-Howard Correspondence (between logic and type theory) 2. Dependent types (vs. Simple types) 3. Proof-theoretic semantics (vs. Model-theoretic semantics) 5 / 71
  • 7.
    DTT DTS Previouswork 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 : A MN : 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
  • 8.
    DTT DTS Previouswork 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 ) The type of a term is determined by types of its subterm(s). 7 / 71
  • 9.
    DTT DTS Previouswork 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 ) The typing tree of a term (in STLC) can be recovered from the (structure of) term. (cf. Milner (1978)) Fact 1 A term is an encoding of a typing tree. 8 / 71
  • 10.
    DTT DTS Previouswork 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 ) The typing tree of a term (in STLC) can be recovered from the (structure of) term. (cf. Milner (1978)) Fact 1 A term is an encoding of a typing tree. 8 / 71
  • 11.
    DTT DTS Previouswork 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 ) The typing tree of a term (in STLC) can be recovered from the (structure of) term. (cf. Milner (1978)) Fact 1 A term is an encoding of a typing tree. 8 / 71
  • 12.
    DTT DTS Previouswork 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 ) The typing tree of a term (in STLC) can be recovered from the (structure of) term. (cf. Milner (1978)) Fact 1 A term is an encoding of a typing tree. 8 / 71
  • 13.
    DTT DTS Previouswork Type check./infer. Conclusion References Curry-Howard Correspondence btw. function type and implication Introduction rules Elimination rules Typing rules in STLC x : A.... M : B i λx.M function : A → B (LAM ),i M : A → B N : A MN : B (APP) Natural de- duction rules in PL A.... B i A → B (→I ),i A → B A B (→E) 9 / 71
  • 14.
    DTT DTS Previouswork Type check./infer. Conclusion References Curry-Howard Correspondence btw. product type and conjunction Introduction rules Elimination rules Typing rules 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) Natural deduc- tion rules in PL A B A ∧ B (∧I ) A ∧ B A (∧E) A ∧ B B (∧E) Fact 2 Typing rules of STLC (almost exactly) correspond to natural deduction rules in logic. 10 / 71
  • 15.
    DTT DTS Previouswork Type check./infer. Conclusion References Curry-Howard Correspondence btw. product type and conjunction Fact 1 A term is an encoding of a typing tree. + Fact 2 Typing rules of STLC (almost exactly) correspond to natural deduction rules in logic. ⇓ Fact 3 A term of type A is also an encoding of a proof diagram of a proposition A (under the view that proposition is type) 11 / 71
  • 16.
    DTT DTS Previouswork Type check./infer. Conclusion References Curry-Howard Correspondence btw. product type and conjunction Fact 3 A term of type A is also an encoding of a proof diagram of a proposition A (under the view that proposition is type) Fact 3’ Functions encode proofs of →. Pairs encode proofs of ∧. 12 / 71
  • 17.
    DTT DTS Previouswork Type check./infer. Conclusion References Curry-Howard Correspondence btw. product type and conjunction The correspondence between the notions of logic and type theory : Logic Type Theory proposition type proof term (or program) axiom constant symbol assumption variable logical connective type constructor implication functional type conjunction product type disjunction direct sum type absurdity empty type introduction constructor elimination destructor provability inhabitance cut substitution normalization reduction 13 / 71
  • 18.
    DTT DTS Previouswork Type check./infer. Conclusion References Dependent function type Introduction rules Elimination rules function type → in STLC x : A.... M : B i λx.M function : A → B (LAM ),i M : A → B N : A MN : B (APP) Dependent function 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
  • 19.
    DTT DTS Previouswork Type check./infer. Conclusion References Dependent sum type Introduction rules Elimination rules product type × 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) Dependent sum type (Σ) in DTT M : A N : B[M/x] (M, N) pair : x:A B (ΣI ) M : x:A B π1(M) : A (ΣE) M : x:A B π2(M) : B[π1(M)/x] (ΣE) Scope: x:A B 15 / 71
  • 20.
    DTT DTS Previouswork Type check./infer. Conclusion References Dependent types Dependent types Standard notation x ∈ fv(B) x ∈ fv(B) (x:A) → B (Πx : A)B A → B (∀x : A)B x:A B (Σx : A)B A ∧ B (∃x : A)B 16 / 71
  • 21.
    DTT DTS Previouswork Type check./infer. Conclusion References Dependent Type Semantics 17 / 71
  • 22.
    DTT DTS Previouswork 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:A B is a type for pairs of A and B[x]. 18 / 71
  • 23.
    DTT DTS Previouswork 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
  • 24.
    DTT DTS Previouswork 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 man who entered) from u, since u is a function. This explains the following cases uniformly, since both implication and negation are instances 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
  • 25.
    DTT DTS Previouswork Type check./infer. Conclusion References Local context and context passing: Bekki (2014) Definition (Dynamic conjunction and disjunction) M; N def ≡ λc. u:Mc N(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
  • 26.
    DTT DTS Previouswork 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
  • 27.
    DTT DTS Previouswork Type check./infer. Conclusion References Presupposition resolution as proof search @1 :       x:entity man(x) enter(x)       → entity If the hearer chooses to bind the presupposition, he/she has to find a term to replace @1 (for example, λx.π1π2(x) is such a term). In other words, anaphora/presupposition resolution reduces to proof search. Or the hearer may choose to accommodate the presupposition: in that case, he/she abandons tng proof search and add a new variable of the above type to the global context. 23 / 71
  • 28.
    DTT DTS Previouswork Type check./infer. Conclusion References Recent works on DTS Generalized Quantifiers: Tanaka et al. (2013), Tanaka (2014) Double-Negated Antecedents: Bekki (2013b) Modal Subordination: Tanaka et al. (2014) Conventional Implicature: Bekki and McCready (2014) Honorification in Japanese: Watanabe et al. (2014) Type checking/inference in DTS and its implementation: Bekki and Sato (2015) Factive Presupposition: Tanaka et al. (2015) 24 / 71
  • 29.
    DTT DTS Previouswork Type check./infer. Conclusion References Interim summary DTS is a framework of natural language semantics based on dependent type theory, following the line of Sundholm (1986), Ranta (1994). Dependent types work well for representing discourse anaphora (or presupposition in general) in a parallel manner to syntactic structures. DTS is a compositionalized (or lexicalized) version of dependent-type-oriented semantics, which adopts a mechanism such as local contexts, context passing, and underspecified terms. In DTS, the calculation of presupposition projection reduces to type checking/inference. This algorithm has not been formulated nor implemented until this work is done! 25 / 71
  • 30.
    DTT DTS Previouswork Type check./infer. Conclusion References Interim summary DTS is a framework of natural language semantics based on dependent type theory, following the line of Sundholm (1986), Ranta (1994). Dependent types work well for representing discourse anaphora (or presupposition in general) in a parallel manner to syntactic structures. DTS is a compositionalized (or lexicalized) version of dependent-type-oriented semantics, which adopts a mechanism such as local contexts, context passing, and underspecified terms. In DTS, the calculation of presupposition projection reduces to type checking/inference. This algorithm has not been formulated nor implemented until this work is done! 25 / 71
  • 31.
    DTT DTS Previouswork Type check./infer. Conclusion References Interim summary DTS is a framework of natural language semantics based on dependent type theory, following the line of Sundholm (1986), Ranta (1994). Dependent types work well for representing discourse anaphora (or presupposition in general) in a parallel manner to syntactic structures. DTS is a compositionalized (or lexicalized) version of dependent-type-oriented semantics, which adopts a mechanism such as local contexts, context passing, and underspecified terms. In DTS, the calculation of presupposition projection reduces to type checking/inference. This algorithm has not been formulated nor implemented until this work is done! 25 / 71
  • 32.
    DTT DTS Previouswork Type check./infer. Conclusion References Interim summary DTS is a framework of natural language semantics based on dependent type theory, following the line of Sundholm (1986), Ranta (1994). Dependent types work well for representing discourse anaphora (or presupposition in general) in a parallel manner to syntactic structures. DTS is a compositionalized (or lexicalized) version of dependent-type-oriented semantics, which adopts a mechanism such as local contexts, context passing, and underspecified terms. In DTS, the calculation of presupposition projection reduces to type checking/inference. This algorithm has not been formulated nor implemented until this work is done! 25 / 71
  • 33.
    DTT DTS Previouswork Type check./infer. Conclusion References Previous work on type checking/inference algorithm in dependent type theory 26 / 71
  • 34.
    DTT DTS Previouswork Type check./infer. Conclusion References Type Inference in Dependent Types DTS is based on Dependent Type Theory. 27 / 71
  • 35.
    DTT DTS Previouswork Type check./infer. Conclusion References Type Inference in Dependent Types DTS is based on Dependent Type Theory. Type inference in dependent type theory is known to be undecidable. 27 / 71
  • 36.
    DTT DTS Previouswork Type check./infer. Conclusion References Type Inference in Dependent Types DTS is based on Dependent Type Theory. Type inference in dependent type theory is known to be undecidable. 27 / 71
  • 37.
    DTT DTS Previouswork Type check./infer. Conclusion References Type Inference in Dependent Types Previous work on type inference in dependent type theory → L¨oh’s system for Agda (L¨oh et al., 2010). In L¨oh’s system, we can do type inference in dependent type theory with the help of a construction called annotation. 28 / 71
  • 38.
    DTT DTS Previouswork Type check./infer. Conclusion References L¨oh 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
  • 39.
    DTT DTS Previouswork Type check./infer. Conclusion References Explanation of L¨oh’s system e↓ ::= e↑ | λx.e↓ e↑ ::= e↓ : e↓ | ∗ | ∀x : e↓.e↓ | x | e↑ e↓ v ::= n | ∗ | ∀x : v.v n ::= x | nv e↓ : checkable terms e↑ : inferable terms v : values n : neutral terms 30 / 71
  • 40.
    DTT DTS Previouswork Type check./infer. Conclusion References Explanation about L¨oh’s system 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
  • 41.
    DTT DTS Previouswork Type check./infer. Conclusion References Explanation of L¨oh’s system Typeing rules are also classified into two categories: type inference 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 a mutually recursive manner. 2. In DTS, these notations are used similarly. 32 / 71
  • 42.
    DTT DTS Previouswork 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: We read rules from premise to conclusion. If the premises are satisfied, then the conclusion is satisfied. 33 / 71
  • 43.
    DTT DTS Previouswork 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: We read rules from conclusion to premise. A term to the left of the colon has a type to the right of the colon only when all the premise are satisfied. 34 / 71
  • 44.
    DTT DTS Previouswork Type check./infer. Conclusion References Type checking/inference algorithm in DTS 35 / 71
  • 45.
    DTT DTS Previouswork Type check./infer. Conclusion References Type inference system for DTS In DTS, there are terms that are not included in L¨oh’s system. L¨oh’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
  • 46.
    DTT DTS Previouswork Type check./infer. Conclusion References Inferable terms and Checkable terms M↑ : inferable term 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
  • 47.
    DTT DTS Previouswork Type check./infer. Conclusion References Inferable terms and Checkable terms M↑ : inferable term 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
  • 48.
    DTT DTS Previouswork Type check./infer. Conclusion References Typing rules Constant symbols (c, v) ∈ σ [L] Γ σ c :↑ v [L] (CON ) @-operators [L] Γ σ @i :↓ v [L, (i : v)] (ASP) σ : signature [L] : type assignments for @-operators 38 / 71
  • 49.
    DTT DTS Previouswork Type check./infer. Conclusion References Typing rules Dependent sum types [L] Γ σ A :↓ s1 [L ] A β v [L ] Γ, x : v σ B :↓ s2 [L ] [L] Γ σ x:A B :↑ s2 [L ] (ΣF) (s1, s2 ∈ {type, kind}) [L] Γ σ M :↓ v [L ] v [M/x] β v [L ] Γ σ N :↓ v [L ] [L] Γ σ (M, N) :↓ x:v v [L ] (ΣI ) [L] Γ σ M :↑ x:v v [L ] [L] Γ σ π1M :↑ v [L ] (ΣE) [L] Γ σ M :↑ x:v v [L ] v [π1M/x] β v [L] Γ σ π2M :↑ v [L ] (ΣE) 39 / 71
  • 50.
    DTT DTS Previouswork Type check./infer. Conclusion References Difference from L¨oh’s system There is an important difference between our system and L¨oh’s system: rules for function application. In L¨oh’s system, there is only one rule for function application: the (ΠE) rule. In DTS, there are two rules for function application: the (ΠE) rule and the (→ E) rule. 40 / 71
  • 51.
    DTT DTS Previouswork Type check./infer. Conclusion References The difference from L¨oh’s system Why are there two rules for function application in DTS? → The (ΠE) rule is insufficient to decide the type of @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
  • 52.
    DTT DTS Previouswork 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))     In this example, the part whistle(@1((), u)) has @1. Let’s go over a type checking process of whistle(@1((), u)) without using (→ E) rule. 42 / 71
  • 53.
    DTT DTS Previouswork 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) 43 / 71
  • 54.
    DTT DTS Previouswork 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) 43 / 71
  • 55.
    DTT DTS Previouswork 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) 43 / 71
  • 56.
    DTT DTS Previouswork 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 is not a inferable term, so this inference fails. → The type of @1 cannot be decided. 43 / 71
  • 57.
    DTT DTS Previouswork Type check./infer. Conclusion References Type checking for @i Why this fails? (ΠE) rule Γ σ M :↑ (x:v) → v Γ σ N :↓ v v [N/x] β v Γ σ MN :↑ v (ΠE) Because (ΠE) rule first tries to infer the type of the function part of a function application term. This conflicts with the fact that @i is not an inferable term. 44 / 71
  • 58.
    DTT DTS Previouswork Type check./infer. Conclusion References Type checking for @i We can think of another way to decide the type of @1. 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
  • 59.
    DTT DTS Previouswork Type check./infer. Conclusion References Type checking for @i Γ @1((), u) :↓ entity In the expression above, @1 should have the function type. The @1 receives an argument ((),u) and returns a term of type entity. 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
  • 60.
    DTT DTS Previouswork 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) In this rule, the argument part of function application is evaluated first. We can do type inference of the sentence (1) by using this rule. 47 / 71
  • 61.
    DTT DTS Previouswork Type check./infer. Conclusion References Type checking for @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) The @1 is assigned an appropriate type that represents the projective content of the sentence (1) 48 / 71
  • 62.
    DTT DTS Previouswork Type check./infer. Conclusion References Type checking for @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) The @1 is assigned an appropriate type that represents the projective content of the sentence (1) 48 / 71
  • 63.
    DTT DTS Previouswork Type check./infer. Conclusion References Conclusion 49 / 71
  • 64.
    DTT DTS Previouswork Type check./infer. Conclusion References Summary In DTS, presupposition projections are calculated as type check/inference in dependent type theory (and presupposition bindings/accommodations are proof-search), however, type checking/inference in (full) dependent type theory is undecidable. We formulated and implemented a (decidable) type checking/inference system for a fragment of dependent type theory, which is still enough to describe semantic representations of natural language. Annotations β-reduction during type checking Type inference rules for simple function/product types Underspecified terms 50 / 71
  • 65.
    DTT DTS Previouswork Type check./infer. Conclusion References Summary In DTS, presupposition projections are calculated as type check/inference in dependent type theory (and presupposition bindings/accommodations are proof-search), however, type checking/inference in (full) dependent type theory is undecidable. We formulated and implemented a (decidable) type checking/inference system for a fragment of dependent type theory, which is still enough to describe semantic representations of natural language. Annotations β-reduction during type checking Type inference rules for simple function/product types Underspecified terms 50 / 71
  • 66.
    DTT DTS Previouswork Type check./infer. Conclusion References Summary In DTS, presupposition projections are calculated as type check/inference in dependent type theory (and presupposition bindings/accommodations are proof-search), however, type checking/inference in (full) dependent type theory is undecidable. We formulated and implemented a (decidable) type checking/inference system for a fragment of dependent type theory, which is still enough to describe semantic representations of natural language. Annotations β-reduction during type checking Type inference rules for simple function/product types Underspecified terms 50 / 71
  • 67.
    DTT DTS Previouswork Type check./infer. Conclusion References Summary In DTS, presupposition projections are calculated as type check/inference in dependent type theory (and presupposition bindings/accommodations are proof-search), however, type checking/inference in (full) dependent type theory is undecidable. We formulated and implemented a (decidable) type checking/inference system for a fragment of dependent type theory, which is still enough to describe semantic representations of natural language. Annotations β-reduction during type checking Type inference rules for simple function/product types Underspecified terms 50 / 71
  • 68.
    DTT DTS Previouswork Type check./infer. Conclusion References Future work Connection with syntactic parsers Efficient proof-search algorithm for this fragment of dependent type theory Formal properties of the system 51 / 71
  • 69.
    DTT DTS Previouswork Type check./infer. Conclusion References Future work Connection with syntactic parsers Efficient proof-search algorithm for this fragment of dependent type theory Formal properties of the system 51 / 71
  • 70.
    DTT DTS Previouswork Type check./infer. Conclusion References Future work Connection with syntactic parsers Efficient proof-search algorithm for this fragment of dependent type theory Formal properties of the system 51 / 71
  • 71.
    DTT DTS Previouswork Type check./infer. Conclusion References Reference I Ahn, R. and H.-P. Kolb. (1990) “Discourse Representation meets Constructive 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 lexical semantics”, In the Proceedings of Sinn und Bedeutung 17. Paris, pp.63–80. Barendregt, H. P. (1991) “Introduction to generalized type systems”, 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 of Logic in Computer Science, Vol. 2. Oxford Science Publications, pp.117–309. 52 / 71
  • 72.
    DTT DTS Previouswork 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 Double Negation Elimination in Anaphora”, In the Proceedings of Logic and 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 international conference, LACL2014, Toulouse, France, June 2014 Proceedings), LNCS 8535. Toulouse, pp.14–29, Springer, Heiderburg. 53 / 71
  • 73.
    DTT DTS Previouswork Type check./infer. Conclusion References Reference III Bekki, D. and E. McCready. (2014) “CI via DTS”, In the Proceedings of LENLS11. Tokyo, pp.110–123. Bekki, D. and M. Sato. (2015) “Calculating Projections via Type Checking”, In the Proceedings of TYpe Theory and LExical Semantics (TYTLES), ESSLLI2015 workshop. Barcelona, Spain. Berardi, S. (1990) “Type Dependence and Constructive Mathematics”, Ph.d thesis, Mathematical Institute. Bertot, Y. and P. Cast´eran. (2004) Interactive Theorem Proving and Program Development. Springer. Bove, A. and P. Dybjer. (2008) “Dependent Types at Work”. 54 / 71
  • 74.
    DTT DTS Previouswork 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 of Computational 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. D´avila-P´erez, R. (1995) “Semantics and Parsing in Intuitionistic Categorial Grammar”, Ph.d. thesis, University of Essex. 55 / 71
  • 75.
    DTT DTS Previouswork Type check./infer. Conclusion References Reference V Fox, C. (1994a) “Discourse Representation, Type Theory and Property Theory”, In the Proceedings of H. Bunt, R. Muskens, and G. Rentier (eds.): the International Workshop on Computational Semantics. Institute for Language Technology and Artificial Intelligence (ITK), Tilburg, pp.71–80. Fox, C. (1994b) “Existence Presuppositions and Category Mistakes”, Acta Linguistica Hungarica 42(3/4), pp.325–339. Published 1996. Gallin, D. (1975) Intensional and Higher-Order Modal Logic. With Application to Montague Semantics. Amsterdam, New York, North-Holland Publisher/Elsevier Publisher. 56 / 71
  • 76.
    DTT DTS Previouswork 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 of Studies in Logic and the Foundations of Mathematics. North Holland, Elsevier. Krahmer, E. and P. Piwek. (1999) “Presupposition Projection as Proof Construction”, In: H. Bunt and R. Muskens (eds.): Computing Meanings: Current Issues in Computational Semantics, Studies in Linguistics Philosophy Series. Dordrecht, Kluwer Academic Publishers. 57 / 71
  • 77.
    DTT DTS Previouswork Type check./infer. Conclusion References Reference VII L¨oh, A., C. McBride, and W. Swierstra. (2010) “A Tutorial Implementation of a Dependently Typed Lambda Calculus”, Fundamenta Informaticae - Dependently Typed Programming 102(2), pp.177–207. Luo, Z. (1997) “Coercive subtyping in type theory”, In: D. van Dalen and M. Bezem (eds.): CSL 1996. LNCS, vol. 1258. Heidelberg, Springer. Luo, Z. (1999) “Coercive subtyping”, Journal of Logic and Computation 9(1), pp.105–130. Luo, Z. (2010) “Type-theoretical semantics with coercive subtyping”, In the Proceedings of Semantics and Linguistic Theory 20 (SALT 20). Vancouver. 58 / 71
  • 78.
    DTT DTS Previouswork Type check./infer. Conclusion References Reference VIII Luo, Z. (2012) “Formal Semantics in Modern Type Theories with Coercive Subtyping”, Linguistics and Philosophy 35(6). Martin-L¨of, 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-L¨of, P. (1984) Intuitionistic Type Theory, Vol. 17. Naples, Italy: Bibliopolis. Sambin, Giovanni (ed.). Milner, R. (1978) “A Theory of Type Polymorphism in Programming” Journal of Computer and System Science (JCSS)(17), pp.348–374. 59 / 71
  • 79.
    DTT DTS Previouswork Type check./infer. Conclusion References Reference IX Montague, R. (1973) “The proper treatment of quantification in ordinary English”, In: J. Hintikka, J. Moravcsic, and P. Suppes (eds.): Approaches to Natural Language. Dordrecht, Reidel, pp.221–242. Nordstr¨om, B., K. Petersson, and J. Smith. (1990) Programming in Martin-L¨of’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 Logic Series. Dordrecht, Kluwer Academic Publishers. Ranta, A. (1994) Type-Theoretical Grammar. Oxford University Press. 60 / 71
  • 80.
    DTT DTS Previouswork Type check./infer. Conclusion References Reference X Sundholm, G. (1986) “Proof theory and meaning”, In: D. Gabbay and F. Guenthner (eds.): Handbook of Philosophical Logic, Vol. III. Reidel, Kluwer, pp.471–506. Tanaka, R. (2014) “A Proof-Theoretic Approach to Generalized Quantifiers in Dependent Type Semantics”, In the Proceedings of R. de Haan (ed.): the ESSLLI 2014 Student Session, 26th European Summer School in Logic, Language and Information. T¨ubingen, Germany, pp.140–151. Tanaka, R., K. Mineshima, and D. Bekki. (2014) “Resolving Modal Anaphora in Dependent Type Semantics”, In the Proceedings of the Eleventh International Workshop on Logic and Engineering of Natural Language Semantics (LENLS11), JSAI International Symposia on AI 2014. Tokyo, pp.43–56. 61 / 71
  • 81.
    DTT DTS Previouswork Type check./infer. Conclusion References Reference XI Tanaka, R., K. Mineshima, and D. Bekki. (2015) “Factivity and Presupposition in Dependent Type Semantics”, In the Proceedings of TYpe Theory and LExical Semantics (TYTLES), ESSLLI2015 workshop. Tanaka, R., Y. Nakano, and D. Bekki. (2013) “Constructive Generalized Quantifiers Revisited”, In the Proceedings of Logic and Engineering of Natural Language Semantics 10 (LENLS 10). Tokyo, pp.69–78. Watanabe, N., E. McCready, and D. Bekki. (2014) “Japanese Honorification: Compositionality and Expressivity”, In the Proceedings of S. Kawahara and M. Igarashi (eds.): FAJL 7: Formal Approaches to Japanese Linguistics, the MIT Working Papers in Linguistics 73. International Christian University, Japan, pp.265–276. 62 / 71
  • 82.
  • 83.
    Appendix Presuppositions (5) a. Swedendoes 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
  • 84.
    Appendix Lexical items inDTS 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 SNP/NP λy.λx.λc.cherish(x, y) itsacc T (T /NP)/N λn.λp.λx.λc.p    π1    @jc ::     y:entity  nyc have π1 @ic :: z:entity ¬human(z) , y           65 / 71
  • 85.
    Appendix Semantic representations for(5) (5a) : λc.cherish    sweden, π1    @1(c) ::     y:entity  king(y) of y, π1 @2(c) :: z:entity ¬human(z)               (5b) : λc.¬cherish    sweden, π1    @1(c) ::     y:entity  king(y) have π1 @2(c) :: z:entity ¬human(z) , y               (5c) : λc.(u : monarchy(sweden)) → cherish    sweden, π1    @1(c, u) ::     y:entity  king(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:entity  king(y) have π1 @2(c, (x, u)) :: z:entity ¬human(z) , y               (5e) : λc.       cherish    sweden, π1    @1(c) ::     y:entity  king(y) have π1 @2(c) :: z:entity ¬human(z) , y               @3 =monarchy(sweden) @3       66 / 71
  • 86.
    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 :   δ entity monarchy(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 :   δ entity monarchy(x)   →   y:entity king(y) have(x, y)   (5d) : δ : type, c : δ @3 : monarchy(sweden) 67 / 71
  • 87.
    Appendix Presupposition Projection Calculated Thejudgments in (??) are the ones obtained after anaphora resolution for @2 has been executed: the output of the program contains the occurrence of @2 within the types for @1 (this means that the possessive presuppositions in (5) contain the anaphora antecedents). The proof terms corresponding to the intended reading in (5) (i.e. it refers to Sweden in (5a)(5b)(5d), and every monarchy 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 a monarchy), and n is a proof term for (x : entity) → monarchy(x) → ¬human(x) (Monarchy is not a human). Then, (??) is obtained by substituting @2 with these proof terms. 68 / 71
  • 88.
    Appendix Dependent Types inMathematics and Logic The notion of dependent types originates from: Martin-L¨of Type Theory (MLTT) (Martin-L¨of (1975, 1984)), which was proposed as a foundation of constructive mathematics. Calculus of Constructions (CoC) (Coquand and Huet (1988)), which was proposed as a foundation of functional programming and mathematical proofs. Lately, fragments of MLTT and CoC have been integrated into a general theory of the λ-cube (Barendregt (1992)) and Pure Type Systems (PTS) (Berardi (1990); Barendregt (1991)) with other important type theories, such as Girard’s F (Girard et al. (1989)). Calculus of Inductive Constructions (CoIC) (=CoC with inductive types) is known as an underlying language of proof assistants Coq (Bertot and Cast´eran (2004)) and Agda (Nordstr¨om et al. (1990), Bove and Dybjer (2008)). 69 / 71
  • 89.
    Appendix What is NOTDependent Type Theory Type-Theoretic Semantics (ex. Montague (1973), Gallin (1975)), where a proposition is a term of type t, while in Dependent Type Theory, a proposition is a type (=a collection of proofs). Dependent Type Theory is proof-theoretic, but it has a denotational semantics (cf. fibred category theory: Jacobs (1999)) and other types of semantics (cf. game-theoretic semantics) as well. 70 / 71
  • 90.
    Appendix Proof-theoretic vs. model-theoreticsemantics The ‘meaning’ of a given proposition φ: The Proof-theoretic Semantics Model-theoretic Semantics Provability, or {Γ | Γ φ} Truth-condition, or {(M, g) | φ M,g = 1} Inference rules Semantic Values (natural deduction): (classical logic): A.... B i A → B (→I ),i A A → B B (→E) A B A ∧ B (∧I ) A1 ∧ A2 Ai (∧E),i=1,2 A → B M,g = 1 ⇐: A M,g = 0 or B M,g = 1 A ∧ B M,g = 1 ⇐: A M,g = 1 and B M,g = 1 71 / 71