📄 9.6.2a.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='9.6.1b.htm'" ></td>
<td>
<img src="../images/next.gif" onmouseover="javascript:style.cursor='hand'" onclick="vbscript:window.location.href='9.6.2ab.htm'" ></img></td>
</tr>
</table>
<br><br>
<font class="title2"><b>9.6.2 可用表达式(一)</b></font>
<table>
<tr>
<td>    </td>
<td class="content">
<p>
首先阐明几个概念:
</p>
<p>
1、 表达式x+y在点P<font class = "definition2">可用</font>:
</p>
<p>
如果从初始结点到P的每条路径上(不必是无环)都计算x+y,并且在最后一个这样的计算和P之间没有对x或y的赋值,则说表达式x+y在点P可用。
</p>
<p>
2、 基本块<font class = "definition2">注销</font>表达式x+y:
</p>
<p>
如果表达式x+y在基本快B的开始点是可用的,在基本块B中对x或y赋值(或可能赋值),并且随后没有重新计算x+y,则说基本块B注销表达式x+y。
</p>
<p>
3、 基本块<font class = "definition2">产生</font>表达式x+y:
</p>
<p>
如果在基本块B中计算表达式x+y,并且随后没有重新定义x或y,则说基本块B产生表达式x+y。
</p>
<p>
注意,可用表达式注销和产生的概念不完全和到达_定值的概念一样,然而,可用表达式的概念和到达_定值的概念遵守同样的规律。如果修改<a href="9.5.3_1.htm">图9.27(2)(a)</a>简单赋值语句的规则,那么,可以象9.5节那样精确地计算它们。
</p>
<p>
可用表达式的基本应用是寻找公共子表达式。例如:
</p>
<p><img src="images/9_31.gif" hspace="10">
</p>
</td>
</tr>
</table>
<p> </p>
<table align=right width=300>
<tr>
<td><img src="../images/previous.gif" onmouseover="javascript:style.cursor='hand'" onclick="vbscript:window.location.href='9.6.1b.htm'" ></td>
<td>
<img src="../images/next.gif" onmouseover="javascript:style.cursor='hand'" onclick="vbscript:window.location.href='9.6.2ab.htm'" ></img></td>
</tr>
</table>
</BODY>
<html><script language="JavaScript">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -