hy Study the Theory of Computation?
Applications of the Theory
- FSMs for parity checkers, vending machines, communication protocols, and building security devices.
- Interactive games as nondeterministic FSMs.
- Programming languages, compilers, and context-free grammars.
- Natural languages are mostly context-free
- Speech understanding systems use probabilistic FSMs.
- Computational Biology - DNA and proteins are strings
- The undecidability of a simple security model
- Artificial intelligence - the undecidability of first-order logic
Languages and Strings
Symbols/Characters - Members of the alphabet
String - Finite sequence of characters from the alphabet
- Empty String
- Set of all strings (Sigma with an asterix)
- Number of symbols in s
Example - or
Single Framework for Problem Analysis - Language Recognition
Language - Set of finite (possibly infinite) length strings over a finite alphabet.
Example: Code Problem
int alpha, beta;
alpha = 3;
beta = (2+5)/10;
Methods of Solving
1 Lexical Analysis
Break up the problem into variable names, numbers etc.
Create a tree to represent the sequence of operations that should be executed.
The above example is shown in tree form below
Optimize information that isn't valuable to the solution.
For the above example, although alpha is defined to be 3, it's never actually used. Beta is found using only constants and so can be solved on its own.
Decide whether the program is guaranteed to halt or not.
Figure out the use of the function/codde