James A. Foster

next up previous contents
Next: Regular Languages Up: Computing: Models and Limitations Previous: Introduction

Formal Languages

 

We need a mathematical model of input and output, and a definition of a problem, in order to build general, abstract, mathematical models of computation. Our tool will be formal languages formal languages. We used the following definitions:

Alphabet
A finite set of characters (which are primitives)
Word (or string)
A finite sequence of zero or more characters from a given alphabet
Language
A set of words (may be infinite or finite)

For example, assume we're using the alphabet tex2html_wrap_inline481 . The characters characters are: a and b. Some words words are: tex2html_wrap_inline487 (the word with zero characters), aaabb, a, and aaaaaaaaaaaaaaaaa. Some languages languages are: tex2html_wrap_inline495 (a set with no words), tex2html_wrap_inline497 (the set with a single word, where the word has no characters), tex2html_wrap_inline499 , and tex2html_wrap_inline501 .

Here are some operations on words:

Catenation
The catenation of two words w and u, denoted tex2html_wrap_inline507 , is the word consisting of all the characters in w followed by all those in u. Iterated catenation of a word, tex2html_wrap_inline513 , represents k copies of w stuck together. (note: tex2html_wrap_inline519 .)

Reversal
The reversal of a word, denoted tex2html_wrap_inline521 , is all the characters in w in reverse order

Length
The length of a word, denoted tex2html_wrap_inline525 , is the number of characters in w

Census
The number of times a particular character x occurs in word w is denoted tex2html_wrap_inline533

Here are some operations on languages:

Catenation
The catenation of two languages tex2html_wrap_inline535 and tex2html_wrap_inline537 , denoted tex2html_wrap_inline539 , is the set tex2html_wrap_inline541 . tex2html_wrap_inline543 denotes the set tex2html_wrap_inline545 . tex2html_wrap_inline547 denotes tex2html_wrap_inline549 .

Union, Intersection
These have the usual set-theoretic definitions.

Complement
tex2html_wrap_inline551 . Complementation is defined as tex2html_wrap_inline553 .

The power set power set of a set L is the set of all subsets of L. We will denote this tex2html_wrap_inline559 . We distinguish between a language, and a set of languages by calling the latter a class class of languages.

Each formal language L has an associated decision problem decision problem. We call this the decision problem L and sometimes just the problem L. That is

Def239

Notice that the answer to any particular question about any decision problem is either ``yes'' or ``no''. This defines a natural partitioning of all words into those for which the answer is ``yes'', which is precisely L, and everything else. In this sense, any language is synonymous with the set of ``yes'' instances for it's decision problem. So, we will often use the terms formal language and problem problem interchangeably.

A decision problem is solveable solveable if there is an algorithm which solves it. That is, L is solveable if there is an algorithm which will output ``yes'' (or something equivalent) whenever given a string tex2html_wrap_inline579 . Note that we do not specify what this sort of algorithm should do when tex2html_wrap_inline581 .

Quest369

Any problem which is not solvable is unsolvable unsolvable.

There are many interesting questions which we can now pose and answer with this terminology. For example:

bullet Given a language L and a mathematical model of computation, is L solvable using that model?
bullet Given two mathematical models, are there any languages whose decision problems are soveable with one, but not the other?
bullet Are there any languages whose decision problem is not solvable by any model of computation?
bullet Is there any model of computation which can solve all decision problems?

This approach characterizes "computation" as "solution of decision problems with algorithms". This seems highly artificial. We usually think of computation as a functional transformation of inputs into outputs. However, note that the problem of computing a function f(x)=f is very similar to recognizing the set of pairs tex2html_wrap_inline585 in that if we could write a program to recognise this set, we could compute f(x) with the following algorithm:

Algorithm382

So, this approach isn't as artificial as it seems. However, we will discuss the theory of computable functions later in the course.

next up previous contents
Next: Regular Languages Up: Computing: Models and Limitations Previous: Introduction

James Foster
Wed Sep 18 16:53:17 PDT 1996

Last Updated 01/13/2003 15:56 -0800