Professional Documents
Culture Documents
Module:1 Introduction To Languages and Grammars
Module:1 Introduction To Languages and Grammars
Outline
decidable problems.
What can a computer do efficiently? ---
Computational complexity is a study of:
tractable problems solvable with slowly growing functions (like polynomial) of input size,
and
intractable problems solvable with fast growing functions (like exponential).
1.2 Introduction to Formal Proof
1. Concepts
Formal proof techniques are indispensable for proving theorems in theory of computation.
Understanding how correct programs work is equivalent to proving theorems by
induction.
2. Deductive Proofs
An illustration of deductive proof is as shown in Fig. 1.3.
Logic principles used: modus ponens
1. Some More Proof Techniques
Proofs about sets
Proofs by contradiction
1. Induction on Integers
To prove a statement S(n) about an integer n by induction, we do:
Basis --- show S(i) true for a particular basis integer i (0 or 1 usually)
Inductive step --- assume n i (basis integer), and show that the statement “if
1. Induction on Integers
To prove a statement S(n) about an integer n by induction, we do:
Basis --- show S(i) true for a particular basis integer i (0 or 1 usually)
Inductive step --- assume n i (basis integer), and show that the statement “if
Examples ---
Binary alphabet = {0, 1}
English alphabet = {a, b, …, z} …
1.5 Central Concepts of Automata Theory
2. Strings
Definition ---
A string (or word) is a finite sequence of symbols from an alphabet.
An example --- 1011 is a string from the binary alphabet = {0, 1}.
= ∪2∪3∪… * = +∪{}
Concatenation of two strings x and y --- xy
if x = 01101, y = 110, then xy = 01101110, xx = x2 = 0110101101, …
is the identity for concatenation since w = w = w.
1.5 Central Concepts of Automata Theory
3. Languages
Definition ---
A language is a set of strings all chosen from some *.
In other words:
if is an alphabet, and L*, then L is a language over .
Examples ---
The set of all legal English words is a language.
Why? What is the alphabet here? Answer: the set of all letters.
A legal program of C is a language.
Why? What is the alphabet here? Answer: a subset of the ASCII characters.
More examples of languages ---
The set of all strings of n 0’s followed by n 1’s for n 0: {, 01, 0011, 000111,
…}
* is an infinite language for any alphabet .
denotes the empty language (not the empty string ) which is a language over any alphabet.
{} is a language over any alphabet (consisting of only one string, the empty string ).
1.5 Central Concepts of Automata Theory
L4 = {x | x is over V = {a, b}, begins with a, followed by any number of b, possible none}
Note: L4 = L3 = L2
Description by integer parameters ---
L5 = {abn | n 0}
Note: L5 = L4 = L3 = L2
1.5 Central Concepts of Automata Theory
Note: U above is the universal set, just like * which is the closure of an alphabet (defined later)
1.5 Central Concepts of Automata Theory