ESSLLI 2007 COURSE READER. ESSLLI is the Annual Summer School of FoLLI, The Association for Logic, Language and Information

Similar documents
Some basic notation and terminology. Deterministic Finite Automata. COMP218: Decision, Computation and Language Note 1

Foundations of XML Types: Tree Automata

e t dt e t dt = lim e t dt T (1 e T ) = 1

Languages That Are and Are Not Context-Free

Chapter 2: Evaluative Feedback

1. For each of the following theorems, give a two or three sentence sketch of how the proof goes or why it is not true.

Average & instantaneous velocity and acceleration Motion with constant acceleration

Motion. Part 2: Constant Acceleration. Acceleration. October Lab Physics. Ms. Levine 1. Acceleration. Acceleration. Units for Acceleration.

CMPSCI 250: Introduction to Computation. Lecture #31: What DFA s Can and Can t Do David Mix Barrington 9 April 2014

Theory of Computation Regular Languages. (NTU EE) Regular Languages Fall / 38

Contraction Mapping Principle Approach to Differential Equations

The solution is often represented as a vector: 2xI + 4X2 + 2X3 + 4X4 + 2X5 = 4 2xI + 4X2 + 3X3 + 3X4 + 3X5 = 4. 3xI + 6X2 + 6X3 + 3X4 + 6X5 = 6.

Theory of Computation Regular Languages

Properties of Logarithms. Solving Exponential and Logarithmic Equations. Properties of Logarithms. Properties of Logarithms. ( x)

ENGR 1990 Engineering Mathematics The Integral of a Function as a Function

September 20 Homework Solutions

0 for t < 0 1 for t > 0

two values, false and true used in mathematical logic, and to two voltage levels, LOW and HIGH used in switching circuits.

AUTOMATA AND LANGUAGES. Definition 1.5: Finite Automaton

Homework 3 Solutions

REAL ANALYSIS I HOMEWORK 3. Chapter 1

Explore 2 Proving the Vertical Angles Theorem

Fundamentals of Computer Science

5.1-The Initial-Value Problems For Ordinary Differential Equations

Myhill-Nerode Theorem

Formal Languages and Automata

CHAPTER 1 Regular Languages. Contents. definitions, examples, designing, regular operations. Non-deterministic Finite Automata (NFA)

Theory of! Partial Differential Equations!

Streamed Validation of XML Documents

Some Inequalities variations on a common theme Lecture I, UL 2007

Chapter 2. Motion along a straight line. 9/9/2015 Physics 218

NFA DFA Example 3 CMSC 330: Organization of Programming Languages. Equivalence of DFAs and NFAs. Equivalence of DFAs and NFAs (cont.

Exact Minimization of # of Joins

Solutions to Problems from Chapter 2

11.1 Finite Automata. CS125 Lecture 11 Fall Motivation: TMs without a tape: maybe we can at least fully understand such a simple model?

First Midterm Examination

Worked out examples Finite Automata

Theory of! Partial Differential Equations-I!

CS375: Logic and Theory of Computing

Convolution. Lecture #6 2CT.3 8. BME 333 Biomedical Signals and Systems - J.Schesser

Homework 4. 0 ε 0. (00) ε 0 ε 0 (00) (11) CS 341: Foundations of Computer Science II Prof. Marvin Nakayama

NFAs continued, Closure Properties of Regular Languages

Some Theory of Computation Exercises Week 1

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

Regular Languages and Applications

Lecture #6: Continuous-Time Signals

NFAs continued, Closure Properties of Regular Languages

CMSC 330: Organization of Programming Languages

1.0 Electrical Systems

MTH 146 Class 11 Notes

Nondeterminism. Nondeterministic Finite Automata. Example: Moves on a Chessboard. Nondeterminism (2) Example: Chessboard (2) Formal NFA

Types of Finite Automata. CMSC 330: Organization of Programming Languages. Comparing DFAs and NFAs. NFA for (a b)*abb.

Non-deterministic Finite Automata

An Excursion into Set Theory using a Constructivist Approach

CS311 Computational Structures Regular Languages and Regular Grammars. Lecture 6

CSE : Exam 3-ANSWERS, Spring 2011 Time: 50 minutes

CS 301. Lecture 04 Regular Expressions. Stephen Checkoway. January 29, 2018

1. Find a basis for the row space of each of the following matrices. Your basis should consist of rows of the original matrix.

3 Regular expressions

We just finished the Erdős-Stone Theorem, and ex(n, F ) (1 1/(χ(F ) 1)) ( n

Learning Goals. Relational Query Languages. Formal Relational Query Languages. Formal Query Languages: Relational Algebra and Relational Calculus

A Kalman filtering simulation

BİL 354 Veritabanı Sistemleri. Relational Algebra (İlişkisel Cebir)

Harvard University Computer Science 121 Midterm October 23, 2012

CS 311 Homework 3 due 16:30, Thursday, 14 th October 2010

Closure Properties of Regular Languages

Revision Sheet. (a) Give a regular expression for each of the following languages:

CHAPTER 1 Regular Languages. Contents

Chapter Direct Method of Interpolation

Aho-Corasick Automata

Chapter 2 Summary. Carnegie Learning

Lecture 3 ( ) (translated and slightly adapted from lecture notes by Martin Klazar)

CSC 373: Algorithm Design and Analysis Lecture 9

CS 275 Automata and Formal Language Theory

A Structural Approach to the Enforcement of Language and Disjunctive Constraints

2D Motion WS. A horizontally launched projectile s initial vertical velocity is zero. Solve the following problems with this information.

Types of Finite Automata. CMSC 330: Organization of Programming Languages. Comparing DFAs and NFAs. Comparing DFAs and NFAs (cont.) Finite Automata 2

CS 275 Automata and Formal Language Theory

Coalgebra, Lecture 15: Equations for Deterministic Automata

Java II Finite Automata I

Exercises Chapter 1. Exercise 1.1. Let Σ be an alphabet. Prove wv = w + v for all strings w and v.

Longest Common Prefixes

FURTHER GENERALIZATIONS. QI Feng. The value of the integral of f(x) over [a; b] can be estimated in a variety ofways. b a. 2(M m)

ECE Microwave Engineering. Fall Prof. David R. Jackson Dept. of ECE. Notes 10. Waveguides Part 7: Transverse Equivalent Network (TEN)

Lecture 08: Feb. 08, 2019

SOLUTIONS TO ECE 3084

Physic 231 Lecture 4. Mi it ftd l t. Main points of today s lecture: Example: addition of velocities Trajectories of objects in 2 = =

Crossing the Bridge between Similar Games

Finite Automata-cont d

State Minimization for DFAs

( ) ( ) ( ) ( ) ( ) ( y )

PHYSICS 1210 Exam 1 University of Wyoming 14 February points

Chapter 7: Solving Trig Equations

Regular languages refresher

ad = cb (1) cf = ed (2) adf = cbf (3) cf b = edb (4)

XML and Databases. Lecture 5 XML Validation using Automata. Sebastian Maneth NICTA and UNSW

Name Ima Sample ASU ID

1. Consider a PSA initially at rest in the beginning of the left-hand end of a long ISS corridor. Assume xo = 0 on the left end of the ISS corridor.

NON-DETERMINISTIC FSA

4.8 Improper Integrals

Transcription:

ESSLLI 2007 19h Europen Summer School in Logic, Lnguge nd Inormion Augus 6-17, 2007 hp://www.cs.cd.ie/esslli2007 Triniy College Dulin Irelnd COURSE READER ESSLLI is he Annul Summer School o FoLLI, The Associion or Logic, Lnguge nd Inormion hp://www.olli.org

Ouline Auom nd Logic on Trees 1 Inroducion Wim Mrens 1 Sijn Vnsummeren 2 2 Rnked Tree Auom 1 Universiy o Dormund, Germny 2 Hssel Universiy, Belgium 3 Properies nd Algorihms Ouline Wh m I doing here? 1 Inroducion 2 Rnked Tree Auom You know somehing ou inie uom on srings You wn o know more ou inie uom on rees 3 Properies nd Algorihms D on he we is in ree-srucured XML <muppe creor="henson"> <nme> Kermi </nme> <niml> Frog </niml> </muppe> creor Henson muppe nme Kermi niml Frog They re he sis or XML schem lnguges nd vlidion Form oundion or XML query lnguges Aid in sic veriicion

A sis or XML schem lnguges Consrin: Every muppe node mus hve creor nd nme, nd my hve n opionl niml. Exmples: muppe muppe A sis or XML schem lnguges Consrin: Every muppe node mus hve creor nd nme, nd my hve n opionl niml. Mny schem lnguges: DTD, XML Schem, Relx NG,... creor nme niml creor nme All nurlly modeled nd execued y ree uom Henson Kermi Frog Henson Miss Piggy As oundion or XML query lnguges Query: Rerieve ll muppe nmes. Exmples: As oundion or XML query lnguges Query: Rerieve ll muppe nmes. creor muppe nme niml muppe creor nme Lnguges sed on Tree Auom: Mondic dlog, Query uom Henson Kermi Frog Henson Miss Piggy In summry... Tree uom provide he underlying guiding principles or d on he We Aid in Sic Veriicion. Given: Progrm P, inpu schem I, oupu schem O. Quesion: Is P() O, or every I? Like he relionl clculus (i.e., irs-order logic) nd he relionl lger provide he underlying principles or relionl d. Sic Type-checking: XDuce, CDuce, XQuery, XLST,...

Who re you guys nywy? Course Overview Dy 1: Bsics on Rnked Tree Auom Dy 2: Algorihms on Rnked Tree Auom Dy 3: Connecion wih Mondic Second-Order Logic Dy 4: Bsics nd Algorihms on Unrnked Tree Auom Dy 5: XML-reled pplicions Wim Mrens Sijn Vnsummeren Ouline Wrmup: Auom on Srings srings wih n even numer o s 1 Inroducion 2 Rnked Tree Auom sr q 0 q 1 3 Properies nd Algorihms Trnsiion Rules q 0 q1 q 0 q0 ec... From Srings o Trees: Binry Trees From Srings o Trees: Binry Trees inry rees wih n even numer o s even even odd even odd even even # # # # # # # # How do we pu his ino rnsiion rules? inry rees wih n even numer o s even even odd even odd even even # # # # # # # # Trnsiion rules (even,odd) even (le -rnsiion) (even,even) odd (righ -rnsiion) ec...

Rnked Trees Rnked Alphe Wh re rnked rees? A rnked lphe symol is ormlizion o uncion cll A rnked symol...... is symol ogeher wih n ineger rnk() A uncion cll (,) is rnked ree rnk() ell us he numer o children is llowed o hve A uncion cll (g(,,c),h(i)) is rnked ree g h c i Noion (k) : symol wih rnk() = k Rnked Alphe: Exmple Rnked Tree Auom Exmple Alphe: { (2), (2),c (3),# (0) } Allowed Tree: # # # # c # # # # # # A rnked ree uomon A consiss o Alphe(A): inie se o lphe symols Ses(A): inie se o ses where Rules(A): inie se o rnsiion rules Finl(A): inie se o inl ses Rules(A) re o he orm (q 1,...,q k ) (k) q (I k = 0, we wrie ε (0) q) Rnked Tree Auom Terminology How do hey work? Exmple rue ε ε (,) (, )... (, ) lse rue lse rue rue lse rue I roo is leled y q Finl(A): ACCEPT Terminology Lnguge(A): se o rees cceped y A Regulr ree lnguge: Se o rees S such h S = Lnguge(A) or some rnked ree uomon A

Exmple Deerminisic Rnked Tree Auomon Tree uomon A over { (2), (2),c (3),# (0) } or rees wih even numer o s Alphe(A): {,,c,#} Ses(A): {even,odd} Finl(A): {even} Rules(A): (even,even) odd (even,even) even (even,even,even) c even (even,odd) even (even,odd) odd (even,even,odd) c odd (odd,even) even (odd,even) odd (even,odd,even) c odd (odd,odd) odd (odd,odd) even (even,odd,odd) c even ε # even... Deerminisic: No wo rules o he orm or dieren ses q nd q (q 1,...,q k ) (k) q (q 1,...,q k ) (k) q Deerminisic Rnked Tree Auomon: Exmple Ouline Exmple (even,even) odd (even,even) even (even,even,even) c even (even,odd) even (even,odd) odd (even,even,odd) c odd (odd,even) even (odd,even) odd (even,odd,even) c odd (odd,odd) odd (odd,odd) even (even,odd,odd) c even ε # even... 1 Inroducion 2 Rnked Tree Auom 3 Properies nd Algorihms Some immedie nurl quesions Generl quesions: Are non-deerminisic nd deerminisic rnked ree uom equivlen? Are regulr ree lnguges closed under Boolen operions? Does i mer wheher we red rees op-down or oom-up? Do we hve pumping lemm? Cn ree uom e minimized? Complexiy quesions: Wh is he complexiy o deciding wheher... uomon A cceps ree? uomon A cceps ree ll? uomon A cceps ll rees o uomon B? se o uom ccep common ree? Cn Rnked Tree Auom e Deerminized? Tke his non-deerminisic Tree Auomon: Exmple Auomon wih Finl(A) = q nd rules ε c q q q q q q q (q,q) q

Cn Rnked Tree Auom e Deerminized? Rnked Auom cn e Deerminized Exmple Auomon wih Finl(A) = q nd rules ε c q q q q q q q (q,q) q Deerminizion Ses(A de ) = {{q},{q,q },{q,q,q }} nd rules ε c {q} {q} {q,q } {q,q } {q,q,q } {q,q,q } {q,q,q } (S 1,S 2 ) {q} or ll S 1,S 2 Ses(A) Theorem From ech non-deerminisic ree uomon, n equivlen deerminisic ree uomon cn e consruced in exponenil ime Corollry Non-deerminisic nd deerminisic ree uom recognize he sme lnguges Rnked Auom cn e Deerminized Theorem Rnked Auom cn e deerminized in exponenil ime Is his opiml? n ( + ). ( + ) ( + ). ( + ) # Nurl Quesions Generl quesions: Are non-deerminisic nd deerminisic rnked ree uom equivlen? Yes. Are regulr ree lnguges closed under Boolen operions? Does i mer wheher we red rees op-down or oom-up? Do we hve pumping lemm? Cn ree uom e minimized? Complexiy quesions: Wh is he complexiy o deciding wheher... uomon A cceps ree? uomon A cceps ree ll? uomon A cceps ll rees o uomon B? se o uom ccep common ree? Closure under Union nd Inersecion: Produc Consrucion Exmple Auomon A: even numer o s (even,even) odd Auomon B: even numer o s (even,even) even Closure under Union nd Inersecion Produc Consrucion: Given A, B, consruc A B Alphe(A B) = Alphe(A) Alphe(B) Ses(A B) = Ses(A) Ses(B) Finl(A B) = {(s A,s B ) s A Finl(A) s B Finl(B)} Rules(A B) = { even even odd even even even ( (s 1 A,s 1 B ),...,(sk A,sk B )) (k) (s A,s B ) (sa 1,...,sk A ) (k) s A Rules(A) ( (even,even),(even,even) ) (odd,even) (sb 1,...,sk B ) (k) s B Rules(B)}

Closure under Union nd Inersecion: Union Closure under Union nd Inersecion: Inersecion Given A, B, consruc A B Alphe(A B) = Alphe(A) Alphe(B) Ses(A B) = Ses(A) Ses(B) Rules(A B) = { ( (s 1 A,s 1 B ),...,(sk A,sk B )) (k) (s A,s B ) (sa 1,...,sk A ) (k) s A Rules(A) (sb 1,...,sk B ) (k) s B Rules(B)} Given A, B, consruc A B Alphe(A B) = Alphe(A) Alphe(B) Ses(A B) = Ses(A) Ses(B) Rules(A B) = { ( (s 1 A,s 1 B ),...,(sk A,sk B )) (k) (s A,s B ) (sa 1,...,sk A ) (k) s A Rules(A) (sb 1,...,sk B ) (k) s B Rules(B)} Finl(A B) = {(s A,s B ) s A Finl(A) s B Finl(B)} Finl(A B) = {(s A,s B ) s A Finl(A) s B Finl(B)} Produc Consrucion: Blow-up Closure under Complemen: Compleion Produc Consrucion: Blow-up Ses(A B) = Ses(A) Ses(B) Rules(A B) Rules(A) Rules(B) Blow-up: Qudric Deiniion (Complee ree uomon) For ech (k) Alphe(A) nd q 1,...,q k Ses(A), here is rule (q 1,...,q k ) q or some q. Exmple (Incomplee (deerminisic) Tree Auomon) Tree uomon A or {(,)}: ε q (q,q ) q wih Finl(A) = q Closure under Complemen: Compleion Closure under Complemen Exmple (Incomplee (deerminisic) Tree Auomon) Tree uomon A or {(,)}: ε q (q,q ) q wih Finl(A) = q Exmple (Complemening A) Add sink se q s : ε q ε q s (q,q ) q (q,q ) q s (q,q ) q s (q,q ) q s (q,q ) q s (q,q ) q s (q,q ) q s (q,q ) q s (q s,q), q s or ll q {q,q,q s } (q,q s ), q s or ll q {q,q,q s } wih Finl(A) = {q,q s } Complemening A (1) Deerminize A (2) Complee he resul (3) Swich inl non-inl ses Complemen consrucion: Blow-up Deerminizing A: exponenil low-up (ses: 2 Ses(A) ) Compleing he resul: low-up in rules: Alphe (2 Ses(A) ) k, where k is mximl rnk Alphe(A) Swiching inl non-inl ses: liner Overll: Exponenil low-up

Nurl Quesions Generl quesions: Are non-deerminisic nd deerminisic rnked ree uom equivlen? Yes. Are regulr ree lnguges closed under Bool. operions? Yes. Does i mer wheher we red rees op-down or oom-up? Do we hve pumping lemm? Cn ree uom e minimized? Complexiy quesions: Wh is he complexiy o deciding wheher... uomon A cceps ree? uomon A cceps ree ll? uomon A cceps ll rees o uomon B? se o uom ccep common ree? Top-Down Tree Auom: Connecion o Srings Exmple (Srings re Unry Trees) cd = ((c(d))) = c d Reding srings le-o-righ = Reding rees op-down Top-Down Tree Auom Top-Down Tree Auom Exmple Exmple rue rue rue rue rue lse lse rue rue lse lse rue ε ε (,) (, ) (,) (, ) rue lse (,) (, ) (,) (, ) Ini(A) = (,) (, ) (,) (, ) rue ε lse (,) (,) (,) (,) ε We need dieren rules Top-Down Tree Auom Cn Top-Down Tree Auom Be Deerminized? A op-down ree uomon A consiss o Alphe(A): inie se o lphe symols Ses(A): inie se o ses Rules(A): inie se o rnsiion rules Ini(A): inie se o iniil ses where Top-Down Deerminisic Tree Auomon For every q Ses(A) nd Alphe(A) here s mos one rule q (k) (q 1,...,q k ) Rules(A) re o he orm q (k) (q 1,...,q k ) Top-down ree uom lso recognize ll regulr ree lnguges

Cn Top-Down Tree Auom Be Deerminized? Top-Down TA do no recognize ll regulr lnguges! Exmple c c Ini(A) = q 0 q 0 (q,q) q ε q c ε lso recognizes... c c Nurl Quesions Generl quesions: Are non-deerminisic nd deerminisic rnked ree uom equivlen? Yes. Are regulr ree lnguges closed under Bool. operions? Yes. Does i mer wheher we red rees op-down or oom-up? Yes. Do we hve pumping lemm? Cn ree uom e minimized? Complexiy quesions: Wh is he complexiy o deciding wheher... uomon A cceps ree? uomon A cceps ree ll? uomon A cceps ll rees o uomon B? se o uom ccep common ree? Pumping Lemm Pumping Lemm Deiniion (Conex) A conex is ree wih hole Deiniion (Conex Applicion) Given he conex C nd ree, C[] is oined y plugging ino C. x x One cn lso pply conex o conex: C 1 [C 2 ] The resul is new conex The Pumping Lemm Wh s he use? Lemm (Pumping Lemm) I L is regulr, here is consn k such h, or every ree L wih deph les k here is conex C 1, (non-empy) conex C 2, nd smll ree such h = C 1 [C 2 [ ]] nd or every n N, C 1 [C n 2 [ ]] is in L. Show h lnguges re no regulr. Exmple (The Usul Suspec) n. #. # n

Nurl Quesions Generl quesions: Are non-deerminisic nd deerminisic rnked ree uom equivlen? Yes. Are regulr ree lnguges closed under Bool. operions? Yes. Does i mer wheher we red rees op-down or oom-up? Yes. Do we hve pumping lemm? Yes. Cn ree uom e minimized? Complexiy quesions: Wh is he complexiy o deciding wheher... uomon A cceps ree? uomon A cceps ree ll? uomon A cceps ll rees o uomon B? se o uom ccep common ree? Minimizion: Myhill-Nerode Theorem Deiniion (Congruence) A congruence is n equivlence relion on rees closed under conex I hen : Minimizion: Myhill-Nerode Theorem Minimizion: Myhill-Nerode Theorem Deiniion (Congruence o Lnguge) I L is ree lnguge hen we deine 1 L 2 i, or ll conexs C: C[ 1 ] L C[ 2 ] L Theorem (Myhill-Nerode or Trees) The ollowing re equivlen: () L is regulr ree lnguge () L is he union o some equivlence clsses o inie index (c) he relion L is congruence o inie index Miniml uomon A or L ollows rom his clssiicion: size o A = numer o equivlence clsses o L Nurl Quesions Generl quesions: Are non-deerminisic nd deerminisic rnked ree uom equivlen? Yes. Are regulr ree lnguges closed under Bool. operions? Yes. Does i mer wheher we red rees op-down or oom-up? Yes. Do we hve pumping lemm? Yes. Cn ree uom e minimized? Yes. Complexiy quesions: Wh is he complexiy o deciding wheher... uomon A cceps ree? uomon A cceps ree ll? uomon A cceps ll rees o uomon B? se o uom ccep common ree?