CS 310 – Fall 2006 Pacific University CS310 Strings, String Operators, and Languages Sections: August 30, 2006.

Slides:



Advertisements
Similar presentations
Regular operations Sipser 1.1 (pages 44 – 47). CS 311 Fall Building languages If L is a language, then its complement is L’ = {w | w ∉ L} Let A.
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.
Properties of Regular Languages
1 Lecture 32 Closure Properties for CFL’s –Kleene Closure construction examples proof of correctness –Others covered less thoroughly in lecture union,
FORMAL LANGUAGES, AUTOMATA, AND COMPUTABILITY
1 Languages. 2 A language is a set of strings String: A sequence of letters Examples: “cat”, “dog”, “house”, … Defined over an alphabet: Languages.
NFAs Sipser 1.2 (pages 47–54). CS 311 Fall Recall… Last time we showed that the class of regular languages is closed under: –Complement –Union.
Regular operations Sipser 1.1 (pages 44 – 47). CS 311 Mount Holyoke College 2 Building languages If L is a language, then its complement is L’ = {w |
NFAs Sipser 1.2 (pages 47–54). CS 311 Mount Holyoke College 2 Recall… Last time we showed that the class of regular languages is closed under: –Complement.
Regular operations Sipser 1.2 (pages 47-63). First… a sample proof
Lecture 3UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 3.
CS 310 – Fall 2006 Pacific University CS310 Finite Automata Sections:1.1 page 44 September 8, 2006.
CS 310 – Fall 2006 Pacific University CS310 Converting NFA to DFA Sections:1.2 Page 54 September 15, 2006.
1 CSCI-2400 Models of Computation. 2 Computation CPU memory.
Regular Languages Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 3 Comments, additions and modifications.
Sets Definition of a Set: NAME = {list of elements or description of elements} i.e. B = {1,2,3} or C = {x  Z + | -4 < x < 4} Axiom of Extension: A set.
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...
CS 310 – Fall 2006 Pacific University CS310 Finite Automata Sections: September 1, 2006.
1 Lecture 5 Topics –Closure Properties for REC Proofs –2 examples Applications.
1 Module 31 Closure Properties for CFL’s –Kleene Closure construction examples proof of correctness –Others covered less thoroughly in lecture union, concatenation.
Costas Busch - RPI1 Mathematical Preliminaries. Costas Busch - RPI2 Mathematical Preliminaries Sets Functions Relations Graphs Proof Techniques.
Courtesy Costas Busch - RPI1 Mathematical Preliminaries.
FSA Lecture 1 Finite State Machines. Creating a Automaton  Given a language L over an alphabet , design a deterministic finite automaton (DFA) M such.
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.
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”,
Lecture 1 String and Language. String string is a finite sequence of symbols. For example, string ( s, t, r, i, n, g) CS4384 ( C, S, 4, 3, 8) (1,
Regular Languages A language is regular over  if it can be built from ;, {  }, and { a } for every a 2 , using operators union ( [ ), concatenation.
Introduction to CS Theory Lecture 1 – Introduction Piotr Faliszewski
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,
Mathematical Preliminaries Strings and Languages Preliminaries 1.
1 Strings and Languages. 2 Review Sets and sequences Functions and relations Graphs Boolean logic:      Proof techniques: – Construction, Contradiction,
Two examples English-Words English-Sentences alphabet S ={a,b,c,d,…}
1 Let L= { w= u v : u  {a, b}*, v  {c, d}* and |u|= |v|} 1.Design a context-free grammar that generates L. 2.Use your grammar and the construction from.
1 INFO 2950 Prof. Carla Gomes Module Modeling Computation: Language Recognition Rosen, Chapter 12.4.
1 Chapter 1 Introduction to the Theory of Computation.
Mathematical Preliminaries (Hein 1.1 and 1.2) Sets are collections in which order of elements and duplication of elements do not matter. – {1,a,1,1} =
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 2 Mälardalen University 2006.
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:
1 Exercise: Prove that the set S = { π : π is a permutation of {1, 2, 3, …, n} for some integer n ≥ 1 } is countable.
1 Module 31 Closure Properties for CFL’s –Kleene Closure –Union –Concatenation CFL’s versus regular languages –regular languages subset of CFL.
Strings and Languages CS 130: Theory of Computation HMU textbook, Chapter 1 (Sec 1.5)
Chapter 4 Pumping Lemma Properties of Regular Languages Decidable questions on Regular Languages.
1 String v is a prefix of w if w= v y for some string y. String v is a suffix of w if w= x v for some string x. String v is a substring of w if there are.
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.
UNIT - I Formal Language and Regular Expressions: Languages Definition regular expressions Regular sets identity rules. Finite Automata: DFA NFA NFA with.
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.
Introduction Why do we study Theory of Computation ?
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.
Dept. of Computer Science & IT, FUUAST Automata Theory 2 Automata Theory III Properties of Regular Languages 1.Closure 2.Union 3.Concatenation 4.Complement(Negation)
Chapter 2. Formal Languages Dept. of Computer Engineering, Hansung University, Sung-Dong Kim.
Chapter 1 INTRODUCTION TO THE THEORY OF COMPUTATION.
Alphabet, String, Language. 2 Alphabet and Strings An alphabet is a finite, non-empty set of symbols. –Denoted by  –{ 0, 1 } is a binary alphabet. –{
Languages.
Languages Prof. Busch - LSU.
Languages Costas Busch - LSU.
Languages, prefixes, sets, cardinality, functions
Assume that p, q, and r are in
COSC 3340: Introduction to Theory of Computation
Mathematical Preliminaries Strings and Languages
Languages, prefixes, sets, cardinality, functions
Introduction Reading: Sections 1.5 – 1.7.
Chapter 1 Introduction to the Theory of Computation
Languages Fall 2018.
Terminology and Symbols
Presentation transcript:

CS 310 – Fall 2006 Pacific University CS310 Strings, String Operators, and Languages Sections: August 30, 2006

CS 310 – Fall 2006 Pacific University Quick Review Sets (Union, Intersection, [Proper] Subset) { n | rule about n} Cross Product/Power Set Sequences/Tuples Functions f : D -> R Relation f : A 1 x A 2 x …x A n -> {TRUE, FALSE} Equivalence Relations: 3 conditions

CS 310 – Fall 2006 Pacific University Strings Alphabet: Any finite set, ∑ = {a, b} String: Any finite sequence of symbols from a given alphabet w = ababaabba, string over ∑ ε = empty string, zero symbols length of w: |w| = number of symbols it contains |ε| =|w| = Strings are building blocks of computer science strings can represent: data sets (DNA), source code, files…

CS 310 – Fall 2006 Pacific University String Operations Closure (∑*): set of all strings over ∑, including ε. ∑ = {a, b} ∑* = {ε,a,b,ab,ba,aa,bb,…} Concatenations If x,y є ∑*, then xy is defined to the be concatenation of strings x, y x=aba y=bab xy= x k is k copies of x concatenated x 2 =

CS 310 – Fall 2006 Pacific University String Operations Prefix/Suffix z = xy for x,y,z є ∑*, x is a prefix of z y is a suffix of z Reverse x є ∑*, x R is the reverse of x x = ab, x R =ba

CS 310 – Fall 2006 Pacific University Languages Language Language L over ∑ is a subset of ∑* L = { x є {a,b}* | |x| is even } = {ε, aa, ab,, } Complement of a language L over ∑ ∑* - L = L’ Concatenation of languages L 1 and L 2 over ∑ L 1 L 2 = {xy| x є L 1, y є L 2 } L 2 = LL

CS 310 – Fall 2006 Pacific University Languages Union of languages L 1 and L 2 over ∑ L 1 U L 2 = {x | x є L 1 or x є L 2 } L1 = {0}* L2 = {1}* what is in L 1 U L 2 ? what is in L 1 L 2 ?

CS 310 – Fall 2006 Pacific University Languages Kleene Star L* = set of strings formed by concatenating any number of strings from L L = { x є { a, b}* | |x| is odd} What does L contain: {} L* = {ε,,,, }

CS 310 – Fall 2006 Pacific University Languages Recursive Definitions Define L over ∑ = {0,1} as 1. ε є L 2. If x є L then 0x1 є L What is in L? L= {} Can we prove that {ε,01,0011,000111,…} is equivalent to {0 i 1 i | i>=0}? Show L is subset of {0 i 1 i | i>=0} and the reverse

CS 310 – Fall 2006 Pacific University Proof For x,y є ∑*, show (xy) R = y R x R