Introduction and Chapter One: Fundamentals

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

YES-NO machines Finite State Automata as language recognizers.
1 Regular Expressions & Automata Nelson Padua-Perez Bill Pugh Department of Computer Science University of Maryland, College Park.
Regular Languages Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 3 Comments, additions and modifications.
Strings and Languages Operations
Regular Languages Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 3 Comments, additions and modifications.
LING 438/538 Computational Linguistics Sandiway Fong Lecture 12: 10/5.
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:
1 Regular Expressions/Languages Regular languages –Inductive definitions –Regular expressions syntax semantics Not covered in lecture.
CPSC 388 – Compiler Design and Construction
Chapter 2 Languages.
Lexical Analysis CSE 340 – Principles of Programming Languages Fall 2015 Adam Doupé Arizona State University
1 Syntax Specification Regular Expressions. 2 Phases of Compilation.
CS/IT 138 THEORY OF COMPUTATION Chapter 1 Introduction to the Theory of Computation.
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,
1 Chapter 1 Automata: the Methods & the Madness Angkor Wat, Cambodia.
Formal Methods in SE Theory of Automata Qasiar Javaid Assistant Professor Lecture # 06.
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,…}
Introduction to CS Theory Lecture 3 – Regular Languages Piotr Faliszewski
Automata, Computability, & Complexity by Elaine Rich ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Slides provided by author Slides edited for.
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} =
CS 3813: Introduction to Formal Languages and Automata
Introduction to Language Theory
Module 2 How to design Computer Language Huma Ayub Software Construction Lecture 8.
L ECTURE 3 Chapter 4 Regular Expressions. I MPORTANT T ERMS Regular Expressions Regular Languages Finite Representations.
1 Module 14 Regular languages –Inductive definitions –Regular expressions syntax semantics.
Recursive Definitions & Regular Expressions (RE)
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.
Lecture 02: Theory of Automata:08 Theory of Automata.
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 2 Mälardalen University 2010.
Chapter 3 Regular Expressions, Nondeterminism, and Kleene’s Theorem Copyright © 2011 The McGraw-Hill Companies, Inc. Permission required for reproduction.
November 2003Computational Morphology III1 CSA405: Advanced Topics in NLP Xerox Notation.
Lecture # Book Introduction to Theory of Computation by Anil Maheshwari Michiel Smid, 2014 “Introduction to computer theory” by Daniel I.A. Cohen.
Theory of computation Introduction theory of computation: It comprises the fundamental mathematical properties of computer hardware, software,
Lecture # 4.
Mathematical Foundations of Computer Science Chapter 3: Regular Languages and Regular Grammars.
Lecture 2 Theory of AUTOMATA
Week 13 - Wednesday.  What did we talk about last time?  Exam 3  Before review:  Graphing functions  Rules for manipulating asymptotic bounds  Computing.
Lecture 02: Theory of Automata:2014 Asif Nawaz Theory of Automata.
Lecture 03: Theory of Automata:2014 Asif Nawaz Theory of Automata.
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 2. Formal Languages Dept. of Computer Engineering, Hansung University, Sung-Dong Kim.
Chapter 1 INTRODUCTION TO THE THEORY OF COMPUTATION.
Pumping Lemma.
Theory of Computation Lecture #
Lecture 1 Theory of Automata
Languages Prof. Busch - LSU.
Languages Costas Busch - LSU.
Formal Language & Automata Theory
Theory of Automata.
Regular Expressions (Examples)
LANGUAGES Prepared by: Paridah Samsuri Dept. of Software Engineering
Chapter Seven: Regular Expressions
Assume that p, q, and r are in
Chapter Five: Nondeterministic Finite Automata
Pumping Lemma.
CS 250, Discrete Structures, Fall 2011 Nitesh Saxena
Introduction Reading: Sections 1.5 – 1.7.
Chapter 1 Introduction to the Theory of Computation
CSC312 Automata Theory Lecture # 2 Languages.
Welcome to ! Theory Of Automata Irum Feroz
Languages Fall 2018.
Presentation transcript:

Introduction and Chapter One: Fundamentals Formal Language, chapter 1, slide 1

No one who loves language can take much pleasure in the prospect of studying a subject called formal language. It sounds suspiciously abstract and reductionistic. It sounds as if all the transcendent beauty of language will be burned away, fired under a dry heat of definitions and theorems and proofs, until nothing is left but an ash of syntax. It sounds abstract—and it is, undeniably. Yet from this abstraction arise some of the most beautiful and enduring ideas in all of computer science. Formal Language, chapter 1, slide 2

Why Study Formal Language? Connected... ...to many other branches of knowledge Rigorous... ...mathematics with many open questions at the frontiers Useful... ...with many applications in computer systems, particularly in programming languages and compilers Accessible... ...no advanced mathematics required Stable... ...the basics have not changed much in the last thirty years Formal Language, chapter 1, slide 3

