Introduction Reading: Sections 1.5 – 1.7.

Slides:



Advertisements
Similar presentations
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.
Advertisements

COMP-421 Compiler Design Presented by Dr Ioanna Dionysiou.
YES-NO machines Finite State Automata as language recognizers.
Chapter Chapter Summary Languages and Grammars Finite-State Machines with Output Finite-State Machines with No Output Language Recognition Turing.
Lexical Analysis - Scanner Computer Science Rensselaer Polytechnic Compiler Design Lecture 2.
1 Languages. 2 A language is a set of strings String: A sequence of letters Examples: “cat”, “dog”, “house”, … Defined over an alphabet: Languages.
1 CSCI-2400 Models of Computation. 2 Computation CPU memory.
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...
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”,
The Data Element. 2 Data type: A description of the set of values and the basic set of operations that can be applied to values of the type. Strong typing:
CPSC 388 – Compiler Design and Construction
The Data Element. 2 Data type: A description of the set of values and the basic set of operations that can be applied to values of the type. Strong typing:
Languages & Strings String Operations Language Definitions.
Welcome to Honors Intro to CS Theory Introduction to CS Theory (Honors & Traditional): - formalization of computation - various models of computation (increasing.
CSC312 Automata Theory Lecture # 2 Languages.
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,
Lecture Two: Formal Languages Formal Languages, Lecture 2, slide 1 Amjad Ali.
Introduction to Theory of Automata
Compiler Phases: Source program Lexical analyzer Syntax analyzer Semantic analyzer Machine-independent code improvement Target code generation Machine-specific.
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,…}
Lecture # 3 Chapter #3: Lexical Analysis. Role of Lexical Analyzer It is the first phase of compiler Its main task is to read the input characters and.
1 Chapter 1 Introduction to the Theory of Computation.
Languages, Grammars, and Regular Expressions Chuck Cusack Based partly on Chapter 11 of “Discrete Mathematics and its Applications,” 5 th edition, by Kenneth.
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.
1 Languages. 2 A language is a set of strings String: A sequence of letters Examples: “cat”, “dog”, “house”, … Defined over an alphabet:
Welcome to Honors Intro to CS Theory Introduction to CS Theory (Honors & Traditional): - formalization of computation - various models of computation (increasing.
COMP3190: Principle of Programming Languages DFA and its equivalent, scanner.
1 Exercise: Prove that the set S = { π : π is a permutation of {1, 2, 3, …, n} for some integer n ≥ 1 } is countable.
1 November 1, November 1, 2015November 1, 2015November 1, 2015 Azusa, CA Sheldon X. Liang Ph. D. Computer Science at Azusa Pacific University Azusa.
Introduction to Theory of Automata By: Wasim Ahmad Khan.
Lecture 5 Regular Expressions CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
Review: Compiler Phases: Source program Lexical analyzer Syntax analyzer Semantic analyzer Intermediate code generator Code optimizer Code generator Symbol.
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.
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.
Theory of computation Introduction theory of computation: It comprises the fundamental mathematical properties of computer hardware, software,
Transparency No. 1 Formal Language and Automata Theory Homework 1.
1 Course Overview Why this course “formal languages and automata theory?” What do computers really do? What are the practical benefits/application of formal.
Introduction Why do we study Theory of Computation ?
CSE 311: Foundations of Computing Fall 2013 Lecture 18: Structural induction, regular expressions.
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.
Chapter 2. Formal Languages Dept. of Computer Engineering, Hansung University, Sung-Dong Kim.
Chapter 1 INTRODUCTION TO THE THEORY OF COMPUTATION.
Deterministic Finite-State Machine (or Deterministic Finite Automaton) A DFA is a 5-tuple, (S, Σ, T, s, A), consisting of: S: a finite set of states Σ:
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. –{
Language Theory Module 03.1 COP4020 – Programming Language Concepts Dr. Manuel E. Bermudez.
Languages.
Languages Prof. Busch - LSU.
Languages Costas Busch - LSU.
COP4620 – Programming Language Translators Dr. Manuel E. Bermudez
Assume that p, q, and r are in
Review: Compiler Phases:
Strings and Languages cs466(Prasad) L2Lang.
Specification of tokens using regular expressions
Compiler Construction
The Data Element.
Chapter 1 Introduction to the Theory of Computation
The Data Element.
CSC312 Automata Theory Lecture # 2 Languages.
Languages Fall 2018.
Introduction and Chapter One: Fundamentals
Terminology and Symbols
Presentation transcript:

Introduction Reading: Sections 1.5 – 1.7

Definitions Symbol – An atomic unit, such as a digit, character, lower-case letter, etc. Sometimes a word. Alphabet – A finite set of symbols, usually denoted by Σ. Σ = {0, 1} Σ = {0, a, 4} Σ = {a, b, c, d} String – A finite length sequence of symbols, presumably from some alphabet. w = 0110 y = 0aa x = aabcaa one special string: ε Operations: concatenation: wz = 0110111 length: |w| = 4 |ε| = 0 |x| = 6 reversal: yR = aa0

We are interested in sets of strings. Some special sets of strings: Σ* All strings of (zero or more) symbols from Σ (Kleene closure) Σ+ Σ* - {ε} (positive closure) Example: Σ = {0, 1} Σ* = {ε, 0, 1, 00, 01, 10, 11, 000, 001,…} Σ+ = {0, 1, 00, 01, 10, 11, 000, 001,…}

Formal Definition of a Language A (formal) language is a set of strings from some alphabet. Alternatively, a (formal) language is any subset L of Σ* Examples: Σ = {0, 1} L1 = {x | x Σ* and x contains an even number of 0’s} = {ε, 1, 111, 00, 100, 010, 001, 0000, 00100,…} Σ = {0, 1, 2,…, 9, .} L2 = {x | x Σ* and x forms a finite length real number} = {0, 1.5, 9.326,…}

Examples: Σ = {a, b, c,…, z, A, B,…, Z} L3 = {x | x Σ* and x is a Java reserved word} = {while, for, if,…} Σ = {ASCII characters} L4 = {x | x Σ* and x is a syntactically correct Java program} Σ = {English words} L5 = {x | x Σ* and x is a syntactically correct English sentence}

Even arbitrary sets of strings are languages: {01, 10010, 1111, 0010} {ε, 0, 11, 101010} Some special languages: {} The empty set/language, containing no strings, also denoted Ø. {ε} A language containing one string, the empty string. Σ* All strings of symbols from Σ (Kleene closure) Σ+ Σ* - {ε} (positive closure)