Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How should Chomsky's Hierarchy and Turing Machines influence language design?

I'm currently studying for a discrete mathematics test in which we are learning Chomsky's hierarchy and the type of automatas that recognize each level of the hierarchy. I'm being taught that most computer languages fall within "level 2 and 1" of the hierarchy, but not precisely how.

My questions are:

  1. What features belong to each level?

  2. Is this nothing more than theoretical basis? I'm wondering if language designers like Dennis Ritchie and James Gosling had to go into this considerations when designing C and Java. Do they? How would someone apply this?

  3. We are being told that Turing Machines recognize the level 0 of the hierarchy. If so, are there any language features that belong to level 0? I'm guessing that this may be natural language processing, is it?

like image 446
andandandand Avatar asked Jun 14 '09 15:06

andandandand


1 Answers

  1. None. Level 1 includes Level 2. Maybe I misunderstood you, so to be complete:

    • Regular Languages are used within Regular Expression Matching. Colloquial: DFAs can not count. And you need to count if you want to match brackets. [Level 3]
    • Language Syntax is normally a Context Free Language. See 2) [Level 2]
    • Context Sensitive Language are used only theoretically. See 3) [Level 1]
  2. It helps in designing lexers and parsers. I do not know if the creators of C thought about that, but Java, certainly. Parser Generator

  3. Turing Machines calculate anything that can be calculated. "Can be calculated" is even defined as: Can be accepted by a Turing Machine. This includes, of course, natural language processing. Anything above Level 2 is not very useful for language generation, because a program reading such inputs may not stop (Word Problem can no longer be solved).

like image 180
ebo Avatar answered Oct 18 '22 10:10

ebo