Lecture 23UofH - COSC 3340 - Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 23.

Slides:



Advertisements
Similar presentations
CSC 361NFA vs. DFA1. CSC 361NFA vs. DFA2 NFAs vs. DFAs NFAs can be constructed from DFAs using transitions: Called NFA- Suppose M 1 accepts L 1, M 2 accepts.
Advertisements

CS 208: Computing Theory Assoc. Prof. Dr. Brahim Hnich Faculty of Computer Sciences Izmir University of Economics.
Lecture 6 Nondeterministic Finite Automata (NFA)
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 2 Mälardalen University 2005.
1 1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 3 School of Innovation, Design and Engineering Mälardalen University 2012.
Theory Of Automata By Dr. MM Alam
Lexical Analysis - Scanner Computer Science Rensselaer Polytechnic Compiler Design Lecture 2.
Lecture 3UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 3.
CS5371 Theory of Computation
Courtesy Costas Busch - RPI1 Non Deterministic Automata.
Fall 2006Costas Busch - RPI1 Deterministic Finite Automata And Regular Languages.
Lecture 3 Goals: Formal definition of NFA, acceptance of a string by an NFA, computation tree associated with a string. Algorithm to convert an NFA to.
1 Languages and Finite Automata or how to talk to machines...
Lecture 3 Goals: Formal definition of NFA, acceptance of a string by an NFA, computation tree associated with a string. Algorithm to convert an NFA to.
CS 490: Automata and Language Theory Daniel Firpo Spring 2003.
Fall 2006Costas Busch - RPI1 Non-Deterministic Finite Automata.
1 Non-Deterministic Automata Regular Expressions.
Lecture 9UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 9.
Lecture 27UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 27.
Finite Automata Costas Busch - RPI.
Lecture 5UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 5.
Lecture 4UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 4.
1 Non-Deterministic Finite Automata. 2 Alphabet = Nondeterministic Finite Automaton (NFA)
UofH - COSC Dr. Verma COSC 3340: Introduction to Theory of Computation Rakesh Verma Computer Science Department University of Houston URL:
Nondeterministic Finite Automata CS 130: Theory of Computation HMU textbook, Chapter 2 (Sec 2.3 & 2.5)
Lecture 2UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 2.
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
REGULAR LANGUAGES.
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 3 Mälardalen University 2010.
CMSC 330: Organization of Programming Languages Theory of Regular Expressions Finite Automata.
Natural Language Processing Lecture 4 : Regular Expressions and Automata.
Chapter 3 Regular Expressions, Nondeterminism, and Kleene’s Theorem Copyright © 2011 The McGraw-Hill Companies, Inc. Permission required for reproduction.
Lecture 11UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 11.
Lecture 2 Overview Topics What I forgot from last lecture Proof techniques continued Alphabets, strings, languages Automata June 2, 2015 CSCE 355 Foundations.
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 3 Mälardalen University 2007.
Lecture 14UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 14.
Nondeterministic Finite Automata (NFAs). Reminder: Deterministic Finite Automata (DFA) q For every state q in Q and every character  in , one and only.
Lecture 24UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 24.
1 Compiler Construction (CS-636) Muhammad Bilal Bashir UIIT, Rawalpindi.
CS 404Ahmed Ezzat 1 CS 404 Introduction to Compiler Design Lecture 1 Ahmed Ezzat.
LECTURE 5 Scanning. SYNTAX ANALYSIS We know from our previous lectures that the process of verifying the syntax of the program is performed in two stages:
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 3 Mälardalen University 2006.
1 Finite Automata. 2 Introductory Example An automaton that accepts all legal Pascal identifiers: Letter Digit Letter or Digit "yes" "no" 2.
Theory of Computation Automata Theory Dr. Ayman Srour.
Theory of Languages and Automata By: Mojtaba Khezrian.
Introduction to Automata Theory Theory of Computation Lecture 3 Tasneem Ghnaimat.
COSC 3340: Introduction to Theory of Computation
Lecture2 Regular Language
Non Deterministic Automata
COSC 3340: Introduction to Theory of Computation
Pushdown Automata PDAs
Pushdown Automata PDAs
COSC 3340: Introduction to Theory of Computation
COSC 3340: Introduction to Theory of Computation
COSC 3340: Introduction to Theory of Computation
COSC 3340: Introduction to Theory of Computation
COSC 3340: Introduction to Theory of Computation
CSE322 Definition and description of finite Automata
Non Deterministic Automata
Finite Automata.
COSC 3340: Introduction to Theory of Computation
COSC 3340: Introduction to Theory of Computation
COSC 3340: Introduction to Theory of Computation
COSC 3340: Introduction to Theory of Computation
COSC 3340: Introduction to Theory of Computation
Non Deterministic Automata
COSC 3340: Introduction to Theory of Computation
COSC 3340: Introduction to Theory of Computation
COSC 3340: Introduction to Theory of Computation
Presentation transcript:

