1 / 29

第三章 词法分析

第三章 词法分析. 习题. 0. 1. 1. 0. 1. A. B. C. D. 1. E. 7. 构造下列正规式的 DFA. 7.1 1(0|1)*101. 0. E. 1. 1. 0. 1. A. B. C. D. 1. 确定化. 4. 已经最小化. 1. 1. 0. 1. 1. 0. 1. 0. 1. 2. 3. 0. 0. D. 0. 1. 0. C. E. ε. 1. 1. 0. A. B. 1. 1. F. 0. 0. I. G. H. 1.

ehren
Download Presentation

第三章 词法分析

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 第三章 词法分析 习题

  2. 0 1 1 0 1 A B C D 1 E 7. 构造下列正规式的DFA 7.1 1(0|1)*101

  3. 0 E 1 1 0 1 A B C D 1 确定化

  4. 4 已经最小化 1 1 0 1 1 0 1 0 1 2 3 0 0

  5. D 0 1 0 C E ε 1 1 0 A B 1 1 F 0 0 I G H 1 7.2 1(1010*|1(010)*1)*0

  6. 8. 给出下面正规表达式 (0|1)*01 (8.1) 以01结尾的二进制数串

  7. (8.2) 能被5整除的十进制整数非0打头 0|5|nd*(0|5) d = 0|1|2|…|9 n = 1|2|3|…|9

  8. (8.3) 包含 奇数个0 或 奇数个1的二进制数串 1*0(1|01*0)*| 0*1(0|10*1)*

  9. (8.4) 英文字母 组成的所有符号串, 要求符号串中的字母依照字典序 排列 (a|A)*(b|B)*…(z|Z)*

  10. (8.5) 没有重复出现的数字的数字符号串的全体 • 有限集合, 可以采用枚举方法

  11. (8.6) 最多有一个重复出现的数字 的数字符号串的全体

  12. a b ε 1 a b 3 2 (8.7) 不包含子串abb 的由a和b组成的符号串的全体 b*(a|ab)*

  13. a b ε 1 a a b b 3 a b 1 0 2 2 a 确定化 不包含 子串abb

  14. 0 0 0 1 0 A B C 1 D 1 9. 给出DFA及正规表达式 (9.1) {0,1} 上的含有子串010 的所有串 (0|1)*010(0|1)*

  15. 0 D 0 0 1 0 A B C 1 1 确定化

  16. 0 0 1 0 1 0 0 1 2 3 1 1 最小化 {0} {1} {2} {3,4,5}

  17. 1 0 0 1 1 B S A (9.2) {0,1} 上的 不含子串010的所有串 1*(0|111*)*1*

  18. 1 0 1 ε ε A B 1 ε C D 1 1 E 1*(0|111*)*1* 确定化

  19. 最小化 {0,1,2,3,4,5,6} {0,2,4,5,6} {1} {3}

  20. 1 0 0 1 1 3 0 1

  21. 补充: 所有不含子串011的01串 1*(01|0)*

  22. M : 人 W: 狼 S: 羊 C: 白菜 状态中间的横线代表河, 横线上下两侧字母分别表示北岸和南岸现有的人或物, 弧线上的字母表示正在过河的人和物 10. 狼, 山羊, 白菜

  23. MWC S MWSC WC MS M MS …

  24. W MCS MSW C MS MW MC S MWC MS WC MWC M MS S MWSC MW MC MSC W C MWS MS

  25. a a b a 0 0 1 0 2 b a b a 2 (12.a) 确定化和最小化 a a, b 1 a 确定化结果 最小化结果

  26. 1 0 (12.b) 确定化和最小化 b b 2 3 a b a a a b 5 4 a a b b

  27. 0 a a b b 2 3 a b 最小化 Π0: {0,1} {2,3,4,5} Π1: {0,1} {2,4} {3,5}

  28. 2 0 1 (0|10)* X 2 0 0 1 Y Y X X 1 ε ε 0 14. 构造DFA, 它接受Σ={0,1}上所有满足如下条件的字符串: 每个1都有0直接跟在右边

  29. 2 0 1 2 0 0 1 Y X X 1 ε ε 0 确定化 最小化

More Related