Preview

Finite Automata

Powerful Essays
Open Document
Open Document
26011 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Finite Automata
C

H

A

P

T

E

R

Finite-State Machines and Pushdown Automata

The finite-state machine (FSM) and the pushdown automaton (PDA) enjoy a special place in computer science. The FSM has proven to be a very useful model for many practical tasks and deserves to be among the tools of every practicing computer scientist. Many simple tasks, such as interpreting the commands typed into a keyboard or running a calculator, can be modeled by finite-state machines. The PDA is a model to which one appeals when writing compilers because it captures the essential architectural features needed to parse context-free languages, languages whose structure most closely resembles that of many programming languages. In this chapter we examine the language recognition capability of FSMs and PDAs. We show that FSMs recognize exactly the regular languages, languages defined by regular expressions and generated by regular grammars. We also provide an algorithm to find a FSM that is equivalent to a given FSM but has the fewest states. We examine language recognition by PDAs and show that PDAs recognize exactly the context-free languages, languages whose grammars satisfy less stringent requirements than regular grammars. Both regular and context-free grammar types are special cases of the phrasestructure grammars that are shown in Chapter 5 to be the languages accepted by Turing machines. It is desirable not only to classify languages by the architecture of machines that recognize them but also to have tests to show that a language is not of a particular type. For this reason we establish so-called pumping lemmas whose purpose is to show how strings in one language can be elongated or “pumped up.” Pumping up may reveal that a language does not fall into a presumed language category. We also develop other properties of languages that provide mechanisms for distinguishing among language types. Because of the importance of context-free languages, we examine how they are parsed, a key step in

You May Also Find These Documents Helpful

  • Good Essays

    In this phase a token is generated against all the lexemes in the source code. These lexemes and tokens are stored in the Symbol Table. Tokens against the lexemes are generated based on some patterns or rules.…

    • 703 Words
    • 3 Pages
    Good Essays
  • Good Essays

    The first language and its rules I will describe is Visual Basic. Visual Basic has a few different rules and they are described on Microsoft’s website in a document. This document is called (“Visual Basic Naming Rules”) and they read as such:…

    • 878 Words
    • 4 Pages
    Good Essays
  • Satisfactory Essays

    unit 6

    • 360 Words
    • 2 Pages

    3) A declarative language is a language in which you tell the computer what to do not how.…

    • 360 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    pt1420 exam review

    • 738 Words
    • 3 Pages

    What is used to translate high level language programs to machine language (or machine code)? Compiler…

    • 738 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    Lab 7 Student

    • 1242 Words
    • 7 Pages

    This lab accompanies Chapter 5 (pp. 163-183 and pp. 196-201) of Starting Out with Programming Logic & Design.…

    • 1242 Words
    • 7 Pages
    Satisfactory Essays
  • Good Essays

    Concept Programing

    • 443 Words
    • 3 Pages

    3. (15%) Design a state diagram to recognize one form of the comments of the C-based programming languages,…

    • 443 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    William Stokoe Timeline

    • 479 Words
    • 2 Pages

    1957- Stokoe receives a research grant from the American Council of Learned Societies to begin analyzing ASL as a language. Two years later, The National Science Foundation continued the funding for his study. 1-2…

    • 479 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    Part of Speech Recognizer

    • 3200 Words
    • 13 Pages

    References: [1] S. L. Abebe and P. Tonella. Natural language parsing of program element names for concept extraction. In 18th IEEE International Conference on Program Comprehension. IEEE, 2010. [2] K. Atkinson. Spell checking oriented word lists (scowl). [3] E. Boschee, R. Weischedel, and A. Zamanian. Automatic information extraction. In Proceedings of the International Conference on Intelligence Analysis, 2005. [4] B. Caprile and P. Tonella. Restructuring program identifier names. In ICSM, 2000. [5] ML Collard, HH Kagdi, and JI Maletic. An XML-based lightweight C++ fact extractor. Program Comprehension, 2003. 11th IEEE International Workshop on, pages 134–143, 2003. [6] E. Høst and B. Østvold. The programmer’s lexicon, volume i: The verbs. In International Working Conference on Source Code Analysis and Manipulation, Beijing, China, September 2008. [7] E. W. Høst and B. M. Østvold. Debugging method names. In ECOOP 09. Springer Berlin / Heidelberg, 2009. [8] J. Jiang and C. Zhai. Instance weighting for domain adaptation in nlp. In ACL 2007, 2007. [9] D. Lawrie, D. Binkley, and C. Morrell. Normalizing source code vocabulary. In Proceedings of the 17th Working Conference on Reverse Engineering, 2010. [10] L. Shen, G. Satta, and A. K. Joshi. Guided learning for bidirectional sequence classification. In ACL 07. ACL, June 2007. [11] D. Shepherd, Z. P. Fry, E. Hill, L. Pollock, and K. Vijay-Shanker. Using natural language program analysis to locate and understand action-oriented conerns. In AOSD 07. ACM, March 2007. [12] K. Toutanova, D. Klein, C. Manning, and Y. Singer. Feature-rich part-of-speech tagging with a cyclic dependency network. In HLTNAACL 2003, 2003.…

    • 3200 Words
    • 13 Pages
    Good Essays
  • Powerful Essays

    Homework 2

    • 1897 Words
    • 8 Pages

    3. How do type declaration statements for simple variables affect the readability of a language?…

    • 1897 Words
    • 8 Pages
    Powerful Essays
  • Good Essays

    pt1420 assignment 1

    • 728 Words
    • 3 Pages

    Programming language is a vital and essential part of computers. Even though you do not actually see these languages, they are the bases and make up of software programs. Software is essential to a computer because without software, a computer can do nothing. All of the software that we use to make our computers useful is created by individuals known as programmers; these programmers use different types of programming languages to develop software programs. The first primitive programming language was actually created for the invention of the ‘difference engine’. This invention created in 1822 by Charles Babbage was a mechanical calculator that would tabulate polynomial functions.…

    • 728 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    Regular Expression

    • 322 Words
    • 2 Pages

    Identify the lexeme that makes up the tokens in the following programs. Give reasonable attribute vcalues for the tokens.…

    • 322 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Finite State Machines

    • 567 Words
    • 3 Pages

    We need use 3 D flip flops to build the circuit. From the state table, We can see when L is 1 and Q1,Q2,Q3 are 0, D1 is 1. So we can get D1=Q1'Q2'Q3' L. D2 and D3 can be find out by using the same method.…

    • 567 Words
    • 3 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Automata, DFA

    • 406 Words
    • 4 Pages

    of two simpler languages. Construct DFA’s for the simpler languages and then combine them using the idea of a product automaton to obtain a DFA that accepts L.…

    • 406 Words
    • 4 Pages
    Satisfactory Essays
  • Good Essays

    Assembly Language

    • 1139 Words
    • 5 Pages

    Compiler languages are the high-level equivalent of assembly language. Each instruction in the compiler language can correspond to many machine instructions. Once the program has been written, it is translated to the equivalent machine code by a program called a compiler. Once the program has been compiled, the resulting machine code is saved separately, and can be run on its own at any time.…

    • 1139 Words
    • 5 Pages
    Good Essays
  • Powerful Essays

    Structure of Compiler

    • 1758 Words
    • 8 Pages

    Almost all modern compilers are syntax-directed: The compilation process is driven by the syntactic structure of the source program. A parser builds semantic structure out of tokens, the elementary symbols of programming language syntax. Recognition of syntactic structure is a major part of the analysis task.…

    • 1758 Words
    • 8 Pages
    Powerful Essays