1 Lecture 3 Topics –Languages –Language classes –Closure properties.

Slides:



Advertisements
Similar presentations
Properties of Regular Languages
Advertisements

CSE 105 Theory of Computation Alexander Tsiatas Spring 2012 Theory of Computation Lecture Slides by Alexander Tsiatas is licensed under a Creative Commons.
Sets Lecture 11: Oct 24 AB C. This Lecture We will first introduce some basic set theory before we do counting. Basic Definitions Operations on Sets Set.
Finite Automata Section 1.1 CSC 4170 Theory of Computation.
1 Introduction to Computability Theory Lecture3: Regular Expressions Prof. Amos Israeli.
1 Lecture 4: Formal Definition of Solvability Analysis of decision problems –Two types of inputs:yes inputs and no inputs –Language recognition problem.
Lecture 9 Recursive and r.e. language classes
1 Module 8 Closure Properties –Definition –Language class definition set of languages –Closure properties and first-order logic statements For all, there.
1 Module 9 Recursive and r.e. language classes –representing solvable and half-solvable problems Proofs of closure properties –for the set of recursive.
Lecture 8 Recursively enumerable (r.e.) languages
CS 454 Theory of Computation Sonoma State University, Fall 2011 Instructor: B. (Ravi) Ravikumar Office: 116 I Darwin Hall Original slides by Vahid and.
1 Lecture 5 Topics –Closure Properties for REC Proofs –2 examples Applications.
CS 454 Theory of Computation Sonoma State University, Fall 2011 Instructor: B. (Ravi) Ravikumar Office: 116 I Darwin Hall Original slides by Vahid and.
1 Module 10 Recursive and r.e. language classes –representing solvable and half-solvable problems Proofs of closure properties –for the set of recursive.
Admin Office hours 2:45-3:15 today due to department meeting if you change addresses during the semester, please unsubscribe the old one from the.
1 Regular Expressions/Languages Regular languages –Inductive definitions –Regular expressions syntax semantics Not covered in lecture.
1 Module 9 Closure Properties –Definition –Language class definition set of languages –Closure properties and first-order logic statements For all, there.
Set theory Sets: Powerful tool in computer science to solve real world problems. A set is a collection of distinct objects called elements. Traditionally,
INTRODUCTION TO THE THEORY OF COMPUTATION INTRODUCTION MICHAEL SIPSER, SECOND EDITION 1.
DECIDABILITY OF PRESBURGER ARITHMETIC USING FINITE AUTOMATA Presented by : Shubha Jain Reference : Paper by Alexandre Boudet and Hubert Comon.
1 Chapter 1 Automata: the Methods & the Madness Angkor Wat, Cambodia.
Chapter 4 Numeration and Mathematical Systems © 2008 Pearson Addison-Wesley. All rights reserved.
The Recursion Theorem Pages 217– ADVANCED TOPICS IN C O M P U T A B I L I T Y THEORY.
MA/CSSE 474 Theory of Computation Functions, Closure, Decision Problems.
1 Chapter 1 Introduction to the Theory of Computation.
Boolean Algebra and Computer Logic Mathematical Structures for Computer Science Chapter 7.1 – 7.2 Copyright © 2006 W.H. Freeman & Co.MSCS Slides Boolean.
Lexical Analysis I Specifying Tokens Lecture 2 CS 4318/5531 Spring 2010 Apan Qasem Texas State University *some slides adopted from Cooper and Torczon.
CS 103 Discrete Structures Lecture 10 Basic Structures: Sets (1)
Chapter 7 Logic, Sets, and Counting Section 2 Sets.
CSE S. Tanimoto Introduction to ML 1 Introduction to ML History Special features Interacting with ML ML’s basic types ML’s composite types Math.
1 Module 14 Regular languages –Inductive definitions –Regular expressions syntax semantics.
Mathematical Preliminaries
Finite Automata – Definition and Examples Lecture 6 Section 1.1 Mon, Sep 3, 2007.
Arithmetic Expressions in C++. CSCE 1062 Outline Data declaration {section 2.3} Arithmetic operators in C++ {section 2.6} Mixed data type arithmetic in.
Finite Automata Chapter 1. Automatic Door Example Top View.
Classifications LanguageGrammarAutomaton Regular, right- linear Right-linear, left-linear DFA, NFA Context-free PDA Context- sensitive LBA Recursively.
9.1 Sequences and Series. Definition of Sequence  An ordered list of numbers  An infinite sequence is a function whose domain is the set of positive.
Chapter 1.8 Absolute Value and Inequalities. Recall from Chapter R that the absolute value of a number a, written |a|, gives the distance from a to 0.
Module #3 - Sets 3/2/2016(c) , Michael P. Frank 2. Sets and Set Operations.
Lecture 10 Closure Properties of Regular Languages Topics: Extended RegExpr Thompson Construction Test 1 Post Mortem October 1, 2008 CSCE 355 Foundations.
Operators A binary operator combines two values to get one result: x OP y where OP is any binary operators such as +, -, *, /, ==, !=, >, &&, or even =.
CSE 202 – Formal Languages and Automata Theory 1 REGULAR EXPRESSION.
MA/CSSE 474 Theory of Computation Decision Problems, Continued DFSMs.
Set Builder Notation. If you recall, a set is a collection of objects which we write using brackets and name using a capital letter. Remember also that:
General Discussion of “Properties” The Pumping Lemma Membership, Emptiness, Etc.
CSE 105 theory of computation
CSE 105 theory of computation
CS170 – Week 1 Lecture 3: Foundation Ismail abumuhfouz.
Propositional Calculus: Boolean Functions and Expressions
Formal Language & Automata Theory
Data Types, Identifiers, and Expressions
CSE 105 theory of computation
Lecture 10 Closure Properties of Regular Languages
Closure Properties for Regular Languages
CSE322 CONSTRUCTION OF FINITE AUTOMATA EQUIVALENT TO REGULAR EXPRESSION Lecture #9.
INTRODUCTION TO THE THEORY OF COMPUTATION
CSE S. Tanimoto Introduction to ML
Closure Properties of Regular Languages
Real Numbers and their Properties
CSE S. Tanimoto Introduction to ML
Chapter 7 Logic, Sets, and Counting
Programming Languages
CSE 105 theory of computation
CSE S. Tanimoto Introduction to ML
CSE S. Tanimoto Introduction to ML
Teori Bahasa dan Automata Lecture 6: Regular Expression
Representations & Reasoning Systems (RRS) (2.2)
Terminology and Symbols
CSE 105 theory of computation
Presentation transcript:

