Newsgroups: comp.ai.nat-lang
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!news.mathworks.com!zombie.ncsc.mil!news.duke.edu!godot.cc.duq.edu!hudson.lm.com!news.pop.psu.edu!psuvax1!news.ecn.bgu.edu!chicagokent.kentlaw.edu!iitmax!sanders
From: sanders@iitmax.iit.edu (Greg Sanders)
Subject: Re: Context Sensitivity
Message-ID: <1995Jan31.044252.30778@iitmax.iit.edu>
Organization: Illinois Institute of Technology / Academic Computing Center
References: <447@mango.ukc.ac.uk>
Date: Tue, 31 Jan 95 04:42:52 GMT
Lines: 42

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?

Well, I hope I remember this correctly.  Suppose we have rewrite rules
where the left-hand side can be replaced by the right-hand side.  Here's 
an example of a rewrite rule meaning a NP may consist of a determiner 
followed by a noun.
     NP ::= <Determiner> <Noun>

If the left-hand side of a rule has more than one symbol, and at least one 
of the symbols is not expandable by any other rewrite rule, then that symbol
constitutes "context."  More simply (although less informatively), a
grammar is context sensitive (or a subset thereof) as long as the number
of symbols on the left-hand side of each rule is less than or equal to the 
number of symbols on its right-hand side.  (Hoping against hope that I
have not screwed this up)

The significance of context-sensitive grammars is that some strings
(sentences) cannot be generated by any less powerful grammar.  For
example, sentences consisting of the same string repeated twice
      xyzxyz
or sentences with the same number of each of three symbols, of which
     xyz, xxyyzz, xxxyyyzzz, and xxxxyyyyzzzz are examples.
 
The "respectively" construction appears to me to be context sensitive.
     John, Bill, and Sally ate ice-cream, candy, and peanuts, respectively.

Swiss German is considered to require a context sensitive grammar for one
construction, if I remember correctly, but the details slip my mind.

With some work, essentially all of English can be described with a context-
free grammar, but context-sensitive grammars are often more convenient for
descriptive purposes.

 -- Greg Sanders
    gsanders@nimue.hood.edu
  

