1
High-Level Descriptions of Computation
High-Level Descriptions of Computation
•
Instead of giving a Turing Machine, we shall often describe a program as code in some
programming language (or often “pseudo-code”)
–
Possibly using high level data structures and subroutines
•
Inputs and outputs are complex objects, encoded as strings
•
Examples of objects:
–
Matrices, graphs, geometric shapes, images, videos,
. . .
–
DFAs, NFAs, Turing Machines, Algorithms, other machines
. . .
High-Level Descriptions of Computation
Encoding Complex Objects
•
“Everything” finite can be encoded as a (finite) string of symbols from a finite alphabet (e.g.
ASCII)
–
Can in turn be encoded in binary (as modern day computers do). No special
t
symbol:
use self-terminating representations
•
Example: encoding a “graph.”
(1,2,3,4)((1,2)(2,3)(3,1)(1,4))
encodes the graph
1
2
3
4
High-Level Descriptions of Computation
•
We have already seen several algorithms, for problems involving complex objects like DFAs,
NFAs, regular expressions, and Turing Machines
–
For example, convert a NFA to DFA; Given a NFA
N
and a word
w
, decide if
w
∈
L
(
N
);
. . .
•
All these inputs can be encoded as strings and all these algorithms can be implemented as
Turing Machines
•
Some of these algorithms are for decision problems, while others are for computing more
general functions
•
All these algorithms terminate on all inputs
2