1 CISC/CMPE 223, Winter 2023, Alphabets, strings and languages Introduction to the course topics The course covers a variety of topics dealing with finite state machines, regular expressions, grammars and program verification, as well as, an introduction to the theoretical limits of algorithmic computation. The relationship between programs and formal languages provides an example of the impact of theory on practice. Uses of formal theory include the following: · grammars are used in lexical and parsing stages of compiler construction · use of regular expressions in text editors · state-charts in object-oriented modeling · circuit-design · DNA and protein sequence matching: regular expression matching algorithms On the other hand, theory acts also as an "early warning system" by providing a science of the impossible: · what should not be attempted because it is impossible (or provably too costly) A fundamental question in computing is whether there exist tasks/problems that, even in principle, cannot be solved algorithmically and, if yes, which tasks are algorithmically solvable and which are not. In fact, it can be established that the number of different computational problems is larger than the number of all possible programs (in some pro- gramming language such as Java or C), which means that there must exist problems that are not solvable by any program (or by any algorithm). Note that the number of programs is infinite, and to show that the number of computa- tional problems is larger, we need to compare the sizes of different infinite numbers.
CISC/CMPE 223, Winter 2023, Alphabets, strings and languages 2 - Figure 1: Example of an uncomputable problem. In this course we use a different approach. Using a technique called diagonalization we establish that certain specific (and "useful") computational problems cannot be solved by any program written in the language C. The most well-known example of an unsolvable problem is the so called halting problem that asks whether an arbitrary program given as input terminates. Example. A program with behavior as depicted in Figure ?? does not exist! However, having an algorithm A for a computational problem P does not mean that P is solvable in practice. It might be the case that for inputs of moderate size A would need more time than the age of the universe, even when executed on modern computers ... These observations can be summarized as a coarse classification of algorithmic problems/functions: 1. Non-computable problems (that is, even in principle impossible to solve using an algo- rithm/a computer) 2. Possible-with-unlimited-resources BUT impossible-with-limited-resources 3. Possible-with-limited-resources: these are the problems "solvable in practice" Typical questions we can consider:
CISC/CMPE 223, Winter 2023, Alphabets, strings and languages 3 · Program existence: Does there exist a program for a given algorithmic problem (or function)? · Software specification: How should programs be specified? · Software validation: Is a given program correct, i.e., does it satisfy the specification? · Software construction: How is a correct program obtained? · Semantics: What does a given program do? (this is related to correctness) · Efficiency: Is