Structures Informatiques et Logiques pour la Mod elisation - - PowerPoint PPT Presentation

structures informatiques et logiques pour la mod
SMART_READER_LITE
LIVE PREVIEW

Structures Informatiques et Logiques pour la Mod elisation - - PowerPoint PPT Presentation

Structures Informatiques et Logiques pour la Mod elisation Linguistique (MPRI 2.27.1 - second part) Philippe de Groote Inria 2015-2016 Philippe de Groote (Inria) MPRI 2.27.1 2015-2016 1 / 41 Syntax/semantics Interface Compositionality


slide-1
SLIDE 1

Structures Informatiques et Logiques pour la Mod´ elisation Linguistique (MPRI 2.27.1 - second part)

Philippe de Groote

Inria

2015-2016

Philippe de Groote (Inria) MPRI 2.27.1 2015-2016 1 / 41

slide-2
SLIDE 2

Syntax/semantics Interface

1

Compositionality

2

Context-free grammars Example Abstract syntax as heterogeneous algebra Homomorphism

3

Higher-order abstract syntax Higher-order signature Examples Higher-order homomorphism

4

Abstract categorial grammars Definition Generated languages Example Language-theoretic example Expressive power

Philippe de Groote (Inria) MPRI 2.27.1 2015-2016 2 / 41

slide-3
SLIDE 3

Compositionality

Syntax/semantics Interface

1

Compositionality

2

Context-free grammars Example Abstract syntax as heterogeneous algebra Homomorphism

3

Higher-order abstract syntax Higher-order signature Examples Higher-order homomorphism

4

Abstract categorial grammars Definition Generated languages Example Language-theoretic example Expressive power

Philippe de Groote (Inria) MPRI 2.27.1 2015-2016 3 / 41

slide-4
SLIDE 4

Compositionality

Compositionality

Compositionality principle The meaning of a complex expression is determined by the meanings

  • f its constituents and by the formation rules used to combine them.

Montague’s homomorphism requirement Semantics must be obtained as a homomorphic image of syntax. Contextuality principle The meaning of an expression is determined by the meanings of the complex expressions of which it is a constituent.

Philippe de Groote (Inria) MPRI 2.27.1 2015-2016 4 / 41

slide-5
SLIDE 5

Context-free grammars

Syntax/semantics Interface

1

Compositionality

2

Context-free grammars Example Abstract syntax as heterogeneous algebra Homomorphism

3

Higher-order abstract syntax Higher-order signature Examples Higher-order homomorphism

4

Abstract categorial grammars Definition Generated languages Example Language-theoretic example Expressive power

Philippe de Groote (Inria) MPRI 2.27.1 2015-2016 5 / 41

slide-6
SLIDE 6

Context-free grammars Example

Syntax/semantics Interface

1

Compositionality

2

Context-free grammars Example Abstract syntax as heterogeneous algebra Homomorphism

3

Higher-order abstract syntax Higher-order signature Examples Higher-order homomorphism

4

Abstract categorial grammars Definition Generated languages Example Language-theoretic example Expressive power

Philippe de Groote (Inria) MPRI 2.27.1 2015-2016 6 / 41

slide-7
SLIDE 7

Context-free grammars Example

Rule to rule semantics

Context free grammar: S → NP VP VP → tV NP tV → loves NP → John NP → somebody Semantic rules: [[S]] = [[NP]] [[VP]] [[VP]] = λx. [[NP]] (λy. [[tV]] y x) [[tV]] = λy. λx. love x y [[NP]] = λk. k j [[NP]] = λk. ∃y. k y

Philippe de Groote (Inria) MPRI 2.27.1 2015-2016 7 / 41

slide-8
SLIDE 8

Context-free grammars Abstract syntax as heterogeneous algebra

Syntax/semantics Interface

1

Compositionality

2

Context-free grammars Example Abstract syntax as heterogeneous algebra Homomorphism

3

Higher-order abstract syntax Higher-order signature Examples Higher-order homomorphism

4

Abstract categorial grammars Definition Generated languages Example Language-theoretic example Expressive power

