PLT: Lecture 8 - PowerPoint PPT Presentation

1 / 13
About This Presentation
Title:

PLT: Lecture 8

Description:

Generated some simple grammars for covering some simple English instances ... in a heated discussion on the wave/particle duality of matter or the neo-realist ... – PowerPoint PPT presentation

Number of Views:59
Avg rating:3.0/5.0
Slides: 14
Provided by: deptSc7
Category:
Tags: plt | lecture

less

Transcript and Presenter's Notes

Title: PLT: Lecture 8


1
PLT Lecture 8
  • Generative Grammars

2
Last Lecture
  • Described Chomskys adaptations to Posts
    Production Systems
  • Generated some simple grammars for covering some
    simple English instances (Discuss)
  • Gave a formal definition of a generative grammar

3
Phase Structure, Generative Grammars
  • 4-tuple VT, VN, P, S
  • VT
  • VN
  • VN n VT
  • P binary relations called productions or re-write
    rules
  • Domain V x VN X V
  • Codomain V
  • Eventually some rules of type
  • Domain -gt VT
  • S element of VN

4
Conventions
  • Individual terminal symbols a,b,ct
  • Strings of terminal symbols u,v,w,x,y,z
  • Individual non-terminals A,B,X,Y,Z //
    includes S
  • Strings that may contain terminal and
    non-terminal symbols a, b, , w
  • p e P (a, b)
  • a -gt b, yat -gt ybt

5
Trivial Generation Example
  • G(0,1, S, S-gt0S1,S-gt01, S)
  • a1S, b10S1
  • a2S, b201
  • Generation
  • Start string is S
  • t and y are
  • Applying P1, new a, t, y
  • Reapplying P1
  • Eventual application of P2
  • More generally,
  • If G is a grammar, a, b e of V, p e G.P such
    that a-gtb, we can say a-gtb

6
Sentential Forms and Language Instances
  • Sentential forms
  • Let S be the start symbol for Grammar G
  • S e V gt S e V
  • If a is derivable from S (Sgt a) then a is a
    sentential form of G
  • Written SF(G)
  • Language Instance
  • Sentential form made up of only VT
  • Written L(G)
  • L(G) subset of SF(G)

7
Prove L(G) ww0n1n n gt 0
  • Let P(n) be equivalent to Sgt0nS1n
  • P(0) holds (Sgt00S10 (P1)), SgtS
  • Assume P(n) holds Sgt0nS1n
  • Show for P(n1)
  • Sgt00nS11n (P1)
  • Sgt0n1S1n1
  • Keeping Sgt01 as the final substitution

8
A More Complex Grammar
  • Grammar
  • S-gt aSBC
  • S-gt aBC
  • CB-gtBC
  • aB-gt ab
  • bB-gt bb
  • bC-gtbc
  • cC -gt cc
  • Observations
  • Generate aaaabbbbcccc

9
Classifying Grammars
  • Unrestricted Grammars
  • a -gt b
  • Otherwise no restrictions
  • Context Sensitive Grammars
  • a -gt b
  • a !gt b
  • Context Free Grammars
  • A-gt b
  • Regular Grammars
  • A-gtaB
  • A-gta

10
The Drunkards Lament
  • On Thursday nights, a panic strikes the stables
    bar, a place to which students withdraw, in order
    to enhance their unhealthy pallor prior to
    visiting home for the weekend to look for
    sympathy, food, laundry services, and cash.
  • The crowds mill around the bar. There is a
    communal terror that the bar may run dry. All
    able bodied men and women re-double their efforts
    to get what they are convinced is the very last
    pint to emerge from the taps.
  • Some unscrupulous individuals know no difference
    between meum and tuum. These people keep their
    eyes open for pints which may be neglected
    because-
  • Their owners are engaged in a heated discussion
    on the wave/particle duality of matter or the
    neo-realist school of painting(unlikely), or
  • Their owners have gone to fetch another pint
  • Their owners having had alcohol affect their
    anti-diuretic hormone now badly need to reduce
    their liquidity.
  • Whatever the reason, it is truly heartrending to
    see their distress when the loss of the loved
    object is discovered. Many of them break into a
    lament, whose grammatical structure is now being
    studied keenly by linguists because of its simple
    yet highly effective poetic structure.

11
The Drunkards Lament
  • Instances
  • Some dirty swine stole my drink
  • A pig stole my drink
  • A lousy rat took my drink
  • A rotten lousy dirty rat swiped my drink
  • The lousy dirty rotten swine took my drink
  • Try to make a Context Free Grammar out of it
  • Try to make a Regular Grammar out of it.

12
Drunkards Lament CF Grammar
  • ltLamentgt-gt ltArticlegtltAdjstuffgtltNoungtltVerbgt my
    drink
  • ltArticlegt-gtSome A The
  • ltAdjstuffgt-gtltAdjgtltAdjstuffgt
  • ltAdjstuffgt-gtltAdjgt
  • ltAdjstuffgt-gt l
  • ltAdjgt-gt rotton lousy dirty
  • ltNoungt-gt swine pig rat
  • ltVerbgt-gt took swiped stole

13
Drunkards Lament Regular Grammar
  • ltLamentgt-gt Some ltRestOfStuffgt
  • ltLamentgt-gt A ltRestOfStuffgt
  • ltLamentgt-gt The ltRestOfStuffgt
  • ltRestOfStuffgt-gtrotton ltRestOfStuffgt
  • ltRestOfStuffgt-gtlousy ltRestOfStuffgt
  • ltRestOfStuffgt-gtdirty ltRestOfStuffgt
  • ltRestOfStuffgt-gtswine ltVerbObjectgt
  • ltRestOfStuffgt-gtpig ltVerbObjectgt
  • ltRestOfStuffgt-gtrat ltVerbObjectgt
  • ltVerbObjectgt-gttook ltObjectgt
  • ltVerbObjectgt-gtswiped ltObjectgt
  • ltVerbObjectgt-gtstole ltObjectgt
  • ltObjectgt-gt my ltDrinkWordgt
  • ltDrinkwordgt-gt drink
Write a Comment
User Comments (0)
About PowerShow.com