📄 9.7.7.2.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.7.7.1c.htm'" ></td>
<td>
<img src="../images/next.gif" onmouseover="javascript:style.cursor='hand'" onclick="vbscript:window.location.href='9.7.7.2b.htm'" ></img></td>
</tr>
</table>
<br><br>
<font class="title2"><b>9.7.7.2 强度削弱用于归纳变量的算法</b></font>
<table>
<tr>
<td>    </td>
<td class="content">
<br>
<font class = "definition">算法9.12 强度削弱用于归纳变量 </font><br>
输入:循环L,附带到达_定值信息和算法9.11(寻找归纳变量)计算的<br>
      归纳变量族。 <br>
输出:强度削弱用于归纳变量后的循环。 <br>
方法:依次对循环的每个基本归纳变量i执行:<br>
     对i族的每个三元组为(i,c,d)的一般归纳变量j执行: <br>
     (1) 建新变量s,但如果变量j1和j2有同样的三元组,则仅建一个<br>
        新变量用于两者; <br>
     (2) 用j:=s代替j 的赋值; <br>
     (3) 在L中紧接在赋值语句i:=i+n的后面(n是常量)加上: <br>       s:=s+r <br>
      其中r=c*n,因为c和n是常量,所以c*n被计算为一个常量。把s<br>
        放入i族,三元组为(i,c,d)。 <br>
     (4) 还必须保证在循环的入口处s的初值为c*i+d,这个初始化工作<br>
        把下面<br>
           s:=c*i   /*如果c为1,则s:=i*/ <br>
           s:=s+d    /*如果d为0,则省略*/ <br>
      的赋值放在前置块的末尾。<br>
注意: s是i族的归纳变量。 </p>
</td>
</tr>
</table>
<p>
<table>
<tr>
<td><font class="yanshi">   观看演示 </font></td>
<td><font color=blue onmouseover="javascript:style.cursor='hand'" onclick="javascript:open('applet/9772/Page1.htm','_blank','menu=no,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no,left=100,top=100,width=800,height=600')">寻找归纳变量、强度削弱</font></td>
<td><img src="../images/yanshi.gif"></img></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='9.7.7.1c.htm'" ></td>
<td>
<img src="../images/next.gif" onmouseover="javascript:style.cursor='hand'" onclick="vbscript:window.location.href='9.7.7.2b.htm'" ></img></td>
</tr>
</table>
</BODY>
<html><script language="JavaScript">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -