Dept. of Computer Science & IT, FUUAST Theory of Computation 2 Regular Expressions Regular Expression
Dept. of Computer Science & IT, FUUAST Theory of Computation 3 Regular Expressions
Dept. of Computer Science & IT, FUUAST Theory of Computation 4 Precedence of Regular Expression Operators Regular Expressions
Dept. of Computer Science & IT, FUUAST Theory of Computation 5 Regular Expressions
Dept. of Computer Science & IT, FUUAST Theory of Computation 6 Write Regular expression for the following languages Represent the following sets by regular expression a){a,bc} b){1,11,111,1111,………..} c){ab, a, b, bb} d){b 2, b 5, b 8, ………….} e){a 2n+1 | n≥0} d) L 1 ={a 2n b 2m+1 | n≥0, m ≥0 } Regular Expressions
Dept. of Computer Science & IT, FUUAST Theory of Computation 7 Regular Expressions Identities:
Dept. of Computer Science & IT, FUUAST Theory of Computation 8 Regular Expressions
Dept. of Computer Science & IT, FUUAST Theory of Computation 9 Regular Expressions
Dept. of Computer Science & IT, FUUAST Theory of Computation 10 Regular Expressions
Dept. of Computer Science & IT, FUUAST Theory of Computation 11 Regular Expressions
Dept. of Computer Science & IT, FUUAST Theory of Computation 12 Regular Expressions Converting Regular Expressions to Automata R + S L(R) ⋃L(S) RS L(R)L(S)
Dept. of Computer Science & IT, FUUAST Theory of Computation 13 Regular Expressions R * L(R * ) Regular Expression to an є-NFA
Dept. of Computer Science & IT, FUUAST Theory of Computation 14 Regular Expressions Regular Expression to an є-NFA a) b)
Dept. of Computer Science & IT, FUUAST Theory of Computation 15 Regular Expressions c)
Dept. of Computer Science & IT, FUUAST Theory of Computation 16 Regular Expressions Closure properties of Regular Languages:
Dept. of Computer Science & IT, FUUAST Theory of Computation 17 Regular Expressions
Dept. of Computer Science & IT, FUUAST Theory of Computation 18 Regular Expressions
Dept. of Computer Science & IT, FUUAST Theory of Computation 19 Regular Expressions
Context-Free Languages Dept. of Computer Science & IT, FUUAST Theory of Computation 20 ( CFL )
Dept. of Computer Science & IT, FUUAST Theory of Computation 21 Context-Free Languages ( CFG )
Dept. of Computer Science & IT, FUUAST Theory of Computation 22 Context-Free Languages
Dept. of Computer Science & IT, FUUAST Theory of Computation 23 Context-Free Languages
Dept. of Computer Science & IT, FUUAST Theory of Computation 24 Context-Free Languages
Dept. of Computer Science & IT, FUUAST Theory of Computation 25 Context-Free Languages Rules:Productions: Derivation Symbols
Dept. of Computer Science & IT, FUUAST Theory of Computation 26 Context-Free Languages
Dept. of Computer Science & IT, FUUAST Theory of Computation 27 Context-Free Languages Derivation Symbols
Dept. of Computer Science & IT, FUUAST Theory of Computation 28 Context-Free Languages Language Of a Grammar
Dept. of Computer Science & IT, FUUAST Theory of Computation 29 Context-Free Languages
Dept. of Computer Science & IT, FUUAST Theory of Computation 30 Context-Free Languages
Dept. of Computer Science & IT, FUUAST Theory of Computation 31 Context-Free Languages Parse Trees
Dept. of Computer Science & IT, FUUAST Theory of Computation 32 Context-Free Languages Ambiguous Grammars
Dept. of Computer Science & IT, FUUAST Theory of Computation 33 Context-Free Languages Ambiguous Grammars
Dept. of Computer Science & IT, FUUAST Theory of Computation 34 Context-Free Languages
Dept. of Computer Science & IT, FUUAST Theory of Computation 35 Context-Free Languages Useless Productions G = (V,T,S,P) is Context-free Grammar with P, S → aSb | λ | A A → aA A is useful if there is at least one w L(G) such that S xAy w a)Empty Productions A → λ, A λ b)Unit Productions A → B, A B c)Left Recursion A → Ax
Dept. of Computer Science & IT, FUUAST Theory of Computation 36 Context-Free Languages
Dept. of Computer Science & IT, FUUAST Theory of Computation 37 Context-Free Languages
Dept. of Computer Science & IT, FUUAST Theory of Computation 38 Context-Free Languages Normal Forms 1)Chomsky Normal Forms 2)Greibach Normal Forms Chomsky Normal Forms (CNF) Any context-free language without any λ- production and unit production is generated by a grammar in which productions are of the form
Dept. of Computer Science & IT, FUUAST Theory of Computation 39 Context-Free Languages 2) 3)
END Dept. of Computer Science & IT, FUUAST Theory of Computation 40