A SUBSET OF THE URM LANGUAGE; FA AND NFA
This chapter is presented for enhanced completeness of coverage, but is a mostly “how to” chapter, rather than one that poses and answers fundamental questions on the limitations of computing, 110 the latter being our central theme in this volume. Nevertheless, concepts and tools developed here are usable in the theory and practice of compiler writing, a principal area of application.
We will first introduce informally a modified and restricted URM. This new URM model will have explicit “read” instructions. 111
Secondly, any specific URM under this model will only have one variable that we may call generically “x”. This variable will always be of type digit; it cannot hold arbitrary integers, rather it can only hold digits as values. It has no stop instruction, nor instructions for adding/subtracting.
Pause. In the absence of a stop instruction, how does a computation halt? We postulate that our modified URMs halt simply by reading something unexpected , that is, an object that is not a member of the input alphabet of permissible digits. Such an illegal symbol serves as an end-marker of the useful stream digitss that constitute the input string over the given alphabet. As such it is often called an “end-of-file” marker, for short, eof .
Thus the modified URM halts if it runs out of input.
We next modify the permissible instructions of 2.1.1 , displayed on p. 93. The only permissible instructions now is of the following type that we at first force into a “high level” programming language format, not aiming for elegance; we will achieve the latter once we formalize this model of computation that we will call a finite automaton (plural: automata )—acronym, FA .
Our insistence on a URM-like model for the automaton will be restricted to this brief motivational introduction and is only meant to illustrate the indebtedness of the finite automata model to the general URM model of Chapter 2 , as promised above.
The typical instruction of an automaton.
where L and M′, . . ., M ( n ) are labels—not necessarily distinct—and a , a ′, . . ., a ( n ) are all the possible digit values in the context of a specific URM program, that is, { a , a ′, . . ., a (n) } is the input alphabet.
The empty string,
, will never be part of a FA’s input alphabet.
The labels, in practice, are not restricted to be numerical or even consecutive (if numerical). However, one instruction’s placement is significant. It is often identified by a label such as “0”, or “ q 0 ”, or some such symbol and is placed at the very beginning of the program.
Pause. A finite automaton does not care where its other instructions fall, as they will be reachable by the goto-structure as needed, wherever they are.
The semantics of the “typical” instruction of above is first to assign to the variable x the just read value from some “external (to the URM) medium”, and then to move to the next instruction as determined by the a ( i ) s or the eof in the if-cases above.
Finally, we partition the instruction-labels—also called states —of any given restricted URM into two types: accepting and rejecting. Their role is as follows: Such a URM, when it has halted,
Pause. When or if ?
will have finished scanning a sequence of digits—a string over its alphabet. This string is accepted if the program halted while in an accepting state, otherwise the input is rejected.