Algebraists use the words group, ring, and field in technical ways, while entomologists have precise definitions for common words like bug and fly. Although it can be slightly confusing to overload ordinary words like this, it's usually better than the alternative, which is to invent new words. So most specialized fields of study make the same choice, adding crisp, rigorous definitions for words whose common meaning is fuzzy and intuitive. The study of formal language is no exception. We use crisp, rigorous definitions for basic terms such as alphabet, string, and language. Formal Language, chapter 1, slide 4

Outline 1.1 Alphabets 1.2 Strings 1.3 Languages Formal Language, chapter 1, slide 5

Alphabets An alphabet is any finite set of symbols {0,1}: binary alphabet {0,1,2,3,4,5,6,7,8,9}: decimal alphabet ASCII, Unicode: machine-text alphabets Or just {a,b}: enough for many examples {}: a legal but not usually interesting alphabet We will usually use Σ as the name of the alphabet we’re considering, as in Σ = {a,b} Formal Language, chapter 1, slide 6

Alphabets Uninterpreted Informally, we often describe languages interpretively “the set of even binary numbers” But our goal is to describe them rigorously, and that means avoiding interpretations “the set of strings of 0s and 1s that end in 0” We don’t define what a symbol is, and we don’t ascribe meaning to symbols Formal Language, chapter 1, slide 7

Outline 1.1 Alphabets 1.2 Strings 1.3 Languages Formal Language, chapter 1, slide 8

Strings A string is a finite sequence of zero or more symbols Length of a string: |abbb| = 4 A string over the alphabet Σ means a string all of whose symbols are in Σ The set of all strings of length 2 over the alphabet {a,b} is {aa, ab, ba, bb} Formal Language, chapter 1, slide 9

Empty String The empty string is written as ε Like "" in some programming languages |ε| = 0 Don't confuse empty set and empty string: {} ≠ ε {} ≠ {ε} Formal Language, chapter 1, slide 10

Symbols And Variables Sometimes we will use variables that stand for strings: x = abbb In programming languages, syntax helps distinguish symbols from variables String x = "abbb"; In formal language, we rely on context and naming conventions to tell them apart We'll use the first letters, like a, b, and c, as symbols The last few, like x, y, and z, will be string variables Formal Language, chapter 1, slide 11

Concatenation The concatenation of two strings x and y is the string containing all the symbols of x in order, followed by all the symbols of y in order We show concatenation just by writing the strings next to each other If x = abc and y = def, then xy = abcdef For any x, εx = xε = x Formal Language, chapter 1, slide 12

Numbers We use N to denote the set of natural numbers: N = {0, 1, …} Formal Language, chapter 1, slide 13

Exponents We use N to denote the set of natural numbers: N = {0, 1, …} Exponent n concatenates a string with itself n times If x = ab, then x0 = ε x1 = x = ab x2 = xx = abab, etc. We use parentheses for grouping exponentiations (assuming that Σ does not contain the parentheses) (ab)7 = ababababababab Formal Language, chapter 1, slide 14

Outline 1.1 Alphabets 1.2 Strings 1.3 Languages Formal Language, chapter 1, slide 15

Languages A language is a set of strings over some fixed alphabet Not restricted to finite sets: in fact, finite sets are not usually interesting languages All our alphabets are finite, and all our strings are finite, but most of the languages we're interested in are infinite Formal Language, chapter 1, slide 16

Kleene Star The Kleene closure of an alphabet Σ, written as Σ*, is the language of all strings over Σ {a}* is the set of all strings of zero or more as: {ε, a, aa, aaa, …} {a,b}* is the set of all strings of zero or more symbols, each of which is either a or b = {ε, a, b, aa, bb, ab, ba, aaa, …} x ∈ Σ* means x is a string over Σ Unless Σ = {}, Σ* is infinite Formal Language, chapter 1, slide 17

Set Formers A set written with extra constraints or conditions limiting the elements of the set Not the rigorous definitions we're looking for, but a useful notation anyway: {x ∈ {a, b}* | |x| ≤ 2} = {ε, a, b, aa, bb, ab, ba} {xy | x ∈ {a, aa} and y ∈ {b, bb}} = {ab, abb, aab, aabb} {x ∈ {a, b}* | x contains one a and two bs} = {abb, bab, bba} {anbn | n ≥ 1} = {ab, aabb, aaabbb, aaaabbbb, ...} Formal Language, chapter 1, slide 18

Free Variables in Set Formers Unless otherwise constrained, exponents in a set former are assumed to range over all N Examples {(ab)n} = {ε, ab, abab, ababab, abababab, ...} {anbn} = {ε, ab, aabb, aaabbb, aaaabbbb, ...} Formal Language, chapter 1, slide 19

The Quest Set formers are relatively informal They can be vague, ambiguous, or self- contradictory A big part of our quest in the study of formal language is to develop better tools for defining languages Formal Language, chapter 1, slide 20