Three Basic Concepts Languages Grammars Automata.

Slides:



Advertisements
Similar presentations
Chapter 5 Pushdown Automata
Advertisements

1 Lecture 32 Closure Properties for CFL’s –Kleene Closure construction examples proof of correctness –Others covered less thoroughly in lecture union,
YES-NO machines Finite State Automata as language recognizers.
CFGs and PDAs Sipser 2 (pages ). Long long ago…
1 Languages. 2 A language is a set of strings String: A sequence of letters Examples: “cat”, “dog”, “house”, … Defined over an alphabet: Languages.
Context-Free Grammars Sipser 2.1 (pages 99 – 109).
Context-Free Grammars Sipser 2.1 (pages 99 – 109).
1 Languages and Finite Automata or how to talk to machines...
January 14, 2015CS21 Lecture 51 CS21 Decidability and Tractability Lecture 5 January 14, 2015.
Chapter 3: Formal Translation Models
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
Finite State Machines Data Structures and Algorithms for Information Processing 1.
Regular Model Checking Ahmed Bouajjani,Benget Jonsson, Marcus Nillson and Tayssir Touili Moran Ben Tulila
Formal Grammars Denning, Sections 3.3 to 3.6. Formal Grammar, Defined A formal grammar G is a four-tuple G = (N,T,P,  ), where N is a finite nonempty.
Languages & Strings String Operations Language Definitions.
Finite-State Machines with No Output Longin Jan Latecki Temple University Based on Slides by Elsa L Gunter, NJIT, and by Costas Busch Costas Busch.
Finite-State Machines with No Output
::ICS 804:: Theory of Computation - Ibrahim Otieno SCI/ICT Building Rm. G15.
CS490 Presentation: Automata & Language Theory Thong Lam Ran Shi.
CS/IT 138 THEORY OF COMPUTATION Chapter 1 Introduction to the Theory of Computation.
CSC312 Automata Theory Lecture # 2 Languages.
Lecture Two: Formal Languages Formal Languages, Lecture 2, slide 1 Amjad Ali.
Pushdown Automata (PDAs)
Languages, Grammars, and Regular Expressions Chuck Cusack Based partly on Chapter 11 of “Discrete Mathematics and its Applications,” 5 th edition, by Kenneth.
1 Context-Free Languages Not all languages are regular. L 1 = {a n b n | n  0} is not regular. L 2 = {(), (()), ((())),...} is not regular.  some properties.
Grammars CPSC 5135.
Languages & Grammars. Grammars  A set of rules which govern the structure of a language Fritz Fritz The dog The dog ate ate left left.
CS 3813: Introduction to Formal Languages and Automata
Introduction to Language Theory
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 2 Mälardalen University 2006.
Part VII. Models for Context-Free Languages 1/50.
Push-down Automata Section 3.3 Fri, Oct 21, 2005.
1 Simplification of Context-Free Grammars Some useful substitution rules. Removing useless productions. Removing -productions. Removing unit-productions.
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
Grammars A grammar is a 4-tuple G = (V, T, P, S) where 1)V is a set of nonterminal symbols (also called variables or syntactic categories) 2)T is a finite.
1 Pushdown Automata There are context-free languages that are not regular. Finite automata cannot recognize all context-free languages.
Finite State Machines 1.Finite state machines with output 2.Finite state machines with no output 3.DFA 4.NDFA.
Modeling Computation: Finite State Machines without Output
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 3 Mälardalen University 2007.
CS 154 Formal Languages and Computability February 4 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron.
Mathematical Foundations of Computer Science Chapter 3: Regular Languages and Regular Grammars.
1 Section 13.1 Turing Machines A Turing machine (TM) is a simple computer that has an infinite amount of storage in the form of cells on an infinite tape.
1.2 Three Basic Concepts Languages start variables Grammars Let us see a grammar for English. Typically, we are told “a sentence can Consist.
1 Turing Machines and Equivalent Models Section 13.1 Turing Machines.
CS 154 Formal Languages and Computability February 9 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron.
BİL711 Natural Language Processing1 Regular Expressions & FSAs Any regular expression can be realized as a finite state automaton (FSA) There are two kinds.
Akram Salah ISSR Basic Concepts Languages Grammar Automata (Automaton)
Theory of Languages and Automata By: Mojtaba Khezrian.
1 Finite Automata. 2 Introductory Example An automaton that accepts all legal Pascal identifiers: Letter Digit Letter or Digit "yes" "no" 2.
Week 14 - Friday.  What did we talk about last time?  Simplifying FSAs  Quotient automata.
Chapter 2. Formal Languages Dept. of Computer Engineering, Hansung University, Sung-Dong Kim.
Pushdown Automata - like NFA-  but also has a stack - transition takes the current state, the current input symbol, and the top-of-the-stack symbol (which.
Chapter 1 INTRODUCTION TO THE THEORY OF COMPUTATION.
Recap: Nondeterministic Finite Automaton (NFA) A deterministic finite automaton (NFA) is a 5-tuple (Q, , ,s,F) where: Q is a finite set of elements called.
6. Pushdown Automata CIS Automata and Formal Languages – Pei Wang.
Finite Automata.
Theory of Computation Lecture #
BCT 2083 DISCRETE STRUCTURE AND APPLICATIONS
Languages.
CIS Automata and Formal Languages – Pei Wang
Chapter 7 PUSHDOWN AUTOMATA.
REGULAR LANGUAGES AND REGULAR GRAMMARS
A HIERARCHY OF FORMAL LANGUAGES AND AUTOMATA
CSE322 LEFT & RIGHT LINEAR REGULAR GRAMMAR
Principles of Computing – UFCFA3-30-1
Chapter Five: Nondeterministic Finite Automata
Finite-State Machines with No Output
CSC312 Automata Theory Lecture # 2 Languages.
What is it? The term "Automata" is derived from the Greek word "αὐτόματα" which means "self-acting". An automaton (Automata in plural) is an abstract self-propelled.
Presentation transcript:

Three Basic Concepts Languages Grammars Automata

Languages Alphabet: a finite and nonempty set of symbols  = {a, b} String: finite sequence of symbols from  w = abaaa : empty string *: the set of all strings on  (+ = *  {})

Languages Language: a subset L of * Sentence: a string in L

Languages Example 1:  = {a, b} * = {, a, b, aa, ab, ba, aaa, ...} L1 = {a, aa, aab} (finite language) L2 = {anbn | n  0} = {, ab, aabb, ...}

Languages Language concatenation: L1L2 = {xy | xL1, yL2} Ln = L L ... L (n times) L0 = {}

Languages Example 2: L = {anbn | n  0}

Languages Example 2: L = {anbn | n  0} L2 = {anbnambm | n  0, m  0}

Languages Star-closure: L* = L0  L1  L2 ... Positive closure:

Grammars A grammar for a natural language tells us whether a particular sentence is well-formed or not. <sentence>  <noun-phrase><predicate> <noun-phrase>  <article><noun> <predicate>  <verb> <article>  a | the <noun>  boy | dog <verb>  runs | walks

Grammars Formal grammar: G = (V, T, S, P) V: finite set of variables T: finite set of terminal symbols SV: start variable P: finite set of productions

Grammars Productions: x  y x(VT)+ y(VT)* w = uxv derives z = uyv w  z w1 * wn (w1  w2  ...  wn | w1 = wn) w1 + wn

Grammars Generated language: G = (V, T, S, P) L(G) = {wT* | S * w} Derivation: S  w1  w2  ...  wn  wL(G) Sentential forms: S, w1, w2, ..., wn (containing variables)

Grammars Example 3: G = ({S}, {a, b}, S, P) P: S  aSb S   S  aSb  aaSbb  aabb aabb: sentence aaSbb: sentential form

Grammars Example 3: G = ({S}, {a, b}, S, P) P: S  aSb S  

Grammars Example 3: G = ({S}, {a, b}, S, P) P: S  aSb S   L(G) = {anbn | n  0}

Grammars Example 4: G1 = ({A, S}, {a, b}, S, P1) P1: S  aAb |  A  aAb | 

Grammars Example 4: G1 = ({A, S}, {a, b}, S, P1) P1: S  aAb |  A  aAb |  L(G1) = {anbn | n  0} G and G1 are equivalent

Grammars Example 5: G2 = ({S}, {a, b}, S, P2) P2: S  SS S   S  bSa S  aSb S  bSa

Grammars Example 5: G2 = ({S}, {a, b}, S, P2) P2: S  SS S   S  bSa S  aSb S  bSa L(G2) = {w | na(w) = nb(w)}

Automata An abstract model of digital computer: Input file Control unit Storage Output

Automata Input file: is divided into squares. Input is a string over a given alphabet. Each input square holds a symbol. The symbols are read from left to right, one at a time. The end of the input string can be detected.

Automata Storage: consists of an unlimited number of cells. Each cell can hold a symbol from an alphabet (which can be different from the input alphabet). The contents of the storage cells can be read and changed.

Automata Control unit: has a finite number of internal states. Can be in any one of the internal states. Can change state in some defined manner.

current state  input symbol  storage info  next state Automata Transition function: current state  input symbol  storage info  next state Output may be produced Info in the storage may be changed Configuration: current state  input symbol  storage info Move: current configuration  next configuration

Automata General types of automata: Accepter: yes/no output Transducer: string of symbols as output Deterministic: single move Non-deterministic: multiple moves

Homework Exercises: 4, 5, 6, 8, 9, 12, 15, 17 of Section 1.2 - Linz’s book. Reading: Section 1.3 - Linz’s book. Presentation: Section 2.4 - Linz’s book (procedures mark and reduce).