24
Functional Semantics for Pregroup Grammars Gabriel Gaudreault Concordia University, Montreal CoCoNat 2015 19 July 2015 Gabriel Gaudreault Concordia University, Montreal CoCoNat 2015 Functional Semantics for Pregroup Grammars

pres_coconat

Embed Size (px)

Citation preview

Page 1: pres_coconat

Functional Semantics for Pregroup Grammars

Gabriel Gaudreault

Concordia University, Montreal

CoCoNat 2015

19 July 2015

Gabriel Gaudreault Concordia University, Montreal CoCoNat 2015Functional Semantics for Pregroup Grammars

Page 2: pres_coconat

Goals

Goal:Figuring out a way to do semantics with pregroup grammars thatis intuitive and does not require learning higher-level mathematics

What I am presenting:- A functional calculus that is sensible to the incoming direction ofthe inputs and which has functional composition as main reductionoperation- The 1-1 relation between it and a subset of pregroup grammarsthat is relevant for linguistic analysis- How the system can be used for linguistic analysis

Gabriel Gaudreault Concordia University, Montreal CoCoNat 2015Functional Semantics for Pregroup Grammars

Page 3: pres_coconat

Overview

Categorial Grammars

Formal Semantics

Pregroup Grammars

λ-semantics for Pregroup Grammars?

λ↔-calculus

“Curry-Howard” Correspondence

Syntactic & Semantic Analysis

Gabriel Gaudreault Concordia University, Montreal CoCoNat 2015Functional Semantics for Pregroup Grammars

Page 4: pres_coconat

Categorial Grammars

Main idea: We can assign mathematical types to words and thencheck whether sentences are grammatical by looking at the stringof their corresponding types and using our derivation rules.

Types s, t := N,S , ... | s/t | s \ t

Reduction rules inspired by arithmetic

Butterflies like orangesN (N \ S) / N N → S

(Noun phrase) (subject \ verb / object) (Noun phrase)

Gabriel Gaudreault Concordia University, Montreal CoCoNat 2015Functional Semantics for Pregroup Grammars

Page 5: pres_coconat

Semantics for the Lambek Calculus

Semantics through λ-calculus

λx .λy .love(x , y)

Elimination Rule ↔ Function Application

a : A λx .b(x) : A \ B

b(a) : B

Introduction Rule ↔ Function Abstraction

x : A, Γ ` b : B

Γ ` λx .b : A \ B

In parallel to grammaticality check we do meaning extraction

Alan : NP λw .work(x) : NP \ S

work(Alan) : S

Gabriel Gaudreault Concordia University, Montreal CoCoNat 2015Functional Semantics for Pregroup Grammars

Page 6: pres_coconat

Pregroups

(P,→, r , l , ·, 1) : Partially ordered monoid over P, in which everyelement a ∈ P has a right and left adjoint, ar ∈ P, al ∈ Prespectively, subject to

a · ar → 1→ ar · a al · a→ 1→ a · al

(think of arithmetic: 2 ∗ 2−1 = 1)

Has properties such as:

a→ b ⇔ bl → al ⇔ br → ar

arl = alr = a

(a1...an)l = aln...al1

Gabriel Gaudreault Concordia University, Montreal CoCoNat 2015Functional Semantics for Pregroup Grammars

Page 7: pres_coconat

Pregroup Grammars

In PG, words get assigned pregroup types π, s, n, n, i , etc. whichcorrespond to syntactic categories

Ordered structure: we can now define relations such as N → π3,s2 → s

The role that inverses (A \ B) and (A / B) played in the originalsyntactic calculus is played by adjoints arb and abl ...

πr s i l i i r i i l i o l nnnln

s

will dance to save humanitymanA

Gabriel Gaudreault Concordia University, Montreal CoCoNat 2015Functional Semantics for Pregroup Grammars

Page 8: pres_coconat

Pregroup Grammars

Difference with the Syntactic Calculus:Those new types are associative — (ab)c = a(bc) — and cancombine in much more flexible ways because they are nowconsidered as a list of independent information pieces

abl · bc l → ac l

a/b · b/c 6→ a/c

(in one step)

We can’t really use the λ-calculus to do semantics anymore, as itis not clear what kind of functions our types represent:

(a \ b)/c ⇒ c → a→ b but arbc l ⇒?

Gabriel Gaudreault Concordia University, Montreal CoCoNat 2015Functional Semantics for Pregroup Grammars

Page 9: pres_coconat

λ↔-calculus

Termσ Formation Rules

x ∈ Varσx ∈ Termσ

c ∈ Conσc ∈ Termσ

t ∈ TermΩrφ s ∈ Termφrπ

(t)s ∈ TermΩrπ

t ∈ Termπφl s ∈ TermφΩl

t(s) ∈ TermπΩl

t ∈ Termσ x ∈ Varφ

t.x〉 ∈ Termσφl

x ∈ Varφ t ∈ Termσ

