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 1 Context-free grammars 2 Example Abstract syntax as heterogeneous algebra Homomorphism Higher-order abstract syntax 3 Higher-order signature Examples Higher-order homomorphism Abstract categorial grammars 4 Definition Generated languages Example Language-theoretic example Expressive power Philippe de Groote (Inria) MPRI 2.27.1 2015-2016 2 / 41
Compositionality Syntax/semantics Interface Compositionality 1 Context-free grammars 2 Example Abstract syntax as heterogeneous algebra Homomorphism Higher-order abstract syntax 3 Higher-order signature Examples Higher-order homomorphism Abstract categorial grammars 4 Definition Generated languages Example Language-theoretic example Expressive power Philippe de Groote (Inria) MPRI 2.27.1 2015-2016 3 / 41
Compositionality Compositionality Compositionality principle The meaning of a complex expression is determined by the meanings of 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
Context-free grammars Syntax/semantics Interface Compositionality 1 Context-free grammars 2 Example Abstract syntax as heterogeneous algebra Homomorphism Higher-order abstract syntax 3 Higher-order signature Examples Higher-order homomorphism Abstract categorial grammars 4 Definition Generated languages Example Language-theoretic example Expressive power Philippe de Groote (Inria) MPRI 2.27.1 2015-2016 5 / 41
Context-free grammars Example Syntax/semantics Interface Compositionality 1 Context-free grammars 2 Example Abstract syntax as heterogeneous algebra Homomorphism Higher-order abstract syntax 3 Higher-order signature Examples Higher-order homomorphism Abstract categorial grammars 4 Definition Generated languages Example Language-theoretic example Expressive power Philippe de Groote (Inria) MPRI 2.27.1 2015-2016 6 / 41
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
Context-free grammars Abstract syntax as heterogeneous algebra Syntax/semantics Interface Compositionality 1 Context-free grammars 2 Example Abstract syntax as heterogeneous algebra Homomorphism Higher-order abstract syntax 3 Higher-order signature Examples Higher-order homomorphism Abstract categorial grammars 4 Definition Generated languages Example Language-theoretic example Expressive power Philippe de Groote (Inria) MPRI 2.27.1 2015-2016 8 / 41
Context-free grammars Abstract syntax as heterogeneous algebra Signature associated to a CFG Context free grammar: S → NP VP ( p 1 ) VP → tV NP ( p 2 ) tV → loves ( p 3 ) NP → John ( p 4 ) NP → somebody ( p 5 ) Associate a sort to each non-terminal, and an operator to each production rule: p 1 : NP × VP → S p 2 : tV × NP → VP p 3 : tV p 4 : NP p 5 : NP Philippe de Groote (Inria) MPRI 2.27.1 2015-2016 9 / 41
Context-free grammars Homomorphism Syntax/semantics Interface Compositionality 1 Context-free grammars 2 Example Abstract syntax as heterogeneous algebra Homomorphism Higher-order abstract syntax 3 Higher-order signature Examples Higher-order homomorphism Abstract categorial grammars 4 Definition Generated languages Example Language-theoretic example Expressive power Philippe de Groote (Inria) MPRI 2.27.1 2015-2016 10 / 41
Context-free grammars Homomorphism Syntactic and semantic algebras Syntactic algebra: p 1 : NP × VP → S p 2 : tV × NP → VP p 3 : tV p 4 : NP p 5 : NP Semantic algebra: : NP ∗ × VP ∗ → S ∗ f 1 ( a, b ) = a b f 2 ( a, b ) = λx. b ( λy. a y x ) : tV ∗ × NP ∗ → VP ∗ : tV ∗ f 3 = λy. λx. love x y : NP ∗ f 4 = λk. k j : NP ∗ f 5 = λk. ∃ y. k y Philippe de Groote (Inria) MPRI 2.27.1 2015-2016 11 / 41
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
Higher-order abstract syntax Syntax/semantics Interface Compositionality 1 Context-free grammars 2 Example Abstract syntax as heterogeneous algebra Homomorphism Higher-order abstract syntax 3 Higher-order signature Examples Higher-order homomorphism Abstract categorial grammars 4 Definition Generated languages Example Language-theoretic example Expressive power Philippe de Groote (Inria) MPRI 2.27.1 2015-2016 13 / 41
Higher-order abstract syntax Higher-order signature Syntax/semantics Interface Compositionality 1 Context-free grammars 2 Example Abstract syntax as heterogeneous algebra Homomorphism Higher-order abstract syntax 3 Higher-order signature Examples Higher-order homomorphism Abstract categorial grammars 4 Definition Generated languages Example Language-theoretic example Expressive power Philippe de Groote (Inria) MPRI 2.27.1 2015-2016 14 / 41
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
Higher-order abstract syntax Examples Syntax/semantics Interface Compositionality 1 Context-free grammars 2 Example Abstract syntax as heterogeneous algebra Homomorphism Higher-order abstract syntax 3 Higher-order signature Examples Higher-order homomorphism Abstract categorial grammars 4 Definition Generated languages Example Language-theoretic example Expressive power Philippe de Groote (Inria) MPRI 2.27.1 2015-2016 16 / 41
Higher-order abstract syntax Examples Trees p 1 : NP → VP → S p 2 : tV → NP → VP p 3 : tV p 4 : NP p 5 : NP Philippe de Groote (Inria) MPRI 2.27.1 2015-2016 17 / 41
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
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
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
Higher-order abstract syntax Higher-order homomorphism Syntax/semantics Interface Compositionality 1 Context-free grammars 2 Example Abstract syntax as heterogeneous algebra Homomorphism Higher-order abstract syntax 3 Higher-order signature Examples Higher-order homomorphism Abstract categorial grammars 4 Definition Generated languages Example Language-theoretic example Expressive power Philippe de Groote (Inria) MPRI 2.27.1 2015-2016 21 / 41
Higher-order abstract syntax Higher-order homomorphism Definition Given two higher-order signatures Σ 1 = � A 1 , C 1 , τ 1 � and Σ 2 = � A 2 , C 2 , τ 2 � , a higher-order homomorphism H = � η, θ � from Σ 1 to Σ 2 is generated by two functions: η : A 1 → T ( A 2 ) , θ : C 1 → Λ(Σ 2 ) , such that − Σ 2 θ ( c ) : ˆ η ( τ 1 ( c )) . where ˆ η is the homomorphic extension of η , i.e.: η ( a ) = η ( a ) , for a ∈ A 1 . ˆ η ( α → β ) = ˆ ˆ η ( α ) → ˆ η ( β ) . Philippe de Groote (Inria) MPRI 2.27.1 2015-2016 22 / 41
Abstract categorial grammars Syntax/semantics Interface Compositionality 1 Context-free grammars 2 Example Abstract syntax as heterogeneous algebra Homomorphism Higher-order abstract syntax 3 Higher-order signature Examples Higher-order homomorphism Abstract categorial grammars 4 Definition Generated languages Example Language-theoretic example Expressive power Philippe de Groote (Inria) MPRI 2.27.1 2015-2016 23 / 41
Recommend
More recommend