Philippe de Groote (Inria) MPRI 2.27.1 2015-2016 8 / 41

slide-9
SLIDE 9

Context-free grammars Abstract syntax as heterogeneous algebra

Signature associated to a CFG

Context free grammar: S → NP VP (p1) VP → tV NP (p2) tV → loves (p3) NP → John (p4) NP → somebody (p5) Associate a sort to each non-terminal, and an operator to each production rule: p1 : NP × VP → S p2 : tV × NP → VP p3 : tV p4 : NP p5 : NP

Philippe de Groote (Inria) MPRI 2.27.1 2015-2016 9 / 41

slide-10
SLIDE 10

Context-free grammars Homomorphism

Syntax/semantics Interface

1

Compositionality

2

Context-free grammars Example Abstract syntax as heterogeneous algebra Homomorphism

3

Higher-order abstract syntax Higher-order signature Examples Higher-order homomorphism

4

Abstract categorial grammars Definition Generated languages Example Language-theoretic example Expressive power

Philippe de Groote (Inria) MPRI 2.27.1 2015-2016 10 / 41

slide-11
SLIDE 11

Context-free grammars Homomorphism

Syntactic and semantic algebras

Syntactic algebra: p1 : NP × VP → S p2 : tV × NP → VP p3 : tV p4 : NP p5 : NP Semantic algebra: f1(a, b) = a b : NP∗ × VP∗ → S∗ f2(a, b) = λx. b (λy. a y x) : tV∗ × NP∗ → VP∗ f3 = λy. λx. love x y : tV∗ f4 = λk. k j : NP∗ f5 = λk. ∃y. k y : NP∗

Philippe de Groote (Inria) MPRI 2.27.1 2015-2016 11 / 41

slide-12
SLIDE 12

Context-free grammars Homomorphism

Where: S∗ = o VP∗ = ι → o tV∗ = ι → ι → o NP∗ = (ι → o) → o

Philippe de Groote (Inria) MPRI 2.27.1 2015-2016 12 / 41

slide-13
SLIDE 13

Higher-order abstract syntax

Syntax/semantics Interface

1

Compositionality

2

Context-free grammars Example Abstract syntax as heterogeneous algebra Homomorphism

3

Higher-order abstract syntax Higher-order signature Examples Higher-order homomorphism

4

Abstract categorial grammars Definition Generated languages Example Language-theoretic example Expressive power

Philippe de Groote (Inria) MPRI 2.27.1 2015-2016 13 / 41

slide-14
SLIDE 14

Higher-order abstract syntax Higher-order signature

Syntax/semantics Interface

1

Compositionality

2

Context-free grammars Example Abstract syntax as heterogeneous algebra Homomorphism

3

Higher-order abstract syntax Higher-order signature Examples Higher-order homomorphism

4

Abstract categorial grammars Definition Generated languages Example Language-theoretic example Expressive power

Philippe de Groote (Inria) MPRI 2.27.1 2015-2016 14 / 41

slide-15
SLIDE 15

Higher-order abstract syntax Higher-order signature

Definition

Let T (A) be the set of functional types built on the set of atomic types A, i.e.: T (A) ::= A | ( T (A) → T (A) ) A higher-order signature is a triple Σ = A, C, τ, where: A is a finite set of atomic types; C is a finite set of constants; τ : C → T (A) is a function that assigns each constant in C with a simple type built on A. We use Λ(Σ) to denote the set of simply typed λ-terms built upon a higher-order linear signature Σ. We use Λ0(Σ) to denote the set of linear λ-terms built upon a higher-order signature Σ.

Philippe de Groote (Inria) MPRI 2.27.1 2015-2016 15 / 41

slide-16
SLIDE 16

Higher-order abstract syntax Examples

Syntax/semantics Interface

1

Compositionality

2

Context-free grammars Example Abstract syntax as heterogeneous algebra Homomorphism

3

Higher-order abstract syntax Higher-order signature Examples Higher-order homomorphism

4

Abstract categorial grammars Definition Generated languages Example Language-theoretic example Expressive power

