example1 - Describing Regular Expressions CMSC 330:...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
1 CMSC 330: Organization of Programming Languages CMSC 330 2 Describing Regular Expressions a) 0(0|1)*0 All strings beginning and ending in 0 b) (( |0)1*)* All strings c) (0|1)*0(0|1)(0|1) All strings with 0 as third digit from right CMSC 330 3 Creating Regular Expressions For all strings of 0’s and 1’s that… a) Begin in 1 1(0|1)* b) End in 1 (0|1)*1 c) Contains 00 (0|1)*00(0|1)* d) Do not contain 00 (01|1)*( |0) CMSC 330 4 Creating NFA For all strings of 0’s and 1’s that… a) Begin in 1 b) End in 1 c) Contains 00 d) Do not contain 00 1 0,1 1 0 0 0,1 0 0,1 0,1 1 0 Based on regular expression CMSC 330 5 Creating DFA For all strings of 0’s and 1’s that… a) Begin in 1 b) End in 1 c) Contains 00 d) Do not contain 00 1 0 0,1 0 1 1 0 0 1 1 0,1 0 0 1 1 0,1 Swap final / non-final states! CMSC 330 6 a) Construct NFA b) Accept ababbab 7,5,1,2,6,8,7,5,3,4,6,8,7,5,1,2,6,8,7,5,3,4,6,8,7,5,3,4,6, 8,7,5,1,2,6,8,7,5,3,4,6,8 accept For RE (a | b )* a 3 4 b 1 2 5 6 7 8
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 CMSC 330 7 For RE (a | b )*
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/13/2012 for the course CMSC 330 taught by Professor Staff during the Fall '08 term at Maryland.

Page1 / 3

example1 - Describing Regular Expressions CMSC 330:...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online