1 Lecture 3 Topics –Languages –Language classes –Closure properties

2 In class reading assignment Read Section 1.5 (pages 27-30) and answer the following questions –What is a language? –What is  ? –What is {aa,bb}{cc,dd}? –What is {aa,bb} 2 ? –What are the five shortest strings in {aa,bb} * ? –What are the five shortest strings in {aa,bb} + ? –What does it mean if a language is infinite/finite? –Is there a difference between {} and {  }?

3 Questions What is the English Language? What is the C ++ Language?

4 Describing a language L List all elements in L –Doesn’t work for infinite languages English language description of L –many different descriptions possible, though some are better than others Formal mathematical description of L Give a method for recognizing all strings in L –give a program for recognizing strings in L

5 Example Describing the language of “Legal Identifiers of C++” –English 1: Legal identifiers of C++ –English 2 (CSE 231 textbook): “In C++, an identifier should begin with a letter, which may be followed by any number of letters, digits or underscores.” –Formal Definition: Regular expression: A(A+D+_) * –A = {a, b, …, z, A, B, …, Z} –D = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}

6 Example Continued –Program to recognize language bool main( ) { char a; getc(cin, a); if (cin.eof( ) || (!alpha(a)) return false; getc(cin, a); while (!cin.eof( )) { if (!alpha(a) || !digit(a) !! (a != ‘_’)) return false; getc(cin,a); } return true; }

7 Work on these examples {a n b m | m,n >= 0} –shortest 3 strings? –English language description? –C++ program? {a n b n | n >= 0} –shortest 3 strings? –English language description? –C++ program?

8 Language classes A language class is a set of languages –an element of a language class is a language which is a set of strings

9 Example language classes the set of finite languages the set of languages with at most 3 strings –CARD-3 the set of languages whose l.r.p.’s can be solved How are the above language classes related?

10 Closure Properties A set is closed under an operation if applying the operation to elements of the set produces another element of the set Example/Counterexample –set of integers and addition –set of integers and division

11 Integers and Addition Integers 2 5 7

12 Integers and Division Integers 2 5.4

13 Closure Properties for LC’s –We will be interested in closure properties of language classes. The elements of a language class are languages which are sets themselves Remember that we apply the set operations to the languages (elements of the language classes) rather than the language classes themselves –Example/Counterexample Finite languages and set union operator CARD-3 and set union operator

14 Finite Sets and Set Union Finite Sets {0,1,00} {0,1,11} {0,1,00,11}

15 CARD-3 and Set Union CARD-3 {0,1,00} {0,1,11} {0,1,00,11}

16 Finite Sets and Set Complement Finite Sets {0,1} {l,00,01,10,11,000,...}

17 Infinite Number of Facts A closure property can represent an infinite number of facts Example: Finite languages closed under union –{} union {} is a finite language –{} union {0} is a finite language –... –{ } union {} is a finite language –...

18 First-order logic A way to formally write a closure property –For all L 1,...,L k in LC, L 1 op... op L k in LC –Only one expression is needed because of the for all quantifier Number of languages k is determined by arity of the operation –complement is unary so only one language –union is binary so two languages

19 Example F-O logic statements For all L 1,L 2 in FINITE, L 1 union L 2 in FINITE For all L 1,L 2 in LC3, L 1 union L 2 in LC3 For all L in FINITE, L c in FINITE For all L in LC3, L c in LC3