Philippe de Groote (Inria) MPRI 2.27.1 2015-2016 16 / 41

slide-17
SLIDE 17

Higher-order abstract syntax Examples

Trees

p1 : NP → VP → S p2 : tV → NP → VP p3 : tV p4 : NP p5 : NP

Philippe de Groote (Inria) MPRI 2.27.1 2015-2016 17 / 41

slide-18
SLIDE 18

Higher-order abstract syntax Examples

Strings

A canonical way of representing strings as λ-terms consists of representing them as function compositions: ‘abbac’ = λx. a (b (b (a (c x)))) In this setting: ǫ

= λx. x α + β

= λα. λβ. λx. α (β x)

Philippe de Groote (Inria) MPRI 2.27.1 2015-2016 18 / 41

slide-19
SLIDE 19

Higher-order abstract syntax Examples

First-order logic

zero : term succ : term → term add : term → term → term . . . eq : term → term → prop not : prop → prop and : prop → prop → prop forall : (term → prop) → prop

Philippe de Groote (Inria) MPRI 2.27.1 2015-2016 19 / 41

slide-20
SLIDE 20

Higher-order abstract syntax Examples

linguistic example

. . . a : N → NP wise : N → N man : N who : (NP → S) → N → N loves : NP → NP → S himself : (NP → NP → S) → NP → S . . .

Philippe de Groote (Inria) MPRI 2.27.1 2015-2016 20 / 41

slide-21
SLIDE 21

Higher-order abstract syntax Higher-order homomorphism

Syntax/semantics Interface

1

Compositionality

2

Context-free grammars Example Abstract syntax as heterogeneous algebra Homomorphism

3

Higher-order abstract syntax Higher-order signature Examples Higher-order homomorphism

4

Abstract categorial grammars Definition Generated languages Example Language-theoretic example Expressive power

Philippe de Groote (Inria) MPRI 2.27.1 2015-2016 21 / 41

slide-22
SLIDE 22

Higher-order abstract syntax Higher-order homomorphism

Definition

Given two higher-order signatures Σ1 = A1, C1, τ1 and Σ2 = A2, C2, τ2, a higher-order homomorphism H = η, θ from Σ1 to Σ2 is generated by two functions: η : A1 → T (A2), θ : C1 → Λ(Σ2), such that −Σ2 θ(c) : ˆ η(τ1(c)). where ˆ η is the homomorphic extension of η, i.e.: ˆ η(a) = η(a), for a ∈ A1. ˆ η(α → β) = ˆ η(α) → ˆ η(β).

Philippe de Groote (Inria) MPRI 2.27.1 2015-2016 22 / 41

slide-23
SLIDE 23

Abstract categorial grammars

Syntax/semantics Interface

1

Compositionality

2

Context-free grammars Example Abstract syntax as heterogeneous algebra Homomorphism

3

Higher-order abstract syntax Higher-order signature Examples Higher-order homomorphism

4

Abstract categorial grammars Definition Generated languages Example Language-theoretic example Expressive power

Philippe de Groote (Inria) MPRI 2.27.1 2015-2016 23 / 41

slide-24
SLIDE 24

Abstract categorial grammars Definition

Syntax/semantics Interface

1

Compositionality

2

Context-free grammars Example Abstract syntax as heterogeneous algebra Homomorphism

3

Higher-order abstract syntax Higher-order signature Examples Higher-order homomorphism

4

Abstract categorial grammars Definition Generated languages Example Language-theoretic example Expressive power

Philippe de Groote (Inria) MPRI 2.27.1 2015-2016 24 / 41

slide-25
SLIDE 25

Abstract categorial grammars Definition

Vocabularies and Lexicon

A vocabulary is defined to be a higher-order signature. Given two vocabularies Σ1 and Σ2, a lexicon L from Σ1 to Σ2 is defined to be a linear higher-order homomorphism L : Σ1 → Σ2.

Philippe de Groote (Inria) MPRI 2.27.1 2015-2016 25 / 41

slide-26
SLIDE 26

