📄 2.1.3.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.1.2b.htm'"></img></td>
<td><img src="../images/next.gif" onmouseover="javascript:style.cursor='hand'" onclick="vbscript:window.location.href='2.1.3b.htm'"></img></td>
</tr>
</table><br><br>
<font class="title2"><b>2.1.3 语言</b></font>
<table><tr><td>    </td>
<td class="content">
<p>
<font class="definition3">字母表∑上的一个语言</font>是∑上的一些符号串的集合。这个定义几乎概括了关于语言的每个概念。C,Pascal以至英语都包括在这个定义之中。
</p>
<p>
空集Φ是一个语言,仅含有一个空符号串的集合{ε}也是一个语言。要注意Φ和{ε}是不同的语言。
</p>
<p>
我们可以进一步考虑定义在语言之上的几个重要运算。假设L和M表示两个语言。
</p>
<p>
1.<font class="definition3">语言L和M的合并(union)</font>,记作<font class="definition3">L∪M</font>,定义为:<br>
<center><font class="emphasize">L∪M={s|s is in L or s is in M}</font> </center>
此集合读作“<font class="emphasize2">所有属于L或属于M的符号串s所组成的集合</font>"。并请注意不要把运算符号∪与字母U相混。
</p>
<p>
2.<font class="definition3">语言L和M的连接(concatenation)</font>,记作<font class="definition3">LM</font>,定义为:<br>
<center><font class="emphasize">LM={st|s is in L and t is in M}</font></center>
此集合读作“<font class="emphasize2">满足s属于L和t属于M的所有符号串st所组成的集合</font>”。 因为对于任意符号串x总有εx=xε=x,所以有:<br>
<center>{ε}L=L{ε}=L </center>
注意,一般而言,LM≠ML,但(LM)W=L(MW)。L自身的n次连接记为:
<table align=center width=100>
<tr><td align=right>L<sup>n</sup>=LL…L</td></tr>
<tr><td align=right>n个 </td></tr></table>
并规定L<sup>0</sup>={ε}。
</p>
<p>
3. <font class="definition3">语言L的Kleene闭包</font>,记作<font class="definition3">L<sup>*</sup></font>,定义为:
<table align=center width=300 cellspacing="0" cellpadding="0" >
<tr ><td>     <font class="emphasize2"><sub>∞</sub></font> </td><tr>
<tr><td><font class="emphasize">L<sup>*</sup>=∪L<sup>i</sup>=L<sup>0</sup>∪L<sup>1</sup>∪L<sup>2</sup>∪L<sup>3</sup>∪… </font></td></tr>
<tr><td>     <font class="emphasize2"><sup>i=0</sup></font> </td><tr></table>
</p>
<p>
4.<font class="definition3">语言L的正闭包</font>,记作<font class="definition3">L<sup>+</sup></font>,定义为:
<table align=center width=300 cellspacing="0" cellpadding="0" >
<tr ><td>     <font class="emphasize2"><sub>∞</sub></font> </td><tr>
<tr><td><font class="emphasize">L<sup>+</sup>=∪L<sup>i</sup>=L<sup>1</sup>∪L<sup>2</sup>∪L<sup>3</sup>∪L<sup>4</sup>∪… </font></td></tr>
<tr><td>     <font class="emphasize2"><sup>i=1</sup></font> </td></tr></table>
</p>
<p>
以上运算是在语言上定义的,即它们对于某个字母表上的任何符号串集合都是适用的。
</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='2.1.2b.htm'"></img></td>
<td><img src="../images/next.gif" onmouseover="javascript:style.cursor='hand'" onclick="vbscript:window.location.href='2.1.3b.htm'"></img></td>
</tr>
</table>
</BODY>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -