260 likes | 375 Views
Erik Jonsson School of Engineering and Computer Science. CS 5349 – 0 01 CS 4384 - 001. Automata Theory. http://www.utdallas.edu/~pervin. Thursday: Sections 3.1-3.3. Tuesday 10-07-14. FEARLESS Engineering. EXAMINATION I. 2 October 2014.
E N D
Erik Jonsson School of Engineering and Computer Science CS 5349– 001 CS 4384 - 001 Automata Theory http://www.utdallas.edu/~pervin Thursday: Sections 3.1-3.3 Tuesday10-07-14 FEARLESS Engineering
EXAMINATION I 2 October 2014
We play against an opponent. Our goal is to win the game by establishing a contradiction to the PL, while the opponent tries to foil us. There are four moves in the game. • The opponent picks p. • Given p we pick a string s(p) in L of length ≥ p. • The opponent chooses the decomposition xyz subject to |xy| ≤ p, |y| ≥ 1. We have to assume that the opponent makes the choice that will make it harder for us to win the game. • We pick i so that the pumped string is not in L. The Pumping Lemma Game Don't forget! It will be on the comprehensive final exam!
Context-free Languages Chapter Three
A context-free grammar (CFG) G is a quadruple (V, Σ, R, S) where • V: a set of non-terminal symbols (Variables) • Σ: a set of terminals (V ∩ Σ = Ǿ) (Alphabet) • R: a set of rules (R: V → (V UΣ)*) • S: a start symbol (a variable) Definition Du, Lecture #11
If R: A → B, then xAy xBy and we say that xBy is derived from xAy using rule R. • If s ··· t, then we write s * t. • A string x in Σ* is generated by G=(V,Σ,R,S) if S * x. • L(G) = { x in Σ* | S * x}. How do we use rules?
G = ({S}, {0,1}. {S → 0S1 | ε }, S) • ε in L(G) because S ε . • 01 in L(G) because S 0S1 01. • 0011 in L(G) because S 0S1 00S11 0011. • 0 1 in L(G) because S * 0 1 . • L(G) = {0 1 | n > 0} n n n n n n Example
A context-free grammar is “context-free’’ because we can use a rule R no matter what the context. E.g., (M&S P.89, Def. 3.1.2) from the rule R: A -> w, we can derive from the string uAv in one step the string uwv, no matter what the context (that is, for any strings u and v). Context-free
For every regular language L, there exists a CFG G such that L=L(G). Theorem