Abstract categorial grammars Definition

Definition

An abstract categorial grammar is a quadruple G = Σ1, Σ2, L, s where : Σ1 = A1, C1, τ1 and Σ2 = A2, C2, τ2 are two higher-order linear signatures; Σ1 is called the abstract vocabulary and Σ2 is called the

  • bject vocabulary;

L : Σ1 → Σ2 is a lexicon from the abstract vocabulary to the object vocabulary; s ∈ T (A1) is a type of the abstract vocabulary; it is called the distinguished type of the grammar.

Philippe de Groote (Inria) MPRI 2.27.1 2015-2016 26 / 41

slide-27
SLIDE 27

Abstract categorial grammars Generated languages

Syntax/semantics Interface

1

Compositionality

2

Context-free grammars Example Abstract syntax as heterogeneous algebra Homomorphism

3

Higher-order abstract syntax Higher-order signature Examples Higher-order homomorphism

4

Abstract categorial grammars Definition Generated languages Example Language-theoretic example Expressive power

Philippe de Groote (Inria) MPRI 2.27.1 2015-2016 27 / 41

slide-28
SLIDE 28

Abstract categorial grammars Generated languages

Abstract and object language

Let Λ0(Σ) be the set of linear λ-terms built upon a higher-order signature Σ. The abstract language generated by G (A(G)) is defined as follows: A(G) = {t ∈ Λ0(Σ1) | −Σ1 t: s is derivable} The object language generated by G (O(G)) is defined to be the image of the abstract language by the term homomorphism induced by the lexicon L: O(G) = {t ∈ Λ0(Σ2) | ∃u ∈ A(G). t = L(u)}

Philippe de Groote (Inria) MPRI 2.27.1 2015-2016 28 / 41

slide-29
SLIDE 29

Abstract categorial grammars Example

Syntax/semantics Interface

1

Compositionality

2

Context-free grammars Example Abstract syntax as heterogeneous algebra Homomorphism

3

Higher-order abstract syntax Higher-order signature Examples Higher-order homomorphism

4

Abstract categorial grammars Definition Generated languages Example Language-theoretic example Expressive power

Philippe de Groote (Inria) MPRI 2.27.1 2015-2016 29 / 41

slide-30
SLIDE 30

Abstract categorial grammars Example

Signatures Σ0:

N , NP, S : type J : NP U : N A : N −

  • ((NP −
  • S) −
  • S)

S : ((NP −

  • S) −
  • S) −
  • (NP −
  • S)

Σ1:

/a/, /John/, /seeks/, /unicorn/ : STRING

Σ2:

ι, o : type ∧ :

  • (o −
  • o)

∃ : (ι → o) −

  • o

j : ι unicorn : ι −

  • o

find : ι −

  • (ι −
  • o)

try : ι −

  • ((ι −
  • o) −
  • o)

Philippe de Groote (Inria) MPRI 2.27.1 2015-2016 30 / 41

slide-31
SLIDE 31

Abstract categorial grammars Example

Lexicons L1 : Σ0 → Σ1

N , NP, S := STRING J := /John/ U := /unicorn/ A := λx. λp. p (/a/ + x) S := λp. λx. p (λy. x + /seeks/ + y)

L2 : Σ0 → Σ2

N := ι → o NP := ι S :=

  • J

:= j U := λx. unicorn x A := λp. λq. ∃x. p x ∧ q x S := λp. λx. try x (λy. p (λz. find y z))

Philippe de Groote (Inria) MPRI 2.27.1 2015-2016 31 / 41

slide-32
SLIDE 32

Abstract categorial grammars Example

Syntax/semantics transfer

We have that: L1(S (A U) J) = /John/ + /seeks/ + /a/ + /unicorn/ L2(S (A U) J) = try j (λx. ∃y. unicorn y ∧ find x y) L1(A U (λx. S (λk. k x) J)) = /John/ + /seeks/ + /a/ + /unicorn/ L2(A U (λx. S (λk. k x) J)) = ∃y. unicorn y ∧ try j (λx. find x y)

