📄 2.2.2e.htm
字号:
<html>
<head>
<title>编译原理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link type="text/css" rel="stylesheet" href="../css/specification.css">
</head>
<BODY>
<table align=right width=300>
<tr>
<td>
<img src="../images/previous.gif" onmouseover="javascript:style.cursor='hand'" onclick="vbscript:window.location.href='2.2.2d.htm'" width="24" height="24"></img></td>
<td>
<img src="../images/next.gif" onmouseover="javascript:style.cursor='hand'" onclick="vbscript:window.location.href='2.2.2f.htm'" width="26" height="24"></img></td>
</tr>
</table>
<br><br>
<table><tr><td>    </td>
<td class="content">
<p>
如果存在一个直接推导序列:<br>
<center>α<sub>0</sub> <img src="IMG/equal.gif" width="19" height="13"></img> α<sub>1</sub>
<img src="IMG/equal.gif" width="19" height="13"></img> α<sub>2</sub>
<img src="IMG/equal.gif" width="19" height="13"></img> …
<img src="IMG/equal.gif" width="19" height="13"></img> α<sub>n</sub>(n>0) </center>
则我们称这个序列是一个从α<sub>0</sub>至α<sub>n</sub>的<font class="definition2">长度为n的推导</font>(简称推导)。或说α<sub>0</sub>可推导出α<sub>n</sub>,或α<sub>n</sub>可归约到α<sub>0</sub>。记作:
<center> α<sub>0</sub><img src="IMG/equaladd.gif" width="20" height="19">α<sub>n</sub> </center>
即α<sub>0</sub><img src="IMG/equaladd.gif" width="20" height="19">α<sub>n</sub>表示:从α<sub>0</sub>出发,经一步或若干步,可推导出α<sub>n</sub>。而用:
<center> α<sub>0</sub><img src="IMG/equalstar.gif" width="20" height="23">α<sub>n</sub> </center>
表示:从α<sub>0</sub>出发,经0步或若干步,可推导出α<sub>n</sub>。换言之,α<sub>0</sub><img src="IMG/equalstar.gif" width="20" height="23">α<sub>n</sub>意味着,或者α<sub>0</sub>=α<sub>n</sub>或者α<sub>0</sub><img src="IMG/equaladd.gif" width="20" height="19">α<sub>n</sub>。<br>
例如可从前面所得到的直接推导序列<br>
<center> E <img src="IMG/equal.gif" width="19" height="13"></img> E+T
<img src="IMG/equal.gif" width="19" height="13"></img> …
<img src="IMG/equal.gif" width="19" height="13"></img> a+a </center>
中看到:<br>
<center> E<img src="IMG/equaladd.gif" width="20" height="19">E+T </center>
是长度为1的推导。而 <br>
<center> E<img src="IMG/equaladd.gif" width="20" height="19">T+T </center>
是长度为2的推导。类似于此,<br>
<center> E<img src="IMG/equaladd.gif" width="20" height="19">a+a </center>
是长度为6的推导。
</p>
<p>
在图2.2中列出了上述推导中的每一个直接推导的详细情况。 <br><br>
<table align = center border = 1 width = 550 cellspacing="0" cellpadding="5">
<tr>
<td width=25% align=center>αAβ</td>
<td width=25% align=center>αγβ</td>
<td width=26% align=center>所用规则(产生式)</td>
<td width=12% align=center>α</td>
<td width=12% align=center>β</td>
</tr>
<tr>
<td align=center>E</td>
<td>  <img src="IMG/equal.gif" width="19" height="13"></img> E+T</td>
<td> E->E+T</td>
<td align=center>ε</td>
<td align=center>ε</td>
</tr>
<tr>
<td align=center>E+T</td>
<td>  <img src="IMG/equal.gif" width="19" height="13"></img> T+T</td>
<td> E->T</td>
<td align=center>ε</td>
<td align=center>+T</td>
</tr>
<tr>
<td align=center>T+T</td>
<td>  <img src="IMG/equal.gif" width="19" height="13"></img> F+T</td>
<td> T->F</td>
<td align=center>ε</td>
<td align=center>+T</td>
</tr>
<tr>
<td align=center>F+T</td>
<td>  <img src="IMG/equal.gif" width="19" height="13"></img> a+F</td>
<td> F->a</td>
<td align=center>ε</td>
<td align=center>+T</td>
</tr>
<tr>
<td align=center>a+T</td>
<td>  <img src="IMG/equal.gif" width="19" height="13"></img> a+F</td>
<td> T->F</td>
<td align=center>a+</td>
<td align=center>ε</td>
</tr>
<tr>
<td align=center>a+F</td>
<td>  <img src="IMG/equal.gif" width="19" height="13"></img> a+a</td>
<td> F->a</td>
<td align=center>a+</td>
<td align=center>ε</td>
</tr>
</table>
<center>图2.2 直接推导的例子</center>
</td></tr></table>
<br>
<table align=right width=300>
<tr>
<td>
<img src="../images/previous.gif" onmouseover="javascript:style.cursor='hand'" onclick="vbscript:window.location.href='2.2.2d.htm'" width="24" height="24"></img></td>
<td>
<img src="../images/next.gif" onmouseover="javascript:style.cursor='hand'" onclick="vbscript:window.location.href='2.2.2f.htm'" width="26" height="24"></img></td>
</tr>
</table>
</BODY>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -