Download presentation
Presentation is loading. Please wait.
Published byJudith Townsend Modified over 6 years ago
1
Theory of Computation Theory of computation is mainly concerned with the study of how problems can be solved using algorithms. Therefore, we can infer that it is very relevant to the study of logic and mainly logic within mathematics. These studies are used to understand the way an algorithm is meant to work, and to actually prove it works through analyzing problems that may arise with the technique used and finding solutions to these problems. It is quiet huge field of study, but it is split up into three different parts: automata theory, computability theory, and computational complexity theory.
2
Theory of Computation: areas
CSC 573 Theory of Computation 7/28/2018 Theory of Computation: areas Formal Language Theory language = set of sentences (strings) grammar = rules for generating strings production/deduction systems capabilities & limitations application: programming language specification Automata Theory (Abstract Machines) models for the computing process with various resources characterize ``computable” application: parsing algorithms Complexity Theory time/space resources application: algorithm design
3
What is Automata Theory?
Cpt S 317: Spring 2009 What is Automata Theory? Study of abstract computing devices, or “machines” Automaton = an abstract computing device Note: A “device” need not even be a physical hardware! Computability vs. Complexity School of EECS, WSU
4
Alan Turing (1912-1954) Father of Modern Computer Science
Cpt S 317: Spring 2009 Alan Turing ( ) (A pioneer of automata theory) Father of Modern Computer Science English mathematician Studied abstract machines called Turing machines even before computers existed Heard of the Turing test? School of EECS, WSU
5
Theory of Computation: A Historical Perspective
Cpt S 317: Spring 2009 Theory of Computation: A Historical Perspective 1930s Alan Turing studies Turing machines Decidability Halting problem s “Finite automata” machines studied Noam Chomsky proposes the “Chomsky Hierarchy” for formal languages 1969 Cook introduces “intractable” problems or “NP-Hard” problems 1970- Modern computer science: compilers, computational & complexity theory evolve School of EECS, WSU
6
Cpt S 317: Spring 2009 Languages & Grammars Languages: “A language is a collection of sentences of finite length all constructed from a finite alphabet of symbols” Grammars: “A grammar can be regarded as a device that enumerates the sentences of a language” - nothing more, nothing less N. Chomsky, Information and Control, Vol 2, 1959 Or “words” Image source: Nowak et al. Nature, vol 417, 2002 School of EECS, WSU
7
Cpt S 317: Spring 2009 The Chomsky Hierachy A containment hierarchy of classes of formal languages Recursively- enumerable (TM) Context- sensitive (LBA) Context- free (PDA) Regular (DFA) School of EECS, WSU
8
Language In English, there are at least three different types of entities: letters, words, sentences. Letters are from a finite alphabet { a, b, c, , z } Words are made up of certain combinations of letters from the alphabet. Not all combinations of letters lead to a valid English word.
9
Sentences are made up of certain combinations of words.
Not all combinations of words lead to a valid English sentence. So we see that some basic units are combined to make bigger units.
10
Languages How can you tell whether a given sentence belongs to a particular languages Black is cat the The tea is hot I like chocolates two much Rules give a clue to forming as well as validating sentences.
11
How to Communicate with machines ?
Need a language: what sort Machines don’t have human mind though may have its partial imitation Would fail on incorrect or ambiguous input Some recovery or input corrections may be proposed but again very limited. Thus need a precise, explicit and universal definition of communication language
12
Summary of Languages Three aspects/specifications Lexical Syntactic
Defines valid words/units of a language Syntactic Defines rules for combining the units to form valid sentences (computer programs in context of machines) Semantic Concerned with the interpretation or meaning of a sentence (what output to produce in context of machines) Affected by ambiguity the most.
13
Formal languages A language designed for use in situations in which natural language is unsuitable, as for example in mathematics, logic, or computer programming. The symbols and formulas of such languages stand in precisely specified syntactic and semantic relations to one another
14
Formal languages Rules defined explicitly and clearly No ambiguities
Universally uniform understanding Lets the machine Interpret an input uniformly every time. i.e. always produces same output for a particular input Avoid crashes because of ambiguity. Explicitly and categorically reject invalid input
15
Formal Languages Need uniformly understandable notation
Representations Alphabet Represents a finite set of fundamental units of lanauges, e.g. for English ={a,b,….z.A,…Z,} ∑ = {0,1} ∑ = {0,1,2,3,4,5,6,7,8,9}
16
Formal Languages List of words Set of all valid words of a given language, e.g., a language English_Words that contains all valid words of English would have a = {all entries of the dictionary + punctuation marks and blank space} Denoted by Is Finite or Infinite set. Strings: A string a finite sequence of symbols chosen from alphabet. For example , , abbbcdeg etc.
17
String Variable: A letter used for denoting a string
String Variable: A letter used for denoting a string. The author uses w, x, y and z as string variable. For example w = , x = , z = abbbcdeg Length of String: The number of positions for symbols in the string. For simplicity we can say that it is the number of symbols in the string. For example |w| = 7 , |x| = ? , |z| = ?
18
Finite vs. Infinite Languages
Countable set of words Can be defined by rigorously listing the words in E.g. English-Words Infinite Languages Infinite set of valid words Cant be listed completely E.g. English_Sentences
19
Infinite Languages Most of the languages are infinite
How can u check whether a word belongs to a language if it is Finite Checking its entry in Infinite Validating against rules
20
Defining Languages Define alphabet set
Define rules for forming valid words and sequences of words from Called grammar Can be descriptive Limitations of informalism Can be mathematical Can also define supporting functions e.g., length(X), reverse(x)
21
Defining languages Example ={a,b,…z}
L = {all words formed only of odd number of xs} L = {xn | n is odd} L = {all words of length less than or equal to 4} PALINDROME ={Λ, all strings x such that reverse (x) = x}
22
Kleene Closure Set closure Kleene Closure (applied to )
A set of all the strings (finite) that can be formed by the elements of where the elements may be repeated any number of times. Denoted by * Also called Kleene star.
23
∑* : The set of all strings over an alphabet ∑ and called Kleene Star Closure of alphabet. So we have ∑* = ∑0 U ∑1 U ∑2 U ∑3 U…………… ∑+ : The set of all strings over an alphabet ∑ excluding empty string, ε, and called plus operation. So we have ∑+ = ∑1 U ∑2 U ∑3 U……………
24
Some observations Λ represents an empty string (not alphabet thus not a part of ) ε also represents the same ε is not equivalent to If = then * = {Λ} Is S* == (S*)* and so on
25
Length: Examples: String Length
26
Length of Concatenation
Example:
27
Empty String A string with no letters: Observations:
28
Substring Substring of string: a subsequence of consecutive characters
29
Prefix and Suffix Prefixes Suffixes prefix suffix
30
Another Operation Example: Definition:
31
The * Operation : the set of all possible strings from alphabet
32
The + Operation : the set of all possible strings from alphabet except
33
Languages A language is any subset of Example: Languages:
34
Note that: Sets Set size Set size String length
35
Another Example An infinite language
36
Operations on Languages
The usual set operations Complement:
37
Reverse Definition: Examples:
38
Concatenation Definition: Example:
39
Another Operation Definition: Special case:
40
More Examples
41
Star-Closure (Kleene *)
Definition: Example:
42
Positive Closure Definition:
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.