Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!oliveb!apple!claris!hearn From: hearn@claris.com (Bob Hearn) Newsgroups: comp.lang.misc Subject: Re: Language Design Message-ID: <9140@claris.com> Date: 22 Mar 89 20:14:56 GMT References: <9122@claris.com> <2970@goofy.megatest.UUCP> Reply-To: hearn@claris.com (Bob Hearn) Organization: Claris Corporation, Mountain View CA Lines: 43 In article <2970@goofy.megatest.UUCP> djones@megatest.UUCP (Dave Jones) writes: >The term "context-free", as Chomsky defined it is not very useful >to us computer types, because no one ever, ever writes grammars any >other way. To him, "context-free" meant that a rule could only >have one symbol on the left-hand side. "Context-sensitive" meant that >production rules could have strings of symbols on the left: > > a X b <= a x y b > >In the above, the a and b form a "context" for the reduction >X <= xy. Precisely! But, gee... I've considered myself a computer type for, oh, 12 years or so, and it's useful to me. How you write grammars depends on what you're going to use the grammars for. I don't think anyone could write a compiler, for example, without being at least familiar with terms of formal language theory like "context-free" and "context-sensitive." > >I haven't been following the discussion, but I suspect that the >correspondents were not alluding to the unuseful Chomsky definitions, >but instead were using the terms quite literally: "context-free" meaning >"context-free". I think that is a perfectly reasonable thing to >do, especially if one is unfamiliar with the confusing Chomsky >definition. (I never did like the practice of "defining" something >that already had a meaning in normal English.) If you *had* been following the discussion, you'd have seen that my original posting was a followup to someone complaining about how screwed-up C's grammar was, that it wasn't context-free. When someone uses the words "context-free" and "grammar" in the same sentence, I assume he knows what he's talking about, and what he said was incorrect... K&R's grammar for C *is* CF, and not particularly screwed-up. I've received no end of mail and flames for that simple correction! As for "context-free" already having a meaning in normal English, I disagree. One could say that you need context to parse C, but if you use the phrase "context-free" in the realm of computer science, it's because you've heard it before, and you should find out what it means before using it. Bob Hearn hearn@claris.com P.S. I'll chill when I stop getting flamed.