Real world uses of DFA,NFA,PDA and Turing machines
I am now taking a course on Theory of Computation. I can und开发者_开发技巧erstand the concepts well. I can able to solve the problems. And, when I asked my instructor about the real world application, he told me these concepts will be surely useful and essential in compiler design. But, at least to make a meaningful study, I need some explanations on how can I use those concepts it in my coding.
e.g. If I want to design my own grep. I will use string functions in C. I don't know how to use regular expressions there in coding.
Same case applies to Turing machines.
If I want to add two numbers why I have to go by those unary concepts. Does the hardware implement those concepts?
This article has a practical discussion of DFA and NFA as they apply to efficient regular expression matching. It discusses which real libraries use the efficient Thompson NFA method.
Turing machines are primarily practical as a definition of a computer. If someone tells me about a new language, I can check whether it's as powerful (not to be confused with ease of use) as say, C or Java by attempting to construct a Turing machine in it.
NFA and DFA: These two are used in compilers to create tokens from characters in the source file and return them to the grammar parser. You can learn more from the UNIX lex
and yacc
manual.
Turing Machines: I don't think this has a different use than its original academic purpose.
精彩评论