1. 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
2. Goals
Goal:
Figuring out a way to do semantics with pregroup grammars that
is intuitive and does not require learning higher-level mathematics
What I am presenting:
- A functional calculus that is sensible to the incoming direction of
the inputs and which has functional composition as main reduction
operation
- The 1-1 relation between it and a subset of pregroup grammars
that 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
3. 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
4. Categorial Grammars
Main idea: We can assign mathematical types to words and then
check whether sentences are grammatical by looking at the string
of their corresponding types and using our derivation rules.
Types s, t := N, S, ... | s/t | s t
Reduction rules inspired by arithmetic
Butterflies like oranges
N (N S) / N N → S
(Noun phrase) (subject verb / object) (Noun phrase)
Gabriel Gaudreault Concordia University, Montreal CoCoNat 2015Functional Semantics for Pregroup Grammars
5. 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
6. Pregroups
(P, →, r , l , ·, 1) : Partially ordered monoid over P, in which every
element a ∈ P has a right and left adjoint, ar ∈ P, al ∈ P
respectively, 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
= al
n...al
1
Gabriel Gaudreault Concordia University, Montreal CoCoNat 2015Functional Semantics for Pregroup Grammars
7. Pregroup Grammars
In PG, words get assigned pregroup types π, s, n, ¯n, i, etc. which
correspond 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 original
syntactic calculus is played by adjoints ar b and abl ...
πr s il i ir i il i ol nnnl¯n
s
will dance to save humanitymanA
Gabriel Gaudreault Concordia University, Montreal CoCoNat 2015Functional Semantics for Pregroup Grammars
8. Pregroup Grammars
Difference with the Syntactic Calculus:
Those new types are associative — (ab)c = a(bc) — and can
combine in much more flexible ways because they are now
considered as a list of independent information pieces
abl
· bcl
→ acl
a/b · b/c → a/c
(in one step)
We can’t really use the λ-calculus to do semantics anymore, as it
is not clear what kind of functions our types represent:
(a b)/c ⇒ c → a → b but ar
bcl
⇒?
Gabriel Gaudreault Concordia University, Montreal CoCoNat 2015Functional Semantics for Pregroup Grammars
9. λ↔
-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
10. λ↔
-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 ∈ Termer p
(Paul)run ∈ Termp
Gabriel Gaudreault Concordia University, Montreal CoCoNat 2015Functional Semantics for Pregroup Grammars
11. λ↔
-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
12. Reformulation of Pregroup Types
We redefine pregroup types as a deductive system.
init
A A
Γ, A B l I
Γ BAl
Γ1 ABl Γ2 BΣl
l E
Γ1, Γ2 AΣl
A, Γ B r I
Γ Ar B
Γ1 Σr A Γ2 Ar B r E
Γ1, Γ2 Σr B
We change the way of looking at Ar BCl : it now behaves more like
an non-commutative linear functional type A B C rather than
a cartesian product or sum A⊥ ⊕ B ⊕ C⊥
Σl
and Σr
stand for a sequences of left and right adjoint types Cl
1...Cl
n,
Cr
1 ...Cr
n respectively.
Gabriel Gaudreault Concordia University, Montreal CoCoNat 2015Functional Semantics for Pregroup Grammars
13. Pregroup−λ↔
Grammars
Easy correspondence between the functional calculus and those
new pregroup types:
init
x : A x : A
Γ, x : A b : B l I
Γ b.x : BAl
Γ1 a : ABl Γ2 b : BΣl
l E
Γ1, Γ2 a(b) : AΣl
x : A, Γ b : B r I
Γ x.b : Ar B
Γ1 a : Σr A Γ2 b : Ar B r E
Γ1, Γ2 (a)b : Σr B
Gabriel Gaudreault Concordia University, Montreal CoCoNat 2015Functional Semantics for Pregroup Grammars
14. β-reduction
One of the major differences between that system and something
like 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φπl
1...πl
n
This is the main reason why an untyped λ↔-calculus is not possible
Gabriel Gaudreault Concordia University, Montreal CoCoNat 2015Functional Semantics for Pregroup Grammars
15. β-reduction
t|x (b|x1 ...|xn ) =β (t)[x := b] |x1 ...|xn
when t|x ∈ Termσφl and b|x1 ...|xn ∈ Termφπl
1...πl
n
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
16. β-reduction
t|x (b|x1 ...|xn ) =β (t)[x := b] |x1 ...|xn
when t|x ∈ Termσφl and b|x1 ...|xn ∈ Termφπl
1...πl
n
We still need to be able to pass abstracted predicates though
Someone
∃x.(x)y.y : s(πr
3s)l
runs
z.(z)run : πr
3s
∃x.(x) z.(z)run : s
∃x.(x)run : s
Gabriel Gaudreault Concordia University, Montreal CoCoNat 2015Functional Semantics for Pregroup Grammars
17. New Typing Structure
The pregroup types we will end up using in our analyses only form
a subset of the ones possible in the algebraic formulation. For
instance, there are
No more types of the form Ar , Arr B, Al B, AB, etc.
No more relations such as (AB)l ↔ Bl Al
Only one kind of contraction is possible: between
“disconnected” types
It is totally fine: we will end up not needing those relations and
types at all, and our contraction rule is sufficient
Gabriel Gaudreault Concordia University, Montreal CoCoNat 2015Functional Semantics for Pregroup Grammars
18. New Typing Structure
Predictions:
give never needs its equivalent type i(op)l
give a star to Bob
ipl ol ¯nnl n p¯nl N
→ ipl ol ¯n p¯nl ¯n
→ ipl ol o p
→ ipl p → i
for does not need φ(o¯j)l either
John wants for Mary to live
N πr
3sφl φ¯jl ol N ¯jil i
→ π3 πr
3sφl φ¯jl ol o ¯j
→ sφl φ¯jl ¯j
→ sφl φ → s
Gabriel Gaudreault Concordia University, Montreal CoCoNat 2015Functional Semantics for Pregroup Grammars
19. New Typing Structure
More examples:
somebody
ssl π
?
πr
Edward likes pie
s
s
John
N
who
¯nr ¯nsl πl
Carl
π
I like ice cream
s
¯n
John
N
who
¯nr ¯n(πs)l
?
πs
¯n
John
N
whom
¯nr ¯nol lsl
I like ice cream
s
?
ol
¯n
Gabriel Gaudreault Concordia University, Montreal CoCoNat 2015Functional Semantics for Pregroup Grammars
20. Flexibility of Derivations
the
ı(x)|x : ¯nnl
green
green(y)|y : nnl
l E
ı(green(y))|y : ¯nnl
apple
apple : n
l E
ı(green(apple)) : ¯n
the
ı(x)|x : ¯nnl
green
green(y)|y : nnl
apple
apple : n
l E
green(apple) : n
l E
ı(green(apple)) : ¯n
Gabriel Gaudreault Concordia University, Montreal CoCoNat 2015Functional Semantics for Pregroup Grammars
21. Constituency Analysis
flies
plural(fly(x)|x ) : n
in
y|(y)in(x)|x : nr n¯nl
the
ı(x)|x : ¯nnl
sky
sky : n
l E
ı(sky) : ¯n
l E
y|(y)in(ı(sky)) : nr n
l E
(plural(fly(x)|x )in(ı(sky)) : n
flies
z|fly(z) : πr s
in
y|(y)in(x)|x : sr s ¯nl
l E
z|(fly(z))in(x)|x : πr s ¯nl
the
ı(x)|x : ¯nnl
sky
sky : n
l E
ı(sky) : ¯n
l E
z|(fly(z))in(ı(sky)) : πr s
Gabriel Gaudreault Concordia University, Montreal CoCoNat 2015Functional Semantics for Pregroup Grammars
22. Examples
Sentence with Quantifiers
First reading: Everybody has a special someone, who might all be
different from eachother
everybody
∀((person(z) → (z)x|z ))|x : s(πr
3s)l
loves
x|(x)love(y)|y : πr
3sol
somebody
z|∃((person(y) → z(y))|y ) : (sol
)r
s
x|∃((person(y) → (x)love(y))|y ) : πr
3s
∀((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(πr
3s)l
loves
x|(x)love(y)|y : πr
3sol
∀((person(z) → (z)love(y)|z ))|y : sol
somebody
z|∃((person(x) → z(x))|x ) : (sol
)r
s
∃((person(x) → ∀((person(z) → (z)love(x)|z )))|x ) : s
Gabriel Gaudreault Concordia University, Montreal CoCoNat 2015Functional Semantics for Pregroup Grammars
23. Future
More in-depth analysis of semantic power of the new calculus,
i.e. what does an associative & compositional semantic layer
imply 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
24. The End
Thank you for listening
Special thanks to: Alan Bale, Claudia Casadio, and Robert Seely
for their help in this project
Gabriel Gaudreault Concordia University, Montreal CoCoNat 2015Functional Semantics for Pregroup Grammars