CSC312 Automata Theory Lecture # 2 Languages.

Slides:



Advertisements
Similar presentations
Chapter 2 Revision of Mathematical Notations and Techniques
Advertisements

Formal Languages Languages: English, Spanish,... PASCAL, C,... Problem: How do we define a language? i.e. what sentences belong to a language? e.g.Large.
YES-NO machines Finite State Automata as language recognizers.
1 Languages. 2 A language is a set of strings String: A sequence of letters Examples: “cat”, “dog”, “house”, … Defined over an alphabet: Languages.
Courtesy Costas Busch - RPI1 A Universal Turing Machine.
1 CSCI-2400 Models of Computation. 2 Computation CPU memory.
Fall 2006Costas Busch - RPI1 Deterministic Finite Automata And Regular Languages.
Regular Languages Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 3 Comments, additions and modifications.
CS 310 – Fall 2006 Pacific University CS310 Strings, String Operators, and Languages Sections: August 30, 2006.
Regular Languages Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 3 Comments, additions and modifications.
1 Languages and Finite Automata or how to talk to machines...
Costas Busch - RPI1 Mathematical Preliminaries. Costas Busch - RPI2 Mathematical Preliminaries Sets Functions Relations Graphs Proof Techniques.
Courtesy Costas Busch - RPI1 Mathematical Preliminaries.
Theoretical Computer Science COMP 335 Fall 2004
CS 3240 – Chuck Allison.  A model of computation  A very simple, manual computer (we draw pictures!)  Our machines: automata  1) Finite automata (“finite-state.
Topics Automata Theory Grammars and Languages Complexities
Fall 2006Costas Busch - RPI1 Languages. Fall 2006Costas Busch - RPI2 Language: a set of strings String: a sequence of symbols from some alphabet Example:
Fall 2004COMP 3351 Languages. Fall 2004COMP 3352 A language is a set of strings String: A sequence of letters/symbols Examples: “cat”, “dog”, “house”,
Regular Languages A language is regular over  if it can be built from ;, {  }, and { a } for every a 2 , using operators union ( [ ), concatenation.
Lecture # 1 (Automata Theory)
CSC312 Automata Theory Lecture # 2 Languages.
Costas Busch - LSU1 Languages. Costas Busch - LSU2 Language: a set of strings String: a sequence of symbols from some alphabet Example: Strings: cat,
Formal Methods in SE Theory of Automata Qasiar Javaid Assistant Professor Lecture # 06.
Mathematical Preliminaries Strings and Languages Preliminaries 1.
Lecture Two: Formal Languages Formal Languages, Lecture 2, slide 1 Amjad Ali.
Introduction to Theory of Automata
Two examples English-Words English-Sentences alphabet S ={a,b,c,d,…}
1 Chapter 1 Introduction to the Theory of Computation.
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 2 Mälardalen University 2006.
Module 2 How to design Computer Language Huma Ayub Software Construction Lecture 8.
Lecture-2 Recap Lecture-1
Mathematical Preliminaries. Sets Functions Relations Graphs Proof Techniques.
1 Languages. 2 A language is a set of strings String: A sequence of letters Examples: “cat”, “dog”, “house”, … Defined over an alphabet:
L ECTURE 3 Chapter 4 Regular Expressions. I MPORTANT T ERMS Regular Expressions Regular Languages Finite Representations.
1 Exercise: Prove that the set S = { π : π is a permutation of {1, 2, 3, …, n} for some integer n ≥ 1 } is countable.
Introduction to Theory of Automata By: Wasim Ahmad Khan.
Regular Expressions and Languages A regular expression is a notation to represent languages, i.e. a set of strings, where the set is either finite or contains.
Mathematical Notions and Terminology Lecture 2 Section 0.2 Fri, Aug 24, 2007.
Strings and Languages CS 130: Theory of Computation HMU textbook, Chapter 1 (Sec 1.5)
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 2 Mälardalen University 2010.
1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 2 School of Innovation, Design and Engineering Mälardalen University 2012.
CSC312 Automata Theory Lecture # 3 Languages-II. Formal Language A formal language is a set of words—that is, strings of symbols drawn from a common alphabet.
CS 203: Introduction to Formal Languages and Automata
Recursive Definations Regular Expressions Ch # 4 by Cohen
Lecture # Book Introduction to Theory of Computation by Anil Maheshwari Michiel Smid, 2014 “Introduction to computer theory” by Daniel I.A. Cohen.
Strings and Languages Denning, Section 2.7. Alphabet An alphabet V is a finite nonempty set of symbols. Each symbol is a non- divisible or atomic object.
Theory of computation Introduction theory of computation: It comprises the fundamental mathematical properties of computer hardware, software,
Lecture # 4.
Lecture 2 Theory of AUTOMATA
1 Strings and Languages Lecture 2-3 Ref. Handout p12-17.
Lecture 02: Theory of Automata:2014 Asif Nawaz Theory of Automata.
Lecture 03: Theory of Automata:2014 Asif Nawaz Theory of Automata.
L ANGUAGE C ONCEPTS : F ORMAL M ODEL FOR L ANGUAGES Theory of Computer Akram Salah.
1 Let S = { π : π is a permutation of {1, 2, 3, …, n} for some integer n ≥ 1 }. (a) List the elements of S for n= 1, 2, and 3. (b) Prove that the set S.
Languages and Strings Chapter 2. (1) Lexical analysis: Scan the program and break it up into variable names, numbers, etc. (2) Parsing: Create a tree.
Chapter 1 INTRODUCTION TO THE THEORY OF COMPUTATION.
Theory of Computation Lecture #
Lecture # 2.
Languages.
Languages Prof. Busch - LSU.
Languages Costas Busch - LSU.
Theory of Computation Theory of computation is mainly concerned with the study of how problems can be solved using algorithms.  Therefore, we can infer.
Mathematical Notions and Terminology
Assume that p, q, and r are in
Mathematical Preliminaries Strings and Languages
Introduction Reading: Sections 1.5 – 1.7.
Chapter 1 Introduction to the Theory of Computation
CSC312 Automata Theory Lecture # 2 Languages.
LECTURE # 07.
Languages Fall 2018.
Presentation transcript:

CSC312 Automata Theory Lecture # 2 Languages

Courtesy Costas Busch - RPI Alphabets and Strings Alphabets: An alphabet is a finite set of symbols, usually letters, digits, and punctuations. Valid/In-valid alphabets: An alphabet may contain letters consisting of group of symbols for example Σ= {a, ba, bab, d}. Remarks: While defining an alphabet of letters consisting of more than one symbols, no letter should be started with the letter of the same alphabet i.e. one letter should not be the prefix of another. However, a letter may be ended in a letter of same alphabet. Valid alphabet : Invalid alphabet : Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI Alphabets and Strings String or word: A finite sequence of letters/alphabets Examples: “cat”, “dog”, “house”, “read” … Defined over an alphabet: Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI Alphabets and Strings We will use small alphabets: Strings Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI String Operations Let we have following strings Concatenation Reverse Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI String Length Length: Examples: Courtesy Costas Busch - RPI

Length of Concatenation Example: Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI Empty String A string with no letters: Observations: Note-1: A language that does not contain any word at all is denoted by  or { }. This language doesn’t contain any word not even the NULL string. i.e. { } ≠ {} Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI Empty String Note-2: Suppose a language L doesn’t contain NULL then L = L +  but L ≠ L + {}. Important : NULL is identity element with respect to concatenation. Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI Substring Substring of string: a subsequence of consecutive characters String Substring Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI Prefix and Suffix Let the string is Prefixes Suffixes prefix suffix Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI Another Operation - w repeated n time; that is, Example: Definition: Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI The * Operation : the set of all possible strings from alphabet , called closure of alphabets also known as Kleene star operator or Kleene star closure. i.e. infinitely many words each of finite length. Courtesy Costas Busch - RPI

The + Operation : the set of all possible strings from alphabet except , also known as Kleene plus operator. Note : are infinite

Courtesy Costas Busch - RPI Languages A language is a set of strings OR A language is any subset of , usually denoted by L. It may be finite or infinite. Example: Languages: If a string w is in L, we say that w is a sentence of L. Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI Note that: Sets Set size Set size String length Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI Another Example An infinite language Courtesy Costas Busch - RPI

Operations on Languages The usual set operations Complement: Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI Reverse Definition: Examples: Concatenation Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI Another Operation Definition: L concatenated with itself n times. Special case: Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI More Examples Courtesy Costas Busch - RPI

Star-Closure (Kleene *) Definition: Example: Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI Positive Closure Definition: Note: L+ includes  if and only if L includes  Courtesy Costas Busch - RPI

Lexicographical Order Assume that the symbols in are themselves ordered. Definition: A set of strings is in lexicographical order if The strings are grouped first according to their length. Then, within each group, the strings are ordered “alphabetically” according to the ordering of the symbols. Courtesy Costas Busch - RPI

Lexicographical Order Ex: Let the alphabet be The set of all strings in Lexicographical order is , a, b, aa, ab, ba, bb, aaa, …., bbb, aaaa, …, bbbb, …. Courtesy Costas Busch - RPI