〈x .t ∈ Termφrσ

Example:

Alan ∈ Terme 〈x .(x)work ∈ Termerp

(Alan)work ∈ Termp

Gabriel Gaudreault Concordia University, Montreal CoCoNat 2015Functional Semantics for Pregroup Grammars

Page 10: pres_coconat

λ↔-calculus - Function Application

Γ1 ` t ∈ TermΩrφ Γ2 ` s ∈ Termφrπ

Γ1, Γ2 ` (t)s ∈ TermΩrπ

Γ1 ` t ∈ Termπφl Γ2 ` s ∈ TermφΩl

Γ1, Γ2 ` t(s) ∈ TermπΩl

Recall in simply typed λ-calculus:

Γ1 ` a : A Γ2 ` λx .f (x) : A→ B

Γ1, Γ2 ` f [a/x ]

Example:

Paul ∈ Terme 〈x .(x)run ∈ Termerp

(Paul)run ∈ Termp

Gabriel Gaudreault Concordia University, Montreal CoCoNat 2015Functional Semantics for Pregroup Grammars

Page 11: pres_coconat

λ↔-calculus - Function Abstraction

Γ, x ∈ Varφ ` t ∈ Termσ

Γ ` t.x〉 ∈ Termσφl

x ∈ Varφ, Γ ` t ∈ Termσ

Γ ` 〈x .t ∈ Termφrσ

Recall lambda abstraction:

Γ, x : A ` b : B

Γ ` λx .b(x) : A→ B

Pregroup expansion rule:

x ∈ Vara ` x ∈ Vara

` 〈x .x ∈ Termara

Gabriel Gaudreault Concordia University, Montreal CoCoNat 2015Functional Semantics for Pregroup Grammars

Page 12: pres_coconat

Reformulation of Pregroup Types

We redefine pregroup types as a deductive system.

initA ` A

Γ,A ` Bl I

Γ ` BAl

Γ1 ` AB l Γ2 ` BΣllE

Γ1, Γ2 ` AΣl

A, Γ ` Br I

Γ ` ArB

Γ1 ` ΣrA Γ2 ` ArB rEΓ1, Γ2 ` ΣrB

