精品文档
目录
P36-6 ...................................................................................................................................... 2 P36-7 ...................................................................................................................................... 2 P36-8 ...................................................................................................................................... 2 P36-9 ...................................................................................................................................... 3 P36-10 .................................................................................................................................... 3 P36-11 .................................................................................................................................... 3 P64–7 ................................................................................................................................... 4 P64–8 ................................................................................................................................... 5 P64–12 ................................................................................................................................. 5 P64–14 ................................................................................................................................. 7 P81–1 ................................................................................................................................... 8 P81–2 ................................................................................................................................... 9 P81–3 ................................................................................................................................. 12 P133–1 ............................................................................................................................... 12 P133–2 ............................................................................................................................... 12 P133–3 ............................................................................................................................... 14 P134–5 ............................................................................................................................... 15 P164–5 ............................................................................................................................... 19 P164–7 ............................................................................................................................... 19 P217–1 ............................................................................................................................... 19 P217–3 ............................................................................................................................... 20 P218–4 ............................................................................................................................... 20 P218–5 ............................................................................................................................... 21 P218–6 ............................................................................................................................... 22 P218–7 ............................................................................................................................... 22 P219–12 ............................................................................................................................. 22 P270–9 ............................................................................................................................... 24
.
精品文档
P36-6
(1)
L(G1)是0~9组成的数字串
(2)
最左推导:
N?ND?NDD?NDDD?DDDD?0DDD?01DD?012D?0127N?ND?DD?3D?34N?ND?NDD?DDD?5DD?56D?568
最右推导:
N?ND?N7?ND7?N27?ND27?N127?D127?0127N?ND?N4?D4?34N?ND?N8?ND8?N68?D68?568
P36-7
G(S)
O?1|3|5|7|9N?2|4|6|8|OD?0|NS?O|AOA?AD|N
P36-8
文法:
E?T|E?T|E?TT?F|T*F|T/F F?(E)|i最左推导:
E?E?T?T?T?F?T?i?T?i?T*F?i?F*F?i?i*F?i?i*iE?T?T*F?F*F?i*F?i*(E)?i*(E?T)?i*(T?T)?i*(F?T)?i*(i?T)?i*(i?F)?i*(i?i)最右推导:
E?E?T?E?T*F?E?T*i?E?F*i?E?i*i?T?i*i?F?i*i?i?i*iE?T?F*T?F*F?F*(E)?F*(E?T)?F*(E?F)?F*(E?i)?F*(T?i)?F*(F?i)?F*(i?i)?i*(i?i)语法树:/********************************
.
EE+TE+TFTFiFiii+i+i*****************/
P36-9
句子iiiei有两个语法树:
SS??iSeSiS??iiSeSiSei??iiSeiiiSei??iiieiiiiei
P36-10
/**************
S?TS|TT?(S)|( )
***************/
P36-11
/*************** L1:
S?ACA?aAb|ab C?cC|?L2:
S?ABA?aA|?
B?bBc|bcL3:
.
EE+TTT*FFFiiii-i-i精品文档
EE-TE-TFTFiFiii+i*i
精品文档
S?ABA?aAb|? B?aBb|?L4:
S?A|BA?0A1|? B?1B0|A***************/
第三章习题参考答案
P64–7
(1)
* 1(01|)101 X Y
0
1 ? ? 1 0 1 X 1 2 3 4 5
1 确定化:
{X} φ {1,2,3} {2,3} {2,3,4} {2,3,5} {2,3,4,Y} 0 φ φ {2,3} {2,3} {2,3,5} {2,3} {2,3,5} 1 {1,2,3} φ {2,3,4} {2,3,4} {2,3,4} Y {2,3,4,Y} {2,3,4,}
0
1 0 0 2 3
0 0 1 1 0 0 1 1 4 5 6 0 1 1 1 最小化:
.
精品文档
{0,1,2,3,4,5},{6}{0,1,2,3,4,5}0?{1,3,5} {0,1,2,3,4,5}1?{1,2,4,6}{0,1,2,3,4},{5},{6}{0,1,2,3,4}?{1,3,5}0{0,1,2,3},{4},{5},{6} {0,1,2,3}0?{1,3} {0,1,2,3}1?{1,2,4}{0,1},{2,3}{4},{5},{6}{0,1}?{1} {0,1}?{1,2}01{2,3}0?{3} {2,3}1?{4}{0},{1},{2,3},{4},{5},{6} 0
1 2 0
0 0 1 0 0 1 1 3 4 5 0 1 1 1
P64–8
(1)
(1|0)*01
(2)
(1|2|3|4|5|6|7|8|9)(0|1|2|3|4|5|6|7|8|9)*(0|5)|(0|5)
(3)
0*1(0|10*1)*|1*0(0|10*1)*
P64–12
(a)
a
a,b 0 a
确定化:
{0} {0,1} {1} .
1 a {0,1} {0,1} {0} b {1} {1} φ