Philippe de Groote (Inria) MPRI 2.27.1 2015-2016 32 / 41

slide-33
SLIDE 33

Abstract categorial grammars Language-theoretic example

Syntax/semantics Interface

1

Compositionality

2

Context-free grammars Example Abstract syntax as heterogeneous algebra Homomorphism

3

Higher-order abstract syntax Higher-order signature Examples Higher-order homomorphism

4

Abstract categorial grammars Definition Generated languages Example Language-theoretic example Expressive power

Philippe de Groote (Inria) MPRI 2.27.1 2015-2016 33 / 41

slide-34
SLIDE 34

Abstract categorial grammars Language-theoretic example

Context-free grammars

S → ǫ S → aSb Abstract vocabulary : S : type A : S B : S −

  • S

Lexicon : S := string A := ǫ B := λx. a + x + b

Philippe de Groote (Inria) MPRI 2.27.1 2015-2016 34 / 41

slide-35
SLIDE 35

Abstract categorial grammars Language-theoretic example

Tree-adjoining grammars

S ǫ Sna a S d b S∗ na c Abstract vocabulary : S, S′, S′′ : type A : (S′′ −

  • S′) −
  • S

B : S′′ −

  • (S′′ −
  • S′) −
  • S′

C : S′′ −

  • S′

Lexicon : S, S′, S′′ := string A := λf. f ǫ B := λx. λg. a + g (b + x + c) + d C := λx. x

Philippe de Groote (Inria) MPRI 2.27.1 2015-2016 35 / 41

slide-36
SLIDE 36

Abstract categorial grammars Language-theoretic example

Tree-adjoining grammars revisited

S ǫ Sna a S d b S∗ na c Abstract vocabulary : T, S : type A : T −

  • S

B : T −

  • T

C : T Lexicon : S := string T := string −

  • string

A := λf. f ǫ B := λg. λx. a + g (b + x + c) + d C := λx. x

Philippe de Groote (Inria) MPRI 2.27.1 2015-2016 36 / 41

slide-37
SLIDE 37

Abstract categorial grammars Expressive power

Syntax/semantics Interface

1

Compositionality

2

Context-free grammars Example Abstract syntax as heterogeneous algebra Homomorphism

3

Higher-order abstract syntax Higher-order signature Examples Higher-order homomorphism

4

Abstract categorial grammars Definition Generated languages Example Language-theoretic example Expressive power

Philippe de Groote (Inria) MPRI 2.27.1 2015-2016 37 / 41

slide-38
SLIDE 38

Abstract categorial grammars Expressive power

Abstract categorial hierarchy

Let G = Σ, Ξ, L, s. Define the order and the complexity of G:

  • rd(G) = max{ord(τΣ(c)) | c ∈ CΣ}.

comp(G) = max{ord(L(a)) | a ∈ AΣ}. Define: G(m, n) = {G | ord(G) ≤ m and comp(G) ≤ n} L(m, n) = {O(G) | G ∈ G(m, n)} For all m, n ≥ 1, L(m, n + 1) ⊂ L(m + 1, n). For all m, n ≥ 1, L(m + 3, n) ⊂ L(m + 2, n + 1).

Philippe de Groote (Inria) MPRI 2.27.1 2015-2016 38 / 41

slide-39
SLIDE 39

Abstract categorial grammars Expressive power

Second-order hierarchy of string languages

L(2, 1) regular languages L(2, 2) context-free languages L(2, 3) well-nested mildly context-sensitive languages L(2, 4) mildly context-sensitive languages L(2, 4 + n) L(2, 4)

Philippe de Groote (Inria) MPRI 2.27.1 2015-2016 39 / 41

slide-40
SLIDE 40

Abstract categorial grammars Expressive power

Membership

General case (Universal) membership is decidable if and only if the multiplicative-exponential fragment of linear logic is decidable. Lexicalized case (Universal) membership is NP-complete. Second-order case Universal membership is NP-complete, and membership is polynomial.

Philippe de Groote (Inria) MPRI 2.27.1 2015-2016 40 / 41