We change the way of looking at ArBC l : it now behaves more likean non-commutative linear functional type A ( B

(

C rather thana cartesian product or sum A⊥ ⊕ B ⊕ C⊥

Σl and Σr stand for a sequences of left and right adjoint types C l1...C

ln,

C r1 ...C

rn respectively.

Gabriel Gaudreault Concordia University, Montreal CoCoNat 2015Functional Semantics for Pregroup Grammars

Page 13: pres_coconat

Pregroup−λ↔ Grammars

Easy correspondence between the functional calculus and thosenew pregroup types:

initx : A ` x : A

Γ, x : A ` b : Bl I

Γ ` b.x〉 : BAl

Γ1 ` a : AB l Γ2 ` b : BΣllE

Γ1, Γ2 ` a(b) : AΣl

x : A, Γ ` b : Br I

Γ ` 〈x .b : ArB

Γ1 ` a : ΣrA Γ2 ` b : ArB rEΓ1, Γ2 ` (a)b : ΣrB

Gabriel Gaudreault Concordia University, Montreal CoCoNat 2015Functional Semantics for Pregroup Grammars

Page 14: pres_coconat

β-reduction

One of the major differences between that system and somethinglike a λ-calculus with 2 “directional”-λ’s is the β-reduction rules:

t|x〉 (b|x1〉...|xn〉) =β (t)[x := b] |x1〉...|xn〉

when t|x〉 ∈ Termσφl and b|x1〉...|xn〉 ∈ Termφπl1...π

ln

This is the main reason why an untyped λ↔-calculus is not possible

Gabriel Gaudreault Concordia University, Montreal CoCoNat 2015Functional Semantics for Pregroup Grammars

Page 15: pres_coconat

β-reduction

t|x〉 (b|x1〉...|xn〉) =β (t)[x := b] |x1〉...|xn〉

when t|x〉 ∈ Termσφl and b|x1〉...|xn〉 ∈ Termφπl1...π

ln

E.g.

the

ı(x).x〉 : nnl

green

green(y).y〉 : nnl

ı(green(y)).y〉 : nnl

Compare this to

theλx .ı(x) : NP/N

green

λy .green(y) : N/N z : N

green(z) : N

ı(green(z)) : NP

λz .ı(green(z)) : NP/N

Gabriel Gaudreault Concordia University, Montreal CoCoNat 2015Functional Semantics for Pregroup Grammars

Page 16: pres_coconat

β-reduction

t|x〉 (b|x1〉...|xn〉) =β (t)[x := b] |x1〉...|xn〉

when t|x〉 ∈ Termσφl and b|x1〉...|xn〉 ∈ Termφπl1...π

ln

We still need to be able to pass abstracted predicates though

Someone

∃x .(x)y .y〉 : s(πr3s)lruns

〈z .(z)run : πr3s

∃x .(x)〈z .(z)run : s

∃x .(x)run : s

Gabriel Gaudreault Concordia University, Montreal CoCoNat 2015Functional Semantics for Pregroup Grammars

Page 17: pres_coconat

New Typing Structure

The pregroup types we will end up using in our analyses only forma subset of the ones possible in the algebraic formulation. Forinstance, there are

No more types of the form Ar , ArrB, AlB, AB, etc.

No more relations such as (AB)l ↔ B lAl

Only one kind of contraction is possible: between“disconnected” types

It is totally fine: we will end up not needing those relations andtypes at all, and our contraction rule is sufficient

Gabriel Gaudreault Concordia University, Montreal CoCoNat 2015Functional Semantics for Pregroup Grammars

Page 18: pres_coconat

New Typing Structure

Predictions:

give never needs its equivalent type i(op)l

give a star to Bobiplo l nnl n pnl N

→ iplo l n pnl n

→ iplo l o p

→ ipl p → i

for does not need φ(oj)l either

John wants for Mary to liveN πr3sφl φj lo l N ji l i

→ π3 πr3sφl φj lo l o j

→ sφl φj l j

→ sφl φ → s

Gabriel Gaudreault Concordia University, Montreal CoCoNat 2015Functional Semantics for Pregroup Grammars

Page 19: pres_coconat

New Typing Structure

More examples:

somebody

ss lπ?πr

Edward likes pies

s

JohnN

who

nr ns lπlCarlπ

I like ice creams

n

JohnN

who

nr n(πs)l?πs

n

JohnN

whom

nr no l ls lI like ice cream

s

?

o l

n

Gabriel Gaudreault Concordia University, Montreal CoCoNat 2015Functional Semantics for Pregroup Grammars

Page 20: pres_coconat

Flexibility of Derivations

the

ı(x)|x〉 : nnl

green

green(y)|y〉 : nnllE

ı(green(y))|y〉 : nnl

apple

apple : nlE

ı(green(apple)) : n

the

ı(x)|x〉 : nnl

green

green(y)|y〉 : nnl

apple

apple : nlE

green(apple) : nlE

ı(green(apple)) : n

Gabriel Gaudreault Concordia University, Montreal CoCoNat 2015Functional Semantics for Pregroup Grammars

Page 21: pres_coconat

Constituency Analysis

fliesplural(fly(x)|x〉) : n

in

〈y |(y)in(x)|x〉 : nrnnl

the

ı(x)|x〉 : nnl

sky

sky : nlE

ı(sky) : nlE〈y |(y)in(ı(sky)) : nrn

lE(plural(fly(x)|x〉)in(ı(sky)) : n

flies〈z |fly(z) : πr s

in

〈y |(y)in(x)|x〉 : sr snllE〈z |(fly(z))in(x)|x〉 : πr snl

the

ı(x)|x〉 : nnl

sky

sky : nlE

ı(sky) : nlE〈z |(fly(z))in(ı(sky)) : πr s

Gabriel Gaudreault Concordia University, Montreal CoCoNat 2015Functional Semantics for Pregroup Grammars

Page 22: pres_coconat

Examples

Sentence with Quantifiers

First reading: Everybody has a special someone, who might all bedifferent from eachother

everybody

∀((person(z) → (z)x|z〉))|x〉 : s(πr3s)

l

loves

〈x|(x)love(y)|y〉 : πr3so

l

somebody

〈z|∃((person(y) → z(y))|y〉) : (so l )r s

〈x|∃((person(y) → (x)love(y))|y〉) : πr3s

∀((person(z) → ∃((person(y) → (z)love(y))|y〉))|z〉) : s

Second reading: There’s someone who everyone’s in love with

everybody

∀((person(z) → (z)x|z〉))|x〉 : s(πr3s)

l

loves

〈x|(x)love(y)|y〉 : πr3so

l

∀((person(z) → (z)love(y)|z〉))|y〉 : so l

somebody

〈z|∃((person(x) → z(x))|x〉) : (so l )r s

∃((person(x) → ∀((person(z) → (z)love(x)|z〉)))|x〉) : s

Gabriel Gaudreault Concordia University, Montreal CoCoNat 2015Functional Semantics for Pregroup Grammars

Page 23: pres_coconat

Future

More in-depth analysis of semantic power of the new calculus,i.e. what does an associative & compositional semantic layerimply for semantic analysis?

Proving Church-Rosser Property

Category theoretical analysis of the new calculus

Gabriel Gaudreault Concordia University, Montreal CoCoNat 2015Functional Semantics for Pregroup Grammars

Page 24: pres_coconat

The End

Thank you for listening

Special thanks to: Alan Bale, Claudia Casadio, and Robert Seelyfor their help in this project

Gabriel Gaudreault Concordia University, Montreal CoCoNat 2015Functional Semantics for Pregroup Grammars