Lecture 23UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 23

UofH - COSC Dr. Verma 2 Tree Automata The automata concept is general and powerful! (should be in every CS student toolkit) Just as DFAs and NFAs work on strings, we can define automata that process trees, DAGs, graphs, matrices, etc. We illustrate this generality thru tree automata

Lecture 23UofH - COSC Dr. Verma 3 Tree Automata Process trees instead of strings Can be bottom-up (we consider) or top-down The tree automata TA has: – a finite set of states – 0 or more special states - final states – input alphabet – transition table containing rules of two kinds: a -> q, f(q1,…,qn) -> q

Lecture 23UofH - COSC Dr. Verma 4 Informally -- How does a TA work? TA works from the leaves to the root of the tree. TA goes into a loop until the entire tree is read. – In each step, TA consults its transition table and determines states for nodes higher up the tree based on (f, q1,…,qn) where f – symbol at the node q1, …, qn – states at the children of the node

Lecture 23UofH - COSC Dr. Verma 5 How does a TA work? (contd.) For deterministic TA, after reading input tree, – if TA state final, input accepted – if TA state not final, input rejected For nondeterministic TA, as long as one accepting computation exits, input is accepted; if none, input is rejected. Language of TA -- set of all trees accepted by TA. TAs have applications in XML, Xpath, compilers, logic, and verification

Lecture 23UofH - COSC Dr. Verma 6 Formal definition of NTA NTA M = (Q, , Δ, F) Where, – Q is a finite set of states –  is the input alphabet – F  Q is set of final states – Δ is a set of transition rules of two kinds a -> q where a is in  and q is in Q f(q1, …, qn) -> q where f is in  and q, qi’s in Q

Lecture 23UofH - COSC Dr. Verma 7 Formal definition of L(M) We can define the yields in one-step relation between two trees Take its reflexive-transitive closure and define L(M) Reference: Tree Automata and Applications book by Comon et al. (available on the web)

Lecture 23UofH - COSC Dr. Verma 8 DFAs are special case of TA The DFA symbols become unary functions The TA has rules: – a(q0) -> q1 – b(q0) -> q0 – a(q1) -> q0 – b(q1) -> q1 – q0 is final state

Lecture 23UofH - COSC Dr. Verma 9 Example of TA – boolean formula evaluation 0 -> q0, 1 -> q1 not(q0) -> q1, not(q1) -> q0 and(q0, q0) -> q0, …, and(q1, q1) -> q1 or(q0, q0) -> q0, …, or(q1, q1) -> q1 q1 is final state Evaluate: or(and(not(0), not(1)), and(0, 0))

Lecture 23UofH - COSC Dr. Verma 10 More generally … We can have rules of the form: – expr1 -> expr2, where lhs and rhs are expressions containing variables x, y, z and function symbols f, g, h, a, … Example: x + 0 -> x and x + -x -> 0 These rules are applied using pattern matching A derivation: (0 + -0) + 0 => => 0

Lecture 23UofH - COSC Dr. Verma 11 How powerful are such rules? As powerful as a Turing Machine! (Reference: TCS paper by Max Dauchet) An interpreter, called LRR, for such rules has been implemented by me and my students – LRR saves every rule application in a compact data structure – Can be used for programming or verification LRR Demo available for interested students (see me)