📄 9.7.7.1.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.5.htm'" ></td>
<td>
<img src="../images/next.gif" onmouseover="javascript:style.cursor='hand'" onclick="vbscript:window.location.href='9.7.7.1b.htm'" ></img></td>
</tr>
</table>
<br><br>
<font class="title2"><b>9.7.7.1 寻找归纳变量算法</b></font>
<table>
<tr>
<td>    </td>
<td class="content">
<p>
在循环中,若变量x值的每次改变都是增加或减少某个固定的常量,那么x叫做循环的<font class = "definition2">归纳变量</font>。经常,每执行一次循环,归纳变量增加同样的常量值,例如由for i:=1 to 10 开头的循环中的i。
</p>
<p>
归纳变量的一种常见情况是作为数组的下标,例如i,一些其它归纳变量,如t,它的值是i的线性函数,作为访问数组的实际偏移。i经常仅用于测试循环是否终止,可以用测试某个t代替对i的测试。
</p>
<p>
如果循环中对变量i只有唯一形如i:=i±c的赋值,其中c是常量,那么i是要找的循环的<font class = "definition2">基本归纳变量</font>。然后再寻找其它的归纳变量j,它仅在L中定值一次,并且其值是某个基本归纳变量的线性函数。
</p>
</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.5.htm'" ></td>
<td>
<img src="../images/next.gif" onmouseover="javascript:style.cursor='hand'" onclick="vbscript:window.location.href='9.7.7.1b.htm'" ></img></td>
</tr>
</table>
</BODY>
<html><script language="JavaScript">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -