Download presentation

Presentation is loading. Please wait.

Published bySkylar McWilliams Modified over 2 years ago

1
Historical Perspectives Stephen Kleene (1909-1994) Founded recursive function theory Pioneered theoretical computer science Student of Alonzo Church; was at the Institute for Advanced Study (1940) Invented regular expressions Kleene star / closure, Kleene algebra, Kleene recursion theorem, Kleene fixed point theorem, Kleene-Rosser paradox “Kleeneliness is next to Gödeliness”

3
Historical Perspectives Noam Chomsky (1928-) Linguist, philosopher, cognitive scientist, political activist, dissident, author Father of modern liguistics Pioneered formal languages Developed generative grammars Invented context-free grammars Defined the Chomsky hierarchy Influenced cognitive psychology, philosophy of language and mind Chomskyan linguistics, Chomskyan syntax, Chomskyan models Critic of U.S. foreign policy Most widely cited living scholar Eighth most-cited source overall!

6
“…I must admit to taking a copy of Noam Chomsky's ‘Syntactic Structures’ along with me on my honeymoon in 1961 … Here was a marvelous thing: a mathematical theory of language in which I could use as a computer programmer's intuition!” - Don Knuth on Chomsky’s influence

12
Formal Languages: Review Alphabet: a finite set of symbols String: a finite sequence of symbols Language: a set of strings String length: number of symbols in it String concatenation: w 1 w 2 Empty string: or ^ Language concatenation: L 1 L 2 ={w 1 w 2 | w 1 L 1, w 2 L 2 } String exponentiation: w k = ww…w (k times) Language exponentiation: L k = LL…L (k times) LL = L 2 L k =LL k-1 L 0 ={ } ={a,b} ababbaab L={a,aa,aaa,…} |aba|=3 ab ba=abba w w = w = w {1,2} {a,aa,…} ={1a,2a,1aa,2aa,…} a 3 =aaa {0,1} 32

13
Formal Languages: Review String reversal: w R Language reversal: L R ={w R | w L} Kleene closure:L * = L 0 L 1 L 2 L 3 ... L + = L 1 L 2 L 3 L 4 ... Theorem: L + = LL * Trivial language: { } Empty language: Ø All finite strings: * L * L Theorem * is countable, | * | = |Z| Theorem * is uncountable. Theorem * contains no infinite strings. Theorem: (L * ) * =L * (aabc) R =cbaa {ab,cd} R ={ba,dc} {a} * {a} + { } L=L { }=L Ø * ={ } {a,aa,…} {1,2} dovetailing diagonalization finite strings in i L * (L * ) * & (L * ) * L *

14
Finite Automata: Review Basic idea: a FA is a “machine” that changes states while processing symbols, one at a time. Finite set of states: Q = {q 0, q 1, q 3,..., q k } Transition function: : Q Q Initial state:q 0 Q Final states:F Q Finite automaton is M=(Q, , , q 0, F) Ex: an FA that accepts all odd-length strings of zeros: q0q0 q1q1 0 0 M=({q 0,q 1 }, {0}, {((q 0,0),q 1 ), ((q 1,0),q 0 )}, q 0, {q 1 }) q0q0 qiqi qjqj q1q1 qkqk

15
Finite Automata: Review FA operation: consume a string w * one symbol at a time while changing states Acceptance: end up in a final state Rejection: anything else (including hang-up / crash) Ex: FA that accepts all strings of form abababab…= (ab) * q1q1 a b M=({q 0,q 1 }, {a,b}, {((q 0,a),q 1 ), ((q 1,b),q 0 )}, q 0, {q 0 }) But M “crashes” on input string “abba”! Solution: add dead-end state to fully specify M M’=({q 0,q 1,q 2 }, {a,b}, {((q 0,a),q 1 ), ((q 1,b),q 0 ), ((q 0,b),q 2 ), ((q 1,b),q 2 ). ((q 2,a),q 2 ), ((q 2,b),q 2 ) }, q 0, {q 0 }) q0q0 q2q2 b a a,b M M’

16
Finite Automata: Review Transition function extends from symbols to strings: :Q * Q (q 0,wx) = ( (q 0,w),x) where (q i, ) = q i Language of M is L(M)={w *| (q 0,w) F} Definition: a language is regular iff it is accepted by some FA. Theorem: Complementation preserves regularity. Proof: Invert final and non-final states in fully specified FA. L(M)=(ab) * L(M’)= b(a+b) * + (a+b) * a + (a+b) * (aa+bb)(a+b) * M’ “simulates” M and does the opposite! q1q1 a b q0q0 q2q2 b a a,b M q1q1 a b q0q0 q2q2 b a M’ Why are these complements?

17
Finite Automata: Review Theorem: Intersection perserves regularity. Proof: (“parallel” simulation): Construct all super-states, one per each state pair. New super-transition function jumps among super-states, simulating old transition function Initial super state contains both old initial states. Final super states contains pairs of old final states. Resulting DFA accepts same language as original NFA (but size can be the product of two old sizes). GivenM 1 =(Q 1, , 1, q’, F 1 ) and M 2 =(Q 2, , 2, q”, F 2 ) construct M=(Q, , , q, F) Q = Q 1 Q 2 F = F 1 F 2 q=(q’,q”) :Q Q ((q i,q j ),x) = ( 1 (q i,x), 2 (q j,x)) “cross product construction”

18
Finite Automata: Review Theorem: Union preserves regularity. Proof: De Morgan's law: L 1 L 2 = L 1 L 2 Or cross-product construction, i.e., parallel simulation with F = (F 1 Q ) (Q F 2 ) Theorem: Set difference preserves regularity. Proof: Set identity L 1 – L 2 = L 1 L 2 Or cross-product construction, i.e., parallel simulation with F = (F 1 Q –F 2 )) Theorem: XOR preserves regularity. Proof: Set identity L 1 L 2 = (L 1 L 2 ) – (L 1 L 2 ) Or cross-product construction, i.e., parallel simulation with F = (F 1 Q –F 2 )) ((Q –F 1 ) F 2 ) Meta-Theorem: Identity-based proofs are easier!

19
Finite Automata: Review Non-determinism: generalizes determinism, where many “next moves” are allowed at each step: Old :Q Q New :2 Q 2 Q Computation becomes a “tree”. Acceptance: a path from root (start state) to some leaf (a final state) Ex: non-deterministically accept all strings where the 7 th symbol before the end is a “b”: q2q2 q0q0 q7q7 q3q3 q4q4 q5q5 q6q6 a,b q1q1 Input:ababbaaa ba,b Accept!

20
Finite Automata: Review Theorem: Non-determinism in FAs does not increase power. Proof: by simulation: Construct all super-states, one per each state subset. New super-transition function jumps among super-states, simulating old transition function Initial super state are those containing old initial state. Final super states are those containing old final states. Resulting DFA accepts the same language as original NFA, but can have exponentially more states. “powerset construction” Q: Why doesn’t this work for PDAs?

21
Finite Automata: Review Note: The powerset construction generalizes the cross-product construction. Other, more general constructions are possible. EC: Let HALF(L)={v | v,w * |v|=|w| and vw L} Show that HALF preserves regularity. A two way FA can move its head backwards on the input: :Q Q {left,right} EC: Show that two-way FA are not more powerful than ordinary one-way FA. -transitions: Theorem: -transitions do not increase FA recognition power. Proof: Simulate -transitions FA without using -transitions. i.e., consider -transitions to be a form of non-determinism. qiqi qjqj qiqi qjqj One super-state!

22
The movie “Next” (2007) Based on the science fiction story “The Golden Man” by Philip Dick Premise: a man with the super power of non-determinism! At any given moment his reality branches into multiple directions, and he can choose the branch that he prefers! Transition function!

23
Regular Expressions: Review Regular expressions are defined recursively as follows: {}{} trivial language {x} x singleton language Ø empty set q0q0 Inductively, if R and S are regular expressions, then so are: q0q0 q0q0 q1q1 x (R+S) union RS concatenation R*R* Kleene closure Examples:aa(a+b) * bb(a+b) * b(a+b) * a(a+b) * Theorem: Any regular expression is accepted by some FA. M2M2 M1M1 M2M2 M1M1 M Compositions!

Similar presentations

OK

1/29/02CSE460 - MSU1 Nondeterminism-NFA Section 4.1 of Martin Textbook CSE460 – Computability & Formal Language Theory Comp. Science & Engineering Michigan.

1/29/02CSE460 - MSU1 Nondeterminism-NFA Section 4.1 of Martin Textbook CSE460 – Computability & Formal Language Theory Comp. Science & Engineering Michigan.

© 2017 SlidePlayer.com Inc.

All rights reserved.

Ads by Google

Ppt on earthquake disaster management Ppt on storage devices-recent trends Ppt on power grid failure in india 2012 full Download ppt on basic concepts of chemistry Ppt on areas related to circles class 10th Ppt on internet banking free download Ppt on event management system Ppt on types of forests found in india Ppt on railway track cross Ppt on diode family video