Newsgroups: comp.ai.nat-lang
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!news.mathworks.com!newshost.marcam.com!zip.eecs.umich.edu!umn.edu!giga.cs.umn.edu!dogru
From: dogru@giga.cs.umn.edu (Sait Dogru)
Subject: Re: Context Sensitivity
Message-ID: <D3Atr4.KJ8@news.cis.umn.edu>
Sender: news@news.cis.umn.edu (Usenet News Administration)
Nntp-Posting-Host: giga.cs.umn.edu
Organization: University of Minnesota, Twin Cities
References:  <447@mango.ukc.ac.uk>
Date: Wed, 1 Feb 1995 02:02:16 GMT
Lines: 82

In article <447@mango.ukc.ac.uk> A.M.L.Fowler@ukc.ac.uk (amlf) writes:
>
>             Help with Context Sensitivity
>             -----------------------------
>
>Can someone give me a proper definition for a context sensitive grammar?
>
  Context-sensitive languages are a superset of the context-free
  ones.  A context-sensitive grammar allows more than one symbol on
  the left-hand side of the rules, unlike the context-free ones,
  which only allow for one nonterminal symbol on the left.  The
  multiple symbols on the left basically define a *context* for the
  rule in which the rule can apply (and, hence the name).  There is 
  also the restriction that the right-hand side be at least as long
  as the left-hand side.

>I've just read Michael Covington's book on NLP for Prolog and he says
>that context sensitive rules are rarely used in natural language
>analysis because they are potentially too complicated and do not lend
>themselves to a straightforward parsing algorithm.
>
  Mr. Covington is right in that context-sensitivity is primarily
  used to ensure global (i.e., involving more than one rule)
  constraints on the language.  However, with context-sensitive
  grammars, your grammar gets extremely large and complicated.
  (Note that you can achieve the same constraints in a CFG with 
  features/parameters/etc. very succinctly.)

>He gives an example of a NounPhrase expanding to a Determiner + a Noun,
>but only when preceeded by a Preposition - which is obviously a
>contrived example.
>

  Here is a similar example enforcing agreement within a noun phrase.
  For example, "a dog" is acceptable, but "a dogs" or "the two dog" 
  are not.  The terminals are a, the, dog, and dogs.  I have put an
  apostrophe (') after those nonterminals that make the grammar
  context-sensitive.  Notice that the grammar doesn't have explicit rules
  for such nonterminals.  They are generated for the other rules to apply
  and they all disappear if the parse is successful.  

  np --> art number noun

  art singular' --> a singular'
  art singular' --> the singular'
  art plural'   --> the plural'

  number        --> a singular'
  number        --> two plural' 

  singular' noun --> dog
  plural'   noun --> dogs

>However, I have read another text recently which states that a DCG
>that copes with inflection/case-marking etc. *is* context sensitive.
>
  Probably not.  But I will have to see the grammar rules to be
  sure.  It largely depends on how you handle inflection/case/etc. 
  
  The above info is mainly from AI and the Design of Expert Systems
  by George Luger and William Stubblefield.  (All this is from memory, 
  you should check the book for more info and a larger
  context-sensitive grammar.)  There is also another book that talks
  about context-sensitivity but I don't remember the title or the author 
  (Computational Linguistics...(?) by Grisham? or Grishmann???).

  Hope this helped,

  Sait
  dogru@cs.umn.edu



>I think that Covington is right here and the other author is not,
>but I would like another opinion.
>
>Also, if Covington is right, can anyone provide an example which actually
>is true of English Grammar?
>
>Many thanks,
>Aliy
>
