computational semantics: lab sessionsgjaeger/lehre/cg_ss00/cslab99pdf.pdf · computational...

Click here to load reader

Upload: others

Post on 22-May-2020

7 views

Category:

Documents


0 download

TRANSCRIPT

  • Computational semantics:Lab sessions

    Michael Moortgat

    Contents First Last Prev Next Back Close Quit

  • Contents

    1 Preliminaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 Session One . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

    2.1 Strategy 1: structural reasoning . . . . . . . . . . . . . . . . . . . . . . . 62.2 Strategy 2: lexical programs . . . . . . . . . . . . . . . . . . . . . . . . . . 7

    3 Session Two . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93.1 Scoping as a defined macro . . . . . . . . . . . . . . . . . . . . . . . . . . . 113.2 Decomposing the Scoping Constructor . . . . . . . . . . . . . . . . . 12

    4 Session Three . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164.1 Pied Piping: first approximation . . . . . . . . . . . . . . . . . . . . . . 174.2 Pied Piping: fine-tuning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

    1. PreliminariesReferences to information on the web assume the following base URL: http://www-uilots.let.uu.nl/staff/moortgat/ICG/. In order to run the courseware, you need somefiles from that URL, or from the web page for the course, ./compsem99.html.

    Computational semantics Contents First Last Prev Next Back Close Quit

    ./compsem99.html

  • manual.pdf the Grail2 manualcarp7.pdf Chapter 7 from Carpenter TLSproofs1.tex for formatting the outputproof.sty a style file for derivationscarpenter.pl our current fragmentcslab99.pdf this document

    You have obtained a student account icllnn on inzicht.let.uu.nl, the unix machinewhich runs the courseware. Running Grail for the first time (command grail at theunix prompt) creates directories fragments and tex in your home directory. In thefragments directory, you can save your work. The output of your parses is writtento the tex directory as the file eg.tex, which is consulted by proofs1.tex. If you wantto build a collection of parse trees, you can escape from Grail and save eg.tex underanother name.

    2. Session OneThis week we build a fragment covering data from TLS, sections 7.1 to 7.6, togetherwith material covered in class. We have seen that the grammatical base logic is

    Computational semantics Contents First Last Prev Next Back Close Quit

    ./carpenter.pl

  • not expressive enough to associate expressions with the readings we’d like to have:‘syntax’ is an obstacle that makes certain readings unavailable. We compare twostrategie to overcome these expressive limitations:

    • Structural reasoning. Structural positions that are inaccessible for binding canbe made accessible by means of structural rules.

    • Lexical meaning. Lexical meaning programs make it possible to adjust the se-mantic assembly to the syntactic configuration, or to express non-linear mean-ings.

    The fragment carpenter.pl already contains some type assignments and lexicalmeaning recipes that will make it easy for you to complete the fragment. Whenyou are ready with the assignments, save your work as lab1.pl in your fragmentsdirectory.

    Computational semantics Contents First Last Prev Next Back Close Quit

  • 1 everyone likes someone2 everyone doesn’t snore3 every kid played with some toy4 Jo thinks someone left5 Jo or some tall kid ran6 Francis likes Felix and every dog7 Francis likes every kid in some class8 Francis likes some kid in no class9 every kid in some class studied

    10 some kid in no class slept11 someone likes every toy in some store12 some kid who entered every event is tired13 every kid who entered some event received a ribbon14 Jo likes some movie which every student likes15 every kid who is in some class passes every exam

    Computational semantics Contents First Last Prev Next Back Close Quit

  • 2.1. Strategy 1: structural reasoning

    In the lexicon, you find GQ expressions like ’everyone’, ’somebody’ with meaningsof type (Ind −→ Bool) −→ Bool. A compatible type assignment in terms of thedirectional implications ’/’ and ’\’ suitable for occurrences of these expressions inthe subject position would be:

    everyone : s/(np\s)− ∀somebody : s/(np\s)− ∃

    What about non-subject occurrences of these GQs, for example the direct objectoccurrence of ’someone’ in (1a)? When you open the Postulates window of yourfragment, you’ll see that global Associativity postulates are active:

    P1 A • (B • C) a` (A •B) • C P2

    These postulates, in words, allow you to restructure a syntactic configuration asyou please, as long as you keep the linear order intact. With these postulates inforce, a second type assignment for expressions denoting functions of type (Ind −→Bool) −→ Bool is available — a type assignment that would be suitable for directobject occurrences:

    Computational semantics Contents First Last Prev Next Back Close Quit

  • everyone : (s/np)\s− ∀somebody : (s/np)\s− ∃

    Assuming Associativity and systematic lexical ambiguity for GQs (and, hence,for the determiners ’every’, ’some’), run the example sentences, and see whether youcan derive the desired readings.

    2.2. Strategy 2: lexical programs

    The above experiment will soon make it clear that this approach doesn’t express theappropriate generalizations. The combination of systematic subject/object lexicalambiguity and associativity postulates (i.e. loss of constituent sensitivity) is notenough to allow embedded GQs wide scope — GQs can only take scope from a (leftor right) peripheral position in their scoping domain.

    Let us explore an alternative strategy, which does not depend on structural rea-soning. Disable the Associativity postulates, and assign types to the GQs tailoredto the specific syntactic context. Provide lexical programs providing the requiredmeaning assembly.

    Computational semantics Contents First Last Prev Next Back Close Quit

  • illustration. Example (1a) is ambiguous: the subject or the object GQ canhave wide scope. An appropriate direct object type assignment for ’somebody’would be (remember: you don’t have any structural rules!):

    somebody : ((np\s)/np)\(np\s)

    With this type, ’somebody’ denotes a function of type

    (Ind −→ (Ind −→ Bool)) −→ (Ind −→ Bool)

    The task now is to find a lexical meaning denoting such a function. From thestructure of the type, we know that the overall format has to be

    λRλx.body

    where R and x are parameters of type (Ind −→ (Ind −→ Bool)) and Ind re-spectively, and body is of type Bool. Within body, we have to put together theparameters and the ‘primitive’ meaning of ’somebody’, ∃, in a way that is compat-ible with the type requirements:

    λRλx.(∃ λy.((R y) x))

    Computational semantics Contents First Last Prev Next Back Close Quit

  • Try out this combination of type assignment and lexical meaning, and checkwhich of the two readings for example (1) you obtain. Produce the second readingfollowing the same strategy: an ad hoc type assignment plus lexical meaning tailoredto this specific sentence/reading.

    3. Session TwoIn Friday’s lecture, we have introduced the Scoping Constructor A ⇑ B, and thegeneralized form q(A, B, C), and explained how these allow embedded GQs to takenon-local scope from arbitrary syntactic positions. As a result, one single typeassignment to GQs is adequate for their different syntactic roles: np ⇑ s (that is,q(np, s, s), in terms of q).

    On the WWW course page, you’ll find an updated version carpenter1.pl. Have alook at the postulate package: the associativity postulates are gone. Instead, thereis a package now for the Scoping Constructor (the NW postulates and their SEduals), and a package for the extraction operator ↑ (the right branch extractionpostulates MA and MC).

    Computational semantics Contents First Last Prev Next Back Close Quit

  • A • (B •nw C) ` B •nw (A • C) NW(A •nw B) • C ` A •nw (B • C) NWA •se (B • C) ` B • (A •se C) SEA •se (B • C) ` (A •se B) • C SE

    (A •B) • ♦C ` A • (B • ♦C) MA(A •B) • ♦C ` (A • ♦C) •B MC

    The definitions of the scoping and extraction operators are given below.

    q(A, B, C)df= (C/nw(A\seB)) •nw (A\seA)

    A ⇑ B df= q(A, B, B)

    A ↑ B df= A/♦2B

    Here are some of the more interesting lexical entries with their semantics.

    Computational semantics Contents First Last Prev Next Back Close Quit

  • everyone : np ⇑ s− 〈∀, λx.x〉someone : np ⇑ s− 〈∃, λx.x〉every : (np ⇑ s)/n− λx.〈(every2 x), λy.y〉some : (np ⇑ s)/n− λx.〈(some2 x), λy.y〉

    who : (n\n)/(np\s)− λxλyλz.(x z) ∧ (y z)who : (n\n)/(s/♦2np)− λxλyλz.(x z) ∧ (y z)whom : (n\n)/(s/♦2np)− λxλyλz.(x z) ∧ (y z)

    3.1. Scoping as a defined macro

    For a start, don’t try to understand how these structural inferences work exactly —simply take ⇑ and ↑ as defined macros, with the interpretation given in TLS Chapter7. Adapt your work on carpenter.pl to the new situation: provide appropriate typeassignments and derive the sample sentences. Save the result as lab2.pl in yourfragments directory.

    hints for displaying your results. At this point, you don’t want to bebothered by the definition of the ⇑ and ↑ operators in terms of the elementary

    Computational semantics Contents First Last Prev Next Back Close Quit

  • operators /, •, \,♦, 2. In the Options menu, choose for a format which keeps themacros in reduced form, and make the structural inferences implicit. Also, disablethe semantics for unary connectives in the Semantics menu.

    1. everyone likes somebody2. Jo thinks someome left3. every kid played with some toy4. every white dog barks5. every dog didnot bark6. Jo or some tall kid ran7. Francis likes himself and every dog8. Francis likes every kid in some class9. every kid in some class studied

    10. every kid who entered some event received a ribbon

    3.2. Decomposing the Scoping Constructor

    Let us have a closer look now at the definition of the Scoping Constructor, and thestructural inferences that go with it. Recall that for ⇑ types, we have the followingsemantic domains in mind:

    Computational semantics Contents First Last Prev Next Back Close Quit

  • DomA⇑B = (DomA −→ DomB) −→ DomB

    The generalized form of the scoping constructor q(A, B, C) doesn’t insist on theidentity of B — the binding domain for A — and C, the result of binding A in B.The denotation type for q(A, B, C), then, is

    Domq(A,B,C) = (DomA −→ DomB) −→ DomC

    A regular GQ can now be typed as np ⇑ s, in other words q(np, s, s), with

    Domnp⇑s = (Domnp −→ Doms) −→ Doms = (Ind −→ Bool) −→ Bool

    We would like to have the following Gentzen rule of use for the Scoping Con-structor:

    ∆[x : A] ⇒ u : B Γ[y : C] ⇒ t : DΓ[∆[z : q(A, B, C)]] ⇒ t[y/z(λx.u)] : D qL

    Can we define q(A, B, C) in terms of the primitive type forming operators insuch a way that the required structural and semantic behavior follows? Here’s a

    Computational semantics Contents First Last Prev Next Back Close Quit

  • multimodal definition, together with the structural inferences. The definition usesmodes •nw and •se, in addition to the regular composition mode •.

    q(A, B, C)df= (C/nw(A\seB)) •nw (A\seA)

    A • (B •nw C) ` B •nw (A • C) NW(A •nw B) • C ` A •nw (B • C) NWA •se (B • C) ` B • (A •se C) SEA •se (B • C) ` (A •se B) • C SE

    The formula q(A, B, C) is defined as a •nw product of a C/nw(A\seB) part and anidentity formula A\seA. The NW postulates allow the C/nw(A\seB) part to travelupward in a North-East direction to find its scope domain. At that point, an Ahypothesis is sent downward along a South-Eastern path. The hypothesis is caughtat the position of the original q(A, B, C) by the A\seA annihilator.

    The [qL] rule is a derived rule of inference for the defined q(A, B, C), as shownbelow.

    Computational semantics Contents First Last Prev Next Back Close Quit

  • A ⇒ A ∆[A] ⇒ B∆[A ◦se A\seA] ⇒ B∆[A\seA] ⇒ A\seB

    SEnΓ[C] ⇒ D

    Γ[C/nw(A\seB) ◦nw ∆[A\seA]] ⇒ D/nwL

    Γ[∆[(C/nw(A\seB)) ◦nw (A\seA)]] ⇒ DNW n

    Γ[∆[(C/nw(A\seB)) •nw (A\seA)]] ⇒ D•nwL

    Γ[∆[q(A, B, C)]] ⇒ Ddf

    The structural duality of the NW and the SE postulates is brought out nicelyin the following compact format. In the left-to-right direction, you read mode j asnw, in the right-to-left direction as se.

    SEj=se A • (B •j C) a` B •j (A • C) NWj=nwSEj=se (A •j B) • C a` A •j (B • C) NWj=nw

    For generalized quantifiers, the Scoping Constructor np ⇑ s (i.e. q(np, s, s)) isdefined as a product of a ‘regular’ GQ type s/(np\s) and an identity type np\np(omitting mode indices). The lexical semantics for a q(np, s, s) expression is a pair

    Computational semantics Contents First Last Prev Next Back Close Quit

  • of a regular GQ meaning for the s/(np\s) part, and the identity operation on npmeanings for the np\np part. For example,

    everyone : q(np, s, s)− 〈∀, λx.x〉

    lab. In the Options menu, make the structural inferences explicit, and runyour examples again. Try to understand why, in multiple GQ environments, theannihilator of one GQ cannot catch the hypothetical np of another GQ. Also, tryout which way derivability goes for

    q(np, s, s)?

    a` s/(np\s)

    Do you see what the consequences are for the typing of words that take GQarguments (for example, the higher-order doesn’t)? And for the conjunction ofsimple individuals (type np) with GQ’s?

    4. Session ThreeIn the previous sessions, you have been working with the Scoping Constructor A ⇑ B,and you have explored the range of scope phenomena this constructor accounts for.

    Computational semantics Contents First Last Prev Next Back Close Quit

  • What remains to be done, is to lift the scoping constructor to its full generality — ageneralization that dramatically widens the empirical range of this type constructor.Recall that semantically A ⇑ B is typed as (t(A) → t(B)) → t(B). The constructor,in other words, involves three subtypes: the bound expression A, the domain ofbinding B, and the result of binding A in its binding domain. In the case of A ⇑ B,binding domain and result are identified. In the generalized version of the scopingconstruct, this is no longer necessarily true: we write q(A, B, C) for the constructorbinding A in domain B with result C.

    alert: Carpenter writes q(C, B, A) for our q(A, B, C).

    In this Session, we look at Piep Piping to illustrate an application of the general-ized Scoping Constructor q(A, B, C) where B 6= C. We start with an approximation,and then gradually fine-tune our analysis.

    4.1. Pied Piping: first approximation

    In the the following examples, the noun ’book’ is modified by a relative clause (n\n).

    (1) a. book which Jo admires the author of

    Computational semantics Contents First Last Prev Next Back Close Quit

  • b. book the author of which Jo admires

    In (1a) the relative clause is headed by the relative pronoun ’which’, and thebody of the clause is a sentence from which we have withdrawn a np hypothesis.You have already encountered such relative clauses in Session One. An appropriatetype assignment and lexical program would be

    which : (n\n)/(s ↑ np)− λPλQλx.(Q x) ∧ (P x) (†)

    Example (1b) shows that there is an alternative way of realizing the relativeclause: rather than starting simply with the relative pronoun ’which’, there is abigger np phrase, containing the relative pronoun, that introduces the relative clause.Speaking metaphorically, let’s call the construction in (1a) extraction and thealternative in (1b) pied piping. There is a nice complementarity between (1a)and (1b) with regard to the interpretation of the np hypothesis in the body of therelative clause: in (1b) this is the full direct object of ’admire’, whereas in (1a), it isjust the object of the relational noun ’author’. (1a) and (1b) use exactly the samegrammatical resources, but they put them together in two different ways, yieldingone and the same reading — the reading you get from (†) above:

    Computational semantics Contents First Last Prev Next Back Close Quit

  • λx.(book x) ∧ ((admire (ι (author x)) jo) (‡)

    Of course, you could come up with an ad hoc extra type assignment and lexicalmeaning program for ’which’ in example (1b) to produce that result. (try it!)But it would be much nicer to have one lexical assignment/meaning that wouldcover Extraction and Piep Piping. With the Scoping Constructor q, this is indeedpossible. Consider the following type assignment:

    which : q(np, np, (n\n)/(s ↑ np)) (abbreviation: relpro)

    Operationally, this type will use a np hypothesis to derive a np, in order toproduce the relative pronoun type we saw in (†). What kind of semantic objectwould relpro denote? Recalling that

    Domq(A,B,C) = (DomA −→ DomB) −→ DomC

    we calculate

    Domrelpro = (Ind −→ Ind) −→ (Ind −→ Bool) −→ (Ind −→ Bool) −→ (Ind −→ Bool)np np s ↑ np n n

    Computational semantics Contents First Last Prev Next Back Close Quit

  • where you find the subtypes of the q formula under the relevant semantic domains.Assuming we want to derive the property intersection semantics for relative clauseswe saw in (‡), a compatible lexical meaning program would have the followingschematic form

    λWλPλQλx. . . .︸ ︷︷ ︸ ∧ . . .︸ ︷︷ ︸Bool Bool

    where

    W : Ind −→ IndP, Q : Ind −→ Bool

    x : Ind

    To find out how you can assemble the parts W , P , Q, x, have a look again at thetarget meaning (‡). In the meaning recipe for ’which’, you’d like to abstract awayfrom the specific lexical contributions of example (1b).

    λx.(book x) ∧ ((admire (ι (author x)) jo)

    The lambda term below does exactly that:

    λWλPλQλx.(Q x) ∧ (P (W x))

    Computational semantics Contents First Last Prev Next Back Close Quit

  • lab exercise. Adapt the relative pronoun lexical entries in your current versionof fragment carpenter1.pl in the light of what we saw above. The discussion abovedeals with the Pied Piping realization of the relative clause. Show that simpleExtraction of the relative pronoun, as in example (1a), can be obtained from thesame lexical entry you use for Pied Piping. Recall that our decomposition of typesq(A, B, C) is in fact a product type with factors C/(A\B) and A\A —hence thepair meaning with the identity function as second projection.

    which : relpro− 〈λWλPλQλx.(Q x) ∧ (P (W x)), λy.y〉

    4.2. Pied Piping: fine-tuning

    lab exercise. The discussion so far deals with Pied Piping cases with a np domain:the bigger phrase which the relative pronoun occurs in is a noun phrase. Theexamples below show that, apart from np, a number of other phrases can introducea relative clause in the Pied Piping construction: an prepositional complement (pp)in (2a), or a verb phase modifier (iv\iv) in (2b). Present type assignments for theseexamples. Do you have to change the lexical meaning programs?

    (2) a. author with whom Jo compares everyone

    Computational semantics Contents First Last Prev Next Back Close Quit

  • b. meeting during which everyone fell asleep

    c. *meeting which everyone fell asleep during

    Looking a bit more careful at (2b), we see a case here where the Pied Pipingrealization is OK, but where Extraction would be ungrammatical, as shown in (2c).Speaking metaphorically, one says that this type of modifiers are ’islands’ for Ex-traction. A direct way of imposing such an Island Constraint in type-logical terms,is to put a 2 lock on the type in question, as we have seen elsewhere. Try this outfor iv\iv, and figure out what the consequences are for (2b) and (2c). Do you see away of fine-tuning the type assignment for ’which’ in such a way that (2b) but not(2c) is derivable, without in general spoiling the prediction that where Pied Pipingis possible, simple Extraction is a possibility too?

    lab exercise. Returning to the case of Pied Piping in a np domain we dis-cussed in §4.1, we see that there is a need for some fine-tuning there too. Our typeassignment

    which : q(np, np, (n\n)/(s ↑ np))− λWλPλQλx.(Q x) ∧ (P (W x)) (♣)

    was motivated by examples like (1), where the definite determiner ’the’ (np/n)projects an individual denoting np. But look now at the examples below. Here we

    Computational semantics Contents First Last Prev Next Back Close Quit

    http://www-uilots.let.uu.nl/staff/moortgat/ICG/exercises.pdf#section.6

  • have Extraction/Pied Piping with full GQs, with (Ind −→ Bool) −→ Bool denota-tions.

    (3) a. writer a novel of whom every schoolboy knows

    b. writer whom every schoolboy knows a novel of

    Adjust the type assignment for ’which’ in (♣) such a way that it will cover theexamples of (1) as well as those of (3): replace the colored np subformulas by anappropriate GQ formula. This time, you will have to adapt the lexical meaningprogram too. You can follow the strategy of §4.1: compute the semantic domainwhere your new type will have to find its denotation, write down the skeletal formof the lexical lambda term, and then work out how you can assemble the parametersin the body of this lambda term.

    λWλPλQλx. . . .︸ ︷︷ ︸ ∧ . . .︸ ︷︷ ︸Bool Bool

    W : Ind −→?P : ? −→ BoolQ : Ind −→ Boolx : Ind

    Computational semantics Contents First Last Prev Next Back Close Quit

  • Discuss the scope readings you obtain for the examples. Do you think the deriv-able readings are all empirically justified? If not, do you see a way of fine-tuningthe type assignment?

    2

    Computational semantics Contents First Last Prev Next Back Close Quit

    PreliminariesSession OneStrategy 1: structural reasoningStrategy 2: lexical programs

    Session TwoScoping as a defined macroDecomposing the Scoping Constructor

    Session ThreePied Piping: first approximationPied Piping: fine-tuning